diff options
author | Yann Diorcet <diorcet.yann@gmail.com> | 2012-11-16 14:25:57 (GMT) |
---|---|---|
committer | Yann Diorcet <diorcet.yann@gmail.com> | 2012-11-16 14:25:57 (GMT) |
commit | b43fdf40f1f90c4c313dda5b74955cc725a88b40 (patch) | |
tree | 70c65d158f49bc2c50fdbc3e4a61a7f62cbe747b /scripts/build/companion_libs/140-mpc.sh | |
parent | 1af4a119d20cd1f806262f5a951ba0a356da3d8a (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/140-mpc.sh')
-rw-r--r-- | scripts/build/companion_libs/140-mpc.sh | 8 |
1 files changed, 7 insertions, 1 deletions
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} \ |