1 # generated automatically by aclocal 1.9.2 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # codeset.m4 serial AM1 (gettext-0.10.40)
15 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
16 dnl This file is free software, distributed under the terms of the GNU
17 dnl General Public License. As a special exception to the GNU General
18 dnl Public License, this file may be distributed as part of a program
19 dnl that contains a configuration script generated by Autoconf, under
20 dnl the same distribution terms as the rest of that program.
22 dnl From Bruno Haible.
24 AC_DEFUN([AM_LANGINFO_CODESET],
26 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
27 [AC_TRY_LINK([#include <langinfo.h>],
28 [char* cs = nl_langinfo(CODESET);],
29 am_cv_langinfo_codeset=yes,
30 am_cv_langinfo_codeset=no)
32 if test $am_cv_langinfo_codeset = yes; then
33 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
34 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
38 # gettext.m4 serial 28 (gettext-0.13)
39 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
40 dnl This file is free software, distributed under the terms of the GNU
41 dnl General Public License. As a special exception to the GNU General
42 dnl Public License, this file may be distributed as part of a program
43 dnl that contains a configuration script generated by Autoconf, under
44 dnl the same distribution terms as the rest of that program.
46 dnl This file can can be used in projects which are not available under
47 dnl the GNU General Public License or the GNU Library General Public
48 dnl License but which still want to provide support for the GNU gettext
50 dnl Please note that the actual code of the GNU gettext library is covered
51 dnl by the GNU Library General Public License, and the rest of the GNU
52 dnl gettext package package is covered by the GNU General Public License.
53 dnl They are *not* in the public domain.
56 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
57 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
59 dnl Macro to add for using GNU gettext.
61 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
62 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
63 dnl default (if it is not specified or empty) is 'no-libtool'.
64 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
65 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
66 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
67 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
68 dnl depending on --{enable,disable}-{shared,static} and on the presence of
69 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
70 dnl $(top_builddir)/intl/libintl.a will be created.
71 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
72 dnl implementations (in libc or libintl) without the ngettext() function
73 dnl will be ignored. If NEEDSYMBOL is specified and is
74 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
75 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
76 dnl INTLDIR is used to find the intl libraries. If empty,
77 dnl the value `$(top_builddir)/intl/' is used.
79 dnl The result of the configuration is one of three cases:
80 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
82 dnl Catalog format: GNU --> install in $(datadir)
83 dnl Catalog extension: .mo after installation, .gmo in source tree
84 dnl 2) GNU gettext has been found in the system's C library.
85 dnl Catalog format: GNU --> install in $(datadir)
86 dnl Catalog extension: .mo after installation, .gmo in source tree
87 dnl 3) No internationalization, always use English msgid.
88 dnl Catalog format: none
89 dnl Catalog extension: none
90 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
91 dnl The use of .gmo is historical (it was needed to avoid overwriting the
92 dnl GNU format catalogs when building on a platform with an X/Open gettext),
93 dnl but we keep it in order not to force irrelevant filename changes on the
96 AC_DEFUN([AM_GNU_GETTEXT],
98 dnl Argument checking.
99 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
100 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
102 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
103 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
105 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
106 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
108 AC_REQUIRE([AM_PO_SUBDIRS])dnl
109 ifelse(gt_included_intl, yes, [
110 AC_REQUIRE([AM_INTL_SUBDIR])dnl
113 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
114 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
115 AC_REQUIRE([AC_LIB_RPATH])
117 dnl Sometimes libintl requires libiconv, so first search for libiconv.
118 dnl Ideally we would do this search only after the
119 dnl if test "$USE_NLS" = "yes"; then
120 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
121 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
122 dnl the configure script would need to contain the same shell code
123 dnl again, outside any 'if'. There are two solutions:
124 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
125 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
126 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
127 dnl documented, we avoid it.
128 ifelse(gt_included_intl, yes, , [
129 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
135 ifelse(gt_included_intl, yes, [
136 BUILD_INCLUDED_LIBINTL=no
137 USE_INCLUDED_LIBINTL=no
143 dnl If we use NLS figure out what method
144 if test "$USE_NLS" = "yes"; then
145 gt_use_preinstalled_gnugettext=no
146 ifelse(gt_included_intl, yes, [
147 AC_MSG_CHECKING([whether included gettext is requested])
148 AC_ARG_WITH(included-gettext,
149 [ --with-included-gettext use the GNU gettext library included here],
150 nls_cv_force_use_gnu_gettext=$withval,
151 nls_cv_force_use_gnu_gettext=no)
152 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
154 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
155 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
157 dnl User does not insist on using GNU NLS library. Figure out what
158 dnl to use. If GNU gettext is available we use this. Else we have
159 dnl to fall back to GNU NLS library.
161 dnl Add a version number to the cache macros.
162 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
163 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
164 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
166 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
167 [AC_TRY_LINK([#include <libintl.h>
168 ]ifelse([$2], [need-formatstring-macros],
169 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
170 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
173 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
175 ], [])[extern int _nl_msg_cat_cntr;
176 extern int *_nl_domain_bindings;],
177 [bindtextdomain ("", "");
178 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
179 gt_cv_func_gnugettext_libc=yes,
180 gt_cv_func_gnugettext_libc=no)])
182 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
183 dnl Sometimes libintl requires libiconv, so first search for libiconv.
184 ifelse(gt_included_intl, yes, , [
187 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
188 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
189 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
190 dnl even if libiconv doesn't exist.
191 AC_LIB_LINKFLAGS_BODY([intl])
192 AC_CACHE_CHECK([for GNU gettext in libintl],
193 gt_cv_func_gnugettext_libintl,
194 [gt_save_CPPFLAGS="$CPPFLAGS"
195 CPPFLAGS="$CPPFLAGS $INCINTL"
197 LIBS="$LIBS $LIBINTL"
198 dnl Now see whether libintl exists and does not depend on libiconv.
199 AC_TRY_LINK([#include <libintl.h>
200 ]ifelse([$2], [need-formatstring-macros],
201 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
202 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
205 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
207 ], [])[extern int _nl_msg_cat_cntr;
212 const char *_nl_expand_alias ();],
213 [bindtextdomain ("", "");
214 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
215 gt_cv_func_gnugettext_libintl=yes,
216 gt_cv_func_gnugettext_libintl=no)
217 dnl Now see whether libintl exists and depends on libiconv.
218 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
219 LIBS="$LIBS $LIBICONV"
220 AC_TRY_LINK([#include <libintl.h>
221 ]ifelse([$2], [need-formatstring-macros],
222 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
223 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
226 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
228 ], [])[extern int _nl_msg_cat_cntr;
233 const char *_nl_expand_alias ();],
234 [bindtextdomain ("", "");
235 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
236 [LIBINTL="$LIBINTL $LIBICONV"
237 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
238 gt_cv_func_gnugettext_libintl=yes
241 CPPFLAGS="$gt_save_CPPFLAGS"
242 LIBS="$gt_save_LIBS"])
245 dnl If an already present or preinstalled GNU gettext() is found,
246 dnl use it. But if this macro is used in GNU gettext, and GNU
247 dnl gettext is already preinstalled in libintl, we update this
248 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
249 if test "$gt_cv_func_gnugettext_libc" = "yes" \
250 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
251 && test "$PACKAGE" != gettext-runtime \
252 && test "$PACKAGE" != gettext-tools; }; then
253 gt_use_preinstalled_gnugettext=yes
255 dnl Reset the values set by searching for libintl.
261 ifelse(gt_included_intl, yes, [
262 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
263 dnl GNU gettext is not found in the C library.
264 dnl Fall back on included GNU gettext library.
265 nls_cv_use_gnu_gettext=yes
269 if test "$nls_cv_use_gnu_gettext" = "yes"; then
270 dnl Mark actions used to generate GNU NLS library.
271 BUILD_INCLUDED_LIBINTL=yes
272 USE_INCLUDED_LIBINTL=yes
273 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
274 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
275 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
278 if test "$gt_use_preinstalled_gnugettext" = "yes" \
279 || test "$nls_cv_use_gnu_gettext" = "yes"; then
280 dnl Mark actions to use GNU gettext tools.
285 if test "$gt_use_preinstalled_gnugettext" = "yes" \
286 || test "$nls_cv_use_gnu_gettext" = "yes"; then
287 AC_DEFINE(ENABLE_NLS, 1,
288 [Define to 1 if translation of program messages to the user's native language
295 AC_MSG_CHECKING([whether to use NLS])
296 AC_MSG_RESULT([$USE_NLS])
297 if test "$USE_NLS" = "yes"; then
298 AC_MSG_CHECKING([where the gettext function comes from])
299 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
300 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
301 gt_source="external libintl"
306 gt_source="included intl directory"
308 AC_MSG_RESULT([$gt_source])
311 if test "$USE_NLS" = "yes"; then
313 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
314 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
315 AC_MSG_CHECKING([how to link with libintl])
316 AC_MSG_RESULT([$LIBINTL])
317 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
320 dnl For backward compatibility. Some packages may be using this.
321 AC_DEFINE(HAVE_GETTEXT, 1,
322 [Define if the GNU gettext() function is already present or preinstalled.])
323 AC_DEFINE(HAVE_DCGETTEXT, 1,
324 [Define if the GNU dcgettext() function is already present or preinstalled.])
327 dnl We need to process the po/ directory.
331 ifelse(gt_included_intl, yes, [
332 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
333 dnl to 'yes' because some of the testsuite requires it.
334 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
335 BUILD_INCLUDED_LIBINTL=yes
338 dnl Make all variables we use known to autoconf.
339 AC_SUBST(BUILD_INCLUDED_LIBINTL)
340 AC_SUBST(USE_INCLUDED_LIBINTL)
343 dnl For backward compatibility. Some configure.ins may be using this.
347 dnl For backward compatibility. Some Makefiles may be using this.
349 AC_SUBST(DATADIRNAME)
351 dnl For backward compatibility. Some Makefiles may be using this.
355 dnl For backward compatibility. Some Makefiles may be using this.
359 dnl For backward compatibility. Some Makefiles may be using this.
360 if test "$USE_INCLUDED_LIBINTL" = yes; then
361 INTLOBJS="\$(GETTOBJS)"
365 dnl Enable libtool support if the surrounding package wishes it.
366 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
367 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
370 dnl For backward compatibility. Some Makefiles may be using this.
374 dnl Make all documented variables known to autoconf.
381 dnl Checks for all prerequisites of the intl subdirectory,
382 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
383 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
384 AC_DEFUN([AM_INTL_SUBDIR],
386 AC_REQUIRE([AC_PROG_INSTALL])dnl
387 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
388 AC_REQUIRE([AC_PROG_CC])dnl
389 AC_REQUIRE([AC_CANONICAL_HOST])dnl
390 AC_REQUIRE([AC_PROG_RANLIB])dnl
391 AC_REQUIRE([AC_ISC_POSIX])dnl
392 AC_REQUIRE([AC_HEADER_STDC])dnl
393 AC_REQUIRE([AC_C_CONST])dnl
394 AC_REQUIRE([bh_C_SIGNED])dnl
395 AC_REQUIRE([AC_C_INLINE])dnl
396 AC_REQUIRE([AC_TYPE_OFF_T])dnl
397 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
398 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
399 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
400 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
401 AC_REQUIRE([gt_TYPE_WINT_T])dnl
402 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
403 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
404 AC_REQUIRE([gt_TYPE_INTMAX_T])
405 AC_REQUIRE([gt_PRINTF_POSIX])
406 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
407 AC_REQUIRE([AC_FUNC_MMAP])dnl
408 AC_REQUIRE([jm_GLIBC21])dnl
409 AC_REQUIRE([gt_INTDIV0])dnl
410 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
411 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
412 AC_REQUIRE([gt_INTTYPES_PRI])dnl
413 AC_REQUIRE([gl_XSIZE])dnl
415 AC_CHECK_TYPE([ptrdiff_t], ,
416 [AC_DEFINE([ptrdiff_t], [long],
417 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
419 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
420 stdlib.h string.h unistd.h sys/param.h])
421 AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
422 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
423 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
426 dnl Use the _snprintf function only if it is declared (because on NetBSD it
427 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
428 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
429 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
431 dnl Use the *_unlocked functions only if they are declared.
432 dnl (because some of them were defined without being declared in Solaris
433 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
434 dnl on Solaris 2.5.1 to run on Solaris 2.6).
435 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
436 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
437 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
438 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
440 case $gt_cv_func_printf_posix in
441 *yes) HAVE_POSIX_PRINTF=1 ;;
442 *) HAVE_POSIX_PRINTF=0 ;;
444 AC_SUBST([HAVE_POSIX_PRINTF])
445 if test "$ac_cv_func_asprintf" = yes; then
450 AC_SUBST([HAVE_ASPRINTF])
451 if test "$ac_cv_func_snprintf" = yes; then
456 AC_SUBST([HAVE_SNPRINTF])
457 if test "$ac_cv_func_wprintf" = yes; then
462 AC_SUBST([HAVE_WPRINTF])
466 if test $ac_cv_header_locale_h = yes; then
470 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
471 dnl because plural.y uses bison specific features. It requires at least
472 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
474 dnl bison is only needed for the maintainer (who touches plural.y). But in
475 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
476 dnl the rule in general Makefile. Now, some people carelessly touch the
477 dnl files or have a broken "make" program, hence the plural.c rule will
478 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
479 dnl present or too old.
480 AC_CHECK_PROGS([INTLBISON], [bison])
481 if test -z "$INTLBISON"; then
484 dnl Found it, now check the version.
485 AC_MSG_CHECKING([version of bison])
486 changequote(<<,>>)dnl
487 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
488 case $ac_prog_version in
489 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
490 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
492 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
493 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
495 AC_MSG_RESULT([$ac_prog_version])
497 if test $ac_verc_fail = yes; then
503 dnl gt_CHECK_DECL(FUNC, INCLUDES)
504 dnl Check whether a function is declared.
505 AC_DEFUN([gt_CHECK_DECL],
507 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
508 [AC_TRY_COMPILE([$2], [
510 char *p = (char *) $1;
512 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
513 if test $ac_cv_have_decl_$1 = yes; then
518 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
519 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
523 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
524 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
526 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
527 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
528 dnl This file is free software, distributed under the terms of the GNU
529 dnl General Public License. As a special exception to the GNU General
530 dnl Public License, this file may be distributed as part of a program
531 dnl that contains a configuration script generated by Autoconf, under
532 dnl the same distribution terms as the rest of that program.
534 # Test for the GNU C Library, version 2.1 or newer.
537 AC_DEFUN([jm_GLIBC21],
539 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
540 ac_cv_gnu_library_2_1,
541 [AC_EGREP_CPP([Lucky GNU user],
543 #include <features.h>
544 #ifdef __GNU_LIBRARY__
545 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
550 ac_cv_gnu_library_2_1=yes,
551 ac_cv_gnu_library_2_1=no)
555 GLIBC21="$ac_cv_gnu_library_2_1"
559 # iconv.m4 serial AM4 (gettext-0.11.3)
560 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
561 dnl This file is free software, distributed under the terms of the GNU
562 dnl General Public License. As a special exception to the GNU General
563 dnl Public License, this file may be distributed as part of a program
564 dnl that contains a configuration script generated by Autoconf, under
565 dnl the same distribution terms as the rest of that program.
567 dnl From Bruno Haible.
569 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
571 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
572 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
573 AC_REQUIRE([AC_LIB_RPATH])
575 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
577 AC_LIB_LINKFLAGS_BODY([iconv])
580 AC_DEFUN([AM_ICONV_LINK],
582 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
583 dnl those with the standalone portable GNU libiconv installed).
585 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
587 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
589 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
590 dnl because if the user has installed libiconv and not disabled its use
591 dnl via --without-libiconv-prefix, he wants to use it. The first
592 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
593 am_save_CPPFLAGS="$CPPFLAGS"
594 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
596 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
597 am_cv_func_iconv="no, consider installing GNU libiconv"
599 AC_TRY_LINK([#include <stdlib.h>
601 [iconv_t cd = iconv_open("","");
602 iconv(cd,NULL,NULL,NULL,NULL);
604 am_cv_func_iconv=yes)
605 if test "$am_cv_func_iconv" != yes; then
607 LIBS="$LIBS $LIBICONV"
608 AC_TRY_LINK([#include <stdlib.h>
610 [iconv_t cd = iconv_open("","");
611 iconv(cd,NULL,NULL,NULL,NULL);
614 am_cv_func_iconv=yes)
618 if test "$am_cv_func_iconv" = yes; then
619 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
621 if test "$am_cv_lib_iconv" = yes; then
622 AC_MSG_CHECKING([how to link with libiconv])
623 AC_MSG_RESULT([$LIBICONV])
625 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
627 CPPFLAGS="$am_save_CPPFLAGS"
638 if test "$am_cv_func_iconv" = yes; then
639 AC_MSG_CHECKING([for iconv declaration])
640 AC_CACHE_VAL(am_cv_proto_iconv, [
648 #if defined(__STDC__) || defined(__cplusplus)
649 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
653 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
654 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);"])
655 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
656 AC_MSG_RESULT([$]{ac_t:-
657 }[$]am_cv_proto_iconv)
658 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
659 [Define as const if the declaration of iconv() needs const.])
663 # intdiv0.m4 serial 1 (gettext-0.11.3)
664 dnl Copyright (C) 2002 Free Software Foundation, Inc.
665 dnl This file is free software, distributed under the terms of the GNU
666 dnl General Public License. As a special exception to the GNU General
667 dnl Public License, this file may be distributed as part of a program
668 dnl that contains a configuration script generated by Autoconf, under
669 dnl the same distribution terms as the rest of that program.
671 dnl From Bruno Haible.
673 AC_DEFUN([gt_INTDIV0],
675 AC_REQUIRE([AC_PROG_CC])dnl
676 AC_REQUIRE([AC_CANONICAL_HOST])dnl
678 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
679 gt_cv_int_divbyzero_sigfpe,
687 sigfpe_handler (int sig)
689 sigfpe_handler (sig) int sig;
692 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
693 exit (sig != SIGFPE);
703 signal (SIGFPE, sigfpe_handler);
704 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
705 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
706 signal (SIGTRAP, sigfpe_handler);
708 /* Linux/SPARC yields signal SIGILL. */
709 #if defined (__sparc__) && defined (__linux__)
710 signal (SIGILL, sigfpe_handler);
717 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
719 # Guess based on the CPU.
721 alpha* | i[34567]86 | m68k | s390*)
722 gt_cv_int_divbyzero_sigfpe="guessing yes";;
724 gt_cv_int_divbyzero_sigfpe="guessing no";;
728 case "$gt_cv_int_divbyzero_sigfpe" in
732 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
733 [Define if integer division by zero raises signal SIGFPE.])
736 # intmax.m4 serial 1 (gettext-0.12)
737 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
738 dnl This file is free software, distributed under the terms of the GNU
739 dnl General Public License. As a special exception to the GNU General
740 dnl Public License, this file may be distributed as part of a program
741 dnl that contains a configuration script generated by Autoconf, under
742 dnl the same distribution terms as the rest of that program.
744 dnl From Bruno Haible.
745 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
746 dnl find a replacement if it is lacking.
748 AC_DEFUN([gt_TYPE_INTMAX_T],
750 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
751 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
752 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
756 #if HAVE_STDINT_H_WITH_UINTMAX
759 #if HAVE_INTTYPES_H_WITH_UINTMAX
760 #include <inttypes.h>
762 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
763 if test $gt_cv_c_intmax_t = yes; then
764 AC_DEFINE(HAVE_INTMAX_T, 1,
765 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
769 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
770 dnl Copyright (C) 1997-2002 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.
777 dnl From Bruno Haible.
779 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
780 # macros to non-string values. This is the case on AIX 4.3.3.
782 AC_DEFUN([gt_INTTYPES_PRI],
784 AC_REQUIRE([gt_HEADER_INTTYPES_H])
785 if test $gt_cv_header_inttypes_h = yes; then
786 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
787 gt_cv_inttypes_pri_broken,
789 AC_TRY_COMPILE([#include <inttypes.h>
793 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
796 if test "$gt_cv_inttypes_pri_broken" = yes; then
797 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
798 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
802 # inttypes.m4 serial 1 (gettext-0.11.4)
803 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
804 dnl This file is free software, distributed under the terms of the GNU
805 dnl General Public License. As a special exception to the GNU General
806 dnl Public License, this file may be distributed as part of a program
807 dnl that contains a configuration script generated by Autoconf, under
808 dnl the same distribution terms as the rest of that program.
810 dnl From Paul Eggert.
812 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
815 AC_DEFUN([gt_HEADER_INTTYPES_H],
817 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
820 [#include <sys/types.h>
821 #include <inttypes.h>],
822 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
824 if test $gt_cv_header_inttypes_h = yes; then
825 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
826 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
830 # inttypes_h.m4 serial 5 (gettext-0.12)
831 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
832 dnl This file is free software, distributed under the terms of the GNU
833 dnl General Public License. As a special exception to the GNU General
834 dnl Public License, this file may be distributed as part of a program
835 dnl that contains a configuration script generated by Autoconf, under
836 dnl the same distribution terms as the rest of that program.
838 dnl From Paul Eggert.
840 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
841 # doesn't clash with <sys/types.h>, and declares uintmax_t.
843 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
845 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
847 [#include <sys/types.h>
848 #include <inttypes.h>],
849 [uintmax_t i = (uintmax_t) -1;],
850 jm_ac_cv_header_inttypes_h=yes,
851 jm_ac_cv_header_inttypes_h=no)])
852 if test $jm_ac_cv_header_inttypes_h = yes; then
853 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
854 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
855 and declares uintmax_t. ])
859 # lcmessage.m4 serial 3 (gettext-0.11.3)
860 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
861 dnl This file is free software, distributed under the terms of the GNU
862 dnl General Public License. As a special exception to the GNU General
863 dnl Public License, this file may be distributed as part of a program
864 dnl that contains a configuration script generated by Autoconf, under
865 dnl the same distribution terms as the rest of that program.
867 dnl This file can can be used in projects which are not available under
868 dnl the GNU General Public License or the GNU Library General Public
869 dnl License but which still want to provide support for the GNU gettext
871 dnl Please note that the actual code of the GNU gettext library is covered
872 dnl by the GNU Library General Public License, and the rest of the GNU
873 dnl gettext package package is covered by the GNU General Public License.
874 dnl They are *not* in the public domain.
877 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
879 # Check whether LC_MESSAGES is available in <locale.h>.
881 AC_DEFUN([AM_LC_MESSAGES],
883 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
884 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
885 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
886 if test $am_cv_val_LC_MESSAGES = yes; then
887 AC_DEFINE(HAVE_LC_MESSAGES, 1,
888 [Define if your <locale.h> file defines LC_MESSAGES.])
892 # lib-ld.m4 serial 3 (gettext-0.13)
893 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
894 dnl This file is free software, distributed under the terms of the GNU
895 dnl General Public License. As a special exception to the GNU General
896 dnl Public License, this file may be distributed as part of a program
897 dnl that contains a configuration script generated by Autoconf, under
898 dnl the same distribution terms as the rest of that program.
900 dnl Subroutines of libtool.m4,
901 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
904 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
905 AC_DEFUN([AC_LIB_PROG_LD_GNU],
906 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
907 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
908 case `$LD -v 2>&1 </dev/null` in
909 *GNU* | *'with BFD'*)
910 acl_cv_prog_gnu_ld=yes ;;
912 acl_cv_prog_gnu_ld=no ;;
914 with_gnu_ld=$acl_cv_prog_gnu_ld
917 dnl From libtool-1.4. Sets the variable LD.
918 AC_DEFUN([AC_LIB_PROG_LD],
920 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
921 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
922 AC_REQUIRE([AC_PROG_CC])dnl
923 AC_REQUIRE([AC_CANONICAL_HOST])dnl
924 # Prepare PATH_SEPARATOR.
925 # The user is always right.
926 if test "${PATH_SEPARATOR+set}" != set; then
927 echo "#! /bin/sh" >conf$$.sh
928 echo "exit 0" >>conf$$.sh
930 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
938 if test "$GCC" = yes; then
939 # Check if gcc -print-prog-name=ld gives a path.
940 AC_MSG_CHECKING([for ld used by GCC])
943 # gcc leaves a trailing carriage return which upsets mingw
944 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
946 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
949 # Accept absolute paths.
950 [[\\/]* | [A-Za-z]:[\\/]*)]
951 [re_direlt='/[^/][^/]*/\.\./']
952 # Canonicalize the path of ld
953 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
954 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
955 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
957 test -z "$LD" && LD="$ac_prog"
960 # If it fails, then pretend we aren't using GCC.
964 # If it is relative, then search for the first ld in PATH.
968 elif test "$with_gnu_ld" = yes; then
969 AC_MSG_CHECKING([for GNU ld])
971 AC_MSG_CHECKING([for non-GNU ld])
973 AC_CACHE_VAL(acl_cv_path_LD,
974 [if test -z "$LD"; then
975 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
976 for ac_dir in $PATH; do
977 test -z "$ac_dir" && ac_dir=.
978 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
979 acl_cv_path_LD="$ac_dir/$ac_prog"
980 # Check to see if the program is GNU ld. I'd rather use --version,
981 # but apparently some GNU ld's only accept -v.
982 # Break only if it was the GNU/non-GNU ld that we prefer.
983 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
984 *GNU* | *'with BFD'*)
985 test "$with_gnu_ld" != no && break ;;
987 test "$with_gnu_ld" != yes && break ;;
993 acl_cv_path_LD="$LD" # Let the user override the test with a path.
996 if test -n "$LD"; then
1001 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1005 # lib-link.m4 serial 4 (gettext-0.12)
1006 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1007 dnl This file is free software, distributed under the terms of the GNU
1008 dnl General Public License. As a special exception to the GNU General
1009 dnl Public License, this file may be distributed as part of a program
1010 dnl that contains a configuration script generated by Autoconf, under
1011 dnl the same distribution terms as the rest of that program.
1013 dnl From Bruno Haible.
1015 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1016 dnl the libraries corresponding to explicit and implicit dependencies.
1017 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1018 dnl augments the CPPFLAGS variable.
1019 AC_DEFUN([AC_LIB_LINKFLAGS],
1021 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1022 AC_REQUIRE([AC_LIB_RPATH])
1023 define([Name],[translit([$1],[./-], [___])])
1024 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1025 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1026 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1027 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1028 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1029 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1030 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1032 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1033 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1034 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1035 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1037 AC_SUBST([LTLIB]NAME)
1038 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1039 dnl results of this search when this library appears as a dependency.
1045 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1046 dnl searches for libname and the libraries corresponding to explicit and
1047 dnl implicit dependencies, together with the specified include files and
1048 dnl the ability to compile and link the specified testcode. If found, it
1049 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1050 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1051 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1052 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1053 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1055 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1056 AC_REQUIRE([AC_LIB_RPATH])
1057 define([Name],[translit([$1],[./-], [___])])
1058 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1059 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1061 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1063 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1065 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1066 dnl because if the user has installed lib[]Name and not disabled its use
1067 dnl via --without-lib[]Name-prefix, he wants to use it.
1068 ac_save_CPPFLAGS="$CPPFLAGS"
1069 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1071 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1072 ac_save_LIBS="$LIBS"
1073 LIBS="$LIBS $LIB[]NAME"
1074 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1075 LIBS="$ac_save_LIBS"
1077 if test "$ac_cv_lib[]Name" = yes; then
1079 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1080 AC_MSG_CHECKING([how to link with lib[]$1])
1081 AC_MSG_RESULT([$LIB[]NAME])
1084 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1085 dnl $INC[]NAME either.
1086 CPPFLAGS="$ac_save_CPPFLAGS"
1090 AC_SUBST([HAVE_LIB]NAME)
1092 AC_SUBST([LTLIB]NAME)
1097 dnl Determine the platform dependent parameters needed to use rpath:
1098 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1099 dnl hardcode_direct, hardcode_minus_L.
1100 AC_DEFUN([AC_LIB_RPATH],
1102 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1103 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1104 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1105 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1106 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1107 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1108 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1114 libext="$acl_cv_libext"
1115 shlibext="$acl_cv_shlibext"
1116 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1117 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1118 hardcode_direct="$acl_cv_hardcode_direct"
1119 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1120 dnl Determine whether the user wants rpath handling at all.
1121 AC_ARG_ENABLE(rpath,
1122 [ --disable-rpath do not hardcode runtime library paths],
1123 :, enable_rpath=yes)
1126 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1127 dnl the libraries corresponding to explicit and implicit dependencies.
1128 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1129 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1131 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1132 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1133 dnl By default, look in $includedir and $libdir.
1135 AC_LIB_WITH_FINAL_PREFIX([
1136 eval additional_includedir=\"$includedir\"
1137 eval additional_libdir=\"$libdir\"
1139 AC_LIB_ARG_WITH([lib$1-prefix],
1140 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1141 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1143 if test "X$withval" = "Xno"; then
1146 if test "X$withval" = "X"; then
1147 AC_LIB_WITH_FINAL_PREFIX([
1148 eval additional_includedir=\"$includedir\"
1149 eval additional_libdir=\"$libdir\"
1152 additional_includedir="$withval/include"
1153 additional_libdir="$withval/lib"
1157 dnl Search the library and its dependencies in $additional_libdir and
1158 dnl $LDFLAGS. Using breadth-first-seach.
1164 names_already_handled=
1165 names_next_round='$1 $2'
1166 while test -n "$names_next_round"; do
1167 names_this_round="$names_next_round"
1169 for name in $names_this_round; do
1171 for n in $names_already_handled; do
1172 if test "$n" = "$name"; then
1177 if test -z "$already_handled"; then
1178 names_already_handled="$names_already_handled $name"
1179 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1180 dnl or AC_LIB_HAVE_LINKFLAGS call.
1181 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1182 eval value=\"\$HAVE_LIB$uppername\"
1183 if test -n "$value"; then
1184 if test "$value" = yes; then
1185 eval value=\"\$LIB$uppername\"
1186 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1187 eval value=\"\$LTLIB$uppername\"
1188 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1190 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1191 dnl that this library doesn't exist. So just drop it.
1195 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1196 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1201 if test $use_additional = yes; then
1202 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1203 found_dir="$additional_libdir"
1204 found_so="$additional_libdir/lib$name.$shlibext"
1205 if test -f "$additional_libdir/lib$name.la"; then
1206 found_la="$additional_libdir/lib$name.la"
1209 if test -f "$additional_libdir/lib$name.$libext"; then
1210 found_dir="$additional_libdir"
1211 found_a="$additional_libdir/lib$name.$libext"
1212 if test -f "$additional_libdir/lib$name.la"; then
1213 found_la="$additional_libdir/lib$name.la"
1218 if test "X$found_dir" = "X"; then
1219 for x in $LDFLAGS $LTLIB[]NAME; do
1220 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1223 dir=`echo "X$x" | sed -e 's/^X-L//'`
1224 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1226 found_so="$dir/lib$name.$shlibext"
1227 if test -f "$dir/lib$name.la"; then
1228 found_la="$dir/lib$name.la"
1231 if test -f "$dir/lib$name.$libext"; then
1233 found_a="$dir/lib$name.$libext"
1234 if test -f "$dir/lib$name.la"; then
1235 found_la="$dir/lib$name.la"
1241 if test "X$found_dir" != "X"; then
1246 if test "X$found_dir" != "X"; then
1247 dnl Found the library.
1248 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1249 if test "X$found_so" != "X"; then
1250 dnl Linking with a shared library. We attempt to hardcode its
1251 dnl directory into the executable's runpath, unless it's the
1252 dnl standard /usr/lib.
1253 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1254 dnl No hardcoding is needed.
1255 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1257 dnl Use an explicit option to hardcode DIR into the resulting
1259 dnl Potentially add DIR to ltrpathdirs.
1260 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1262 for x in $ltrpathdirs; do
1263 if test "X$x" = "X$found_dir"; then
1268 if test -z "$haveit"; then
1269 ltrpathdirs="$ltrpathdirs $found_dir"
1271 dnl The hardcoding into $LIBNAME is system dependent.
1272 if test "$hardcode_direct" = yes; then
1273 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1274 dnl resulting binary.
1275 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1277 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1278 dnl Use an explicit option to hardcode DIR into the resulting
1280 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1281 dnl Potentially add DIR to rpathdirs.
1282 dnl The rpathdirs will be appended to $LIBNAME at the end.
1284 for x in $rpathdirs; do
1285 if test "X$x" = "X$found_dir"; then
1290 if test -z "$haveit"; then
1291 rpathdirs="$rpathdirs $found_dir"
1294 dnl Rely on "-L$found_dir".
1295 dnl But don't add it if it's already contained in the LDFLAGS
1296 dnl or the already constructed $LIBNAME
1298 for x in $LDFLAGS $LIB[]NAME; do
1299 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1300 if test "X$x" = "X-L$found_dir"; then
1305 if test -z "$haveit"; then
1306 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1308 if test "$hardcode_minus_L" != no; then
1309 dnl FIXME: Not sure whether we should use
1310 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1312 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1314 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1315 dnl here, because this doesn't fit in flags passed to the
1316 dnl compiler. So give up. No hardcoding. This affects only
1317 dnl very old systems.
1318 dnl FIXME: Not sure whether we should use
1319 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1321 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1327 if test "X$found_a" != "X"; then
1328 dnl Linking with a static library.
1329 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1331 dnl We shouldn't come here, but anyway it's good to have a
1333 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1336 dnl Assume the include files are nearby.
1337 additional_includedir=
1338 case "$found_dir" in
1340 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1341 additional_includedir="$basedir/include"
1344 if test "X$additional_includedir" != "X"; then
1345 dnl Potentially add $additional_includedir to $INCNAME.
1346 dnl But don't add it
1347 dnl 1. if it's the standard /usr/include,
1348 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1349 dnl 3. if it's already present in $CPPFLAGS or the already
1350 dnl constructed $INCNAME,
1351 dnl 4. if it doesn't exist as a directory.
1352 if test "X$additional_includedir" != "X/usr/include"; then
1354 if test "X$additional_includedir" = "X/usr/local/include"; then
1355 if test -n "$GCC"; then
1357 linux*) haveit=yes;;
1361 if test -z "$haveit"; then
1362 for x in $CPPFLAGS $INC[]NAME; do
1363 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1364 if test "X$x" = "X-I$additional_includedir"; then
1369 if test -z "$haveit"; then
1370 if test -d "$additional_includedir"; then
1371 dnl Really add $additional_includedir to $INCNAME.
1372 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1378 dnl Look for dependencies.
1379 if test -n "$found_la"; then
1380 dnl Read the .la file. It defines the variables
1381 dnl dlname, library_names, old_library, dependency_libs, current,
1382 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1383 save_libdir="$libdir"
1385 */* | *\\*) . "$found_la" ;;
1386 *) . "./$found_la" ;;
1388 libdir="$save_libdir"
1389 dnl We use only dependency_libs.
1390 for dep in $dependency_libs; do
1393 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1394 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1395 dnl But don't add it
1396 dnl 1. if it's the standard /usr/lib,
1397 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1398 dnl 3. if it's already present in $LDFLAGS or the already
1399 dnl constructed $LIBNAME,
1400 dnl 4. if it doesn't exist as a directory.
1401 if test "X$additional_libdir" != "X/usr/lib"; then
1403 if test "X$additional_libdir" = "X/usr/local/lib"; then
1404 if test -n "$GCC"; then
1406 linux*) haveit=yes;;
1410 if test -z "$haveit"; then
1412 for x in $LDFLAGS $LIB[]NAME; do
1413 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1414 if test "X$x" = "X-L$additional_libdir"; then
1419 if test -z "$haveit"; then
1420 if test -d "$additional_libdir"; then
1421 dnl Really add $additional_libdir to $LIBNAME.
1422 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1426 for x in $LDFLAGS $LTLIB[]NAME; do
1427 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1428 if test "X$x" = "X-L$additional_libdir"; then
1433 if test -z "$haveit"; then
1434 if test -d "$additional_libdir"; then
1435 dnl Really add $additional_libdir to $LTLIBNAME.
1436 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1443 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1444 if test "$enable_rpath" != no; then
1445 dnl Potentially add DIR to rpathdirs.
1446 dnl The rpathdirs will be appended to $LIBNAME at the end.
1448 for x in $rpathdirs; do
1449 if test "X$x" = "X$dir"; then
1454 if test -z "$haveit"; then
1455 rpathdirs="$rpathdirs $dir"
1457 dnl Potentially add DIR to ltrpathdirs.
1458 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1460 for x in $ltrpathdirs; do
1461 if test "X$x" = "X$dir"; then
1466 if test -z "$haveit"; then
1467 ltrpathdirs="$ltrpathdirs $dir"
1472 dnl Handle this in the next round.
1473 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1476 dnl Handle this in the next round. Throw away the .la's
1477 dnl directory; it is already contained in a preceding -L
1479 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1482 dnl Most likely an immediate library name.
1483 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1484 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1490 dnl Didn't find the library; assume it is in the system directories
1491 dnl known to the linker and runtime loader. (All the system
1492 dnl directories known to the linker should also be known to the
1493 dnl runtime loader, otherwise the system is severely misconfigured.)
1494 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1495 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1501 if test "X$rpathdirs" != "X"; then
1502 if test -n "$hardcode_libdir_separator"; then
1503 dnl Weird platform: only the last -rpath option counts, the user must
1504 dnl pass all path elements in one option. We can arrange that for a
1505 dnl single library, but not when more than one $LIBNAMEs are used.
1507 for found_dir in $rpathdirs; do
1508 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1510 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1511 acl_save_libdir="$libdir"
1513 eval flag=\"$hardcode_libdir_flag_spec\"
1514 libdir="$acl_save_libdir"
1515 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1517 dnl The -rpath options are cumulative.
1518 for found_dir in $rpathdirs; do
1519 acl_save_libdir="$libdir"
1521 eval flag=\"$hardcode_libdir_flag_spec\"
1522 libdir="$acl_save_libdir"
1523 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1527 if test "X$ltrpathdirs" != "X"; then
1528 dnl When using libtool, the option that works for both libraries and
1529 dnl executables is -R. The -R options are cumulative.
1530 for found_dir in $ltrpathdirs; do
1531 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1536 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1537 dnl unless already present in VAR.
1538 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1539 dnl contains two or three consecutive elements that belong together.
1540 AC_DEFUN([AC_LIB_APPENDTOVAR],
1542 for element in [$2]; do
1545 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1546 if test "X$x" = "X$element"; then
1551 if test -z "$haveit"; then
1552 [$1]="${[$1]}${[$1]:+ }$element"
1557 # lib-prefix.m4 serial 3 (gettext-0.13)
1558 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1559 dnl This file is free software, distributed under the terms of the GNU
1560 dnl General Public License. As a special exception to the GNU General
1561 dnl Public License, this file may be distributed as part of a program
1562 dnl that contains a configuration script generated by Autoconf, under
1563 dnl the same distribution terms as the rest of that program.
1565 dnl From Bruno Haible.
1567 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1568 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1569 dnl require excessive bracketing.
1570 ifdef([AC_HELP_STRING],
1571 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1572 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1574 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1575 dnl to access previously installed libraries. The basic assumption is that
1576 dnl a user will want packages to use other packages he previously installed
1577 dnl with the same --prefix option.
1578 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1579 dnl libraries, but is otherwise very convenient.
1580 AC_DEFUN([AC_LIB_PREFIX],
1582 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1583 AC_REQUIRE([AC_PROG_CC])
1584 AC_REQUIRE([AC_CANONICAL_HOST])
1585 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1586 dnl By default, look in $includedir and $libdir.
1588 AC_LIB_WITH_FINAL_PREFIX([
1589 eval additional_includedir=\"$includedir\"
1590 eval additional_libdir=\"$libdir\"
1592 AC_LIB_ARG_WITH([lib-prefix],
1593 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1594 --without-lib-prefix don't search for libraries in includedir and libdir],
1596 if test "X$withval" = "Xno"; then
1599 if test "X$withval" = "X"; then
1600 AC_LIB_WITH_FINAL_PREFIX([
1601 eval additional_includedir=\"$includedir\"
1602 eval additional_libdir=\"$libdir\"
1605 additional_includedir="$withval/include"
1606 additional_libdir="$withval/lib"
1610 if test $use_additional = yes; then
1611 dnl Potentially add $additional_includedir to $CPPFLAGS.
1612 dnl But don't add it
1613 dnl 1. if it's the standard /usr/include,
1614 dnl 2. if it's already present in $CPPFLAGS,
1615 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1616 dnl 4. if it doesn't exist as a directory.
1617 if test "X$additional_includedir" != "X/usr/include"; then
1619 for x in $CPPFLAGS; do
1620 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1621 if test "X$x" = "X-I$additional_includedir"; then
1626 if test -z "$haveit"; then
1627 if test "X$additional_includedir" = "X/usr/local/include"; then
1628 if test -n "$GCC"; then
1630 linux*) haveit=yes;;
1634 if test -z "$haveit"; then
1635 if test -d "$additional_includedir"; then
1636 dnl Really add $additional_includedir to $CPPFLAGS.
1637 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1642 dnl Potentially add $additional_libdir to $LDFLAGS.
1643 dnl But don't add it
1644 dnl 1. if it's the standard /usr/lib,
1645 dnl 2. if it's already present in $LDFLAGS,
1646 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1647 dnl 4. if it doesn't exist as a directory.
1648 if test "X$additional_libdir" != "X/usr/lib"; then
1650 for x in $LDFLAGS; do
1651 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1652 if test "X$x" = "X-L$additional_libdir"; then
1657 if test -z "$haveit"; then
1658 if test "X$additional_libdir" = "X/usr/local/lib"; then
1659 if test -n "$GCC"; then
1661 linux*) haveit=yes;;
1665 if test -z "$haveit"; then
1666 if test -d "$additional_libdir"; then
1667 dnl Really add $additional_libdir to $LDFLAGS.
1668 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1676 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1677 dnl acl_final_exec_prefix, containing the values to which $prefix and
1678 dnl $exec_prefix will expand at the end of the configure script.
1679 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1681 dnl Unfortunately, prefix and exec_prefix get only finally determined
1682 dnl at the end of configure.
1683 if test "X$prefix" = "XNONE"; then
1684 acl_final_prefix="$ac_default_prefix"
1686 acl_final_prefix="$prefix"
1688 if test "X$exec_prefix" = "XNONE"; then
1689 acl_final_exec_prefix='${prefix}'
1691 acl_final_exec_prefix="$exec_prefix"
1693 acl_save_prefix="$prefix"
1694 prefix="$acl_final_prefix"
1695 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1696 prefix="$acl_save_prefix"
1699 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1700 dnl variables prefix and exec_prefix bound to the values they will have
1701 dnl at the end of the configure script.
1702 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1704 acl_save_prefix="$prefix"
1705 prefix="$acl_final_prefix"
1706 acl_save_exec_prefix="$exec_prefix"
1707 exec_prefix="$acl_final_exec_prefix"
1709 exec_prefix="$acl_save_exec_prefix"
1710 prefix="$acl_save_prefix"
1713 # longdouble.m4 serial 1 (gettext-0.12)
1714 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
1715 dnl This file is free software, distributed under the terms of the GNU
1716 dnl General Public License. As a special exception to the GNU General
1717 dnl Public License, this file may be distributed as part of a program
1718 dnl that contains a configuration script generated by Autoconf, under
1719 dnl the same distribution terms as the rest of that program.
1721 dnl From Bruno Haible.
1722 dnl Test whether the compiler supports the 'long double' type.
1723 dnl Prerequisite: AC_PROG_CC
1725 AC_DEFUN([gt_TYPE_LONGDOUBLE],
1727 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
1728 [if test "$GCC" = yes; then
1729 gt_cv_c_long_double=yes
1732 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
1733 long double foo = 0.0;
1734 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
1735 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
1737 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
1739 if test $gt_cv_c_long_double = yes; then
1740 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
1744 # longlong.m4 serial 4
1745 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
1746 dnl This file is free software, distributed under the terms of the GNU
1747 dnl General Public License. As a special exception to the GNU General
1748 dnl Public License, this file may be distributed as part of a program
1749 dnl that contains a configuration script generated by Autoconf, under
1750 dnl the same distribution terms as the rest of that program.
1752 dnl From Paul Eggert.
1754 # Define HAVE_LONG_LONG if 'long long' works.
1756 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
1758 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1759 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
1760 [long long llmax = (long long) -1;
1761 return ll << i | ll >> i | llmax / ll | llmax % ll;],
1762 ac_cv_type_long_long=yes,
1763 ac_cv_type_long_long=no)])
1764 if test $ac_cv_type_long_long = yes; then
1765 AC_DEFINE(HAVE_LONG_LONG, 1,
1766 [Define if you have the 'long long' type.])
1770 # nls.m4 serial 1 (gettext-0.12)
1771 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1772 dnl This file is free software, distributed under the terms of the GNU
1773 dnl General Public License. As a special exception to the GNU General
1774 dnl Public License, this file may be distributed as part of a program
1775 dnl that contains a configuration script generated by Autoconf, under
1776 dnl the same distribution terms as the rest of that program.
1778 dnl This file can can be used in projects which are not available under
1779 dnl the GNU General Public License or the GNU Library General Public
1780 dnl License but which still want to provide support for the GNU gettext
1782 dnl Please note that the actual code of the GNU gettext library is covered
1783 dnl by the GNU Library General Public License, and the rest of the GNU
1784 dnl gettext package package is covered by the GNU General Public License.
1785 dnl They are *not* in the public domain.
1788 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1789 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1793 AC_MSG_CHECKING([whether NLS is requested])
1794 dnl Default is enabled NLS
1796 [ --disable-nls do not use Native Language Support],
1797 USE_NLS=$enableval, USE_NLS=yes)
1798 AC_MSG_RESULT($USE_NLS)
1802 AC_DEFUN([AM_MKINSTALLDIRS],
1804 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1805 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1806 dnl Try to locate it.
1808 if test -n "$ac_aux_dir"; then
1809 case "$ac_aux_dir" in
1810 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1811 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1814 if test -z "$MKINSTALLDIRS"; then
1815 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1817 AC_SUBST(MKINSTALLDIRS)
1820 # po.m4 serial 3 (gettext-0.14)
1821 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1822 dnl This file is free software, distributed under the terms of the GNU
1823 dnl General Public License. As a special exception to the GNU General
1824 dnl Public License, this file may be distributed as part of a program
1825 dnl that contains a configuration script generated by Autoconf, under
1826 dnl the same distribution terms as the rest of that program.
1828 dnl This file can can be used in projects which are not available under
1829 dnl the GNU General Public License or the GNU Library General Public
1830 dnl License but which still want to provide support for the GNU gettext
1832 dnl Please note that the actual code of the GNU gettext library is covered
1833 dnl by the GNU Library General Public License, and the rest of the GNU
1834 dnl gettext package package is covered by the GNU General Public License.
1835 dnl They are *not* in the public domain.
1838 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1839 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1841 dnl Checks for all prerequisites of the po subdirectory.
1842 AC_DEFUN([AM_PO_SUBDIRS],
1844 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1845 AC_REQUIRE([AC_PROG_INSTALL])dnl
1846 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1847 AC_REQUIRE([AM_NLS])dnl
1849 dnl Perform the following tests also if --disable-nls has been given,
1850 dnl because they are needed for "make dist" to work.
1852 dnl Search for GNU msgfmt in the PATH.
1853 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1854 dnl The second test excludes FreeBSD msgfmt.
1855 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1856 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1857 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1859 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1861 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1862 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1863 dnl The second test excludes FreeBSD xgettext.
1864 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1865 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1866 (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)],
1868 dnl Remove leftover from FreeBSD xgettext call.
1871 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1872 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1873 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1875 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1876 dnl Test whether we really found GNU msgfmt.
1877 if test "$GMSGFMT" != ":"; then
1878 dnl If it is no GNU msgfmt we define it as : so that the
1879 dnl Makefiles still can work.
1880 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1881 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1884 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1886 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1891 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1892 dnl Test whether we really found GNU xgettext.
1893 if test "$XGETTEXT" != ":"; then
1894 dnl If it is no GNU xgettext we define it as : so that the
1895 dnl Makefiles still can work.
1896 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1897 (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
1901 [found xgettext program is not GNU xgettext; ignore it])
1904 dnl Remove leftover from FreeBSD xgettext call.
1908 AC_OUTPUT_COMMANDS([
1909 for ac_file in $CONFIG_FILES; do
1910 # Support "outfile[:infile[:infile...]]"
1912 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1914 # PO directories have a Makefile.in generated from Makefile.in.in.
1915 case "$ac_file" in */Makefile.in)
1916 # Adjust a relative srcdir.
1917 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1918 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1919 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1920 # In autoconf-2.13 it is called $ac_given_srcdir.
1921 # In autoconf-2.50 it is called $srcdir.
1922 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1923 case "$ac_given_srcdir" in
1924 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1925 /*) top_srcdir="$ac_given_srcdir" ;;
1926 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1928 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1929 rm -f "$ac_dir/POTFILES"
1930 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1931 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1932 POMAKEFILEDEPS="POTFILES.in"
1933 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1934 # on $ac_dir but don't depend on user-specified configuration
1936 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1937 # The LINGUAS file contains the set of available languages.
1938 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1939 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1941 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1942 # Hide the ALL_LINGUAS assigment from automake.
1943 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1944 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1946 # The set of available languages was given in configure.in.
1947 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1950 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1951 # Compute UPDATEPOFILES
1952 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1953 # Compute DUMMYPOFILES
1954 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1956 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1957 case "$ac_given_srcdir" in
1959 *) srcdirpre='$(srcdir)/' ;;
1965 for lang in $ALL_LINGUAS; do
1966 POFILES="$POFILES $srcdirpre$lang.po"
1967 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1968 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1969 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1971 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1972 # environment variable.
1974 if test -n "$ALL_LINGUAS"; then
1975 for presentlang in $ALL_LINGUAS; do
1977 if test "%UNSET%" != "$LINGUAS"; then
1978 desiredlanguages="$LINGUAS"
1980 desiredlanguages="$ALL_LINGUAS"
1982 for desiredlang in $desiredlanguages; do
1983 # Use the presentlang catalog if desiredlang is
1984 # a. equal to presentlang, or
1985 # b. a variant of presentlang (because in this case,
1986 # presentlang can be used as a fallback for messages
1987 # which are not translated in the desiredlang catalog).
1988 case "$desiredlang" in
1989 "$presentlang"*) useit=yes;;
1992 if test $useit = yes; then
1993 INST_LINGUAS="$INST_LINGUAS $presentlang"
1998 if test -n "$INST_LINGUAS"; then
1999 for lang in $INST_LINGUAS; do
2000 CATALOGS="$CATALOGS $lang.gmo"
2003 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2004 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"
2005 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2006 if test -f "$f"; then
2008 *.orig | *.bak | *~) ;;
2009 *) cat "$f" >> "$ac_dir/Makefile" ;;
2017 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2018 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2020 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2021 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2022 LINGUAS="${LINGUAS-%UNSET%}"
2026 dnl Postprocesses a Makefile in a directory containing PO files.
2027 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2029 # When this code is run, in config.status, two variables have already been
2031 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2032 # - LINGUAS is the value of the environment variable LINGUAS at configure
2036 # Adjust a relative srcdir.
2037 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2038 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2039 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2040 # In autoconf-2.13 it is called $ac_given_srcdir.
2041 # In autoconf-2.50 it is called $srcdir.
2042 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2043 case "$ac_given_srcdir" in
2044 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2045 /*) top_srcdir="$ac_given_srcdir" ;;
2046 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2049 # Find a way to echo strings without interpreting backslash.
2050 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2053 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2054 gt_echo='printf %s\n'
2065 # A sed script that extracts the value of VARIABLE from a Makefile.
2067 # Test if the hold space is empty.
2072 # Yes it was empty. Look if we have the expected variable definition.
2073 /^[ ]*VARIABLE[ ]*=/{
2074 # Seen the first line of the variable definition.
2075 s/^[ ]*VARIABLE[ ]*=//
2080 # Here we are processing a line from the variable definition.
2081 # Remove comment, more precisely replace it with a space.
2083 # See if the line ends in a backslash.
2087 # Print the line, without the trailing backslash.
2090 # There was no trailing backslash. The end of the variable definition is
2091 # reached. Clear the hold space.
2096 # A trailing backslash means that the variable definition continues in the
2097 # next line. Put a nonempty string into the hold space to indicate this.
2104 # Set POTFILES to the value of the Makefile variable POTFILES.
2105 sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2106 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2107 # Compute POTFILES_DEPS as
2108 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2110 for file in $POTFILES; do
2111 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2115 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2116 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2118 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2119 # The LINGUAS file contains the set of available languages.
2120 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2121 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2123 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2124 sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2125 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2127 # Hide the ALL_LINGUAS assigment from automake.
2128 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2130 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2131 # Compute UPDATEPOFILES
2132 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2133 # Compute DUMMYPOFILES
2134 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2136 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2137 # Compute PROPERTIESFILES
2138 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2139 # Compute CLASSFILES
2140 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2142 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2144 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2145 # Compute RESOURCESDLLFILES
2146 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2147 case "$ac_given_srcdir" in
2149 *) srcdirpre='$(srcdir)/' ;;
2160 for lang in $ALL_LINGUAS; do
2161 POFILES="$POFILES $srcdirpre$lang.po"
2162 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2163 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2164 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2165 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2166 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2167 QMFILES="$QMFILES $srcdirpre$lang.qm"
2168 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2169 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2170 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2171 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2173 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2174 # environment variable.
2176 if test -n "$ALL_LINGUAS"; then
2177 for presentlang in $ALL_LINGUAS; do
2179 if test "%UNSET%" != "$LINGUAS"; then
2180 desiredlanguages="$LINGUAS"
2182 desiredlanguages="$ALL_LINGUAS"
2184 for desiredlang in $desiredlanguages; do
2185 # Use the presentlang catalog if desiredlang is
2186 # a. equal to presentlang, or
2187 # b. a variant of presentlang (because in this case,
2188 # presentlang can be used as a fallback for messages
2189 # which are not translated in the desiredlang catalog).
2190 case "$desiredlang" in
2191 "$presentlang"*) useit=yes;;
2194 if test $useit = yes; then
2195 INST_LINGUAS="$INST_LINGUAS $presentlang"
2204 if test -n "$INST_LINGUAS"; then
2205 for lang in $INST_LINGUAS; do
2206 CATALOGS="$CATALOGS $lang.gmo"
2207 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2208 QTCATALOGS="$QTCATALOGS $lang.qm"
2209 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2210 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2211 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2212 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2216 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"
2217 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2218 # Add dependencies that cannot be formulated as a simple suffix rule.
2219 for lang in $ALL_LINGUAS; do
2220 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2221 cat >> "$ac_file.tmp" <<EOF
2222 $frobbedlang.msg: $lang.po
2223 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2224 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2228 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2229 # Add dependencies that cannot be formulated as a simple suffix rule.
2230 for lang in $ALL_LINGUAS; do
2231 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2232 cat >> "$ac_file.tmp" <<EOF
2233 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2234 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2235 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2239 if test -n "$POMAKEFILEDEPS"; then
2240 cat >> "$ac_file.tmp" <<EOF
2241 Makefile: $POMAKEFILEDEPS
2244 mv "$ac_file.tmp" "$ac_file"
2247 # printf-posix.m4 serial 2 (gettext-0.13.1)
2248 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2249 dnl This file is free software, distributed under the terms of the GNU
2250 dnl General Public License. As a special exception to the GNU General
2251 dnl Public License, this file may be distributed as part of a program
2252 dnl that contains a configuration script generated by Autoconf, under
2253 dnl the same distribution terms as the rest of that program.
2255 dnl From Bruno Haible.
2256 dnl Test whether the printf() function supports POSIX/XSI format strings with
2259 AC_DEFUN([gt_PRINTF_POSIX],
2261 AC_REQUIRE([AC_PROG_CC])
2262 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
2263 gt_cv_func_printf_posix,
2268 /* The string "%2$d %1$d", with dollar characters protected from the shell's
2269 dollar expansion (possibly an autoconf bug). */
2270 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
2271 static char buf[100];
2274 sprintf (buf, format, 33, 55);
2275 return (strcmp (buf, "55 33") != 0);
2276 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
2278 AC_EGREP_CPP(notposix, [
2279 #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
2282 ], gt_cv_func_printf_posix="guessing no",
2283 gt_cv_func_printf_posix="guessing yes")
2286 case $gt_cv_func_printf_posix in
2288 AC_DEFINE(HAVE_POSIX_PRINTF, 1,
2289 [Define if your printf() function supports format strings with positions.])
2294 # progtest.m4 serial 3 (gettext-0.12)
2295 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2296 dnl This file is free software, distributed under the terms of the GNU
2297 dnl General Public License. As a special exception to the GNU General
2298 dnl Public License, this file may be distributed as part of a program
2299 dnl that contains a configuration script generated by Autoconf, under
2300 dnl the same distribution terms as the rest of that program.
2302 dnl This file can can be used in projects which are not available under
2303 dnl the GNU General Public License or the GNU Library General Public
2304 dnl License but which still want to provide support for the GNU gettext
2306 dnl Please note that the actual code of the GNU gettext library is covered
2307 dnl by the GNU Library General Public License, and the rest of the GNU
2308 dnl gettext package package is covered by the GNU General Public License.
2309 dnl They are *not* in the public domain.
2312 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2314 # Search path for a program which passes the given test.
2316 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2317 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2318 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2320 # Prepare PATH_SEPARATOR.
2321 # The user is always right.
2322 if test "${PATH_SEPARATOR+set}" != set; then
2323 echo "#! /bin/sh" >conf$$.sh
2324 echo "exit 0" >>conf$$.sh
2326 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2334 # Find out how to test for executable files. Don't use a zero-byte file,
2335 # as systems may use methods other than mode bits to determine executability.
2336 cat >conf$$.file <<_ASEOF
2340 chmod +x conf$$.file
2341 if test -x conf$$.file >/dev/null 2>&1; then
2342 ac_executable_p="test -x"
2344 ac_executable_p="test -f"
2348 # Extract the first word of "$2", so it can be a program name with args.
2349 set dummy $2; ac_word=[$]2
2350 AC_MSG_CHECKING([for $ac_word])
2351 AC_CACHE_VAL(ac_cv_path_$1,
2353 [[\\/]]* | ?:[[\\/]]*)
2354 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2357 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2358 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2360 test -z "$ac_dir" && ac_dir=.
2361 for ac_exec_ext in '' $ac_executable_extensions; do
2362 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2364 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2371 dnl If no 4th arg is given, leave the cache variable unset,
2372 dnl so AC_PATH_PROGS will keep looking.
2373 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2378 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2379 AC_MSG_RESULT([$]$1)
2386 # signed.m4 serial 1 (gettext-0.10.40)
2387 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2388 dnl This file is free software, distributed under the terms of the GNU
2389 dnl General Public License. As a special exception to the GNU General
2390 dnl Public License, this file may be distributed as part of a program
2391 dnl that contains a configuration script generated by Autoconf, under
2392 dnl the same distribution terms as the rest of that program.
2394 dnl From Bruno Haible.
2396 AC_DEFUN([bh_C_SIGNED],
2398 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2399 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2400 if test $bh_cv_c_signed = no; then
2402 [Define to empty if the C compiler doesn't support this keyword.])
2406 # size_max.m4 serial 2
2407 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2408 dnl This file is free software, distributed under the terms of the GNU
2409 dnl General Public License. As a special exception to the GNU General
2410 dnl Public License, this file may be distributed as part of a program
2411 dnl that contains a configuration script generated by Autoconf, under
2412 dnl the same distribution terms as the rest of that program.
2414 dnl From Bruno Haible.
2416 AC_DEFUN([gl_SIZE_MAX],
2418 AC_CHECK_HEADERS(stdint.h)
2419 dnl First test whether the system already has SIZE_MAX.
2420 AC_MSG_CHECKING([for SIZE_MAX])
2422 AC_EGREP_CPP([Found it], [
2431 if test -z "$result"; then
2432 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2433 dnl than the type 'unsigned long'.
2434 dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2435 dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2436 _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2437 [#include <stddef.h>], result=?)
2438 _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2439 [#include <stddef.h>], result=?)
2440 _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2441 [#include <stddef.h>], result=?)
2442 if test "$fits_in_uint" = 1; then
2443 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2444 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2445 AC_TRY_COMPILE([#include <stddef.h>
2447 extern unsigned long foo;
2448 ], [], fits_in_uint=0)
2450 if test -z "$result"; then
2451 if test "$fits_in_uint" = 1; then
2452 result="$res_hi$res_lo"U
2454 result="$res_hi$res_lo"UL
2457 dnl Shouldn't happen, but who knows...
2461 AC_MSG_RESULT([$result])
2462 if test "$result" != yes; then
2463 AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
2464 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
2468 # stdint_h.m4 serial 3 (gettext-0.12)
2469 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2470 dnl This file is free software, distributed under the terms of the GNU
2471 dnl General Public License. As a special exception to the GNU General
2472 dnl Public License, this file may be distributed as part of a program
2473 dnl that contains a configuration script generated by Autoconf, under
2474 dnl the same distribution terms as the rest of that program.
2476 dnl From Paul Eggert.
2478 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2479 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2481 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2483 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2485 [#include <sys/types.h>
2486 #include <stdint.h>],
2487 [uintmax_t i = (uintmax_t) -1;],
2488 jm_ac_cv_header_stdint_h=yes,
2489 jm_ac_cv_header_stdint_h=no)])
2490 if test $jm_ac_cv_header_stdint_h = yes; then
2491 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2492 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2493 and declares uintmax_t. ])
2497 # uintmax_t.m4 serial 7 (gettext-0.12)
2498 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2499 dnl This file is free software, distributed under the terms of the GNU
2500 dnl General Public License. As a special exception to the GNU General
2501 dnl Public License, this file may be distributed as part of a program
2502 dnl that contains a configuration script generated by Autoconf, under
2503 dnl the same distribution terms as the rest of that program.
2505 dnl From Paul Eggert.
2509 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2510 # if it is not already defined in <stdint.h> or <inttypes.h>.
2512 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2514 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2515 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2516 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2517 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2518 test $ac_cv_type_unsigned_long_long = yes \
2519 && ac_type='unsigned long long' \
2520 || ac_type='unsigned long'
2521 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2522 [Define to unsigned long or unsigned long long
2523 if <stdint.h> and <inttypes.h> don't define.])
2525 AC_DEFINE(HAVE_UINTMAX_T, 1,
2526 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2530 # ulonglong.m4 serial 3
2531 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2532 dnl This file is free software, distributed under the terms of the GNU
2533 dnl General Public License. As a special exception to the GNU General
2534 dnl Public License, this file may be distributed as part of a program
2535 dnl that contains a configuration script generated by Autoconf, under
2536 dnl the same distribution terms as the rest of that program.
2538 dnl From Paul Eggert.
2540 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2542 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2544 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2545 [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2546 [unsigned long long ullmax = (unsigned long long) -1;
2547 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2548 ac_cv_type_unsigned_long_long=yes,
2549 ac_cv_type_unsigned_long_long=no)])
2550 if test $ac_cv_type_unsigned_long_long = yes; then
2551 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2552 [Define if you have the 'unsigned long long' type.])
2556 # wchar_t.m4 serial 1 (gettext-0.12)
2557 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2558 dnl This file is free software, distributed under the terms of the GNU
2559 dnl General Public License. As a special exception to the GNU General
2560 dnl Public License, this file may be distributed as part of a program
2561 dnl that contains a configuration script generated by Autoconf, under
2562 dnl the same distribution terms as the rest of that program.
2564 dnl From Bruno Haible.
2565 dnl Test whether <stddef.h> has the 'wchar_t' type.
2566 dnl Prerequisite: AC_PROG_CC
2568 AC_DEFUN([gt_TYPE_WCHAR_T],
2570 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2571 [AC_TRY_COMPILE([#include <stddef.h>
2572 wchar_t foo = (wchar_t)'\0';], ,
2573 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
2574 if test $gt_cv_c_wchar_t = yes; then
2575 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
2579 # wint_t.m4 serial 1 (gettext-0.12)
2580 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2581 dnl This file is free software, distributed under the terms of the GNU
2582 dnl General Public License. As a special exception to the GNU General
2583 dnl Public License, this file may be distributed as part of a program
2584 dnl that contains a configuration script generated by Autoconf, under
2585 dnl the same distribution terms as the rest of that program.
2587 dnl From Bruno Haible.
2588 dnl Test whether <wchar.h> has the 'wint_t' type.
2589 dnl Prerequisite: AC_PROG_CC
2591 AC_DEFUN([gt_TYPE_WINT_T],
2593 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2594 [AC_TRY_COMPILE([#include <wchar.h>
2595 wint_t foo = (wchar_t)'\0';], ,
2596 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
2597 if test $gt_cv_c_wint_t = yes; then
2598 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
2603 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2604 dnl This file is free software, distributed under the terms of the GNU
2605 dnl General Public License. As a special exception to the GNU General
2606 dnl Public License, this file may be distributed as part of a program
2607 dnl that contains a configuration script generated by Autoconf, under
2608 dnl the same distribution terms as the rest of that program.
2610 AC_DEFUN([gl_XSIZE],
2612 dnl Prerequisites of lib/xsize.h.
2613 AC_REQUIRE([gl_SIZE_MAX])
2614 AC_CHECK_HEADERS(stdint.h)
2619 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
2621 # This program is free software; you can redistribute it and/or modify
2622 # it under the terms of the GNU General Public License as published by
2623 # the Free Software Foundation; either version 2, or (at your option)
2624 # any later version.
2626 # This program is distributed in the hope that it will be useful,
2627 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2628 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2629 # GNU General Public License for more details.
2631 # You should have received a copy of the GNU General Public License
2632 # along with this program; if not, write to the Free Software
2633 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2636 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2637 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
2638 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2640 # Of course, Automake must honor this variable whenever it calls a
2641 # tool from the auxiliary directory. The problem is that $srcdir (and
2642 # therefore $ac_aux_dir as well) can be either absolute or relative,
2643 # depending on how configure is run. This is pretty annoying, since
2644 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2645 # source directory, any form will work fine, but in subdirectories a
2646 # relative path needs to be adjusted first.
2648 # $ac_aux_dir/missing
2649 # fails when called from a subdirectory if $ac_aux_dir is relative
2650 # $top_srcdir/$ac_aux_dir/missing
2651 # fails if $ac_aux_dir is absolute,
2652 # fails when called from a subdirectory in a VPATH build with
2653 # a relative $ac_aux_dir
2655 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2656 # are both prefixed by $srcdir. In an in-source build this is usually
2657 # harmless because $srcdir is `.', but things will broke when you
2658 # start a VPATH build or use an absolute $srcdir.
2660 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2661 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
2662 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2663 # and then we would define $MISSING as
2664 # MISSING="\${SHELL} $am_aux_dir/missing"
2665 # This will work as long as MISSING is not called from configure, because
2666 # unfortunately $(top_srcdir) has no meaning in configure.
2667 # However there are other variables, like CC, which are often used in
2668 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2670 # Another solution, used here, is to always expand $ac_aux_dir to an
2671 # absolute PATH. The drawback is that using absolute paths prevent a
2672 # configured tree to be moved without reconfiguration.
2674 AC_DEFUN([AM_AUX_DIR_EXPAND],
2675 [dnl Rely on autoconf to set up CDPATH properly.
2676 AC_PREREQ([2.50])dnl
2677 # expand $ac_aux_dir to an absolute path
2678 am_aux_dir=`cd $ac_aux_dir && pwd`
2684 # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
2686 # This program is free software; you can redistribute it and/or modify
2687 # it under the terms of the GNU General Public License as published by
2688 # the Free Software Foundation; either version 2, or (at your option)
2689 # any later version.
2691 # This program is distributed in the hope that it will be useful,
2692 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2693 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2694 # GNU General Public License for more details.
2696 # You should have received a copy of the GNU General Public License
2697 # along with this program; if not, write to the Free Software
2698 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2703 # AM_MISSING_PROG(NAME, PROGRAM)
2704 # ------------------------------
2705 AC_DEFUN([AM_MISSING_PROG],
2706 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2707 $1=${$1-"${am_missing_run}$2"}
2711 # AM_MISSING_HAS_RUN
2712 # ------------------
2713 # Define MISSING if not defined so far and test if it supports --run.
2714 # If it does, set am_missing_run to use it, otherwise, to nothing.
2715 AC_DEFUN([AM_MISSING_HAS_RUN],
2716 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2717 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2718 # Use eval to expand $SHELL
2719 if eval "$MISSING --run true"; then
2720 am_missing_run="$MISSING --run "
2723 AC_MSG_WARN([`missing' script is too old or missing])