From 22d316926b9589608d332143c1fa134229b75b3c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 4 Mar 2010 11:14:51 +0100 Subject: s3:configure: add --enable-as-needed On some broken systems like RHEL5, we need to be able to disable --as-needed. metze --- source3/configure.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 7ba72bf26c..5283d8f99a 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1746,7 +1746,12 @@ fi AC_MSG_RESULT($BLDSHARED) -for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do +AC_ARG_ENABLE(as-needed, + [AS_HELP_STRING([--enable-as-needed], + [Turn on as-needed support if available (default=yes)])]) + +if test "x$enable_as_needed" != xno; then + for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do saved_ldflags="$LDFLAGS" AC_MSG_CHECKING([if $flags works]) LDFLAGS="$flags $saved_ldflags" @@ -1757,7 +1762,8 @@ for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do AC_MSG_RESULT([no])) LDFLAGS="$LD_AS_NEEDED_FLAG $saved_ldflags" test x"$ld_as_needed_flag_found" = xyes && break -done + done +fi # for historical reasons almost all linkers don't complain about unresolved # symbols in shared libs. Except for the internal samba modules we want to get -- cgit