From 050ec5cb29345afb71213ef17b780789b9673564 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 19 Jun 2006 07:19:00 +0000 Subject: (gl_IGNORE_UNUSED_LIBRARIES): Prefer binutils's --as-needed option if available. --- m4/ChangeLog | 6 ++++++ m4/lib-ignore.m4 | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/ChangeLog b/m4/ChangeLog index 2fc9a180b..8ad70a2ee 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2006-06-19 Paul Eggert + + * lib-ignore.m4 (gl_IGNORE_UNUSED_LIBRARIES): Prefer binutils's + --as-needed option if available. Problem reported by Albert Chin in + . + 2006-06-18 Jim Meyering Test for a bug that causes glibc's getcwd to suffer a failed assertion. diff --git a/m4/lib-ignore.m4 b/m4/lib-ignore.m4 index 348f6f44a..deaaee8e6 100644 --- a/m4/lib-ignore.m4 +++ b/m4/lib-ignore.m4 @@ -15,7 +15,12 @@ AC_DEFUN([gl_IGNORE_UNUSED_LIBRARIES], gl_saved_ldflags=$LDFLAGS # Use long option sequences like '-z ignore' to test for the feature, # to forestall problems with linkers that have -z, -i, -g, -n, etc. flags. - for gl_flags in '-Wl,-z,ignore' '-z ignore'; do + for gl_flags in \ + '-Wl,--as-needed' \ + '-Wl,-z,ignore' \ + '--as-needed' \ + '-z ignore' + do LDFLAGS="$gl_flags $LDFLAGS" AC_LINK_IFELSE([AC_LANG_PROGRAM()], [gl_cv_ignore_unused_libraries=$gl_flags]) -- cgit v1.2.3-54-g00ecf