diff --git a/config/programs.m4 b/config/programs.m4
index 41bda91ccff4ffed3fd5827fb62a0e3bc938de62..cf659555c07eacd998d46035b22d4dbccbfb47ce 100644
--- a/config/programs.m4
+++ b/config/programs.m4
@@ -1,4 +1,4 @@
-# $PostgreSQL: pgsql/config/programs.m4,v 1.22 2008/02/17 16:36:42 petere Exp $
+# $PostgreSQL: pgsql/config/programs.m4,v 1.23 2008/05/27 22:18:04 tgl Exp $
 
 
 # PGAC_PATH_YACC
@@ -187,10 +187,13 @@ AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
 
 # PGAC_CHECK_GETTEXT
 # ------------------
+# We check for bind_textdomain_codeset() not just gettext().  GNU gettext
+# before 0.10.36 does not have that function, and is generally too incomplete
+# to be usable.
 
 AC_DEFUN([PGAC_CHECK_GETTEXT],
 [
-  AC_SEARCH_LIBS(gettext, intl, [],
+  AC_SEARCH_LIBS(bind_textdomain_codeset, intl, [],
                  [AC_MSG_ERROR([a gettext implementation is required for NLS])])
   AC_CHECK_HEADER([libintl.h], [],
                   [AC_MSG_ERROR([header file <libintl.h> is required for NLS])])
@@ -199,7 +202,6 @@ AC_DEFUN([PGAC_CHECK_GETTEXT],
     AC_MSG_ERROR([msgfmt is required for NLS])
   fi
   AC_CHECK_PROGS(MSGMERGE, msgmerge)
-dnl FIXME: We should probably check for version >=0.10.36.
   AC_CHECK_PROGS(XGETTEXT, xgettext)
 ])# PGAC_CHECK_GETTEXT
 
diff --git a/configure b/configure
index 6b9b88d15922dff852d85d7fcb8bee0e41ae43ac..f493808442cb2c2b8c758c7db8a300e057bcefca 100755
--- a/configure
+++ b/configure
@@ -24625,9 +24625,9 @@ _ACEOF
 
 if test "$enable_nls" = yes ; then
 
-  { echo "$as_me:$LINENO: checking for library containing gettext" >&5
-echo $ECHO_N "checking for library containing gettext... $ECHO_C" >&6; }
-if test "${ac_cv_search_gettext+set}" = set; then
+  { echo "$as_me:$LINENO: checking for library containing bind_textdomain_codeset" >&5
+echo $ECHO_N "checking for library containing bind_textdomain_codeset... $ECHO_C" >&6; }
+if test "${ac_cv_search_bind_textdomain_codeset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -24644,11 +24644,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char gettext ();
+char bind_textdomain_codeset ();
 int
 main ()
 {
-return gettext ();
+return bind_textdomain_codeset ();
   ;
   return 0;
 }
@@ -24678,7 +24678,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
-  ac_cv_search_gettext=$ac_res
+  ac_cv_search_bind_textdomain_codeset=$ac_res
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -24688,21 +24688,21 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
-  if test "${ac_cv_search_gettext+set}" = set; then
+  if test "${ac_cv_search_bind_textdomain_codeset+set}" = set; then
   break
 fi
 done
-if test "${ac_cv_search_gettext+set}" = set; then
+if test "${ac_cv_search_bind_textdomain_codeset+set}" = set; then
   :
 else
-  ac_cv_search_gettext=no
+  ac_cv_search_bind_textdomain_codeset=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_gettext" >&5
-echo "${ECHO_T}$ac_cv_search_gettext" >&6; }
-ac_res=$ac_cv_search_gettext
+{ echo "$as_me:$LINENO: result: $ac_cv_search_bind_textdomain_codeset" >&5
+echo "${ECHO_T}$ac_cv_search_bind_textdomain_codeset" >&6; }
+ac_res=$ac_cv_search_bind_textdomain_codeset
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"