diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-07-02 00:19:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-07-02 00:19:04 +0000 |
commit | 328c7c2f681aeea5792099d68349c440a5a3d663 (patch) | |
tree | 4e47b7c7f9ed8ad63a025444f7f31581cddf458e /gold/configure.ac | |
parent | 02d7cd4495b617a9dc356b4f5140a74d020df6f5 (diff) | |
download | gdb-328c7c2f681aeea5792099d68349c440a5a3d663.zip gdb-328c7c2f681aeea5792099d68349c440a5a3d663.tar.gz gdb-328c7c2f681aeea5792099d68349c440a5a3d663.tar.bz2 |
PR gold/12525
* configure.ac: Test whether static linking works, setting
the automake conditional HAVE_STATIC.
* testsuite/Makefile.am: Disable tests using -static if
HAVE_STATIC is not true.
* configure, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/configure.ac')
-rw-r--r-- | gold/configure.ac | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gold/configure.ac b/gold/configure.ac index be0533b..47120b4 100644 --- a/gold/configure.ac +++ b/gold/configure.ac @@ -261,6 +261,17 @@ AM_CONDITIONAL(GCC, test "$GCC" = yes) AM_CONDITIONAL(NATIVE_OR_CROSS_LINKER, test "x$target_alias" = "x" -o "x$host_alias" = "x$target_alias" -o "x$host_alias" = "x$build_alias") +dnl Test for whether static linking is supported. Some systems do not +dnl install static libraries. This only affects the set of tests that +dnl we run. +AC_CACHE_CHECK([whether static linking works], [gold_cv_lib_static], +LDFLAGS_hold=$LDFLAGS +LDFLAGS="$LDFLAGS -static" +[AC_LINK_IFELSE([ +AC_LANG_PROGRAM([[void f() { }]])], +[gold_cv_lib_static=yes], [gold_cv_lib_static=no])]) +AM_CONDITIONAL(HAVE_STATIC, test "$gold_cv_lib_static" = "yes") + dnl Some architectures do not support taking pointers of functions dnl defined in shared libraries except in -fPIC mode. We need to dnl tell the unittest framework if we're compiling for one of those |