Search code examples
iphonecross-compilingopenssh

compiling OpenSSH for iPhone?


I'm trying to (cross-)compile obfuscated-openssh for the iPhone, and I'm running into some problems. I'm using this to configure the build:

./configure --host=arm-apple-darwin CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 \
CFLAGS="-arch armv6 -pipe -std=c99 -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include \
-L/Users/ben/iphonelib -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type \
-Wunused-variable -fmessage-length=0 -fvisibility=hidden \
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb \
-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" \
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp \
AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar

This doesn't work, though, complaining about not being able to find many header files, including netinet/in_systm.h and openssl/bn.h. Does anyone have any ideas as to how to make the build finish?


Solution

  • in_systm.h isn't available on iPhone. It only defines a few types, and the other pieces it includes are available. So you may be able to just copy the Mac version of the header into the build tree and point to it. ("locate in_systm.h" is a good way to find these kinds of things.)

    You may very well run into many more problems like this, but that's how to address in_systm.h.