diff options
author | Anthony Blake <anthonix@me.com> | 2012-11-07 09:26:23 +1300 |
---|---|---|
committer | Anthony Blake <anthonix@me.com> | 2012-11-07 09:26:23 +1300 |
commit | 7cab17eac2144e557f98e545a27fa882e43da2de (patch) | |
tree | 5b9618f16943fd61a50854e7bf69dc135b61a666 /build_android.sh | |
parent | 07a46c66535ce0f50c2d4706335d2093868a1ee9 (diff) | |
download | ffts-7cab17eac2144e557f98e545a27fa882e43da2de.zip ffts-7cab17eac2144e557f98e545a27fa882e43da2de.tar.gz |
Fixed build scripts with patch from Tim Baverstock -- thanks Tim
Diffstat (limited to 'build_android.sh')
-rwxr-xr-x | build_android.sh | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/build_android.sh b/build_android.sh index 2e237fd..fba6b86 100755 --- a/build_android.sh +++ b/build_android.sh @@ -5,17 +5,51 @@ INSTALL_DIR="`pwd`/jni/ffts" -export PATH="$NDK_ROOT/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/:$PATH" -export SYS_ROOT="$NDK_ROOT/platforms/android-8/arch-arm/" -export CC="arm-linux-androideabi-gcc --sysroot=$SYS_ROOT" -export LD="arm-linux-androideabi-ld" -export AR="arm-linux-androideabi-ar" -export RANLIB="arm-linux-androideabi-ranlib" -export STRIP="arm-linux-androideabi-strip" +case $(uname -s) in + Darwin) + CONFBUILD=i386-apple-darwin10.8.0 + HOSTPLAT=darwin-x86 + ;; + Linux) + CONFBUILD=i386-unknown-linux + HOSTPLAT=linux-x86 + ;; + *) echo $0: Unknown platform; exit +esac + +case x86 in + arm) + TARGPLAT=arm-linux-androideabi + ARCH=arm + CONFTARG=arm-eabi + ;; + x86) + TARGPLAT=x86 + ARCH=x86 + CONFTARG=x86 + ;; + mips) + ## probably wrong + TARGPLAT=mipsel-linux-android + ARCH=mips + CONFTARG=mips + ;; + *) echo $0: Unknown target; exit +esac + +: ${NDK_ROOT:?} + +export PATH="$NDK_ROOT/toolchains/${TARGPLAT}-4.6/prebuilt/${HOSTPLAT}/bin/:$PATH" +export SYS_ROOT="$NDK_ROOT/platforms/android-9/arch-${ARCH}/" +export CC="${TARGPLAT}-gcc --sysroot=$SYS_ROOT" +export LD="${TARGPLAT}-ld" +export AR="${TARGPLAT}-ar" +export RANLIB="${TARGPLAT}-ranlib" +export STRIP="${TARGPLAT}-strip" export CFLAGS="-O3" mkdir -p $INSTALL_DIR -./configure --enable-neon --build=i386-apple-darwin10.8.0 --host=arm-eabi --prefix=$INSTALL_DIR LIBS="-lc -lgcc" +./configure --enable-neon --build=${CONFBUILD} --host=${CONFTARG} --prefix=$INSTALL_DIR LIBS="-lc -lgcc" make clean make |