Skip to content

Instantly share code, notes, and snippets.

@arielm
Created January 29, 2015 22:03
Show Gist options
  • Save arielm/ca170b7c96200e713c73 to your computer and use it in GitHub Desktop.
Save arielm/ca170b7c96200e713c73 to your computer and use it in GitHub Desktop.
The path for this file should be: mozjs-31.2.0/js/src/build-android
#!/bin/sh
if [ -z $NDK_ROOT ]; then
echo "NDK_ROOT MUST BE DEFINED!"
echo "e.g. export NDK_ROOT=$HOME/android-ndk"
exit -1
fi
host_kernel=$(uname -s | tr "[:upper:]" "[:lower:]")
host_arch=$(uname -m)
cpus=$(sysctl hw.ncpu | awk '{print $2}')
TARGET=arm-linux-androideabi
TARGET_ARCH=armv7-a
GCC_VERSION=4.8
TOOLCHAIN=$NDK_ROOT/toolchains/${TARGET}-${GCC_VERSION}/prebuilt/${host_kernel}-${host_arch}
###
rm -rf dist
rm -f ./config.cache
../configure --with-android-ndk=$NDK_ROOT \
--with-android-toolchain=$TOOLCHAIN \
--with-android-version=9 \
--with-android-gnu-compiler-version=${GCC_VERSION} \
--with-arch=${TARGET_ARCH} \
--target=${TARGET} \
--enable-android-libstdcxx \
--disable-shared-js --disable-tests --without-intl-api \
--disable-debug --enable-strip --enable-install-strip \
--disable-threadsafe \
--enable-exact-rooting --enable-gcgenerational
make -j$cpus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment