diff options
author | David 'Digit' Turner <digit@google.com> | 2009-05-27 14:20:44 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-05-27 16:04:25 +0200 |
commit | cf34139a6b3c59f36bfe09ce3299b4578c99073e (patch) | |
tree | 556cb74ddab5de2bc8b56b395e028edcd803cefd /build/tools | |
parent | 16417b521c8d1e673cbc0b998c5efd2217df8956 (diff) | |
download | ndk-cf34139a6b3c59f36bfe09ce3299b4578c99073e.tar.gz |
Force the use of 32-bit toolchain binaries on 64-bit systems.
This is used to reduce the number of distributable prebuilt packages
(i.e. linux-x86_64 is not needed anymore).
Also fix build/tools/build-toolchain.sh to properly copy the GPL and LGPL
license files into the generated prebuilt packages.
Also add a .gitignore files to get less spew from 'git status'
Diffstat (limited to 'build/tools')
-rwxr-xr-x | build/tools/build-toolchain.sh | 49 | ||||
-rwxr-xr-x | build/tools/make-release.sh | 2 |
2 files changed, 23 insertions, 28 deletions
diff --git a/build/tools/build-toolchain.sh b/build/tools/build-toolchain.sh index 75de8f973..42f727682 100755 --- a/build/tools/build-toolchain.sh +++ b/build/tools/build-toolchain.sh @@ -34,6 +34,7 @@ OPTION_HELP=no OPTION_PLATFORM= OPTION_FORCE_32=no OPTION_REBUILD=no + VERBOSE=no for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` @@ -73,9 +74,7 @@ for opt do done if [ $OPTION_HELP = "yes" ] ; then - echo "Collect files from an Android build tree and assembles a sysroot" - echo "suitable for building a standalone toolchain or be used by the" - echo "Android NDK." + echo "Rebuild the prebuilt binaries for the Android NDK toolchain." echo "" echo "options:" echo "" @@ -90,27 +89,14 @@ if [ $OPTION_HELP = "yes" ] ; then exit 0 fi -# some Linux platforms report 64-bit while they have a 32-bit userland -# so check that the compiler generates 32-bit binaries -# if it does, call force_32bit_binaries to change the value of $HOST_TAG -# -# note that this also changes HOST_CFLAGS and HOST_LDFLAGS, however, there -# is no way for the configure script in the toolchain to get these properly. -# -if [ $HOST_TAG = linux-x86_64 ] ; then - setup_toolchain - cat >$TMPC <<EOF -int main(void) -{ - return 0; -} -EOF - compile_exec_run - readelf -h $TMPE | grep -q -e "ELF32" - if [ $? = 0 ] ; then - force_32bit_binaries - fi -fi +# Force generation of 32-bit binaries on 64-bit systems +case $HOST_TAG in + *-x86_64) + HOST_CFLAGS="$HOST_CFLAGS -m32" + HOST_LDFLAGS="$HOST_LDFLAGS -m32" + force_32bit_binaries # to modify HOST_TAG and others + ;; +esac TMPLOG=/tmp/android-toolchain-build-$$.log rm -rf $TMPLOG @@ -305,6 +291,7 @@ download_package () echo "ERROR: Invalid MD5 Sum for $PACKAGE_TARBALL" echo " Expected $PKGSUM" echo " Computed $SUM" + echo "You might want to use the --force-download option." exit 2 fi @@ -378,7 +365,8 @@ if ! timestamp_check toolchain configure; then echo "Configure: toolchain build" mkdir -p $TOOLCHAIN_BUILD && cd $TOOLCHAIN_BUILD && - CFLAGS="$HOST_CFLAGS" LDFLAGS="$HOST_LDFLAGS" run \ + export CFLAGS="$HOST_CFLAGS" && + export LDFLAGS="$HOST_LDFLAGS" && run \ $TOOLCHAIN_SRC/configure --target=arm-eabi \ --disable-nls \ --prefix=$TOOLCHAIN_PREFIX \ @@ -394,9 +382,11 @@ fi # build the toolchain if ! timestamp_check toolchain build ; then - echo "Building : toolchain (this can take a long time)." + echo "Building : toolchain [this can take a long time]." cd $TOOLCHAIN_BUILD && - CFLAGS="$HOST_CFLAGS" LDFLAGS="$HOST_LDFLAGS" run make -j$JOBS + export CFLAGS="$HOST_CFLAGS" && + export LDFLAGS="$HOST_LDFLAGS" && + run make -j$JOBS if [ $? != 0 ] ; then echo "Error while building toolchain. See $TMPLOG" exit 1 @@ -414,8 +404,12 @@ if ! timestamp_check toolchain install ; then echo "Error while installing toolchain. See $TMPLOG" exit 1 fi + # don't forget to copy the GPL and LGPL license files + cp -f $TOOLCHAIN_SRC/COPYING $TOOLCHAIN_SRC/COPYING.LIB $TOOLCHAIN_PREFIX + # remove some unneeded files rm -f $TOOLCHAIN_PREFIX/bin/*-gccbug rm -rf $TOOLCHAIN_PREFIX/man $TOOLCHAIN_PREFIX/info + # strip binaries to reduce final package size strip $TOOLCHAIN_PREFIX/bin/* strip $TOOLCHAIN_PREFIX/arm-eabi/bin/* strip $TOOLCHAIN_PREFIX/libexec/gcc/*/*/cc1 @@ -431,6 +425,7 @@ if ! timestamp_check gdbserver configure; then mkdir -p $GDBSERVER_BUILD cd $GDBSERVER_BUILD && CFLAGS="-g -O2 -static -mandroid -I$ANDROID_SYSROOT/usr/include" \ + LDFLAGS= \ CC="$TOOLCHAIN_PREFIX/bin/arm-eabi-gcc" \ run $TOOLCHAIN_SRC/gdb-6.6/gdb/gdbserver/configure \ --host=arm-eabi-linux \ diff --git a/build/tools/make-release.sh b/build/tools/make-release.sh index b4ab459d7..a59912427 100755 --- a/build/tools/make-release.sh +++ b/build/tools/make-release.sh @@ -21,7 +21,7 @@ PREBUILT_DIR= PREBUILT_PREFIX=android-ndk-prebuilt-20090323 # the list of supported host development systems -PREBUILT_SYSTEMS="linux-x86 linux-x86_64 darwin-x86 windows" +PREBUILT_SYSTEMS="linux-x86 darwin-x86 windows" OPTION_HELP=no |