From 4ff045b266deadb3b1ce4a4466edbbfb7ef1f92f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 9 May 2011 11:04:19 -0400 Subject: [PATCH] Cache the status of the initial gettext() check. --- configure | 14 ++++++++++++++ configure.in | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 91205acac..1b66a38b3 100755 --- a/configure +++ b/configure @@ -16709,6 +16709,12 @@ done # make sure we use the gettext() that matches the include file. # First check that it links w/o additional libs, then try with -lintl. if test "$enable_nls" = "yes"; then + if test "${sudo_cv_gettext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext" >&5 +$as_echo_n "checking for gettext... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16724,11 +16730,17 @@ main () _ACEOF if ac_fn_c_try_link "$LINENO"; then : + sudo_cv_gettext=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_gettext" >&5 +$as_echo "$sudo_cv_gettext" >&6; } $as_echo "#define HAVE_LIBINTL_H 1" >>confdefs.h else + sudo_cv_gettext=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $sudo_cv_gettext" >&5 +$as_echo "$sudo_cv_gettext" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5 $as_echo_n "checking for gettext in -lintl... " >&6; } if test "${ac_cv_lib_intl_gettext+set}" = set; then : @@ -16822,6 +16834,8 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi +fi + case ${enable_zlib-"yes"} in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzdopen in -lz" >&5 diff --git a/configure.in b/configure.in index 13f0870e7..92cd83c7c 100644 --- a/configure.in +++ b/configure.in @@ -2151,12 +2151,18 @@ AC_CHECK_FUNCS(getprogname, , [ # make sure we use the gettext() that matches the include file. # First check that it links w/o additional libs, then try with -lintl. if test "$enable_nls" = "yes"; then + AC_CACHE_VAL(sudo_cv_gettext, [ + AC_MSG_CHECKING([for gettext]) AC_LINK_IFELSE( [ AC_LANG_PROGRAM([[#include ]], [(void)gettext((char *)0);]) ], [ + sudo_cv_gettext=yes + AC_MSG_RESULT($sudo_cv_gettext) AC_DEFINE(HAVE_LIBINTL_H) ], [ + sudo_cv_gettext=no + AC_MSG_RESULT($sudo_cv_gettext) AC_CHECK_LIB(intl, gettext, [LIBS="${LIBS} -lintl"] [AC_DEFINE(HAVE_LIBINTL_H)], @@ -2164,7 +2170,7 @@ if test "$enable_nls" = "yes"; then AC_CHECK_LIB(intl, gettext, [LIBS="${LIBS} -lintl -liconv"] AC_DEFINE(HAVE_LIBINTL_H), [], [-liconv]) ]) - ]) + ])]) fi dnl -- 2.50.1