diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-10-14 20:44:24 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2011-10-14 20:44:24 (GMT) |
commit | e2b9a81da34023db468b61caecf1b4799016f174 (patch) | |
tree | 6bdb3dc39eb5a490d49823b07b336a260cb0a6f9 /scripts/crosstool-NG.sh.in | |
parent | 6e00f49ab44487694fd0e68a3f4b2c4f43f72afe (diff) |
scripts: check host features with host compiler
Currently, we check host feature in ./configure. This works only for
cross toolchains, but not for canadian toolchains. ./configure has
absolutely no way to know what the host for the toolchain will be;
only the build scripts know.
So, move the headers & libraries checks from ./configure to the build
scripts, early enough in the build, but not before we know the host
compiler and other tools.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/crosstool-NG.sh.in')
-rw-r--r-- | scripts/crosstool-NG.sh.in | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 2a54a86..e70ff2a 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -464,6 +464,19 @@ if [ -z "${CT_RESTART}" ]; then *) ;; esac + # Now we know our host and where to find the host tools, we can check + # if static link was requested, but only if it was requested + if [ "${CT_WANTS_STATIC_LINK}" = "y" ]; then + tmp="${CT_BUILD_DIR}/.static-test" + if ! "${CT_HOST}-gcc" -xc - -static -o "${tmp}" >/dev/null 2>&1 <<-_EOF_ + int main() { return 0; } + _EOF_ + then + CT_Abort "Static linking impossible on the host system '${CT_HOST}'" + fi + rm -f "${tmp}" + fi + # Help gcc CT_CFLAGS_FOR_HOST= [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST+=" -pipe" |