summaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs/cloog.sh
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-17 16:56:30 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2011-07-17 16:56:30 (GMT)
commit2e3cc45633c343e63c84fd35f458a6ea1fdad28b (patch)
tree31b52a123b0daa335442e1539209c8041c230d22 /scripts/build/companion_libs/cloog.sh
parent533e5c128c4c955a88c16d7469a569a2c4f8cfe3 (diff)
complibs: split companion libraries to backend/frontend, a-la cc_core
Move the actual complibs codes to backend functions that builds the required combo of build/host/target as requested by a frontend. This split is currently a no-op, but is required for the upcoming canadian-cross rework, where we'll be needing to build the complibs twice, one for build/build, and one for build/host. This applies to the six companion libraries: - GMP - MPFR - PPL - Cloog/PPL - MPC - libelf Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/build/companion_libs/cloog.sh')
-rw-r--r--scripts/build/companion_libs/cloog.sh48
1 files changed, 35 insertions, 13 deletions
diff --git a/scripts/build/companion_libs/cloog.sh b/scripts/build/companion_libs/cloog.sh
index 2ee0e80..990ac4f 100644
--- a/scripts/build/companion_libs/cloog.sh
+++ b/scripts/build/companion_libs/cloog.sh
@@ -4,7 +4,7 @@
do_cloog_get() { :; }
do_cloog_extract() { :; }
-do_cloog() { :; }
+do_cloog_for_host() { :; }
# Overide functions depending on configuration
if [ "${CT_CLOOG}" = "y" ]; then
@@ -33,25 +33,49 @@ do_cloog_extract() {
fi
}
-do_cloog() {
- local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
+# Build CLooG/PPL for running on host
+do_cloog_for_host() {
+ local -a cloog_opts
- mkdir -p "${CT_BUILD_DIR}/build-cloog-ppl"
- cd "${CT_BUILD_DIR}/build-cloog-ppl"
+ CT_DoStep INFO "Installing CLooG/PPL for host"
+ CT_mkdir_pushd "${CT_BUILD_DIR}/build-cloog-ppl-host-${CT_HOST}"
- CT_DoStep INFO "Installing CLooG/ppl"
+ cloog_opts+=( "host=${CT_HOST}" )
+ cloog_opts+=( "prefix=${CT_COMPLIBS_DIR}" )
+ cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ do_cloog_backend "${cloog_opts[@]}"
+
+ CT_Popd
+ CT_EndStep
+}
+
+# Build ClooG/PPL
+# Parameter : description : type : default
+# host : machine to run on : tuple : (none)
+# prefix : prefix to install into : dir : (none)
+# cflags : host cflags to use : string : (empty)
+do_cloog_backend() {
+ local host
+ local prefix
+ local cflags
+ local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
+ local arg
+
+ for arg in "$@"; do
+ eval "${arg// /\\ }"
+ done
CT_DoLog EXTRA "Configuring CLooG/ppl"
CT_DoExecLog CFG \
- CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CFLAGS="${cflags}" \
LIBS="-lm" \
"${cloog_src_dir}/configure" \
--build=${CT_BUILD} \
- --host=${CT_HOST} \
- --prefix="${CT_COMPLIBS_DIR}" \
- --with-gmp="${CT_COMPLIBS_DIR}" \
- --with-ppl="${CT_COMPLIBS_DIR}" \
+ --host=${host} \
+ --prefix="${prefix}" \
+ --with-gmp="${prefix}" \
+ --with-ppl="${prefix}" \
--with-bits=gmp \
--with-host-libstdcxx='-lstdc++' \
--disable-shared \
@@ -67,8 +91,6 @@ do_cloog() {
CT_DoLog EXTRA "Installing CLooG/ppl"
CT_DoExecLog ALL make install-libLTLIBRARIES install-pkgincludeHEADERS
-
- CT_EndStep
}
fi # CT_CLOOG