编译OpenSSH for android时出错

时间:2015-08-20 10:08:40

标签: android linux android-ndk cross-compiling openssh

我正在尝试使用Android-NDK交叉编译OpenSSH for Android Plateform(Armv7)。为此,我按照以下帖子的说明进行了操作:Cross Compile OpenSSH for ARM

我用android等效替换“arm-linux-gnueabi-gcc”:“arm-linux-androideabi-gcc”。我设法编译了zlib和openssl,但是当谈到openssh时,事情变得更加复杂......

以下是我所做的:

export HOST=arm-linux-androideabi
./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm

之后我得到了以下输出:

configure: error: *** OpenSSL headers missing - please install first or check config.log ***

所以我通过这个修改了我的./configure:

./configure --host=$HOST --target=$HOST --prefix=$HOME/OpenSSH/opensshArm --with-ssl-dir=$HOME/OpenSSH/out/usr

其中$ HOME / out /是用于编译zlib和openssl的输出目录。

这就是我被困住的地方:我发布了“make”,这是输出:

make[1]: Entering directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
arm-linux-androideabi-gcc -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -fno-builtin-memset  -I. -I.. -I. -I./.. -I/home/test/OpenSSH/out/usr/include  -DHAVE_CONFIG_H -c bsd-arc4random.c
In file included from /home/test/OpenSSH/out/usr/include/openssl/crypto.h:120,
                 from /home/test/OpenSSH/out/usr/include/openssl/bn.h:133,
                 from ../buffer.h:49,
                 from ../entropy.h:30,
                 from ../includes.h:177,
                 from bsd-arc4random.c:17:
/home/test/toolchain/bin/../sysroot/usr/include/stdlib.h:168: error: expected identifier or '(' before numeric constant
make[1]: *** [bsd-arc4random.o] Error 1
make[1]: Leaving directory `/home/test/OpenSSH/openssh-6.4p1/openbsd-compat'
make: *** [openbsd-compat/libopenbsd-compat.a] Error 2

有帮助吗?

0 个答案:

没有答案