summaryrefslogtreecommitdiffstats
path: root/gl/m4/gettext.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/gettext.m4')
-rw-r--r--gl/m4/gettext.m4107
1 files changed, 46 insertions, 61 deletions
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
index 8d1f0665..a0eda3d8 100644
--- a/gl/m4/gettext.m4
+++ b/gl/m4/gettext.m4
@@ -1,16 +1,16 @@
1# gettext.m4 serial 66 (gettext-0.18.2) 1# gettext.m4 serial 71 (gettext-0.20.2)
2dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6dnl 6dnl
7dnl This file can can be used in projects which are not available under 7dnl This file can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public 8dnl the GNU General Public License or the GNU Lesser General Public
9dnl License but which still want to provide support for the GNU gettext 9dnl License but which still want to provide support for the GNU gettext
10dnl functionality. 10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered 11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU 12dnl by the GNU Lesser General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License. 13dnl gettext package is covered by the GNU General Public License.
14dnl They are *not* in the public domain. 14dnl They are *not* in the public domain.
15 15
16dnl Authors: 16dnl Authors:
@@ -20,15 +20,13 @@ dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
20dnl Macro to add for using GNU gettext. 20dnl Macro to add for using GNU gettext.
21 21
22dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). 22dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
23dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The 23dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
24dnl default (if it is not specified or empty) is 'no-libtool'. 24dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and
25dnl INTLSYMBOL should be 'external' for packages with no intl directory, 25dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
26dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
27dnl If INTLSYMBOL is 'use-libtool', then a libtool library 26dnl If INTLSYMBOL is 'use-libtool', then a libtool library
28dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, 27dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
29dnl depending on --{enable,disable}-{shared,static} and on the presence of 28dnl depending on --{enable,disable}-{shared,static} and on the presence of
30dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library 29dnl AM-DISABLE-SHARED).
31dnl $(top_builddir)/intl/libintl.a will be created.
32dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext 30dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
33dnl implementations (in libc or libintl) without the ngettext() function 31dnl implementations (in libc or libintl) without the ngettext() function
34dnl will be ignored. If NEEDSYMBOL is specified and is 32dnl will be ignored. If NEEDSYMBOL is specified and is
@@ -57,19 +55,17 @@ dnl
57AC_DEFUN([AM_GNU_GETTEXT], 55AC_DEFUN([AM_GNU_GETTEXT],
58[ 56[
59 dnl Argument checking. 57 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], ,
61 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT 59 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
62])])])])]) 60])])])])
63 ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], 61 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])])
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , 64 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT 65 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
67])])])]) 66])])])])
68 define([gt_included_intl], 67 define([gt_included_intl],
69 ifelse([$1], [external], 68 ifelse([$1], [external], [no], [yes]))
70 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
71 [yes]))
72 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
73 gt_NEEDS_INIT 69 gt_NEEDS_INIT
74 AM_GNU_GETTEXT_NEED([$2]) 70 AM_GNU_GETTEXT_NEED([$2])
75 71
@@ -91,8 +87,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
91 dnl again, outside any 'if'. There are two solutions: 87 dnl again, outside any 'if'. There are two solutions:
92 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. 88 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
93 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. 89 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 90 dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
95 dnl documented, we avoid it.
96 ifelse(gt_included_intl, yes, , [ 91 ifelse(gt_included_intl, yes, , [
97 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) 92 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
98 ]) 93 ])
@@ -161,13 +156,18 @@ changequote([,])dnl
161 [AC_LANG_PROGRAM( 156 [AC_LANG_PROGRAM(
162 [[ 157 [[
163#include <libintl.h> 158#include <libintl.h>
164$gt_revision_test_code 159#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
165extern int _nl_msg_cat_cntr; 160extern int _nl_msg_cat_cntr;
166extern int *_nl_domain_bindings; 161extern int *_nl_domain_bindings;
162#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
163#else
164#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
165#endif
166$gt_revision_test_code
167 ]], 167 ]],
168 [[ 168 [[
169bindtextdomain ("", ""); 169bindtextdomain ("", "");
170return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings 170return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
171 ]])], 171 ]])],
172 [eval "$gt_func_gnugettext_libc=yes"], 172 [eval "$gt_func_gnugettext_libc=yes"],
173 [eval "$gt_func_gnugettext_libc=no"])]) 173 [eval "$gt_func_gnugettext_libc=no"])])
@@ -193,17 +193,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b
193 [AC_LANG_PROGRAM( 193 [AC_LANG_PROGRAM(
194 [[ 194 [[
195#include <libintl.h> 195#include <libintl.h>
196$gt_revision_test_code 196#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
197extern int _nl_msg_cat_cntr; 197extern int _nl_msg_cat_cntr;
198extern 198extern
199#ifdef __cplusplus 199#ifdef __cplusplus
200"C" 200"C"
201#endif 201#endif
202const char *_nl_expand_alias (const char *); 202const char *_nl_expand_alias (const char *);
203#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
204#else
205#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
206#endif
207$gt_revision_test_code
203 ]], 208 ]],
204 [[ 209 [[
205bindtextdomain ("", ""); 210bindtextdomain ("", "");
206return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") 211return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
207 ]])], 212 ]])],
208 [eval "$gt_func_gnugettext_libintl=yes"], 213 [eval "$gt_func_gnugettext_libintl=yes"],
209 [eval "$gt_func_gnugettext_libintl=no"]) 214 [eval "$gt_func_gnugettext_libintl=no"])
@@ -214,17 +219,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
214 [AC_LANG_PROGRAM( 219 [AC_LANG_PROGRAM(
215 [[ 220 [[
216#include <libintl.h> 221#include <libintl.h>
217$gt_revision_test_code 222#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
218extern int _nl_msg_cat_cntr; 223extern int _nl_msg_cat_cntr;
219extern 224extern
220#ifdef __cplusplus 225#ifdef __cplusplus
221"C" 226"C"
222#endif 227#endif
223const char *_nl_expand_alias (const char *); 228const char *_nl_expand_alias (const char *);
229#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
230#else
231#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
232#endif
233$gt_revision_test_code
224 ]], 234 ]],
225 [[ 235 [[
226bindtextdomain ("", ""); 236bindtextdomain ("", "");
227return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") 237return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
228 ]])], 238 ]])],
229 [LIBINTL="$LIBINTL $LIBICONV" 239 [LIBINTL="$LIBINTL $LIBICONV"
230 LTLIBINTL="$LTLIBINTL $LTLIBICONV" 240 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
@@ -263,8 +273,8 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
263 dnl Mark actions used to generate GNU NLS library. 273 dnl Mark actions used to generate GNU NLS library.
264 BUILD_INCLUDED_LIBINTL=yes 274 BUILD_INCLUDED_LIBINTL=yes
265 USE_INCLUDED_LIBINTL=yes 275 USE_INCLUDED_LIBINTL=yes
266 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" 276 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
267 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" 277 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
268 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` 278 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
269 fi 279 fi
270 280
@@ -332,43 +342,14 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a
332 fi 342 fi
333 343
334 ifelse(gt_included_intl, yes, [ 344 ifelse(gt_included_intl, yes, [
335 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL 345 dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
336 dnl to 'yes' because some of the testsuite requires it. 346 dnl because some of the testsuite requires it.
337 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then 347 BUILD_INCLUDED_LIBINTL=yes
338 BUILD_INCLUDED_LIBINTL=yes
339 fi
340 348
341 dnl Make all variables we use known to autoconf. 349 dnl Make all variables we use known to autoconf.
342 AC_SUBST([BUILD_INCLUDED_LIBINTL]) 350 AC_SUBST([BUILD_INCLUDED_LIBINTL])
343 AC_SUBST([USE_INCLUDED_LIBINTL]) 351 AC_SUBST([USE_INCLUDED_LIBINTL])
344 AC_SUBST([CATOBJEXT]) 352 AC_SUBST([CATOBJEXT])
345
346 dnl For backward compatibility. Some configure.ins may be using this.
347 nls_cv_header_intl=
348 nls_cv_header_libgt=
349
350 dnl For backward compatibility. Some Makefiles may be using this.
351 DATADIRNAME=share
352 AC_SUBST([DATADIRNAME])
353
354 dnl For backward compatibility. Some Makefiles may be using this.
355 INSTOBJEXT=.mo
356 AC_SUBST([INSTOBJEXT])
357
358 dnl For backward compatibility. Some Makefiles may be using this.
359 GENCAT=gencat
360 AC_SUBST([GENCAT])
361
362 dnl For backward compatibility. Some Makefiles may be using this.
363 INTLOBJS=
364 if test "$USE_INCLUDED_LIBINTL" = yes; then
365 INTLOBJS="\$(GETTOBJS)"
366 fi
367 AC_SUBST([INTLOBJS])
368
369 dnl Enable libtool support if the surrounding package wishes it.
370 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
371 AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
372 ]) 353 ])
373 354
374 dnl For backward compatibility. Some Makefiles may be using this. 355 dnl For backward compatibility. Some Makefiles may be using this.
@@ -399,3 +380,7 @@ AC_DEFUN([AM_GNU_GETTEXT_NEED],
399 380
400dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) 381dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
401AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) 382AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
383
384
385dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
386AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])