Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 965
Sophie Alpert Avatar asked Aug 20 '09 22:08

Sophie Alpert


2 Answers

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.

like image 168
Rob Napier Avatar answered Sep 23 '22 07:09

Rob Napier


Openssh depends on the openssl libraries. You'll probably need to build that first.

I recently had to add ssh support to an embedded system and used Dropbear. It was a lot easier to get up and running than openssh. It gave us scp, ssh, and sshd support with a 300k executable. Supposedly, for ssh only you can get it down to ~110K.

like image 21
Devon_C_Miller Avatar answered Sep 22 '22 07:09

Devon_C_Miller