1 |
# gettext.m4 serial 14 (gettext-0.11.2) |
# gettext.m4 serial 17 (gettext-0.11.5) |
2 |
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. |
3 |
dnl This file is free software, distributed under the terms of the GNU |
dnl This file is free software, distributed under the terms of the GNU |
4 |
dnl General Public License. As a special exception to the GNU General |
dnl General Public License. As a special exception to the GNU General |
33 |
dnl $(top_builddir)/intl/libintl.a will be created. |
dnl $(top_builddir)/intl/libintl.a will be created. |
34 |
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext |
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext |
35 |
dnl implementations (in libc or libintl) without the ngettext() function |
dnl implementations (in libc or libintl) without the ngettext() function |
36 |
dnl will be ignored. |
dnl will be ignored. If NEEDSYMBOL is specified and is |
37 |
|
dnl 'need-formatstring-macros', then GNU gettext implementations that don't |
38 |
|
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. |
39 |
dnl INTLDIR is used to find the intl libraries. If empty, |
dnl INTLDIR is used to find the intl libraries. If empty, |
40 |
dnl the value `$(top_builddir)/intl/' is used. |
dnl the value `$(top_builddir)/intl/' is used. |
41 |
dnl |
dnl |
62 |
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
63 |
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
64 |
])])])])]) |
])])])])]) |
65 |
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , |
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
66 |
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
67 |
])])]) |
])])])]) |
68 |
define(gt_included_intl, ifelse([$1], [external], [no], [yes])) |
define(gt_included_intl, ifelse([$1], [external], [no], [yes])) |
69 |
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) |
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) |
70 |
|
|
77 |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
78 |
AC_REQUIRE([AC_LIB_RPATH]) |
AC_REQUIRE([AC_LIB_RPATH]) |
79 |
|
|
80 |
|
dnl Sometimes libintl requires libiconv, so first search for libiconv. |
81 |
|
dnl Ideally we would do this search only after the |
82 |
|
dnl if test "$USE_NLS" = "yes"; then |
83 |
|
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then |
84 |
|
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT |
85 |
|
dnl the configure script would need to contain the same shell code |
86 |
|
dnl again, outside any 'if'. There are two solutions: |
87 |
|
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. |
88 |
|
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. |
89 |
|
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not |
90 |
|
dnl documented, we avoid it. |
91 |
|
ifelse(gt_included_intl, yes, , [ |
92 |
|
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
93 |
|
]) |
94 |
|
|
95 |
AC_MSG_CHECKING([whether NLS is requested]) |
AC_MSG_CHECKING([whether NLS is requested]) |
96 |
dnl Default is enabled NLS |
dnl Default is enabled NLS |
97 |
AC_ARG_ENABLE(nls, |
AC_ARG_ENABLE(nls, |
127 |
dnl to fall back to GNU NLS library. |
dnl to fall back to GNU NLS library. |
128 |
|
|
129 |
dnl Add a version number to the cache macros. |
dnl Add a version number to the cache macros. |
130 |
define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1)) |
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) |
131 |
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) |
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) |
132 |
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) |
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) |
133 |
|
|
134 |
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, |
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, |
135 |
[AC_TRY_LINK([#include <libintl.h> |
[AC_TRY_LINK([#include <libintl.h> |
136 |
extern int _nl_msg_cat_cntr; |
]ifelse([$2], [need-formatstring-macros], |
137 |
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
138 |
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
139 |
|
#endif |
140 |
|
changequote(,)dnl |
141 |
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
142 |
|
changequote([,])dnl |
143 |
|
], [])[extern int _nl_msg_cat_cntr; |
144 |
extern int *_nl_domain_bindings;], |
extern int *_nl_domain_bindings;], |
145 |
[bindtextdomain ("", ""); |
[bindtextdomain ("", ""); |
146 |
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
165 |
LIBS="$LIBS $LIBINTL" |
LIBS="$LIBS $LIBINTL" |
166 |
dnl Now see whether libintl exists and does not depend on libiconv. |
dnl Now see whether libintl exists and does not depend on libiconv. |
167 |
AC_TRY_LINK([#include <libintl.h> |
AC_TRY_LINK([#include <libintl.h> |
168 |
extern int _nl_msg_cat_cntr; |
]ifelse([$2], [need-formatstring-macros], |
169 |
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
170 |
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
171 |
|
#endif |
172 |
|
changequote(,)dnl |
173 |
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
174 |
|
changequote([,])dnl |
175 |
|
], [])[extern int _nl_msg_cat_cntr; |
176 |
extern |
extern |
177 |
#ifdef __cplusplus |
#ifdef __cplusplus |
178 |
"C" |
"C" |
186 |
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then |
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then |
187 |
LIBS="$LIBS $LIBICONV" |
LIBS="$LIBS $LIBICONV" |
188 |
AC_TRY_LINK([#include <libintl.h> |
AC_TRY_LINK([#include <libintl.h> |
189 |
extern int _nl_msg_cat_cntr; |
]ifelse([$2], [need-formatstring-macros], |
190 |
|
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
191 |
|
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
192 |
|
#endif |
193 |
|
changequote(,)dnl |
194 |
|
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
195 |
|
changequote([,])dnl |
196 |
|
], [])[extern int _nl_msg_cat_cntr; |
197 |
extern |
extern |
198 |
#ifdef __cplusplus |
#ifdef __cplusplus |
199 |
"C" |
"C" |
488 |
;; |
;; |
489 |
esac |
esac |
490 |
done], |
done], |
491 |
[# Capture the value of obsolete $ALL_LINGUAS because we need it to compute |
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute |
492 |
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it |
# POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it |
493 |
# from automake. |
# from automake. |
494 |
eval 'ALL_LINGUAS''="$ALL_LINGUAS"' |
eval 'ALL_LINGUAS''="$ALL_LINGUAS"' |
517 |
AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
518 |
AC_REQUIRE([AC_FUNC_MMAP])dnl |
AC_REQUIRE([AC_FUNC_MMAP])dnl |
519 |
AC_REQUIRE([jm_GLIBC21])dnl |
AC_REQUIRE([jm_GLIBC21])dnl |
520 |
|
AC_REQUIRE([gt_INTDIV0])dnl |
521 |
|
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl |
522 |
|
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl |
523 |
|
AC_REQUIRE([gt_INTTYPES_PRI])dnl |
524 |
|
|
525 |
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ |
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ |
526 |
stdlib.h string.h unistd.h sys/param.h]) |
stdlib.h string.h unistd.h sys/param.h]) |
530 |
|
|
531 |
AM_ICONV |
AM_ICONV |
532 |
AM_LANGINFO_CODESET |
AM_LANGINFO_CODESET |
533 |
AM_LC_MESSAGES |
if test $ac_cv_header_locale_h = yes; then |
534 |
|
AM_LC_MESSAGES |
535 |
|
fi |
536 |
|
|
537 |
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, |
538 |
dnl because plural.y uses bison specific features. It requires at least |
dnl because plural.y uses bison specific features. It requires at least |
581 |
fi |
fi |
582 |
AC_SUBST(MKINSTALLDIRS) |
AC_SUBST(MKINSTALLDIRS) |
583 |
]) |
]) |
584 |
|
|
585 |
|
|
586 |
|
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) |
587 |
|
AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |