1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add/fix caching on some configure checks

This commit is contained in:
Peter Eisentraut
2010-09-29 22:38:04 +03:00
parent fe48d9471e
commit 804a786c95
4 changed files with 226 additions and 145 deletions

View File

@ -117,7 +117,7 @@ AC_SUBST(FLEXFLAGS)
AC_DEFUN([PGAC_CHECK_READLINE],
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_VAL([pgac_cv_check_readline],
AC_CACHE_CHECK([for library containing readline], [pgac_cv_check_readline],
[pgac_cv_check_readline=no
pgac_save_LIBS=$LIBS
if test x"$with_libedit_preferred" != x"yes"
@ -125,7 +125,6 @@ then READLINE_ORDER="-lreadline -ledit"
else READLINE_ORDER="-ledit -lreadline"
fi
for pgac_rllib in $READLINE_ORDER ; do
AC_MSG_CHECKING([for ${pgac_rllib}])
for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
AC_TRY_LINK_FUNC([readline], [[
@ -144,14 +143,11 @@ for pgac_rllib in $READLINE_ORDER ; do
]])
done
if test "$pgac_cv_check_readline" != no ; then
AC_MSG_RESULT([yes ($pgac_cv_check_readline)])
break
else
AC_MSG_RESULT(no)
fi
done
LIBS=$pgac_save_LIBS
])[]dnl AC_CACHE_VAL
])[]dnl AC_CACHE_CHECK
if test "$pgac_cv_check_readline" != no ; then
LIBS="$pgac_cv_check_readline $LIBS"
@ -167,8 +163,8 @@ fi
# Readline versions < 2.1 don't have rl_completion_append_character
AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER],
[AC_MSG_CHECKING([for rl_completion_append_character])
AC_TRY_LINK([#include <stdio.h>
[AC_CACHE_CHECK([for rl_completion_append_character], pgac_cv_var_rl_completion_append_character,
[AC_TRY_LINK([#include <stdio.h>
#ifdef HAVE_READLINE_READLINE_H
# include <readline/readline.h>
#elif defined(HAVE_READLINE_H)
@ -176,10 +172,12 @@ AC_TRY_LINK([#include <stdio.h>
#endif
],
[rl_completion_append_character = 'x';],
[AC_MSG_RESULT(yes)
[pgac_cv_var_rl_completion_append_character=yes],
[pgac_cv_var_rl_completion_append_character=no])])
if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
[Define to 1 if you have the global variable 'rl_completion_append_character'.])],
[AC_MSG_RESULT(no)])])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
[Define to 1 if you have the global variable 'rl_completion_append_character'.])
fi])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER