diff options
-rw-r--r-- | source3/configure.in | 10 |
1 files changed, 8 insertions, 2 deletions
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 |