问题描述
我试图交叉编译的在下列方式的android
I am trying to cross compile Linux PAM for android in the following way
`#!/bin/sh
# Linux-PAM/build.sh
INSTALL_DIR="`pwd`/out"
export
PATH="android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin:$PATH"
export CROSS_COMPILER="$PATH:android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin"
export SYS_ROOT="android/prebuilts/ndk/current/platforms/android-9/arch-arm"
export CC="arm-linux-androideabi-gcc --sysroot=$SYS_ROOT"
export LD="arm-linux-androideabi-ld"
export AR="arm-linux-androideabi-ar"
export RANLIB="arm-linux-androideabi-ranlib"
export STRIP="arm-linux-androideabi-strip"
mkdir -p $INSTALL_DIR
./configure --host=arm-eabi --build=x86_64 --enable-shared --prefix=$INSTALL_DIR LIBS="-lc -lgcc"
make
make install`
输出使静态建库。我想共享库。如果我编译的Linux,它建立在默认情况下共享库。但为Android将静态基础之上。该文件的config.log具有以下
The output gives statically built libraries. I want shared libraries. If I compile for linux, it builds shared library by default. But for Android it builds statically. The config.log file has following
configure:3581: arm-linux-androideabi-gcc --sysroot=android/prebuilts/ndk/current/platforms/android-9/arch-arm -v >&5
Using built-in specs.
COLLECT_GCC=arm-linux-androideabi-gcc
COLLECT_LTO_WRAPPER=android/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../libexec/gcc/arm-linux-androideabi/4.6.x-google/lto-wrapper
Target: arm-linux-androideabi
Configured with: /tmp/android-8532/src/build/../gcc/gcc-4.6/configure --prefix=/usr/local --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/tmp/android-8532/obj/temp-install --with-mpfr=/tmp/android-8532/obj/temp-install --with-mpc=/tmp/android-8532/obj/temp-install --without-ppl --without-cloog --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --with-gcc-version=4.6 --with-binutils-version=2.21 --with-gmp-version=4.2.4 --with-mpfr-version=2.4.1 --with-gdb-version=7.3.x --with-arch=armv5te --with-sysroot=/tmp/android-8532/install/sysroot --with-prefix=/tmp/android-8532/install --with-gold-version=2.21 --enable-gold --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default
....
configure:10632: checking if libtool supports shared libraries
configure:10634: result: no
configure:10637: checking whether to build shared libraries
configure:10658: result: no
这是怎么回事了?
What is going wrong?
推荐答案
我已经在命令行类似的问题交叉编译为Android。 iOS版也快乐。见中的Autoconf的邮件名单。
I've had similar problems cross-compiling for Android from the command line. iOS is fun, too. See How To Configure for Android? on the Autoconf mailing list.
我相信主机
不正确。尝试:
./configure --build=`./config.guess` --host=arm ...
或
./configure --build=`./config.guess` --host=arm-linux-androideabi ...
如果这不是它,你可以从发布的config.log
全部结果(完全与共享对象的测试,而不是整个文件)。
If that's not it, can you post the full results from config.log
(full relating to the shared object tests, not the whole file).
抱歉,我不能再帮你。我想我的MacBook(其设立为Android开发人员),但这里的Linux-PAM-1.1.8的交叉编译我的结果是:
Sorry I can't help you further. I'm trying the cross-compile of Linux-PAM-1.1.8 on my MacBook (its set up for Android dev), but here's my result:
In file included from pam_modutil_private.h:14:0,
from pam_audit.c:12:
./include/security/pam_modutil.h:53:20: fatal error: shadow.h: No such file or directory
compilation terminated.
make[2]: *** [pam_audit.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
$ pwd
/Users/jwalton/Linux-PAM-1.1.8
$ find . -iname shadow.h
$
这篇关于Linux的帕姆创建静态库,而不是共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!