]> git.draconx.ca Git - cdecl99.git/blobdiff - configure.ac
Add basic readline history support.
[cdecl99.git] / configure.ac
index 3be31270ae2ccd41e0f60d1e12d020116ab57696..0b9bab10e6fd10134028855e7edc06f60d57a0ab 100644 (file)
@@ -18,6 +18,25 @@ gl_EARLY
 LT_INIT
 gl_INIT
 
+AC_CACHE_CHECK([if readline supports add_history], [dx_cv_rl_add_history], [dnl
+dx_cv_rl_add_history=no
+dx_save_libs=$LIBS
+LIBS="$LIBS $LIBREADLINE"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
+#include <stdio.h>
+#if HAVE_READLINE_HISTORY_H
+#  include <readline/history.h>
+#endif
+], [dnl
+(*add_history)("");
+])], [dx_cv_rl_add_history=yes], [dx_cv_rl_add_history=no])
+LIBS=$dx_save_libs
+])
+
+AS_IF([test x"$dx_cv_rl_add_history" = x"yes"],
+       [AC_DEFINE([HAVE_RL_ADD_HISTORY], [1],
+               [Define to 1 if readline supports add_history.])])
+
 m4_include([lib/gnulib.mk])
 DX_GLSYM_PREFIX([cdecl__])