1 |
# gettext.m4 serial 29 |
# gettext.m4 serial 37 (gettext-0.14.4) |
2 |
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. |
dnl Copyright (C) 1995-2005 Free Software Foundation, Inc. |
3 |
dnl This file is free software, distributed under the terms of the GNU |
dnl This file is free software; the Free Software Foundation |
4 |
dnl General Public License. As a special exception to the GNU General |
dnl gives unlimited permission to copy and/or distribute it, |
5 |
dnl Public License, this file may be distributed as part of a program |
dnl with or without modifications, as long as this notice is preserved. |
|
dnl that contains a configuration script generated by Autoconf, under |
|
|
dnl the same distribution terms as the rest of that program. |
|
6 |
dnl |
dnl |
7 |
dnl This file can can be used in projects which are not available under |
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 |
dnl the GNU General Public License or the GNU Library General Public |
63 |
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
64 |
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
65 |
])])])]) |
])])])]) |
66 |
define(gt_included_intl, ifelse([$1], [external], [no], [yes])) |
define([gt_included_intl], ifelse([$1], [external], [no], [yes])) |
67 |
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) |
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) |
68 |
|
|
69 |
AC_REQUIRE([AM_PO_SUBDIRS])dnl |
AC_REQUIRE([AM_PO_SUBDIRS])dnl |
70 |
ifelse(gt_included_intl, yes, [ |
ifelse(gt_included_intl, yes, [ |
90 |
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
91 |
]) |
]) |
92 |
|
|
93 |
|
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. |
94 |
|
gt_INTL_MACOSX |
95 |
|
|
96 |
dnl Set USE_NLS. |
dnl Set USE_NLS. |
97 |
AM_NLS |
AM_NLS |
98 |
|
|
139 |
], [])[extern int _nl_msg_cat_cntr; |
], [])[extern int _nl_msg_cat_cntr; |
140 |
extern int *_nl_domain_bindings;], |
extern int *_nl_domain_bindings;], |
141 |
[bindtextdomain ("", ""); |
[bindtextdomain ("", ""); |
142 |
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
143 |
gt_cv_func_gnugettext_libc=yes, |
gt_cv_func_gnugettext_libc=yes, |
144 |
gt_cv_func_gnugettext_libc=no)]) |
gt_cv_func_gnugettext_libc=no)]) |
145 |
|
|
173 |
#ifdef __cplusplus |
#ifdef __cplusplus |
174 |
"C" |
"C" |
175 |
#endif |
#endif |
176 |
const char *_nl_expand_alias ();], |
const char *_nl_expand_alias (const char *);], |
177 |
[bindtextdomain ("", ""); |
[bindtextdomain ("", ""); |
178 |
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
179 |
gt_cv_func_gnugettext_libintl=yes, |
gt_cv_func_gnugettext_libintl=yes, |
180 |
gt_cv_func_gnugettext_libintl=no) |
gt_cv_func_gnugettext_libintl=no) |
181 |
dnl Now see whether libintl exists and depends on libiconv. |
dnl Now see whether libintl exists and depends on libiconv. |
194 |
#ifdef __cplusplus |
#ifdef __cplusplus |
195 |
"C" |
"C" |
196 |
#endif |
#endif |
197 |
const char *_nl_expand_alias ();], |
const char *_nl_expand_alias (const char *);], |
198 |
[bindtextdomain ("", ""); |
[bindtextdomain ("", ""); |
199 |
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
200 |
[LIBINTL="$LIBINTL $LIBICONV" |
[LIBINTL="$LIBINTL $LIBICONV" |
201 |
LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
202 |
gt_cv_func_gnugettext_libintl=yes |
gt_cv_func_gnugettext_libintl=yes |
239 |
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
240 |
fi |
fi |
241 |
|
|
242 |
|
CATOBJEXT= |
243 |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
244 |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
245 |
dnl Mark actions to use GNU gettext tools. |
dnl Mark actions to use GNU gettext tools. |
247 |
fi |
fi |
248 |
]) |
]) |
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 |
|
|
259 |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
260 |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
|| test "$nls_cv_use_gnu_gettext" = "yes"; then |
261 |
AC_DEFINE(ENABLE_NLS, 1, |
AC_DEFINE(ENABLE_NLS, 1, |
331 |
AC_SUBST(GENCAT) |
AC_SUBST(GENCAT) |
332 |
|
|
333 |
dnl For backward compatibility. Some Makefiles may be using this. |
dnl For backward compatibility. Some Makefiles may be using this. |
334 |
|
INTLOBJS= |
335 |
if test "$USE_INCLUDED_LIBINTL" = yes; then |
if test "$USE_INCLUDED_LIBINTL" = yes; then |
336 |
INTLOBJS="\$(GETTOBJS)" |
INTLOBJS="\$(GETTOBJS)" |
337 |
fi |
fi |
362 |
AC_REQUIRE([AM_MKINSTALLDIRS])dnl |
AC_REQUIRE([AM_MKINSTALLDIRS])dnl |
363 |
AC_REQUIRE([AC_PROG_CC])dnl |
AC_REQUIRE([AC_PROG_CC])dnl |
364 |
AC_REQUIRE([AC_CANONICAL_HOST])dnl |
AC_REQUIRE([AC_CANONICAL_HOST])dnl |
365 |
|
AC_REQUIRE([gt_GLIBC2])dnl |
366 |
AC_REQUIRE([AC_PROG_RANLIB])dnl |
AC_REQUIRE([AC_PROG_RANLIB])dnl |
367 |
AC_REQUIRE([AC_ISC_POSIX])dnl |
AC_REQUIRE([AC_ISC_POSIX])dnl |
368 |
AC_REQUIRE([AC_HEADER_STDC])dnl |
AC_REQUIRE([AC_HEADER_STDC])dnl |
387 |
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl |
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl |
388 |
AC_REQUIRE([gt_INTTYPES_PRI])dnl |
AC_REQUIRE([gt_INTTYPES_PRI])dnl |
389 |
AC_REQUIRE([gl_XSIZE])dnl |
AC_REQUIRE([gl_XSIZE])dnl |
390 |
|
AC_REQUIRE([gt_INTL_MACOSX])dnl |
391 |
|
|
392 |
AC_CHECK_TYPE([ptrdiff_t], , |
AC_CHECK_TYPE([ptrdiff_t], , |
393 |
[AC_DEFINE([ptrdiff_t], [long], |
[AC_DEFINE([ptrdiff_t], [long], |
441 |
AM_ICONV |
AM_ICONV |
442 |
AM_LANGINFO_CODESET |
AM_LANGINFO_CODESET |
443 |
if test $ac_cv_header_locale_h = yes; then |
if test $ac_cv_header_locale_h = yes; then |
444 |
AM_LC_MESSAGES |
gt_LC_MESSAGES |
445 |
|
fi |
446 |
|
|
447 |
|
if test -n "$INTL_MACOSX_LIBS"; then |
448 |
|
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers" |
449 |
fi |
fi |
450 |
|
|
451 |
dnl intl/plural.c is generated from intl/plural.y. It requires bison, |
dnl intl/plural.c is generated from intl/plural.y. It requires bison, |
481 |
]) |
]) |
482 |
|
|
483 |
|
|
484 |
|
dnl Checks for special options needed on MacOS X. |
485 |
|
dnl Defines INTL_MACOSX_LIBS. |
486 |
|
AC_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 |
|
|
528 |
dnl gt_CHECK_DECL(FUNC, INCLUDES) |
dnl gt_CHECK_DECL(FUNC, INCLUDES) |
529 |
dnl Check whether a function is declared. |
dnl Check whether a function is declared. |
530 |
AC_DEFUN([gt_CHECK_DECL], |
AC_DEFUN([gt_CHECK_DECL], |