Commit 8b91a2d0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Resync gettext with contrib

parent 609cba8d
...@@ -356,7 +356,7 @@ dnl ...@@ -356,7 +356,7 @@ dnl
dnl Gettext stuff dnl Gettext stuff
dnl dnl
ALL_LINGUAS="af ar bn ca co cs da de el en_GB es eu fa fr fur gl he hi hu it ja ka ko lt lv ms my ne nl no oc pa pl ps pt_BR pt_PT ro ru sk sl sq sv tet th tl tr zh_CN zh_TW" ALL_LINGUAS="af ar bn ca co cs da de el en_GB es eu fa fr fur gl he hi hu it ja ka ko lt lv ms my ne nl no oc pa pl ps pt_BR pt_PT ro ru sk sl sq sv tet th tl tr zh_CN zh_TW"
AM_GNU_GETTEXT_VERSION(0.11.5) AM_GNU_GETTEXT_VERSION(0.16.1)
AM_GNU_GETTEXT AM_GNU_GETTEXT
AS_IF([test "${nls_cv_force_use_gnu_gettext}" = "yes"], [ AS_IF([test "${nls_cv_force_use_gnu_gettext}" = "yes"], [
AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, [Define if we use the local libintl]) AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, [Define if we use the local libintl])
...@@ -821,7 +821,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[ ...@@ -821,7 +821,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_MSG_RESULT(no)]) AC_MSG_RESULT(no)])
dnl Check for headers dnl Check for headers
AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h stdbool.h getopt.h strings.h inttypes.h sys/int_types.h wchar.h) AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h stdbool.h getopt.h strings.h inttypes.h sys/int_types.h wchar.h locale.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h) AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
AC_CHECK_HEADERS([arpa/inet.h net/if.h netinet/in.h sys/socket.h netinet/udplite.h]) AC_CHECK_HEADERS([arpa/inet.h net/if.h netinet/in.h sys/socket.h netinet/udplite.h])
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
......
...@@ -12,6 +12,8 @@ EXTRA_DIST = \ ...@@ -12,6 +12,8 @@ EXTRA_DIST = \
glibc21.m4 \ glibc21.m4 \
iconv.m4 \ iconv.m4 \
intdiv0.m4 \ intdiv0.m4 \
intl.m4 \
intldir.m4 \
inttypes-pri.m4 \ inttypes-pri.m4 \
inttypes.m4 \ inttypes.m4 \
inttypes_h.m4 \ inttypes_h.m4 \
...@@ -20,11 +22,13 @@ EXTRA_DIST = \ ...@@ -20,11 +22,13 @@ EXTRA_DIST = \
lib-ld.m4 \ lib-ld.m4 \
lib-link.m4 \ lib-link.m4 \
lib-prefix.m4 \ lib-prefix.m4 \
lock.m4
private.m4 \ private.m4 \
progtest.m4 \ progtest.m4 \
stdint_h.m4 \ stdint_h.m4 \
uintmax_t.m4 \ uintmax_t.m4 \
ulonglong.m4 \ ulonglong.m4 \
visibility.m4 \
vlc.m4 \ vlc.m4 \
flags.m4 \ flags.m4 \
$(NULL) $(NULL)
......
# codeset.m4 serial AM1 (gettext-0.10.40) # codeset.m4 serial 2 (gettext-0.16)
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU dnl This file is free software; the Free Software Foundation
dnl General Public License. As a special exception to the GNU General dnl gives unlimited permission to copy and/or distribute it,
dnl Public License, this file may be distributed as part of a program dnl with or without modifications, as long as this notice is preserved.
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible. dnl From Bruno Haible.
...@@ -12,7 +10,7 @@ AC_DEFUN([AM_LANGINFO_CODESET], ...@@ -12,7 +10,7 @@ AC_DEFUN([AM_LANGINFO_CODESET],
[ [
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>], [AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);], [char* cs = nl_langinfo(CODESET); return !cs;],
am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no) am_cv_langinfo_codeset=no)
]) ])
......
# gettext.m4 serial 17 (gettext-0.11.5) # gettext.m4 serial 59 (gettext-0.16.1)
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU dnl This file is free software; the Free Software Foundation
dnl General Public License. As a special exception to the GNU General dnl gives unlimited permission to copy and/or distribute it,
dnl Public License, this file may be distributed as part of a program dnl with or without modifications, as long as this notice is preserved.
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl dnl
dnl This file can can be used in projects which are not available under dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public dnl the GNU General Public License or the GNU Library General Public
...@@ -17,7 +15,7 @@ dnl They are *not* in the public domain. ...@@ -17,7 +15,7 @@ dnl They are *not* in the public domain.
dnl Authors: dnl Authors:
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
dnl Macro to add for using GNU gettext. dnl Macro to add for using GNU gettext.
...@@ -65,8 +63,13 @@ AC_DEFUN([AM_GNU_GETTEXT], ...@@ -65,8 +63,13 @@ AC_DEFUN([AM_GNU_GETTEXT],
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
])])])]) ])])])])
define(gt_included_intl, ifelse([$1], [external], [no], [yes])) define([gt_included_intl],
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) ifelse([$1], [external],
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
[yes]))
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
gt_NEEDS_INIT
AM_GNU_GETTEXT_NEED([$2])
AC_REQUIRE([AM_PO_SUBDIRS])dnl AC_REQUIRE([AM_PO_SUBDIRS])dnl
ifelse(gt_included_intl, yes, [ ifelse(gt_included_intl, yes, [
...@@ -80,7 +83,7 @@ AC_DEFUN([AM_GNU_GETTEXT], ...@@ -80,7 +83,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Sometimes libintl requires libiconv, so first search for libiconv.
dnl Ideally we would do this search only after the dnl Ideally we would do this search only after the
dnl if test "$USE_NLS" = "yes"; then dnl if test "$USE_NLS" = "yes"; then
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
dnl the configure script would need to contain the same shell code dnl the configure script would need to contain the same shell code
dnl again, outside any 'if'. There are two solutions: dnl again, outside any 'if'. There are two solutions:
...@@ -92,13 +95,11 @@ AC_DEFUN([AM_GNU_GETTEXT], ...@@ -92,13 +95,11 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
]) ])
AC_MSG_CHECKING([whether NLS is requested]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
dnl Default is enabled NLS gt_INTL_MACOSX
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support], dnl Set USE_NLS.
USE_NLS=$enableval, USE_NLS=yes) AC_REQUIRE([AM_NLS])
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
ifelse(gt_included_intl, yes, [ ifelse(gt_included_intl, yes, [
BUILD_INCLUDED_LIBINTL=no BUILD_INCLUDED_LIBINTL=no
...@@ -108,6 +109,15 @@ AC_DEFUN([AM_GNU_GETTEXT], ...@@ -108,6 +109,15 @@ AC_DEFUN([AM_GNU_GETTEXT],
LTLIBINTL= LTLIBINTL=
POSUB= POSUB=
dnl Add a version number to the cache macros.
case " $gt_needs " in
*" need-formatstring-macros "*) gt_api_version=3 ;;
*" need-ngettext "*) gt_api_version=2 ;;
*) gt_api_version=1 ;;
esac
gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
dnl If we use NLS figure out what method dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then if test "$USE_NLS" = "yes"; then
gt_use_preinstalled_gnugettext=no gt_use_preinstalled_gnugettext=no
...@@ -126,28 +136,35 @@ AC_DEFUN([AM_GNU_GETTEXT], ...@@ -126,28 +136,35 @@ AC_DEFUN([AM_GNU_GETTEXT],
dnl to use. If GNU gettext is available we use this. Else we have dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library. dnl to fall back to GNU NLS library.
dnl Add a version number to the cache macros. if test $gt_api_version -ge 3; then
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) gt_revision_test_code='
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif #endif
changequote(,)dnl changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr; '
else
gt_revision_test_code=
fi
if test $gt_api_version -ge 2; then
gt_expression_test_code=' + * ngettext ("", "", 0)'
else
gt_expression_test_code=
fi
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
[AC_TRY_LINK([#include <libintl.h>
$gt_revision_test_code
extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;], extern int *_nl_domain_bindings;],
[bindtextdomain ("", ""); [bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
gt_cv_func_gnugettext_libc=yes, [eval "$gt_func_gnugettext_libc=yes"],
gt_cv_func_gnugettext_libc=no)]) [eval "$gt_func_gnugettext_libc=no"])])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Sometimes libintl requires libiconv, so first search for libiconv.
ifelse(gt_included_intl, yes, , [ ifelse(gt_included_intl, yes, , [
AM_ICONV_LINK AM_ICONV_LINK
...@@ -158,52 +175,40 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -158,52 +175,40 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
dnl even if libiconv doesn't exist. dnl even if libiconv doesn't exist.
AC_LIB_LINKFLAGS_BODY([intl]) AC_LIB_LINKFLAGS_BODY([intl])
AC_CACHE_CHECK([for GNU gettext in libintl], AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl, [$gt_func_gnugettext_libintl],
[gt_save_CPPFLAGS="$CPPFLAGS" [gt_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $INCINTL" CPPFLAGS="$CPPFLAGS $INCINTL"
gt_save_LIBS="$LIBS" gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL" LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv. dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h> AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros], $gt_revision_test_code
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr;
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr;
extern extern
#ifdef __cplusplus #ifdef __cplusplus
"C" "C"
#endif #endif
const char *_nl_expand_alias ();], const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", ""); [bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
gt_cv_func_gnugettext_libintl=yes, [eval "$gt_func_gnugettext_libintl=yes"],
gt_cv_func_gnugettext_libintl=no) [eval "$gt_func_gnugettext_libintl=no"])
dnl Now see whether libintl exists and depends on libiconv. dnl Now see whether libintl exists and depends on libiconv.
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV" LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h> AC_TRY_LINK([#include <libintl.h>
]ifelse([$2], [need-formatstring-macros], $gt_revision_test_code
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr;
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], [])[extern int _nl_msg_cat_cntr;
extern extern
#ifdef __cplusplus #ifdef __cplusplus
"C" "C"
#endif #endif
const char *_nl_expand_alias ();], const char *_nl_expand_alias (const char *);],
[bindtextdomain ("", ""); [bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
[LIBINTL="$LIBINTL $LIBICONV" [LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV"
gt_cv_func_gnugettext_libintl=yes eval "$gt_func_gnugettext_libintl=yes"
]) ])
fi fi
CPPFLAGS="$gt_save_CPPFLAGS" CPPFLAGS="$gt_save_CPPFLAGS"
...@@ -214,9 +219,10 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -214,9 +219,10 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
dnl use it. But if this macro is used in GNU gettext, and GNU dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.) dnl libintl. (Cf. the install rule in intl/Makefile.in.)
if test "$gt_cv_func_gnugettext_libc" = "yes" \ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
&& test "$PACKAGE" != gettext; }; then && test "$PACKAGE" != gettext-runtime \
&& test "$PACKAGE" != gettext-tools; }; then
gt_use_preinstalled_gnugettext=yes gt_use_preinstalled_gnugettext=yes
else else
dnl Reset the values set by searching for libintl. dnl Reset the values set by searching for libintl.
...@@ -235,14 +241,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -235,14 +241,14 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
if test "$nls_cv_use_gnu_gettext" = "yes"; then if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library. dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
BUILD_INCLUDED_LIBINTL=yes BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi fi
CATOBJEXT=
if test "$gt_use_preinstalled_gnugettext" = "yes" \ if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then || test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions to use GNU gettext tools. dnl Mark actions to use GNU gettext tools.
...@@ -250,6 +256,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -250,6 +256,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
fi fi
]) ])
if test -n "$INTL_MACOSX_LIBS"; then
if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Some extra flags are needed during linking.
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
fi
fi
if test "$gt_use_preinstalled_gnugettext" = "yes" \ if test "$gt_use_preinstalled_gnugettext" = "yes" \
|| test "$nls_cv_use_gnu_gettext" = "yes"; then || test "$nls_cv_use_gnu_gettext" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1, AC_DEFINE(ENABLE_NLS, 1,
...@@ -260,10 +275,26 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -260,10 +275,26 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
fi fi
fi fi
AC_MSG_CHECKING([whether to use NLS])
AC_MSG_RESULT([$USE_NLS])
if test "$USE_NLS" = "yes"; then
AC_MSG_CHECKING([where the gettext function comes from])
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
gt_source="external libintl"
else
gt_source="libc"
fi
else
gt_source="included intl directory"
fi
AC_MSG_RESULT([$gt_source])
fi
if test "$USE_NLS" = "yes"; then if test "$USE_NLS" = "yes"; then
if test "$gt_use_preinstalled_gnugettext" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
AC_MSG_CHECKING([how to link with libintl]) AC_MSG_CHECKING([how to link with libintl])
AC_MSG_RESULT([$LIBINTL]) AC_MSG_RESULT([$LIBINTL])
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
...@@ -283,7 +314,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -283,7 +314,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
ifelse(gt_included_intl, yes, [ ifelse(gt_included_intl, yes, [
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it. dnl to 'yes' because some of the testsuite requires it.
if test "$PACKAGE" = gettext; then if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
BUILD_INCLUDED_LIBINTL=yes BUILD_INCLUDED_LIBINTL=yes
fi fi
...@@ -291,7 +322,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -291,7 +322,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATOBJEXT) AC_SUBST(CATOBJEXT)
AC_SUBST(INTLOBJS)
dnl For backward compatibility. Some configure.ins may be using this. dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl= nls_cv_header_intl=
...@@ -309,6 +339,13 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -309,6 +339,13 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
GENCAT=gencat GENCAT=gencat
AC_SUBST(GENCAT) AC_SUBST(GENCAT)
dnl For backward compatibility. Some Makefiles may be using this.
INTLOBJS=
if test "$USE_INCLUDED_LIBINTL" = yes; then
INTLOBJS="\$(GETTOBJS)"
fi
AC_SUBST(INTLOBJS)
dnl Enable libtool support if the surrounding package wishes it. dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
...@@ -325,261 +362,56 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", ...@@ -325,261 +362,56 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
]) ])
dnl Checks for all prerequisites of the po subdirectory, dnl Checks for special options needed on MacOS X.
dnl except for USE_NLS. dnl Defines INTL_MACOSX_LIBS.
AC_DEFUN([AM_PO_SUBDIRS], AC_DEFUN([gt_INTL_MACOSX],
[ [
AC_REQUIRE([AC_PROG_MAKE_SET])dnl dnl Check for API introduced in MacOS X 10.2.
AC_REQUIRE([AC_PROG_INSTALL])dnl AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
AC_REQUIRE([AM_MKINSTALLDIRS])dnl gt_cv_func_CFPreferencesCopyAppValue,
[gt_save_LIBS="$LIBS"
dnl Perform the following tests also if --disable-nls has been given, LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
dnl because they are needed for "make dist" to work. AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
[CFPreferencesCopyAppValue(NULL, NULL)],
dnl Search for GNU msgfmt in the PATH. [gt_cv_func_CFPreferencesCopyAppValue=yes],
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. [gt_cv_func_CFPreferencesCopyAppValue=no])
dnl The second test excludes FreeBSD msgfmt. LIBS="$gt_save_LIBS"])
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
:)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
dnl Search for GNU xgettext 0.11 or newer in the PATH.
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
dnl The second test excludes FreeBSD xgettext.
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
(if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
:)
dnl Remove leftover from FreeBSD xgettext call.
rm -f messages.po
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
dnl Test whether we really found GNU msgfmt.
if test "$GMSGFMT" != ":"; then
dnl If it is no GNU msgfmt we define it as : so that the
dnl Makefiles still can work.
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
: ;
else
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
AC_MSG_RESULT(
[found $GMSGFMT program is not GNU msgfmt; ignore it])
GMSGFMT=":"
fi
fi fi
dnl Check for API introduced in MacOS X 10.3.
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
dnl Test whether we really found GNU xgettext. [gt_save_LIBS="$LIBS"
if test "$XGETTEXT" != ":"; then LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
dnl If it is no GNU xgettext we define it as : so that the AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
dnl Makefiles still can work. [gt_cv_func_CFLocaleCopyCurrent=yes],
if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && [gt_cv_func_CFLocaleCopyCurrent=no])
(if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then LIBS="$gt_save_LIBS"])
: ; if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
else AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
AC_MSG_RESULT( [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
dnl Remove leftover from FreeBSD xgettext call.
rm -f messages.po
fi fi
INTL_MACOSX_LIBS=
AC_OUTPUT_COMMANDS([ if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
for ac_file in $CONFIG_FILES; do INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
# Support "outfile[:infile[:infile...]]" fi
case "$ac_file" in AC_SUBST([INTL_MACOSX_LIBS])
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
esac
# PO directories have a Makefile.in generated from Makefile.in.in.
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
# ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
# on $ac_dir but don't depend on user-specified configuration
# parameters.
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
# The LINGUAS file contains the set of available languages.
if test -n "$ALL_LINGUAS"; then
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
fi
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
# Hide the ALL_LINGUAS assigment from automake.
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
fi
case "$ac_given_srcdir" in
.) srcdirpre= ;;
*) srcdirpre='$(srcdir)/' ;;
esac
POFILES=
GMOFILES=
UPDATEPOFILES=
DUMMYPOFILES=
for lang in $ALL_LINGUAS; do
POFILES="$POFILES $srcdirpre$lang.po"
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
done
# CATALOGS depends on both $ac_dir and the user's LINGUAS
# environment variable.
INST_LINGUAS=
if test -n "$ALL_LINGUAS"; then
for presentlang in $ALL_LINGUAS; do
useit=no
if test "%UNSET%" != "$LINGUAS"; then
desiredlanguages="$LINGUAS"
else
desiredlanguages="$ALL_LINGUAS"
fi
for desiredlang in $desiredlanguages; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then