summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/popt/config.m41
-rw-r--r--source4/lib/replace/readline.m423
2 files changed, 19 insertions, 5 deletions
diff --git a/source4/lib/popt/config.m4 b/source4/lib/popt/config.m4
index 0eca06ceed..41d49993e0 100644
--- a/source4/lib/popt/config.m4
+++ b/source4/lib/popt/config.m4
@@ -35,6 +35,7 @@ else
[],
[EXT_LIB_POPT])
SMB_EXT_LIB(POPT, [${TMP_LIBPOPT_LIBS}])
+ SMB_EXT_LIB_ENABLE(POPT,YES)
AC_MSG_RESULT(no)
fi
diff --git a/source4/lib/replace/readline.m4 b/source4/lib/replace/readline.m4
index 0d1aa60d17..8248a1d900 100644
--- a/source4/lib/replace/readline.m4
+++ b/source4/lib/replace/readline.m4
@@ -2,6 +2,7 @@
# Readline included by default unless explicitly asked not to
test "${with_readline+set}" != "set" && with_readline=yes
+EXTERNAL_READLINE=no
# test for where we get readline() from
AC_MSG_CHECKING(whether to use readline)
AC_ARG_WITH(readline,
@@ -19,7 +20,7 @@ AC_ARG_WITH(readline,
done
AC_CHECK_LIB(readline, rl_callback_handler_install,
[TERMLIBS="-lreadline $TERMLIBS"
- AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
+ EXTERNAL_READLINE=yes
break], [TERMLIBS=], $TERMLIBS)])
;;
no)
@@ -50,7 +51,7 @@ AC_ARG_WITH(readline,
LDFLAGS="-L$with_readline/lib $LDFLAGS"
CPPFLAGS="-I$with_readline/include $CPPFLAGS"
TERMLIBS="-lreadline $TERMLIBS"
- AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
+ EXTERNAL_READLINE=yes
break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
;;
@@ -67,6 +68,18 @@ AC_CHECK_LIB(readline, rl_completion_matches,
[],
[$TERMLIBS])
-SMB_EXT_LIB(READLINE, [${TERMLIBS}])
-
-SMB_SUBSYSTEM(LIBREADLINE, [lib/replace/readline.o], [EXT_LIB_READLINE])
+AC_MSG_CHECKING(whether to use extern readline)
+if test x"$EXTERNAL_READLINE" = x"yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
+ SMB_SUBSYSTEM(LIBREADLINE,
+ [lib/replace/readline.o],
+ [EXT_LIB_READLINE])
+ SMB_EXT_LIB(READLINE, [${TERMLIBS}])
+ SMB_EXT_LIB_ENABLE(READLINE,YES)
+else
+ SMB_SUBSYSTEM(LIBREADLINE,
+ [lib/replace/readline.o],
+ [])
+ AC_MSG_RESULT(no)
+fi