diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 49 |
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) | |||
124 | AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes]) | 124 | AM_CONDITIONAL([COMPAT_OPT], [test "$want_compat" = yes]) |
125 | AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes]) | 125 | AM_CONDITIONAL([ENABLE_EXPORT], [test "$want_export" = yes]) |
126 | 126 | ||
127 | # Check for Curses libs. | ||
128 | for lib in ncurses curses termcap | ||
129 | do | ||
130 | AC_CHECK_LIB($lib, tputs, [CURSES_LIBS="-l$lib"; break]) | ||
131 | done | ||
132 | |||
133 | AC_SUBST(CURSES_LIBS) | ||
134 | # Readline | ||
135 | AC_ARG_WITH([readline], | ||
136 | AC_HELP_STRING([--without-readline], | ||
137 | [do not use readline]), | ||
138 | [ | ||
139 | case "${withval}" in | ||
140 | yes) status_readline=yes ;; | ||
141 | no) status_readline=no ;; | ||
142 | *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;; | ||
143 | esac],[status_readline=probe]) | ||
144 | |||
145 | AC_SUBST(READLINE_LIBS) | ||
146 | |||
147 | if 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 | ||
170 | else | ||
171 | status_readline=no | ||
172 | fi | ||
173 | |||
174 | AM_CONDITIONAL([GDBM_COND_READLINE], [test "$status_readline" = "yes"]) | ||
175 | |||
127 | # Initialize the test suite. | 176 | # Initialize the test suite. |
128 | AC_CONFIG_TESTDIR(tests) | 177 | AC_CONFIG_TESTDIR(tests) |
129 | AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in]) | 178 | AC_CONFIG_FILES([tests/Makefile tests/atlocal po/Makefile.in]) |