]> git.ipfire.org Git - thirdparty/gcc.git/blob - intl/aclocal.m4
intl: New directory; see intl/ChangeLog for details.
[thirdparty/gcc.git] / intl / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 # gettext.m4 serial 20 (gettext-0.12)
14 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
15 dnl This file is free software, distributed under the terms of the GNU
16 dnl General Public License. As a special exception to the GNU General
17 dnl Public License, this file may be distributed as part of a program
18 dnl that contains a configuration script generated by Autoconf, under
19 dnl the same distribution terms as the rest of that program.
20 dnl
21 dnl This file can can be used in projects which are not available under
22 dnl the GNU General Public License or the GNU Library General Public
23 dnl License but which still want to provide support for the GNU gettext
24 dnl functionality.
25 dnl Please note that the actual code of the GNU gettext library is covered
26 dnl by the GNU Library General Public License, and the rest of the GNU
27 dnl gettext package package is covered by the GNU General Public License.
28 dnl They are *not* in the public domain.
29
30 dnl Authors:
31 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
32 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
33
34 dnl Macro to add for using GNU gettext.
35
36 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
37 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
38 dnl default (if it is not specified or empty) is 'no-libtool'.
39 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
40 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
41 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
42 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
43 dnl depending on --{enable,disable}-{shared,static} and on the presence of
44 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
45 dnl $(top_builddir)/intl/libintl.a will be created.
46 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
47 dnl implementations (in libc or libintl) without the ngettext() function
48 dnl will be ignored. If NEEDSYMBOL is specified and is
49 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
50 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
51 dnl INTLDIR is used to find the intl libraries. If empty,
52 dnl the value `$(top_builddir)/intl/' is used.
53 dnl
54 dnl The result of the configuration is one of three cases:
55 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
56 dnl and used.
57 dnl Catalog format: GNU --> install in $(datadir)
58 dnl Catalog extension: .mo after installation, .gmo in source tree
59 dnl 2) GNU gettext has been found in the system's C library.
60 dnl Catalog format: GNU --> install in $(datadir)
61 dnl Catalog extension: .mo after installation, .gmo in source tree
62 dnl 3) No internationalization, always use English msgid.
63 dnl Catalog format: none
64 dnl Catalog extension: none
65 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
66 dnl The use of .gmo is historical (it was needed to avoid overwriting the
67 dnl GNU format catalogs when building on a platform with an X/Open gettext),
68 dnl but we keep it in order not to force irrelevant filename changes on the
69 dnl maintainers.
70 dnl
71 AC_DEFUN([AM_GNU_GETTEXT],
72 [
73 dnl Argument checking.
74 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
75 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
76 ])])])])])
77 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
78 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
79 ])])])])
80 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
81 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
82
83 AC_REQUIRE([AM_PO_SUBDIRS])dnl
84 ifelse(gt_included_intl, yes, [
85 AC_REQUIRE([AM_INTL_SUBDIR])dnl
86 ])
87
88 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
89 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
90 AC_REQUIRE([AC_LIB_RPATH])
91
92 dnl Sometimes libintl requires libiconv, so first search for libiconv.
93 dnl Ideally we would do this search only after the
94 dnl if test "$USE_NLS" = "yes"; then
95 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
96 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
97 dnl the configure script would need to contain the same shell code
98 dnl again, outside any 'if'. There are two solutions:
99 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
100 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
101 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
102 dnl documented, we avoid it.
103 ifelse(gt_included_intl, yes, , [
104 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
105 ])
106
107 dnl Set USE_NLS.
108 AM_NLS
109
110 ifelse(gt_included_intl, yes, [
111 BUILD_INCLUDED_LIBINTL=no
112 USE_INCLUDED_LIBINTL=no
113 ])
114 LIBINTL=
115 LTLIBINTL=
116 POSUB=
117
118 dnl If we use NLS figure out what method
119 if test "$USE_NLS" = "yes"; then
120 gt_use_preinstalled_gnugettext=no
121 ifelse(gt_included_intl, yes, [
122 AC_MSG_CHECKING([whether included gettext is requested])
123 AC_ARG_WITH(included-gettext,
124 [ --with-included-gettext use the GNU gettext library included here],
125 nls_cv_force_use_gnu_gettext=$withval,
126 nls_cv_force_use_gnu_gettext=no)
127 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
128
129 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
130 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
131 ])
132 dnl User does not insist on using GNU NLS library. Figure out what
133 dnl to use. If GNU gettext is available we use this. Else we have
134 dnl to fall back to GNU NLS library.
135
136 dnl Add a version number to the cache macros.
137 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
138 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
139 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
140
141 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
142 [AC_TRY_LINK([#include <libintl.h>
143 ]ifelse([$2], [need-formatstring-macros],
144 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
145 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
146 #endif
147 changequote(,)dnl
148 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
149 changequote([,])dnl
150 ], [])[extern int _nl_msg_cat_cntr;
151 extern int *_nl_domain_bindings;],
152 [bindtextdomain ("", "");
153 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
154 gt_cv_func_gnugettext_libc=yes,
155 gt_cv_func_gnugettext_libc=no)])
156
157 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
158 dnl Sometimes libintl requires libiconv, so first search for libiconv.
159 ifelse(gt_included_intl, yes, , [
160 AM_ICONV_LINK
161 ])
162 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
163 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
164 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
165 dnl even if libiconv doesn't exist.
166 AC_LIB_LINKFLAGS_BODY([intl])
167 AC_CACHE_CHECK([for GNU gettext in libintl],
168 gt_cv_func_gnugettext_libintl,
169 [gt_save_CPPFLAGS="$CPPFLAGS"
170 CPPFLAGS="$CPPFLAGS $INCINTL"
171 gt_save_LIBS="$LIBS"
172 LIBS="$LIBS $LIBINTL"
173 dnl Now see whether libintl exists and does not depend on libiconv.
174 AC_TRY_LINK([#include <libintl.h>
175 ]ifelse([$2], [need-formatstring-macros],
176 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
177 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
178 #endif
179 changequote(,)dnl
180 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
181 changequote([,])dnl
182 ], [])[extern int _nl_msg_cat_cntr;
183 extern
184 #ifdef __cplusplus
185 "C"
186 #endif
187 const char *_nl_expand_alias ();],
188 [bindtextdomain ("", "");
189 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
190 gt_cv_func_gnugettext_libintl=yes,
191 gt_cv_func_gnugettext_libintl=no)
192 dnl Now see whether libintl exists and depends on libiconv.
193 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
194 LIBS="$LIBS $LIBICONV"
195 AC_TRY_LINK([#include <libintl.h>
196 ]ifelse([$2], [need-formatstring-macros],
197 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
198 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
199 #endif
200 changequote(,)dnl
201 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
202 changequote([,])dnl
203 ], [])[extern int _nl_msg_cat_cntr;
204 extern
205 #ifdef __cplusplus
206 "C"
207 #endif
208 const char *_nl_expand_alias ();],
209 [bindtextdomain ("", "");
210 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
211 [LIBINTL="$LIBINTL $LIBICONV"
212 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
213 gt_cv_func_gnugettext_libintl=yes
214 ])
215 fi
216 CPPFLAGS="$gt_save_CPPFLAGS"
217 LIBS="$gt_save_LIBS"])
218 fi
219
220 dnl If an already present or preinstalled GNU gettext() is found,
221 dnl use it. But if this macro is used in GNU gettext, and GNU
222 dnl gettext is already preinstalled in libintl, we update this
223 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
224 if test "$gt_cv_func_gnugettext_libc" = "yes" \
225 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
226 && test "$PACKAGE" != gettext-runtime \
227 && test "$PACKAGE" != gettext-tools; }; then
228 gt_use_preinstalled_gnugettext=yes
229 else
230 dnl Reset the values set by searching for libintl.
231 LIBINTL=
232 LTLIBINTL=
233 INCINTL=
234 fi
235
236 ifelse(gt_included_intl, yes, [
237 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
238 dnl GNU gettext is not found in the C library.
239 dnl Fall back on included GNU gettext library.
240 nls_cv_use_gnu_gettext=yes
241 fi
242 fi
243
244 if test "$nls_cv_use_gnu_gettext" = "yes"; then
245 dnl Mark actions used to generate GNU NLS library.
246 BUILD_INCLUDED_LIBINTL=yes
247 USE_INCLUDED_LIBINTL=yes
248 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
249 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
250 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
251 fi
252
253 if test "$gt_use_preinstalled_gnugettext" = "yes" \
254 || test "$nls_cv_use_gnu_gettext" = "yes"; then
255 dnl Mark actions to use GNU gettext tools.
256 CATOBJEXT=.gmo
257 fi
258 ])
259
260 if test "$gt_use_preinstalled_gnugettext" = "yes" \
261 || test "$nls_cv_use_gnu_gettext" = "yes"; then
262 AC_DEFINE(ENABLE_NLS, 1,
263 [Define to 1 if translation of program messages to the user's native language
264 is requested.])
265 else
266 USE_NLS=no
267 fi
268 fi
269
270 AC_MSG_CHECKING([whether to use NLS])
271 AC_MSG_RESULT([$USE_NLS])
272 if test "$USE_NLS" = "yes"; then
273 AC_MSG_CHECKING([where the gettext function comes from])
274 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
275 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
276 gt_source="external libintl"
277 else
278 gt_source="libc"
279 fi
280 else
281 gt_source="included intl directory"
282 fi
283 AC_MSG_RESULT([$gt_source])
284 fi
285
286 if test "$USE_NLS" = "yes"; then
287
288 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
289 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
290 AC_MSG_CHECKING([how to link with libintl])
291 AC_MSG_RESULT([$LIBINTL])
292 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
293 fi
294
295 dnl For backward compatibility. Some packages may be using this.
296 AC_DEFINE(HAVE_GETTEXT, 1,
297 [Define if the GNU gettext() function is already present or preinstalled.])
298 AC_DEFINE(HAVE_DCGETTEXT, 1,
299 [Define if the GNU dcgettext() function is already present or preinstalled.])
300 fi
301
302 dnl We need to process the po/ directory.
303 POSUB=po
304 fi
305
306 ifelse(gt_included_intl, yes, [
307 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
308 dnl to 'yes' because some of the testsuite requires it.
309 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
310 BUILD_INCLUDED_LIBINTL=yes
311 fi
312
313 dnl Make all variables we use known to autoconf.
314 AC_SUBST(BUILD_INCLUDED_LIBINTL)
315 AC_SUBST(USE_INCLUDED_LIBINTL)
316 AC_SUBST(CATOBJEXT)
317
318 dnl For backward compatibility. Some configure.ins may be using this.
319 nls_cv_header_intl=
320 nls_cv_header_libgt=
321
322 dnl For backward compatibility. Some Makefiles may be using this.
323 DATADIRNAME=share
324 AC_SUBST(DATADIRNAME)
325
326 dnl For backward compatibility. Some Makefiles may be using this.
327 INSTOBJEXT=.mo
328 AC_SUBST(INSTOBJEXT)
329
330 dnl For backward compatibility. Some Makefiles may be using this.
331 GENCAT=gencat
332 AC_SUBST(GENCAT)
333
334 dnl For backward compatibility. Some Makefiles may be using this.
335 if test "$USE_INCLUDED_LIBINTL" = yes; then
336 INTLOBJS="\$(GETTOBJS)"
337 fi
338 AC_SUBST(INTLOBJS)
339
340 dnl Enable libtool support if the surrounding package wishes it.
341 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
342 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
343 ])
344
345 dnl For backward compatibility. Some Makefiles may be using this.
346 INTLLIBS="$LIBINTL"
347 AC_SUBST(INTLLIBS)
348
349 dnl Make all documented variables known to autoconf.
350 AC_SUBST(LIBINTL)
351 AC_SUBST(LTLIBINTL)
352 AC_SUBST(POSUB)
353 ])
354
355
356 dnl Checks for all prerequisites of the intl subdirectory,
357 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
358 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
359 AC_DEFUN([AM_INTL_SUBDIR],
360 [
361 AC_REQUIRE([AC_PROG_INSTALL])dnl
362 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
363 AC_REQUIRE([AC_PROG_CC])dnl
364 AC_REQUIRE([AC_CANONICAL_HOST])dnl
365 AC_REQUIRE([AC_PROG_RANLIB])dnl
366 AC_REQUIRE([AC_ISC_POSIX])dnl
367 AC_REQUIRE([AC_HEADER_STDC])dnl
368 AC_REQUIRE([AC_C_CONST])dnl
369 AC_REQUIRE([AC_C_INLINE])dnl
370 AC_REQUIRE([AC_TYPE_OFF_T])dnl
371 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
372 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
373 AC_REQUIRE([AC_FUNC_MMAP])dnl
374 AC_REQUIRE([jm_GLIBC21])dnl
375 AC_REQUIRE([gt_INTDIV0])dnl
376 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
377 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
378 AC_REQUIRE([gt_INTTYPES_PRI])dnl
379
380 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
381 stdlib.h string.h unistd.h sys/param.h])
382 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
383 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
384 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
385 __fsetlocking])
386
387 AM_ICONV
388 AM_LANGINFO_CODESET
389 if test $ac_cv_header_locale_h = yes; then
390 AM_LC_MESSAGES
391 fi
392
393 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
394 dnl because plural.y uses bison specific features. It requires at least
395 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
396 dnl compile.
397 dnl bison is only needed for the maintainer (who touches plural.y). But in
398 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
399 dnl the rule in general Makefile. Now, some people carelessly touch the
400 dnl files or have a broken "make" program, hence the plural.c rule will
401 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
402 dnl present or too old.
403 AC_CHECK_PROGS([INTLBISON], [bison])
404 if test -z "$INTLBISON"; then
405 ac_verc_fail=yes
406 else
407 dnl Found it, now check the version.
408 AC_MSG_CHECKING([version of bison])
409 changequote(<<,>>)dnl
410 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
411 case $ac_prog_version in
412 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
413 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
414 changequote([,])dnl
415 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
416 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
417 esac
418 AC_MSG_RESULT([$ac_prog_version])
419 fi
420 if test $ac_verc_fail = yes; then
421 INTLBISON=:
422 fi
423 ])
424
425
426 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
427 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
428
429 # po.m4 serial 1 (gettext-0.12)
430 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
431 dnl This file is free software, distributed under the terms of the GNU
432 dnl General Public License. As a special exception to the GNU General
433 dnl Public License, this file may be distributed as part of a program
434 dnl that contains a configuration script generated by Autoconf, under
435 dnl the same distribution terms as the rest of that program.
436 dnl
437 dnl This file can can be used in projects which are not available under
438 dnl the GNU General Public License or the GNU Library General Public
439 dnl License but which still want to provide support for the GNU gettext
440 dnl functionality.
441 dnl Please note that the actual code of the GNU gettext library is covered
442 dnl by the GNU Library General Public License, and the rest of the GNU
443 dnl gettext package package is covered by the GNU General Public License.
444 dnl They are *not* in the public domain.
445
446 dnl Authors:
447 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
448 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
449
450 dnl Checks for all prerequisites of the po subdirectory.
451 AC_DEFUN([AM_PO_SUBDIRS],
452 [
453 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
454 AC_REQUIRE([AC_PROG_INSTALL])dnl
455 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
456 AC_REQUIRE([AM_NLS])dnl
457
458 dnl Perform the following tests also if --disable-nls has been given,
459 dnl because they are needed for "make dist" to work.
460
461 dnl Search for GNU msgfmt in the PATH.
462 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
463 dnl The second test excludes FreeBSD msgfmt.
464 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
465 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
466 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
467 :)
468 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
469
470 dnl Search for GNU xgettext 0.12 or newer in the PATH.
471 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
472 dnl The second test excludes FreeBSD xgettext.
473 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
474 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
475 (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)],
476 :)
477 dnl Remove leftover from FreeBSD xgettext call.
478 rm -f messages.po
479
480 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
481 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
482 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
483
484 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
485 dnl Test whether we really found GNU msgfmt.
486 if test "$GMSGFMT" != ":"; then
487 dnl If it is no GNU msgfmt we define it as : so that the
488 dnl Makefiles still can work.
489 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
490 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
491 : ;
492 else
493 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
494 AC_MSG_RESULT(
495 [found $GMSGFMT program is not GNU msgfmt; ignore it])
496 GMSGFMT=":"
497 fi
498 fi
499
500 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
501 dnl Test whether we really found GNU xgettext.
502 if test "$XGETTEXT" != ":"; then
503 dnl If it is no GNU xgettext we define it as : so that the
504 dnl Makefiles still can work.
505 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
506 (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
507 : ;
508 else
509 AC_MSG_RESULT(
510 [found xgettext program is not GNU xgettext; ignore it])
511 XGETTEXT=":"
512 fi
513 dnl Remove leftover from FreeBSD xgettext call.
514 rm -f messages.po
515 fi
516
517 AC_OUTPUT_COMMANDS([
518 for ac_file in $CONFIG_FILES; do
519 # Support "outfile[:infile[:infile...]]"
520 case "$ac_file" in
521 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
522 esac
523 # PO directories have a Makefile.in generated from Makefile.in.in.
524 case "$ac_file" in */Makefile.in)
525 # Adjust a relative srcdir.
526 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
527 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
528 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
529 # In autoconf-2.13 it is called $ac_given_srcdir.
530 # In autoconf-2.50 it is called $srcdir.
531 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
532 case "$ac_given_srcdir" in
533 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
534 /*) top_srcdir="$ac_given_srcdir" ;;
535 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
536 esac
537 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
538 rm -f "$ac_dir/POTFILES"
539 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
540 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
541 POMAKEFILEDEPS="POTFILES.in"
542 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
543 # on $ac_dir but don't depend on user-specified configuration
544 # parameters.
545 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
546 # The LINGUAS file contains the set of available languages.
547 if test -n "$OBSOLETE_ALL_LINGUAS"; then
548 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
549 fi
550 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
551 # Hide the ALL_LINGUAS assigment from automake.
552 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
553 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
554 else
555 # The set of available languages was given in configure.in.
556 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
557 fi
558 case "$ac_given_srcdir" in
559 .) srcdirpre= ;;
560 *) srcdirpre='$(srcdir)/' ;;
561 esac
562 POFILES=
563 GMOFILES=
564 UPDATEPOFILES=
565 DUMMYPOFILES=
566 for lang in $ALL_LINGUAS; do
567 POFILES="$POFILES $srcdirpre$lang.po"
568 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
569 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
570 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
571 done
572 # CATALOGS depends on both $ac_dir and the user's LINGUAS
573 # environment variable.
574 INST_LINGUAS=
575 if test -n "$ALL_LINGUAS"; then
576 for presentlang in $ALL_LINGUAS; do
577 useit=no
578 if test "%UNSET%" != "$LINGUAS"; then
579 desiredlanguages="$LINGUAS"
580 else
581 desiredlanguages="$ALL_LINGUAS"
582 fi
583 for desiredlang in $desiredlanguages; do
584 # Use the presentlang catalog if desiredlang is
585 # a. equal to presentlang, or
586 # b. a variant of presentlang (because in this case,
587 # presentlang can be used as a fallback for messages
588 # which are not translated in the desiredlang catalog).
589 case "$desiredlang" in
590 "$presentlang"*) useit=yes;;
591 esac
592 done
593 if test $useit = yes; then
594 INST_LINGUAS="$INST_LINGUAS $presentlang"
595 fi
596 done
597 fi
598 CATALOGS=
599 if test -n "$INST_LINGUAS"; then
600 for lang in $INST_LINGUAS; do
601 CATALOGS="$CATALOGS $lang.gmo"
602 done
603 fi
604 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
605 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
606 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
607 if test -f "$f"; then
608 case "$f" in
609 *.orig | *.bak | *~) ;;
610 *) cat "$f" >> "$ac_dir/Makefile" ;;
611 esac
612 fi
613 done
614 fi
615 ;;
616 esac
617 done],
618 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
619 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
620 # from automake.
621 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
622 # Capture the value of LINGUAS because we need it to compute CATALOGS.
623 LINGUAS="${LINGUAS-%UNSET%}"
624 ])
625 ])
626
627 # nls.m4 serial 1 (gettext-0.12)
628 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
629 dnl This file is free software, distributed under the terms of the GNU
630 dnl General Public License. As a special exception to the GNU General
631 dnl Public License, this file may be distributed as part of a program
632 dnl that contains a configuration script generated by Autoconf, under
633 dnl the same distribution terms as the rest of that program.
634 dnl
635 dnl This file can can be used in projects which are not available under
636 dnl the GNU General Public License or the GNU Library General Public
637 dnl License but which still want to provide support for the GNU gettext
638 dnl functionality.
639 dnl Please note that the actual code of the GNU gettext library is covered
640 dnl by the GNU Library General Public License, and the rest of the GNU
641 dnl gettext package package is covered by the GNU General Public License.
642 dnl They are *not* in the public domain.
643
644 dnl Authors:
645 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
646 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
647
648 AC_DEFUN([AM_NLS],
649 [
650 AC_MSG_CHECKING([whether NLS is requested])
651 dnl Default is enabled NLS
652 AC_ARG_ENABLE(nls,
653 [ --disable-nls do not use Native Language Support],
654 USE_NLS=$enableval, USE_NLS=yes)
655 AC_MSG_RESULT($USE_NLS)
656 AC_SUBST(USE_NLS)
657 ])
658
659 AC_DEFUN([AM_MKINSTALLDIRS],
660 [
661 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
662 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
663 dnl Try to locate it.
664 MKINSTALLDIRS=
665 if test -n "$ac_aux_dir"; then
666 case "$ac_aux_dir" in
667 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
668 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
669 esac
670 fi
671 if test -z "$MKINSTALLDIRS"; then
672 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
673 fi
674 AC_SUBST(MKINSTALLDIRS)
675 ])
676
677 # progtest.m4 serial 3 (gettext-0.12)
678 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
679 dnl This file is free software, distributed under the terms of the GNU
680 dnl General Public License. As a special exception to the GNU General
681 dnl Public License, this file may be distributed as part of a program
682 dnl that contains a configuration script generated by Autoconf, under
683 dnl the same distribution terms as the rest of that program.
684 dnl
685 dnl This file can can be used in projects which are not available under
686 dnl the GNU General Public License or the GNU Library General Public
687 dnl License but which still want to provide support for the GNU gettext
688 dnl functionality.
689 dnl Please note that the actual code of the GNU gettext library is covered
690 dnl by the GNU Library General Public License, and the rest of the GNU
691 dnl gettext package package is covered by the GNU General Public License.
692 dnl They are *not* in the public domain.
693
694 dnl Authors:
695 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
696
697 # Search path for a program which passes the given test.
698
699 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
700 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
701 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
702 [
703 # Prepare PATH_SEPARATOR.
704 # The user is always right.
705 if test "${PATH_SEPARATOR+set}" != set; then
706 echo "#! /bin/sh" >conf$$.sh
707 echo "exit 0" >>conf$$.sh
708 chmod +x conf$$.sh
709 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
710 PATH_SEPARATOR=';'
711 else
712 PATH_SEPARATOR=:
713 fi
714 rm -f conf$$.sh
715 fi
716
717 # Find out how to test for executable files. Don't use a zero-byte file,
718 # as systems may use methods other than mode bits to determine executability.
719 cat >conf$$.file <<_ASEOF
720 #! /bin/sh
721 exit 0
722 _ASEOF
723 chmod +x conf$$.file
724 if test -x conf$$.file >/dev/null 2>&1; then
725 ac_executable_p="test -x"
726 else
727 ac_executable_p="test -f"
728 fi
729 rm -f conf$$.file
730
731 # Extract the first word of "$2", so it can be a program name with args.
732 set dummy $2; ac_word=[$]2
733 AC_MSG_CHECKING([for $ac_word])
734 AC_CACHE_VAL(ac_cv_path_$1,
735 [case "[$]$1" in
736 [[\\/]]* | ?:[[\\/]]*)
737 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
738 ;;
739 *)
740 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
741 for ac_dir in ifelse([$5], , $PATH, [$5]); do
742 IFS="$ac_save_IFS"
743 test -z "$ac_dir" && ac_dir=.
744 for ac_exec_ext in '' $ac_executable_extensions; do
745 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
746 if [$3]; then
747 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
748 break 2
749 fi
750 fi
751 done
752 done
753 IFS="$ac_save_IFS"
754 dnl If no 4th arg is given, leave the cache variable unset,
755 dnl so AC_PATH_PROGS will keep looking.
756 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
757 ])dnl
758 ;;
759 esac])dnl
760 $1="$ac_cv_path_$1"
761 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
762 AC_MSG_RESULT([$]$1)
763 else
764 AC_MSG_RESULT(no)
765 fi
766 AC_SUBST($1)dnl
767 ])
768
769 # lib-link.m4 serial 4 (gettext-0.12)
770 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
771 dnl This file is free software, distributed under the terms of the GNU
772 dnl General Public License. As a special exception to the GNU General
773 dnl Public License, this file may be distributed as part of a program
774 dnl that contains a configuration script generated by Autoconf, under
775 dnl the same distribution terms as the rest of that program.
776
777 dnl From Bruno Haible.
778
779 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
780 dnl the libraries corresponding to explicit and implicit dependencies.
781 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
782 dnl augments the CPPFLAGS variable.
783 AC_DEFUN([AC_LIB_LINKFLAGS],
784 [
785 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
786 AC_REQUIRE([AC_LIB_RPATH])
787 define([Name],[translit([$1],[./-], [___])])
788 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
789 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
790 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
791 AC_LIB_LINKFLAGS_BODY([$1], [$2])
792 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
793 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
794 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
795 ])
796 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
797 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
798 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
799 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
800 AC_SUBST([LIB]NAME)
801 AC_SUBST([LTLIB]NAME)
802 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
803 dnl results of this search when this library appears as a dependency.
804 HAVE_LIB[]NAME=yes
805 undefine([Name])
806 undefine([NAME])
807 ])
808
809 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
810 dnl searches for libname and the libraries corresponding to explicit and
811 dnl implicit dependencies, together with the specified include files and
812 dnl the ability to compile and link the specified testcode. If found, it
813 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
814 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
815 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
816 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
817 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
818 [
819 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
820 AC_REQUIRE([AC_LIB_RPATH])
821 define([Name],[translit([$1],[./-], [___])])
822 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
823 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
824
825 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
826 dnl accordingly.
827 AC_LIB_LINKFLAGS_BODY([$1], [$2])
828
829 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
830 dnl because if the user has installed lib[]Name and not disabled its use
831 dnl via --without-lib[]Name-prefix, he wants to use it.
832 ac_save_CPPFLAGS="$CPPFLAGS"
833 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
834
835 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
836 ac_save_LIBS="$LIBS"
837 LIBS="$LIBS $LIB[]NAME"
838 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
839 LIBS="$ac_save_LIBS"
840 ])
841 if test "$ac_cv_lib[]Name" = yes; then
842 HAVE_LIB[]NAME=yes
843 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
844 AC_MSG_CHECKING([how to link with lib[]$1])
845 AC_MSG_RESULT([$LIB[]NAME])
846 else
847 HAVE_LIB[]NAME=no
848 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
849 dnl $INC[]NAME either.
850 CPPFLAGS="$ac_save_CPPFLAGS"
851 LIB[]NAME=
852 LTLIB[]NAME=
853 fi
854 AC_SUBST([HAVE_LIB]NAME)
855 AC_SUBST([LIB]NAME)
856 AC_SUBST([LTLIB]NAME)
857 undefine([Name])
858 undefine([NAME])
859 ])
860
861 dnl Determine the platform dependent parameters needed to use rpath:
862 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
863 dnl hardcode_direct, hardcode_minus_L.
864 AC_DEFUN([AC_LIB_RPATH],
865 [
866 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
867 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
868 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
869 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
870 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
871 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
872 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
873 . ./conftest.sh
874 rm -f ./conftest.sh
875 acl_cv_rpath=done
876 ])
877 wl="$acl_cv_wl"
878 libext="$acl_cv_libext"
879 shlibext="$acl_cv_shlibext"
880 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
881 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
882 hardcode_direct="$acl_cv_hardcode_direct"
883 hardcode_minus_L="$acl_cv_hardcode_minus_L"
884 dnl Determine whether the user wants rpath handling at all.
885 AC_ARG_ENABLE(rpath,
886 [ --disable-rpath do not hardcode runtime library paths],
887 :, enable_rpath=yes)
888 ])
889
890 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
891 dnl the libraries corresponding to explicit and implicit dependencies.
892 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
893 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
894 [
895 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
896 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
897 dnl By default, look in $includedir and $libdir.
898 use_additional=yes
899 AC_LIB_WITH_FINAL_PREFIX([
900 eval additional_includedir=\"$includedir\"
901 eval additional_libdir=\"$libdir\"
902 ])
903 AC_LIB_ARG_WITH([lib$1-prefix],
904 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
905 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
906 [
907 if test "X$withval" = "Xno"; then
908 use_additional=no
909 else
910 if test "X$withval" = "X"; then
911 AC_LIB_WITH_FINAL_PREFIX([
912 eval additional_includedir=\"$includedir\"
913 eval additional_libdir=\"$libdir\"
914 ])
915 else
916 additional_includedir="$withval/include"
917 additional_libdir="$withval/lib"
918 fi
919 fi
920 ])
921 dnl Search the library and its dependencies in $additional_libdir and
922 dnl $LDFLAGS. Using breadth-first-seach.
923 LIB[]NAME=
924 LTLIB[]NAME=
925 INC[]NAME=
926 rpathdirs=
927 ltrpathdirs=
928 names_already_handled=
929 names_next_round='$1 $2'
930 while test -n "$names_next_round"; do
931 names_this_round="$names_next_round"
932 names_next_round=
933 for name in $names_this_round; do
934 already_handled=
935 for n in $names_already_handled; do
936 if test "$n" = "$name"; then
937 already_handled=yes
938 break
939 fi
940 done
941 if test -z "$already_handled"; then
942 names_already_handled="$names_already_handled $name"
943 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
944 dnl or AC_LIB_HAVE_LINKFLAGS call.
945 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
946 eval value=\"\$HAVE_LIB$uppername\"
947 if test -n "$value"; then
948 if test "$value" = yes; then
949 eval value=\"\$LIB$uppername\"
950 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
951 eval value=\"\$LTLIB$uppername\"
952 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
953 else
954 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
955 dnl that this library doesn't exist. So just drop it.
956 :
957 fi
958 else
959 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
960 dnl and the already constructed $LIBNAME/$LTLIBNAME.
961 found_dir=
962 found_la=
963 found_so=
964 found_a=
965 if test $use_additional = yes; then
966 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
967 found_dir="$additional_libdir"
968 found_so="$additional_libdir/lib$name.$shlibext"
969 if test -f "$additional_libdir/lib$name.la"; then
970 found_la="$additional_libdir/lib$name.la"
971 fi
972 else
973 if test -f "$additional_libdir/lib$name.$libext"; then
974 found_dir="$additional_libdir"
975 found_a="$additional_libdir/lib$name.$libext"
976 if test -f "$additional_libdir/lib$name.la"; then
977 found_la="$additional_libdir/lib$name.la"
978 fi
979 fi
980 fi
981 fi
982 if test "X$found_dir" = "X"; then
983 for x in $LDFLAGS $LTLIB[]NAME; do
984 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
985 case "$x" in
986 -L*)
987 dir=`echo "X$x" | sed -e 's/^X-L//'`
988 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
989 found_dir="$dir"
990 found_so="$dir/lib$name.$shlibext"
991 if test -f "$dir/lib$name.la"; then
992 found_la="$dir/lib$name.la"
993 fi
994 else
995 if test -f "$dir/lib$name.$libext"; then
996 found_dir="$dir"
997 found_a="$dir/lib$name.$libext"
998 if test -f "$dir/lib$name.la"; then
999 found_la="$dir/lib$name.la"
1000 fi
1001 fi
1002 fi
1003 ;;
1004 esac
1005 if test "X$found_dir" != "X"; then
1006 break
1007 fi
1008 done
1009 fi
1010 if test "X$found_dir" != "X"; then
1011 dnl Found the library.
1012 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1013 if test "X$found_so" != "X"; then
1014 dnl Linking with a shared library. We attempt to hardcode its
1015 dnl directory into the executable's runpath, unless it's the
1016 dnl standard /usr/lib.
1017 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1018 dnl No hardcoding is needed.
1019 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1020 else
1021 dnl Use an explicit option to hardcode DIR into the resulting
1022 dnl binary.
1023 dnl Potentially add DIR to ltrpathdirs.
1024 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1025 haveit=
1026 for x in $ltrpathdirs; do
1027 if test "X$x" = "X$found_dir"; then
1028 haveit=yes
1029 break
1030 fi
1031 done
1032 if test -z "$haveit"; then
1033 ltrpathdirs="$ltrpathdirs $found_dir"
1034 fi
1035 dnl The hardcoding into $LIBNAME is system dependent.
1036 if test "$hardcode_direct" = yes; then
1037 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1038 dnl resulting binary.
1039 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1040 else
1041 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1042 dnl Use an explicit option to hardcode DIR into the resulting
1043 dnl binary.
1044 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1045 dnl Potentially add DIR to rpathdirs.
1046 dnl The rpathdirs will be appended to $LIBNAME at the end.
1047 haveit=
1048 for x in $rpathdirs; do
1049 if test "X$x" = "X$found_dir"; then
1050 haveit=yes
1051 break
1052 fi
1053 done
1054 if test -z "$haveit"; then
1055 rpathdirs="$rpathdirs $found_dir"
1056 fi
1057 else
1058 dnl Rely on "-L$found_dir".
1059 dnl But don't add it if it's already contained in the LDFLAGS
1060 dnl or the already constructed $LIBNAME
1061 haveit=
1062 for x in $LDFLAGS $LIB[]NAME; do
1063 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1064 if test "X$x" = "X-L$found_dir"; then
1065 haveit=yes
1066 break
1067 fi
1068 done
1069 if test -z "$haveit"; then
1070 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1071 fi
1072 if test "$hardcode_minus_L" != no; then
1073 dnl FIXME: Not sure whether we should use
1074 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1075 dnl here.
1076 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1077 else
1078 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1079 dnl here, because this doesn't fit in flags passed to the
1080 dnl compiler. So give up. No hardcoding. This affects only
1081 dnl very old systems.
1082 dnl FIXME: Not sure whether we should use
1083 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1084 dnl here.
1085 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1086 fi
1087 fi
1088 fi
1089 fi
1090 else
1091 if test "X$found_a" != "X"; then
1092 dnl Linking with a static library.
1093 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1094 else
1095 dnl We shouldn't come here, but anyway it's good to have a
1096 dnl fallback.
1097 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1098 fi
1099 fi
1100 dnl Assume the include files are nearby.
1101 additional_includedir=
1102 case "$found_dir" in
1103 */lib | */lib/)
1104 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1105 additional_includedir="$basedir/include"
1106 ;;
1107 esac
1108 if test "X$additional_includedir" != "X"; then
1109 dnl Potentially add $additional_includedir to $INCNAME.
1110 dnl But don't add it
1111 dnl 1. if it's the standard /usr/include,
1112 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1113 dnl 3. if it's already present in $CPPFLAGS or the already
1114 dnl constructed $INCNAME,
1115 dnl 4. if it doesn't exist as a directory.
1116 if test "X$additional_includedir" != "X/usr/include"; then
1117 haveit=
1118 if test "X$additional_includedir" = "X/usr/local/include"; then
1119 if test -n "$GCC"; then
1120 case $host_os in
1121 linux*) haveit=yes;;
1122 esac
1123 fi
1124 fi
1125 if test -z "$haveit"; then
1126 for x in $CPPFLAGS $INC[]NAME; do
1127 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1128 if test "X$x" = "X-I$additional_includedir"; then
1129 haveit=yes
1130 break
1131 fi
1132 done
1133 if test -z "$haveit"; then
1134 if test -d "$additional_includedir"; then
1135 dnl Really add $additional_includedir to $INCNAME.
1136 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1137 fi
1138 fi
1139 fi
1140 fi
1141 fi
1142 dnl Look for dependencies.
1143 if test -n "$found_la"; then
1144 dnl Read the .la file. It defines the variables
1145 dnl dlname, library_names, old_library, dependency_libs, current,
1146 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1147 save_libdir="$libdir"
1148 case "$found_la" in
1149 */* | *\\*) . "$found_la" ;;
1150 *) . "./$found_la" ;;
1151 esac
1152 libdir="$save_libdir"
1153 dnl We use only dependency_libs.
1154 for dep in $dependency_libs; do
1155 case "$dep" in
1156 -L*)
1157 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1158 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1159 dnl But don't add it
1160 dnl 1. if it's the standard /usr/lib,
1161 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1162 dnl 3. if it's already present in $LDFLAGS or the already
1163 dnl constructed $LIBNAME,
1164 dnl 4. if it doesn't exist as a directory.
1165 if test "X$additional_libdir" != "X/usr/lib"; then
1166 haveit=
1167 if test "X$additional_libdir" = "X/usr/local/lib"; then
1168 if test -n "$GCC"; then
1169 case $host_os in
1170 linux*) haveit=yes;;
1171 esac
1172 fi
1173 fi
1174 if test -z "$haveit"; then
1175 haveit=
1176 for x in $LDFLAGS $LIB[]NAME; do
1177 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1178 if test "X$x" = "X-L$additional_libdir"; then
1179 haveit=yes
1180 break
1181 fi
1182 done
1183 if test -z "$haveit"; then
1184 if test -d "$additional_libdir"; then
1185 dnl Really add $additional_libdir to $LIBNAME.
1186 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1187 fi
1188 fi
1189 haveit=
1190 for x in $LDFLAGS $LTLIB[]NAME; do
1191 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1192 if test "X$x" = "X-L$additional_libdir"; then
1193 haveit=yes
1194 break
1195 fi
1196 done
1197 if test -z "$haveit"; then
1198 if test -d "$additional_libdir"; then
1199 dnl Really add $additional_libdir to $LTLIBNAME.
1200 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1201 fi
1202 fi
1203 fi
1204 fi
1205 ;;
1206 -R*)
1207 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1208 if test "$enable_rpath" != no; then
1209 dnl Potentially add DIR to rpathdirs.
1210 dnl The rpathdirs will be appended to $LIBNAME at the end.
1211 haveit=
1212 for x in $rpathdirs; do
1213 if test "X$x" = "X$dir"; then
1214 haveit=yes
1215 break
1216 fi
1217 done
1218 if test -z "$haveit"; then
1219 rpathdirs="$rpathdirs $dir"
1220 fi
1221 dnl Potentially add DIR to ltrpathdirs.
1222 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1223 haveit=
1224 for x in $ltrpathdirs; do
1225 if test "X$x" = "X$dir"; then
1226 haveit=yes
1227 break
1228 fi
1229 done
1230 if test -z "$haveit"; then
1231 ltrpathdirs="$ltrpathdirs $dir"
1232 fi
1233 fi
1234 ;;
1235 -l*)
1236 dnl Handle this in the next round.
1237 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1238 ;;
1239 *.la)
1240 dnl Handle this in the next round. Throw away the .la's
1241 dnl directory; it is already contained in a preceding -L
1242 dnl option.
1243 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1244 ;;
1245 *)
1246 dnl Most likely an immediate library name.
1247 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1248 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1249 ;;
1250 esac
1251 done
1252 fi
1253 else
1254 dnl Didn't find the library; assume it is in the system directories
1255 dnl known to the linker and runtime loader. (All the system
1256 dnl directories known to the linker should also be known to the
1257 dnl runtime loader, otherwise the system is severely misconfigured.)
1258 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1259 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1260 fi
1261 fi
1262 fi
1263 done
1264 done
1265 if test "X$rpathdirs" != "X"; then
1266 if test -n "$hardcode_libdir_separator"; then
1267 dnl Weird platform: only the last -rpath option counts, the user must
1268 dnl pass all path elements in one option. We can arrange that for a
1269 dnl single library, but not when more than one $LIBNAMEs are used.
1270 alldirs=
1271 for found_dir in $rpathdirs; do
1272 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1273 done
1274 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1275 acl_save_libdir="$libdir"
1276 libdir="$alldirs"
1277 eval flag=\"$hardcode_libdir_flag_spec\"
1278 libdir="$acl_save_libdir"
1279 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1280 else
1281 dnl The -rpath options are cumulative.
1282 for found_dir in $rpathdirs; do
1283 acl_save_libdir="$libdir"
1284 libdir="$found_dir"
1285 eval flag=\"$hardcode_libdir_flag_spec\"
1286 libdir="$acl_save_libdir"
1287 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1288 done
1289 fi
1290 fi
1291 if test "X$ltrpathdirs" != "X"; then
1292 dnl When using libtool, the option that works for both libraries and
1293 dnl executables is -R. The -R options are cumulative.
1294 for found_dir in $ltrpathdirs; do
1295 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1296 done
1297 fi
1298 ])
1299
1300 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1301 dnl unless already present in VAR.
1302 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1303 dnl contains two or three consecutive elements that belong together.
1304 AC_DEFUN([AC_LIB_APPENDTOVAR],
1305 [
1306 for element in [$2]; do
1307 haveit=
1308 for x in $[$1]; do
1309 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1310 if test "X$x" = "X$element"; then
1311 haveit=yes
1312 break
1313 fi
1314 done
1315 if test -z "$haveit"; then
1316 [$1]="${[$1]}${[$1]:+ }$element"
1317 fi
1318 done
1319 ])
1320
1321 # lib-prefix.m4 serial 2 (gettext-0.12)
1322 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1323 dnl This file is free software, distributed under the terms of the GNU
1324 dnl General Public License. As a special exception to the GNU General
1325 dnl Public License, this file may be distributed as part of a program
1326 dnl that contains a configuration script generated by Autoconf, under
1327 dnl the same distribution terms as the rest of that program.
1328
1329 dnl From Bruno Haible.
1330
1331 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1332 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1333 dnl require excessive bracketing.
1334 ifdef([AC_HELP_STRING],
1335 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1336 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1337
1338 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1339 dnl to access previously installed libraries. The basic assumption is that
1340 dnl a user will want packages to use other packages he previously installed
1341 dnl with the same --prefix option.
1342 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1343 dnl libraries, but is otherwise very convenient.
1344 AC_DEFUN([AC_LIB_PREFIX],
1345 [
1346 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1347 AC_REQUIRE([AC_PROG_CC])
1348 AC_REQUIRE([AC_CANONICAL_HOST])
1349 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1350 dnl By default, look in $includedir and $libdir.
1351 use_additional=yes
1352 AC_LIB_WITH_FINAL_PREFIX([
1353 eval additional_includedir=\"$includedir\"
1354 eval additional_libdir=\"$libdir\"
1355 ])
1356 AC_LIB_ARG_WITH([lib-prefix],
1357 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1358 --without-lib-prefix don't search for libraries in includedir and libdir],
1359 [
1360 if test "X$withval" = "Xno"; then
1361 use_additional=no
1362 else
1363 if test "X$withval" = "X"; then
1364 AC_LIB_WITH_FINAL_PREFIX([
1365 eval additional_includedir=\"$includedir\"
1366 eval additional_libdir=\"$libdir\"
1367 ])
1368 else
1369 additional_includedir="$withval/include"
1370 additional_libdir="$withval/lib"
1371 fi
1372 fi
1373 ])
1374 if test $use_additional = yes; then
1375 dnl Potentially add $additional_includedir to $CPPFLAGS.
1376 dnl But don't add it
1377 dnl 1. if it's the standard /usr/include,
1378 dnl 2. if it's already present in $CPPFLAGS,
1379 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1380 dnl 4. if it doesn't exist as a directory.
1381 if test "X$additional_includedir" != "X/usr/include"; then
1382 haveit=
1383 for x in $CPPFLAGS; do
1384 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1385 if test "X$x" = "X-I$additional_includedir"; then
1386 haveit=yes
1387 break
1388 fi
1389 done
1390 if test -z "$haveit"; then
1391 if test "X$additional_includedir" = "X/usr/local/include"; then
1392 if test -n "$GCC"; then
1393 case $host_os in
1394 linux*) haveit=yes;;
1395 esac
1396 fi
1397 fi
1398 if test -z "$haveit"; then
1399 if test -d "$additional_includedir"; then
1400 dnl Really add $additional_includedir to $CPPFLAGS.
1401 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1402 fi
1403 fi
1404 fi
1405 fi
1406 dnl Potentially add $additional_libdir to $LDFLAGS.
1407 dnl But don't add it
1408 dnl 1. if it's the standard /usr/lib,
1409 dnl 2. if it's already present in $LDFLAGS,
1410 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1411 dnl 4. if it doesn't exist as a directory.
1412 if test "X$additional_libdir" != "X/usr/lib"; then
1413 haveit=
1414 for x in $LDFLAGS; do
1415 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1416 if test "X$x" = "X-L$additional_libdir"; then
1417 haveit=yes
1418 break
1419 fi
1420 done
1421 if test -z "$haveit"; then
1422 if test "X$additional_libdir" = "X/usr/local/lib"; then
1423 if test -n "$GCC"; then
1424 case $host_os in
1425 linux*) haveit=yes;;
1426 esac
1427 fi
1428 fi
1429 if test -z "$haveit"; then
1430 if test -d "$additional_libdir"; then
1431 dnl Really add $additional_libdir to $LDFLAGS.
1432 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1433 fi
1434 fi
1435 fi
1436 fi
1437 fi
1438 ])
1439
1440 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1441 dnl acl_final_exec_prefix, containing the values to which $prefix and
1442 dnl $exec_prefix will expand at the end of the configure script.
1443 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1444 [
1445 dnl Unfortunately, prefix and exec_prefix get only finally determined
1446 dnl at the end of configure.
1447 if test "X$prefix" = "XNONE"; then
1448 acl_final_prefix="$ac_default_prefix"
1449 else
1450 acl_final_prefix="$prefix"
1451 fi
1452 if test "X$exec_prefix" = "XNONE"; then
1453 acl_final_exec_prefix='${prefix}'
1454 else
1455 acl_final_exec_prefix="$exec_prefix"
1456 fi
1457 acl_save_prefix="$prefix"
1458 prefix="$acl_final_prefix"
1459 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1460 prefix="$acl_save_prefix"
1461 ])
1462
1463 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1464 dnl variables prefix and exec_prefix bound to the values they will have
1465 dnl at the end of the configure script.
1466 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1467 [
1468 acl_save_prefix="$prefix"
1469 prefix="$acl_final_prefix"
1470 acl_save_exec_prefix="$exec_prefix"
1471 exec_prefix="$acl_final_exec_prefix"
1472 $1
1473 exec_prefix="$acl_save_exec_prefix"
1474 prefix="$acl_save_prefix"
1475 ])
1476
1477 # lib-ld.m4 serial 2 (gettext-0.12)
1478 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1479 dnl This file is free software, distributed under the terms of the GNU
1480 dnl General Public License. As a special exception to the GNU General
1481 dnl Public License, this file may be distributed as part of a program
1482 dnl that contains a configuration script generated by Autoconf, under
1483 dnl the same distribution terms as the rest of that program.
1484
1485 dnl Subroutines of libtool.m4,
1486 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1487 dnl with libtool.m4.
1488
1489 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1490 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1491 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1492 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1493 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1494 acl_cv_prog_gnu_ld=yes
1495 else
1496 acl_cv_prog_gnu_ld=no
1497 fi])
1498 with_gnu_ld=$acl_cv_prog_gnu_ld
1499 ])
1500
1501 dnl From libtool-1.4. Sets the variable LD.
1502 AC_DEFUN([AC_LIB_PROG_LD],
1503 [AC_ARG_WITH(gnu-ld,
1504 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1505 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1506 AC_REQUIRE([AC_PROG_CC])dnl
1507 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1508 # Prepare PATH_SEPARATOR.
1509 # The user is always right.
1510 if test "${PATH_SEPARATOR+set}" != set; then
1511 echo "#! /bin/sh" >conf$$.sh
1512 echo "exit 0" >>conf$$.sh
1513 chmod +x conf$$.sh
1514 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1515 PATH_SEPARATOR=';'
1516 else
1517 PATH_SEPARATOR=:
1518 fi
1519 rm -f conf$$.sh
1520 fi
1521 ac_prog=ld
1522 if test "$GCC" = yes; then
1523 # Check if gcc -print-prog-name=ld gives a path.
1524 AC_MSG_CHECKING([for ld used by GCC])
1525 case $host in
1526 *-*-mingw*)
1527 # gcc leaves a trailing carriage return which upsets mingw
1528 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1529 *)
1530 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1531 esac
1532 case $ac_prog in
1533 # Accept absolute paths.
1534 [[\\/]* | [A-Za-z]:[\\/]*)]
1535 [re_direlt='/[^/][^/]*/\.\./']
1536 # Canonicalize the path of ld
1537 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1538 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1539 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1540 done
1541 test -z "$LD" && LD="$ac_prog"
1542 ;;
1543 "")
1544 # If it fails, then pretend we aren't using GCC.
1545 ac_prog=ld
1546 ;;
1547 *)
1548 # If it is relative, then search for the first ld in PATH.
1549 with_gnu_ld=unknown
1550 ;;
1551 esac
1552 elif test "$with_gnu_ld" = yes; then
1553 AC_MSG_CHECKING([for GNU ld])
1554 else
1555 AC_MSG_CHECKING([for non-GNU ld])
1556 fi
1557 AC_CACHE_VAL(acl_cv_path_LD,
1558 [if test -z "$LD"; then
1559 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1560 for ac_dir in $PATH; do
1561 test -z "$ac_dir" && ac_dir=.
1562 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1563 acl_cv_path_LD="$ac_dir/$ac_prog"
1564 # Check to see if the program is GNU ld. I'd rather use --version,
1565 # but apparently some GNU ld's only accept -v.
1566 # Break only if it was the GNU/non-GNU ld that we prefer.
1567 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1568 test "$with_gnu_ld" != no && break
1569 else
1570 test "$with_gnu_ld" != yes && break
1571 fi
1572 fi
1573 done
1574 IFS="$ac_save_ifs"
1575 else
1576 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1577 fi])
1578 LD="$acl_cv_path_LD"
1579 if test -n "$LD"; then
1580 AC_MSG_RESULT($LD)
1581 else
1582 AC_MSG_RESULT(no)
1583 fi
1584 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1585 AC_LIB_PROG_LD_GNU
1586 ])
1587
1588 # iconv.m4 serial AM4 (gettext-0.11.3)
1589 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1590 dnl This file is free software, distributed under the terms of the GNU
1591 dnl General Public License. As a special exception to the GNU General
1592 dnl Public License, this file may be distributed as part of a program
1593 dnl that contains a configuration script generated by Autoconf, under
1594 dnl the same distribution terms as the rest of that program.
1595
1596 dnl From Bruno Haible.
1597
1598 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1599 [
1600 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1601 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1602 AC_REQUIRE([AC_LIB_RPATH])
1603
1604 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1605 dnl accordingly.
1606 AC_LIB_LINKFLAGS_BODY([iconv])
1607 ])
1608
1609 AC_DEFUN([AM_ICONV_LINK],
1610 [
1611 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1612 dnl those with the standalone portable GNU libiconv installed).
1613
1614 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1615 dnl accordingly.
1616 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1617
1618 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1619 dnl because if the user has installed libiconv and not disabled its use
1620 dnl via --without-libiconv-prefix, he wants to use it. The first
1621 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
1622 am_save_CPPFLAGS="$CPPFLAGS"
1623 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1624
1625 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1626 am_cv_func_iconv="no, consider installing GNU libiconv"
1627 am_cv_lib_iconv=no
1628 AC_TRY_LINK([#include <stdlib.h>
1629 #include <iconv.h>],
1630 [iconv_t cd = iconv_open("","");
1631 iconv(cd,NULL,NULL,NULL,NULL);
1632 iconv_close(cd);],
1633 am_cv_func_iconv=yes)
1634 if test "$am_cv_func_iconv" != yes; then
1635 am_save_LIBS="$LIBS"
1636 LIBS="$LIBS $LIBICONV"
1637 AC_TRY_LINK([#include <stdlib.h>
1638 #include <iconv.h>],
1639 [iconv_t cd = iconv_open("","");
1640 iconv(cd,NULL,NULL,NULL,NULL);
1641 iconv_close(cd);],
1642 am_cv_lib_iconv=yes
1643 am_cv_func_iconv=yes)
1644 LIBS="$am_save_LIBS"
1645 fi
1646 ])
1647 if test "$am_cv_func_iconv" = yes; then
1648 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1649 fi
1650 if test "$am_cv_lib_iconv" = yes; then
1651 AC_MSG_CHECKING([how to link with libiconv])
1652 AC_MSG_RESULT([$LIBICONV])
1653 else
1654 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1655 dnl either.
1656 CPPFLAGS="$am_save_CPPFLAGS"
1657 LIBICONV=
1658 LTLIBICONV=
1659 fi
1660 AC_SUBST(LIBICONV)
1661 AC_SUBST(LTLIBICONV)
1662 ])
1663
1664 AC_DEFUN([AM_ICONV],
1665 [
1666 AM_ICONV_LINK
1667 if test "$am_cv_func_iconv" = yes; then
1668 AC_MSG_CHECKING([for iconv declaration])
1669 AC_CACHE_VAL(am_cv_proto_iconv, [
1670 AC_TRY_COMPILE([
1671 #include <stdlib.h>
1672 #include <iconv.h>
1673 extern
1674 #ifdef __cplusplus
1675 "C"
1676 #endif
1677 #if defined(__STDC__) || defined(__cplusplus)
1678 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1679 #else
1680 size_t iconv();
1681 #endif
1682 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1683 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);"])
1684 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1685 AC_MSG_RESULT([$]{ac_t:-
1686 }[$]am_cv_proto_iconv)
1687 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1688 [Define as const if the declaration of iconv() needs const.])
1689 fi
1690 ])
1691
1692 # isc-posix.m4 serial 2 (gettext-0.11.2)
1693 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1694 dnl This file is free software, distributed under the terms of the GNU
1695 dnl General Public License. As a special exception to the GNU General
1696 dnl Public License, this file may be distributed as part of a program
1697 dnl that contains a configuration script generated by Autoconf, under
1698 dnl the same distribution terms as the rest of that program.
1699
1700 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1701
1702 # This test replaces the one in autoconf.
1703 # Currently this macro should have the same name as the autoconf macro
1704 # because gettext's gettext.m4 (distributed in the automake package)
1705 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1706 # give these diagnostics:
1707 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1708 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1709
1710 undefine([AC_ISC_POSIX])
1711
1712 AC_DEFUN([AC_ISC_POSIX],
1713 [
1714 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1715 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1716 ]
1717 )
1718
1719 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
1720 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1721 dnl This file is free software, distributed under the terms of the GNU
1722 dnl General Public License. As a special exception to the GNU General
1723 dnl Public License, this file may be distributed as part of a program
1724 dnl that contains a configuration script generated by Autoconf, under
1725 dnl the same distribution terms as the rest of that program.
1726
1727 # Test for the GNU C Library, version 2.1 or newer.
1728 # From Bruno Haible.
1729
1730 AC_DEFUN([jm_GLIBC21],
1731 [
1732 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1733 ac_cv_gnu_library_2_1,
1734 [AC_EGREP_CPP([Lucky GNU user],
1735 [
1736 #include <features.h>
1737 #ifdef __GNU_LIBRARY__
1738 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1739 Lucky GNU user
1740 #endif
1741 #endif
1742 ],
1743 ac_cv_gnu_library_2_1=yes,
1744 ac_cv_gnu_library_2_1=no)
1745 ]
1746 )
1747 AC_SUBST(GLIBC21)
1748 GLIBC21="$ac_cv_gnu_library_2_1"
1749 ]
1750 )
1751
1752 # intdiv0.m4 serial 1 (gettext-0.11.3)
1753 dnl Copyright (C) 2002 Free Software Foundation, Inc.
1754 dnl This file is free software, distributed under the terms of the GNU
1755 dnl General Public License. As a special exception to the GNU General
1756 dnl Public License, this file may be distributed as part of a program
1757 dnl that contains a configuration script generated by Autoconf, under
1758 dnl the same distribution terms as the rest of that program.
1759
1760 dnl From Bruno Haible.
1761
1762 AC_DEFUN([gt_INTDIV0],
1763 [
1764 AC_REQUIRE([AC_PROG_CC])dnl
1765 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1766
1767 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
1768 gt_cv_int_divbyzero_sigfpe,
1769 [
1770 AC_TRY_RUN([
1771 #include <stdlib.h>
1772 #include <signal.h>
1773
1774 static void
1775 #ifdef __cplusplus
1776 sigfpe_handler (int sig)
1777 #else
1778 sigfpe_handler (sig) int sig;
1779 #endif
1780 {
1781 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
1782 exit (sig != SIGFPE);
1783 }
1784
1785 int x = 1;
1786 int y = 0;
1787 int z;
1788 int nan;
1789
1790 int main ()
1791 {
1792 signal (SIGFPE, sigfpe_handler);
1793 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
1794 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
1795 signal (SIGTRAP, sigfpe_handler);
1796 #endif
1797 /* Linux/SPARC yields signal SIGILL. */
1798 #if defined (__sparc__) && defined (__linux__)
1799 signal (SIGILL, sigfpe_handler);
1800 #endif
1801
1802 z = x / y;
1803 nan = y / y;
1804 exit (1);
1805 }
1806 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
1807 [
1808 # Guess based on the CPU.
1809 case "$host_cpu" in
1810 alpha* | i[34567]86 | m68k | s390*)
1811 gt_cv_int_divbyzero_sigfpe="guessing yes";;
1812 *)
1813 gt_cv_int_divbyzero_sigfpe="guessing no";;
1814 esac
1815 ])
1816 ])
1817 case "$gt_cv_int_divbyzero_sigfpe" in
1818 *yes) value=1;;
1819 *) value=0;;
1820 esac
1821 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
1822 [Define if integer division by zero raises signal SIGFPE.])
1823 ])
1824
1825 # uintmax_t.m4 serial 7 (gettext-0.12)
1826 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1827 dnl This file is free software, distributed under the terms of the GNU
1828 dnl General Public License. As a special exception to the GNU General
1829 dnl Public License, this file may be distributed as part of a program
1830 dnl that contains a configuration script generated by Autoconf, under
1831 dnl the same distribution terms as the rest of that program.
1832
1833 dnl From Paul Eggert.
1834
1835 AC_PREREQ(2.13)
1836
1837 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
1838 # if it is not already defined in <stdint.h> or <inttypes.h>.
1839
1840 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
1841 [
1842 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
1843 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
1844 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
1845 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1846 test $ac_cv_type_unsigned_long_long = yes \
1847 && ac_type='unsigned long long' \
1848 || ac_type='unsigned long'
1849 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
1850 [Define to unsigned long or unsigned long long
1851 if <stdint.h> and <inttypes.h> don't define.])
1852 else
1853 AC_DEFINE(HAVE_UINTMAX_T, 1,
1854 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
1855 fi
1856 ])
1857
1858 # inttypes_h.m4 serial 5 (gettext-0.12)
1859 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1860 dnl This file is free software, distributed under the terms of the GNU
1861 dnl General Public License. As a special exception to the GNU General
1862 dnl Public License, this file may be distributed as part of a program
1863 dnl that contains a configuration script generated by Autoconf, under
1864 dnl the same distribution terms as the rest of that program.
1865
1866 dnl From Paul Eggert.
1867
1868 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1869 # doesn't clash with <sys/types.h>, and declares uintmax_t.
1870
1871 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
1872 [
1873 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
1874 [AC_TRY_COMPILE(
1875 [#include <sys/types.h>
1876 #include <inttypes.h>],
1877 [uintmax_t i = (uintmax_t) -1;],
1878 jm_ac_cv_header_inttypes_h=yes,
1879 jm_ac_cv_header_inttypes_h=no)])
1880 if test $jm_ac_cv_header_inttypes_h = yes; then
1881 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1882 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1883 and declares uintmax_t. ])
1884 fi
1885 ])
1886
1887 # stdint_h.m4 serial 3 (gettext-0.12)
1888 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
1889 dnl This file is free software, distributed under the terms of the GNU
1890 dnl General Public License. As a special exception to the GNU General
1891 dnl Public License, this file may be distributed as part of a program
1892 dnl that contains a configuration script generated by Autoconf, under
1893 dnl the same distribution terms as the rest of that program.
1894
1895 dnl From Paul Eggert.
1896
1897 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
1898 # doesn't clash with <sys/types.h>, and declares uintmax_t.
1899
1900 AC_DEFUN([jm_AC_HEADER_STDINT_H],
1901 [
1902 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
1903 [AC_TRY_COMPILE(
1904 [#include <sys/types.h>
1905 #include <stdint.h>],
1906 [uintmax_t i = (uintmax_t) -1;],
1907 jm_ac_cv_header_stdint_h=yes,
1908 jm_ac_cv_header_stdint_h=no)])
1909 if test $jm_ac_cv_header_stdint_h = yes; then
1910 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
1911 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
1912 and declares uintmax_t. ])
1913 fi
1914 ])
1915
1916 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
1917 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
1918 dnl This file is free software, distributed under the terms of the GNU
1919 dnl General Public License. As a special exception to the GNU General
1920 dnl Public License, this file may be distributed as part of a program
1921 dnl that contains a configuration script generated by Autoconf, under
1922 dnl the same distribution terms as the rest of that program.
1923
1924 dnl From Paul Eggert.
1925
1926 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
1927 [
1928 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
1929 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
1930 [unsigned long long ullmax = (unsigned long long) -1;
1931 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
1932 ac_cv_type_unsigned_long_long=yes,
1933 ac_cv_type_unsigned_long_long=no)])
1934 if test $ac_cv_type_unsigned_long_long = yes; then
1935 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
1936 [Define if you have the unsigned long long type.])
1937 fi
1938 ])
1939
1940 # inttypes.m4 serial 1 (gettext-0.11.4)
1941 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1942 dnl This file is free software, distributed under the terms of the GNU
1943 dnl General Public License. As a special exception to the GNU General
1944 dnl Public License, this file may be distributed as part of a program
1945 dnl that contains a configuration script generated by Autoconf, under
1946 dnl the same distribution terms as the rest of that program.
1947
1948 dnl From Paul Eggert.
1949
1950 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
1951 # <sys/types.h>.
1952
1953 AC_DEFUN([gt_HEADER_INTTYPES_H],
1954 [
1955 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
1956 [
1957 AC_TRY_COMPILE(
1958 [#include <sys/types.h>
1959 #include <inttypes.h>],
1960 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
1961 ])
1962 if test $gt_cv_header_inttypes_h = yes; then
1963 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
1964 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
1965 fi
1966 ])
1967
1968 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
1969 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1970 dnl This file is free software, distributed under the terms of the GNU
1971 dnl General Public License. As a special exception to the GNU General
1972 dnl Public License, this file may be distributed as part of a program
1973 dnl that contains a configuration script generated by Autoconf, under
1974 dnl the same distribution terms as the rest of that program.
1975
1976 dnl From Bruno Haible.
1977
1978 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1979 # macros to non-string values. This is the case on AIX 4.3.3.
1980
1981 AC_DEFUN([gt_INTTYPES_PRI],
1982 [
1983 AC_REQUIRE([gt_HEADER_INTTYPES_H])
1984 if test $gt_cv_header_inttypes_h = yes; then
1985 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1986 gt_cv_inttypes_pri_broken,
1987 [
1988 AC_TRY_COMPILE([#include <inttypes.h>
1989 #ifdef PRId32
1990 char *p = PRId32;
1991 #endif
1992 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1993 ])
1994 fi
1995 if test "$gt_cv_inttypes_pri_broken" = yes; then
1996 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1997 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1998 fi
1999 ])
2000
2001 # codeset.m4 serial AM1 (gettext-0.10.40)
2002 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2003 dnl This file is free software, distributed under the terms of the GNU
2004 dnl General Public License. As a special exception to the GNU General
2005 dnl Public License, this file may be distributed as part of a program
2006 dnl that contains a configuration script generated by Autoconf, under
2007 dnl the same distribution terms as the rest of that program.
2008
2009 dnl From Bruno Haible.
2010
2011 AC_DEFUN([AM_LANGINFO_CODESET],
2012 [
2013 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2014 [AC_TRY_LINK([#include <langinfo.h>],
2015 [char* cs = nl_langinfo(CODESET);],
2016 am_cv_langinfo_codeset=yes,
2017 am_cv_langinfo_codeset=no)
2018 ])
2019 if test $am_cv_langinfo_codeset = yes; then
2020 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2021 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2022 fi
2023 ])
2024
2025 # lcmessage.m4 serial 3 (gettext-0.11.3)
2026 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2027 dnl This file is free software, distributed under the terms of the GNU
2028 dnl General Public License. As a special exception to the GNU General
2029 dnl Public License, this file may be distributed as part of a program
2030 dnl that contains a configuration script generated by Autoconf, under
2031 dnl the same distribution terms as the rest of that program.
2032 dnl
2033 dnl This file can can be used in projects which are not available under
2034 dnl the GNU General Public License or the GNU Library General Public
2035 dnl License but which still want to provide support for the GNU gettext
2036 dnl functionality.
2037 dnl Please note that the actual code of the GNU gettext library is covered
2038 dnl by the GNU Library General Public License, and the rest of the GNU
2039 dnl gettext package package is covered by the GNU General Public License.
2040 dnl They are *not* in the public domain.
2041
2042 dnl Authors:
2043 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2044
2045 # Check whether LC_MESSAGES is available in <locale.h>.
2046
2047 AC_DEFUN([AM_LC_MESSAGES],
2048 [
2049 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2050 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2051 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2052 if test $am_cv_val_LC_MESSAGES = yes; then
2053 AC_DEFINE(HAVE_LC_MESSAGES, 1,
2054 [Define if your <locale.h> file defines LC_MESSAGES.])
2055 fi
2056 ])
2057