1.1 --- a/config/companion_libs.in Mon May 25 17:26:21 2009 +0000
1.2 +++ b/config/companion_libs.in Mon May 25 18:22:26 2009 +0000
1.3 @@ -36,20 +36,25 @@
1.4 source config/companion_libs/mpfr.in
1.5 endif
1.6
1.7 -config PPL_CLOOG
1.8 +config PPL_CLOOG_MPC
1.9 bool
1.10 - prompt "PPL and GLooG/PPL"
1.11 + prompt "PPL, GLooG/PPL and MPC"
1.12 help
1.13 - gcc-4.4.0 and above requires both PPL and CLooG/PPL to build some
1.14 - parts of the optimiser (GRAPHITE loop optimisation, to be precise).
1.15 + gcc-4.4.0 and above requires PPL and CLooG/PPL to build some parts
1.16 + of the optimiser (GRAPHITE loop optimisation, to be precise).
1.17 +
1.18 + In addition to those, gcc-4.4 also optionally uses MPC to enable
1.19 + additional optimisations on complex numbers. Although MPC is optional,
1.20 + crosstool-NG requires it and uses it to build gcc >= 4.4.0.
1.21
1.22 These will be automatically selected if you choose gcc>=4.4.0, but you
1.23 can say 'Y' here, although it is unknown yet if any other component
1.24 can use them.
1.25
1.26 -if PPL_CLOOG
1.27 +if PPL_CLOOG_MPC
1.28 source config/companion_libs/ppl.in
1.29 source config/companion_libs/cloog.in
1.30 +source config/companion_libs/mpc.in
1.31 endif
1.32
1.33 endmenu
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/config/companion_libs/mpc.in Mon May 25 18:22:26 2009 +0000
2.3 @@ -0,0 +1,32 @@
2.4 +# MPC options
2.5 +
2.6 +choice
2.7 + bool
2.8 + prompt "MPC version"
2.9 +
2.10 +config MPC_V_0_6
2.11 + bool
2.12 + prompt "0.6"
2.13 +
2.14 +# CT_INSERT_VERSION_ABOVE
2.15 +# Don't remove above line!
2.16 +endchoice
2.17 +
2.18 +config MPC_VERSION
2.19 + string
2.20 + default "0.6" if MPC_V_0_6
2.21 +# CT_INSERT_VERSION_STRING_ABOVE
2.22 +# Don't remove above line!
2.23 +
2.24 +config MPC_CHECK
2.25 + bool
2.26 + prompt "Check MPC (!!! README !!!)"
2.27 + default n
2.28 + help
2.29 + It is highly recommended to check the newly built MPC library.
2.30 + Unfortunately, this is a very intensive task, and takes a loooong time.
2.31 +
2.32 + Checking MPC is thus disabled by default.
2.33 +
2.34 + If you suspect that your MPC library is the cause for incorrectly
2.35 + generated code, you should answer 'Y' here.
3.1 --- a/scripts/build/companion_libs/cloog.sh Mon May 25 17:26:21 2009 +0000
3.2 +++ b/scripts/build/companion_libs/cloog.sh Mon May 25 18:22:26 2009 +0000
3.3 @@ -8,7 +8,7 @@
3.4 do_cloog_target() { :; }
3.5
3.6 # Overide functions depending on configuration
3.7 -if [ "${CT_PPL_CLOOG}" = "y" ]; then
3.8 +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
3.9
3.10 # Download CLooG
3.11 do_cloog_get() {
3.12 @@ -57,4 +57,4 @@
3.13 CT_EndStep
3.14 }
3.15
3.16 -fi # CT_PPL_CLOOG
3.17 +fi # CT_PPL_CLOOG_MPC
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/scripts/build/companion_libs/mpc.sh Mon May 25 18:22:26 2009 +0000
4.3 @@ -0,0 +1,57 @@
4.4 +# This file adds the functions to build the MPC library
4.5 +# Copyright 2009 Yann E. MORIN
4.6 +# Licensed under the GPL v2. See COPYING in the root of this package
4.7 +
4.8 +do_mpc_get() { :; }
4.9 +do_mpc_extract() { :; }
4.10 +do_mpc() { :; }
4.11 +do_mpc_target() { :; }
4.12 +
4.13 +# Overide functions depending on configuration
4.14 +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
4.15 +
4.16 +# Download MPC
4.17 +do_mpc_get() {
4.18 + CT_GetFile "mpc-${CT_MPC_VERSION}" .tar.gz \
4.19 + http://www.multiprecision.org/mpc/download
4.20 +}
4.21 +
4.22 +# Extract MPC
4.23 +do_mpc_extract() {
4.24 + CT_Extract "mpc-${CT_MPC_VERSION}"
4.25 + CT_Patch "mpc-${CT_MPC_VERSION}"
4.26 +}
4.27 +
4.28 +do_mpc() {
4.29 + mkdir -p "${CT_BUILD_DIR}/build-mpc"
4.30 + cd "${CT_BUILD_DIR}/build-mpc"
4.31 +
4.32 + CT_DoStep INFO "Installing MPC"
4.33 +
4.34 + CT_DoLog EXTRA "Configuring MPC"
4.35 + CFLAGS="${CT_CFLAGS_FOR_HOST}" \
4.36 + CT_DoExecLog ALL \
4.37 + "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
4.38 + --build=${CT_BUILD} \
4.39 + --host=${CT_HOST} \
4.40 + --prefix="${CT_PREFIX_DIR}" \
4.41 + --with-gmp="${CT_PREFIX_DIR}" \
4.42 + --with-mpfr="${CT_PREFIX_DIR}" \
4.43 + --disable-shared \
4.44 + --enable-static \
4.45 +
4.46 + CT_DoLog EXTRA "Building MPC"
4.47 + CT_DoExecLog ALL make ${PARALLELMFLAGS}
4.48 +
4.49 + if [ "${CT_MPC_CHECK}" = "y" ]; then
4.50 + CT_DoLog EXTRA "Checking MPC"
4.51 + CT_DoExecLog ALL make ${PARALLELMFLAGS} -s check
4.52 + fi
4.53 +
4.54 + CT_DoLog EXTRA "Installing MPC"
4.55 + CT_DoExecLog ALL make install
4.56 +
4.57 + CT_EndStep
4.58 +}
4.59 +
4.60 +fi # CT_PPL_CLOOG_MPC
5.1 --- a/scripts/build/companion_libs/ppl.sh Mon May 25 17:26:21 2009 +0000
5.2 +++ b/scripts/build/companion_libs/ppl.sh Mon May 25 18:22:26 2009 +0000
5.3 @@ -8,7 +8,7 @@
5.4 do_ppl_target() { :; }
5.5
5.6 # Overide functions depending on configuration
5.7 -if [ "${CT_PPL_CLOOG}" = "y" ]; then
5.8 +if [ "${CT_PPL_CLOOG_MPC}" = "y" ]; then
5.9
5.10 # Download PPL
5.11 do_ppl_get() {
5.12 @@ -65,4 +65,4 @@
5.13 CT_EndStep
5.14 }
5.15
5.16 -fi # CT_PPL_CLOOG
5.17 +fi # CT_PPL_CLOOG_MPC
6.1 --- a/scripts/crosstool-NG.sh.in Mon May 25 17:26:21 2009 +0000
6.2 +++ b/scripts/crosstool-NG.sh.in Mon May 25 18:22:26 2009 +0000
6.3 @@ -92,6 +92,7 @@
6.4 . "${CT_LIB_DIR}/scripts/build/companion_libs/mpfr.sh"
6.5 . "${CT_LIB_DIR}/scripts/build/companion_libs/ppl.sh"
6.6 . "${CT_LIB_DIR}/scripts/build/companion_libs/cloog.sh"
6.7 +. "${CT_LIB_DIR}/scripts/build/companion_libs/mpc.sh"
6.8 . "${CT_LIB_DIR}/scripts/build/binutils/binutils.sh"
6.9 . "${CT_LIB_DIR}/scripts/build/binutils/elf2flt.sh"
6.10 . "${CT_LIB_DIR}/scripts/build/libc/${CT_LIBC}.sh"
6.11 @@ -449,6 +450,7 @@
6.12 do_mpfr_get
6.13 do_ppl_get
6.14 do_cloog_get
6.15 + do_mpc_get
6.16 do_binutils_get
6.17 do_cc_get
6.18 do_libc_get
6.19 @@ -467,6 +469,7 @@
6.20 do_mpfr_extract
6.21 do_ppl_extract
6.22 do_cloog_extract
6.23 + do_mpc_extract
6.24 do_binutils_extract
6.25 do_cc_extract
6.26 do_libc_extract
7.1 --- a/steps.mk Mon May 25 17:26:21 2009 +0000
7.2 +++ b/steps.mk Mon May 25 18:22:26 2009 +0000
7.3 @@ -22,6 +22,7 @@
7.4 mpfr \
7.5 ppl \
7.6 cloog \
7.7 + mpc \
7.8 binutils \
7.9 elf2flt \
7.10 cc_core_pass_1 \