mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 10:14:41 +00:00
m4: ax_lib_readline.m4: Use readline libraries when linking add_history test program
Up till now the AC_LANG_CALL() was just checking if program which uses the add_history call can be correctly linked without passing required libraries (e.g. -libreadline to LIBS variable). This commit fixes this issue as now the add_history can be found as it is now available in any of passed libs.
This commit is contained in:
parent
11d59f81cf
commit
552e00990d
|
@ -94,11 +94,15 @@ AC_DEFUN([AX_LIB_READLINE], [
|
|||
AC_DEFINE(HAVE_LIBREADLINE, 1,
|
||||
[Define if you have a readline compatible library])
|
||||
AC_CHECK_HEADERS(readline.h readline/readline.h)
|
||||
ORIG_LIBS="$LIBS"
|
||||
LIBS="$ORIG_LIBS $ax_cv_lib_readline"
|
||||
AC_CACHE_CHECK([whether readline supports history],
|
||||
ax_cv_lib_readline_history, [
|
||||
ax_cv_lib_readline_history="no"
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [add_history])], [ax_cv_lib_readline_history="yes"])
|
||||
])
|
||||
LIBS=$ORIG_LIBS
|
||||
|
||||
if test "$ax_cv_lib_readline_history" = "yes"; then
|
||||
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
|
||||
[Define if your readline library has \`add_history'])
|
||||
|
|
Loading…
Reference in a new issue