-# check for libraries
-if test "x${with_readline}" != xno; then
- AC_CHECK_LIB([readline], [readline], [], [
- if test "x${with_readline}" = xyes; then
- AC_MSG_ERROR([
-----------------------------------------
-Unable to find readline library
-----------------------------------------])
- fi
+AS_IF([test "x${with_readline}" != "xno"], [
+ AC_CHECK_LIB([readline], [readline], [
+ AC_SUBST([READLINE_LIBS], [-lreadline])
+ AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline])
+ ], [
+ AC_MSG_FAILURE([readline test failed (--without-readline to disable)])