scripts/crosstool-NG.sh.in
changeset 2717 13df2720b374
parent 2716 afa3fde1f7a7
child 2727 a7df9ea895fa
     1.1 --- a/scripts/crosstool-NG.sh.in	Sun Oct 16 13:26:26 2011 +0200
     1.2 +++ b/scripts/crosstool-NG.sh.in	Fri Oct 14 22:44:24 2011 +0200
     1.3 @@ -464,6 +464,19 @@
     1.4          *)  ;;
     1.5      esac
     1.6  
     1.7 +    # Now we know our host and where to find the host tools, we can check
     1.8 +    # if static link was requested, but only if it was requested
     1.9 +    if [ "${CT_WANTS_STATIC_LINK}" = "y" ]; then
    1.10 +        tmp="${CT_BUILD_DIR}/.static-test"
    1.11 +        if ! "${CT_HOST}-gcc" -xc - -static -o "${tmp}" >/dev/null 2>&1 <<-_EOF_
    1.12 +				int main() { return 0; }
    1.13 +			_EOF_
    1.14 +        then
    1.15 +            CT_Abort "Static linking impossible on the host system '${CT_HOST}'"
    1.16 +        fi
    1.17 +        rm -f "${tmp}"
    1.18 +    fi
    1.19 +
    1.20      # Help gcc
    1.21      CT_CFLAGS_FOR_HOST=
    1.22      [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST+=" -pipe"