summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/configure.in12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 6157f373a2..058283a4e1 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1799,8 +1799,12 @@ fi
AC_MSG_RESULT($BLDSHARED)
-saved_before_as_needed_ldflags="$LDFLAGS"
-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=auto)])])
+if test "x$enable_as_needed" != xno; then
+ saved_before_as_needed_ldflags="$LDFLAGS"
+ 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"
@@ -1811,7 +1815,9 @@ 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
+
# check if we have to disable LD_AS_NEEDED_FLAG:
# On some systems for a veriety of reasons linking with