summaryrefslogtreecommitdiffabout
path: root/configure.ac
authorSergey Poznyakoff <gray@gnu.org.ua>2016-07-12 09:41:15 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2016-07-12 11:34:16 (GMT)
commit89f200b55b309aa67c1fbfc11d4de211725348f4 (patch) (unidiff)
tree39e2e43f29766cbebbdf61f160b5d062ea63c996 /configure.ac
parente8cad816f36b1cad11bb67c96f0ce878cf30844e (diff)
downloadgdbm-89f200b55b309aa67c1fbfc11d4de211725348f4.tar.gz
gdbm-89f200b55b309aa67c1fbfc11d4de211725348f4.tar.bz2
Line-editing support in gdbmtool
* configure.ac: Check if GNU Readline is available. * src/Makefile.am: Add new files. * src/input-rl.c: New file. * src/input-std.c: New file. * src/gdbmtool.c (handler_param): Move declaration to the header file. (quit_handler): Call input_done. (command_tab): Add the "history" command. (command_generator): New function. (slist_new_s, slist_new_l) (slist_insert): New functions. (main): Call input_init and input_done. * src/gdbmtool.h: New protos. * src/gram.y: Use slist_insert to construct string lists. * src/lex.l (read_input): Remove. Use input_read instead. (print_prompt_at_bol): New function. (print_prompt): Remove. (make_prompt): New function. * NEWS: Document changes. * README: Document readline support. * doc/gdbm.texi: Document line editing in gdbmtool. * doc/gdbmtool.1: Likewise.
Diffstat (limited to 'configure.ac') (more/less context) (ignore whitespace changes)
-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
@@ -124,6 +124,55 @@ AC_SUBST(GDBM183_INCLUDEDIR)
124AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes]) 124AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes])
125AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes]) 125AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes])
126 126
127# Check for Curses libs.
128for lib in ncurses curses termcap
129do
130 AC_CHECK_LIB($lib, tputs, [CURSES_LIBS="-l$lib"; break])
131done
132
133AC_SUBST(CURSES_LIBS)
134# Readline
135AC_ARG_WITH([readline],
136 AC_HELP_STRING([--without-readline],
137 [do not use readline]),
138 [
139case "${withval}" in
140 yes) status_readline=yes ;;
141 no) status_readline=no ;;
142 *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;;
143esac],[status_readline=probe])
144
145AC_SUBST(READLINE_LIBS)
146
147if test "$status_readline" != "no"; then
148 dnl FIXME This should only link in the curses libraries if it's
149 dnl really needed!
150 saved_LIBS=$LIBS
151 LIBS="$LIBS $CURSES_LIBS"
152 AC_CHECK_LIB(readline, readline,
153 [status_readline=yes],
154 [if test "$status_readline" = "yes"; then
155 AC_MSG_ERROR(readline requested but does not seem to be installed)
156 else
157 status_readline=no
158 fi])
159 LIBS=$saved_LIBS
160
161 if test "$status_readline" = "yes"; then
162 AC_CHECK_HEADERS(readline/readline.h,
163 AC_DEFINE(WITH_READLINE,1,[Enable use of readline]))
164 READLINE_LIBS="-lreadline $CURSES_LIBS"
165 saved_LIBS=$LIBS
166 LIBS="$LIBS $READLINE_LIBS"
167 AC_CHECK_FUNCS(rl_completion_matches)
168 LIBS=$saved_LIBS
169 fi
170else
171 status_readline=no
172fi
173
174AM_CONDITIONAL([GDBM_COND_READLINE], [test "$status_readline" = "yes"])
175
127# Initialize the test suite. 176# Initialize the test suite.
128AC_CONFIG_TESTDIR(tests) 177AC_CONFIG_TESTDIR(tests)
129AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in]) 178AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in])

Return to:

Send suggestions and report system problems to the System administrator.