summaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-04-10 22:47:23 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-04-10 22:47:23 (GMT)
commit5b27e8de528dbfaa1e3ddd926af26b906db85c3d (patch)
tree384bcbc175437e3d5a53bbd93f9f91087d0bc7ec /scripts/build/companion_libs
parent5b663e2aae05cab9fb519a2faba66f85f11db161 (diff)
complibs: allow either static or shared build
Diffstat (limited to 'scripts/build/companion_libs')
-rw-r--r--scripts/build/companion_libs/cloog.sh17
-rw-r--r--scripts/build/companion_libs/gmp.sh12
-rw-r--r--scripts/build/companion_libs/libelf.sh16
-rw-r--r--scripts/build/companion_libs/mpc.sh12
-rw-r--r--scripts/build/companion_libs/mpfr.sh23
-rw-r--r--scripts/build/companion_libs/ppl.sh14
6 files changed, 69 insertions, 25 deletions
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
index 6a58a2d..925ab02 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 35933d7..ec92b9a 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 ecda8ff..7bbc8e4 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 793ad5a..d79ee14 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 87580c3..c26f266 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 4133269..2761a6e 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=...