mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Require bind_textdomain_codeset() not just gettext() to enable NLS support.
GNU gettext before 0.10.36 does not have that function, and is generally too incomplete to be usable.
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
				
			|||||||
# $PostgreSQL: pgsql/config/programs.m4,v 1.21 2007/07/19 17:15:30 tgl Exp $
 | 
					# $PostgreSQL: pgsql/config/programs.m4,v 1.21.2.1 2008/05/27 22:18:11 tgl Exp $
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# PGAC_PATH_YACC
 | 
					# PGAC_PATH_YACC
 | 
				
			||||||
@@ -187,10 +187,13 @@ AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# PGAC_CHECK_GETTEXT
 | 
					# 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_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_MSG_ERROR([a gettext implementation is required for NLS])])
 | 
				
			||||||
  AC_CHECK_HEADER([libintl.h], [],
 | 
					  AC_CHECK_HEADER([libintl.h], [],
 | 
				
			||||||
                  [AC_MSG_ERROR([header file <libintl.h> is required for NLS])])
 | 
					                  [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])
 | 
					    AC_MSG_ERROR([msgfmt is required for NLS])
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  AC_CHECK_PROGS(MSGMERGE, msgmerge)
 | 
					  AC_CHECK_PROGS(MSGMERGE, msgmerge)
 | 
				
			||||||
dnl FIXME: We should probably check for version >=0.10.36.
 | 
					 | 
				
			||||||
  AC_CHECK_PROGS(XGETTEXT, xgettext)
 | 
					  AC_CHECK_PROGS(XGETTEXT, xgettext)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Note: share/locale is always the default, independent of $datadir
 | 
					  # Note: share/locale is always the default, independent of $datadir
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										30
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										30
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -24248,13 +24248,13 @@ _ACEOF
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
if test "$enable_nls" = yes ; then
 | 
					if test "$enable_nls" = yes ; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  echo "$as_me:$LINENO: checking for library containing gettext" >&5
 | 
					  echo "$as_me:$LINENO: checking for library containing bind_textdomain_codeset" >&5
 | 
				
			||||||
echo $ECHO_N "checking for library containing gettext... $ECHO_C" >&6
 | 
					echo $ECHO_N "checking for library containing bind_textdomain_codeset... $ECHO_C" >&6
 | 
				
			||||||
if test "${ac_cv_search_gettext+set}" = set; then
 | 
					if test "${ac_cv_search_bind_textdomain_codeset+set}" = set; then
 | 
				
			||||||
  echo $ECHO_N "(cached) $ECHO_C" >&6
 | 
					  echo $ECHO_N "(cached) $ECHO_C" >&6
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  ac_func_search_save_LIBS=$LIBS
 | 
					  ac_func_search_save_LIBS=$LIBS
 | 
				
			||||||
ac_cv_search_gettext=no
 | 
					ac_cv_search_bind_textdomain_codeset=no
 | 
				
			||||||
cat >conftest.$ac_ext <<_ACEOF
 | 
					cat >conftest.$ac_ext <<_ACEOF
 | 
				
			||||||
/* confdefs.h.  */
 | 
					/* confdefs.h.  */
 | 
				
			||||||
_ACEOF
 | 
					_ACEOF
 | 
				
			||||||
@@ -24268,11 +24268,11 @@ extern "C"
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
/* We use char because int might match the return type of a gcc2
 | 
					/* We use char because int might match the return type of a gcc2
 | 
				
			||||||
   builtin and then its argument prototype would still apply.  */
 | 
					   builtin and then its argument prototype would still apply.  */
 | 
				
			||||||
char gettext ();
 | 
					char bind_textdomain_codeset ();
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
main ()
 | 
					main ()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
gettext ();
 | 
					bind_textdomain_codeset ();
 | 
				
			||||||
  ;
 | 
					  ;
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -24299,7 +24299,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 | 
				
			|||||||
  ac_status=$?
 | 
					  ac_status=$?
 | 
				
			||||||
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 | 
					  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 | 
				
			||||||
  (exit $ac_status); }; }; then
 | 
					  (exit $ac_status); }; }; then
 | 
				
			||||||
  ac_cv_search_gettext="none required"
 | 
					  ac_cv_search_bind_textdomain_codeset="none required"
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  echo "$as_me: failed program was:" >&5
 | 
					  echo "$as_me: failed program was:" >&5
 | 
				
			||||||
sed 's/^/| /' conftest.$ac_ext >&5
 | 
					sed 's/^/| /' conftest.$ac_ext >&5
 | 
				
			||||||
@@ -24307,7 +24307,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
rm -f conftest.err conftest.$ac_objext \
 | 
					rm -f conftest.err conftest.$ac_objext \
 | 
				
			||||||
      conftest$ac_exeext conftest.$ac_ext
 | 
					      conftest$ac_exeext conftest.$ac_ext
 | 
				
			||||||
if test "$ac_cv_search_gettext" = no; then
 | 
					if test "$ac_cv_search_bind_textdomain_codeset" = no; then
 | 
				
			||||||
  for ac_lib in intl; do
 | 
					  for ac_lib in intl; do
 | 
				
			||||||
    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 | 
					    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 | 
				
			||||||
    cat >conftest.$ac_ext <<_ACEOF
 | 
					    cat >conftest.$ac_ext <<_ACEOF
 | 
				
			||||||
@@ -24323,11 +24323,11 @@ extern "C"
 | 
				
			|||||||
#endif
 | 
					#endif
 | 
				
			||||||
/* We use char because int might match the return type of a gcc2
 | 
					/* We use char because int might match the return type of a gcc2
 | 
				
			||||||
   builtin and then its argument prototype would still apply.  */
 | 
					   builtin and then its argument prototype would still apply.  */
 | 
				
			||||||
char gettext ();
 | 
					char bind_textdomain_codeset ();
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
main ()
 | 
					main ()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
gettext ();
 | 
					bind_textdomain_codeset ();
 | 
				
			||||||
  ;
 | 
					  ;
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -24354,7 +24354,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 | 
				
			|||||||
  ac_status=$?
 | 
					  ac_status=$?
 | 
				
			||||||
  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 | 
					  echo "$as_me:$LINENO: \$? = $ac_status" >&5
 | 
				
			||||||
  (exit $ac_status); }; }; then
 | 
					  (exit $ac_status); }; }; then
 | 
				
			||||||
  ac_cv_search_gettext="-l$ac_lib"
 | 
					  ac_cv_search_bind_textdomain_codeset="-l$ac_lib"
 | 
				
			||||||
break
 | 
					break
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  echo "$as_me: failed program was:" >&5
 | 
					  echo "$as_me: failed program was:" >&5
 | 
				
			||||||
@@ -24367,10 +24367,10 @@ rm -f conftest.err conftest.$ac_objext \
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
LIBS=$ac_func_search_save_LIBS
 | 
					LIBS=$ac_func_search_save_LIBS
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
echo "$as_me:$LINENO: result: $ac_cv_search_gettext" >&5
 | 
					echo "$as_me:$LINENO: result: $ac_cv_search_bind_textdomain_codeset" >&5
 | 
				
			||||||
echo "${ECHO_T}$ac_cv_search_gettext" >&6
 | 
					echo "${ECHO_T}$ac_cv_search_bind_textdomain_codeset" >&6
 | 
				
			||||||
if test "$ac_cv_search_gettext" != no; then
 | 
					if test "$ac_cv_search_bind_textdomain_codeset" != no; then
 | 
				
			||||||
  test "$ac_cv_search_gettext" = "none required" || LIBS="$ac_cv_search_gettext $LIBS"
 | 
					  test "$ac_cv_search_bind_textdomain_codeset" = "none required" || LIBS="$ac_cv_search_bind_textdomain_codeset $LIBS"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  { { echo "$as_me:$LINENO: error: a gettext implementation is required for NLS" >&5
 | 
					  { { echo "$as_me:$LINENO: error: a gettext implementation is required for NLS" >&5
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user