Mercurial > audlegacy
annotate m4/gettext.m4 @ 4876:85e71772af79
Credit Carlo Bramini for patching in bug #47.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Tue, 28 Apr 2009 23:00:58 +0100 |
parents | 0b924771b26e |
children |
rev | line source |
---|---|
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
1 # gettext.m4 serial 20 (gettext-0.12) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
2 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
3 dnl This file is free software, distributed under the terms of the GNU |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
4 dnl General Public License. As a special exception to the GNU General |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
5 dnl Public License, this file may be distributed as part of a program |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
6 dnl that contains a configuration script generated by Autoconf, under |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
7 dnl the same distribution terms as the rest of that program. |
0 | 8 dnl |
9 dnl This file can can be used in projects which are not available under | |
10 dnl the GNU General Public License or the GNU Library General Public | |
11 dnl License but which still want to provide support for the GNU gettext | |
12 dnl functionality. | |
13 dnl Please note that the actual code of the GNU gettext library is covered | |
14 dnl by the GNU Library General Public License, and the rest of the GNU | |
15 dnl gettext package package is covered by the GNU General Public License. | |
16 dnl They are *not* in the public domain. | |
17 | |
18 dnl Authors: | |
19 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
20 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. |
0 | 21 |
22 dnl Macro to add for using GNU gettext. | |
23 | |
24 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). | |
25 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The | |
26 dnl default (if it is not specified or empty) is 'no-libtool'. | |
27 dnl INTLSYMBOL should be 'external' for packages with no intl directory, | |
28 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. | |
29 dnl If INTLSYMBOL is 'use-libtool', then a libtool library | |
30 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, | |
31 dnl depending on --{enable,disable}-{shared,static} and on the presence of | |
32 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library | |
33 dnl $(top_builddir)/intl/libintl.a will be created. | |
34 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext | |
35 dnl implementations (in libc or libintl) without the ngettext() function | |
36 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, | |
40 dnl the value `$(top_builddir)/intl/' is used. | |
41 dnl | |
42 dnl The result of the configuration is one of three cases: | |
43 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled | |
44 dnl and used. | |
45 dnl Catalog format: GNU --> install in $(datadir) | |
46 dnl Catalog extension: .mo after installation, .gmo in source tree | |
47 dnl 2) GNU gettext has been found in the system's C library. | |
48 dnl Catalog format: GNU --> install in $(datadir) | |
49 dnl Catalog extension: .mo after installation, .gmo in source tree | |
50 dnl 3) No internationalization, always use English msgid. | |
51 dnl Catalog format: none | |
52 dnl Catalog extension: none | |
53 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. | |
54 dnl The use of .gmo is historical (it was needed to avoid overwriting the | |
55 dnl GNU format catalogs when building on a platform with an X/Open gettext), | |
56 dnl but we keep it in order not to force irrelevant filename changes on the | |
57 dnl maintainers. | |
58 dnl | |
59 AC_DEFUN([AM_GNU_GETTEXT], | |
60 [ | |
61 dnl Argument checking. | |
62 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , | |
63 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT | |
64 ])])])])]) | |
65 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , | |
66 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT | |
67 ])])])]) | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
68 define(gt_included_intl, ifelse([$1], [external], [no], [yes])) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
69 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) |
0 | 70 |
71 AC_REQUIRE([AM_PO_SUBDIRS])dnl | |
72 ifelse(gt_included_intl, yes, [ | |
73 AC_REQUIRE([AM_INTL_SUBDIR])dnl | |
74 ]) | |
75 | |
76 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. | |
77 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | |
78 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 | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
83 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then |
0 | 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 dnl Set USE_NLS. | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
96 AM_NLS |
0 | 97 |
98 ifelse(gt_included_intl, yes, [ | |
99 BUILD_INCLUDED_LIBINTL=no | |
100 USE_INCLUDED_LIBINTL=no | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
101 INTL_OBJECTIVE= |
0 | 102 ]) |
103 LIBINTL= | |
104 LTLIBINTL= | |
105 POSUB= | |
106 | |
107 dnl If we use NLS figure out what method | |
108 if test "$USE_NLS" = "yes"; then | |
109 gt_use_preinstalled_gnugettext=no | |
110 ifelse(gt_included_intl, yes, [ | |
111 AC_MSG_CHECKING([whether included gettext is requested]) | |
112 AC_ARG_WITH(included-gettext, | |
113 [ --with-included-gettext use the GNU gettext library included here], | |
114 nls_cv_force_use_gnu_gettext=$withval, | |
115 nls_cv_force_use_gnu_gettext=no) | |
116 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | |
117 | |
118 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | |
119 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | |
120 ]) | |
121 dnl User does not insist on using GNU NLS library. Figure out what | |
122 dnl to use. If GNU gettext is available we use this. Else we have | |
123 dnl to fall back to GNU NLS library. | |
124 | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
125 dnl Add a version number to the cache macros. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
126 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
127 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
128 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
129 |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
130 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
131 [AC_TRY_LINK([#include <libintl.h> |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
132 ]ifelse([$2], [need-formatstring-macros], |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
133 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
0 | 134 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
135 #endif | |
136 changequote(,)dnl | |
137 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | |
138 changequote([,])dnl | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
139 ], [])[extern int _nl_msg_cat_cntr; |
0 | 140 extern int *_nl_domain_bindings;], |
141 [bindtextdomain ("", ""); | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
142 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
143 gt_cv_func_gnugettext_libc=yes, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
144 gt_cv_func_gnugettext_libc=no)]) |
0 | 145 |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
146 if test "$gt_cv_func_gnugettext_libc" != "yes"; then |
0 | 147 dnl Sometimes libintl requires libiconv, so first search for libiconv. |
148 ifelse(gt_included_intl, yes, , [ | |
149 AM_ICONV_LINK | |
150 ]) | |
151 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL | |
152 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) | |
153 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL | |
154 dnl even if libiconv doesn't exist. | |
155 AC_LIB_LINKFLAGS_BODY([intl]) | |
156 AC_CACHE_CHECK([for GNU gettext in libintl], | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
157 gt_cv_func_gnugettext_libintl, |
0 | 158 [gt_save_CPPFLAGS="$CPPFLAGS" |
159 CPPFLAGS="$CPPFLAGS $INCINTL" | |
160 gt_save_LIBS="$LIBS" | |
161 LIBS="$LIBS $LIBINTL" | |
162 dnl Now see whether libintl exists and does not depend on libiconv. | |
163 AC_TRY_LINK([#include <libintl.h> | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
164 ]ifelse([$2], [need-formatstring-macros], |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
165 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
166 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
167 #endif |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
168 changequote(,)dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
169 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
170 changequote([,])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
171 ], [])[extern int _nl_msg_cat_cntr; |
0 | 172 extern |
173 #ifdef __cplusplus | |
174 "C" | |
175 #endif | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
176 const char *_nl_expand_alias ();], |
0 | 177 [bindtextdomain ("", ""); |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
178 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
179 gt_cv_func_gnugettext_libintl=yes, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
180 gt_cv_func_gnugettext_libintl=no) |
0 | 181 dnl Now see whether libintl exists and depends on libiconv. |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
182 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then |
0 | 183 LIBS="$LIBS $LIBICONV" |
184 AC_TRY_LINK([#include <libintl.h> | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
185 ]ifelse([$2], [need-formatstring-macros], |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
186 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
187 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
188 #endif |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
189 changequote(,)dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
190 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
191 changequote([,])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
192 ], [])[extern int _nl_msg_cat_cntr; |
0 | 193 extern |
194 #ifdef __cplusplus | |
195 "C" | |
196 #endif | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
197 const char *_nl_expand_alias ();], |
0 | 198 [bindtextdomain ("", ""); |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
199 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], |
0 | 200 [LIBINTL="$LIBINTL $LIBICONV" |
201 LTLIBINTL="$LTLIBINTL $LTLIBICONV" | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
202 gt_cv_func_gnugettext_libintl=yes |
0 | 203 ]) |
204 fi | |
205 CPPFLAGS="$gt_save_CPPFLAGS" | |
206 LIBS="$gt_save_LIBS"]) | |
207 fi | |
208 | |
209 dnl If an already present or preinstalled GNU gettext() is found, | |
210 dnl use it. But if this macro is used in GNU gettext, and GNU | |
211 dnl gettext is already preinstalled in libintl, we update this | |
212 dnl libintl. (Cf. the install rule in intl/Makefile.in.) | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
213 if test "$gt_cv_func_gnugettext_libc" = "yes" \ |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
214 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ |
0 | 215 && test "$PACKAGE" != gettext-runtime \ |
216 && test "$PACKAGE" != gettext-tools; }; then | |
217 gt_use_preinstalled_gnugettext=yes | |
218 else | |
219 dnl Reset the values set by searching for libintl. | |
220 LIBINTL= | |
221 LTLIBINTL= | |
222 INCINTL= | |
223 fi | |
224 | |
225 ifelse(gt_included_intl, yes, [ | |
226 if test "$gt_use_preinstalled_gnugettext" != "yes"; then | |
227 dnl GNU gettext is not found in the C library. | |
228 dnl Fall back on included GNU gettext library. | |
229 nls_cv_use_gnu_gettext=yes | |
230 fi | |
231 fi | |
232 | |
233 if test "$nls_cv_use_gnu_gettext" = "yes"; then | |
234 dnl Mark actions used to generate GNU NLS library. | |
235 BUILD_INCLUDED_LIBINTL=yes | |
236 USE_INCLUDED_LIBINTL=yes | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
237 INTL_OBJECTIVE=intl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
238 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
239 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" |
0 | 240 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
241 fi | |
242 | |
243 if test "$gt_use_preinstalled_gnugettext" = "yes" \ | |
244 || test "$nls_cv_use_gnu_gettext" = "yes"; then | |
245 dnl Mark actions to use GNU gettext tools. | |
246 CATOBJEXT=.gmo | |
247 fi | |
248 ]) | |
249 | |
250 if test "$gt_use_preinstalled_gnugettext" = "yes" \ | |
251 || test "$nls_cv_use_gnu_gettext" = "yes"; then | |
252 AC_DEFINE(ENABLE_NLS, 1, | |
253 [Define to 1 if translation of program messages to the user's native language | |
254 is requested.]) | |
255 else | |
256 USE_NLS=no | |
257 fi | |
258 fi | |
259 | |
260 AC_MSG_CHECKING([whether to use NLS]) | |
261 AC_MSG_RESULT([$USE_NLS]) | |
262 if test "$USE_NLS" = "yes"; then | |
263 AC_MSG_CHECKING([where the gettext function comes from]) | |
264 if test "$gt_use_preinstalled_gnugettext" = "yes"; then | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
265 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then |
0 | 266 gt_source="external libintl" |
267 else | |
268 gt_source="libc" | |
269 fi | |
270 else | |
271 gt_source="included intl directory" | |
272 fi | |
273 AC_MSG_RESULT([$gt_source]) | |
274 fi | |
275 | |
276 if test "$USE_NLS" = "yes"; then | |
277 | |
278 if test "$gt_use_preinstalled_gnugettext" = "yes"; then | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
279 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then |
0 | 280 AC_MSG_CHECKING([how to link with libintl]) |
281 AC_MSG_RESULT([$LIBINTL]) | |
282 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) | |
283 fi | |
284 | |
285 dnl For backward compatibility. Some packages may be using this. | |
286 AC_DEFINE(HAVE_GETTEXT, 1, | |
287 [Define if the GNU gettext() function is already present or preinstalled.]) | |
288 AC_DEFINE(HAVE_DCGETTEXT, 1, | |
289 [Define if the GNU dcgettext() function is already present or preinstalled.]) | |
290 fi | |
291 | |
292 dnl We need to process the po/ directory. | |
293 POSUB=po | |
294 fi | |
295 | |
296 ifelse(gt_included_intl, yes, [ | |
297 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL | |
298 dnl to 'yes' because some of the testsuite requires it. | |
299 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then | |
300 BUILD_INCLUDED_LIBINTL=yes | |
301 fi | |
302 | |
303 dnl Make all variables we use known to autoconf. | |
304 AC_SUBST(BUILD_INCLUDED_LIBINTL) | |
305 AC_SUBST(USE_INCLUDED_LIBINTL) | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
306 AC_SUBST(INTL_OBJECTIVE) |
0 | 307 AC_SUBST(CATOBJEXT) |
308 | |
309 dnl For backward compatibility. Some configure.ins may be using this. | |
310 nls_cv_header_intl= | |
311 nls_cv_header_libgt= | |
312 | |
313 dnl For backward compatibility. Some Makefiles may be using this. | |
314 DATADIRNAME=share | |
315 AC_SUBST(DATADIRNAME) | |
316 | |
317 dnl For backward compatibility. Some Makefiles may be using this. | |
318 INSTOBJEXT=.mo | |
319 AC_SUBST(INSTOBJEXT) | |
320 | |
321 dnl For backward compatibility. Some Makefiles may be using this. | |
322 GENCAT=gencat | |
323 AC_SUBST(GENCAT) | |
324 | |
325 dnl For backward compatibility. Some Makefiles may be using this. | |
326 if test "$USE_INCLUDED_LIBINTL" = yes; then | |
327 INTLOBJS="\$(GETTOBJS)" | |
328 fi | |
329 AC_SUBST(INTLOBJS) | |
330 | |
331 dnl Enable libtool support if the surrounding package wishes it. | |
332 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix | |
333 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) | |
334 ]) | |
335 | |
336 dnl For backward compatibility. Some Makefiles may be using this. | |
337 INTLLIBS="$LIBINTL" | |
338 AC_SUBST(INTLLIBS) | |
339 | |
340 dnl Make all documented variables known to autoconf. | |
341 AC_SUBST(LIBINTL) | |
342 AC_SUBST(LTLIBINTL) | |
343 AC_SUBST(POSUB) | |
344 ]) | |
345 | |
346 | |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
347 dnl Checks for all prerequisites of the intl subdirectory, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
348 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
349 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
350 AC_DEFUN([AM_INTL_SUBDIR], |
0 | 351 [ |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
352 AC_REQUIRE([AC_PROG_INSTALL])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
353 AC_REQUIRE([AM_MKINSTALLDIRS])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
354 AC_REQUIRE([AC_PROG_CC])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
355 AC_REQUIRE([AC_CANONICAL_HOST])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
356 AC_REQUIRE([AC_PROG_RANLIB])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
357 AC_REQUIRE([AC_ISC_POSIX])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
358 AC_REQUIRE([AC_HEADER_STDC])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
359 AC_REQUIRE([AC_C_CONST])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
360 AC_REQUIRE([AC_C_INLINE])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
361 AC_REQUIRE([AC_TYPE_OFF_T])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
362 AC_REQUIRE([AC_TYPE_SIZE_T])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
363 AC_REQUIRE([AC_FUNC_ALLOCA])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
364 AC_REQUIRE([AC_FUNC_MMAP])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
365 AC_REQUIRE([jm_GLIBC21])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
366 AC_REQUIRE([gt_INTDIV0])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
367 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
368 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
369 AC_REQUIRE([gt_INTTYPES_PRI])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
370 |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
371 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
372 stdlib.h string.h unistd.h sys/param.h]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
373 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \ |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
374 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \ |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
375 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \ |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
376 __fsetlocking]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
377 |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
378 AM_ICONV |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
379 AM_LANGINFO_CODESET |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
380 if test $ac_cv_header_locale_h = yes; then |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
381 AM_LC_MESSAGES |
4458
2df5e83c9bf4
Updated bunch of m4 macros from Debian testing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1874
diff
changeset
|
382 fi |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
383 |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
384 dnl intl/plural.c is generated from intl/plural.y. It requires bison, |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
385 dnl because plural.y uses bison specific features. It requires at least |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
386 dnl bison-1.26 because earlier versions generate a plural.c that doesn't |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
387 dnl compile. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
388 dnl bison is only needed for the maintainer (who touches plural.y). But in |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
389 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
390 dnl the rule in general Makefile. Now, some people carelessly touch the |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
391 dnl files or have a broken "make" program, hence the plural.c rule will |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
392 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
393 dnl present or too old. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
394 AC_CHECK_PROGS([INTLBISON], [bison]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
395 if test -z "$INTLBISON"; then |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
396 ac_verc_fail=yes |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
397 else |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
398 dnl Found it, now check the version. |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
399 AC_MSG_CHECKING([version of bison]) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
400 changequote(<<,>>)dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
401 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
402 case $ac_prog_version in |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
403 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
404 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
405 changequote([,])dnl |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
406 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
407 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
408 esac |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
409 AC_MSG_RESULT([$ac_prog_version]) |
4458
2df5e83c9bf4
Updated bunch of m4 macros from Debian testing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1874
diff
changeset
|
410 fi |
4462
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
411 if test $ac_verc_fail = yes; then |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
412 INTLBISON=: |
0b924771b26e
Backed out changeset b128239bfc7a
Matti Hamalainen <ccr@tnsp.org>
parents:
4458
diff
changeset
|
413 fi |
0 | 414 ]) |
415 | |
416 | |
417 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) | |
418 AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |