1、下载
libosip2-5.0.0.tar.gz
libexosip2-5.0.0.tar.gz
2、编译 osip
tar -zxvf libosip2-5.0.0.tar.gz
cd libosip2-5.0.0
编辑脚本 build.sh 如下:
export NDK_ROOT=/opt/android-ndk-r14b export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 export PLATFORM=$NDK_ROOT/platforms/android-9 export CC=$PREBUILT/bin/arm-linux-androideabi-gcc export AR=$PREBUILT/bin/arm-linux-androideabi-ar export RANLIB=$PREBUILT/bin/arm-linux-androideabi-ranlib export STRIP=$PREBUILT/bin/arm-linux-androideabi-strip export CFLAGS="--sysroot=$PLATFORM/arch-arm -DHAVE_TIME_H -DHAVE_FCNTL_H -DHAVE_SYS_SELECT_H -fPIC -DOSIP_MT -DENABLE_TRACE -mfpu=neon -mfloat-abi=softfp -I$PLATFORM/arch-arm/usr/include" export LDFLAGS="-Wl,-rpath-link=$PLATFORM/arch-arm/usr/lib -L$PLATFORM/arch-arm/usr/lib -nostdlib "
./configure --host=arm --disable-shared --enable-static --enable-pthread=force --prefix=/home/zbs/
make && make install
3、编译 exosip
tar -zxvf libexosip2-5.0.0.tar.gz
cd libexosip2-5.0.0
编辑脚本 build.sh 如下:
export NDK_ROOT=/opt/android-ndk-r14b export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 export PLATFORM=$NDK_ROOT/platforms/android-9 export CC=$PREBUILT/bin/arm-linux-androideabi-gcc export AR=$PREBUILT/bin/arm-linux-androideabi-ar export RANLIB=$PREBUILT/bin/arm-linux-androideabi-ranlib export STRIP=$PREBUILT/bin/arm-linux-androideabi-strip export CFLAGS="--sysroot=$PLATFORM/arch-arm -DANDROID -DHAVE_TIME_H -DHAVE_FCNTL_H -DHAVE_SYS_SELECT_H -fPIC -DOSIP_MT -DENABLE_TRACE -mfpu=neon -mfloat-abi=softfp -I$PLATFORM/arch-arm/usr/include " export LDFLAGS=" -Wl,-rpath-link=$PLATFORM/arch-arm/usr/lib -L$PLATFORM/arch-arm/usr/lib -nostdlib -lgcc -lc -lm -dl" export OSIP_CFLAGS="-I/home/zbs/include " export OSIP_LIBS="-L/home/zbs/lib -losip2 -losipparser2 " ./configure --host=arm-linux --enable-pthread=force --disable-shared --enable-static --prefix=/home/zbs/
make && make install
4 、编译报错别紧张
如上图的错误都可以解决
把 你的NDK路径/android-ndk-r14b/platforms/android-21/arch-arm/usr/include/arpa 下面的所有头文件复杂到 你的NDK路径/android-ndk-r14b/platforms/android-9/arch-arm/usr/include/arpa 下
cp /opt/android-ndk-r14b/platforms/android-21/arch-arm/usr/include/arpa/*.h /opt/android-ndk-r14b/platforms/android-9/arch-arm/usr/include/arpa/*.h
然后重新编译就OK了