From 36bbcf4b4f26e414438d7535b111b5a1159ebb22 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 19 Dec 2016 10:28:15 -0800 Subject: For simple cross or native pick up both build/host flags. Signed-off-by: Alexey Neyman 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 -- cgit v0.10.2-6-g49f6