Skip to content

Instantly share code, notes, and snippets.

@EarlOfEgo
Last active November 2, 2021 10:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save EarlOfEgo/6881748 to your computer and use it in GitHub Desktop.
Save EarlOfEgo/6881748 to your computer and use it in GitHub Desktop.
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
make
@fredhurui
Copy link

where is the glob.c?

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