aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2012-02-15 16:03:22 -0800
committerJing Yu <jingyu@google.com>2012-02-15 16:03:22 -0800
commit5ef7fa6f214e96660a9b16343fea904831e5e6e2 (patch)
tree7d62daa2f912272934f58b25b5d8be2ef235d397
parent84b232badae3b50c749d37e81506ce2f3b0edefd (diff)
downloadbuild-5ef7fa6f214e96660a9b16343fea904831e5e6e2.tar.gz
Update build scripts
1) support build of gdb-7.3 2) disable libitm for Android toolchain 3) stop building target libsupc++.a for ARM Change-Id: I01dab62925892e3d804e698b05c52e0be8c382d5
-rw-r--r--Makefile.in52
-rwxr-xr-xconfigure135
-rw-r--r--configure.ac59
3 files changed, 213 insertions, 33 deletions
diff --git a/Makefile.in b/Makefile.in
index 7b6716b..ea3bd2d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -56,9 +56,10 @@ TOPLEVEL_CONFIGURE_ARGUMENTS:=@TOPLEVEL_CONFIGURE_ARGUMENTS@
baseargs = @baseargs@
GCC_MIN_VERSION_4_3_0:=@GCC_MIN_VERSION_4_3_0@
GCC_MIN_VERSION_4_5_0:=@GCC_MIN_VERSION_4_5_0@
-ENABLE_GRAPHITE:=@ENABLE_GRAPHITE@
+GDB_MIN_VERSION_7_2:=@GDB_MIN_VERSION_7_2@
BINUTILS_MIN_VERSION_2_21:=@BINUTILS_MIN_VERSION_2_21@
GOLD_MIN_VERSION_2_21:=@GOLD_MIN_VERSION_2_21@
+ENABLE_GRAPHITE:=@ENABLE_GRAPHITE@
PACKAGE_TO_SRCDIR:=@package_to_srcdir@
BUILD_ANDROID_GCC:=@BUILD_ANDROID_GCC@
GDB_TARGET:=@GDB_TARGET@
@@ -78,11 +79,13 @@ MPC_VERSION=mpc-@MPC_VERSION@
PPL_VERSION=ppl-@PPL_VERSION@
CLOOG_VERSION=cloog-@CLOOG_VERSION@
GDB_VERSION=gdb-@GDB_VERSION@
+EXPAT_VERSION=expat-@EXPAT_VERSION@
HAVE_MPC=@have_mpc@
HAVE_MPFR=@have_mpfr@
HAVE_GMP=@have_gmp@
HAVE_PPL=@have_ppl@
HAVE_CLOOG=@have_cloog@
+HAVE_EXPAT=@have_expat@
ENABLE_GOLD=@enable_gold@
STAMP=touch
@@ -110,6 +113,10 @@ ifeq ($(HAVE_CLOOG), no)
CLOOG_DIR=$(TEMP_INSTALLDIR)
endif
+ifeq ($(HAVE_EXPAT),no)
+ EXPAT_DIR=$(TEMP_INSTALLDIR)
+endif
+
# Figure out where to find the ld binary.
FIND_TARGET_LD=\
`[ -d $(TARGET_BINUTILS_BUILDDIR)/gold ] && echo "gold" || echo "ld"`
@@ -417,12 +424,11 @@ endif
# Target indenpendent Android gcc options.
-# For now we build a static version of libsupc++.
ifeq ($(BUILD_ANDROID_GCC),yes)
GCC_CONFIG_ARGS += $(GCC_CONFIG_LIBSTDCXX_V3) --disable-libssp \
--enable-threads --disable-nls --disable-libmudflap --disable-libgomp \
- --disable-sjlj-exceptions --disable-shared \
- --disable-tls
+ --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared \
+ --disable-tls --disable-libitm
CFLAGS_FOR_TARGET += -DTARGET_POSIX_IO -fno-short-enums
# ARM specific options.
@@ -430,16 +436,9 @@ ifeq ($(target_cpu),arm)
GCC_CONFIG_ARGS += --with-float=soft --with-fpu=vfp --with-arch=armv5te \
--enable-target-optspace
-# Experimental: build libsupc++.a for ARM.
-GCC_CONFIG_ARGS += --disable-hosted-libstdcxx \
- --enable-cxx-flags="-fexceptions -frtti"
-
ifneq ($(target_os),linux-androideabi)
GCC_CONFIG_ARGS += --with-abi=aapcs
endif
-
-else
-GCC_CONFIG_ARGS += --disable-libstdc__-v3
endif
endif
@@ -671,6 +670,31 @@ stmp-install-host-cloog: stmp-build-host-cloog
$(STAMP) $@
install-host-cloog: stmp-install-host-cloog
+# host expat rules
+.PHONY: config-host-expat build-host-expat install-host-expat
+config-host-expat: stmp-config-host-expat
+EXPAT_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \
+ --host=${cur_host} --build=${cur_build}
+stmp-config-host-expat: config.status $(canadian_stmp)
+ ([ -d ${EXPAT_VERSION} ] || \
+ mkdir ${EXPAT_VERSION}) && \
+ ($(canadian_env) \
+ cd ${EXPAT_VERSION} ; \
+ $(call find-package-srcdir, ${EXPAT_VERSION})/configure \
+ $(EXPAT_CONFIG_ARGS)) && \
+ $(STAMP) $@
+stmp-build-host-expat: stmp-config-host-expat
+ ($(canadian_env) \
+ $(MAKE) -C ${EXPAT_VERSION}) && $(STAMP) $@
+build-host-expat: stmp_build-host-expat
+ifeq ($(HAVE_EXPAT),no)
+stmp-install-host-expat: stmp-build-host-expat
+ $(MAKE) -C ${EXPAT_VERSION} install -j1 && $(STAMP) $@
+else
+stmp-install-host-expat:
+endif
+install-host-expat: stmp-install-host-expat
+
# target gdb rules
.PHONY: config-target-gdb build-target-gdb install-target-gdb
ifeq ($(GDB_VERSION),gdb-none)
@@ -684,6 +708,12 @@ GDB_CONFIG_ARGS=$(baseargs) --prefix=$(prefix) \
--target=$(GDB_TARGET) --host=${cur_host} --build=${cur_build} \
--disable-nls
+# For gdb versions 7.2 and higher, expat is required.
+ifeq ($(GDB_MIN_VERSION_7_2),yes)
+stmp-config-target-gdb: stmp-install-host-expat
+GDB_CONFIG_ARGS += --with-expat --with-libexpat-prefix=$(EXPAT_DIR)
+endif
+
stmp-config-target-gdb: config.status $(canadian_stmp)
([ -d ${GDB_VERSION} ] || \
mkdir ${GDB_VERSION}) && \
diff --git a/configure b/configure
index 8c276b4..e7c02f8 100755
--- a/configure
+++ b/configure
@@ -1,12 +1,10 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for android-tools 2.0.
-#
+# Generated by GNU Autoconf 2.64 for android-tools 2.0.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
-#
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
+# Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -525,8 +523,7 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
+exec 7<&0 </dev/null 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -555,12 +552,15 @@ PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
+have_expat
have_cloog
have_ppl
have_gmp
have_mpfr
have_mpc
sysroot
+EXPAT_VERSION
+GDB_MIN_VERSION_7_2
GDB_VERSION
CLOOG_VERSION
PPL_VERSION
@@ -650,12 +650,14 @@ with_mpc_version
with_ppl_version
with_cloog_version
with_gdb_version
+with_expat_version
with_sysroot
with_mpc
with_mpfr
with_gmp
with_ppl
with_cloog
+with_expat
'
ac_precious_vars='build_alias
host_alias
@@ -1305,6 +1307,8 @@ Optional Packages:
use cloog-VERSION (default is 0.15.9)
--with-gdb-version=VERSION
use gdb-VERSION (default is 6.6)
+ --with-expat-version=VERSION
+ use expat-VERSION (default is 2.0.1)
--with-sysroot=DIR
use target sysroot in DIR
--with-mpc=PATH
@@ -1317,6 +1321,8 @@ Optional Packages:
specify prefix directory for the installed PPL package.
--with-cloog=PATH
specify prefix directory for the installed CLooG package.
+ --with-expat=PATH
+ specify prefix directory for the installed EXPAT package.
Report bugs to the package provider.
_ACEOF
@@ -1382,7 +1388,7 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
android-tools configure 2.0
-generated by GNU Autoconf 2.65
+generated by GNU Autoconf 2.64
Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1399,7 +1405,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by android-tools $as_me 2.0, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.64. Invocation command line was
$ $0 $@
@@ -1652,7 +1658,7 @@ fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ if test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
@@ -1661,9 +1667,9 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
@@ -2703,6 +2709,78 @@ if test \( ! -d $srcdir/../$tool/gdb-${GDB_VERSION} \) -a \( x"$version" != x"no
fi
fi
+# figure out if we need to build expat for gdb 7.2+
+gdb_version_file="${srcdir}/../gdb/gdb-${GDB_VERSION}/gdb/version.in"
+if test -f "${gdb_version_file}"; then
+ GDB_MAJOR=`head -n 1 $gdb_version_file | sed -e "s/[^0-9].*//"`
+ GDB_MINOR=`head -n 1 $gdb_version_file | \
+ sed -e "s/^[0-9]*\.//" -e "s/[^0-9].*//"`
+ if test "$GDB_MAJOR" -gt 7 -o \
+ \( "$GDB_MAJOR" -eq 7 -a "$GDB_MINOR" -ge 2 \) ; then
+ GDB_MIN_VERSION_7_2="yes"
+ else
+ GDB_MIN_VERSION_7_2="no"
+ fi
+else
+ # No version file, assume it is trunk
+ GDB_MIN_VERSION_7_2="yes"
+fi
+
+
+if test "$GDB_MIN_VERSION_7_2" == "yes"; then
+# expat version (default is 2.0.1)
+# expat is only used for gdb version higher than 7.2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking expat version" >&5
+$as_echo_n "checking expat version... " >&6; }
+
+# Check whether --with-expat-version was given.
+if test "${with_expat_version+set}" = set; then :
+ withval=$with_expat_version; if test x"$withval" != x ; then
+ EXPAT_VERSION="$withval"
+ fi
+else
+ EXPAT_VERSION="2.0.1"
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPAT_VERSION" >&5
+$as_echo "$EXPAT_VERSION" >&6; }
+x=expat-${EXPAT_VERSION}; tool=$(echo "$x" | sed -e 's/-.*//'); version=$(echo "$x" | sed -e 's/[^-]*-//'); \
+if test \( ! -d $srcdir/../$tool/expat-${EXPAT_VERSION} \) -a \( x"$version" != x"none" \) ; then
+ if test -f $srcdir/../$tool/expat-${EXPAT_VERSION}.tar ; then
+ mkdir -p temp-src && tar -C temp-src -xf $srcdir/../$tool/expat-${EXPAT_VERSION}.tar
+ elif test -f $srcdir/../$tool/expat-${EXPAT_VERSION}.tar.gz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../$tool/expat-${EXPAT_VERSION}.tar.gz
+ elif test -f $srcdir/../$tool/expat-${EXPAT_VERSION}.tgz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../$tool/expat-${EXPAT_VERSION}.tgz
+ elif test -f $srcdir/../$tool/expat-${EXPAT_VERSION}.tar.bz2 ; then
+ mkdir -p temp-src && tar -C temp-src -xjf $srcdir/../$tool/expat-${EXPAT_VERSION}.tar.bz2
+ elif test -f $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar ; then
+ mkdir -p temp-src && tar -C temp-src -xf $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar
+ elif test -f $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar.gz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar.gz
+ elif test -f $srcdir/../tarballs/expat-${EXPAT_VERSION}.tgz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../tarballs/expat-${EXPAT_VERSION}.tgz
+ elif test -f $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar.bz2 ; then
+ mkdir -p temp-src && tar -C temp-src -xjf $srcdir/../tarballs/expat-${EXPAT_VERSION}.tar.bz2
+ else
+ as_fn_error "'package expat-${EXPAT_VERSION} does not exist.'" "$LINENO" 5
+ fi
+fi
+fi
+
+
+# For certain targets, with gdb 7.2+, the proper gdb target is
+# arm-linux-android.
+if test "$GDB_MIN_VERSION_7_2" == "yes"; then
+case $target in
+ arm-unknown-linux-androideabi | arm-unknown-eabi)
+ GDB_TARGET=arm-linux-android
+ ;;
+ *)
+ ;;
+esac
+fi
+
# Sysroot location
# Check whether --with-sysroot was given.
@@ -2816,6 +2894,23 @@ fi
+# Specify a location for expat
+
+# Check whether --with-expat was given.
+if test "${with_expat+set}" = set; then :
+ withval=$with_expat; if test -d "$withval" ; then
+ have_expat="$withval"
+ elif test x"$withval" != x"no"; then
+ as_fn_error "invalid value for --with-expat" "$LINENO" 5
+ else
+ have_expat=no
+ fi
+else
+ have_expat=no
+fi
+
+
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -3358,7 +3453,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by android-tools $as_me 2.0, which was
-generated by GNU Autoconf 2.65. Invocation command line was
+generated by GNU Autoconf 2.64. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -3393,7 +3488,6 @@ Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
@@ -3408,11 +3502,10 @@ Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
android-tools config.status 2.0
-configured by $0, generated by GNU Autoconf 2.65,
- with options \\"\$ac_cs_config\\"
+configured by $0, generated by GNU Autoconf 2.64,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
@@ -3448,8 +3541,6 @@ do
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
@@ -3617,7 +3708,7 @@ s/'"$ac_delim"'$//
t delim
:nl
h
-s/\(.\{148\}\)..*/\1/
+s/\(.\{148\}\).*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
@@ -3631,7 +3722,7 @@ s/.\{148\}//
t nl
:delim
h
-s/\(.\{148\}\)..*/\1/
+s/\(.\{148\}\).*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
diff --git a/configure.ac b/configure.ac
index 95d2c9a..b4d56bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -481,6 +481,52 @@ AC_MSG_RESULT($GDB_VERSION)
AC_SUBST(GDB_VERSION)
ANDROID_CHECK_PACKAGE(gdb-${GDB_VERSION})
+# figure out if we need to build expat for gdb 7.2+
+gdb_version_file="${srcdir}/../gdb/gdb-${GDB_VERSION}/gdb/version.in"
+if test -f "${gdb_version_file}"; then
+ GDB_MAJOR=`head -n 1 $gdb_version_file | sed -e "s/[[^0-9]].*//"`
+ GDB_MINOR=`head -n 1 $gdb_version_file | \
+ sed -e "s/^[[0-9]]*\.//" -e "s/[[^0-9]].*//"`
+ if test "$GDB_MAJOR" -gt 7 -o \
+ \( "$GDB_MAJOR" -eq 7 -a "$GDB_MINOR" -ge 2 \) ; then
+ GDB_MIN_VERSION_7_2="yes"
+ else
+ GDB_MIN_VERSION_7_2="no"
+ fi
+else
+ # No version file, assume it is trunk
+ GDB_MIN_VERSION_7_2="yes"
+fi
+AC_SUBST(GDB_MIN_VERSION_7_2)
+
+if test "$GDB_MIN_VERSION_7_2" == "yes"; then
+# expat version (default is 2.0.1)
+# expat is only used for gdb version higher than 7.2
+AC_MSG_CHECKING([expat version])
+AC_ARG_WITH([expat-version],
+ [ --with-expat-version=VERSION
+ use expat-VERSION (default is 2.0.1)],
+ [if test x"$withval" != x ; then
+ EXPAT_VERSION="$withval"
+ fi],
+[EXPAT_VERSION="2.0.1"])
+AC_MSG_RESULT($EXPAT_VERSION)
+ANDROID_CHECK_PACKAGE(expat-${EXPAT_VERSION})
+fi
+AC_SUBST(EXPAT_VERSION)
+
+# For certain targets, with gdb 7.2+, the proper gdb target is
+# arm-linux-android.
+if test "$GDB_MIN_VERSION_7_2" == "yes"; then
+case $target in
+ arm-unknown-linux-androideabi | arm-unknown-eabi)
+ GDB_TARGET=arm-linux-android
+ ;;
+ *)
+ ;;
+esac
+fi
+
# Sysroot location
AC_ARG_WITH([sysroot],
[ --with-sysroot=DIR
@@ -571,4 +617,17 @@ AC_ARG_WITH(cloog, [ --with-cloog=PATH
[have_cloog=no])
AC_SUBST(have_cloog)
+# Specify a location for expat
+AC_ARG_WITH(expat, [ --with-expat=PATH
+ specify prefix directory for the installed EXPAT package.],
+ [if test -d "$withval" ; then
+ have_expat="$withval"
+ elif test x"$withval" != x"no"; then
+ AC_MSG_ERROR(invalid value for --with-expat)
+ else
+ have_expat=no
+ fi],
+ [have_expat=no])
+AC_SUBST(have_expat)
+
AC_OUTPUT