summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Flebbe <o.flebbe@science-computing.de>2010-05-25 13:22:56 +0200
committerKarolin Seeger <kseeger@samba.org>2010-06-18 08:33:33 +0200
commit5e6dbbb3ffbb388f8a934c8ee9a9c15f68cb50a5 (patch)
treeacaf490491973f01836587559ce1105d465a5380
parent864a2bd71f17c869356770a0d34fbf828b9aa27f (diff)
downloadsamba-5e6dbbb3ffbb388f8a934c8ee9a9c15f68cb50a5.tar.gz
check if LD_AS_NEEDED breaks linking with libreadline fixes #7209
Signed-off-by: Simo Sorce <idra@samba.org> (cherry picked from commit 7aa8af144efc6d57f33b90ac856096aa7089468d) (cherry picked from commit f2330cc029243c70043b18554241363d890c96e7)
-rw-r--r--source3/configure.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 416fb67ec78..4e9ee1ba604 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1706,6 +1706,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])
@@ -1719,6 +1720,25 @@ 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:
+# On some systems for a veriety of reasons linking with
+# -Wl,--as-needed -lreadline -lncurses fails
+# we have to retest, if these combination is detected before.
+# 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