From 203b608490706094f6e1c0eff14d012747a2d8c6 Mon Sep 17 00:00:00 2001 From: Olaf Flebbe Date: Tue, 25 May 2010 13:22:56 +0200 Subject: [PATCH] check if LD_AS_NEEDED breaks for libreadline --- source3/configure.in | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index 74a2479..fb5a421 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1697,6 +1697,7 @@ fi AC_MSG_RESULT($BLDSHARED) +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]) @@ -1710,6 +1711,22 @@ for flags in "-Wl,--as-needed" "-Wl,-z,ignore" "-z ignore" ; do test x"$ld_as_needed_flag_found" = xyes && break done +# check if we have to disable LD_AS_NEEDED_FLAG +# for details see Bugzilla #7209 + +if test x$ac_cv_lib_readline_rl_callback_handler_install = xyes ; then + if test x$ld_as_needed_flag_found = xyes ; then + AC_MSG_CHECKING([if $LD_AS_NEEDED_FLAG works with readline]) + # try if check no fails + save_LIBS=$LIBS + LIBS="$LIBS $TERMLIBS" + AC_TRY_LINK([], [rl_callback_handler_install();], [AC_MSG_RESULT([yes])],[ AC_MSG_RESULT([no]); LDFLAGS="$saved_before_as_needed_ldflags"]) + LIBS="$save_LIBS" + fi +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 # errors when we produce a shared lib with unresolved symbols. On some -- 1.6.0.2