交叉编译android版curl

交叉编译android版curl

1
2
3
4
1. curl 版本 7.47
2. OS: centos 6.7 32bit
3. android-ndk-r10e

  • 下载curl源代码文件,解压
1
2
3
4
unzip -x curl.zip
cd curl
./buildconf
-- 若出错,需要安装automake,autoconf, libtool三个依赖的工具
  • 下载android-ndk-r10e并安装, 假设安装在当前用户目录下
1
2
3
4
5
6
7
8
export CC="/home/user/android-ndk/toolchains/x86-4.8/prebuilt/linux-x86/bin/i686-linux-android-gcc --sysroot=/home/user/android-ndk/platforms/android-17/arch-x86"
./configure --host=x86
make
cd src
file curl
-- curl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
strip curl
--可以减少文件的体积
  • 编译成功.
    export CC=”/home/zhighest/android/android-ndk-r10b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc –sysroot=/home/zhighest/android/android-ndk-r10b/platforms/android-18/arch-arm”