From 328c7c2f681aeea5792099d68349c440a5a3d663 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 2 Jul 2011 00:19:04 +0000 Subject: 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. --- gold/configure.ac | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gold/configure.ac') 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 -- cgit v1.1