summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2009-10-20 08:01:52 +0200
committerBjörn Jacke <bj@sernet.de>2009-10-20 10:52:07 +0200
commit4243e6e3a904d2f3deb72a6ba456c49233d9af51 (patch)
tree563c176e5d4f6e84a2c2595148525f8f51e68ba6 /source3
parentf96f8f9c7720de8f032f571e81246c59e13550c1 (diff)
downloadsamba-4243e6e3a904d2f3deb72a6ba456c49233d9af51.tar.gz
samba-4243e6e3a904d2f3deb72a6ba456c49233d9af51.tar.bz2
samba-4243e6e3a904d2f3deb72a6ba456c49233d9af51.zip
s3:configure: add support for Solaris' ld -z ignore
try linker flags for ignoring unused libs in this order: -Wl,--as-needed (gcc like + binutils) -Wl,-z,ignore (gcc like + Solaris linker) -z ignore (old Sun C)
Diffstat (limited to 'source3')
-rw-r--r--source3/configure.in18
1 files changed, 7 insertions, 11 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 80a347cd4e..a296a59ca0 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1758,22 +1758,18 @@ fi
AC_MSG_RESULT($BLDSHARED)
-if test x"${ac_cv_prog_gnu_ld}" = x"yes"; then
+for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do
saved_ldflags="$LDFLAGS"
- AC_MSG_CHECKING([if --as-needed works])
- LDFLAGS="--as-needed $saved_ldflags"
- AC_TRY_LINK([],[],
- [AC_MSG_RESULT([yes])
- LD_AS_NEEDED_FLAG=--as-needed],
- AC_MSG_RESULT([no]))
- AC_MSG_CHECKING([if -Wl,--as-needed works])
- LDFLAGS="-Wl,--as-needed $saved_ldflags"
+ AC_MSG_CHECKING([if $flags works])
+ LDFLAGS="$flags $saved_ldflags"
AC_TRY_LINK([],[],
[AC_MSG_RESULT([yes])
- LD_AS_NEEDED_FLAG=-Wl,--as-needed],
+ LD_AS_NEEDED_FLAG=$flags
+ ld_as_needed_flag_found=yes],
AC_MSG_RESULT([no]))
LDFLAGS="$LD_AS_NEEDED_FLAG $saved_ldflags"
-fi
+ test x"$ld_as_needed_flag_found" = xyes && break
+done
# 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