我正在尝试编译适用于android的dahdi-linux-complete-2.10.2+2.10.2中的工具。
我已经使用下面的android_configure.sh文件完成了./configure。它是基于https://gist.github.com/nddrylliog/4688209的
#!/bin/sh
export ANDROID_SDK=/home/aks/android4.2
# I put all my dev stuff in herej
export DEV_PREFIX=${ANDROID_SDK}/development/
# Don't forget to adjust this to your NDK path
#export ANDROID_NDK=${DEV_PREFIX}/ndk/
export CROSS_COMPILE=arm-linux-androideabi
# I chose the gcc-4.7 toolchain - works fine for me##!
export ANDROID_PREFIX=${ANDROID_SDK}/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6
# Apparently android-8 works fine, there are other versions, look them up
export SYSROOT=${ANDROID_SDK}/prebuilts/ndk/8/platforms/android-9/arch-arm
#export CROSS_PATH=/home/androida20/a20_rbox/lichee/out/android/common/buildroot/external-toolchain/arm-linux-gnueabi/bin
# Non-exhaustive lists of compiler + binutils
# Depending on what you compile, you might need more binutils than that
export CPP=${CROSS_PATH}-cpp
export AR=${CROSS_PATH}-ar
export AS=${CROSS_PATH}-as
export NM=${CROSS_PATH}-nm
export CC=${CROSS_PATH}-gcc
export CXX=${CROSS_PATH}-g++
export LD=${CROSS_PATH}-ld
export RANLIB=${CROSS_PATH}-ranlib
# This is just an empty directory where I want the built objects to be installed
export PREFIX=${HOME}/android-prefix
# Don't mix up .pc files from your host and build target
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
# You can clone the full Android sources to get bionic if you want.. I didn't
# want to so I just got linker.h from here: http://gitorious.org/0xdroid/bionic
# Note that this was only required to build boehm-gc with dynamic linking support.
export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${ANDROID_SDK}/bionic"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} --sysroot=${SYSROOT} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib"
./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} --prefix=${PREFIX} --with-dahdi=../linux "$@"为了编译,我运行了以下命令
./android_configure.sh
makemake显示以下错误
error: cannot find -lpthread下面是make的最后一条错误消息
/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc --sysroot=/home/androida20/a20_rbox/android4.2/prebuilts/ndk/8/platforms/android-9/arch-arm -L/home/androida20/a20_rbox/android4.2/prebuilts/ndk/8/platforms/android-9/arch-arm/usr/lib -L/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/lib dahdi_cfg.o version.o libtonezone.a -lm -lpthread -o dahdi_cfg
/home/androida20/a20_rbox/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
collect2: ld returned 1 exit status
make: *** [dahdi_cfg] Error 1在这方面的任何帮助都是值得感谢的。提前感谢
发布于 2015-12-29 19:18:08
在android中它使用了bionic,它有自己的pthread实现,所以在从makefile中删除-lpthread之后,它就能够编译了。
https://stackoverflow.com/questions/34461246
复制相似问题