diff options
author | Jeremy Sowden <jeremy@azazel.net> | 2019-09-24 08:40:54 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-10-15 11:04:54 +0200 |
commit | 023c2d3301a06e2782d39e11ecc3345863a276b1 (patch) | |
tree | d21e01f8c7d49495ef43d24804728140cca93c25 /configure.ac | |
parent | 21cbab5b6ffec409d5677802bcd1172d0d1cd990 (diff) |
cli: add linenoise CLI implementation.
By default, continue to use libreadline, but if `--with-cli=linenoise`
is passed to configure, build the linenoise implementation instead.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 68f97f09..170b6093 100644 --- a/configure.ac +++ b/configure.ac @@ -68,12 +68,21 @@ AC_CHECK_LIB([gmp],[__gmpz_init], , AC_MSG_ERROR([No suitable version of libgmp AM_CONDITIONAL([BUILD_MINIGMP], [test "x$with_mini_gmp" = xyes]) AC_ARG_WITH([cli], [AS_HELP_STRING([--without-cli], - [disable interactive CLI (libreadline support)])], - [], [with_cli=yes]) -AS_IF([test "x$with_cli" != xno], [ + [disable interactive CLI (libreadline or linenoise support)])], + [], [with_cli=readline]) + +AS_IF([test "x$with_cli" = xreadline], [ AC_CHECK_LIB([readline], [readline], , AC_MSG_ERROR([No suitable version of libreadline found])) AC_DEFINE([HAVE_LIBREADLINE], [1], []) +], + [test "x$with_cli" = xlinenoise], [ +AC_CHECK_LIB([linenoise], [linenoise], , + AC_MSG_ERROR([No suitable version of linenoise found])) +AC_DEFINE([HAVE_LIBLINENOISE], [1], []) +], + [test "x$with_cli" != xno], [ +AC_MSG_ERROR([unexpected CLI value: $with_cli]) ]) AM_CONDITIONAL([BUILD_CLI], [test "x$with_cli" != xno]) |