# HG changeset patch # User "Yann E. MORIN" # Date 1243275746 0 # Node ID b23f3c2e0c732677cce16fbb3ba7c9d509954f1d # Parent 46658e3fc78193a8a3940f36a1b1446a0d8d17b4 /devel/gcc-4.4: - add support for building the MPC library. -------- diffstat follows -------- /devel/gcc-4.4/scripts/build/companion_libs/ppl.sh | 4 2 2 0 +- /devel/gcc-4.4/scripts/build/companion_libs/mpc.sh | 57 57 0 0 ++++++++++++++++++++++++++++++++++ /devel/gcc-4.4/scripts/build/companion_libs/cloog.sh | 4 2 2 0 +- /devel/gcc-4.4/scripts/crosstool-NG.sh.in | 3 3 0 0 ++ /devel/gcc-4.4/steps.mk | 1 1 0 0 + /devel/gcc-4.4/config/companion_libs/mpc.in | 32 32 0 0 +++++++++++++++++++ /devel/gcc-4.4/config/companion_libs.in | 15 10 5 0 ++++++--- 7 files changed, 107 insertions(+), 9 deletions(-) diff -r 46658e3fc781 -r b23f3c2e0c73 config/companion_libs.in --- a/config/companion_libs.in Mon May 25 17:26:21 2009 +0000 +++ b/config/companion_libs.in Mon May 25 18:22:26 2009 +0000 @@ -36,20 +36,25 @@ source config/companion_libs/mpfr.in endif -config PPL_CLOOG +config PPL_CLOOG_MPC bool - prompt "PPL and GLooG/PPL" + prompt "PPL, GLooG/PPL and MPC" help - gcc-4.4.0 and above requires both PPL and CLooG/PPL to build some - parts of the optimiser (GRAPHITE loop optimisation, to be precise). + gcc-4.4.0 and above requires PPL and CLooG/PPL to build some parts + of the optimiser (GRAPHITE loop optimisation, to be precise). + + In addition to those, gcc-4.4 also optionally uses MPC to enable + additional optimisations on complex numbers. Although MPC is optional, + crosstool-NG requires it and uses it to build gcc >= 4.4.0. These will be automatically selected if you choose gcc>=4.4.0, but you can say 'Y' here, although it is unknown yet if any other component can use them. -if PPL_CLOOG +if PPL_CLOOG_MPC source config/companion_libs/ppl.in source config/companion_libs/cloog.in +source config/companion_libs/mpc.in endif endmenu diff -r 46658e3fc781 -r b23f3c2e0c73 config/companion_libs/mpc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config/companion_libs/mpc.in Mon May 25 18:22:26 2009 +0000 @@ -0,0 +1,32 @@ +# MPC options + +choice + bool + prompt "MPC version" + +config MPC_V_0_6 + bool + prompt "0.6" + +# CT_INSERT_VERSION_ABOVE +# Don't remove above line! +endchoice + +config MPC_VERSION + string + default "0.6" if MPC_V_0_6 +# CT_INSERT_VERSION_STRING_ABOVE +# Don't remove above line! + +config MPC_CHECK + bool + prompt "Check MPC (!!! README !!!)" + default n + help + It is highly recommended to check the newly built MPC library. + Unfortunately, this is a very intensive task, and takes a loooong time. + + Checking MPC is thus disabled by default. + + If you suspect that your MPC library is the cause for incorrectly + generated code, you should answer 'Y' here. diff -r 46658e3fc781 -r b23f3c2e0c73 scripts/build/companion_libs/cloog.sh --- a/scripts/build/companion_libs/cloog.sh Mon May 25 17:26:21 2009 +0000 +++ b/scripts/build/companion_libs/cloog.sh Mon May 25 18:22:26 2009 +0000 @@ -8,7 +8,7 @@ do_cloog_target() { :; } # Overide functions depending on configuration -if [ "${CT_PPL_CLOOG}" = "y" ]; then +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then # Download CLooG do_cloog_get() { @@ -57,4 +57,4 @@ CT_EndStep } -fi # CT_PPL_CLOOG +fi # CT_PPL_CLOOG_MPC diff -r 46658e3fc781 -r b23f3c2e0c73 scripts/build/companion_libs/mpc.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/build/companion_libs/mpc.sh Mon May 25 18:22:26 2009 +0000 @@ -0,0 +1,57 @@ +# This file adds the functions to build the MPC library +# Copyright 2009 Yann E. MORIN +# Licensed under the GPL v2. See COPYING in the root of this package + +do_mpc_get() { :; } +do_mpc_extract() { :; } +do_mpc() { :; } +do_mpc_target() { :; } + +# Overide functions depending on configuration +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then + +# Download MPC +do_mpc_get() { + CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \ + http://www.multiprecision.org/mpc/download +} + +# Extract MPC +do_mpc_extract() { + CT_Extract "mpc-${CT_MPC_VERSION}" + CT_Patch "mpc-${CT_MPC_VERSION}" +} + +do_mpc() { + mkdir -p "${CT_BUILD_DIR}/build-mpc" + cd "${CT_BUILD_DIR}/build-mpc" + + CT_DoStep INFO "Installing MPC" + + CT_DoLog EXTRA "Configuring MPC" + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ + CT_DoExecLog ALL \ + "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \ + --build=${CT_BUILD} \ + --host=${CT_HOST} \ + --prefix="${CT_PREFIX_DIR}" \ + --with-gmp="${CT_PREFIX_DIR}" \ + --with-mpfr="${CT_PREFIX_DIR}" \ + --disable-shared \ + --enable-static \ + + CT_DoLog EXTRA "Building MPC" + CT_DoExecLog ALL make ${PARALLELMFLAGS} + + if [ "${CT_MPC_CHECK}" = "y" ]; then + CT_DoLog EXTRA "Checking MPC" + CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check + fi + + CT_DoLog EXTRA "Installing MPC" + CT_DoExecLog ALL make install + + CT_EndStep +} + +fi # CT_PPL_CLOOG_MPC diff -r 46658e3fc781 -r b23f3c2e0c73 scripts/build/companion_libs/ppl.sh --- a/scripts/build/companion_libs/ppl.sh Mon May 25 17:26:21 2009 +0000 +++ b/scripts/build/companion_libs/ppl.sh Mon May 25 18:22:26 2009 +0000 @@ -8,7 +8,7 @@ do_ppl_target() { :; } # Overide functions depending on configuration -if [ "${CT_PPL_CLOOG}" = "y" ]; then +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then # Download PPL do_ppl_get() { @@ -65,4 +65,4 @@ CT_EndStep } -fi # CT_PPL_CLOOG +fi # CT_PPL_CLOOG_MPC diff -r 46658e3fc781 -r b23f3c2e0c73 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Mon May 25 17:26:21 2009 +0000 +++ b/scripts/crosstool-NG.sh.in Mon May 25 18:22:26 2009 +0000 @@ -92,6 +92,7 @@ . "${CT_LIB_DIR}/scripts/build/companion_libs/mpfr.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/ppl.sh" . "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh" +. "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh" . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh" . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh" . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh" @@ -449,6 +450,7 @@ do_mpfr_get do_ppl_get do_cloog_get + do_mpc_get do_binutils_get do_cc_get do_libc_get @@ -467,6 +469,7 @@ do_mpfr_extract do_ppl_extract do_cloog_extract + do_mpc_extract do_binutils_extract do_cc_extract do_libc_extract diff -r 46658e3fc781 -r b23f3c2e0c73 steps.mk --- a/steps.mk Mon May 25 17:26:21 2009 +0000 +++ b/steps.mk Mon May 25 18:22:26 2009 +0000 @@ -22,6 +22,7 @@ mpfr \ ppl \ cloog \ + mpc \ binutils \ elf2flt \ cc_core_pass_1 \