Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shell script to build libxml2 for Android with the NDK. The NDK is stored in /home/USER/Tools/android-ndk-r9/ this has to be adjusted.
export CROSS_COMPILE="arm-linux-androideabi"
export CC="${CROSS_COMPILE}-gcc"
export CXX="${CROSS_COMPILE}-g++"
export NDK="${HOME}/Tools/android-ndk-r9"
export SYSROOT="$NDK/platforms/android-14/arch-arm"
export PATH="$PATH:$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin"
export CPPFLAGS="--sysroot=${SYSROOT}"
export CFLAGS="--sysroot=${SYSROOT} -I."
$CC -c -I${SYSROOT}/usr/include/ -I. glob.c
chmod +x glob.o
export LIBS="${PWD}/glob.o"
export LDFLAGS="-L/usr/lib/"
./configure --build=X86_64-unknown-linux-gnu --host=${CROSS_COMPILE} --target=${CROSS_COMPILE} --without-python --enable-static --disable-shared
Copy link

fredhurui commented Nov 2, 2021

where is the glob.c?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment