aboutsummaryrefslogtreecommitdiff
path: root/m4/gettext.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/gettext.m4')
-rw-r--r--m4/gettext.m4102
1 files changed, 82 insertions, 20 deletions
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index a374f03f..624a8078 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -1,10 +1,8 @@
1# gettext.m4 serial 28 (gettext-0.13) 1# gettext.m4 serial 37 (gettext-0.14.4)
2dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. 2dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
3dnl This file is free software, distributed under the terms of the GNU 3dnl This file is free software; the Free Software Foundation
4dnl General Public License. As a special exception to the GNU General 4dnl gives unlimited permission to copy and/or distribute it,
5dnl Public License, this file may be distributed as part of a program 5dnl with or without modifications, as long as this notice is preserved.
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8dnl 6dnl
9dnl This file can can be used in projects which are not available under 7dnl This file can can be used in projects which are not available under
10dnl the GNU General Public License or the GNU Library General Public 8dnl the GNU General Public License or the GNU Library General Public
@@ -65,8 +63,8 @@ AC_DEFUN([AM_GNU_GETTEXT],
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , 63 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT 64 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
67])])])]) 65])])])])
68 define(gt_included_intl, ifelse([$1], [external], [no], [yes])) 66 define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
69 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) 67 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
70 68
71 AC_REQUIRE([AM_PO_SUBDIRS])dnl 69 AC_REQUIRE([AM_PO_SUBDIRS])dnl
72 ifelse(gt_included_intl, yes, [ 70 ifelse(gt_included_intl, yes, [
@@ -92,6 +90,9 @@ AC_DEFUN([AM_GNU_GETTEXT],
92 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) 90 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
93 ]) 91 ])
94 92
93 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
94 gt_INTL_MACOSX
95
95 dnl Set USE_NLS. 96 dnl Set USE_NLS.
96 AM_NLS 97 AM_NLS
97 98
@@ -138,7 +139,7 @@ changequote([,])dnl
138], [])[extern int _nl_msg_cat_cntr; 139], [])[extern int _nl_msg_cat_cntr;
139extern int *_nl_domain_bindings;], 140extern int *_nl_domain_bindings;],
140 [bindtextdomain ("", ""); 141 [bindtextdomain ("", "");
141return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], 142return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
142 gt_cv_func_gnugettext_libc=yes, 143 gt_cv_func_gnugettext_libc=yes,
143 gt_cv_func_gnugettext_libc=no)]) 144 gt_cv_func_gnugettext_libc=no)])
144 145
@@ -172,9 +173,9 @@ extern
172#ifdef __cplusplus 173#ifdef __cplusplus
173"C" 174"C"
174#endif 175#endif
175const char *_nl_expand_alias ();], 176const char *_nl_expand_alias (const char *);],
176 [bindtextdomain ("", ""); 177 [bindtextdomain ("", "");
177return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], 178return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
178 gt_cv_func_gnugettext_libintl=yes, 179 gt_cv_func_gnugettext_libintl=yes,
179 gt_cv_func_gnugettext_libintl=no) 180 gt_cv_func_gnugettext_libintl=no)
180 dnl Now see whether libintl exists and depends on libiconv. 181 dnl Now see whether libintl exists and depends on libiconv.
@@ -193,9 +194,9 @@ extern
193#ifdef __cplusplus 194#ifdef __cplusplus
194"C" 195"C"
195#endif 196#endif
196const char *_nl_expand_alias ();], 197const char *_nl_expand_alias (const char *);],
197 [bindtextdomain ("", ""); 198 [bindtextdomain ("", "");
198return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], 199return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
199 [LIBINTL="$LIBINTL $LIBICONV" 200 [LIBINTL="$LIBINTL $LIBICONV"
200 LTLIBINTL="$LTLIBINTL $LTLIBICONV" 201 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
201 gt_cv_func_gnugettext_libintl=yes 202 gt_cv_func_gnugettext_libintl=yes
@@ -238,6 +239,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
238 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` 239 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
239 fi 240 fi
240 241
242 CATOBJEXT=
241 if test "$gt_use_preinstalled_gnugettext" = "yes" \ 243 if test "$gt_use_preinstalled_gnugettext" = "yes" \
242 || test "$nls_cv_use_gnu_gettext" = "yes"; then 244 || test "$nls_cv_use_gnu_gettext" = "yes"; then
243 dnl Mark actions to use GNU gettext tools. 245 dnl Mark actions to use GNU gettext tools.
@@ -245,6 +247,15 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
245 fi 247 fi
246 ]) 248 ])
247 249
250 if test -n "$INTL_MACOSX_LIBS"; then
251 if test "$gt_use_preinstalled_gnugettext" = "yes" \
252 || test "$nls_cv_use_gnu_gettext" = "yes"; then
253 dnl Some extra flags are needed during linking.
254 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
255 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
256 fi
257 fi
258
248 if test "$gt_use_preinstalled_gnugettext" = "yes" \ 259 if test "$gt_use_preinstalled_gnugettext" = "yes" \
249 || test "$nls_cv_use_gnu_gettext" = "yes"; then 260 || test "$nls_cv_use_gnu_gettext" = "yes"; then
250 AC_DEFINE(ENABLE_NLS, 1, 261 AC_DEFINE(ENABLE_NLS, 1,
@@ -320,6 +331,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
320 AC_SUBST(GENCAT) 331 AC_SUBST(GENCAT)
321 332
322 dnl For backward compatibility. Some Makefiles may be using this. 333 dnl For backward compatibility. Some Makefiles may be using this.
334 INTLOBJS=
323 if test "$USE_INCLUDED_LIBINTL" = yes; then 335 if test "$USE_INCLUDED_LIBINTL" = yes; then
324 INTLOBJS="\$(GETTOBJS)" 336 INTLOBJS="\$(GETTOBJS)"
325 fi 337 fi
@@ -350,6 +362,7 @@ AC_DEFUN([AM_INTL_SUBDIR],
350 AC_REQUIRE([AM_MKINSTALLDIRS])dnl 362 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
351 AC_REQUIRE([AC_PROG_CC])dnl 363 AC_REQUIRE([AC_PROG_CC])dnl
352 AC_REQUIRE([AC_CANONICAL_HOST])dnl 364 AC_REQUIRE([AC_CANONICAL_HOST])dnl
365 AC_REQUIRE([gt_GLIBC2])dnl
353 AC_REQUIRE([AC_PROG_RANLIB])dnl 366 AC_REQUIRE([AC_PROG_RANLIB])dnl
354 AC_REQUIRE([AC_ISC_POSIX])dnl 367 AC_REQUIRE([AC_ISC_POSIX])dnl
355 AC_REQUIRE([AC_HEADER_STDC])dnl 368 AC_REQUIRE([AC_HEADER_STDC])dnl
@@ -358,22 +371,23 @@ AC_DEFUN([AM_INTL_SUBDIR],
358 AC_REQUIRE([AC_C_INLINE])dnl 371 AC_REQUIRE([AC_C_INLINE])dnl
359 AC_REQUIRE([AC_TYPE_OFF_T])dnl 372 AC_REQUIRE([AC_TYPE_OFF_T])dnl
360 AC_REQUIRE([AC_TYPE_SIZE_T])dnl 373 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
361 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl 374 AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
362 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl 375 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
363 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl 376 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
364 AC_REQUIRE([gt_TYPE_WINT_T])dnl 377 AC_REQUIRE([gt_TYPE_WINT_T])dnl
365 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) 378 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
366 AC_REQUIRE([jm_AC_HEADER_STDINT_H]) 379 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
367 AC_REQUIRE([gt_TYPE_INTMAX_T]) 380 AC_REQUIRE([gt_TYPE_INTMAX_T])
368 AC_REQUIRE([gt_PRINTF_POSIX]) 381 AC_REQUIRE([gt_PRINTF_POSIX])
369 AC_REQUIRE([AC_FUNC_ALLOCA])dnl 382 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
370 AC_REQUIRE([AC_FUNC_MMAP])dnl 383 AC_REQUIRE([AC_FUNC_MMAP])dnl
371 AC_REQUIRE([jm_GLIBC21])dnl 384 AC_REQUIRE([gl_GLIBC21])dnl
372 AC_REQUIRE([gt_INTDIV0])dnl 385 AC_REQUIRE([gt_INTDIV0])dnl
373 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl 386 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
374 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl 387 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
375 AC_REQUIRE([gt_INTTYPES_PRI])dnl 388 AC_REQUIRE([gt_INTTYPES_PRI])dnl
376 AC_REQUIRE([gl_XSIZE])dnl 389 AC_REQUIRE([gl_XSIZE])dnl
390 AC_REQUIRE([gt_INTL_MACOSX])dnl
377 391
378 AC_CHECK_TYPE([ptrdiff_t], , 392 AC_CHECK_TYPE([ptrdiff_t], ,
379 [AC_DEFINE([ptrdiff_t], [long], 393 [AC_DEFINE([ptrdiff_t], [long],
@@ -427,7 +441,11 @@ __fsetlocking])
427 AM_ICONV 441 AM_ICONV
428 AM_LANGINFO_CODESET 442 AM_LANGINFO_CODESET
429 if test $ac_cv_header_locale_h = yes; then 443 if test $ac_cv_header_locale_h = yes; then
430 AM_LC_MESSAGES 444 gt_LC_MESSAGES
445 fi
446
447 if test -n "$INTL_MACOSX_LIBS"; then
448 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
431 fi 449 fi
432 450
433 dnl intl/plural.c is generated from intl/plural.y. It requires bison, 451 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
@@ -463,6 +481,50 @@ changequote([,])dnl
463]) 481])
464 482
465 483
484dnl Checks for special options needed on MacOS X.
485dnl Defines INTL_MACOSX_LIBS.
486AC_DEFUN([gt_INTL_MACOSX],
487[
488 dnl Check for API introduced in MacOS X 10.2.
489 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
490 gt_cv_func_CFPreferencesCopyAppValue,
491 [gt_save_CPPFLAGS="$CPPFLAGS"
492 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
493 gt_save_LIBS="$LIBS"
494 LIBS="$LIBS -framework CoreFoundation"
495 AC_TRY_LINK([#include <CFPreferences.h>],
496 [CFPreferencesCopyAppValue(NULL, NULL)],
497 [gt_cv_func_CFPreferencesCopyAppValue=yes],
498 [gt_cv_func_CFPreferencesCopyAppValue=no])
499 CPPFLAGS="$gt_save_CPPFLAGS"
500 LIBS="$gt_save_LIBS"])
501 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
502 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
503 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
504 fi
505 dnl Check for API introduced in MacOS X 10.3.
506 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
507 [gt_save_CPPFLAGS="$CPPFLAGS"
508 CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
509 gt_save_LIBS="$LIBS"
510 LIBS="$LIBS -framework CoreFoundation"
511 AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
512 [gt_cv_func_CFLocaleCopyCurrent=yes],
513 [gt_cv_func_CFLocaleCopyCurrent=no])
514 CPPFLAGS="$gt_save_CPPFLAGS"
515 LIBS="$gt_save_LIBS"])
516 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
517 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
518 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
519 fi
520 INTL_MACOSX_LIBS=
521 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
522 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
523 fi
524 AC_SUBST([INTL_MACOSX_LIBS])
525])
526
527
466dnl gt_CHECK_DECL(FUNC, INCLUDES) 528dnl gt_CHECK_DECL(FUNC, INCLUDES)
467dnl Check whether a function is declared. 529dnl Check whether a function is declared.
468AC_DEFUN([gt_CHECK_DECL], 530AC_DEFUN([gt_CHECK_DECL],