diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 11:45:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 11:45:04 +0000 |
commit | cd0a6e382eafd7fd241a00a10527333d73985fca (patch) | |
tree | c725f4c788d4ccc65ccba9e37b7a9b4095b797e9 /m4/gettext.m4 | |
parent | 1b4ccddc7946888fc0b66c58b1434e1814a43822 (diff) | |
download | gnunet-cd0a6e382eafd7fd241a00a10527333d73985fca.tar.gz gnunet-cd0a6e382eafd7fd241a00a10527333d73985fca.zip |
-updating gettext m4 macros
Diffstat (limited to 'm4/gettext.m4')
-rw-r--r-- | m4/gettext.m4 | 134 |
1 files changed, 58 insertions, 76 deletions
diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 91c345e99..be247bf7b 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 | |||
@@ -1,5 +1,5 @@ | |||
1 | # gettext.m4 serial 59 (gettext-0.16.1) | 1 | # gettext.m4 serial 66 (gettext-0.18.2) |
2 | dnl Copyright (C) 1995-2006 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 1995-2014 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. |
@@ -15,7 +15,7 @@ dnl They are *not* in the public domain. | |||
15 | 15 | ||
16 | dnl Authors: | 16 | dnl Authors: |
17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. | 17 | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
18 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006. | 18 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010. |
19 | 19 | ||
20 | dnl Macro to add for using GNU gettext. | 20 | dnl Macro to add for using GNU gettext. |
21 | 21 | ||
@@ -35,7 +35,7 @@ dnl will be ignored. If NEEDSYMBOL is specified and is | |||
35 | dnl 'need-formatstring-macros', then GNU gettext implementations that don't | 35 | dnl 'need-formatstring-macros', then GNU gettext implementations that don't |
36 | dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. | 36 | dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. |
37 | dnl INTLDIR is used to find the intl libraries. If empty, | 37 | dnl INTLDIR is used to find the intl libraries. If empty, |
38 | dnl the value `$(top_builddir)/intl/' is used. | 38 | dnl the value '$(top_builddir)/intl/' is used. |
39 | dnl | 39 | dnl |
40 | dnl The result of the configuration is one of three cases: | 40 | dnl The result of the configuration is one of three cases: |
41 | dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled | 41 | dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled |
@@ -60,6 +60,8 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
60 | ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , | 60 | ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
61 | [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT | 61 | [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
62 | ])])])])]) | 62 | ])])])])]) |
63 | ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], | ||
64 | [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) | ||
63 | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , | 65 | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
64 | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT | 66 | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
65 | ])])])]) | 67 | ])])])]) |
@@ -95,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
95 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) | 97 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
96 | ]) | 98 | ]) |
97 | 99 | ||
98 | dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. | 100 | dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. |
99 | gt_INTL_MACOSX | 101 | gt_INTL_MACOSX |
100 | 102 | ||
101 | dnl Set USE_NLS. | 103 | dnl Set USE_NLS. |
@@ -123,11 +125,11 @@ AC_DEFUN([AM_GNU_GETTEXT], | |||
123 | gt_use_preinstalled_gnugettext=no | 125 | gt_use_preinstalled_gnugettext=no |
124 | ifelse(gt_included_intl, yes, [ | 126 | ifelse(gt_included_intl, yes, [ |
125 | AC_MSG_CHECKING([whether included gettext is requested]) | 127 | AC_MSG_CHECKING([whether included gettext is requested]) |
126 | AC_ARG_WITH(included-gettext, | 128 | AC_ARG_WITH([included-gettext], |
127 | [ --with-included-gettext use the GNU gettext library included here], | 129 | [ --with-included-gettext use the GNU gettext library included here], |
128 | nls_cv_force_use_gnu_gettext=$withval, | 130 | nls_cv_force_use_gnu_gettext=$withval, |
129 | nls_cv_force_use_gnu_gettext=no) | 131 | nls_cv_force_use_gnu_gettext=no) |
130 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | 132 | AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) |
131 | 133 | ||
132 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | 134 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
133 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | 135 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
@@ -155,12 +157,18 @@ changequote([,])dnl | |||
155 | fi | 157 | fi |
156 | 158 | ||
157 | AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], | 159 | AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], |
158 | [AC_TRY_LINK([#include <libintl.h> | 160 | [AC_LINK_IFELSE( |
161 | [AC_LANG_PROGRAM( | ||
162 | [[ | ||
163 | #include <libintl.h> | ||
159 | $gt_revision_test_code | 164 | $gt_revision_test_code |
160 | extern int _nl_msg_cat_cntr; | 165 | extern int _nl_msg_cat_cntr; |
161 | extern int *_nl_domain_bindings;], | 166 | extern int *_nl_domain_bindings; |
162 | [bindtextdomain ("", ""); | 167 | ]], |
163 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], | 168 | [[ |
169 | bindtextdomain ("", ""); | ||
170 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings | ||
171 | ]])], | ||
164 | [eval "$gt_func_gnugettext_libc=yes"], | 172 | [eval "$gt_func_gnugettext_libc=yes"], |
165 | [eval "$gt_func_gnugettext_libc=no"])]) | 173 | [eval "$gt_func_gnugettext_libc=no"])]) |
166 | 174 | ||
@@ -181,35 +189,47 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b | |||
181 | gt_save_LIBS="$LIBS" | 189 | gt_save_LIBS="$LIBS" |
182 | LIBS="$LIBS $LIBINTL" | 190 | LIBS="$LIBS $LIBINTL" |
183 | dnl Now see whether libintl exists and does not depend on libiconv. | 191 | dnl Now see whether libintl exists and does not depend on libiconv. |
184 | AC_TRY_LINK([#include <libintl.h> | 192 | AC_LINK_IFELSE( |
193 | [AC_LANG_PROGRAM( | ||
194 | [[ | ||
195 | #include <libintl.h> | ||
185 | $gt_revision_test_code | 196 | $gt_revision_test_code |
186 | extern int _nl_msg_cat_cntr; | 197 | extern int _nl_msg_cat_cntr; |
187 | extern | 198 | extern |
188 | #ifdef __cplusplus | 199 | #ifdef __cplusplus |
189 | "C" | 200 | "C" |
190 | #endif | 201 | #endif |
191 | const char *_nl_expand_alias (const char *);], | 202 | const char *_nl_expand_alias (const char *); |
192 | [bindtextdomain ("", ""); | 203 | ]], |
193 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], | 204 | [[ |
205 | bindtextdomain ("", ""); | ||
206 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") | ||
207 | ]])], | ||
194 | [eval "$gt_func_gnugettext_libintl=yes"], | 208 | [eval "$gt_func_gnugettext_libintl=yes"], |
195 | [eval "$gt_func_gnugettext_libintl=no"]) | 209 | [eval "$gt_func_gnugettext_libintl=no"]) |
196 | dnl Now see whether libintl exists and depends on libiconv. | 210 | dnl Now see whether libintl exists and depends on libiconv. |
197 | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then | 211 | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then |
198 | LIBS="$LIBS $LIBICONV" | 212 | LIBS="$LIBS $LIBICONV" |
199 | AC_TRY_LINK([#include <libintl.h> | 213 | AC_LINK_IFELSE( |
214 | [AC_LANG_PROGRAM( | ||
215 | [[ | ||
216 | #include <libintl.h> | ||
200 | $gt_revision_test_code | 217 | $gt_revision_test_code |
201 | extern int _nl_msg_cat_cntr; | 218 | extern int _nl_msg_cat_cntr; |
202 | extern | 219 | extern |
203 | #ifdef __cplusplus | 220 | #ifdef __cplusplus |
204 | "C" | 221 | "C" |
205 | #endif | 222 | #endif |
206 | const char *_nl_expand_alias (const char *);], | 223 | const char *_nl_expand_alias (const char *); |
207 | [bindtextdomain ("", ""); | 224 | ]], |
208 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], | 225 | [[ |
209 | [LIBINTL="$LIBINTL $LIBICONV" | 226 | bindtextdomain ("", ""); |
210 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" | 227 | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") |
211 | eval "$gt_func_gnugettext_libintl=yes" | 228 | ]])], |
212 | ]) | 229 | [LIBINTL="$LIBINTL $LIBICONV" |
230 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" | ||
231 | eval "$gt_func_gnugettext_libintl=yes" | ||
232 | ]) | ||
213 | fi | 233 | fi |
214 | CPPFLAGS="$gt_save_CPPFLAGS" | 234 | CPPFLAGS="$gt_save_CPPFLAGS" |
215 | LIBS="$gt_save_LIBS"]) | 235 | LIBS="$gt_save_LIBS"]) |
@@ -267,7 +287,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a | |||
267 | 287 | ||
268 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | 288 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
269 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | 289 | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
270 | AC_DEFINE(ENABLE_NLS, 1, | 290 | AC_DEFINE([ENABLE_NLS], [1], |
271 | [Define to 1 if translation of program messages to the user's native language | 291 | [Define to 1 if translation of program messages to the user's native language |
272 | is requested.]) | 292 | is requested.]) |
273 | else | 293 | else |
@@ -301,9 +321,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a | |||
301 | fi | 321 | fi |
302 | 322 | ||
303 | dnl For backward compatibility. Some packages may be using this. | 323 | dnl For backward compatibility. Some packages may be using this. |
304 | AC_DEFINE(HAVE_GETTEXT, 1, | 324 | AC_DEFINE([HAVE_GETTEXT], [1], |
305 | [Define if the GNU gettext() function is already present or preinstalled.]) | 325 | [Define if the GNU gettext() function is already present or preinstalled.]) |
306 | AC_DEFINE(HAVE_DCGETTEXT, 1, | 326 | AC_DEFINE([HAVE_DCGETTEXT], [1], |
307 | [Define if the GNU dcgettext() function is already present or preinstalled.]) | 327 | [Define if the GNU dcgettext() function is already present or preinstalled.]) |
308 | fi | 328 | fi |
309 | 329 | ||
@@ -319,9 +339,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a | |||
319 | fi | 339 | fi |
320 | 340 | ||
321 | dnl Make all variables we use known to autoconf. | 341 | dnl Make all variables we use known to autoconf. |
322 | AC_SUBST(BUILD_INCLUDED_LIBINTL) | 342 | AC_SUBST([BUILD_INCLUDED_LIBINTL]) |
323 | AC_SUBST(USE_INCLUDED_LIBINTL) | 343 | AC_SUBST([USE_INCLUDED_LIBINTL]) |
324 | AC_SUBST(CATOBJEXT) | 344 | AC_SUBST([CATOBJEXT]) |
325 | 345 | ||
326 | dnl For backward compatibility. Some configure.ins may be using this. | 346 | dnl For backward compatibility. Some configure.ins may be using this. |
327 | nls_cv_header_intl= | 347 | nls_cv_header_intl= |
@@ -329,74 +349,36 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a | |||
329 | 349 | ||
330 | dnl For backward compatibility. Some Makefiles may be using this. | 350 | dnl For backward compatibility. Some Makefiles may be using this. |
331 | DATADIRNAME=share | 351 | DATADIRNAME=share |
332 | AC_SUBST(DATADIRNAME) | 352 | AC_SUBST([DATADIRNAME]) |
333 | 353 | ||
334 | dnl For backward compatibility. Some Makefiles may be using this. | 354 | dnl For backward compatibility. Some Makefiles may be using this. |
335 | INSTOBJEXT=.mo | 355 | INSTOBJEXT=.mo |
336 | AC_SUBST(INSTOBJEXT) | 356 | AC_SUBST([INSTOBJEXT]) |
337 | 357 | ||
338 | dnl For backward compatibility. Some Makefiles may be using this. | 358 | dnl For backward compatibility. Some Makefiles may be using this. |
339 | GENCAT=gencat | 359 | GENCAT=gencat |
340 | AC_SUBST(GENCAT) | 360 | AC_SUBST([GENCAT]) |
341 | 361 | ||
342 | dnl For backward compatibility. Some Makefiles may be using this. | 362 | dnl For backward compatibility. Some Makefiles may be using this. |
343 | INTLOBJS= | 363 | INTLOBJS= |
344 | if test "$USE_INCLUDED_LIBINTL" = yes; then | 364 | if test "$USE_INCLUDED_LIBINTL" = yes; then |
345 | INTLOBJS="\$(GETTOBJS)" | 365 | INTLOBJS="\$(GETTOBJS)" |
346 | fi | 366 | fi |
347 | AC_SUBST(INTLOBJS) | 367 | AC_SUBST([INTLOBJS]) |
348 | 368 | ||
349 | dnl Enable libtool support if the surrounding package wishes it. | 369 | dnl Enable libtool support if the surrounding package wishes it. |
350 | INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix | 370 | INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix |
351 | AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) | 371 | AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) |
352 | ]) | 372 | ]) |
353 | 373 | ||
354 | dnl For backward compatibility. Some Makefiles may be using this. | 374 | dnl For backward compatibility. Some Makefiles may be using this. |
355 | INTLLIBS="$LIBINTL" | 375 | INTLLIBS="$LIBINTL" |
356 | AC_SUBST(INTLLIBS) | 376 | AC_SUBST([INTLLIBS]) |
357 | 377 | ||
358 | dnl Make all documented variables known to autoconf. | 378 | dnl Make all documented variables known to autoconf. |
359 | AC_SUBST(LIBINTL) | 379 | AC_SUBST([LIBINTL]) |
360 | AC_SUBST(LTLIBINTL) | 380 | AC_SUBST([LTLIBINTL]) |
361 | AC_SUBST(POSUB) | 381 | AC_SUBST([POSUB]) |
362 | ]) | ||
363 | |||
364 | |||
365 | dnl Checks for special options needed on MacOS X. | ||
366 | dnl Defines INTL_MACOSX_LIBS. | ||
367 | AC_DEFUN([gt_INTL_MACOSX], | ||
368 | [ | ||
369 | dnl Check for API introduced in MacOS X 10.2. | ||
370 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], | ||
371 | gt_cv_func_CFPreferencesCopyAppValue, | ||
372 | [gt_save_LIBS="$LIBS" | ||
373 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" | ||
374 | AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], | ||
375 | [CFPreferencesCopyAppValue(NULL, NULL)], | ||
376 | [gt_cv_func_CFPreferencesCopyAppValue=yes], | ||
377 | [gt_cv_func_CFPreferencesCopyAppValue=no]) | ||
378 | LIBS="$gt_save_LIBS"]) | ||
379 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then | ||
380 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, | ||
381 | [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) | ||
382 | fi | ||
383 | dnl Check for API introduced in MacOS X 10.3. | ||
384 | AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, | ||
385 | [gt_save_LIBS="$LIBS" | ||
386 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" | ||
387 | AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], | ||
388 | [gt_cv_func_CFLocaleCopyCurrent=yes], | ||
389 | [gt_cv_func_CFLocaleCopyCurrent=no]) | ||
390 | LIBS="$gt_save_LIBS"]) | ||
391 | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then | ||
392 | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, | ||
393 | [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) | ||
394 | fi | ||
395 | INTL_MACOSX_LIBS= | ||
396 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then | ||
397 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" | ||
398 | fi | ||
399 | AC_SUBST([INTL_MACOSX_LIBS]) | ||
400 | ]) | 382 | ]) |
401 | 383 | ||
402 | 384 | ||