diff options
author | Reinhard Tartler <siretart@tauware.de> | 2017-06-11 21:52:33 -0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2017-06-11 21:52:33 -0400 |
commit | e0eb815b67734abd09ff41e2271630d4b2a6d760 (patch) | |
tree | 0df971c34f98d2a1dfd0921524a17d561a4a6536 /infrastructure/m4/vl_lib_readline.m4 | |
parent | 676c9e1c9d4ac8eb8a440d7f11c4ac44f98f4a6a (diff) | |
parent | e19a5db232e1ef90e9a02159d2fbd9707ffe4373 (diff) |
merge upstream version 0.12
Diffstat (limited to 'infrastructure/m4/vl_lib_readline.m4')
-rw-r--r-- | infrastructure/m4/vl_lib_readline.m4 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/infrastructure/m4/vl_lib_readline.m4 b/infrastructure/m4/vl_lib_readline.m4 index a0571bfa..e04a5f5f 100644 --- a/infrastructure/m4/vl_lib_readline.m4 +++ b/infrastructure/m4/vl_lib_readline.m4 @@ -79,6 +79,7 @@ AC_DEFUN([VL_LIB_READLINE], [ fi ]) +<<<<<<< HEAD dnl VL_LIB_READLINE_CHECK(name, libraries, headers, history headers) AC_DEFUN([VL_LIB_READLINE_CHECK], [ AC_CACHE_CHECK([for $1 library], @@ -87,6 +88,26 @@ AC_DEFUN([VL_LIB_READLINE_CHECK], [ vl_cv_lib_$1="" for readline_lib in $2; do for termcap_lib in "" termcap curses ncurses; do +======= +dnl BOX_CHECK_VAR(name, where, headers) +AC_DEFUN([BOX_CHECK_VAR], [ + AC_CACHE_CHECK([for $1 $2], [vl_cv_var_$1], + [AC_TRY_LINK([$3], [(void) $1], [vl_cv_var_$1=yes], [vl_cv_var_$1=no]) + ]) + if test "${vl_cv_var_$1}" = "yes"; then + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1), 1, [Define if you have $1 $2]) + fi + ]) + +dnl VL_LIB_READLINE_CHECK(name, libraries, headers, history headers) +AC_DEFUN([VL_LIB_READLINE_CHECK], [ + ORIG_LIBS="$LIBS" + AC_CACHE_CHECK([for $1 library], + [vl_cv_lib_$1], [ + vl_cv_lib_$1="" + for readline_lib in $2; do + for termcap_lib in "" termcap curses ncurses pdcurses; do +>>>>>>> 0.12 if test -z "$termcap_lib"; then TRY_LIB="-l$readline_lib" else @@ -108,12 +129,44 @@ AC_DEFUN([VL_LIB_READLINE_CHECK], [ fi ]) +<<<<<<< HEAD vl_cv_lib_readline_compat_found=no if test "x$vl_cv_lib_$1" != "xno"; then AC_CHECK_HEADERS([$3], [vl_cv_lib_readline_compat_found=yes]) fi if test "x$vl_cv_lib_readline_compat_found" = "xyes"; then +======= + vl_cv_lib_includes="" + + vl_cv_lib_readline_compat_found=no + if test "x$vl_cv_lib_$1" != "xno"; then + AC_CHECK_HEADERS([$3], [ + vl_cv_lib_readline_compat_found=yes + vl_cv_lib_includes="$vl_cv_lib_headers #include <$ac_header>" + ]) + fi + + AC_TRY_LINK([$vl_cv_lib_includes], [(void) readline;], + [vl_compiles=yes], [vl_compiles=no]) + if test "x$vl_compiles" = "xno"; then + AC_TRY_LINK([#include <stdio.h> + $vl_cv_lib_includes], [(void) readline;], + [vl_compiles_with_stdio=yes], [vl_compiles_with_stdio=no]) + if test "x$vl_compiles_with_stdio" = "xyes"; then + vl_cv_lib_includes="#include <stdio.h> +$vl_cv_lib_includes" + fi + fi + + if test "x$vl_cv_lib_readline_compat_found" = "xyes"; then + BOX_CHECK_VAR([rl_completion_matches], [in readline headers], + [$vl_cv_lib_includes]) + + BOX_CHECK_VAR([completion_matches], [in readline headers], + [$vl_cv_lib_includes]) + +>>>>>>> 0.12 AC_DEFINE([HAVE_LIBREADLINE], 1, [Define if you have a readline compatible library]) |