Commit bad50504 bad5050473d78fe11404a132a3aec796c39ed3e0 by Jeff Bailey

Add readline test.

1 parent 66297830
...@@ -19,3 +19,7 @@ ...@@ -19,3 +19,7 @@
19 #undef USE_LIBPAM 19 #undef USE_LIBPAM
20 #undef HAVE_SNPRINTF 20 #undef HAVE_SNPRINTF
21 #undef WITH_PTHREAD 21 #undef WITH_PTHREAD
22
23 /* Define if using libreadline */
24 #undef WITH_READLINE
25
......
...@@ -26,6 +26,14 @@ AC_ARG_ENABLE(pthread, ...@@ -26,6 +26,14 @@ AC_ARG_ENABLE(pthread,
26 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pthread) ;; 26 *) AC_MSG_ERROR(bad value ${enableval} for --disable-pthread) ;;
27 esac],[usepthread=yes]) 27 esac],[usepthread=yes])
28 28
29 AC_ARG_WITH(readline,
30 [ --without-readline do not use readline],
31 [case "${withval}" in
32 yes) usereadline=yes ;;
33 no) usereadline=no ;;
34 *) AC_MSG_ERROR(bad value ${withval} for --without-readline) ;;
35 esac],[usereadline=yes])
36
29 dnl Check for headers 37 dnl Check for headers
30 AC_HEADER_STDC 38 AC_HEADER_STDC
31 AC_HEADER_DIRENT 39 AC_HEADER_DIRENT
...@@ -85,6 +93,12 @@ AC_CHECK_FUNC(gethostbyname, [true], ...@@ -85,6 +93,12 @@ AC_CHECK_FUNC(gethostbyname, [true],
85 AC_CHECK_FUNC(socket, [true], 93 AC_CHECK_FUNC(socket, [true],
86 AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS")) 94 AC_CHECK_LIB(socket, socket, LIBS="-lsocket $LIBS"))
87 95
96 dnl Check for readline
97 if test x"$usereadline" = x"yes"; then
98 AC_CHECK_LIB(readline, readline,
99 AC_CHECK_HEADERS(readline/readline.h, AC_DEFINE(WITH_READLINE)))
100 fi
101
88 dnl Output Makefiles 102 dnl Output Makefiles
89 AC_OUTPUT(Makefile mailutils.spec include/Makefile include/mailutils/Makefile 103 AC_OUTPUT(Makefile mailutils.spec include/Makefile include/mailutils/Makefile
90 m4/Makefile doc/Makefile lib/Makefile mailbox/Makefile imap4d/Makefile 104 m4/Makefile doc/Makefile lib/Makefile mailbox/Makefile imap4d/Makefile
......