diff options
author | Bryan Hundven <bryanhundven@gmail.com> | 2016-02-26 03:34:52 -0800 |
---|---|---|
committer | Bryan Hundven <bryanhundven@gmail.com> | 2016-02-26 03:52:05 -0800 |
commit | c66d5c20cf78b6ab144e77788eedcaecb17e2e6f (patch) | |
tree | 83e80760e1d05f97784671eb7f3943dd7ecc6434 /configure.ac | |
parent | 6430ff506e7a71afa3810e42df0b72620a05ccd6 (diff) | |
download | crosstool-ng-c66d5c20cf78b6ab144e77788eedcaecb17e2e6f.tar.gz crosstool-ng-c66d5c20cf78b6ab144e77788eedcaecb17e2e6f.tar.bz2 crosstool-ng-c66d5c20cf78b6ab144e77788eedcaecb17e2e6f.zip |
configure: Check to see if gcc can static link
This is a semi-nasty-hack to see if gcc can static link.
Obviously on Mac OS X this is not possible, so we set
CT_CONFIGURE_has_static_link=y if it can.
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 4f0b4283..4fd5776a 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,19 @@ AS_IF([test -z "$CC"], [AC_MSG_ERROR([no suitable compiler found])]) AC_PROG_CPP +#--------------------------------------------------------------------- +# Check to see if gcc can static link +AC_MSG_CHECKING([if gcc can static link]) +echo "int main() {}" | gcc -static -xc - > /dev/null 2>&1 +static_test=$? +AS_IF([test $static_test -eq 0], + [static_link=y + AC_MSG_RESULT([yes])], + [test $static_test -ne 0], + [static_link= + AC_MSG_RESULT([no])]) +ACX_SET_KCONFIG_OPTION([static_link]) + # But we still need a way to specify the PATH to GNU versions (Damn MacOS) AC_ARG_WITH([objcopy], AS_HELP_STRING([--with-objcopy=PATH], |