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/crosstool-NG.sh.in | |
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/crosstool-NG.sh.in')
-rw-r--r-- | scripts/crosstool-NG.sh.in | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 59cd971..782a407 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -487,12 +487,22 @@ if [ -z "${CT_RESTART}" ]; then rm -f "${tmp}" fi - # Help gcc + # Help build gcc + # Explicitly optimise, else the lines below will overide the + # package's default optimisation flags + CT_CFLAGS_FOR_BUILD="-O2 -g" + CT_CFLAGS_FOR_BUILD+=" ${CT_EXTRA_CFLAGS_FOR_BUILD}" + CT_LDFLAGS_FOR_BUILD= + CT_LDFLAGS_FOR_BUILD+=" ${CT_EXTRA_LDFLAGS_FOR_BUILD}" + + # Help host gcc # Explicitly optimise, else the lines below will overide the # package's default optimisation flags CT_CFLAGS_FOR_HOST="-O2 -g" [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST+=" -pipe" - CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_FLAGS_FOR_HOST}" + CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}" + CT_LDFLAGS_FOR_HOST= + CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}" # Set the shell to be used by ./configure scripts and by Makefiles (those # that support it!). |