2019年10月2日 / kirito / 0 Comments
- Build openssl:
export ANDROID_HOME=/mnt/data/android
export TOOLCHAIN=$ANDROID_HOME/toolchain
export CROSS_SYSROOT=$TOOLCHAIN/sysroot
export PATH=$TOOLCHAIN/bin:$PATH
export TOOL=arm-linux-androideabi
export CC=$TOOLCHAIN/bin/${TOOL}-gcc
export CXX=$TOOLCHAIN/bin/${TOOL}-g++
export LINK=${CXX}
export LD=$TOOLCHAIN/bin/${TOOL}-ld
export AR=$TOOLCHAIN/bin/${TOOL}-ar
export RANLIB=$TOOLCHAIN/bin/${TOOL}-ranlib
export STRIP=$TOOLCHAIN/bin/${TOOL}-strip
export ARCH_FLAGS="-mthumb"
export ARCH_LINK=
export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"
export CXXFLAGS="${CFLAGS} -frtti -fexceptions"
export LDFLAGS="${ARCH_LINK}"
export ARCH_FLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16"
export CFLAGS="${ARCH_FLAGS} -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-strict-aliasing -finline-limit=64"
export ARCH_LINK="-march=armv7-a -Wl,--fix-cortex-a8"
export LDFLAGS="${ARCH_LINK}"
./Configure android \
--prefix=$TOOLCHAIN/sysroot/usr/local \
--with-zlib-include=$TOOLCHAIN/sysroot/usr/include \
--with-zlib-lib=$TOOLCHAIN/sysroot/usr/lib \
zlib \
no-asm \
no-shared \
no-unit-test
make
make install
- Build nghttp2
export CPPFLAGS="-fPIE -I$TOOLCHAIN/sysroot/usr/include"
export LDFLAGS="-fPIE -pie -I$TOOLCHAIN/sysroot/usr/lib"
export PKG_CONFIG_LIBDIR=$TOOLCHAIN/lib/pkgconfig
cd nghttp2
autoreconf -i
./configure --enable-lib-only \
--host=arm-linux-androideabi \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
--disable-shared \
--prefix="$TOOLCHAIN/sysroot/usr/local"
make
make install
- Build curl: You should add LOCAL_CFLAGS += -fPIE to Android.mk
./configure --prefix=$TOOLCHAIN/sysroot/usr/local \
--with-sysroot=$TOOLCHAIN/sysroot \
--host=arm-linux-androideabi \
--with-ssl=$TOOLCHAIN/sysroot/usr/local \
--with-nghttp2=$TOOLCHAIN/sysroot/usr/local \
--enable-ipv6 \
--enable-static \
--enable-threaded-resolver \
--disable-dict \
--disable-gopher \
--disable-ldap --disable-ldaps \
--disable-manual \
--disable-pop3 --disable-smtp --disable-imap \
--disable-rtsp \
--disable-shared \
--disable-smb \
--disable-telnet \
--disable-verbose
make install
Categories default
2019年10月1日 / kirito / 0 Comments
- Install the prerequisites:
brew install freetype fribidi nasm pkg-config libtool
- Run command glibtoolize, otherwise you will get the error: Libtool library used but 'LIBTOOL' is undefined
- Do the common build process:
./autogen.sh
./configure --prefix=/outdirectory
make
make install
Categories default