diff options
-rw-r--r-- | m4/codeset.m4 | 23 | ||||
-rw-r--r-- | m4/gettext.m4 | 487 | ||||
-rw-r--r-- | m4/glibc21.m4 | 32 | ||||
-rw-r--r-- | m4/iconv.m4 | 103 | ||||
-rw-r--r-- | m4/intdiv0.m4 | 72 | ||||
-rw-r--r-- | m4/intmax.m4 | 32 | ||||
-rw-r--r-- | m4/inttypes-pri.m4 | 32 | ||||
-rw-r--r-- | m4/inttypes.m4 | 27 | ||||
-rw-r--r-- | m4/inttypes_h.m4 | 28 | ||||
-rw-r--r-- | m4/lcmessage.m4 | 32 | ||||
-rw-r--r-- | m4/lib-ld.m4 | 112 | ||||
-rw-r--r-- | m4/lib-link.m4 | 551 | ||||
-rw-r--r-- | m4/lib-prefix.m4 | 155 | ||||
-rw-r--r-- | m4/longdouble.m4 | 30 | ||||
-rw-r--r-- | m4/longlong.m4 | 25 | ||||
-rw-r--r-- | m4/nls.m4 | 49 | ||||
-rw-r--r-- | m4/po.m4 | 426 | ||||
-rw-r--r-- | m4/printf-posix.m4 | 46 | ||||
-rw-r--r-- | m4/progtest.m4 | 91 | ||||
-rw-r--r-- | m4/signed.m4 | 19 | ||||
-rw-r--r-- | m4/size_max.m4 | 61 | ||||
-rw-r--r-- | m4/stdint_h.m4 | 28 | ||||
-rw-r--r-- | m4/uintmax_t.m4 | 32 | ||||
-rw-r--r-- | m4/ulonglong.m4 | 25 | ||||
-rw-r--r-- | m4/wchar_t.m4 | 22 | ||||
-rw-r--r-- | m4/wint_t.m4 | 22 | ||||
-rw-r--r-- | m4/xsize.m4 | 14 |
27 files changed, 2576 insertions, 0 deletions
diff --git a/m4/codeset.m4 b/m4/codeset.m4 new file mode 100644 index 00000000..59535ebc --- /dev/null +++ b/m4/codeset.m4 | |||
@@ -0,0 +1,23 @@ | |||
1 | # codeset.m4 serial AM1 (gettext-0.10.40) | ||
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | AC_DEFUN([AM_LANGINFO_CODESET], | ||
12 | [ | ||
13 | AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, | ||
14 | [AC_TRY_LINK([#include <langinfo.h>], | ||
15 | [char* cs = nl_langinfo(CODESET);], | ||
16 | am_cv_langinfo_codeset=yes, | ||
17 | am_cv_langinfo_codeset=no) | ||
18 | ]) | ||
19 | if test $am_cv_langinfo_codeset = yes; then | ||
20 | AC_DEFINE(HAVE_LANGINFO_CODESET, 1, | ||
21 | [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) | ||
22 | fi | ||
23 | ]) | ||
diff --git a/m4/gettext.m4 b/m4/gettext.m4 new file mode 100644 index 00000000..a374f03f --- /dev/null +++ b/m4/gettext.m4 | |||
@@ -0,0 +1,487 @@ | |||
1 | # gettext.m4 serial 28 (gettext-0.13) | ||
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
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. | ||
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | ||
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 | ])])])]) | ||
68 | define(gt_included_intl, ifelse([$1], [external], [no], [yes])) | ||
69 | define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], [])) | ||
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 | ||
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 | dnl Set USE_NLS. | ||
96 | AM_NLS | ||
97 | |||
98 | ifelse(gt_included_intl, yes, [ | ||
99 | BUILD_INCLUDED_LIBINTL=no | ||
100 | USE_INCLUDED_LIBINTL=no | ||
101 | ]) | ||
102 | LIBINTL= | ||
103 | LTLIBINTL= | ||
104 | POSUB= | ||
105 | |||
106 | dnl If we use NLS figure out what method | ||
107 | if test "$USE_NLS" = "yes"; then | ||
108 | gt_use_preinstalled_gnugettext=no | ||
109 | ifelse(gt_included_intl, yes, [ | ||
110 | AC_MSG_CHECKING([whether included gettext is requested]) | ||
111 | AC_ARG_WITH(included-gettext, | ||
112 | [ --with-included-gettext use the GNU gettext library included here], | ||
113 | nls_cv_force_use_gnu_gettext=$withval, | ||
114 | nls_cv_force_use_gnu_gettext=no) | ||
115 | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) | ||
116 | |||
117 | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" | ||
118 | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then | ||
119 | ]) | ||
120 | dnl User does not insist on using GNU NLS library. Figure out what | ||
121 | dnl to use. If GNU gettext is available we use this. Else we have | ||
122 | dnl to fall back to GNU NLS library. | ||
123 | |||
124 | dnl Add a version number to the cache macros. | ||
125 | define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1))) | ||
126 | define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc]) | ||
127 | define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl]) | ||
128 | |||
129 | AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, | ||
130 | [AC_TRY_LINK([#include <libintl.h> | ||
131 | ]ifelse([$2], [need-formatstring-macros], | ||
132 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | ||
133 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | ||
134 | #endif | ||
135 | changequote(,)dnl | ||
136 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | ||
137 | changequote([,])dnl | ||
138 | ], [])[extern int _nl_msg_cat_cntr; | ||
139 | extern int *_nl_domain_bindings;], | ||
140 | [bindtextdomain ("", ""); | ||
141 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings], | ||
142 | gt_cv_func_gnugettext_libc=yes, | ||
143 | gt_cv_func_gnugettext_libc=no)]) | ||
144 | |||
145 | if test "$gt_cv_func_gnugettext_libc" != "yes"; then | ||
146 | dnl Sometimes libintl requires libiconv, so first search for libiconv. | ||
147 | ifelse(gt_included_intl, yes, , [ | ||
148 | AM_ICONV_LINK | ||
149 | ]) | ||
150 | dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL | ||
151 | dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) | ||
152 | dnl because that would add "-liconv" to LIBINTL and LTLIBINTL | ||
153 | dnl even if libiconv doesn't exist. | ||
154 | AC_LIB_LINKFLAGS_BODY([intl]) | ||
155 | AC_CACHE_CHECK([for GNU gettext in libintl], | ||
156 | gt_cv_func_gnugettext_libintl, | ||
157 | [gt_save_CPPFLAGS="$CPPFLAGS" | ||
158 | CPPFLAGS="$CPPFLAGS $INCINTL" | ||
159 | gt_save_LIBS="$LIBS" | ||
160 | LIBS="$LIBS $LIBINTL" | ||
161 | dnl Now see whether libintl exists and does not depend on libiconv. | ||
162 | AC_TRY_LINK([#include <libintl.h> | ||
163 | ]ifelse([$2], [need-formatstring-macros], | ||
164 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | ||
165 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | ||
166 | #endif | ||
167 | changequote(,)dnl | ||
168 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | ||
169 | changequote([,])dnl | ||
170 | ], [])[extern int _nl_msg_cat_cntr; | ||
171 | extern | ||
172 | #ifdef __cplusplus | ||
173 | "C" | ||
174 | #endif | ||
175 | const char *_nl_expand_alias ();], | ||
176 | [bindtextdomain ("", ""); | ||
177 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], | ||
178 | gt_cv_func_gnugettext_libintl=yes, | ||
179 | gt_cv_func_gnugettext_libintl=no) | ||
180 | dnl Now see whether libintl exists and depends on libiconv. | ||
181 | if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then | ||
182 | LIBS="$LIBS $LIBICONV" | ||
183 | AC_TRY_LINK([#include <libintl.h> | ||
184 | ]ifelse([$2], [need-formatstring-macros], | ||
185 | [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION | ||
186 | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) | ||
187 | #endif | ||
188 | changequote(,)dnl | ||
189 | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; | ||
190 | changequote([,])dnl | ||
191 | ], [])[extern int _nl_msg_cat_cntr; | ||
192 | extern | ||
193 | #ifdef __cplusplus | ||
194 | "C" | ||
195 | #endif | ||
196 | const char *_nl_expand_alias ();], | ||
197 | [bindtextdomain ("", ""); | ||
198 | return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)], | ||
199 | [LIBINTL="$LIBINTL $LIBICONV" | ||
200 | LTLIBINTL="$LTLIBINTL $LTLIBICONV" | ||
201 | gt_cv_func_gnugettext_libintl=yes | ||
202 | ]) | ||
203 | fi | ||
204 | CPPFLAGS="$gt_save_CPPFLAGS" | ||
205 | LIBS="$gt_save_LIBS"]) | ||
206 | fi | ||
207 | |||
208 | dnl If an already present or preinstalled GNU gettext() is found, | ||
209 | dnl use it. But if this macro is used in GNU gettext, and GNU | ||
210 | dnl gettext is already preinstalled in libintl, we update this | ||
211 | dnl libintl. (Cf. the install rule in intl/Makefile.in.) | ||
212 | if test "$gt_cv_func_gnugettext_libc" = "yes" \ | ||
213 | || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ | ||
214 | && test "$PACKAGE" != gettext-runtime \ | ||
215 | && test "$PACKAGE" != gettext-tools; }; then | ||
216 | gt_use_preinstalled_gnugettext=yes | ||
217 | else | ||
218 | dnl Reset the values set by searching for libintl. | ||
219 | LIBINTL= | ||
220 | LTLIBINTL= | ||
221 | INCINTL= | ||
222 | fi | ||
223 | |||
224 | ifelse(gt_included_intl, yes, [ | ||
225 | if test "$gt_use_preinstalled_gnugettext" != "yes"; then | ||
226 | dnl GNU gettext is not found in the C library. | ||
227 | dnl Fall back on included GNU gettext library. | ||
228 | nls_cv_use_gnu_gettext=yes | ||
229 | fi | ||
230 | fi | ||
231 | |||
232 | if test "$nls_cv_use_gnu_gettext" = "yes"; then | ||
233 | dnl Mark actions used to generate GNU NLS library. | ||
234 | BUILD_INCLUDED_LIBINTL=yes | ||
235 | USE_INCLUDED_LIBINTL=yes | ||
236 | LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV" | ||
237 | LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV" | ||
238 | LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` | ||
239 | fi | ||
240 | |||
241 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | ||
242 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | ||
243 | dnl Mark actions to use GNU gettext tools. | ||
244 | CATOBJEXT=.gmo | ||
245 | fi | ||
246 | ]) | ||
247 | |||
248 | if test "$gt_use_preinstalled_gnugettext" = "yes" \ | ||
249 | || test "$nls_cv_use_gnu_gettext" = "yes"; then | ||
250 | AC_DEFINE(ENABLE_NLS, 1, | ||
251 | [Define to 1 if translation of program messages to the user's native language | ||
252 | is requested.]) | ||
253 | else | ||
254 | USE_NLS=no | ||
255 | fi | ||
256 | fi | ||
257 | |||
258 | AC_MSG_CHECKING([whether to use NLS]) | ||
259 | AC_MSG_RESULT([$USE_NLS]) | ||
260 | if test "$USE_NLS" = "yes"; then | ||
261 | AC_MSG_CHECKING([where the gettext function comes from]) | ||
262 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then | ||
263 | if test "$gt_cv_func_gnugettext_libintl" = "yes"; then | ||
264 | gt_source="external libintl" | ||
265 | else | ||
266 | gt_source="libc" | ||
267 | fi | ||
268 | else | ||
269 | gt_source="included intl directory" | ||
270 | fi | ||
271 | AC_MSG_RESULT([$gt_source]) | ||
272 | fi | ||
273 | |||
274 | if test "$USE_NLS" = "yes"; then | ||
275 | |||
276 | if test "$gt_use_preinstalled_gnugettext" = "yes"; then | ||
277 | if test "$gt_cv_func_gnugettext_libintl" = "yes"; then | ||
278 | AC_MSG_CHECKING([how to link with libintl]) | ||
279 | AC_MSG_RESULT([$LIBINTL]) | ||
280 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) | ||
281 | fi | ||
282 | |||
283 | dnl For backward compatibility. Some packages may be using this. | ||
284 | AC_DEFINE(HAVE_GETTEXT, 1, | ||
285 | [Define if the GNU gettext() function is already present or preinstalled.]) | ||
286 | AC_DEFINE(HAVE_DCGETTEXT, 1, | ||
287 | [Define if the GNU dcgettext() function is already present or preinstalled.]) | ||
288 | fi | ||
289 | |||
290 | dnl We need to process the po/ directory. | ||
291 | POSUB=po | ||
292 | fi | ||
293 | |||
294 | ifelse(gt_included_intl, yes, [ | ||
295 | dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL | ||
296 | dnl to 'yes' because some of the testsuite requires it. | ||
297 | if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then | ||
298 | BUILD_INCLUDED_LIBINTL=yes | ||
299 | fi | ||
300 | |||
301 | dnl Make all variables we use known to autoconf. | ||
302 | AC_SUBST(BUILD_INCLUDED_LIBINTL) | ||
303 | AC_SUBST(USE_INCLUDED_LIBINTL) | ||
304 | AC_SUBST(CATOBJEXT) | ||
305 | |||
306 | dnl For backward compatibility. Some configure.ins may be using this. | ||
307 | nls_cv_header_intl= | ||
308 | nls_cv_header_libgt= | ||
309 | |||
310 | dnl For backward compatibility. Some Makefiles may be using this. | ||
311 | DATADIRNAME=share | ||
312 | AC_SUBST(DATADIRNAME) | ||
313 | |||
314 | dnl For backward compatibility. Some Makefiles may be using this. | ||
315 | INSTOBJEXT=.mo | ||
316 | AC_SUBST(INSTOBJEXT) | ||
317 | |||
318 | dnl For backward compatibility. Some Makefiles may be using this. | ||
319 | GENCAT=gencat | ||
320 | AC_SUBST(GENCAT) | ||
321 | |||
322 | dnl For backward compatibility. Some Makefiles may be using this. | ||
323 | if test "$USE_INCLUDED_LIBINTL" = yes; then | ||
324 | INTLOBJS="\$(GETTOBJS)" | ||
325 | fi | ||
326 | AC_SUBST(INTLOBJS) | ||
327 | |||
328 | dnl Enable libtool support if the surrounding package wishes it. | ||
329 | INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix | ||
330 | AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) | ||
331 | ]) | ||
332 | |||
333 | dnl For backward compatibility. Some Makefiles may be using this. | ||
334 | INTLLIBS="$LIBINTL" | ||
335 | AC_SUBST(INTLLIBS) | ||
336 | |||
337 | dnl Make all documented variables known to autoconf. | ||
338 | AC_SUBST(LIBINTL) | ||
339 | AC_SUBST(LTLIBINTL) | ||
340 | AC_SUBST(POSUB) | ||
341 | ]) | ||
342 | |||
343 | |||
344 | dnl Checks for all prerequisites of the intl subdirectory, | ||
345 | dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS, | ||
346 | dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL. | ||
347 | AC_DEFUN([AM_INTL_SUBDIR], | ||
348 | [ | ||
349 | AC_REQUIRE([AC_PROG_INSTALL])dnl | ||
350 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl | ||
351 | AC_REQUIRE([AC_PROG_CC])dnl | ||
352 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | ||
353 | AC_REQUIRE([AC_PROG_RANLIB])dnl | ||
354 | AC_REQUIRE([AC_ISC_POSIX])dnl | ||
355 | AC_REQUIRE([AC_HEADER_STDC])dnl | ||
356 | AC_REQUIRE([AC_C_CONST])dnl | ||
357 | AC_REQUIRE([bh_C_SIGNED])dnl | ||
358 | AC_REQUIRE([AC_C_INLINE])dnl | ||
359 | AC_REQUIRE([AC_TYPE_OFF_T])dnl | ||
360 | AC_REQUIRE([AC_TYPE_SIZE_T])dnl | ||
361 | AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl | ||
362 | AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl | ||
363 | AC_REQUIRE([gt_TYPE_WCHAR_T])dnl | ||
364 | AC_REQUIRE([gt_TYPE_WINT_T])dnl | ||
365 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | ||
366 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | ||
367 | AC_REQUIRE([gt_TYPE_INTMAX_T]) | ||
368 | AC_REQUIRE([gt_PRINTF_POSIX]) | ||
369 | AC_REQUIRE([AC_FUNC_ALLOCA])dnl | ||
370 | AC_REQUIRE([AC_FUNC_MMAP])dnl | ||
371 | AC_REQUIRE([jm_GLIBC21])dnl | ||
372 | AC_REQUIRE([gt_INTDIV0])dnl | ||
373 | AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl | ||
374 | AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl | ||
375 | AC_REQUIRE([gt_INTTYPES_PRI])dnl | ||
376 | AC_REQUIRE([gl_XSIZE])dnl | ||
377 | |||
378 | AC_CHECK_TYPE([ptrdiff_t], , | ||
379 | [AC_DEFINE([ptrdiff_t], [long], | ||
380 | [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) | ||
381 | ]) | ||
382 | AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ | ||
383 | stdlib.h string.h unistd.h sys/param.h]) | ||
384 | AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \ | ||
385 | mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \ | ||
386 | strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \ | ||
387 | __fsetlocking]) | ||
388 | |||
389 | dnl Use the _snprintf function only if it is declared (because on NetBSD it | ||
390 | dnl is defined as a weak alias of snprintf; we prefer to use the latter). | ||
391 | gt_CHECK_DECL(_snprintf, [#include <stdio.h>]) | ||
392 | gt_CHECK_DECL(_snwprintf, [#include <stdio.h>]) | ||
393 | |||
394 | dnl Use the *_unlocked functions only if they are declared. | ||
395 | dnl (because some of them were defined without being declared in Solaris | ||
396 | dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built | ||
397 | dnl on Solaris 2.5.1 to run on Solaris 2.6). | ||
398 | dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13. | ||
399 | gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>]) | ||
400 | gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>]) | ||
401 | gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>]) | ||
402 | |||
403 | case $gt_cv_func_printf_posix in | ||
404 | *yes) HAVE_POSIX_PRINTF=1 ;; | ||
405 | *) HAVE_POSIX_PRINTF=0 ;; | ||
406 | esac | ||
407 | AC_SUBST([HAVE_POSIX_PRINTF]) | ||
408 | if test "$ac_cv_func_asprintf" = yes; then | ||
409 | HAVE_ASPRINTF=1 | ||
410 | else | ||
411 | HAVE_ASPRINTF=0 | ||
412 | fi | ||
413 | AC_SUBST([HAVE_ASPRINTF]) | ||
414 | if test "$ac_cv_func_snprintf" = yes; then | ||
415 | HAVE_SNPRINTF=1 | ||
416 | else | ||
417 | HAVE_SNPRINTF=0 | ||
418 | fi | ||
419 | AC_SUBST([HAVE_SNPRINTF]) | ||
420 | if test "$ac_cv_func_wprintf" = yes; then | ||
421 | HAVE_WPRINTF=1 | ||
422 | else | ||
423 | HAVE_WPRINTF=0 | ||
424 | fi | ||
425 | AC_SUBST([HAVE_WPRINTF]) | ||
426 | |||
427 | AM_ICONV | ||
428 | AM_LANGINFO_CODESET | ||
429 | if test $ac_cv_header_locale_h = yes; then | ||
430 | AM_LC_MESSAGES | ||
431 | fi | ||
432 | |||
433 | dnl intl/plural.c is generated from intl/plural.y. It requires bison, | ||
434 | dnl because plural.y uses bison specific features. It requires at least | ||
435 | dnl bison-1.26 because earlier versions generate a plural.c that doesn't | ||
436 | dnl compile. | ||
437 | dnl bison is only needed for the maintainer (who touches plural.y). But in | ||
438 | dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put | ||
439 | dnl the rule in general Makefile. Now, some people carelessly touch the | ||
440 | dnl files or have a broken "make" program, hence the plural.c rule will | ||
441 | dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not | ||
442 | dnl present or too old. | ||
443 | AC_CHECK_PROGS([INTLBISON], [bison]) | ||
444 | if test -z "$INTLBISON"; then | ||
445 | ac_verc_fail=yes | ||
446 | else | ||
447 | dnl Found it, now check the version. | ||
448 | AC_MSG_CHECKING([version of bison]) | ||
449 | changequote(<<,>>)dnl | ||
450 | ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` | ||
451 | case $ac_prog_version in | ||
452 | '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; | ||
453 | 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) | ||
454 | changequote([,])dnl | ||
455 | ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; | ||
456 | *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; | ||
457 | esac | ||
458 | AC_MSG_RESULT([$ac_prog_version]) | ||
459 | fi | ||
460 | if test $ac_verc_fail = yes; then | ||
461 | INTLBISON=: | ||
462 | fi | ||
463 | ]) | ||
464 | |||
465 | |||
466 | dnl gt_CHECK_DECL(FUNC, INCLUDES) | ||
467 | dnl Check whether a function is declared. | ||
468 | AC_DEFUN([gt_CHECK_DECL], | ||
469 | [ | ||
470 | AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1, | ||
471 | [AC_TRY_COMPILE([$2], [ | ||
472 | #ifndef $1 | ||
473 | char *p = (char *) $1; | ||
474 | #endif | ||
475 | ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)]) | ||
476 | if test $ac_cv_have_decl_$1 = yes; then | ||
477 | gt_value=1 | ||
478 | else | ||
479 | gt_value=0 | ||
480 | fi | ||
481 | AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value], | ||
482 | [Define to 1 if you have the declaration of `$1', and to 0 if you don't.]) | ||
483 | ]) | ||
484 | |||
485 | |||
486 | dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) | ||
487 | AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) | ||
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4 new file mode 100644 index 00000000..9c9f3db3 --- /dev/null +++ b/m4/glibc21.m4 | |||
@@ -0,0 +1,32 @@ | |||
1 | # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40) | ||
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | # Test for the GNU C Library, version 2.1 or newer. | ||
10 | # From Bruno Haible. | ||
11 | |||
12 | AC_DEFUN([jm_GLIBC21], | ||
13 | [ | ||
14 | AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, | ||
15 | ac_cv_gnu_library_2_1, | ||
16 | [AC_EGREP_CPP([Lucky GNU user], | ||
17 | [ | ||
18 | #include <features.h> | ||
19 | #ifdef __GNU_LIBRARY__ | ||
20 | #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) | ||
21 | Lucky GNU user | ||
22 | #endif | ||
23 | #endif | ||
24 | ], | ||
25 | ac_cv_gnu_library_2_1=yes, | ||
26 | ac_cv_gnu_library_2_1=no) | ||
27 | ] | ||
28 | ) | ||
29 | AC_SUBST(GLIBC21) | ||
30 | GLIBC21="$ac_cv_gnu_library_2_1" | ||
31 | ] | ||
32 | ) | ||
diff --git a/m4/iconv.m4 b/m4/iconv.m4 new file mode 100644 index 00000000..c5f35798 --- /dev/null +++ b/m4/iconv.m4 | |||
@@ -0,0 +1,103 @@ | |||
1 | # iconv.m4 serial AM4 (gettext-0.11.3) | ||
2 | dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], | ||
12 | [ | ||
13 | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. | ||
14 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | ||
15 | AC_REQUIRE([AC_LIB_RPATH]) | ||
16 | |||
17 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV | ||
18 | dnl accordingly. | ||
19 | AC_LIB_LINKFLAGS_BODY([iconv]) | ||
20 | ]) | ||
21 | |||
22 | AC_DEFUN([AM_ICONV_LINK], | ||
23 | [ | ||
24 | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and | ||
25 | dnl those with the standalone portable GNU libiconv installed). | ||
26 | |||
27 | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV | ||
28 | dnl accordingly. | ||
29 | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) | ||
30 | |||
31 | dnl Add $INCICONV to CPPFLAGS before performing the following checks, | ||
32 | dnl because if the user has installed libiconv and not disabled its use | ||
33 | dnl via --without-libiconv-prefix, he wants to use it. The first | ||
34 | dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. | ||
35 | am_save_CPPFLAGS="$CPPFLAGS" | ||
36 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) | ||
37 | |||
38 | AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ | ||
39 | am_cv_func_iconv="no, consider installing GNU libiconv" | ||
40 | am_cv_lib_iconv=no | ||
41 | AC_TRY_LINK([#include <stdlib.h> | ||
42 | #include <iconv.h>], | ||
43 | [iconv_t cd = iconv_open("",""); | ||
44 | iconv(cd,NULL,NULL,NULL,NULL); | ||
45 | iconv_close(cd);], | ||
46 | am_cv_func_iconv=yes) | ||
47 | if test "$am_cv_func_iconv" != yes; then | ||
48 | am_save_LIBS="$LIBS" | ||
49 | LIBS="$LIBS $LIBICONV" | ||
50 | AC_TRY_LINK([#include <stdlib.h> | ||
51 | #include <iconv.h>], | ||
52 | [iconv_t cd = iconv_open("",""); | ||
53 | iconv(cd,NULL,NULL,NULL,NULL); | ||
54 | iconv_close(cd);], | ||
55 | am_cv_lib_iconv=yes | ||
56 | am_cv_func_iconv=yes) | ||
57 | LIBS="$am_save_LIBS" | ||
58 | fi | ||
59 | ]) | ||
60 | if test "$am_cv_func_iconv" = yes; then | ||
61 | AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) | ||
62 | fi | ||
63 | if test "$am_cv_lib_iconv" = yes; then | ||
64 | AC_MSG_CHECKING([how to link with libiconv]) | ||
65 | AC_MSG_RESULT([$LIBICONV]) | ||
66 | else | ||
67 | dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV | ||
68 | dnl either. | ||
69 | CPPFLAGS="$am_save_CPPFLAGS" | ||
70 | LIBICONV= | ||
71 | LTLIBICONV= | ||
72 | fi | ||
73 | AC_SUBST(LIBICONV) | ||
74 | AC_SUBST(LTLIBICONV) | ||
75 | ]) | ||
76 | |||
77 | AC_DEFUN([AM_ICONV], | ||
78 | [ | ||
79 | AM_ICONV_LINK | ||
80 | if test "$am_cv_func_iconv" = yes; then | ||
81 | AC_MSG_CHECKING([for iconv declaration]) | ||
82 | AC_CACHE_VAL(am_cv_proto_iconv, [ | ||
83 | AC_TRY_COMPILE([ | ||
84 | #include <stdlib.h> | ||
85 | #include <iconv.h> | ||
86 | extern | ||
87 | #ifdef __cplusplus | ||
88 | "C" | ||
89 | #endif | ||
90 | #if defined(__STDC__) || defined(__cplusplus) | ||
91 | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); | ||
92 | #else | ||
93 | size_t iconv(); | ||
94 | #endif | ||
95 | ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") | ||
96 | am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) | ||
97 | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` | ||
98 | AC_MSG_RESULT([$]{ac_t:- | ||
99 | }[$]am_cv_proto_iconv) | ||
100 | AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, | ||
101 | [Define as const if the declaration of iconv() needs const.]) | ||
102 | fi | ||
103 | ]) | ||
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4 new file mode 100644 index 00000000..55dddcf1 --- /dev/null +++ b/m4/intdiv0.m4 | |||
@@ -0,0 +1,72 @@ | |||
1 | # intdiv0.m4 serial 1 (gettext-0.11.3) | ||
2 | dnl Copyright (C) 2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | AC_DEFUN([gt_INTDIV0], | ||
12 | [ | ||
13 | AC_REQUIRE([AC_PROG_CC])dnl | ||
14 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | ||
15 | |||
16 | AC_CACHE_CHECK([whether integer division by zero raises SIGFPE], | ||
17 | gt_cv_int_divbyzero_sigfpe, | ||
18 | [ | ||
19 | AC_TRY_RUN([ | ||
20 | #include <stdlib.h> | ||
21 | #include <signal.h> | ||
22 | |||
23 | static void | ||
24 | #ifdef __cplusplus | ||
25 | sigfpe_handler (int sig) | ||
26 | #else | ||
27 | sigfpe_handler (sig) int sig; | ||
28 | #endif | ||
29 | { | ||
30 | /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ | ||
31 | exit (sig != SIGFPE); | ||
32 | } | ||
33 | |||
34 | int x = 1; | ||
35 | int y = 0; | ||
36 | int z; | ||
37 | int nan; | ||
38 | |||
39 | int main () | ||
40 | { | ||
41 | signal (SIGFPE, sigfpe_handler); | ||
42 | /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */ | ||
43 | #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP) | ||
44 | signal (SIGTRAP, sigfpe_handler); | ||
45 | #endif | ||
46 | /* Linux/SPARC yields signal SIGILL. */ | ||
47 | #if defined (__sparc__) && defined (__linux__) | ||
48 | signal (SIGILL, sigfpe_handler); | ||
49 | #endif | ||
50 | |||
51 | z = x / y; | ||
52 | nan = y / y; | ||
53 | exit (1); | ||
54 | } | ||
55 | ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no, | ||
56 | [ | ||
57 | # Guess based on the CPU. | ||
58 | case "$host_cpu" in | ||
59 | alpha* | i[34567]86 | m68k | s390*) | ||
60 | gt_cv_int_divbyzero_sigfpe="guessing yes";; | ||
61 | *) | ||
62 | gt_cv_int_divbyzero_sigfpe="guessing no";; | ||
63 | esac | ||
64 | ]) | ||
65 | ]) | ||
66 | case "$gt_cv_int_divbyzero_sigfpe" in | ||
67 | *yes) value=1;; | ||
68 | *) value=0;; | ||
69 | esac | ||
70 | AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value, | ||
71 | [Define if integer division by zero raises signal SIGFPE.]) | ||
72 | ]) | ||
diff --git a/m4/intmax.m4 b/m4/intmax.m4 new file mode 100644 index 00000000..dfb08ccc --- /dev/null +++ b/m4/intmax.m4 | |||
@@ -0,0 +1,32 @@ | |||
1 | # intmax.m4 serial 1 (gettext-0.12) | ||
2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | dnl Test whether the system has the 'intmax_t' type, but don't attempt to | ||
11 | dnl find a replacement if it is lacking. | ||
12 | |||
13 | AC_DEFUN([gt_TYPE_INTMAX_T], | ||
14 | [ | ||
15 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | ||
16 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | ||
17 | AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, | ||
18 | [AC_TRY_COMPILE([ | ||
19 | #include <stddef.h> | ||
20 | #include <stdlib.h> | ||
21 | #if HAVE_STDINT_H_WITH_UINTMAX | ||
22 | #include <stdint.h> | ||
23 | #endif | ||
24 | #if HAVE_INTTYPES_H_WITH_UINTMAX | ||
25 | #include <inttypes.h> | ||
26 | #endif | ||
27 | ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) | ||
28 | if test $gt_cv_c_intmax_t = yes; then | ||
29 | AC_DEFINE(HAVE_INTMAX_T, 1, | ||
30 | [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.]) | ||
31 | fi | ||
32 | ]) | ||
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4 new file mode 100644 index 00000000..fd007c31 --- /dev/null +++ b/m4/inttypes-pri.m4 | |||
@@ -0,0 +1,32 @@ | |||
1 | # inttypes-pri.m4 serial 1 (gettext-0.11.4) | ||
2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI* | ||
12 | # macros to non-string values. This is the case on AIX 4.3.3. | ||
13 | |||
14 | AC_DEFUN([gt_INTTYPES_PRI], | ||
15 | [ | ||
16 | AC_REQUIRE([gt_HEADER_INTTYPES_H]) | ||
17 | if test $gt_cv_header_inttypes_h = yes; then | ||
18 | AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], | ||
19 | gt_cv_inttypes_pri_broken, | ||
20 | [ | ||
21 | AC_TRY_COMPILE([#include <inttypes.h> | ||
22 | #ifdef PRId32 | ||
23 | char *p = PRId32; | ||
24 | #endif | ||
25 | ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes) | ||
26 | ]) | ||
27 | fi | ||
28 | if test "$gt_cv_inttypes_pri_broken" = yes; then | ||
29 | AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1, | ||
30 | [Define if <inttypes.h> exists and defines unusable PRI* macros.]) | ||
31 | fi | ||
32 | ]) | ||
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4 new file mode 100644 index 00000000..ab370ffe --- /dev/null +++ b/m4/inttypes.m4 | |||
@@ -0,0 +1,27 @@ | |||
1 | # inttypes.m4 serial 1 (gettext-0.11.4) | ||
2 | dnl Copyright (C) 1997-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with | ||
12 | # <sys/types.h>. | ||
13 | |||
14 | AC_DEFUN([gt_HEADER_INTTYPES_H], | ||
15 | [ | ||
16 | AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h, | ||
17 | [ | ||
18 | AC_TRY_COMPILE( | ||
19 | [#include <sys/types.h> | ||
20 | #include <inttypes.h>], | ||
21 | [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no) | ||
22 | ]) | ||
23 | if test $gt_cv_header_inttypes_h = yes; then | ||
24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1, | ||
25 | [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.]) | ||
26 | fi | ||
27 | ]) | ||
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4 new file mode 100644 index 00000000..f342eba3 --- /dev/null +++ b/m4/inttypes_h.m4 | |||
@@ -0,0 +1,28 @@ | |||
1 | # inttypes_h.m4 serial 5 (gettext-0.12) | ||
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists, | ||
12 | # doesn't clash with <sys/types.h>, and declares uintmax_t. | ||
13 | |||
14 | AC_DEFUN([jm_AC_HEADER_INTTYPES_H], | ||
15 | [ | ||
16 | AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h, | ||
17 | [AC_TRY_COMPILE( | ||
18 | [#include <sys/types.h> | ||
19 | #include <inttypes.h>], | ||
20 | [uintmax_t i = (uintmax_t) -1;], | ||
21 | jm_ac_cv_header_inttypes_h=yes, | ||
22 | jm_ac_cv_header_inttypes_h=no)]) | ||
23 | if test $jm_ac_cv_header_inttypes_h = yes; then | ||
24 | AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1, | ||
25 | [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, | ||
26 | and declares uintmax_t. ]) | ||
27 | fi | ||
28 | ]) | ||
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4 new file mode 100644 index 00000000..ffd4008b --- /dev/null +++ b/m4/lcmessage.m4 | |||
@@ -0,0 +1,32 @@ | |||
1 | # lcmessage.m4 serial 3 (gettext-0.11.3) | ||
2 | dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
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. | ||
20 | |||
21 | # Check whether LC_MESSAGES is available in <locale.h>. | ||
22 | |||
23 | AC_DEFUN([AM_LC_MESSAGES], | ||
24 | [ | ||
25 | AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, | ||
26 | [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], | ||
27 | am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) | ||
28 | if test $am_cv_val_LC_MESSAGES = yes; then | ||
29 | AC_DEFINE(HAVE_LC_MESSAGES, 1, | ||
30 | [Define if your <locale.h> file defines LC_MESSAGES.]) | ||
31 | fi | ||
32 | ]) | ||
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4 new file mode 100644 index 00000000..38aeaec1 --- /dev/null +++ b/m4/lib-ld.m4 | |||
@@ -0,0 +1,112 @@ | |||
1 | # lib-ld.m4 serial 3 (gettext-0.13) | ||
2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl Subroutines of libtool.m4, | ||
10 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision | ||
11 | dnl with libtool.m4. | ||
12 | |||
13 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. | ||
14 | AC_DEFUN([AC_LIB_PROG_LD_GNU], | ||
15 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, | ||
16 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. | ||
17 | case `$LD -v 2>&1 </dev/null` in | ||
18 | *GNU* | *'with BFD'*) | ||
19 | acl_cv_prog_gnu_ld=yes ;; | ||
20 | *) | ||
21 | acl_cv_prog_gnu_ld=no ;; | ||
22 | esac]) | ||
23 | with_gnu_ld=$acl_cv_prog_gnu_ld | ||
24 | ]) | ||
25 | |||
26 | dnl From libtool-1.4. Sets the variable LD. | ||
27 | AC_DEFUN([AC_LIB_PROG_LD], | ||
28 | [AC_ARG_WITH(gnu-ld, | ||
29 | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | ||
30 | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | ||
31 | AC_REQUIRE([AC_PROG_CC])dnl | ||
32 | AC_REQUIRE([AC_CANONICAL_HOST])dnl | ||
33 | # Prepare PATH_SEPARATOR. | ||
34 | # The user is always right. | ||
35 | if test "${PATH_SEPARATOR+set}" != set; then | ||
36 | echo "#! /bin/sh" >conf$$.sh | ||
37 | echo "exit 0" >>conf$$.sh | ||
38 | chmod +x conf$$.sh | ||
39 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then | ||
40 | PATH_SEPARATOR=';' | ||
41 | else | ||
42 | PATH_SEPARATOR=: | ||
43 | fi | ||
44 | rm -f conf$$.sh | ||
45 | fi | ||
46 | ac_prog=ld | ||
47 | if test "$GCC" = yes; then | ||
48 | # Check if gcc -print-prog-name=ld gives a path. | ||
49 | AC_MSG_CHECKING([for ld used by GCC]) | ||
50 | case $host in | ||
51 | *-*-mingw*) | ||
52 | # gcc leaves a trailing carriage return which upsets mingw | ||
53 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; | ||
54 | *) | ||
55 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; | ||
56 | esac | ||
57 | case $ac_prog in | ||
58 | # Accept absolute paths. | ||
59 | [[\\/]* | [A-Za-z]:[\\/]*)] | ||
60 | [re_direlt='/[^/][^/]*/\.\./'] | ||
61 | # Canonicalize the path of ld | ||
62 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` | ||
63 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do | ||
64 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` | ||
65 | done | ||
66 | test -z "$LD" && LD="$ac_prog" | ||
67 | ;; | ||
68 | "") | ||
69 | # If it fails, then pretend we aren't using GCC. | ||
70 | ac_prog=ld | ||
71 | ;; | ||
72 | *) | ||
73 | # If it is relative, then search for the first ld in PATH. | ||
74 | with_gnu_ld=unknown | ||
75 | ;; | ||
76 | esac | ||
77 | elif test "$with_gnu_ld" = yes; then | ||
78 | AC_MSG_CHECKING([for GNU ld]) | ||
79 | else | ||
80 | AC_MSG_CHECKING([for non-GNU ld]) | ||
81 | fi | ||
82 | AC_CACHE_VAL(acl_cv_path_LD, | ||
83 | [if test -z "$LD"; then | ||
84 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" | ||
85 | for ac_dir in $PATH; do | ||
86 | test -z "$ac_dir" && ac_dir=. | ||
87 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then | ||
88 | acl_cv_path_LD="$ac_dir/$ac_prog" | ||
89 | # Check to see if the program is GNU ld. I'd rather use --version, | ||
90 | # but apparently some GNU ld's only accept -v. | ||
91 | # Break only if it was the GNU/non-GNU ld that we prefer. | ||
92 | case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in | ||
93 | *GNU* | *'with BFD'*) | ||
94 | test "$with_gnu_ld" != no && break ;; | ||
95 | *) | ||
96 | test "$with_gnu_ld" != yes && break ;; | ||
97 | esac | ||
98 | fi | ||
99 | done | ||
100 | IFS="$ac_save_ifs" | ||
101 | else | ||
102 | acl_cv_path_LD="$LD" # Let the user override the test with a path. | ||
103 | fi]) | ||
104 | LD="$acl_cv_path_LD" | ||
105 | if test -n "$LD"; then | ||
106 | AC_MSG_RESULT($LD) | ||
107 | else | ||
108 | AC_MSG_RESULT(no) | ||
109 | fi | ||
110 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | ||
111 | AC_LIB_PROG_LD_GNU | ||
112 | ]) | ||
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4 new file mode 100644 index 00000000..eeb200d2 --- /dev/null +++ b/m4/lib-link.m4 | |||
@@ -0,0 +1,551 @@ | |||
1 | # lib-link.m4 serial 4 (gettext-0.12) | ||
2 | dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and | ||
12 | dnl the libraries corresponding to explicit and implicit dependencies. | ||
13 | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and | ||
14 | dnl augments the CPPFLAGS variable. | ||
15 | AC_DEFUN([AC_LIB_LINKFLAGS], | ||
16 | [ | ||
17 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | ||
18 | AC_REQUIRE([AC_LIB_RPATH]) | ||
19 | define([Name],[translit([$1],[./-], [___])]) | ||
20 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | ||
21 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | ||
22 | AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ | ||
23 | AC_LIB_LINKFLAGS_BODY([$1], [$2]) | ||
24 | ac_cv_lib[]Name[]_libs="$LIB[]NAME" | ||
25 | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" | ||
26 | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" | ||
27 | ]) | ||
28 | LIB[]NAME="$ac_cv_lib[]Name[]_libs" | ||
29 | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" | ||
30 | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" | ||
31 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | ||
32 | AC_SUBST([LIB]NAME) | ||
33 | AC_SUBST([LTLIB]NAME) | ||
34 | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the | ||
35 | dnl results of this search when this library appears as a dependency. | ||
36 | HAVE_LIB[]NAME=yes | ||
37 | undefine([Name]) | ||
38 | undefine([NAME]) | ||
39 | ]) | ||
40 | |||
41 | dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) | ||
42 | dnl searches for libname and the libraries corresponding to explicit and | ||
43 | dnl implicit dependencies, together with the specified include files and | ||
44 | dnl the ability to compile and link the specified testcode. If found, it | ||
45 | dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and | ||
46 | dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and | ||
47 | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs | ||
48 | dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. | ||
49 | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], | ||
50 | [ | ||
51 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | ||
52 | AC_REQUIRE([AC_LIB_RPATH]) | ||
53 | define([Name],[translit([$1],[./-], [___])]) | ||
54 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | ||
55 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | ||
56 | |||
57 | dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME | ||
58 | dnl accordingly. | ||
59 | AC_LIB_LINKFLAGS_BODY([$1], [$2]) | ||
60 | |||
61 | dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, | ||
62 | dnl because if the user has installed lib[]Name and not disabled its use | ||
63 | dnl via --without-lib[]Name-prefix, he wants to use it. | ||
64 | ac_save_CPPFLAGS="$CPPFLAGS" | ||
65 | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) | ||
66 | |||
67 | AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ | ||
68 | ac_save_LIBS="$LIBS" | ||
69 | LIBS="$LIBS $LIB[]NAME" | ||
70 | AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) | ||
71 | LIBS="$ac_save_LIBS" | ||
72 | ]) | ||
73 | if test "$ac_cv_lib[]Name" = yes; then | ||
74 | HAVE_LIB[]NAME=yes | ||
75 | AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) | ||
76 | AC_MSG_CHECKING([how to link with lib[]$1]) | ||
77 | AC_MSG_RESULT([$LIB[]NAME]) | ||
78 | else | ||
79 | HAVE_LIB[]NAME=no | ||
80 | dnl If $LIB[]NAME didn't lead to a usable library, we don't need | ||
81 | dnl $INC[]NAME either. | ||
82 | CPPFLAGS="$ac_save_CPPFLAGS" | ||
83 | LIB[]NAME= | ||
84 | LTLIB[]NAME= | ||
85 | fi | ||
86 | AC_SUBST([HAVE_LIB]NAME) | ||
87 | AC_SUBST([LIB]NAME) | ||
88 | AC_SUBST([LTLIB]NAME) | ||
89 | undefine([Name]) | ||
90 | undefine([NAME]) | ||
91 | ]) | ||
92 | |||
93 | dnl Determine the platform dependent parameters needed to use rpath: | ||
94 | dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, | ||
95 | dnl hardcode_direct, hardcode_minus_L. | ||
96 | AC_DEFUN([AC_LIB_RPATH], | ||
97 | [ | ||
98 | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS | ||
99 | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld | ||
100 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host | ||
101 | AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir | ||
102 | AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ | ||
103 | CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ | ||
104 | ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh | ||
105 | . ./conftest.sh | ||
106 | rm -f ./conftest.sh | ||
107 | acl_cv_rpath=done | ||
108 | ]) | ||
109 | wl="$acl_cv_wl" | ||
110 | libext="$acl_cv_libext" | ||
111 | shlibext="$acl_cv_shlibext" | ||
112 | hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" | ||
113 | hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" | ||
114 | hardcode_direct="$acl_cv_hardcode_direct" | ||
115 | hardcode_minus_L="$acl_cv_hardcode_minus_L" | ||
116 | dnl Determine whether the user wants rpath handling at all. | ||
117 | AC_ARG_ENABLE(rpath, | ||
118 | [ --disable-rpath do not hardcode runtime library paths], | ||
119 | :, enable_rpath=yes) | ||
120 | ]) | ||
121 | |||
122 | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and | ||
123 | dnl the libraries corresponding to explicit and implicit dependencies. | ||
124 | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. | ||
125 | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], | ||
126 | [ | ||
127 | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], | ||
128 | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) | ||
129 | dnl By default, look in $includedir and $libdir. | ||
130 | use_additional=yes | ||
131 | AC_LIB_WITH_FINAL_PREFIX([ | ||
132 | eval additional_includedir=\"$includedir\" | ||
133 | eval additional_libdir=\"$libdir\" | ||
134 | ]) | ||
135 | AC_LIB_ARG_WITH([lib$1-prefix], | ||
136 | [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib | ||
137 | --without-lib$1-prefix don't search for lib$1 in includedir and libdir], | ||
138 | [ | ||
139 | if test "X$withval" = "Xno"; then | ||
140 | use_additional=no | ||
141 | else | ||
142 | if test "X$withval" = "X"; then | ||
143 | AC_LIB_WITH_FINAL_PREFIX([ | ||
144 | eval additional_includedir=\"$includedir\" | ||
145 | eval additional_libdir=\"$libdir\" | ||
146 | ]) | ||
147 | else | ||
148 | additional_includedir="$withval/include" | ||
149 | additional_libdir="$withval/lib" | ||
150 | fi | ||
151 | fi | ||
152 | ]) | ||
153 | dnl Search the library and its dependencies in $additional_libdir and | ||
154 | dnl $LDFLAGS. Using breadth-first-seach. | ||
155 | LIB[]NAME= | ||
156 | LTLIB[]NAME= | ||
157 | INC[]NAME= | ||
158 | rpathdirs= | ||
159 | ltrpathdirs= | ||
160 | names_already_handled= | ||
161 | names_next_round='$1 $2' | ||
162 | while test -n "$names_next_round"; do | ||
163 | names_this_round="$names_next_round" | ||
164 | names_next_round= | ||
165 | for name in $names_this_round; do | ||
166 | already_handled= | ||
167 | for n in $names_already_handled; do | ||
168 | if test "$n" = "$name"; then | ||
169 | already_handled=yes | ||
170 | break | ||
171 | fi | ||
172 | done | ||
173 | if test -z "$already_handled"; then | ||
174 | names_already_handled="$names_already_handled $name" | ||
175 | dnl See if it was already located by an earlier AC_LIB_LINKFLAGS | ||
176 | dnl or AC_LIB_HAVE_LINKFLAGS call. | ||
177 | uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` | ||
178 | eval value=\"\$HAVE_LIB$uppername\" | ||
179 | if test -n "$value"; then | ||
180 | if test "$value" = yes; then | ||
181 | eval value=\"\$LIB$uppername\" | ||
182 | test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" | ||
183 | eval value=\"\$LTLIB$uppername\" | ||
184 | test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" | ||
185 | else | ||
186 | dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined | ||
187 | dnl that this library doesn't exist. So just drop it. | ||
188 | : | ||
189 | fi | ||
190 | else | ||
191 | dnl Search the library lib$name in $additional_libdir and $LDFLAGS | ||
192 | dnl and the already constructed $LIBNAME/$LTLIBNAME. | ||
193 | found_dir= | ||
194 | found_la= | ||
195 | found_so= | ||
196 | found_a= | ||
197 | if test $use_additional = yes; then | ||
198 | if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then | ||
199 | found_dir="$additional_libdir" | ||
200 | found_so="$additional_libdir/lib$name.$shlibext" | ||
201 | if test -f "$additional_libdir/lib$name.la"; then | ||
202 | found_la="$additional_libdir/lib$name.la" | ||
203 | fi | ||
204 | else | ||
205 | if test -f "$additional_libdir/lib$name.$libext"; then | ||
206 | found_dir="$additional_libdir" | ||
207 | found_a="$additional_libdir/lib$name.$libext" | ||
208 | if test -f "$additional_libdir/lib$name.la"; then | ||
209 | found_la="$additional_libdir/lib$name.la" | ||
210 | fi | ||
211 | fi | ||
212 | fi | ||
213 | fi | ||
214 | if test "X$found_dir" = "X"; then | ||
215 | for x in $LDFLAGS $LTLIB[]NAME; do | ||
216 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
217 | case "$x" in | ||
218 | -L*) | ||
219 | dir=`echo "X$x" | sed -e 's/^X-L//'` | ||
220 | if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then | ||
221 | found_dir="$dir" | ||
222 | found_so="$dir/lib$name.$shlibext" | ||
223 | if test -f "$dir/lib$name.la"; then | ||
224 | found_la="$dir/lib$name.la" | ||
225 | fi | ||
226 | else | ||
227 | if test -f "$dir/lib$name.$libext"; then | ||
228 | found_dir="$dir" | ||
229 | found_a="$dir/lib$name.$libext" | ||
230 | if test -f "$dir/lib$name.la"; then | ||
231 | found_la="$dir/lib$name.la" | ||
232 | fi | ||
233 | fi | ||
234 | fi | ||
235 | ;; | ||
236 | esac | ||
237 | if test "X$found_dir" != "X"; then | ||
238 | break | ||
239 | fi | ||
240 | done | ||
241 | fi | ||
242 | if test "X$found_dir" != "X"; then | ||
243 | dnl Found the library. | ||
244 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" | ||
245 | if test "X$found_so" != "X"; then | ||
246 | dnl Linking with a shared library. We attempt to hardcode its | ||
247 | dnl directory into the executable's runpath, unless it's the | ||
248 | dnl standard /usr/lib. | ||
249 | if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then | ||
250 | dnl No hardcoding is needed. | ||
251 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | ||
252 | else | ||
253 | dnl Use an explicit option to hardcode DIR into the resulting | ||
254 | dnl binary. | ||
255 | dnl Potentially add DIR to ltrpathdirs. | ||
256 | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. | ||
257 | haveit= | ||
258 | for x in $ltrpathdirs; do | ||
259 | if test "X$x" = "X$found_dir"; then | ||
260 | haveit=yes | ||
261 | break | ||
262 | fi | ||
263 | done | ||
264 | if test -z "$haveit"; then | ||
265 | ltrpathdirs="$ltrpathdirs $found_dir" | ||
266 | fi | ||
267 | dnl The hardcoding into $LIBNAME is system dependent. | ||
268 | if test "$hardcode_direct" = yes; then | ||
269 | dnl Using DIR/libNAME.so during linking hardcodes DIR into the | ||
270 | dnl resulting binary. | ||
271 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | ||
272 | else | ||
273 | if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then | ||
274 | dnl Use an explicit option to hardcode DIR into the resulting | ||
275 | dnl binary. | ||
276 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | ||
277 | dnl Potentially add DIR to rpathdirs. | ||
278 | dnl The rpathdirs will be appended to $LIBNAME at the end. | ||
279 | haveit= | ||
280 | for x in $rpathdirs; do | ||
281 | if test "X$x" = "X$found_dir"; then | ||
282 | haveit=yes | ||
283 | break | ||
284 | fi | ||
285 | done | ||
286 | if test -z "$haveit"; then | ||
287 | rpathdirs="$rpathdirs $found_dir" | ||
288 | fi | ||
289 | else | ||
290 | dnl Rely on "-L$found_dir". | ||
291 | dnl But don't add it if it's already contained in the LDFLAGS | ||
292 | dnl or the already constructed $LIBNAME | ||
293 | haveit= | ||
294 | for x in $LDFLAGS $LIB[]NAME; do | ||
295 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
296 | if test "X$x" = "X-L$found_dir"; then | ||
297 | haveit=yes | ||
298 | break | ||
299 | fi | ||
300 | done | ||
301 | if test -z "$haveit"; then | ||
302 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" | ||
303 | fi | ||
304 | if test "$hardcode_minus_L" != no; then | ||
305 | dnl FIXME: Not sure whether we should use | ||
306 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" | ||
307 | dnl here. | ||
308 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" | ||
309 | else | ||
310 | dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH | ||
311 | dnl here, because this doesn't fit in flags passed to the | ||
312 | dnl compiler. So give up. No hardcoding. This affects only | ||
313 | dnl very old systems. | ||
314 | dnl FIXME: Not sure whether we should use | ||
315 | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" | ||
316 | dnl here. | ||
317 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | ||
318 | fi | ||
319 | fi | ||
320 | fi | ||
321 | fi | ||
322 | else | ||
323 | if test "X$found_a" != "X"; then | ||
324 | dnl Linking with a static library. | ||
325 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" | ||
326 | else | ||
327 | dnl We shouldn't come here, but anyway it's good to have a | ||
328 | dnl fallback. | ||
329 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" | ||
330 | fi | ||
331 | fi | ||
332 | dnl Assume the include files are nearby. | ||
333 | additional_includedir= | ||
334 | case "$found_dir" in | ||
335 | */lib | */lib/) | ||
336 | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` | ||
337 | additional_includedir="$basedir/include" | ||
338 | ;; | ||
339 | esac | ||
340 | if test "X$additional_includedir" != "X"; then | ||
341 | dnl Potentially add $additional_includedir to $INCNAME. | ||
342 | dnl But don't add it | ||
343 | dnl 1. if it's the standard /usr/include, | ||
344 | dnl 2. if it's /usr/local/include and we are using GCC on Linux, | ||
345 | dnl 3. if it's already present in $CPPFLAGS or the already | ||
346 | dnl constructed $INCNAME, | ||
347 | dnl 4. if it doesn't exist as a directory. | ||
348 | if test "X$additional_includedir" != "X/usr/include"; then | ||
349 | haveit= | ||
350 | if test "X$additional_includedir" = "X/usr/local/include"; then | ||
351 | if test -n "$GCC"; then | ||
352 | case $host_os in | ||
353 | linux*) haveit=yes;; | ||
354 | esac | ||
355 | fi | ||
356 | fi | ||
357 | if test -z "$haveit"; then | ||
358 | for x in $CPPFLAGS $INC[]NAME; do | ||
359 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
360 | if test "X$x" = "X-I$additional_includedir"; then | ||
361 | haveit=yes | ||
362 | break | ||
363 | fi | ||
364 | done | ||
365 | if test -z "$haveit"; then | ||
366 | if test -d "$additional_includedir"; then | ||
367 | dnl Really add $additional_includedir to $INCNAME. | ||
368 | INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" | ||
369 | fi | ||
370 | fi | ||
371 | fi | ||
372 | fi | ||
373 | fi | ||
374 | dnl Look for dependencies. | ||
375 | if test -n "$found_la"; then | ||
376 | dnl Read the .la file. It defines the variables | ||
377 | dnl dlname, library_names, old_library, dependency_libs, current, | ||
378 | dnl age, revision, installed, dlopen, dlpreopen, libdir. | ||
379 | save_libdir="$libdir" | ||
380 | case "$found_la" in | ||
381 | */* | *\\*) . "$found_la" ;; | ||
382 | *) . "./$found_la" ;; | ||
383 | esac | ||
384 | libdir="$save_libdir" | ||
385 | dnl We use only dependency_libs. | ||
386 | for dep in $dependency_libs; do | ||
387 | case "$dep" in | ||
388 | -L*) | ||
389 | additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` | ||
390 | dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. | ||
391 | dnl But don't add it | ||
392 | dnl 1. if it's the standard /usr/lib, | ||
393 | dnl 2. if it's /usr/local/lib and we are using GCC on Linux, | ||
394 | dnl 3. if it's already present in $LDFLAGS or the already | ||
395 | dnl constructed $LIBNAME, | ||
396 | dnl 4. if it doesn't exist as a directory. | ||
397 | if test "X$additional_libdir" != "X/usr/lib"; then | ||
398 | haveit= | ||
399 | if test "X$additional_libdir" = "X/usr/local/lib"; then | ||
400 | if test -n "$GCC"; then | ||
401 | case $host_os in | ||
402 | linux*) haveit=yes;; | ||
403 | esac | ||
404 | fi | ||
405 | fi | ||
406 | if test -z "$haveit"; then | ||
407 | haveit= | ||
408 | for x in $LDFLAGS $LIB[]NAME; do | ||
409 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
410 | if test "X$x" = "X-L$additional_libdir"; then | ||
411 | haveit=yes | ||
412 | break | ||
413 | fi | ||
414 | done | ||
415 | if test -z "$haveit"; then | ||
416 | if test -d "$additional_libdir"; then | ||
417 | dnl Really add $additional_libdir to $LIBNAME. | ||
418 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" | ||
419 | fi | ||
420 | fi | ||
421 | haveit= | ||
422 | for x in $LDFLAGS $LTLIB[]NAME; do | ||
423 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
424 | if test "X$x" = "X-L$additional_libdir"; then | ||
425 | haveit=yes | ||
426 | break | ||
427 | fi | ||
428 | done | ||
429 | if test -z "$haveit"; then | ||
430 | if test -d "$additional_libdir"; then | ||
431 | dnl Really add $additional_libdir to $LTLIBNAME. | ||
432 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" | ||
433 | fi | ||
434 | fi | ||
435 | fi | ||
436 | fi | ||
437 | ;; | ||
438 | -R*) | ||
439 | dir=`echo "X$dep" | sed -e 's/^X-R//'` | ||
440 | if test "$enable_rpath" != no; then | ||
441 | dnl Potentially add DIR to rpathdirs. | ||
442 | dnl The rpathdirs will be appended to $LIBNAME at the end. | ||
443 | haveit= | ||
444 | for x in $rpathdirs; do | ||
445 | if test "X$x" = "X$dir"; then | ||
446 | haveit=yes | ||
447 | break | ||
448 | fi | ||
449 | done | ||
450 | if test -z "$haveit"; then | ||
451 | rpathdirs="$rpathdirs $dir" | ||
452 | fi | ||
453 | dnl Potentially add DIR to ltrpathdirs. | ||
454 | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. | ||
455 | haveit= | ||
456 | for x in $ltrpathdirs; do | ||
457 | if test "X$x" = "X$dir"; then | ||
458 | haveit=yes | ||
459 | break | ||
460 | fi | ||
461 | done | ||
462 | if test -z "$haveit"; then | ||
463 | ltrpathdirs="$ltrpathdirs $dir" | ||
464 | fi | ||
465 | fi | ||
466 | ;; | ||
467 | -l*) | ||
468 | dnl Handle this in the next round. | ||
469 | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` | ||
470 | ;; | ||
471 | *.la) | ||
472 | dnl Handle this in the next round. Throw away the .la's | ||
473 | dnl directory; it is already contained in a preceding -L | ||
474 | dnl option. | ||
475 | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` | ||
476 | ;; | ||
477 | *) | ||
478 | dnl Most likely an immediate library name. | ||
479 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" | ||
480 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" | ||
481 | ;; | ||
482 | esac | ||
483 | done | ||
484 | fi | ||
485 | else | ||
486 | dnl Didn't find the library; assume it is in the system directories | ||
487 | dnl known to the linker and runtime loader. (All the system | ||
488 | dnl directories known to the linker should also be known to the | ||
489 | dnl runtime loader, otherwise the system is severely misconfigured.) | ||
490 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" | ||
491 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" | ||
492 | fi | ||
493 | fi | ||
494 | fi | ||
495 | done | ||
496 | done | ||
497 | if test "X$rpathdirs" != "X"; then | ||
498 | if test -n "$hardcode_libdir_separator"; then | ||
499 | dnl Weird platform: only the last -rpath option counts, the user must | ||
500 | dnl pass all path elements in one option. We can arrange that for a | ||
501 | dnl single library, but not when more than one $LIBNAMEs are used. | ||
502 | alldirs= | ||
503 | for found_dir in $rpathdirs; do | ||
504 | alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" | ||
505 | done | ||
506 | dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. | ||
507 | acl_save_libdir="$libdir" | ||
508 | libdir="$alldirs" | ||
509 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
510 | libdir="$acl_save_libdir" | ||
511 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | ||
512 | else | ||
513 | dnl The -rpath options are cumulative. | ||
514 | for found_dir in $rpathdirs; do | ||
515 | acl_save_libdir="$libdir" | ||
516 | libdir="$found_dir" | ||
517 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
518 | libdir="$acl_save_libdir" | ||
519 | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" | ||
520 | done | ||
521 | fi | ||
522 | fi | ||
523 | if test "X$ltrpathdirs" != "X"; then | ||
524 | dnl When using libtool, the option that works for both libraries and | ||
525 | dnl executables is -R. The -R options are cumulative. | ||
526 | for found_dir in $ltrpathdirs; do | ||
527 | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" | ||
528 | done | ||
529 | fi | ||
530 | ]) | ||
531 | |||
532 | dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, | ||
533 | dnl unless already present in VAR. | ||
534 | dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes | ||
535 | dnl contains two or three consecutive elements that belong together. | ||
536 | AC_DEFUN([AC_LIB_APPENDTOVAR], | ||
537 | [ | ||
538 | for element in [$2]; do | ||
539 | haveit= | ||
540 | for x in $[$1]; do | ||
541 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
542 | if test "X$x" = "X$element"; then | ||
543 | haveit=yes | ||
544 | break | ||
545 | fi | ||
546 | done | ||
547 | if test -z "$haveit"; then | ||
548 | [$1]="${[$1]}${[$1]:+ }$element" | ||
549 | fi | ||
550 | done | ||
551 | ]) | ||
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4 new file mode 100644 index 00000000..8aff5a9d --- /dev/null +++ b/m4/lib-prefix.m4 | |||
@@ -0,0 +1,155 @@ | |||
1 | # lib-prefix.m4 serial 3 (gettext-0.13) | ||
2 | dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and | ||
12 | dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't | ||
13 | dnl require excessive bracketing. | ||
14 | ifdef([AC_HELP_STRING], | ||
15 | [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], | ||
16 | [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) | ||
17 | |||
18 | dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed | ||
19 | dnl to access previously installed libraries. The basic assumption is that | ||
20 | dnl a user will want packages to use other packages he previously installed | ||
21 | dnl with the same --prefix option. | ||
22 | dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate | ||
23 | dnl libraries, but is otherwise very convenient. | ||
24 | AC_DEFUN([AC_LIB_PREFIX], | ||
25 | [ | ||
26 | AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) | ||
27 | AC_REQUIRE([AC_PROG_CC]) | ||
28 | AC_REQUIRE([AC_CANONICAL_HOST]) | ||
29 | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) | ||
30 | dnl By default, look in $includedir and $libdir. | ||
31 | use_additional=yes | ||
32 | AC_LIB_WITH_FINAL_PREFIX([ | ||
33 | eval additional_includedir=\"$includedir\" | ||
34 | eval additional_libdir=\"$libdir\" | ||
35 | ]) | ||
36 | AC_LIB_ARG_WITH([lib-prefix], | ||
37 | [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib | ||
38 | --without-lib-prefix don't search for libraries in includedir and libdir], | ||
39 | [ | ||
40 | if test "X$withval" = "Xno"; then | ||
41 | use_additional=no | ||
42 | else | ||
43 | if test "X$withval" = "X"; then | ||
44 | AC_LIB_WITH_FINAL_PREFIX([ | ||
45 | eval additional_includedir=\"$includedir\" | ||
46 | eval additional_libdir=\"$libdir\" | ||
47 | ]) | ||
48 | else | ||
49 | additional_includedir="$withval/include" | ||
50 | additional_libdir="$withval/lib" | ||
51 | fi | ||
52 | fi | ||
53 | ]) | ||
54 | if test $use_additional = yes; then | ||
55 | dnl Potentially add $additional_includedir to $CPPFLAGS. | ||
56 | dnl But don't add it | ||
57 | dnl 1. if it's the standard /usr/include, | ||
58 | dnl 2. if it's already present in $CPPFLAGS, | ||
59 | dnl 3. if it's /usr/local/include and we are using GCC on Linux, | ||
60 | dnl 4. if it doesn't exist as a directory. | ||
61 | if test "X$additional_includedir" != "X/usr/include"; then | ||
62 | haveit= | ||
63 | for x in $CPPFLAGS; do | ||
64 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
65 | if test "X$x" = "X-I$additional_includedir"; then | ||
66 | haveit=yes | ||
67 | break | ||
68 | fi | ||
69 | done | ||
70 | if test -z "$haveit"; then | ||
71 | if test "X$additional_includedir" = "X/usr/local/include"; then | ||
72 | if test -n "$GCC"; then | ||
73 | case $host_os in | ||
74 | linux*) haveit=yes;; | ||
75 | esac | ||
76 | fi | ||
77 | fi | ||
78 | if test -z "$haveit"; then | ||
79 | if test -d "$additional_includedir"; then | ||
80 | dnl Really add $additional_includedir to $CPPFLAGS. | ||
81 | CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" | ||
82 | fi | ||
83 | fi | ||
84 | fi | ||
85 | fi | ||
86 | dnl Potentially add $additional_libdir to $LDFLAGS. | ||
87 | dnl But don't add it | ||
88 | dnl 1. if it's the standard /usr/lib, | ||
89 | dnl 2. if it's already present in $LDFLAGS, | ||
90 | dnl 3. if it's /usr/local/lib and we are using GCC on Linux, | ||
91 | dnl 4. if it doesn't exist as a directory. | ||
92 | if test "X$additional_libdir" != "X/usr/lib"; then | ||
93 | haveit= | ||
94 | for x in $LDFLAGS; do | ||
95 | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) | ||
96 | if test "X$x" = "X-L$additional_libdir"; then | ||
97 | haveit=yes | ||
98 | break | ||
99 | fi | ||
100 | done | ||
101 | if test -z "$haveit"; then | ||
102 | if test "X$additional_libdir" = "X/usr/local/lib"; then | ||
103 | if test -n "$GCC"; then | ||
104 | case $host_os in | ||
105 | linux*) haveit=yes;; | ||
106 | esac | ||
107 | fi | ||
108 | fi | ||
109 | if test -z "$haveit"; then | ||
110 | if test -d "$additional_libdir"; then | ||
111 | dnl Really add $additional_libdir to $LDFLAGS. | ||
112 | LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" | ||
113 | fi | ||
114 | fi | ||
115 | fi | ||
116 | fi | ||
117 | fi | ||
118 | ]) | ||
119 | |||
120 | dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, | ||
121 | dnl acl_final_exec_prefix, containing the values to which $prefix and | ||
122 | dnl $exec_prefix will expand at the end of the configure script. | ||
123 | AC_DEFUN([AC_LIB_PREPARE_PREFIX], | ||
124 | [ | ||
125 | dnl Unfortunately, prefix and exec_prefix get only finally determined | ||
126 | dnl at the end of configure. | ||
127 | if test "X$prefix" = "XNONE"; then | ||
128 | acl_final_prefix="$ac_default_prefix" | ||
129 | else | ||
130 | acl_final_prefix="$prefix" | ||
131 | fi | ||
132 | if test "X$exec_prefix" = "XNONE"; then | ||
133 | acl_final_exec_prefix='${prefix}' | ||
134 | else | ||
135 | acl_final_exec_prefix="$exec_prefix" | ||
136 | fi | ||
137 | acl_save_prefix="$prefix" | ||
138 | prefix="$acl_final_prefix" | ||
139 | eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" | ||
140 | prefix="$acl_save_prefix" | ||
141 | ]) | ||
142 | |||
143 | dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the | ||
144 | dnl variables prefix and exec_prefix bound to the values they will have | ||
145 | dnl at the end of the configure script. | ||
146 | AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], | ||
147 | [ | ||
148 | acl_save_prefix="$prefix" | ||
149 | prefix="$acl_final_prefix" | ||
150 | acl_save_exec_prefix="$exec_prefix" | ||
151 | exec_prefix="$acl_final_exec_prefix" | ||
152 | $1 | ||
153 | exec_prefix="$acl_save_exec_prefix" | ||
154 | prefix="$acl_save_prefix" | ||
155 | ]) | ||
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4 new file mode 100644 index 00000000..1333d2f5 --- /dev/null +++ b/m4/longdouble.m4 | |||
@@ -0,0 +1,30 @@ | |||
1 | # longdouble.m4 serial 1 (gettext-0.12) | ||
2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | dnl Test whether the compiler supports the 'long double' type. | ||
11 | dnl Prerequisite: AC_PROG_CC | ||
12 | |||
13 | AC_DEFUN([gt_TYPE_LONGDOUBLE], | ||
14 | [ | ||
15 | AC_CACHE_CHECK([for long double], gt_cv_c_long_double, | ||
16 | [if test "$GCC" = yes; then | ||
17 | gt_cv_c_long_double=yes | ||
18 | else | ||
19 | AC_TRY_COMPILE([ | ||
20 | /* The Stardent Vistra knows sizeof(long double), but does not support it. */ | ||
21 | long double foo = 0.0; | ||
22 | /* On Ultrix 4.3 cc, long double is 4 and double is 8. */ | ||
23 | int array [2*(sizeof(long double) >= sizeof(double)) - 1]; | ||
24 | ], , | ||
25 | gt_cv_c_long_double=yes, gt_cv_c_long_double=no) | ||
26 | fi]) | ||
27 | if test $gt_cv_c_long_double = yes; then | ||
28 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.]) | ||
29 | fi | ||
30 | ]) | ||
diff --git a/m4/longlong.m4 b/m4/longlong.m4 new file mode 100644 index 00000000..d7d7350b --- /dev/null +++ b/m4/longlong.m4 | |||
@@ -0,0 +1,25 @@ | |||
1 | # longlong.m4 serial 4 | ||
2 | dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | # Define HAVE_LONG_LONG if 'long long' works. | ||
12 | |||
13 | AC_DEFUN([jm_AC_TYPE_LONG_LONG], | ||
14 | [ | ||
15 | AC_CACHE_CHECK([for long long], ac_cv_type_long_long, | ||
16 | [AC_TRY_LINK([long long ll = 1LL; int i = 63;], | ||
17 | [long long llmax = (long long) -1; | ||
18 | return ll << i | ll >> i | llmax / ll | llmax % ll;], | ||
19 | ac_cv_type_long_long=yes, | ||
20 | ac_cv_type_long_long=no)]) | ||
21 | if test $ac_cv_type_long_long = yes; then | ||
22 | AC_DEFINE(HAVE_LONG_LONG, 1, | ||
23 | [Define if you have the 'long long' type.]) | ||
24 | fi | ||
25 | ]) | ||
diff --git a/m4/nls.m4 b/m4/nls.m4 new file mode 100644 index 00000000..36bc4931 --- /dev/null +++ b/m4/nls.m4 | |||
@@ -0,0 +1,49 @@ | |||
1 | # nls.m4 serial 1 (gettext-0.12) | ||
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
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. | ||
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | ||
21 | |||
22 | AC_DEFUN([AM_NLS], | ||
23 | [ | ||
24 | AC_MSG_CHECKING([whether NLS is requested]) | ||
25 | dnl Default is enabled NLS | ||
26 | AC_ARG_ENABLE(nls, | ||
27 | [ --disable-nls do not use Native Language Support], | ||
28 | USE_NLS=$enableval, USE_NLS=yes) | ||
29 | AC_MSG_RESULT($USE_NLS) | ||
30 | AC_SUBST(USE_NLS) | ||
31 | ]) | ||
32 | |||
33 | AC_DEFUN([AM_MKINSTALLDIRS], | ||
34 | [ | ||
35 | dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly | ||
36 | dnl find the mkinstalldirs script in another subdir but $(top_srcdir). | ||
37 | dnl Try to locate it. | ||
38 | MKINSTALLDIRS= | ||
39 | if test -n "$ac_aux_dir"; then | ||
40 | case "$ac_aux_dir" in | ||
41 | /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;; | ||
42 | *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;; | ||
43 | esac | ||
44 | fi | ||
45 | if test -z "$MKINSTALLDIRS"; then | ||
46 | MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" | ||
47 | fi | ||
48 | AC_SUBST(MKINSTALLDIRS) | ||
49 | ]) | ||
diff --git a/m4/po.m4 b/m4/po.m4 new file mode 100644 index 00000000..e1619988 --- /dev/null +++ b/m4/po.m4 | |||
@@ -0,0 +1,426 @@ | |||
1 | # po.m4 serial 3 (gettext-0.14) | ||
2 | dnl Copyright (C) 1995-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
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. | ||
20 | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003. | ||
21 | |||
22 | dnl Checks for all prerequisites of the po subdirectory. | ||
23 | AC_DEFUN([AM_PO_SUBDIRS], | ||
24 | [ | ||
25 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl | ||
26 | AC_REQUIRE([AC_PROG_INSTALL])dnl | ||
27 | AC_REQUIRE([AM_MKINSTALLDIRS])dnl | ||
28 | AC_REQUIRE([AM_NLS])dnl | ||
29 | |||
30 | dnl Perform the following tests also if --disable-nls has been given, | ||
31 | dnl because they are needed for "make dist" to work. | ||
32 | |||
33 | dnl Search for GNU msgfmt in the PATH. | ||
34 | dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. | ||
35 | dnl The second test excludes FreeBSD msgfmt. | ||
36 | AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, | ||
37 | [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && | ||
38 | (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], | ||
39 | :) | ||
40 | AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) | ||
41 | |||
42 | dnl Search for GNU xgettext 0.12 or newer in the PATH. | ||
43 | dnl The first test excludes Solaris xgettext and early GNU xgettext versions. | ||
44 | dnl The second test excludes FreeBSD xgettext. | ||
45 | AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, | ||
46 | [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && | ||
47 | (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], | ||
48 | :) | ||
49 | dnl Remove leftover from FreeBSD xgettext call. | ||
50 | rm -f messages.po | ||
51 | |||
52 | dnl Search for GNU msgmerge 0.11 or newer in the PATH. | ||
53 | AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, | ||
54 | [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) | ||
55 | |||
56 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. | ||
57 | dnl Test whether we really found GNU msgfmt. | ||
58 | if test "$GMSGFMT" != ":"; then | ||
59 | dnl If it is no GNU msgfmt we define it as : so that the | ||
60 | dnl Makefiles still can work. | ||
61 | if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && | ||
62 | (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then | ||
63 | : ; | ||
64 | else | ||
65 | GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` | ||
66 | AC_MSG_RESULT( | ||
67 | [found $GMSGFMT program is not GNU msgfmt; ignore it]) | ||
68 | GMSGFMT=":" | ||
69 | fi | ||
70 | fi | ||
71 | |||
72 | dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. | ||
73 | dnl Test whether we really found GNU xgettext. | ||
74 | if test "$XGETTEXT" != ":"; then | ||
75 | dnl If it is no GNU xgettext we define it as : so that the | ||
76 | dnl Makefiles still can work. | ||
77 | if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 && | ||
78 | (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then | ||
79 | : ; | ||
80 | else | ||
81 | AC_MSG_RESULT( | ||
82 | [found xgettext program is not GNU xgettext; ignore it]) | ||
83 | XGETTEXT=":" | ||
84 | fi | ||
85 | dnl Remove leftover from FreeBSD xgettext call. | ||
86 | rm -f messages.po | ||
87 | fi | ||
88 | |||
89 | AC_OUTPUT_COMMANDS([ | ||
90 | for ac_file in $CONFIG_FILES; do | ||
91 | # Support "outfile[:infile[:infile...]]" | ||
92 | case "$ac_file" in | ||
93 | *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; | ||
94 | esac | ||
95 | # PO directories have a Makefile.in generated from Makefile.in.in. | ||
96 | case "$ac_file" in */Makefile.in) | ||
97 | # Adjust a relative srcdir. | ||
98 | ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` | ||
99 | ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" | ||
100 | ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` | ||
101 | # In autoconf-2.13 it is called $ac_given_srcdir. | ||
102 | # In autoconf-2.50 it is called $srcdir. | ||
103 | test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" | ||
104 | case "$ac_given_srcdir" in | ||
105 | .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; | ||
106 | /*) top_srcdir="$ac_given_srcdir" ;; | ||
107 | *) top_srcdir="$ac_dots$ac_given_srcdir" ;; | ||
108 | esac | ||
109 | if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then | ||
110 | rm -f "$ac_dir/POTFILES" | ||
111 | test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" | ||
112 | cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" | ||
113 | POMAKEFILEDEPS="POTFILES.in" | ||
114 | # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend | ||
115 | # on $ac_dir but don't depend on user-specified configuration | ||
116 | # parameters. | ||
117 | if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then | ||
118 | # The LINGUAS file contains the set of available languages. | ||
119 | if test -n "$OBSOLETE_ALL_LINGUAS"; then | ||
120 | test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" | ||
121 | fi | ||
122 | ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` | ||
123 | # Hide the ALL_LINGUAS assigment from automake. | ||
124 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' | ||
125 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" | ||
126 | else | ||
127 | # The set of available languages was given in configure.in. | ||
128 | eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' | ||
129 | fi | ||
130 | # Compute POFILES | ||
131 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) | ||
132 | # Compute UPDATEPOFILES | ||
133 | # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) | ||
134 | # Compute DUMMYPOFILES | ||
135 | # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) | ||
136 | # Compute GMOFILES | ||
137 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) | ||
138 | case "$ac_given_srcdir" in | ||
139 | .) srcdirpre= ;; | ||
140 | *) srcdirpre='$(srcdir)/' ;; | ||
141 | esac | ||
142 | POFILES= | ||
143 | UPDATEPOFILES= | ||
144 | DUMMYPOFILES= | ||
145 | GMOFILES= | ||
146 | for lang in $ALL_LINGUAS; do | ||
147 | POFILES="$POFILES $srcdirpre$lang.po" | ||
148 | UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" | ||
149 | DUMMYPOFILES="$DUMMYPOFILES $lang.nop" | ||
150 | GMOFILES="$GMOFILES $srcdirpre$lang.gmo" | ||
151 | done | ||
152 | # CATALOGS depends on both $ac_dir and the user's LINGUAS | ||
153 | # environment variable. | ||
154 | INST_LINGUAS= | ||
155 | if test -n "$ALL_LINGUAS"; then | ||
156 | for presentlang in $ALL_LINGUAS; do | ||
157 | useit=no | ||
158 | if test "%UNSET%" != "$LINGUAS"; then | ||
159 | desiredlanguages="$LINGUAS" | ||
160 | else | ||
161 | desiredlanguages="$ALL_LINGUAS" | ||
162 | fi | ||
163 | for desiredlang in $desiredlanguages; do | ||
164 | # Use the presentlang catalog if desiredlang is | ||
165 | # a. equal to presentlang, or | ||
166 | # b. a variant of presentlang (because in this case, | ||
167 | # presentlang can be used as a fallback for messages | ||
168 | # which are not translated in the desiredlang catalog). | ||
169 | case "$desiredlang" in | ||
170 | "$presentlang"*) useit=yes;; | ||
171 | esac | ||
172 | done | ||
173 | if test $useit = yes; then | ||
174 | INST_LINGUAS="$INST_LINGUAS $presentlang" | ||
175 | fi | ||
176 | done | ||
177 | fi | ||
178 | CATALOGS= | ||
179 | if test -n "$INST_LINGUAS"; then | ||
180 | for lang in $INST_LINGUAS; do | ||
181 | CATALOGS="$CATALOGS $lang.gmo" | ||
182 | done | ||
183 | fi | ||
184 | test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" | ||
185 | sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" | ||
186 | for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do | ||
187 | if test -f "$f"; then | ||
188 | case "$f" in | ||
189 | *.orig | *.bak | *~) ;; | ||
190 | *) cat "$f" >> "$ac_dir/Makefile" ;; | ||
191 | esac | ||
192 | fi | ||
193 | done | ||
194 | fi | ||
195 | ;; | ||
196 | esac | ||
197 | done], | ||
198 | [# Capture the value of obsolete ALL_LINGUAS because we need it to compute | ||
199 | # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it | ||
200 | # from automake. | ||
201 | eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' | ||
202 | # Capture the value of LINGUAS because we need it to compute CATALOGS. | ||
203 | LINGUAS="${LINGUAS-%UNSET%}" | ||
204 | ]) | ||
205 | ]) | ||
206 | |||
207 | dnl Postprocesses a Makefile in a directory containing PO files. | ||
208 | AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], | ||
209 | [ | ||
210 | # When this code is run, in config.status, two variables have already been | ||
211 | # set: | ||
212 | # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, | ||
213 | # - LINGUAS is the value of the environment variable LINGUAS at configure | ||
214 | # time. | ||
215 | |||
216 | changequote(,)dnl | ||
217 | # Adjust a relative srcdir. | ||
218 | ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` | ||
219 | ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" | ||
220 | ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` | ||
221 | # In autoconf-2.13 it is called $ac_given_srcdir. | ||
222 | # In autoconf-2.50 it is called $srcdir. | ||
223 | test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" | ||
224 | case "$ac_given_srcdir" in | ||
225 | .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; | ||
226 | /*) top_srcdir="$ac_given_srcdir" ;; | ||
227 | *) top_srcdir="$ac_dots$ac_given_srcdir" ;; | ||
228 | esac | ||
229 | |||
230 | # Find a way to echo strings without interpreting backslash. | ||
231 | if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then | ||
232 | gt_echo='echo' | ||
233 | else | ||
234 | if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then | ||
235 | gt_echo='printf %s\n' | ||
236 | else | ||
237 | echo_func () { | ||
238 | cat <<EOT | ||
239 | $* | ||
240 | EOT | ||
241 | } | ||
242 | gt_echo='echo_func' | ||
243 | fi | ||
244 | fi | ||
245 | |||
246 | # A sed script that extracts the value of VARIABLE from a Makefile. | ||
247 | sed_x_variable=' | ||
248 | # Test if the hold space is empty. | ||
249 | x | ||
250 | s/P/P/ | ||
251 | x | ||
252 | ta | ||
253 | # Yes it was empty. Look if we have the expected variable definition. | ||
254 | /^[ ]*VARIABLE[ ]*=/{ | ||
255 | # Seen the first line of the variable definition. | ||
256 | s/^[ ]*VARIABLE[ ]*=// | ||
257 | ba | ||
258 | } | ||
259 | bd | ||
260 | :a | ||
261 | # Here we are processing a line from the variable definition. | ||
262 | # Remove comment, more precisely replace it with a space. | ||
263 | s/#.*$/ / | ||
264 | # See if the line ends in a backslash. | ||
265 | tb | ||
266 | :b | ||
267 | s/\\$// | ||
268 | # Print the line, without the trailing backslash. | ||
269 | p | ||
270 | tc | ||
271 | # There was no trailing backslash. The end of the variable definition is | ||
272 | # reached. Clear the hold space. | ||
273 | s/^.*$// | ||
274 | x | ||
275 | bd | ||
276 | :c | ||
277 | # A trailing backslash means that the variable definition continues in the | ||
278 | # next line. Put a nonempty string into the hold space to indicate this. | ||
279 | s/^.*$/P/ | ||
280 | x | ||
281 | :d | ||
282 | ' | ||
283 | changequote([,])dnl | ||
284 | |||
285 | # Set POTFILES to the value of the Makefile variable POTFILES. | ||
286 | sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`" | ||
287 | POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"` | ||
288 | # Compute POTFILES_DEPS as | ||
289 | # $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) | ||
290 | POTFILES_DEPS= | ||
291 | for file in $POTFILES; do | ||
292 | POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file" | ||
293 | done | ||
294 | POMAKEFILEDEPS="" | ||
295 | |||
296 | if test -n "$OBSOLETE_ALL_LINGUAS"; then | ||
297 | test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" | ||
298 | fi | ||
299 | if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then | ||
300 | # The LINGUAS file contains the set of available languages. | ||
301 | ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` | ||
302 | POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" | ||
303 | else | ||
304 | # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. | ||
305 | sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`" | ||
306 | ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` | ||
307 | fi | ||
308 | # Hide the ALL_LINGUAS assigment from automake. | ||
309 | eval 'ALL_LINGUAS''=$ALL_LINGUAS_' | ||
310 | # Compute POFILES | ||
311 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) | ||
312 | # Compute UPDATEPOFILES | ||
313 | # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) | ||
314 | # Compute DUMMYPOFILES | ||
315 | # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) | ||
316 | # Compute GMOFILES | ||
317 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) | ||
318 | # Compute PROPERTIESFILES | ||
319 | # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) | ||
320 | # Compute CLASSFILES | ||
321 | # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) | ||
322 | # Compute QMFILES | ||
323 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) | ||
324 | # Compute MSGFILES | ||
325 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) | ||
326 | # Compute RESOURCESDLLFILES | ||
327 | # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) | ||
328 | case "$ac_given_srcdir" in | ||
329 | .) srcdirpre= ;; | ||
330 | *) srcdirpre='$(srcdir)/' ;; | ||
331 | esac | ||
332 | POFILES= | ||
333 | UPDATEPOFILES= | ||
334 | DUMMYPOFILES= | ||
335 | GMOFILES= | ||
336 | PROPERTIESFILES= | ||
337 | CLASSFILES= | ||
338 | QMFILES= | ||
339 | MSGFILES= | ||
340 | RESOURCESDLLFILES= | ||
341 | for lang in $ALL_LINGUAS; do | ||
342 | POFILES="$POFILES $srcdirpre$lang.po" | ||
343 | UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" | ||
344 | DUMMYPOFILES="$DUMMYPOFILES $lang.nop" | ||
345 | GMOFILES="$GMOFILES $srcdirpre$lang.gmo" | ||
346 | PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" | ||
347 | CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" | ||
348 | QMFILES="$QMFILES $srcdirpre$lang.qm" | ||
349 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | ||
350 | MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" | ||
351 | frobbedlang=`echo $lang | sed -e 's/_/-/g'` | ||
352 | RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll" | ||
353 | done | ||
354 | # CATALOGS depends on both $ac_dir and the user's LINGUAS | ||
355 | # environment variable. | ||
356 | INST_LINGUAS= | ||
357 | if test -n "$ALL_LINGUAS"; then | ||
358 | for presentlang in $ALL_LINGUAS; do | ||
359 | useit=no | ||
360 | if test "%UNSET%" != "$LINGUAS"; then | ||
361 | desiredlanguages="$LINGUAS" | ||
362 | else | ||
363 | desiredlanguages="$ALL_LINGUAS" | ||
364 | fi | ||
365 | for desiredlang in $desiredlanguages; do | ||
366 | # Use the presentlang catalog if desiredlang is | ||
367 | # a. equal to presentlang, or | ||
368 | # b. a variant of presentlang (because in this case, | ||
369 | # presentlang can be used as a fallback for messages | ||
370 | # which are not translated in the desiredlang catalog). | ||
371 | case "$desiredlang" in | ||
372 | "$presentlang"*) useit=yes;; | ||
373 | esac | ||
374 | done | ||
375 | if test $useit = yes; then | ||
376 | INST_LINGUAS="$INST_LINGUAS $presentlang" | ||
377 | fi | ||
378 | done | ||
379 | fi | ||
380 | CATALOGS= | ||
381 | JAVACATALOGS= | ||
382 | QTCATALOGS= | ||
383 | TCLCATALOGS= | ||
384 | CSHARPCATALOGS= | ||
385 | if test -n "$INST_LINGUAS"; then | ||
386 | for lang in $INST_LINGUAS; do | ||
387 | CATALOGS="$CATALOGS $lang.gmo" | ||
388 | JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties" | ||
389 | QTCATALOGS="$QTCATALOGS $lang.qm" | ||
390 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | ||
391 | TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg" | ||
392 | frobbedlang=`echo $lang | sed -e 's/_/-/g'` | ||
393 | CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll" | ||
394 | done | ||
395 | fi | ||
396 | |||
397 | sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" | ||
398 | if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then | ||
399 | # Add dependencies that cannot be formulated as a simple suffix rule. | ||
400 | for lang in $ALL_LINGUAS; do | ||
401 | frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` | ||
402 | cat >> "$ac_file.tmp" <<EOF | ||
403 | $frobbedlang.msg: $lang.po | ||
404 | @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \ | ||
405 | \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } | ||
406 | EOF | ||
407 | done | ||
408 | fi | ||
409 | if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then | ||
410 | # Add dependencies that cannot be formulated as a simple suffix rule. | ||
411 | for lang in $ALL_LINGUAS; do | ||
412 | frobbedlang=`echo $lang | sed -e 's/_/-/g'` | ||
413 | cat >> "$ac_file.tmp" <<EOF | ||
414 | $frobbedlang/\$(DOMAIN).resources.dll: $lang.po | ||
415 | @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \ | ||
416 | \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; } | ||
417 | EOF | ||
418 | done | ||
419 | fi | ||
420 | if test -n "$POMAKEFILEDEPS"; then | ||
421 | cat >> "$ac_file.tmp" <<EOF | ||
422 | Makefile: $POMAKEFILEDEPS | ||
423 | EOF | ||
424 | fi | ||
425 | mv "$ac_file.tmp" "$ac_file" | ||
426 | ]) | ||
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4 new file mode 100644 index 00000000..186ba6a6 --- /dev/null +++ b/m4/printf-posix.m4 | |||
@@ -0,0 +1,46 @@ | |||
1 | # printf-posix.m4 serial 2 (gettext-0.13.1) | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | dnl Test whether the printf() function supports POSIX/XSI format strings with | ||
11 | dnl positions. | ||
12 | |||
13 | AC_DEFUN([gt_PRINTF_POSIX], | ||
14 | [ | ||
15 | AC_REQUIRE([AC_PROG_CC]) | ||
16 | AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], | ||
17 | gt_cv_func_printf_posix, | ||
18 | [ | ||
19 | AC_TRY_RUN([ | ||
20 | #include <stdio.h> | ||
21 | #include <string.h> | ||
22 | /* The string "%2$d %1$d", with dollar characters protected from the shell's | ||
23 | dollar expansion (possibly an autoconf bug). */ | ||
24 | static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; | ||
25 | static char buf[100]; | ||
26 | int main () | ||
27 | { | ||
28 | sprintf (buf, format, 33, 55); | ||
29 | return (strcmp (buf, "55 33") != 0); | ||
30 | }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, | ||
31 | [ | ||
32 | AC_EGREP_CPP(notposix, [ | ||
33 | #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ | ||
34 | notposix | ||
35 | #endif | ||
36 | ], gt_cv_func_printf_posix="guessing no", | ||
37 | gt_cv_func_printf_posix="guessing yes") | ||
38 | ]) | ||
39 | ]) | ||
40 | case $gt_cv_func_printf_posix in | ||
41 | *yes) | ||
42 | AC_DEFINE(HAVE_POSIX_PRINTF, 1, | ||
43 | [Define if your printf() function supports format strings with positions.]) | ||
44 | ;; | ||
45 | esac | ||
46 | ]) | ||
diff --git a/m4/progtest.m4 b/m4/progtest.m4 new file mode 100644 index 00000000..8fe527ce --- /dev/null +++ b/m4/progtest.m4 | |||
@@ -0,0 +1,91 @@ | |||
1 | # progtest.m4 serial 3 (gettext-0.12) | ||
2 | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
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>, 1996. | ||
20 | |||
21 | # Search path for a program which passes the given test. | ||
22 | |||
23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, | ||
24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) | ||
25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST], | ||
26 | [ | ||
27 | # Prepare PATH_SEPARATOR. | ||
28 | # The user is always right. | ||
29 | if test "${PATH_SEPARATOR+set}" != set; then | ||
30 | echo "#! /bin/sh" >conf$$.sh | ||
31 | echo "exit 0" >>conf$$.sh | ||
32 | chmod +x conf$$.sh | ||
33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then | ||
34 | PATH_SEPARATOR=';' | ||
35 | else | ||
36 | PATH_SEPARATOR=: | ||
37 | fi | ||
38 | rm -f conf$$.sh | ||
39 | fi | ||
40 | |||
41 | # Find out how to test for executable files. Don't use a zero-byte file, | ||
42 | # as systems may use methods other than mode bits to determine executability. | ||
43 | cat >conf$$.file <<_ASEOF | ||
44 | #! /bin/sh | ||
45 | exit 0 | ||
46 | _ASEOF | ||
47 | chmod +x conf$$.file | ||
48 | if test -x conf$$.file >/dev/null 2>&1; then | ||
49 | ac_executable_p="test -x" | ||
50 | else | ||
51 | ac_executable_p="test -f" | ||
52 | fi | ||
53 | rm -f conf$$.file | ||
54 | |||
55 | # Extract the first word of "$2", so it can be a program name with args. | ||
56 | set dummy $2; ac_word=[$]2 | ||
57 | AC_MSG_CHECKING([for $ac_word]) | ||
58 | AC_CACHE_VAL(ac_cv_path_$1, | ||
59 | [case "[$]$1" in | ||
60 | [[\\/]]* | ?:[[\\/]]*) | ||
61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path. | ||
62 | ;; | ||
63 | *) | ||
64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR | ||
65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do | ||
66 | IFS="$ac_save_IFS" | ||
67 | test -z "$ac_dir" && ac_dir=. | ||
68 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then | ||
70 | if [$3]; then | ||
71 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" | ||
72 | break 2 | ||
73 | fi | ||
74 | fi | ||
75 | done | ||
76 | done | ||
77 | IFS="$ac_save_IFS" | ||
78 | dnl If no 4th arg is given, leave the cache variable unset, | ||
79 | dnl so AC_PATH_PROGS will keep looking. | ||
80 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" | ||
81 | ])dnl | ||
82 | ;; | ||
83 | esac])dnl | ||
84 | $1="$ac_cv_path_$1" | ||
85 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then | ||
86 | AC_MSG_RESULT([$]$1) | ||
87 | else | ||
88 | AC_MSG_RESULT(no) | ||
89 | fi | ||
90 | AC_SUBST($1)dnl | ||
91 | ]) | ||
diff --git a/m4/signed.m4 b/m4/signed.m4 new file mode 100644 index 00000000..dc1f54f1 --- /dev/null +++ b/m4/signed.m4 | |||
@@ -0,0 +1,19 @@ | |||
1 | # signed.m4 serial 1 (gettext-0.10.40) | ||
2 | dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | AC_DEFUN([bh_C_SIGNED], | ||
12 | [ | ||
13 | AC_CACHE_CHECK([for signed], bh_cv_c_signed, | ||
14 | [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) | ||
15 | if test $bh_cv_c_signed = no; then | ||
16 | AC_DEFINE(signed, , | ||
17 | [Define to empty if the C compiler doesn't support this keyword.]) | ||
18 | fi | ||
19 | ]) | ||
diff --git a/m4/size_max.m4 b/m4/size_max.m4 new file mode 100644 index 00000000..5762fc33 --- /dev/null +++ b/m4/size_max.m4 | |||
@@ -0,0 +1,61 @@ | |||
1 | # size_max.m4 serial 2 | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | |||
11 | AC_DEFUN([gl_SIZE_MAX], | ||
12 | [ | ||
13 | AC_CHECK_HEADERS(stdint.h) | ||
14 | dnl First test whether the system already has SIZE_MAX. | ||
15 | AC_MSG_CHECKING([for SIZE_MAX]) | ||
16 | result= | ||
17 | AC_EGREP_CPP([Found it], [ | ||
18 | #include <limits.h> | ||
19 | #if HAVE_STDINT_H | ||
20 | #include <stdint.h> | ||
21 | #endif | ||
22 | #ifdef SIZE_MAX | ||
23 | Found it | ||
24 | #endif | ||
25 | ], result=yes) | ||
26 | if test -z "$result"; then | ||
27 | dnl Define it ourselves. Here we assume that the type 'size_t' is not wider | ||
28 | dnl than the type 'unsigned long'. | ||
29 | dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr', | ||
30 | dnl which is guaranteed to work from LONG_MIN to LONG_MAX. | ||
31 | _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi, | ||
32 | [#include <stddef.h>], result=?) | ||
33 | _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo, | ||
34 | [#include <stddef.h>], result=?) | ||
35 | _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint, | ||
36 | [#include <stddef.h>], result=?) | ||
37 | if test "$fits_in_uint" = 1; then | ||
38 | dnl Even though SIZE_MAX fits in an unsigned int, it must be of type | ||
39 | dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'. | ||
40 | AC_TRY_COMPILE([#include <stddef.h> | ||
41 | extern size_t foo; | ||
42 | extern unsigned long foo; | ||
43 | ], [], fits_in_uint=0) | ||
44 | fi | ||
45 | if test -z "$result"; then | ||
46 | if test "$fits_in_uint" = 1; then | ||
47 | result="$res_hi$res_lo"U | ||
48 | else | ||
49 | result="$res_hi$res_lo"UL | ||
50 | fi | ||
51 | else | ||
52 | dnl Shouldn't happen, but who knows... | ||
53 | result='~(size_t)0' | ||
54 | fi | ||
55 | fi | ||
56 | AC_MSG_RESULT([$result]) | ||
57 | if test "$result" != yes; then | ||
58 | AC_DEFINE_UNQUOTED([SIZE_MAX], [$result], | ||
59 | [Define as the maximum value of type 'size_t', if the system doesn't define it.]) | ||
60 | fi | ||
61 | ]) | ||
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4 new file mode 100644 index 00000000..32ba7ae7 --- /dev/null +++ b/m4/stdint_h.m4 | |||
@@ -0,0 +1,28 @@ | |||
1 | # stdint_h.m4 serial 3 (gettext-0.12) | ||
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists, | ||
12 | # doesn't clash with <sys/types.h>, and declares uintmax_t. | ||
13 | |||
14 | AC_DEFUN([jm_AC_HEADER_STDINT_H], | ||
15 | [ | ||
16 | AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h, | ||
17 | [AC_TRY_COMPILE( | ||
18 | [#include <sys/types.h> | ||
19 | #include <stdint.h>], | ||
20 | [uintmax_t i = (uintmax_t) -1;], | ||
21 | jm_ac_cv_header_stdint_h=yes, | ||
22 | jm_ac_cv_header_stdint_h=no)]) | ||
23 | if test $jm_ac_cv_header_stdint_h = yes; then | ||
24 | AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1, | ||
25 | [Define if <stdint.h> exists, doesn't clash with <sys/types.h>, | ||
26 | and declares uintmax_t. ]) | ||
27 | fi | ||
28 | ]) | ||
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4 new file mode 100644 index 00000000..b5f28d44 --- /dev/null +++ b/m4/uintmax_t.m4 | |||
@@ -0,0 +1,32 @@ | |||
1 | # uintmax_t.m4 serial 7 (gettext-0.12) | ||
2 | dnl Copyright (C) 1997-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | AC_PREREQ(2.13) | ||
12 | |||
13 | # Define uintmax_t to 'unsigned long' or 'unsigned long long' | ||
14 | # if it is not already defined in <stdint.h> or <inttypes.h>. | ||
15 | |||
16 | AC_DEFUN([jm_AC_TYPE_UINTMAX_T], | ||
17 | [ | ||
18 | AC_REQUIRE([jm_AC_HEADER_INTTYPES_H]) | ||
19 | AC_REQUIRE([jm_AC_HEADER_STDINT_H]) | ||
20 | if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then | ||
21 | AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG]) | ||
22 | test $ac_cv_type_unsigned_long_long = yes \ | ||
23 | && ac_type='unsigned long long' \ | ||
24 | || ac_type='unsigned long' | ||
25 | AC_DEFINE_UNQUOTED(uintmax_t, $ac_type, | ||
26 | [Define to unsigned long or unsigned long long | ||
27 | if <stdint.h> and <inttypes.h> don't define.]) | ||
28 | else | ||
29 | AC_DEFINE(HAVE_UINTMAX_T, 1, | ||
30 | [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.]) | ||
31 | fi | ||
32 | ]) | ||
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4 new file mode 100644 index 00000000..1da8b809 --- /dev/null +++ b/m4/ulonglong.m4 | |||
@@ -0,0 +1,25 @@ | |||
1 | # ulonglong.m4 serial 3 | ||
2 | dnl Copyright (C) 1999-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Paul Eggert. | ||
10 | |||
11 | # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works. | ||
12 | |||
13 | AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG], | ||
14 | [ | ||
15 | AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long, | ||
16 | [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;], | ||
17 | [unsigned long long ullmax = (unsigned long long) -1; | ||
18 | return ull << i | ull >> i | ullmax / ull | ullmax % ull;], | ||
19 | ac_cv_type_unsigned_long_long=yes, | ||
20 | ac_cv_type_unsigned_long_long=no)]) | ||
21 | if test $ac_cv_type_unsigned_long_long = yes; then | ||
22 | AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1, | ||
23 | [Define if you have the 'unsigned long long' type.]) | ||
24 | fi | ||
25 | ]) | ||
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4 new file mode 100644 index 00000000..d8fd1ec5 --- /dev/null +++ b/m4/wchar_t.m4 | |||
@@ -0,0 +1,22 @@ | |||
1 | # wchar_t.m4 serial 1 (gettext-0.12) | ||
2 | dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | dnl Test whether <stddef.h> has the 'wchar_t' type. | ||
11 | dnl Prerequisite: AC_PROG_CC | ||
12 | |||
13 | AC_DEFUN([gt_TYPE_WCHAR_T], | ||
14 | [ | ||
15 | AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t, | ||
16 | [AC_TRY_COMPILE([#include <stddef.h> | ||
17 | wchar_t foo = (wchar_t)'\0';], , | ||
18 | gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)]) | ||
19 | if test $gt_cv_c_wchar_t = yes; then | ||
20 | AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.]) | ||
21 | fi | ||
22 | ]) | ||
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4 new file mode 100644 index 00000000..3d8d2159 --- /dev/null +++ b/m4/wint_t.m4 | |||
@@ -0,0 +1,22 @@ | |||
1 | # wint_t.m4 serial 1 (gettext-0.12) | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | dnl From Bruno Haible. | ||
10 | dnl Test whether <wchar.h> has the 'wint_t' type. | ||
11 | dnl Prerequisite: AC_PROG_CC | ||
12 | |||
13 | AC_DEFUN([gt_TYPE_WINT_T], | ||
14 | [ | ||
15 | AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t, | ||
16 | [AC_TRY_COMPILE([#include <wchar.h> | ||
17 | wint_t foo = (wchar_t)'\0';], , | ||
18 | gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)]) | ||
19 | if test $gt_cv_c_wint_t = yes; then | ||
20 | AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.]) | ||
21 | fi | ||
22 | ]) | ||
diff --git a/m4/xsize.m4 b/m4/xsize.m4 new file mode 100644 index 00000000..9b7cf9b4 --- /dev/null +++ b/m4/xsize.m4 | |||
@@ -0,0 +1,14 @@ | |||
1 | # xsize.m4 serial 2 | ||
2 | dnl Copyright (C) 2003 Free Software Foundation, Inc. | ||
3 | 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 | ||
5 | dnl Public License, this file may be distributed as part of a program | ||
6 | dnl that contains a configuration script generated by Autoconf, under | ||
7 | dnl the same distribution terms as the rest of that program. | ||
8 | |||
9 | AC_DEFUN([gl_XSIZE], | ||
10 | [ | ||
11 | dnl Prerequisites of lib/xsize.h. | ||
12 | AC_REQUIRE([gl_SIZE_MAX]) | ||
13 | AC_CHECK_HEADERS(stdint.h) | ||
14 | ]) | ||