diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build/cc/gcc.sh | 20 | ||||
-rw-r--r-- | scripts/build/companion_libs/cloog.sh | 17 | ||||
-rw-r--r-- | scripts/build/companion_libs/gmp.sh | 12 | ||||
-rw-r--r-- | scripts/build/companion_libs/libelf.sh | 16 | ||||
-rw-r--r-- | scripts/build/companion_libs/mpc.sh | 12 | ||||
-rw-r--r-- | scripts/build/companion_libs/mpfr.sh | 23 | ||||
-rw-r--r-- | scripts/build/companion_libs/ppl.sh | 14 |
7 files changed, 87 insertions, 27 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 6dc97e44..e52ec64c 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -95,6 +95,7 @@ do_cc_core() { local lang_opt local tmp local -a extra_config + local core_LDFLAGS eval $1 eval $2 @@ -162,10 +163,17 @@ do_cc_core() { 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 + core_LDFLAGS='-lstdc++' + fi + # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532) CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ - LDFLAGS="-lstdc++" \ + LDFLAGS="${core_LDFLAGS}" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/gcc-${CT_CC_VERSION}/configure" \ --build=${CT_BUILD} \ @@ -257,6 +265,7 @@ do_cc_core() { do_cc() { local -a extra_config local tmp + local final_LDFLAGS # If building for bare metal, nothing to be done here, the static core conpiler is enough! [ "${CT_BARE_METAL}" = "y" ] && return 0 @@ -325,13 +334,20 @@ do_cc() { 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 # embedded systems don't really need message catalogs... CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ - LDFLAGS="-lstdc++" \ + LDFLAGS="${final_LDFLAGS}" \ CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ CXXFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ LDFLAGS_FOR_TARGET="${CT_TARGET_LDFLAGS}" \ diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh index 6a58a2da..925ab026 100644 --- a/scripts/build/companion_libs/cloog.sh +++ b/scripts/build/companion_libs/cloog.sh @@ -35,6 +35,8 @@ do_cloog_extract() { do_cloog() { local _t + local cloog_LDFLAGS + local -a cloog_opts # Version 0.15.3 has a dirname 'cloog-ppl' (with no version in it!) # while versions 0.15.4 onward do have the version in the dirname. @@ -49,8 +51,16 @@ do_cloog() { CT_DoStep INFO "Installing CLooG/ppl" CT_DoLog EXTRA "Configuring CLooG/ppl" + + if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + cloog_opts+=( --enable-shared --disable-static ) + else + cloog_opts+=( --disable-shared --enable-static ) + cloog_LDFLAGS='-lstdc++' + fi + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ - LDFLAGS='-lstdc++' \ + LDFLAGS="${cloog_LDFLAGS}" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/cloog-ppl${_t}/configure" \ --build=${CT_BUILD} \ @@ -58,9 +68,8 @@ do_cloog() { --prefix="${CT_PREFIX_DIR}" \ --with-gmp="${CT_PREFIX_DIR}" \ --with-ppl="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static \ - --with-bits=gmp + --with-bits=gmp \ + "${cloog_opts[@]}" CT_DoLog EXTRA "Building CLooG/ppl" CT_DoExecLog ALL make ${PARALLELMFLAGS} diff --git a/scripts/build/companion_libs/gmp.sh b/scripts/build/companion_libs/gmp.sh index 35933d74..ec92b9a6 100644 --- a/scripts/build/companion_libs/gmp.sh +++ b/scripts/build/companion_libs/gmp.sh @@ -24,6 +24,7 @@ do_gmp_extract() { if [ "${CT_GMP}" = "y" ]; then do_gmp() { + local -a gmp_opts mkdir -p "${CT_BUILD_DIR}/build-gmp" cd "${CT_BUILD_DIR}/build-gmp" @@ -32,17 +33,22 @@ do_gmp() { CT_DoLog EXTRA "Configuring GMP" + if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + gmp_opts+=( --enable-shared --disable-static ) + else + gmp_opts+=( --disable-shared --enable-static ) + fi + CFLAGS="${CT_CFLAGS_FOR_HOST} -fexceptions" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \ --build=${CT_BUILD} \ --host=${CT_HOST} \ --prefix="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static \ --enable-fft \ --enable-mpbsd \ - --enable-cxx + --enable-cxx \ + "${gmp_opts[@]}" CT_DoLog EXTRA "Building GMP" CT_DoExecLog ALL make ${PARALLELMFLAGS} diff --git a/scripts/build/companion_libs/libelf.sh b/scripts/build/companion_libs/libelf.sh index ecda8ff0..7bbc8e47 100644 --- a/scripts/build/companion_libs/libelf.sh +++ b/scripts/build/companion_libs/libelf.sh @@ -24,12 +24,21 @@ if [ "${CT_LIBELF}" = "y" ]; then # Uncomment when we need it for gcc-4.5 # WARNING! This function is absolutely UNTESTED yet! do_libelf() { - : # Remove this line! + : # Remove this line! and uncomment the following lines +# local -a libelf_opts +# # CT_DoStep INFO "Installing libelf" # mkdir -p "${CT_BUILD_DIR}/build-libelf" # CT_Pushd "${CT_BUILD_DIR}/build-libelf" # # CT_DoLog EXTRA "Configuring libelf" +# +# if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then +# libelf_opts+=( --enable-shared --disable-static ) +# else +# libelf_opts+=( --disable-shared --enable-static ) +# fi +# # CC="${CT_TARGET}-gcc" \ # CT_DoExecLog ALL \ # "${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \ @@ -39,9 +48,8 @@ do_libelf() { # --prefix="${CT_PREFIX_DIR}" \ # --enable-compat \ # --enable-elf64 \ -# --enable-static \ -# --enable-shared \ -# --enable-extended-format +# --enable-extended-format \ +# "${libelf_opts[@]}" # # CT_DoLog EXTRA "Building libelf" # CT_DoExecLog ALL make diff --git a/scripts/build/companion_libs/mpc.sh b/scripts/build/companion_libs/mpc.sh index 793ad5a8..d79ee14a 100644 --- a/scripts/build/companion_libs/mpc.sh +++ b/scripts/build/companion_libs/mpc.sh @@ -23,12 +23,21 @@ do_mpc_extract() { } do_mpc() { + local -a mpc_opts + mkdir -p "${CT_BUILD_DIR}/build-mpc" cd "${CT_BUILD_DIR}/build-mpc" CT_DoStep INFO "Installing MPC" CT_DoLog EXTRA "Configuring MPC" + + if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + mpc_opts+=( --enable-shared --disable-static ) + else + mpc_opts+=( --disable-shared --enable-static ) + fi + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ CT_DoExecLog ALL \ "${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \ @@ -37,8 +46,7 @@ do_mpc() { --prefix="${CT_PREFIX_DIR}" \ --with-gmp="${CT_PREFIX_DIR}" \ --with-mpfr="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static + "${mpc_opts[@]}" CT_DoLog EXTRA "Building MPC" CT_DoExecLog ALL make ${PARALLELMFLAGS} diff --git a/scripts/build/companion_libs/mpfr.sh b/scripts/build/companion_libs/mpfr.sh index 87580c34..c26f266f 100644 --- a/scripts/build/companion_libs/mpfr.sh +++ b/scripts/build/companion_libs/mpfr.sh @@ -67,20 +67,27 @@ do_mpfr_extract() { if [ "${CT_MPFR}" = "y" ]; then do_mpfr() { + local -a mpfr_opts + mkdir -p "${CT_BUILD_DIR}/build-mpfr" cd "${CT_BUILD_DIR}/build-mpfr" CT_DoStep INFO "Installing MPFR" - mpfr_opt= # Under Cygwin, we can't build a thread-safe library case "${CT_HOST}" in - *cygwin*) mpfr_opt="--disable-thread-safe";; - *mingw*) mpfr_opt="--disable-thread-safe";; - *darwin*) mpfr_opt="--disable-thread-safe";; - *) mpfr_opt="--enable-thread-safe";; + *cygwin*) mpfr_opts+=( --disable-thread-safe );; + *mingw*) mpfr_opts+=( --disable-thread-safe );; + *darwin*) mpfr_opts+=( --disable-thread-safe );; + *) mpfr_opts+=( --enable-thread-safe );; esac + if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + mpfr_opts+=( --enable-shared --disable-static ) + else + mpfr_opts+=( --disable-shared --enable-static ) + fi + CT_DoLog EXTRA "Configuring MPFR" CC="${CT_HOST}-gcc" \ CFLAGS="${CT_CFLAGS_FOR_HOST}" \ @@ -89,10 +96,8 @@ do_mpfr() { --build=${CT_BUILD} \ --host=${CT_HOST} \ --prefix="${CT_PREFIX_DIR}" \ - ${mpfr_opt} \ - --disable-shared \ - --enable-static \ - --with-gmp="${CT_PREFIX_DIR}" + --with-gmp="${CT_PREFIX_DIR}" \ + "${mpfr_opts[@]}" CT_DoLog EXTRA "Building MPFR" CT_DoExecLog ALL make ${PARALLELMFLAGS} diff --git a/scripts/build/companion_libs/ppl.sh b/scripts/build/companion_libs/ppl.sh index 41332693..2761a6ee 100644 --- a/scripts/build/companion_libs/ppl.sh +++ b/scripts/build/companion_libs/ppl.sh @@ -25,12 +25,21 @@ do_ppl_extract() { } do_ppl() { + local -a ppl_opts + mkdir -p "${CT_BUILD_DIR}/build-ppl" cd "${CT_BUILD_DIR}/build-ppl" CT_DoStep INFO "Installing PPL" CT_DoLog EXTRA "Configuring PPL" + + if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then + ppl_opts+=( --enable-shared --disable-static ) + else + ppl_opts+=( --disable-shared --enable-static ) + fi + CFLAGS="${CT_CFLAGS_FOR_HOST}" \ CXXFLAGS="${CT_CFLAGS_FOR_HOST}" \ CT_DoExecLog ALL \ @@ -40,12 +49,11 @@ do_ppl() { --prefix="${CT_PREFIX_DIR}" \ --with-libgmp-prefix="${CT_PREFIX_DIR}" \ --with-libgmpxx-prefix="${CT_PREFIX_DIR}" \ - --disable-shared \ - --enable-static \ --disable-debugging \ --disable-assertions \ --disable-ppl_lcdd \ - --disable-ppl_lpsol + --disable-ppl_lpsol \ + "${ppl_opts[@]}" # Maybe-options: # --enable-interfaces=... |