# HG changeset patch # User "Yann E. MORIN" # Date 1270977006 -7200 # Node ID f5dab3c43abf19161cbf8984ab52e92a8b673711 # Parent af092b4bf65c00d982152ce47922dd46ffb49ea6 complibs: don't install in toolchain dir when built as static diff -r af092b4bf65c -r f5dab3c43abf scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/cc/gcc.sh Sun Apr 11 11:10:06 2010 +0200 @@ -151,24 +151,24 @@ else extra_config+=("--disable-__cxa_atexit") fi - if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then - extra_config+=("--with-gmp=${CT_PREFIX_DIR}") - extra_config+=("--with-mpfr=${CT_PREFIX_DIR}") - fi - if [ "${CT_CC_GCC_USE_PPL_CLOOG_MPC}" = "y" ]; then - extra_config+=("--with-ppl=${CT_PREFIX_DIR}") - extra_config+=("--with-cloog=${CT_PREFIX_DIR}") - extra_config+=("--with-mpc=${CT_PREFIX_DIR}") - fi - - CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" # When companion libraries are build static (eg !shared), # the libstdc++ is not pulled automatically, although it # is needed. Shoe-horn it in our LDFLAGS - if [ -z "${CT_COMPLIBS_SHARED}" ]; then + if [ "${CT_COMPLIBS_SHARED}" != "y" ]; then core_LDFLAGS='-lstdc++' fi + if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then + extra_config+=("--with-gmp=${CT_COMPLIBS_DIR}") + extra_config+=("--with-mpfr=${CT_COMPLIBS_DIR}") + fi + if [ "${CT_CC_GCC_USE_PPL_CLOOG_MPC}" = "y" ]; then + extra_config+=("--with-ppl=${CT_COMPLIBS_DIR}") + extra_config+=("--with-cloog=${CT_COMPLIBS_DIR}") + extra_config+=("--with-mpc=${CT_COMPLIBS_DIR}") + fi + + CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532) CC_FOR_BUILD="${CT_BUILD}-gcc" \ @@ -313,14 +313,21 @@ if [ -n "${CC_ENABLE_CXX_FLAGS}" ]; then extra_config+=("--enable-cxx-flags=${CC_ENABLE_CXX_FLAGS}") fi + + # When companion libraries are build static (eg !shared), + # the libstdc++ is not pulled automatically, although it + # is needed. Shoe-horn it in our LDFLAGS + if [ "${CT_COMPLIBS_SHARED}" != "y" ]; then + final_LDFLAGS='-lstdc++' + fi if [ "${CT_CC_GCC_USE_GMP_MPFR}" = "y" ]; then - extra_config+=("--with-gmp=${CT_PREFIX_DIR}") - extra_config+=("--with-mpfr=${CT_PREFIX_DIR}") + extra_config+=("--with-gmp=${CT_COMPLIBS_DIR}") + extra_config+=("--with-mpfr=${CT_COMPLIBS_DIR}") fi if [ "${CT_CC_GCC_USE_PPL_CLOOG_MPC}" = "y" ]; then - extra_config+=("--with-ppl=${CT_PREFIX_DIR}") - extra_config+=("--with-cloog=${CT_PREFIX_DIR}") - extra_config+=("--with-mpc=${CT_PREFIX_DIR}") + extra_config+=("--with-ppl=${CT_COMPLIBS_DIR}") + extra_config+=("--with-cloog=${CT_COMPLIBS_DIR}") + extra_config+=("--with-mpc=${CT_COMPLIBS_DIR}") fi if [ "${CT_THREADS}" = "none" ]; then @@ -334,13 +341,6 @@ CT_DoLog DEBUG "Extra config passed: '${extra_config[*]}'" - # When companion libraries are build static (eg !shared), - # the libstdc++ is not pulled automatically, although it - # is needed. Shoe-horn it in our LDFLAGS - if [ -z "${CT_COMPLIBS_SHARED}" ]; then - final_LDFLAGS='-lstdc++' - fi - # --enable-symvers=gnu really only needed for sh4 to work around a # detection problem only matters for gcc-3.2.x and later, I think. # --disable-nls to work around crash bug on ppc405, but also because diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/cloog.sh --- a/scripts/build/companion_libs/cloog.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/cloog.sh Sun Apr 11 11:10:06 2010 +0200 @@ -65,9 +65,9 @@ "${CT_SRC_DIR}/cloog-ppl${_t}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ - --prefix="${CT_PREFIX_DIR}" \ - --with-gmp="${CT_PREFIX_DIR}" \ - --with-ppl="${CT_PREFIX_DIR}" \ + --prefix="${CT_COMPLIBS_DIR}" \ + --with-gmp="${CT_COMPLIBS_DIR}" \ + --with-ppl="${CT_COMPLIBS_DIR}" \ --with-bits=gmp \ "${cloog_opts[@]}" diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/gmp.sh --- a/scripts/build/companion_libs/gmp.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/gmp.sh Sun Apr 11 11:10:06 2010 +0200 @@ -44,7 +44,7 @@ "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ - --prefix="${CT_PREFIX_DIR}" \ + --prefix="${CT_COMPLIBS_DIR}" \ --enable-fft \ --enable-mpbsd \ --enable-cxx \ diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/libelf.sh --- a/scripts/build/companion_libs/libelf.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/libelf.sh Sun Apr 11 11:10:06 2010 +0200 @@ -45,7 +45,7 @@ # --build=${CT_BUILD} \ # --host=${CT_HOST} \ # --target=${CT_TARGET} \ -# --prefix="${CT_PREFIX_DIR}" \ +# --prefix="${CT_COMPLIBS_DIR}" \ # --enable-compat \ # --enable-elf64 \ # --enable-extended-format \ diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/mpc.sh --- a/scripts/build/companion_libs/mpc.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/mpc.sh Sun Apr 11 11:10:06 2010 +0200 @@ -43,9 +43,9 @@ "${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}" \ + --prefix="${CT_COMPLIBS_DIR}" \ + --with-gmp="${CT_COMPLIBS_DIR}" \ + --with-mpfr="${CT_COMPLIBS_DIR}" \ "${mpc_opts[@]}" CT_DoLog EXTRA "Building MPC" diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/mpfr.sh --- a/scripts/build/companion_libs/mpfr.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/mpfr.sh Sun Apr 11 11:10:06 2010 +0200 @@ -95,8 +95,8 @@ "${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ - --prefix="${CT_PREFIX_DIR}" \ - --with-gmp="${CT_PREFIX_DIR}" \ + --prefix="${CT_COMPLIBS_DIR}" \ + --with-gmp="${CT_COMPLIBS_DIR}" \ "${mpfr_opts[@]}" CT_DoLog EXTRA "Building MPFR" diff -r af092b4bf65c -r f5dab3c43abf scripts/build/companion_libs/ppl.sh --- a/scripts/build/companion_libs/ppl.sh Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/build/companion_libs/ppl.sh Sun Apr 11 11:10:06 2010 +0200 @@ -46,9 +46,9 @@ "${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ - --prefix="${CT_PREFIX_DIR}" \ - --with-libgmp-prefix="${CT_PREFIX_DIR}" \ - --with-libgmpxx-prefix="${CT_PREFIX_DIR}" \ + --prefix="${CT_COMPLIBS_DIR}" \ + --with-libgmp-prefix="${CT_COMPLIBS_DIR}" \ + --with-libgmpxx-prefix="${CT_COMPLIBS_DIR}" \ --disable-debugging \ --disable-assertions \ --disable-ppl_lcdd \ diff -r af092b4bf65c -r f5dab3c43abf scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Sun Apr 11 00:47:23 2010 +0200 +++ b/scripts/crosstool-NG.sh.in Sun Apr 11 11:10:06 2010 +0200 @@ -150,6 +150,11 @@ CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build" CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state" CT_CONFIG_DIR="${CT_BUILD_DIR}/configs" +if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + CT_COMPLIBS_DIR="${CT_PREFIX_DIR}" +else + CT_COMPLIBS_DIR="${CT_BUILD_DIR}/static" +fi # Note: we'll always install the core compiler in its own directory, so as to # not mix the two builds: core and final.