Do not require droid-gcc any more to compile for Android

This commit is contained in:
Frank Denis 2013-12-31 16:06:19 +01:00
parent b5b250e0ba
commit b989d28925
2 changed files with 15 additions and 27 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ confdefs.h
config.*
configure
depcomp
android-toolchain
install-sh
libtool
libsodium.pc

View File

@ -1,12 +1,5 @@
#! /bin/sh
# Note that this script requires droid-wrapper
if [ x`which droid-gcc` = x ]; then
echo "This build script requires droid-wrapper."
echo https://github.com/jevinskie/droid-wrapper
exit 1
fi
if [ -z "$NDK_ROOT" ]; then
echo "You should probably set NDK_ROOT to the directory containing"
echo "the Android NDK"
@ -17,29 +10,23 @@ if [ ! -f ./configure ]; then
exit 1
fi
export CFLAGS="-Os -mthumb"
export DROID_HOST=darwin-x86
if uname -a | grep -q -i linux; then
export DROID_HOST=linux-x86
fi
export LDFLAGS="-mthumb"
export NDK_PLATFORM=9
export NDK_PLATFORM=${NDK_PLATFORM:-android-14}
export NDK_ROOT=${NDK_ROOT:-/usr/local/Cellar/android-ndk/9}
export NDK_ANDROID_SOURCES="${NDK_ROOT}/sources/android"
export TARGET_TOOLCHAIN_VERSION=4.6
export TARGET=arm-linux-androideabi
export NDK_TARGET="arm-linux-androideabi-${TARGET_TOOLCHAIN_VERSION}"
export AR=droid-ar
export AS=droid-as
export CC=droid-gcc
export LD=droid-ld
export NM=droid-nm
export OBJCOPY=droid-objcopy
export RANLIB=droid-ranlib
export STRIP=droid-strip
export TARGET_ARCH=arm
export TARGET="${TARGET_ARCH}-linux-androideabi"
export MAKE_TOOLCHAIN="${NDK_ROOT}/build/tools/make-standalone-toolchain.sh"
export PREFIX="$(pwd)/libsodium-android"
export TOOLCHAIN_DIR="$(pwd)/android-toolchain"
export PATH="${PATH}:${TOOLCHAIN_DIR}"
export CFLAGS="-Os -mthumb"
export LDFLAGS="-mthumb"
$MAKE_TOOLCHAIN --platform="$NDK_PLATFORM" --arch="$TARGET_ARCH" \
--install-dir="$TOOLCHAIN_DIR"
./configure --host=arm-linux-androideabi \
--with-sysroot="${TOOLCHAIN_DIR}/sysroot" \
--disable-pie \
--disable-shared \
--prefix="$PREFIX" && \