aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJing Yu <jingyu@google.com>2010-01-18 13:58:14 -0800
committerJing Yu <jingyu@google.com>2010-01-18 13:58:14 -0800
commit6b840b30d4cd5075704c9c625d2e12ef79ea082b (patch)
treee919c4d93eb5092a87756dba7553f7378057b601
parent1ac8971afc375b8d4ce9060c0dd93e255ac84535 (diff)
Add --with-mpc-version to the build script.
GCC-4.5.0 and up requires mpc library. File configure is generated from configure.ac by auto config.
-rw-r--r--Makefile.in28
-rw-r--r--README1
-rwxr-xr-xconfigure52
-rw-r--r--configure.ac24
4 files changed, 104 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 3edf459..2d0ac70 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,6 +49,7 @@ abs_builddir = @abs_builddir@
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@
PACKAGE_TO_SRCDIR:=@package_to_srcdir@
BUILD_ANDROID_GCC:=@BUILD_ANDROID_GCC@
GDB_TARGET:=@GDB_TARGET@
@@ -63,6 +64,7 @@ GCC_VERSION=gcc-@GCC_VERSION@
NEWLIB_VERSION=newlib-@NEWLIB_VERSION@
GMP_VERSION=gmp-@GMP_VERSION@
MPFR_VERSION=mpfr-@MPFR_VERSION@
+MPC_VERSION=mpc-@MPC_VERSION@
GDB_VERSION=gdb-@GDB_VERSION@
STAMP=touch
@@ -161,6 +163,12 @@ stmp-config-target-gcc: stmp-install-host-gmp stmp-install-host-mpfr
GCC_CONFIG_ARGS += --with-gmp=$(TEMP_INSTALLDIR) --with-mpfr=$(TEMP_INSTALLDIR)
endif
+# For gcc versions 4.5.0 and higher, mpc is required.
+ifeq ($(GCC_MIN_VERSION_4_5_0),yes)
+stmp-config-target-gcc: stmp-install-host-mpc
+GCC_CONFIG_ARGS += --with-mpc=$(TEMP_INSTALLDIR)
+endif
+
# Add Android specific gcc options.
# FIXME: These should be overridable by configure options.
@@ -286,6 +294,26 @@ stmp-install-host-mpfr: stmp-build-host-mpfr
$(STAMP) $@
install-host-mpfr: stmp-install-host-mpfr
+# host mpc rules
+.PHONY: config-host-mpc build-host-mpc install-host-mpc
+config-host-mpc: stmp-config-host-mpc
+MPC_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \
+ --host=${host} --build=${build}
+stmp-config-host-mpc: config.status
+ ([ -d ${MPC_VERSION} ] || \
+ mkdir ${MPC_VERSION}) && \
+ (cd ${MPC_VERSION} ; \
+ $(call find-package-srcdir, ${MPC_VERSION})/configure \
+ $(MPC_CONFIG_ARGS)) && \
+ $(STAMP) $@
+stmp-build-host-mpc: stmp-config-host-mpc
+ $(MAKE) -C ${MPC_VERSION} && $(STAMP) $@
+build-host-mpc: stmp-build-host-mpc
+stmp-install-host-mpc: stmp-build-host-mpc
+ $(MAKE) -C ${MPC_VERSION} install && \
+ $(STAMP) $@
+install-host-mpc: stmp-install-host-mpc
+
# target gdb rules
.PHONY: config-target-gdb build-target-gdb install-target-gdb
config-target-gdb: stmp-config-target-gdb
diff --git a/README b/README
index 93d251f..9d7dbf0 100644
--- a/README
+++ b/README
@@ -47,6 +47,7 @@ following options:
--with-newlib-version=<newlib version>
--with-gmp-version=<gmp version>
--with-mpfr-version=<mpfr version>
+ --with-mpc-version=<mpc version>
--with-gdb-version=<gdb version>
These are used to select the desired version of a particular GNU tool
diff --git a/configure b/configure
index 0d92cf6..d80c0f5 100755
--- a/configure
+++ b/configure
@@ -633,9 +633,11 @@ package_to_srcdir
BINUTILS_VERSION
GCC_VERSION
GCC_MIN_VERSION_4_3_0
+GCC_MIN_VERSION_4_5_0
NEWLIB_VERSION
GMP_VERSION
MPFR_VERSION
+MPC_VERSION
GDB_VERSION
LIBOBJS
LTLIBOBJS'
@@ -1233,6 +1235,8 @@ Optional Packages:
use gmp-VERSION (default is 4.2.2)
--with-mpfr-version=VERSION
use mpfr-VERSION (default is 2.3.0)
+ --with-mpc-version=VERSION
+ use mpc-VERSION (default is 0.8.1)
--with-gdb-version=VERSION
use gdb-VERSION (default is 6.6)
@@ -2103,12 +2107,20 @@ if test -f "${gcc_version_file}"; then
else
GCC_MIN_VERSION_4_3_0="no"
fi
+ if test "$GCC_MAJOR" -gt 4 -o \
+ \( "$GCC_MAJOR" -eq 4 -a "$GCC_MINOR" -ge 5 \) ; then
+ GCC_MIN_VERSION_4_5_0="yes"
+ else
+ GCC_MIN_VERSION_4_5_0="no"
+ fi
else
# No version file, assume it is trunk
GCC_MIN_VERSION_4_3_0="yes"
+ GCC_MIN_VERSION_4_5_0="yes"
fi
+
# newlib version (default is 1.16.0)
# newlib is only used for arm-newlib-eabi for testing
if test x$target == xarm-newlib-elf ; then
@@ -2216,6 +2228,42 @@ fi
+if test "$GCC_MIN_VERSION_4_5_0" == "yes"; then
+# mpc version (default is 0.8.1)
+# mpc is only used for gcc version higher than 4.5.0
+{ echo "$as_me:$LINENO: checking mpc version" >&5
+echo $ECHO_N "checking mpc version... $ECHO_C" >&6; }
+
+# Check whether --with-mpc-version was given.
+if test "${with_mpc_version+set}" = set; then
+ withval=$with_mpc_version; if test x"$withval" != x; then
+ MPC_VERSION="$withval"
+ fi
+else
+ MPC_VERSION="0.8.1"
+fi
+
+{ echo "$as_me:$LINENO: result: $MPC_VERSION" >&5
+echo "${ECHO_T}$MPC_VERSION" >&6; }
+x=mpc-${MPC_VERSION}; tool=${x%-*}; \
+if test ! -d $srcdir/../$tool/mpc-${MPC_VERSION} ; then
+ if test -f $srcdir/../$tool/mpc-${MPC_VERSION}.tar ; then
+ mkdir -p temp-src && tar -C temp-src -xf $srcdir/../$tool/mpc-${MPC_VERSION}.tar
+ elif test -f $srcdir/../$tool/mpc-${MPC_VERSION}.tar.gz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../$tool/mpc-${MPC_VERSION}.tar.gz
+ elif test -f $srcdir/../$tool/mpc-${MPC_VERSION}.tgz ; then
+ mkdir -p temp-src && tar -C temp-src -xzf $srcdir/../$tool/mpc-${MPC_VERSION}.tgz
+ elif test -f $srcdir/../$tool/mpc-${MPC_VERSION}.tar.bz2 ; then
+ mkdir -p temp-src && tar -C temp-src -xjf $srcdir/../$tool/mpc-${MPC_VERSION}.tar.bz2
+ else
+ { { echo "$as_me:$LINENO: error: 'package mpc-${MPC_VERSION} does not exist.'" >&5
+echo "$as_me: error: 'package mpc-${MPC_VERSION} does not exist.'" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+fi
+
+
# gdb version (default is 6.6)
{ echo "$as_me:$LINENO: checking target gdb version to build" >&5
echo $ECHO_N "checking target gdb version to build... $ECHO_C" >&6; }
@@ -2934,15 +2982,17 @@ package_to_srcdir!$package_to_srcdir$ac_delim
BINUTILS_VERSION!$BINUTILS_VERSION$ac_delim
GCC_VERSION!$GCC_VERSION$ac_delim
GCC_MIN_VERSION_4_3_0!$GCC_MIN_VERSION_4_3_0$ac_delim
+GCC_MIN_VERSION_4_5_0!$GCC_MIN_VERSION_4_5_0$ac_delim
NEWLIB_VERSION!$NEWLIB_VERSION$ac_delim
GMP_VERSION!$GMP_VERSION$ac_delim
MPFR_VERSION!$MPFR_VERSION$ac_delim
+MPC_VERSION!$MPC_VERSION$ac_delim
GDB_VERSION!$GDB_VERSION$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 65; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index d0d8ee3..4c892b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,11 +251,19 @@ if test -f "${gcc_version_file}"; then
else
GCC_MIN_VERSION_4_3_0="no"
fi
+ if test "$GCC_MAJOR" -gt 4 -o \
+ \( "$GCC_MAJOR" -eq 4 -a "$GCC_MINOR" -ge 5 \) ; then
+ GCC_MIN_VERSION_4_5_0="yes"
+ else
+ GCC_MIN_VERSION_4_5_0="no"
+ fi
else
# No version file, assume it is trunk
GCC_MIN_VERSION_4_3_0="yes"
+ GCC_MIN_VERSION_4_5_0="yes"
fi
AC_SUBST(GCC_MIN_VERSION_4_3_0)
+AC_SUBST(GCC_MIN_VERSION_4_5_0)
# newlib version (default is 1.16.0)
# newlib is only used for arm-newlib-eabi for testing
@@ -304,6 +312,22 @@ fi
AC_SUBST(GMP_VERSION)
AC_SUBST(MPFR_VERSION)
+if test "$GCC_MIN_VERSION_4_5_0" == "yes"; then
+# mpc version (default is 0.8.1)
+# mpc is only used for gcc version higher than 4.5.0
+AC_MSG_CHECKING([mpc version])
+AC_ARG_WITH([mpc-version],
+ [ --with-mpc-version=VERSION
+ use mpc-VERSION (default is 0.8.1)],
+ [if test x"$withval" != x; then
+ MPC_VERSION="$withval"
+ fi],
+[MPC_VERSION="0.8.1"])
+AC_MSG_RESULT($MPC_VERSION)
+ANDROID_CHECK_PACKAGE(mpc-${MPC_VERSION})
+fi
+AC_SUBST(MPC_VERSION)
+
# gdb version (default is 6.6)
AC_MSG_CHECKING([target gdb version to build])
AC_ARG_WITH([gdb-version],