diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 33e01db..e6db568 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,36 @@ +AC_DEFUN(AC_CHECK_READLINE, +[ + AC_MSG_CHECKING(for readline in -lreadline) + ac_cv_addcurses=false + ac_cv_have_libreadline=false + saved_libs=$LIBS + LIBS="$LIBS -lreadline" + link1ok=0 + link2ok=0 + AC_TRY_LINK(,[extern char *readline(void); readline();],link1ok=1) + LIBS="$LIBS -lreadline -lcurses" + AC_TRY_LINK(,[extern char *readline(void); readline();],link2ok=1) + LIBS="$saved_LIBS" + case "$link1ok$link2ok" in + 00) + AC_MSG_RESULT(no) + ;; + 01) + ac_cv_have_libreadline=true; + ac_cv_addcurses=true + AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE) + AC_MSG_RESULT([yes, and needs libcurses]) + ;; + 1*) + ac_cv_have_libreadline=true; + AC_DEFINE_UNQUOTED(HAVE_LIBREADLINE) + AC_MSG_RESULT(yes) + ;; + esac + AM_CONDITIONAL(HAVE_LIBREADLINE, test x$ac_cv_have_libreadline = xtrue) + AM_CONDITIONAL(ADD_LIBCURSES, test x$ac_cv_addcurses = xtrue) +]) + AC_DEFUN(AC_FIND_FILE, [ $2=NO |