diff options
author | Bryan Hundven <bryanhundven@gmail.com> | 2016-02-28 12:16:10 -0800 |
---|---|---|
committer | Bryan Hundven <bryanhundven@gmail.com> | 2016-02-28 12:16:10 -0800 |
commit | c1c03aa27c27e4e96be6486d90093babc6f1b638 (patch) | |
tree | 4af8062b016b77d0db330ffea00b3c8dfd27ddea | |
parent | 01bc77f5f1704407061b80048950eb824748997e (diff) | |
parent | b3869e933b29286fe362e68fbda3184acf655de8 (diff) | |
download | crosstool-ng-c1c03aa27c27e4e96be6486d90093babc6f1b638.tar.gz crosstool-ng-c1c03aa27c27e4e96be6486d90093babc6f1b638.tar.bz2 crosstool-ng-c1c03aa27c27e4e96be6486d90093babc6f1b638.zip |
Merge pull request #356 from bhundven/check_static_link
configure: Check to see if gcc can static link
-rw-r--r-- | config/cc/gcc.in.2 | 1 | ||||
-rw-r--r-- | config/debug/gdb.in.cross | 1 | ||||
-rw-r--r-- | config/debug/gdb.in.gdbserver | 1 | ||||
-rw-r--r-- | config/debug/gdb.in.native | 1 | ||||
-rw-r--r-- | config/toolchain.in | 1 | ||||
-rw-r--r-- | configure.ac | 13 |
6 files changed, 18 insertions, 0 deletions
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2 index 50a0574f..17b41ccf 100644 --- a/config/cc/gcc.in.2 +++ b/config/cc/gcc.in.2 @@ -56,6 +56,7 @@ config CC_GCC_STATIC_LIBSTDCXX bool prompt "Link libstdc++ statically into the gcc binary" default y + depends on CONFIGURE_has_static_link select WANTS_STATIC_LINK help Newer gcc versions require some c++ libraries. So statically diff --git a/config/debug/gdb.in.cross b/config/debug/gdb.in.cross index 99c9825e..07b85b85 100644 --- a/config/debug/gdb.in.cross +++ b/config/debug/gdb.in.cross @@ -18,6 +18,7 @@ if GDB_CROSS config GDB_CROSS_STATIC bool prompt "Build a static cross gdb" + depends on CONFIGURE_has_static_link select WANTS_STATIC_LINK help A static cross gdb can be usefull if you debug on a machine that is diff --git a/config/debug/gdb.in.gdbserver b/config/debug/gdb.in.gdbserver index 50c3b8bd..8d8fce5b 100644 --- a/config/debug/gdb.in.gdbserver +++ b/config/debug/gdb.in.gdbserver @@ -17,6 +17,7 @@ config GDB_GDBSERVER_HAS_IPA_LIB config GDB_GDBSERVER_STATIC bool prompt "Build a static gdbserver" + depends on CONFIGURE_has_static_link default y help In case you have trouble with dynamic loading of shared libraries, diff --git a/config/debug/gdb.in.native b/config/debug/gdb.in.native index 1861506b..915debd8 100644 --- a/config/debug/gdb.in.native +++ b/config/debug/gdb.in.native @@ -15,6 +15,7 @@ if GDB_NATIVE config GDB_NATIVE_STATIC bool prompt "Build a static native gdb" + depends on CONFIGURE_has_static_link help In case you have trouble with dynamic loading of shared libraries, you will find that a static gdb comes in handy. diff --git a/config/toolchain.in b/config/toolchain.in index 361c6bd0..ca74ee70 100644 --- a/config/toolchain.in +++ b/config/toolchain.in @@ -52,6 +52,7 @@ config WANTS_STATIC_LINK config STATIC_TOOLCHAIN bool prompt "Build Static Toolchain" + depends on CONFIGURE_has_static_link select WANTS_STATIC_LINK help Build static host binaries. 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], |