diff options
| author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-01-31 14:46:01 +0100 |
|---|---|---|
| committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-01-31 14:46:01 +0100 |
| commit | e8bd88d1fcded01ccd066572eeaae1b507989cb3 (patch) | |
| tree | c8e7be6c07c6f635f6e803e6a6ba9e7a95fee7c0 /gl/m4/gettext.m4 | |
| parent | 2ad962c13473607ca0d974bfaa516a0ed53ec73d (diff) | |
| download | monitoring-plugins-e8bd88d1fcded01ccd066572eeaae1b507989cb3.tar.gz | |
Sync with the latest Gnulib code 668c0b8ffa
Diffstat (limited to 'gl/m4/gettext.m4')
| -rw-r--r-- | gl/m4/gettext.m4 | 107 |
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) |
| 2 | dnl Copyright (C) 1995-2013 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2014, 2016, 2018-2023 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| 5 | dnl with or without modifications, as long as this notice is preserved. | 5 | dnl with or without modifications, as long as this notice is preserved. |
| 6 | dnl | 6 | dnl |
| 7 | dnl This file can can be used in projects which are not available under | 7 | 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 |
| 9 | dnl License but which still want to provide support for the GNU gettext | 9 | dnl License but which still want to provide support for the GNU gettext |
| 10 | dnl functionality. | 10 | dnl functionality. |
| 11 | dnl Please note that the actual code of the GNU gettext library is covered | 11 | 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 |
| 13 | dnl gettext package package is covered by the GNU General Public License. | 13 | dnl gettext package is covered by the GNU General Public License. |
| 14 | dnl They are *not* in the public domain. | 14 | dnl They are *not* in the public domain. |
| 15 | 15 | ||
| 16 | dnl Authors: | 16 | dnl Authors: |
| @@ -20,15 +20,13 @@ dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010. | |||
| 20 | dnl Macro to add for using GNU gettext. | 20 | dnl Macro to add for using GNU gettext. |
| 21 | 21 | ||
| 22 | dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). | 22 | dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). |
| 23 | dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The | 23 | dnl INTLSYMBOL must be one of 'external', 'use-libtool'. |
| 24 | dnl default (if it is not specified or empty) is 'no-libtool'. | 24 | dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and |
| 25 | dnl INTLSYMBOL should be 'external' for packages with no intl directory, | 25 | dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. |
| 26 | dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. | ||
| 27 | dnl If INTLSYMBOL is 'use-libtool', then a libtool library | 26 | dnl If INTLSYMBOL is 'use-libtool', then a libtool library |
| 28 | dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, | 27 | dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, |
| 29 | dnl depending on --{enable,disable}-{shared,static} and on the presence of | 28 | 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 | 29 | dnl AM-DISABLE-SHARED). |
| 31 | dnl $(top_builddir)/intl/libintl.a will be created. | ||
| 32 | dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext | 30 | dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext |
| 33 | dnl implementations (in libc or libintl) without the ngettext() function | 31 | dnl implementations (in libc or libintl) without the ngettext() function |
| 34 | dnl will be ignored. If NEEDSYMBOL is specified and is | 32 | dnl will be ignored. If NEEDSYMBOL is specified and is |
| @@ -57,19 +55,17 @@ dnl | |||
| 57 | AC_DEFUN([AM_GNU_GETTEXT], | 55 | AC_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 |
| 165 | extern int _nl_msg_cat_cntr; | 160 | extern int _nl_msg_cat_cntr; |
| 166 | extern int *_nl_domain_bindings; | 161 | extern 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 | [[ |
| 169 | bindtextdomain ("", ""); | 169 | bindtextdomain ("", ""); |
| 170 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings | 170 | return * 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 |
| 197 | extern int _nl_msg_cat_cntr; | 197 | extern int _nl_msg_cat_cntr; |
| 198 | extern | 198 | extern |
| 199 | #ifdef __cplusplus | 199 | #ifdef __cplusplus |
| 200 | "C" | 200 | "C" |
| 201 | #endif | 201 | #endif |
| 202 | const char *_nl_expand_alias (const char *); | 202 | const 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 | [[ |
| 205 | bindtextdomain ("", ""); | 210 | bindtextdomain ("", ""); |
| 206 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") | 211 | return * 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 |
| 218 | extern int _nl_msg_cat_cntr; | 223 | extern int _nl_msg_cat_cntr; |
| 219 | extern | 224 | extern |
| 220 | #ifdef __cplusplus | 225 | #ifdef __cplusplus |
| 221 | "C" | 226 | "C" |
| 222 | #endif | 227 | #endif |
| 223 | const char *_nl_expand_alias (const char *); | 228 | const 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 | [[ |
| 226 | bindtextdomain ("", ""); | 236 | bindtextdomain ("", ""); |
| 227 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") | 237 | return * 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 | ||
| 400 | dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) | 381 | dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) |
| 401 | AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) | 382 | AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
| 383 | |||
| 384 | |||
| 385 | dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) | ||
| 386 | AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) | ||
