aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac49
1 files changed, 49 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 15270b9..336e05c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,24 +115,73 @@ then
AC_CHECK_FUNCS([msync])
fi
AC_TYPE_OFF_T
AC_CHECK_SIZEOF(off_t)
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_SUBST(GDBM183_LIBRARY)
AC_SUBST(GDBM183_LIBDIR)
AC_SUBST(GDBM183_INCLUDEDIR)
AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])
AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes])
+# Check for Curses libs.
+for lib in ncurses curses termcap
+do
+ AC_CHECK_LIB($lib, tputs, [CURSES_LIBS="-l$lib"; break])
+done
+
+AC_SUBST(CURSES_LIBS)
+# Readline
+AC_ARG_WITH([readline],
+ AC_HELP_STRING([--without-readline],
+ [do not use readline]),
+ [
+case "${withval}" in
+ yes) status_readline=yes ;;
+ no) status_readline=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;;
+esac],[status_readline=probe])
+
+AC_SUBST(READLINE_LIBS)
+
+if test "$status_readline" != "no"; then
+ dnl FIXME This should only link in the curses libraries if it's
+ dnl really needed!
+ saved_LIBS=$LIBS
+ LIBS="$LIBS $CURSES_LIBS"
+ AC_CHECK_LIB(readline, readline,
+ [status_readline=yes],
+ [if test "$status_readline" = "yes"; then
+ AC_MSG_ERROR(readline requested but does not seem to be installed)
+ else
+ status_readline=no
+ fi])
+ LIBS=$saved_LIBS
+
+ if test "$status_readline" = "yes"; then
+ AC_CHECK_HEADERS(readline/readline.h,
+ AC_DEFINE(WITH_READLINE,1,[Enable use of readline]))
+ READLINE_LIBS="-lreadline $CURSES_LIBS"
+ saved_LIBS=$LIBS
+ LIBS="$LIBS $READLINE_LIBS"
+ AC_CHECK_FUNCS(rl_completion_matches)
+ LIBS=$saved_LIBS
+ fi
+else
+ status_readline=no
+fi
+
+AM_CONDITIONAL([GDBM_COND_READLINE], [test "$status_readline" = "yes"])
+
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in])
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AC_CONFIG_FILES([Makefile
src/Makefile
src/gdbm.h
doc/Makefile
compat/Makefile
export/Makefile])
AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.