diff -r afa3fde1f7a7 -r 13df2720b374 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Sun Oct 16 13:26:26 2011 +0200 +++ b/scripts/crosstool-NG.sh.in Fri Oct 14 22:44:24 2011 +0200 @@ -464,6 +464,19 @@ *) ;; 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"