diff options
author | Luse Cheng <luse@0xlab.org> | 2011-03-15 11:59:00 +0800 |
---|---|---|
committer | Luse Cheng <luse@0xlab.org> | 2011-03-15 12:10:00 +0800 |
commit | f0b83e28a379308a3d803c77ec7ad7c10ae12932 (patch) | |
tree | 3272d01882992960f7f5631d32154f5640cf7334 | |
parent | 96d55f8d22db989b1a82e984c0040ba7df12a9f9 (diff) | |
download | build-f0b83e28a379308a3d803c77ec7ad7c10ae12932.tar.gz |
Allow build with prebuilt directory for gmp, mpfr and mpc.
Change-Id: I436736db24477e261575ee267d126f44cac35627
-rw-r--r-- | Makefile.in | 44 | ||||
-rwxr-xr-x | configure | 71 | ||||
-rw-r--r-- | configure.ac | 42 |
3 files changed, 143 insertions, 14 deletions
diff --git a/Makefile.in b/Makefile.in index 22f6b3d..85114ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -68,12 +68,27 @@ GMP_VERSION=gmp-@GMP_VERSION@ MPFR_VERSION=mpfr-@MPFR_VERSION@ MPC_VERSION=mpc-@MPC_VERSION@ GDB_VERSION=gdb-@GDB_VERSION@ +HAVE_MPC=@have_mpc@ +HAVE_MPFR=@have_mpfr@ +HAVE_GMP=@have_gmp@ STAMP=touch TARGET_BINUTILS_BUILDDIR=$(abs_builddir)/$(BINUTILS_VERSION) TARGET_GCC_BUILDDIR=$(abs_builddir)/$(GCC_VERSION) TEMP_INSTALLDIR=$(abs_builddir)/temp-install +ifeq ($(HAVE_MPC),no) + MPC_DIR=$(TEMP_INSTALLDIR) +endif + +ifeq ($(HAVE_MPFR),no) + MPFR_DIR=$(TEMP_INSTALLDIR) +endif + +ifeq ($(HAVE_GMP),no) + GMP_DIR=$(TEMP_INSTALLDIR) +endif + # Figure out where to find the ld binary. FIND_TARGET_LD=\ `[ -d $(TARGET_BINUTILS_BUILDDIR)/gold ] && echo "gold" || echo "ld"` @@ -317,13 +332,13 @@ GCC_CONFIG_ARGS=--prefix=$(prefix) \ # Also build libgcc is a seperate sub-target in 4.3.0+. ifeq ($(GCC_MIN_VERSION_4_3_0),yes) stmp-config-target-gcc: stmp-install-host-gmp stmp-install-host-mpfr -GCC_CONFIG_ARGS += --with-gmp=$(TEMP_INSTALLDIR) --with-mpfr=$(TEMP_INSTALLDIR) +GCC_CONFIG_ARGS += --with-gmp=$(GMP_DIR) --with-mpfr=$(MPFR_DIR) 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) +GCC_CONFIG_ARGS += --with-mpc=$(MPC_DIR) endif # Add Android specific gcc options. @@ -441,10 +456,11 @@ stmp-build-host-gmp: stmp-config-host-gmp $(MAKE) -C ${GMP_VERSION}) && $(STAMP) $@ build-host-gmp: stmp-build-host-gmp # Need -j1 to avoid a race condition in building on OS X. +ifeq ($(HAVE_GMP),no) stmp-install-host-gmp: stmp-build-host-gmp - ($(canadian_env) \ - $(MAKE) -C ${GMP_VERSION} install -j1) && \ - $(STAMP) $@ +else +stmp-install-host-gmp: +endif install-host-gmp: stmp-install-host-gmp # host mpfr rules @@ -452,7 +468,7 @@ install-host-gmp: stmp-install-host-gmp config-host-mpfr: stmp-config-host-mpfr MPFR_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \ --host=${cur_host} --build=${cur_build} \ - --with-gmp=$(TEMP_INSTALLDIR) + --with-gmp=$(GMP_DIR) stmp-config-host-mpfr: config.status stmp-install-host-gmp ([ -d ${MPFR_VERSION} ] || \ mkdir ${MPFR_VERSION}) && \ @@ -465,10 +481,11 @@ stmp-build-host-mpfr: stmp-config-host-mpfr ($(canadian_env) \ $(MAKE) -C ${MPFR_VERSION}) && $(STAMP) $@ build-host-mpfr: stmp-build-host-mpfr +ifeq ($(HAVE_MPFR),no) stmp-install-host-mpfr: stmp-build-host-mpfr - ($(canadian_env) \ - $(MAKE) -C ${MPFR_VERSION} install) && \ - $(STAMP) $@ +else +stmp-install-host-mpfr: +endif install-host-mpfr: stmp-install-host-mpfr # host mpc rules @@ -476,7 +493,7 @@ install-host-mpfr: stmp-install-host-mpfr config-host-mpc: stmp-config-host-mpc MPC_CONFIG_ARGS=$(baseargs) --prefix=$(TEMP_INSTALLDIR) --disable-shared \ --host=${cur_host} --build=${cur_build} \ - --with-gmp=$(TEMP_INSTALLDIR) --with-mpfr=$(TEMP_INSTALLDIR) + --with-gmp=$(GMP_DIR) --with-mpfr=$(MPFR_DIR) stmp-config-host-mpc: config.status stmp-install-host-gmp stmp-install-host-mpfr ([ -d ${MPC_VERSION} ] || \ mkdir ${MPC_VERSION}) && \ @@ -489,10 +506,11 @@ stmp-build-host-mpc: stmp-config-host-mpc ($(canadian_env) \ $(MAKE) -C ${MPC_VERSION}) && $(STAMP) $@ build-host-mpc: stmp-build-host-mpc +ifeq ($(HAVE_MPC),no) stmp-install-host-mpc: stmp-build-host-mpc - ($(canadian_env) \ - $(MAKE) -C ${MPC_VERSION} install) && \ - $(STAMP) $@ +else +stmp-install-host-mpc: +endif install-host-mpc: stmp-install-host-mpc # target gdb rules @@ -271,7 +271,7 @@ PACKAGE_VERSION='2.0' PACKAGE_STRING='android-tools 2.0' PACKAGE_BUGREPORT='' -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os BUILD_ANDROID_GCC GDB_TARGET TOPLEVEL_CONFIGURE_ARGUMENTS baseargs gold_baseargs package_to_srcdir BINUTILS_VERSION GOLD_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 sysroot LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os BUILD_ANDROID_GCC GDB_TARGET TOPLEVEL_CONFIGURE_ARGUMENTS baseargs gold_baseargs package_to_srcdir BINUTILS_VERSION GOLD_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 sysroot have_mpc have_mpfr have_gmp LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -812,6 +812,12 @@ Optional Packages: use gdb-VERSION (default is 6.6) --with-sysroot=DIR use target sysroot in DIR + --with-mpc=PATH + specify prefix directory for installed MPC package. + --with-mpfr=PATH + specify prefix directory for installed MPFR package. + --with-gmp=PATH + specify prefix directory for the installed GMP package. _ACEOF fi @@ -1974,6 +1980,66 @@ echo "$as_me: error: 'Target sysroot is not set for canadian cross build'" >&2;} fi; +# Specify a location for mpc + +# Check whether --with-mpc or --without-mpc was given. +if test "${with_mpc+set}" = set; then + withval="$with_mpc" + if test -d "$withval" ; then + have_mpc="$withval" + have_mpfr="$withval" + have_gmp="$withval" + elif test x"$withval" != x"no"; then + { { echo "$as_me:$LINENO: error: invalid value for --with-mpc" >&5 +echo "$as_me: error: invalid value for --with-mpc" >&2;} + { (exit 1); exit 1; }; } + else + have_mpc=no + fi +else + have_mpc=no +fi; + + +# Specify a location for mpfr + +# Check whether --with-mpfr or --without-mpfr was given. +if test "${with_mpfr+set}" = set; then + withval="$with_mpfr" + if test -d "$withval" ; then + have_mpfr="$withval" + have_gmp="$withval" + elif test x"$withval" != x"no"; then + { { echo "$as_me:$LINENO: error: invalid value for --with-mpfr" >&5 +echo "$as_me: error: invalid value for --with-mpfr" >&2;} + { (exit 1); exit 1; }; } + else + have_mpfr=no + fi +else + have_mpfr=no +fi; + + +# Specify a location for gmp + +# Check whether --with-gmp or --without-gmp was given. +if test "${with_gmp+set}" = set; then + withval="$with_gmp" + if test -d "$withval" ; then + have_gmp="$withval" + elif test x"$withval" != x"no"; then + { { echo "$as_me:$LINENO: error: invalid value for --with-gmp" >&5 +echo "$as_me: error: invalid value for --with-gmp" >&2;} + { (exit 1); exit 1; }; } + else + have_gmp=no + fi +else + have_gmp=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 @@ -2637,6 +2703,9 @@ s,@MPFR_VERSION@,$MPFR_VERSION,;t t s,@MPC_VERSION@,$MPC_VERSION,;t t s,@GDB_VERSION@,$GDB_VERSION,;t t s,@sysroot@,$sysroot,;t t +s,@have_mpc@,$have_mpc,;t t +s,@have_mpfr@,$have_mpfr,;t t +s,@have_gmp@,$have_gmp,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/configure.ac b/configure.ac index 4fc90ef..fba2a3c 100644 --- a/configure.ac +++ b/configure.ac @@ -399,4 +399,46 @@ AC_ARG_WITH([sysroot], fi]) AC_SUBST(sysroot) +# Specify a location for mpc +AC_ARG_WITH(mpc, [ --with-mpc=PATH + specify prefix directory for installed MPC package.], + [if test -d "$withval" ; then + have_mpc="$withval" + have_mpfr="$withval" + have_gmp="$withval" + elif test x"$withval" != x"no"; then + AC_MSG_ERROR(invalid value for --with-mpc) + else + have_mpc=no + fi], + [have_mpc=no]) +AC_SUBST(have_mpc) + +# Specify a location for mpfr +AC_ARG_WITH(mpfr, [ --with-mpfr=PATH + specify prefix directory for installed MPFR package.], + [if test -d "$withval" ; then + have_mpfr="$withval" + have_gmp="$withval" + elif test x"$withval" != x"no"; then + AC_MSG_ERROR(invalid value for --with-mpfr) + else + have_mpfr=no + fi], + [have_mpfr=no]) +AC_SUBST(have_mpfr) + +# Specify a location for gmp +AC_ARG_WITH(gmp, [ --with-gmp=PATH + specify prefix directory for the installed GMP package.], + [if test -d "$withval" ; then + have_gmp="$withval" + elif test x"$withval" != x"no"; then + AC_MSG_ERROR(invalid value for --with-gmp) + else + have_gmp=no + fi], + [have_gmp=no]) +AC_SUBST(have_gmp) + AC_OUTPUT |