Skip to content

Commit 32b3f47

Browse files
author
Rémi Denis-Courmont
committed
gettext: update to 0.21
1 parent 63641ab commit 32b3f47

12 files changed

+578
-396
lines changed

autotools/config.rpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Output a system dependent set of variables, describing how to set the
33
# run time search path of shared libraries in an executable.
44
#
5-
# Copyright 1996-2016 Free Software Foundation, Inc.
5+
# Copyright 1996-2020 Free Software Foundation, Inc.
66
# Taken from GNU libtool, 2001
77
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
88
#

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ AS_IF([test "${enable_shared}" = "no" -a "${enable_vlc}" != "no"], [
614614
dnl
615615
dnl Gettext stuff
616616
dnl
617-
AM_GNU_GETTEXT_VERSION([0.19.8])
617+
AM_GNU_GETTEXT_VERSION([0.21])
618618
AM_GNU_GETTEXT([external], [need-formatstring-macros])
619619

620620
dnl

m4/gettext.m4

+20-54
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# gettext.m4 serial 68 (gettext-0.19.8)
2-
dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
1+
# gettext.m4 serial 71 (gettext-0.20.2)
2+
dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
33
dnl This file is free software; the Free Software Foundation
44
dnl gives unlimited permission to copy and/or distribute it,
55
dnl with or without modifications, as long as this notice is preserved.
66
dnl
77
dnl This file can be used in projects which are not available under
8-
dnl the GNU General Public License or the GNU Library General Public
8+
dnl the GNU General Public License or the GNU Lesser General Public
99
dnl License but which still want to provide support for the GNU gettext
1010
dnl functionality.
1111
dnl Please note that the actual code of the GNU gettext library is covered
12-
dnl by the GNU Library General Public License, and the rest of the GNU
12+
dnl by the GNU Lesser General Public License, and the rest of the GNU
1313
dnl gettext package is covered by the GNU General Public License.
1414
dnl They are *not* in the public domain.
1515

@@ -20,15 +20,13 @@ dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
2020
dnl Macro to add for using GNU gettext.
2121

2222
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
23-
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
24-
dnl default (if it is not specified or empty) is 'no-libtool'.
25-
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
26-
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
23+
dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
24+
dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
25+
dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
2726
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
2827
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
2928
dnl depending on --{enable,disable}-{shared,static} and on the presence of
30-
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
31-
dnl $(top_builddir)/intl/libintl.a will be created.
29+
dnl AM-DISABLE-SHARED).
3230
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
3331
dnl implementations (in libc or libintl) without the ngettext() function
3432
dnl will be ignored. If NEEDSYMBOL is specified and is
@@ -57,19 +55,17 @@ dnl
5755
AC_DEFUN([AM_GNU_GETTEXT],
5856
[
5957
dnl Argument checking.
60-
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
58+
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
6159
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
62-
])])])])])
60+
])])])])
6361
ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
64-
[AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
62+
[errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
63+
])])
6564
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
6665
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
6766
])])])])
6867
define([gt_included_intl],
69-
ifelse([$1], [external],
70-
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
71-
[yes]))
72-
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
68+
ifelse([$1], [external], [no], [yes]))
7369
gt_NEEDS_INIT
7470
AM_GNU_GETTEXT_NEED([$2])
7571
@@ -91,8 +87,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
9187
dnl again, outside any 'if'. There are two solutions:
9288
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
9389
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
94-
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
95-
dnl documented, we avoid it.
90+
dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
9691
ifelse(gt_included_intl, yes, , [
9792
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
9893
])
@@ -192,7 +187,7 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
192187
[gt_save_CPPFLAGS="$CPPFLAGS"
193188
CPPFLAGS="$CPPFLAGS $INCINTL"
194189
gt_save_LIBS="$LIBS"
195-
LIBS="$LIBS $LIBINTL $INTL_MACOSX_LIBS"
190+
LIBS="$LIBS $LIBINTL"
196191
dnl Now see whether libintl exists and does not depend on libiconv.
197192
AC_LINK_IFELSE(
198193
[AC_LANG_PROGRAM(
@@ -278,8 +273,8 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
278273
dnl Mark actions used to generate GNU NLS library.
279274
BUILD_INCLUDED_LIBINTL=yes
280275
USE_INCLUDED_LIBINTL=yes
281-
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
282-
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
276+
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
277+
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
283278
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
284279
fi
285280
@@ -347,43 +342,14 @@ return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
347342
fi
348343
349344
ifelse(gt_included_intl, yes, [
350-
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
351-
dnl to 'yes' because some of the testsuite requires it.
352-
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
353-
BUILD_INCLUDED_LIBINTL=yes
354-
fi
345+
dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
346+
dnl because some of the testsuite requires it.
347+
BUILD_INCLUDED_LIBINTL=yes
355348
356349
dnl Make all variables we use known to autoconf.
357350
AC_SUBST([BUILD_INCLUDED_LIBINTL])
358351
AC_SUBST([USE_INCLUDED_LIBINTL])
359352
AC_SUBST([CATOBJEXT])
360-
361-
dnl For backward compatibility. Some configure.ins may be using this.
362-
nls_cv_header_intl=
363-
nls_cv_header_libgt=
364-
365-
dnl For backward compatibility. Some Makefiles may be using this.
366-
DATADIRNAME=share
367-
AC_SUBST([DATADIRNAME])
368-
369-
dnl For backward compatibility. Some Makefiles may be using this.
370-
INSTOBJEXT=.mo
371-
AC_SUBST([INSTOBJEXT])
372-
373-
dnl For backward compatibility. Some Makefiles may be using this.
374-
GENCAT=gencat
375-
AC_SUBST([GENCAT])
376-
377-
dnl For backward compatibility. Some Makefiles may be using this.
378-
INTLOBJS=
379-
if test "$USE_INCLUDED_LIBINTL" = yes; then
380-
INTLOBJS="\$(GETTOBJS)"
381-
fi
382-
AC_SUBST([INTLOBJS])
383-
384-
dnl Enable libtool support if the surrounding package wishes it.
385-
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
386-
AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
387353
])
388354
389355
dnl For backward compatibility. Some Makefiles may be using this.

m4/iconv.m4

+37-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# iconv.m4 serial 19 (gettext-0.18.2)
2-
dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
1+
# iconv.m4 serial 21
2+
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
3+
dnl Inc.
34
dnl This file is free software; the Free Software Foundation
45
dnl gives unlimited permission to copy and/or distribute it,
56
dnl with or without modifications, as long as this notice is preserved.
@@ -165,19 +166,29 @@ AC_DEFUN([AM_ICONV_LINK],
165166
}
166167
}
167168
#endif
168-
#if 0 /* This test leaks and we do not care about HP-UX. */
169169
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
170170
provided. */
171-
if (/* Try standardized names. */
172-
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
173-
/* Try IRIX, OSF/1 names. */
174-
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
175-
/* Try AIX names. */
176-
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
177-
/* Try HP-UX names. */
178-
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
179-
result |= 16;
180-
#endif
171+
{
172+
/* Try standardized names. */
173+
iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
174+
/* Try IRIX, OSF/1 names. */
175+
iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
176+
/* Try AIX names. */
177+
iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
178+
/* Try HP-UX names. */
179+
iconv_t cd4 = iconv_open ("utf8", "eucJP");
180+
if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
181+
&& cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
182+
result |= 16;
183+
if (cd1 != (iconv_t)(-1))
184+
iconv_close (cd1);
185+
if (cd2 != (iconv_t)(-1))
186+
iconv_close (cd2);
187+
if (cd3 != (iconv_t)(-1))
188+
iconv_close (cd3);
189+
if (cd4 != (iconv_t)(-1))
190+
iconv_close (cd4);
191+
}
181192
return result;
182193
]])],
183194
[am_cv_func_iconv_works=yes], ,
@@ -260,14 +271,18 @@ size_t iconv();
260271
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
261272
AC_MSG_RESULT([
262273
$am_cv_proto_iconv])
263-
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
264-
[Define as const if the declaration of iconv() needs const.])
265-
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
266-
m4_ifdef([gl_ICONV_H_DEFAULTS],
267-
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
268-
if test -n "$am_cv_proto_iconv_arg1"; then
269-
ICONV_CONST="const"
270-
fi
271-
])
274+
else
275+
dnl When compiling GNU libiconv on a system that does not have iconv yet,
276+
dnl pick the POSIX compliant declaration without 'const'.
277+
am_cv_proto_iconv_arg1=""
272278
fi
279+
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
280+
[Define as const if the declaration of iconv() needs const.])
281+
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
282+
m4_ifdef([gl_ICONV_H_DEFAULTS],
283+
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
284+
if test -n "$am_cv_proto_iconv_arg1"; then
285+
ICONV_CONST="const"
286+
fi
287+
])
273288
])

m4/intlmacosx.m4

+25-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# intlmacosx.m4 serial 5 (gettext-0.18.2)
2-
dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
1+
# intlmacosx.m4 serial 8 (gettext-0.20.2)
2+
dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
33
dnl This file is free software; the Free Software Foundation
44
dnl gives unlimited permission to copy and/or distribute it,
55
dnl with or without modifications, as long as this notice is preserved.
66
dnl
7-
dnl This file can can be used in projects which are not available under
8-
dnl the GNU General Public License or the GNU Library General Public
7+
dnl This file can be used in projects which are not available under
8+
dnl the GNU General Public License or the GNU Lesser General Public
99
dnl License but which still want to provide support for the GNU gettext
1010
dnl functionality.
1111
dnl Please note that the actual code of the GNU gettext library is covered
12-
dnl by the GNU Library General Public License, and the rest of the GNU
13-
dnl gettext package package is covered by the GNU General Public License.
12+
dnl by the GNU Lesser General Public License, and the rest of the GNU
13+
dnl gettext package is covered by the GNU General Public License.
1414
dnl They are *not* in the public domain.
1515

1616
dnl Checks for special options needed on Mac OS X.
1717
dnl Defines INTL_MACOSX_LIBS.
1818
AC_DEFUN([gt_INTL_MACOSX],
1919
[
20-
dnl Check for API introduced in Mac OS X 10.2.
20+
dnl Check for API introduced in Mac OS X 10.4.
2121
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
2222
[gt_cv_func_CFPreferencesCopyAppValue],
2323
[gt_save_LIBS="$LIBS"
@@ -33,23 +33,32 @@ AC_DEFUN([gt_INTL_MACOSX],
3333
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
3434
[Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
3535
fi
36-
dnl Check for API introduced in Mac OS X 10.3.
37-
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36+
dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
37+
dnl because in macOS 10.13.4 it has the following behaviour:
38+
dnl When two or more languages are specified in the
39+
dnl "System Preferences > Language & Region > Preferred Languages" panel,
40+
dnl it returns en_CC where CC is the territory (even when English is not among
41+
dnl the preferred languages!). What we want instead is what
42+
dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
43+
dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
44+
dnl first among the preferred languages and CC is the territory.
45+
AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
3846
[gt_save_LIBS="$LIBS"
3947
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
4048
AC_LINK_IFELSE(
4149
[AC_LANG_PROGRAM(
4250
[[#include <CoreFoundation/CFLocale.h>]],
43-
[[CFLocaleCopyCurrent();]])],
44-
[gt_cv_func_CFLocaleCopyCurrent=yes],
45-
[gt_cv_func_CFLocaleCopyCurrent=no])
51+
[[CFLocaleCopyPreferredLanguages();]])],
52+
[gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
53+
[gt_cv_func_CFLocaleCopyPreferredLanguages=no])
4654
LIBS="$gt_save_LIBS"])
47-
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48-
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
49-
[Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
55+
if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
56+
AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
57+
[Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
5058
fi
5159
INTL_MACOSX_LIBS=
52-
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
60+
if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
61+
|| test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
5362
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
5463
fi
5564
AC_SUBST([INTL_MACOSX_LIBS])

0 commit comments

Comments
 (0)