Skip to content

Instantly share code, notes, and snippets.

@MewX
Last active April 23, 2018 04:57
Show Gist options
  • Save MewX/b05abb86194ea932b8f1 to your computer and use it in GitHub Desktop.
Save MewX/b05abb86194ea932b8f1 to your computer and use it in GitHub Desktop.
Build LuaJIT for android-ndk-r10e under Cygwin

Build LuaJIT for android-ndk-r10e under Cygwin

This post is to make libs for armeabi, armeabi-v7a, x86 and mips instruction sets.

But the official tutorial is not clear in Windows platform, and the version is too old. So I just write them down.

To begin with, you should have already installed Cygwin32, and change the path to your own path first!

And, a key point is too add TARGET_SYS=Linux when in Windows platform.

** Notice: It's very hard to build the lib on Cygwin64! So, please remember to install Cygwin32! **

armeabi

export NDK=D:/Android/android-ndk-r10e
export NDKABI=14
export NDKVER=$NDK/toolchains/arm-linux-androideabi-4.9
export NDKP=$NDKVER/prebuilt/windows-x86_64/bin/arm-linux-androideabi-
export NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET_SYS=Linux clean default

armeabi-v7a

export NDK=D:/Android/android-ndk-r10e
export NDKABI=14
export NDKVER=$NDK/toolchains/arm-linux-androideabi-4.9
export NDKP=$NDKVER/prebuilt/windows-x86_64/bin/arm-linux-androideabi-
export NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"
export NDKARCH="-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF $NDKARCH" TARGET_SYS=Linux clean default

x86

export NDK=D:/Android/android-ndk-r10e
export NDKABI=14
export NDKVER=$NDK/toolchains/x86-4.9
export NDKP=$NDKVER/prebuilt/windows-x86_64/bin/i686-linux-android-
export NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-x86"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET_SYS=Linux clean default

mips

export NDK=D:/Android/android-ndk-r10e
export NDKABI=14
export NDKVER=$NDK/toolchains/mipsel-linux-android-4.9
export NDKP=$NDKVER/prebuilt/windows-x86_64/bin/mipsel-linux-android-
export NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-mips"
make HOST_CC="gcc -m32" CROSS=$NDKP TARGET_FLAGS="$NDKF" TARGET_SYS=Linux clean default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment