summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-07-02 09:57:28 +1000
committerJiri Gaisler <jiri@gaisler.se>2019-07-02 22:03:52 +0200
commitd509fe6c57f18e2534c586e7dde844811c76a146 (patch)
tree6e667f33725e141a9af9ae166f9ecbfa1c90deb2 /configure.ac
parent787997a6e90e22537d61f4c155ac0a5bf2018109 (diff)
Make readline conditional and add linenoise it not present.
- Readline is not present on all hosts is used on and it has not been a requirement. Rather than break all hosts that are working this patch conditionally adds linenoise a small simple realline replacement.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 4b13030..1ae95d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,11 +5,13 @@ AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC
AC_CHECK_HEADERS([fcntl.h stddef.h stdlib.h string.h sys/time.h unistd.h termios.h])
-AC_CONFIG_FILES([Makefile])
-
-AC_CHECK_LIB(readline, readline, READLINE=-lreadline,
- AC_ERROR([the required "readline" library is missing]), $READLINE)
+AC_CHECK_LIB(readline, readline,
+ [AC_DEFINE([HAVE_READLINE], [1], ["readline found"]) READLINE=-lreadline] linenoise=false,
+ [linenoise=true], $READLINE)
AC_SUBST(READLINE)
+AM_CONDITIONAL([LINENOISE], [test x$linenoise = xtrue])
+AC_SUBST(LINENOISE)
+AC_CONFIG_FILES([Makefile])
AC_ARG_ENABLE([l1cache], [ --enable-l1cache enable L1 cache emulation])
AS_IF([test "x$enable_l1cache" = "xyes"],
@@ -18,4 +20,3 @@ AS_IF([test "x$enable_l1cache" = "xyes"],
AC_C_BIGENDIAN
AC_OUTPUT
-