summaryrefslogtreecommitdiffstats
path: root/src/configure.in
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-07-22 00:26:56 +0000
committerGreg Hudson <ghudson@mit.edu>2011-07-22 00:26:56 +0000
commited8bc7b5e8ba1f72a0ae083b3005fbe18718544b (patch)
treefc6cd75398fa2adb8ce685a50fcf56d5ee193e43 /src/configure.in
parent0d1a70cd014579f6134d73fc073dc090f574e1c8 (diff)
downloadkrb5-ed8bc7b5e8ba1f72a0ae083b3005fbe18718544b.tar.gz
krb5-ed8bc7b5e8ba1f72a0ae083b3005fbe18718544b.tar.xz
krb5-ed8bc7b5e8ba1f72a0ae083b3005fbe18718544b.zip
Add libedit/readline support to ss
By default, look for libedit (using pkg-config) and use it in libss. Alternatively, the builder can explicitly ask for GNU Readline, but using it will break the dejagnu test suite and will also add a GPL dependency to libss and the programs using it. ticket: 6931 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25035 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/configure.in')
-rw-r--r--src/configure.in38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/configure.in b/src/configure.in
index 4ed9e31e37..b057a3b483 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1100,6 +1100,44 @@ if test "$ac_cv_lib_socket" = "yes" -a "$ac_cv_lib_nsl" = "yes"; then
AC_DEFINE(BROKEN_STREAMS_SOCKETS,1,[Define if socket can't be bound to 0.0.0.0])
fi
+# Compile with libedit support in ss by default if available. Compile
+# with readline only if asked, to avoid a default GPL dependency.
+# Building with readline also breaks the dejagnu test suite.
+AC_ARG_WITH([libedit],
+ AC_HELP_STRING([--without-libedit], [do not compile with libedit]),
+ [], [with_libedit=default])
+AC_ARG_WITH([readline],
+ AC_HELP_STRING([--with-readline], [compile with GNU Readline]),
+ [], [with_readline=no])
+AC_MSG_CHECKING([for readline support])
+if test "x$with_readline" = xyes; then
+ with_libedit=no
+fi
+RL_CFLAGS=
+RL_LIBS=
+if test "x$with_libedit" != xno; then
+ if RL_CFLAGS=`pkg-config --cflags libedit 2>&1`; then
+ RL_LIBS=`pkg-config --libs libedit`
+ AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
+ AC_MSG_RESULT([using libedit])
+ elif test "x$with_libedit" = yes; then
+ # We were explicitly asked for libedit and couldn't find it.
+ AC_MSG_ERROR([Could not detect libedit with pkg-config.])
+ else
+ AC_MSG_RESULT([not using any])
+ fi
+elif test "x$with_readline" = xyes; then
+ AC_MSG_RESULT([using GNU Readline])
+ AC_CHECK_LIB([readline], [main], :,
+ AC_MSG_FAILURE([Cannot find readline library.]), [-lncurses])
+ AC_DEFINE([HAVE_READLINE], 1, [Define if building with GNU Readline.])
+ RL_LIBS='-lreadline -lhistory -lncurses'
+else
+ AC_MSG_RESULT([not using any])
+fi
+AC_SUBST([RL_CFLAGS])
+AC_SUBST([RL_LIBS])
+
AC_CONFIG_FILES(krb5-config, [chmod +x krb5-config])
V5_AC_OUTPUT_MAKEFILE(.