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:
@@ -24,12 +24,21 @@ PROGNAME=`basename $0`
|
|||||||
# perform a tiny amount of sanity check
|
# perform a tiny amount of sanity check
|
||||||
#
|
#
|
||||||
if [ -z "$ANDROID_NDK_ROOT" ] ; then
|
if [ -z "$ANDROID_NDK_ROOT" ] ; then
|
||||||
if [ ! -f build/core/ndk-common.sh ] ; then
|
# Try to auto-detect the NDK root by walking up the directory
|
||||||
echo "Please define ANDROID_NDK_ROOT to point to the root of your"
|
# path to the current script.
|
||||||
echo "Android NDK installation."
|
PROGDIR=`dirname $0`
|
||||||
exit 1
|
while [ -n "1" ] ; do
|
||||||
fi
|
if [ -d $PROGDIR/build/core ] ; then
|
||||||
ANDROID_NDK_ROOT=.
|
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
|
fi
|
||||||
|
|
||||||
if [ ! -d $ANDROID_NDK_ROOT ] ; then
|
if [ ! -d $ANDROID_NDK_ROOT ] ; then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2009 The Android Open Source Project
|
# Copyright (C) 2009 The Android Open Source Project
|
||||||
#
|
#
|
||||||
@@ -51,37 +51,23 @@ add_config ()
|
|||||||
echo "$1" >> $config_mk
|
echo "$1" >> $config_mk
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Detecting host toolchain."
|
echo "Detecting host platform."
|
||||||
echo ""
|
|
||||||
|
|
||||||
force_32bit_binaries
|
force_32bit_binaries
|
||||||
setup_toolchain
|
|
||||||
|
|
||||||
create_config_mk
|
create_config_mk
|
||||||
|
|
||||||
add_config "HOST_OS := $HOST_OS"
|
add_config "HOST_OS := $HOST_OS"
|
||||||
add_config "HOST_ARCH := $HOST_ARCH"
|
add_config "HOST_ARCH := $HOST_ARCH"
|
||||||
add_config "HOST_TAG := $HOST_TAG"
|
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
|
## Check that the toolchains we need are installed
|
||||||
## Otherwise, instruct the user to download them from the web site
|
## Otherwise, instruct the user to download them from the web site
|
||||||
|
|
||||||
TOOLCHAINS=arm-eabi-4.2.1
|
TOOLCHAINS=arm-eabi-4.2.1
|
||||||
|
|
||||||
EXT=""
|
|
||||||
[ "Windows_NT" == "$OS" ] && EXT=".exe"
|
|
||||||
|
|
||||||
for tc in $TOOLCHAINS; do
|
for tc in $TOOLCHAINS; do
|
||||||
echo "Toolchain : Checking for $tc prebuilt binaries"
|
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`
|
COMPILERS=`ls $COMPILER_PATTERN 2> /dev/null`
|
||||||
if [ -z $COMPILERS ] ; then
|
if [ -z $COMPILERS ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
Android NDK ChangeLog:
|
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.
|
android-1.5_r1 released.
|
||||||
|
|||||||
Reference in New Issue
Block a user