Fix build/host-setup.sh in various ways

- run as bash script (since Debian's new 'dash' shell doesn't support it)
- remove obsolete host GCC requirement
- improve Windows support by using better heuristics for the executable suffix
- better NDK root directory auto-detection (avoids the need to define ANDROID_NDK_ROOT on some installs)
This commit is contained in:
David 'Digit' Turner
2009-06-29 12:28:04 +02:00
parent 6fe28b1f7f
commit fadee81099
3 changed files with 27 additions and 23 deletions

View File

@@ -24,12 +24,21 @@ PROGNAME=`basename $0`
# perform a tiny amount of sanity check
#
if [ -z "$ANDROID_NDK_ROOT" ] ; then
if [ ! -f build/core/ndk-common.sh ] ; then
echo "Please define ANDROID_NDK_ROOT to point to the root of your"
echo "Android NDK installation."
exit 1
fi
ANDROID_NDK_ROOT=.
# Try to auto-detect the NDK root by walking up the directory
# path to the current script.
PROGDIR=`dirname $0`
while [ -n "1" ] ; do
if [ -d $PROGDIR/build/core ] ; then
break
fi
if [ -z $PROGDIR -o $PROGDIR = '.' ] ; then
echo "Please define ANDROID_NDK_ROOT to point to the root of your"
echo "Android NDK installation."
exit 1
fi
PROGDIR=`dirname $PROGDIR`
done
ANDROID_NDK_ROOT=`cd $PROGDIR && pwd`
fi
if [ ! -d $ANDROID_NDK_ROOT ] ; then

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Copyright (C) 2009 The Android Open Source Project
#
@@ -51,37 +51,23 @@ add_config ()
echo "$1" >> $config_mk
}
echo "Detecting host toolchain."
echo ""
echo "Detecting host platform."
force_32bit_binaries
setup_toolchain
create_config_mk
add_config "HOST_OS := $HOST_OS"
add_config "HOST_ARCH := $HOST_ARCH"
add_config "HOST_TAG := $HOST_TAG"
add_config "HOST_CC := $CC"
add_config "HOST_CFLAGS := $CFLAGS"
add_config "HOST_CXX := $CXX"
add_config "HOST_CXXFLAGS := $CXXFLAGS"
add_config "HOST_LD := $LD"
add_config "HOST_LDFLAGS := $LDFLAGS"
add_config "HOST_AR := $AR"
add_config "HOST_ARFLAGS := $ARFLAGS"
## Check that the toolchains we need are installed
## Otherwise, instruct the user to download them from the web site
TOOLCHAINS=arm-eabi-4.2.1
EXT=""
[ "Windows_NT" == "$OS" ] && EXT=".exe"
for tc in $TOOLCHAINS; do
echo "Toolchain : Checking for $tc prebuilt binaries"
COMPILER_PATTERN=$ANDROID_NDK_ROOT/build/prebuilt/$HOST_TAG/$tc/bin/*-gcc${EXT}
COMPILER_PATTERN=$ANDROID_NDK_ROOT/build/prebuilt/$HOST_TAG/$tc/bin/*-gcc$HOST_EXE
COMPILERS=`ls $COMPILER_PATTERN 2> /dev/null`
if [ -z $COMPILERS ] ; then
echo ""

View File

@@ -1,4 +1,13 @@
Android NDK ChangeLog:
-------------------------------------------------------------------------------
current version
- Fix build/host-setup.sh to:
* execute as a bash script
* remove unused host gcc dependency
* improve Windows host auto-detection
-------------------------------------------------------------------------------
android-1.5_r1 released.