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 | |
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')
-rwxr-xr-x | gold/configure | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gold/configure b/gold/configure index e8e4bf6..66c9d82 100755 --- a/gold/configure +++ b/gold/configure @@ -619,6 +619,8 @@ MCMODEL_MEDIUM_FALSE MCMODEL_MEDIUM_TRUE FN_PTRS_IN_SO_WITHOUT_PIC_FALSE FN_PTRS_IN_SO_WITHOUT_PIC_TRUE +HAVE_STATIC_FALSE +HAVE_STATIC_TRUE NATIVE_OR_CROSS_LINKER_FALSE NATIVE_OR_CROSS_LINKER_TRUE GCC_FALSE @@ -6104,6 +6106,44 @@ else fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether static linking works" >&5 +$as_echo_n "checking whether static linking works... " >&6; } +if test "${gold_cv_lib_static+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + LDFLAGS_hold=$LDFLAGS +LDFLAGS="$LDFLAGS -static" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +void f() { } +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gold_cv_lib_static=yes +else + gold_cv_lib_static=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gold_cv_lib_static" >&5 +$as_echo "$gold_cv_lib_static" >&6; } + if test "$gold_cv_lib_static" = "yes"; then + HAVE_STATIC_TRUE= + HAVE_STATIC_FALSE='#' +else + HAVE_STATIC_TRUE='#' + HAVE_STATIC_FALSE= +fi + + if case $target_cpu in i?86) true;; @@ -7276,6 +7316,10 @@ if test -z "${NATIVE_OR_CROSS_LINKER_TRUE}" && test -z "${NATIVE_OR_CROSS_LINKER as_fn_error "conditional \"NATIVE_OR_CROSS_LINKER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_STATIC_TRUE}" && test -z "${HAVE_STATIC_FALSE}"; then + as_fn_error "conditional \"HAVE_STATIC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${FN_PTRS_IN_SO_WITHOUT_PIC_TRUE}" && test -z "${FN_PTRS_IN_SO_WITHOUT_PIC_FALSE}"; then as_fn_error "conditional \"FN_PTRS_IN_SO_WITHOUT_PIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 |