summaryrefslogtreecommitdiff
path: root/scripts/crosstool-NG.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/crosstool-NG.sh.in')
-rw-r--r--scripts/crosstool-NG.sh.in20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 5037c86..3495867 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -469,10 +469,24 @@ if [ -z "${CT_RESTART}" ]; then
# - fall back to searching user's PATH
# Of course, neither cross-native nor canadian can run on BUILD,
# so don't add those PATHs in this case...
+ # For native and simple cross, build==host, combine the extra CFLAGS/LDFLAGS
+ # supplied for both (so that it doesn't matter where the user supplied them).
case "${CT_TOOLCHAIN_TYPE}" in
- cross) export PATH="${CT_PREFIX_DIR}/bin:${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}";;
- canadian) export PATH="${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}";;
- *) ;;
+ cross|native)
+ export PATH="${CT_PREFIX_DIR}/bin:${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}"
+ bh_cflags="${CT_EXTRA_CFLAGS_FOR_BUILD} ${CT_EXTRA_CFLAGS_FOR_HOST}"
+ bh_ldflags="${CT_EXTRA_LDFLAGS_FOR_BUILD} ${CT_EXTRA_LDFLAGS_FOR_HOST}"
+ CT_EXTRA_CFLAGS_FOR_BUILD="${bh_cflags}"
+ CT_EXTRA_CFLAGS_FOR_HOST="${bh_cflags}"
+ CT_EXTRA_LDFLAGS_FOR_BUILD="${bh_ldflags}"
+ CT_EXTRA_LDFLAGS_FOR_HOST="${bh_ldflags}"
+ ;;
+ canadian|cross-native)
+ export PATH="${CT_BUILDTOOLS_PREFIX_DIR}/bin:${PATH}"
+ # build!=host in this case
+ ;;
+ *)
+ ;;
esac
# Help build gcc