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.in13
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"