summaryrefslogtreecommitdiff
path: root/scripts/build/companion_libs
diff options
context:
space:
mode:
authorYann Diorcet <diorcet.yann@gmail.com>2012-11-16 14:25:57 (GMT)
committerYann Diorcet <diorcet.yann@gmail.com>2012-11-16 14:25:57 (GMT)
commitb43fdf40f1f90c4c313dda5b74955cc725a88b40 (patch)
tree70c65d158f49bc2c50fdbc3e4a61a7f62cbe747b /scripts/build/companion_libs
parent1af4a119d20cd1f806262f5a951ba0a356da3d8a (diff)
scripts: add BUILD/HOST extra cflags/ldflags
On some hosts, and for certain toolchains (eg. toolchain targetting the upcoming Darwin), it may be necessary to pass arbitrary CFLAGS and/or LDFLAGS when building the components. And necessary infrastructure: - EXTRA_{CFLAGS,LDFLAGS}_FOR_{BUILD,HOST} as config options - pass those extra flags to components Fix-up a slight typo in elf2flt at the same time (misnamed cflags). Signed-off-by: Yann Diorcet <diorcet.yann@gmail.com> Message-Id: <d24043276c9243a35421.1353077450@macbook-smorlat.local> Patchwork-Id: 199645
Diffstat (limited to 'scripts/build/companion_libs')
-rw-r--r--scripts/build/companion_libs/100-gmp.sh8
-rw-r--r--scripts/build/companion_libs/110-mpfr.sh10
-rw-r--r--scripts/build/companion_libs/120-ppl.sh8
-rw-r--r--scripts/build/companion_libs/130-cloog.sh8
-rw-r--r--scripts/build/companion_libs/140-mpc.sh8
-rw-r--r--scripts/build/companion_libs/200-libelf.sh8
6 files changed, 43 insertions, 7 deletions
diff --git a/scripts/build/companion_libs/100-gmp.sh b/scripts/build/companion_libs/100-gmp.sh
index ebc095b..8674f16 100644
--- a/scripts/build/companion_libs/100-gmp.sh
+++ b/scripts/build/companion_libs/100-gmp.sh
@@ -37,6 +37,8 @@ do_gmp_for_build() {
gmp_opts+=( "host=${CT_BUILD}" )
gmp_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ gmp_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ gmp_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_gmp_backend "${gmp_opts[@]}"
CT_Popd
@@ -53,6 +55,7 @@ do_gmp_for_host() {
gmp_opts+=( "host=${CT_HOST}" )
gmp_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
gmp_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ gmp_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_gmp_backend "${gmp_opts[@]}"
CT_Popd
@@ -63,11 +66,13 @@ do_gmp_for_host() {
# 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)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
do_gmp_backend() {
local host
local prefix
local cflags
+ local ldflags
local arg
for arg in "$@"; do
@@ -78,6 +83,7 @@ do_gmp_backend() {
CT_DoExecLog CFG \
CFLAGS="${cflags} -fexceptions" \
+ LDFLAGS="${ldflags}" \
"${CT_SRC_DIR}/gmp-${CT_GMP_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \
diff --git a/scripts/build/companion_libs/110-mpfr.sh b/scripts/build/companion_libs/110-mpfr.sh
index 35a4849..1a917c2 100644
--- a/scripts/build/companion_libs/110-mpfr.sh
+++ b/scripts/build/companion_libs/110-mpfr.sh
@@ -80,6 +80,8 @@ do_mpfr_for_build() {
mpfr_opts+=( "host=${CT_BUILD}" )
mpfr_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ mpfr_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ mpfr_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_mpfr_backend "${mpfr_opts[@]}"
CT_Popd
@@ -96,6 +98,7 @@ do_mpfr_for_host() {
mpfr_opts+=( "host=${CT_HOST}" )
mpfr_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
mpfr_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ mpfr_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_mpfr_backend "${mpfr_opts[@]}"
CT_Popd
@@ -106,11 +109,13 @@ do_mpfr_for_host() {
# 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)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
do_mpfr_backend() {
local host
local prefix
local cflags
+ local ldflags
local arg
for arg in "$@"; do
@@ -128,7 +133,8 @@ do_mpfr_backend() {
CT_DoLog EXTRA "Configuring MPFR"
CT_DoExecLog CFG \
CC="${host}-gcc" \
- CFLAGS="${CT_CFLAGS_FOR_HOST}" \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
"${CT_SRC_DIR}/mpfr-${CT_MPFR_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \
diff --git a/scripts/build/companion_libs/120-ppl.sh b/scripts/build/companion_libs/120-ppl.sh
index 90dcad3..93a07ca 100644
--- a/scripts/build/companion_libs/120-ppl.sh
+++ b/scripts/build/companion_libs/120-ppl.sh
@@ -40,6 +40,8 @@ do_ppl_for_build() {
ppl_opts+=( "host=${CT_BUILD}" )
ppl_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ ppl_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_ppl_backend "${ppl_opts[@]}"
CT_Popd
@@ -56,6 +58,7 @@ do_ppl_for_host() {
ppl_opts+=( "host=${CT_HOST}" )
ppl_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
ppl_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ ppl_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_ppl_backend "${ppl_opts[@]}"
CT_Popd
@@ -66,11 +69,13 @@ do_ppl_for_host() {
# 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)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
do_ppl_backend() {
local host
local prefix
local cflags
+ local ldflags
local arg
for arg in "$@"; do
@@ -82,6 +87,7 @@ do_ppl_backend() {
CT_DoExecLog CFG \
CFLAGS="${cflags}" \
CXXFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
"${CT_SRC_DIR}/ppl-${CT_PPL_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \
diff --git a/scripts/build/companion_libs/130-cloog.sh b/scripts/build/companion_libs/130-cloog.sh
index 6408782..06240e5 100644
--- a/scripts/build/companion_libs/130-cloog.sh
+++ b/scripts/build/companion_libs/130-cloog.sh
@@ -53,6 +53,8 @@ do_cloog_for_build() {
cloog_opts+=( "host=${CT_BUILD}" )
cloog_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ cloog_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_cloog_backend "${cloog_opts[@]}"
CT_Popd
@@ -69,6 +71,7 @@ do_cloog_for_host() {
cloog_opts+=( "host=${CT_HOST}" )
cloog_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
cloog_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ cloog_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_cloog_backend "${cloog_opts[@]}"
CT_Popd
@@ -79,11 +82,13 @@ do_cloog_for_host() {
# 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)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
do_cloog_backend() {
local host
local prefix
local cflags
+ local ldflags
local cloog_src_dir="${CT_SRC_DIR}/cloog-ppl-${CT_CLOOG_VERSION}"
local arg
@@ -95,6 +100,7 @@ do_cloog_backend() {
CT_DoExecLog CFG \
CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
LIBS="-lm" \
"${cloog_src_dir}/configure" \
--build=${CT_BUILD} \
diff --git a/scripts/build/companion_libs/140-mpc.sh b/scripts/build/companion_libs/140-mpc.sh
index b035f4d..9ceb7e5 100644
--- a/scripts/build/companion_libs/140-mpc.sh
+++ b/scripts/build/companion_libs/140-mpc.sh
@@ -38,6 +38,8 @@ do_mpc_for_build() {
mpc_opts+=( "host=${CT_BUILD}" )
mpc_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ mpc_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ mpc_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_mpc_backend "${mpc_opts[@]}"
CT_Popd
@@ -54,6 +56,7 @@ do_mpc_for_host() {
mpc_opts+=( "host=${CT_HOST}" )
mpc_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
mpc_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ mpc_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_mpc_backend "${mpc_opts[@]}"
CT_Popd
@@ -64,11 +67,13 @@ do_mpc_for_host() {
# 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)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
do_mpc_backend() {
local host
local prefix
local cflags
+ local ldflags
local arg
for arg in "$@"; do
@@ -79,6 +84,7 @@ do_mpc_backend() {
CT_DoExecLog CFG \
CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
"${CT_SRC_DIR}/mpc-${CT_MPC_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \
diff --git a/scripts/build/companion_libs/200-libelf.sh b/scripts/build/companion_libs/200-libelf.sh
index e7b140b..e404897 100644
--- a/scripts/build/companion_libs/200-libelf.sh
+++ b/scripts/build/companion_libs/200-libelf.sh
@@ -38,6 +38,8 @@ do_libelf_for_build() {
libelf_opts+=( "host=${CT_BUILD}" )
libelf_opts+=( "prefix=${CT_BUILDTOOLS_PREFIX_DIR}" )
+ libelf_opts+=( "cflags=${CT_CFLAGS_FOR_BUILD}" )
+ libelf_opts+=( "ldflags=${CT_LDFLAGS_FOR_BUILD}" )
do_libelf_backend "${libelf_opts[@]}"
CT_Popd
@@ -54,6 +56,7 @@ do_libelf_for_host() {
libelf_opts+=( "host=${CT_HOST}" )
libelf_opts+=( "prefix=${CT_HOST_COMPLIBS_DIR}" )
libelf_opts+=( "cflags=${CT_CFLAGS_FOR_HOST}" )
+ libelf_opts+=( "ldflags=${CT_LDFLAGS_FOR_HOST}" )
do_libelf_backend "${libelf_opts[@]}"
CT_Popd
@@ -87,13 +90,15 @@ fi # CT_LIBELF_TARGET
# destdir : out-of-tree install dir : string : /
# host : machine to run on : tuple : (none)
# prefix : prefix to install into : dir : (none)
-# cflags : host cflags to use : string : (empty)
+# cflags : cflags to use : string : (empty)
+# ldflags : ldflags to use : string : (empty)
# shared : also buils shared lib : bool : n
do_libelf_backend() {
local destdir="/"
local host
local prefix
local cflags
+ local ldflags
local shared
local -a extra_config
local arg
@@ -114,6 +119,7 @@ do_libelf_backend() {
CC="${host}-gcc" \
RANLIB="${host}-ranlib" \
CFLAGS="${cflags} -fPIC" \
+ LDFLAGS="${ldflags}" \
"${CT_SRC_DIR}/libelf-${CT_LIBELF_VERSION}/configure" \
--build=${CT_BUILD} \
--host=${host} \