1 # codeset.m4 serial AM1 (gettext-0.10.40)
2 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License. As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
11 AC_DEFUN([AM_LANGINFO_CODESET],
13 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
14 [AC_TRY_LINK([#include <langinfo.h>],
15 [char* cs = nl_langinfo(CODESET);],
16 am_cv_langinfo_codeset=yes,
17 am_cv_langinfo_codeset=no)
19 if test $am_cv_langinfo_codeset = yes; then
20 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
21 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
24 # gettext.m4 serial 28 (gettext-0.13)
25 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
26 dnl This file is free software, distributed under the terms of the GNU
27 dnl General Public License. As a special exception to the GNU General
28 dnl Public License, this file may be distributed as part of a program
29 dnl that contains a configuration script generated by Autoconf, under
30 dnl the same distribution terms as the rest of that program.
32 dnl This file can can be used in projects which are not available under
33 dnl the GNU General Public License or the GNU Library General Public
34 dnl License but which still want to provide support for the GNU gettext
36 dnl Please note that the actual code of the GNU gettext library is covered
37 dnl by the GNU Library General Public License, and the rest of the GNU
38 dnl gettext package package is covered by the GNU General Public License.
39 dnl They are *not* in the public domain.
42 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
43 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
45 dnl Macro to add for using GNU gettext.
47 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
48 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
49 dnl default (if it is not specified or empty) is 'no-libtool'.
50 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
51 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
52 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
53 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
54 dnl depending on --{enable,disable}-{shared,static} and on the presence of
55 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
56 dnl $(top_builddir)/intl/libintl.a will be created.
57 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
58 dnl implementations (in libc or libintl) without the ngettext() function
59 dnl will be ignored. If NEEDSYMBOL is specified and is
60 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
61 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
62 dnl INTLDIR is used to find the intl libraries. If empty,
63 dnl the value `$(top_builddir)/intl/' is used.
65 dnl The result of the configuration is one of three cases:
66 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
68 dnl Catalog format: GNU --> install in $(datadir)
69 dnl Catalog extension: .mo after installation, .gmo in source tree
70 dnl 2) GNU gettext has been found in the system's C library.
71 dnl Catalog format: GNU --> install in $(datadir)
72 dnl Catalog extension: .mo after installation, .gmo in source tree
73 dnl 3) No internationalization, always use English msgid.
74 dnl Catalog format: none
75 dnl Catalog extension: none
76 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
77 dnl The use of .gmo is historical (it was needed to avoid overwriting the
78 dnl GNU format catalogs when building on a platform with an X/Open gettext),
79 dnl but we keep it in order not to force irrelevant filename changes on the
82 AC_DEFUN([AM_GNU_GETTEXT],
84 dnl Argument checking.
85 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
86 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
88 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
89 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
91 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
92 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
94 AC_REQUIRE([AM_PO_SUBDIRS])dnl
95 ifelse(gt_included_intl, yes, [
96 AC_REQUIRE([AM_INTL_SUBDIR])dnl
99 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
100 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
101 AC_REQUIRE([AC_LIB_RPATH])
103 dnl Sometimes libintl requires libiconv, so first search for libiconv.
104 dnl Ideally we would do this search only after the
105 dnl if test "$USE_NLS" = "yes"; then
106 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
107 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
108 dnl the configure script would need to contain the same shell code
109 dnl again, outside any 'if'. There are two solutions:
110 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
111 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
112 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
113 dnl documented, we avoid it.
114 ifelse(gt_included_intl, yes, , [
115 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
121 ifelse(gt_included_intl, yes, [
122 BUILD_INCLUDED_LIBINTL=no
123 USE_INCLUDED_LIBINTL=no
129 dnl If we use NLS figure out what method
130 if test "$USE_NLS" = "yes"; then
131 gt_use_preinstalled_gnugettext=no
132 ifelse(gt_included_intl, yes, [
133 AC_MSG_CHECKING([whether included gettext is requested])
134 AC_ARG_WITH(included-gettext,
135 [ --with-included-gettext use the GNU gettext library included here],
136 nls_cv_force_use_gnu_gettext=$withval,
137 nls_cv_force_use_gnu_gettext=no)
138 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
140 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
141 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
143 dnl User does not insist on using GNU NLS library. Figure out what
144 dnl to use. If GNU gettext is available we use this. Else we have
145 dnl to fall back to GNU NLS library.
147 dnl Add a version number to the cache macros.
148 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
149 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
150 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
152 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
153 [AC_TRY_LINK([#include <libintl.h>
154 ]ifelse([$2], [need-formatstring-macros],
155 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
156 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
159 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
161 ], [])[extern int _nl_msg_cat_cntr;
162 extern int *_nl_domain_bindings;],
163 [bindtextdomain ("", "");
164 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
165 gt_cv_func_gnugettext_libc=yes,
166 gt_cv_func_gnugettext_libc=no)])
168 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
169 dnl Sometimes libintl requires libiconv, so first search for libiconv.
170 ifelse(gt_included_intl, yes, , [
173 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
174 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
175 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
176 dnl even if libiconv doesn't exist.
177 AC_LIB_LINKFLAGS_BODY([intl])
178 AC_CACHE_CHECK([for GNU gettext in libintl],
179 gt_cv_func_gnugettext_libintl,
180 [gt_save_CPPFLAGS="$CPPFLAGS"
181 CPPFLAGS="$CPPFLAGS $INCINTL"
183 LIBS="$LIBS $LIBINTL"
184 dnl Now see whether libintl exists and does not depend on libiconv.
185 AC_TRY_LINK([#include <libintl.h>
186 ]ifelse([$2], [need-formatstring-macros],
187 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
188 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
191 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
193 ], [])[extern int _nl_msg_cat_cntr;
198 const char *_nl_expand_alias ();],
199 [bindtextdomain ("", "");
200 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
201 gt_cv_func_gnugettext_libintl=yes,
202 gt_cv_func_gnugettext_libintl=no)
203 dnl Now see whether libintl exists and depends on libiconv.
204 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
205 LIBS="$LIBS $LIBICONV"
206 AC_TRY_LINK([#include <libintl.h>
207 ]ifelse([$2], [need-formatstring-macros],
208 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
209 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
212 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
214 ], [])[extern int _nl_msg_cat_cntr;
219 const char *_nl_expand_alias ();],
220 [bindtextdomain ("", "");
221 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
222 [LIBINTL="$LIBINTL $LIBICONV"
223 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
224 gt_cv_func_gnugettext_libintl=yes
227 CPPFLAGS="$gt_save_CPPFLAGS"
228 LIBS="$gt_save_LIBS"])
231 dnl If an already present or preinstalled GNU gettext() is found,
232 dnl use it. But if this macro is used in GNU gettext, and GNU
233 dnl gettext is already preinstalled in libintl, we update this
234 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
235 if test "$gt_cv_func_gnugettext_libc" = "yes" \
236 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
237 && test "$PACKAGE" != gettext-runtime \
238 && test "$PACKAGE" != gettext-tools; }; then
239 gt_use_preinstalled_gnugettext=yes
241 dnl Reset the values set by searching for libintl.
247 ifelse(gt_included_intl, yes, [
248 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
249 dnl GNU gettext is not found in the C library.
250 dnl Fall back on included GNU gettext library.
251 nls_cv_use_gnu_gettext=yes
255 if test "$nls_cv_use_gnu_gettext" = "yes"; then
256 dnl Mark actions used to generate GNU NLS library.
257 BUILD_INCLUDED_LIBINTL=yes
258 USE_INCLUDED_LIBINTL=yes
259 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
260 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
261 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
264 if test "$gt_use_preinstalled_gnugettext" = "yes" \
265 || test "$nls_cv_use_gnu_gettext" = "yes"; then
266 dnl Mark actions to use GNU gettext tools.
271 if test "$gt_use_preinstalled_gnugettext" = "yes" \
272 || test "$nls_cv_use_gnu_gettext" = "yes"; then
273 AC_DEFINE(ENABLE_NLS, 1,
274 [Define to 1 if translation of program messages to the user's native language
281 AC_MSG_CHECKING([whether to use NLS])
282 AC_MSG_RESULT([$USE_NLS])
283 if test "$USE_NLS" = "yes"; then
284 AC_MSG_CHECKING([where the gettext function comes from])
285 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
286 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
287 gt_source="external libintl"
292 gt_source="included intl directory"
294 AC_MSG_RESULT([$gt_source])
297 if test "$USE_NLS" = "yes"; then
299 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
300 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
301 AC_MSG_CHECKING([how to link with libintl])
302 AC_MSG_RESULT([$LIBINTL])
303 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
306 dnl For backward compatibility. Some packages may be using this.
307 AC_DEFINE(HAVE_GETTEXT, 1,
308 [Define if the GNU gettext() function is already present or preinstalled.])
309 AC_DEFINE(HAVE_DCGETTEXT, 1,
310 [Define if the GNU dcgettext() function is already present or preinstalled.])
313 dnl We need to process the po/ directory.
317 ifelse(gt_included_intl, yes, [
318 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
319 dnl to 'yes' because some of the testsuite requires it.
320 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
321 BUILD_INCLUDED_LIBINTL=yes
324 dnl Make all variables we use known to autoconf.
325 AC_SUBST(BUILD_INCLUDED_LIBINTL)
326 AC_SUBST(USE_INCLUDED_LIBINTL)
329 dnl For backward compatibility. Some configure.ins may be using this.
333 dnl For backward compatibility. Some Makefiles may be using this.
335 AC_SUBST(DATADIRNAME)
337 dnl For backward compatibility. Some Makefiles may be using this.
341 dnl For backward compatibility. Some Makefiles may be using this.
345 dnl For backward compatibility. Some Makefiles may be using this.
346 if test "$USE_INCLUDED_LIBINTL" = yes; then
347 INTLOBJS="\$(GETTOBJS)"
351 dnl Enable libtool support if the surrounding package wishes it.
352 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
353 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
356 dnl For backward compatibility. Some Makefiles may be using this.
360 dnl Make all documented variables known to autoconf.
367 dnl Checks for all prerequisites of the intl subdirectory,
368 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
369 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
370 AC_DEFUN([AM_INTL_SUBDIR],
372 AC_REQUIRE([AC_PROG_INSTALL])dnl
373 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
374 AC_REQUIRE([AC_PROG_CC])dnl
375 AC_REQUIRE([AC_CANONICAL_HOST])dnl
376 AC_REQUIRE([AC_PROG_RANLIB])dnl
377 AC_REQUIRE([AC_ISC_POSIX])dnl
378 AC_REQUIRE([AC_HEADER_STDC])dnl
379 AC_REQUIRE([AC_C_CONST])dnl
380 AC_REQUIRE([bh_C_SIGNED])dnl
381 AC_REQUIRE([AC_C_INLINE])dnl
382 AC_REQUIRE([AC_TYPE_OFF_T])dnl
383 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
384 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
385 AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
386 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
387 AC_REQUIRE([gt_TYPE_WINT_T])dnl
388 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
389 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
390 AC_REQUIRE([gt_TYPE_INTMAX_T])
391 AC_REQUIRE([gt_PRINTF_POSIX])
392 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
393 AC_REQUIRE([AC_FUNC_MMAP])dnl
394 AC_REQUIRE([jm_GLIBC21])dnl
395 AC_REQUIRE([gt_INTDIV0])dnl
396 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
397 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
398 AC_REQUIRE([gt_INTTYPES_PRI])dnl
399 AC_REQUIRE([gl_XSIZE])dnl
401 AC_CHECK_TYPE([ptrdiff_t], ,
402 [AC_DEFINE([ptrdiff_t], [long],
403 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
405 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
406 stdlib.h string.h unistd.h sys/param.h])
407 AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
408 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
409 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
412 dnl Use the _snprintf function only if it is declared (because on NetBSD it
413 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
414 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
415 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
417 dnl Use the *_unlocked functions only if they are declared.
418 dnl (because some of them were defined without being declared in Solaris
419 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
420 dnl on Solaris 2.5.1 to run on Solaris 2.6).
421 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
422 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
423 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
424 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
426 case $gt_cv_func_printf_posix in
427 *yes) HAVE_POSIX_PRINTF=1 ;;
428 *) HAVE_POSIX_PRINTF=0 ;;
430 AC_SUBST([HAVE_POSIX_PRINTF])
431 if test "$ac_cv_func_asprintf" = yes; then
436 AC_SUBST([HAVE_ASPRINTF])
437 if test "$ac_cv_func_snprintf" = yes; then
442 AC_SUBST([HAVE_SNPRINTF])
443 if test "$ac_cv_func_wprintf" = yes; then
448 AC_SUBST([HAVE_WPRINTF])
452 if test $ac_cv_header_locale_h = yes; then
456 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
457 dnl because plural.y uses bison specific features. It requires at least
458 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
460 dnl bison is only needed for the maintainer (who touches plural.y). But in
461 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
462 dnl the rule in general Makefile. Now, some people carelessly touch the
463 dnl files or have a broken "make" program, hence the plural.c rule will
464 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
465 dnl present or too old.
466 AC_CHECK_PROGS([INTLBISON], [bison])
467 if test -z "$INTLBISON"; then
470 dnl Found it, now check the version.
471 AC_MSG_CHECKING([version of bison])
472 changequote(<<,>>)dnl
473 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
474 case $ac_prog_version in
475 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
476 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
478 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
479 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
481 AC_MSG_RESULT([$ac_prog_version])
483 if test $ac_verc_fail = yes; then
489 dnl gt_CHECK_DECL(FUNC, INCLUDES)
490 dnl Check whether a function is declared.
491 AC_DEFUN([gt_CHECK_DECL],
493 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
494 [AC_TRY_COMPILE([$2], [
496 char *p = (char *) $1;
498 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
499 if test $ac_cv_have_decl_$1 = yes; then
504 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
505 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
509 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
510 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
511 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
512 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
513 dnl This file is free software, distributed under the terms of the GNU
514 dnl General Public License. As a special exception to the GNU General
515 dnl Public License, this file may be distributed as part of a program
516 dnl that contains a configuration script generated by Autoconf, under
517 dnl the same distribution terms as the rest of that program.
519 # Test for the GNU C Library, version 2.1 or newer.
522 AC_DEFUN([jm_GLIBC21],
524 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
525 ac_cv_gnu_library_2_1,
526 [AC_EGREP_CPP([Lucky GNU user],
528 #include <features.h>
529 #ifdef __GNU_LIBRARY__
530 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
535 ac_cv_gnu_library_2_1=yes,
536 ac_cv_gnu_library_2_1=no)
540 GLIBC21="$ac_cv_gnu_library_2_1"
543 # iconv.m4 serial AM4 (gettext-0.11.3)
544 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
545 dnl This file is free software, distributed under the terms of the GNU
546 dnl General Public License. As a special exception to the GNU General
547 dnl Public License, this file may be distributed as part of a program
548 dnl that contains a configuration script generated by Autoconf, under
549 dnl the same distribution terms as the rest of that program.
551 dnl From Bruno Haible.
553 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
555 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
556 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
557 AC_REQUIRE([AC_LIB_RPATH])
559 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
561 AC_LIB_LINKFLAGS_BODY([iconv])
564 AC_DEFUN([AM_ICONV_LINK],
566 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
567 dnl those with the standalone portable GNU libiconv installed).
569 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
571 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
573 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
574 dnl because if the user has installed libiconv and not disabled its use
575 dnl via --without-libiconv-prefix, he wants to use it. The first
576 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
577 am_save_CPPFLAGS="$CPPFLAGS"
578 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
580 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
581 am_cv_func_iconv="no, consider installing GNU libiconv"
583 AC_TRY_LINK([#include <stdlib.h>
585 [iconv_t cd = iconv_open("","");
586 iconv(cd,NULL,NULL,NULL,NULL);
588 am_cv_func_iconv=yes)
589 if test "$am_cv_func_iconv" != yes; then
591 LIBS="$LIBS $LIBICONV"
592 AC_TRY_LINK([#include <stdlib.h>
594 [iconv_t cd = iconv_open("","");
595 iconv(cd,NULL,NULL,NULL,NULL);
598 am_cv_func_iconv=yes)
602 if test "$am_cv_func_iconv" = yes; then
603 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
605 if test "$am_cv_lib_iconv" = yes; then
606 AC_MSG_CHECKING([how to link with libiconv])
607 AC_MSG_RESULT([$LIBICONV])
609 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
611 CPPFLAGS="$am_save_CPPFLAGS"
622 if test "$am_cv_func_iconv" = yes; then
623 AC_MSG_CHECKING([for iconv declaration])
624 AC_CACHE_VAL(am_cv_proto_iconv, [
632 #if defined(__STDC__) || defined(__cplusplus)
633 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
637 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
638 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);"])
639 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
640 AC_MSG_RESULT([$]{ac_t:-
641 }[$]am_cv_proto_iconv)
642 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
643 [Define as const if the declaration of iconv() needs const.])
646 # intdiv0.m4 serial 1 (gettext-0.11.3)
647 dnl Copyright (C) 2002 Free Software Foundation, Inc.
648 dnl This file is free software, distributed under the terms of the GNU
649 dnl General Public License. As a special exception to the GNU General
650 dnl Public License, this file may be distributed as part of a program
651 dnl that contains a configuration script generated by Autoconf, under
652 dnl the same distribution terms as the rest of that program.
654 dnl From Bruno Haible.
656 AC_DEFUN([gt_INTDIV0],
658 AC_REQUIRE([AC_PROG_CC])dnl
659 AC_REQUIRE([AC_CANONICAL_HOST])dnl
661 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
662 gt_cv_int_divbyzero_sigfpe,
670 sigfpe_handler (int sig)
672 sigfpe_handler (sig) int sig;
675 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
676 exit (sig != SIGFPE);
686 signal (SIGFPE, sigfpe_handler);
687 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
688 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
689 signal (SIGTRAP, sigfpe_handler);
691 /* Linux/SPARC yields signal SIGILL. */
692 #if defined (__sparc__) && defined (__linux__)
693 signal (SIGILL, sigfpe_handler);
700 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
702 # Guess based on the CPU.
704 alpha* | i[34567]86 | m68k | s390*)
705 gt_cv_int_divbyzero_sigfpe="guessing yes";;
707 gt_cv_int_divbyzero_sigfpe="guessing no";;
711 case "$gt_cv_int_divbyzero_sigfpe" in
715 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
716 [Define if integer division by zero raises signal SIGFPE.])
718 # intmax.m4 serial 1 (gettext-0.12)
719 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
720 dnl This file is free software, distributed under the terms of the GNU
721 dnl General Public License. As a special exception to the GNU General
722 dnl Public License, this file may be distributed as part of a program
723 dnl that contains a configuration script generated by Autoconf, under
724 dnl the same distribution terms as the rest of that program.
726 dnl From Bruno Haible.
727 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
728 dnl find a replacement if it is lacking.
730 AC_DEFUN([gt_TYPE_INTMAX_T],
732 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
733 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
734 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
738 #if HAVE_STDINT_H_WITH_UINTMAX
741 #if HAVE_INTTYPES_H_WITH_UINTMAX
742 #include <inttypes.h>
744 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
745 if test $gt_cv_c_intmax_t = yes; then
746 AC_DEFINE(HAVE_INTMAX_T, 1,
747 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
750 # inttypes.m4 serial 1 (gettext-0.11.4)
751 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
752 dnl This file is free software, distributed under the terms of the GNU
753 dnl General Public License. As a special exception to the GNU General
754 dnl Public License, this file may be distributed as part of a program
755 dnl that contains a configuration script generated by Autoconf, under
756 dnl the same distribution terms as the rest of that program.
758 dnl From Paul Eggert.
760 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
763 AC_DEFUN([gt_HEADER_INTTYPES_H],
765 AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
768 [#include <sys/types.h>
769 #include <inttypes.h>],
770 [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
772 if test $gt_cv_header_inttypes_h = yes; then
773 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
774 [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
777 # inttypes_h.m4 serial 5 (gettext-0.12)
778 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
779 dnl This file is free software, distributed under the terms of the GNU
780 dnl General Public License. As a special exception to the GNU General
781 dnl Public License, this file may be distributed as part of a program
782 dnl that contains a configuration script generated by Autoconf, under
783 dnl the same distribution terms as the rest of that program.
785 dnl From Paul Eggert.
787 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
788 # doesn't clash with <sys/types.h>, and declares uintmax_t.
790 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
792 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
794 [#include <sys/types.h>
795 #include <inttypes.h>],
796 [uintmax_t i = (uintmax_t) -1;],
797 jm_ac_cv_header_inttypes_h=yes,
798 jm_ac_cv_header_inttypes_h=no)])
799 if test $jm_ac_cv_header_inttypes_h = yes; then
800 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
801 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
802 and declares uintmax_t. ])
805 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
806 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
807 dnl This file is free software, distributed under the terms of the GNU
808 dnl General Public License. As a special exception to the GNU General
809 dnl Public License, this file may be distributed as part of a program
810 dnl that contains a configuration script generated by Autoconf, under
811 dnl the same distribution terms as the rest of that program.
813 dnl From Bruno Haible.
815 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
816 # macros to non-string values. This is the case on AIX 4.3.3.
818 AC_DEFUN([gt_INTTYPES_PRI],
820 AC_REQUIRE([gt_HEADER_INTTYPES_H])
821 if test $gt_cv_header_inttypes_h = yes; then
822 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
823 gt_cv_inttypes_pri_broken,
825 AC_TRY_COMPILE([#include <inttypes.h>
829 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
832 if test "$gt_cv_inttypes_pri_broken" = yes; then
833 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
834 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
837 # isc-posix.m4 serial 2 (gettext-0.11.2)
838 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
839 dnl This file is free software, distributed under the terms of the GNU
840 dnl General Public License. As a special exception to the GNU General
841 dnl Public License, this file may be distributed as part of a program
842 dnl that contains a configuration script generated by Autoconf, under
843 dnl the same distribution terms as the rest of that program.
845 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
847 # This test replaces the one in autoconf.
848 # Currently this macro should have the same name as the autoconf macro
849 # because gettext's gettext.m4 (distributed in the automake package)
850 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
851 # give these diagnostics:
852 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
853 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
855 undefine([AC_ISC_POSIX])
857 AC_DEFUN([AC_ISC_POSIX],
859 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
860 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
863 # lcmessage.m4 serial 3 (gettext-0.11.3)
864 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
865 dnl This file is free software, distributed under the terms of the GNU
866 dnl General Public License. As a special exception to the GNU General
867 dnl Public License, this file may be distributed as part of a program
868 dnl that contains a configuration script generated by Autoconf, under
869 dnl the same distribution terms as the rest of that program.
871 dnl This file can can be used in projects which are not available under
872 dnl the GNU General Public License or the GNU Library General Public
873 dnl License but which still want to provide support for the GNU gettext
875 dnl Please note that the actual code of the GNU gettext library is covered
876 dnl by the GNU Library General Public License, and the rest of the GNU
877 dnl gettext package package is covered by the GNU General Public License.
878 dnl They are *not* in the public domain.
881 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
883 # Check whether LC_MESSAGES is available in <locale.h>.
885 AC_DEFUN([AM_LC_MESSAGES],
887 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
888 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
889 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
890 if test $am_cv_val_LC_MESSAGES = yes; then
891 AC_DEFINE(HAVE_LC_MESSAGES, 1,
892 [Define if your <locale.h> file defines LC_MESSAGES.])
895 # lib-ld.m4 serial 3 (gettext-0.13)
896 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
897 dnl This file is free software, distributed under the terms of the GNU
898 dnl General Public License. As a special exception to the GNU General
899 dnl Public License, this file may be distributed as part of a program
900 dnl that contains a configuration script generated by Autoconf, under
901 dnl the same distribution terms as the rest of that program.
903 dnl Subroutines of libtool.m4,
904 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
907 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
908 AC_DEFUN([AC_LIB_PROG_LD_GNU],
909 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
910 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
911 case `$LD -v 2>&1 </dev/null` in
912 *GNU* | *'with BFD'*)
913 acl_cv_prog_gnu_ld=yes ;;
915 acl_cv_prog_gnu_ld=no ;;
917 with_gnu_ld=$acl_cv_prog_gnu_ld
920 dnl From libtool-1.4. Sets the variable LD.
921 AC_DEFUN([AC_LIB_PROG_LD],
923 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
924 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
925 AC_REQUIRE([AC_PROG_CC])dnl
926 AC_REQUIRE([AC_CANONICAL_HOST])dnl
927 # Prepare PATH_SEPARATOR.
928 # The user is always right.
929 if test "${PATH_SEPARATOR+set}" != set; then
930 echo "#! /bin/sh" >conf$$.sh
931 echo "exit 0" >>conf$$.sh
933 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
941 if test "$GCC" = yes; then
942 # Check if gcc -print-prog-name=ld gives a path.
943 AC_MSG_CHECKING([for ld used by GCC])
946 # gcc leaves a trailing carriage return which upsets mingw
947 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
949 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
952 # Accept absolute paths.
953 [[\\/]* | [A-Za-z]:[\\/]*)]
954 [re_direlt='/[^/][^/]*/\.\./']
955 # Canonicalize the path of ld
956 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
957 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
958 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
960 test -z "$LD" && LD="$ac_prog"
963 # If it fails, then pretend we aren't using GCC.
967 # If it is relative, then search for the first ld in PATH.
971 elif test "$with_gnu_ld" = yes; then
972 AC_MSG_CHECKING([for GNU ld])
974 AC_MSG_CHECKING([for non-GNU ld])
976 AC_CACHE_VAL(acl_cv_path_LD,
977 [if test -z "$LD"; then
978 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
979 for ac_dir in $PATH; do
980 test -z "$ac_dir" && ac_dir=.
981 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
982 acl_cv_path_LD="$ac_dir/$ac_prog"
983 # Check to see if the program is GNU ld. I'd rather use --version,
984 # but apparently some GNU ld's only accept -v.
985 # Break only if it was the GNU/non-GNU ld that we prefer.
986 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
987 *GNU* | *'with BFD'*)
988 test "$with_gnu_ld" != no && break ;;
990 test "$with_gnu_ld" != yes && break ;;
996 acl_cv_path_LD="$LD" # Let the user override the test with a path.
999 if test -n "$LD"; then
1004 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1007 # lib-link.m4 serial 4 (gettext-0.12)
1008 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1009 dnl This file is free software, distributed under the terms of the GNU
1010 dnl General Public License. As a special exception to the GNU General
1011 dnl Public License, this file may be distributed as part of a program
1012 dnl that contains a configuration script generated by Autoconf, under
1013 dnl the same distribution terms as the rest of that program.
1015 dnl From Bruno Haible.
1017 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1018 dnl the libraries corresponding to explicit and implicit dependencies.
1019 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1020 dnl augments the CPPFLAGS variable.
1021 AC_DEFUN([AC_LIB_LINKFLAGS],
1023 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1024 AC_REQUIRE([AC_LIB_RPATH])
1025 define([Name],[translit([$1],[./-], [___])])
1026 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1027 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1028 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1029 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1030 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1031 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1032 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1034 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1035 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1036 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1037 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1039 AC_SUBST([LTLIB]NAME)
1040 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1041 dnl results of this search when this library appears as a dependency.
1047 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1048 dnl searches for libname and the libraries corresponding to explicit and
1049 dnl implicit dependencies, together with the specified include files and
1050 dnl the ability to compile and link the specified testcode. If found, it
1051 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1052 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1053 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1054 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1055 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1057 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1058 AC_REQUIRE([AC_LIB_RPATH])
1059 define([Name],[translit([$1],[./-], [___])])
1060 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1061 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1063 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1065 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1067 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1068 dnl because if the user has installed lib[]Name and not disabled its use
1069 dnl via --without-lib[]Name-prefix, he wants to use it.
1070 ac_save_CPPFLAGS="$CPPFLAGS"
1071 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1073 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1074 ac_save_LIBS="$LIBS"
1075 LIBS="$LIBS $LIB[]NAME"
1076 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1077 LIBS="$ac_save_LIBS"
1079 if test "$ac_cv_lib[]Name" = yes; then
1081 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1082 AC_MSG_CHECKING([how to link with lib[]$1])
1083 AC_MSG_RESULT([$LIB[]NAME])
1086 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1087 dnl $INC[]NAME either.
1088 CPPFLAGS="$ac_save_CPPFLAGS"
1092 AC_SUBST([HAVE_LIB]NAME)
1094 AC_SUBST([LTLIB]NAME)
1099 dnl Determine the platform dependent parameters needed to use rpath:
1100 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1101 dnl hardcode_direct, hardcode_minus_L.
1102 AC_DEFUN([AC_LIB_RPATH],
1104 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1105 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1106 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1107 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1108 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1109 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1110 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1116 libext="$acl_cv_libext"
1117 shlibext="$acl_cv_shlibext"
1118 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1119 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1120 hardcode_direct="$acl_cv_hardcode_direct"
1121 hardcode_minus_L="$acl_cv_hardcode_minus_L"
1122 dnl Determine whether the user wants rpath handling at all.
1123 AC_ARG_ENABLE(rpath,
1124 [ --disable-rpath do not hardcode runtime library paths],
1125 :, enable_rpath=yes)
1128 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1129 dnl the libraries corresponding to explicit and implicit dependencies.
1130 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1131 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1133 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1134 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1135 dnl By default, look in $includedir and $libdir.
1137 AC_LIB_WITH_FINAL_PREFIX([
1138 eval additional_includedir=\"$includedir\"
1139 eval additional_libdir=\"$libdir\"
1141 AC_LIB_ARG_WITH([lib$1-prefix],
1142 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1143 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1145 if test "X$withval" = "Xno"; then
1148 if test "X$withval" = "X"; then
1149 AC_LIB_WITH_FINAL_PREFIX([
1150 eval additional_includedir=\"$includedir\"
1151 eval additional_libdir=\"$libdir\"
1154 additional_includedir="$withval/include"
1155 additional_libdir="$withval/lib"
1159 dnl Search the library and its dependencies in $additional_libdir and
1160 dnl $LDFLAGS. Using breadth-first-seach.
1166 names_already_handled=
1167 names_next_round='$1 $2'
1168 while test -n "$names_next_round"; do
1169 names_this_round="$names_next_round"
1171 for name in $names_this_round; do
1173 for n in $names_already_handled; do
1174 if test "$n" = "$name"; then
1179 if test -z "$already_handled"; then
1180 names_already_handled="$names_already_handled $name"
1181 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1182 dnl or AC_LIB_HAVE_LINKFLAGS call.
1183 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1184 eval value=\"\$HAVE_LIB$uppername\"
1185 if test -n "$value"; then
1186 if test "$value" = yes; then
1187 eval value=\"\$LIB$uppername\"
1188 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1189 eval value=\"\$LTLIB$uppername\"
1190 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1192 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1193 dnl that this library doesn't exist. So just drop it.
1197 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1198 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1203 if test $use_additional = yes; then
1204 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1205 found_dir="$additional_libdir"
1206 found_so="$additional_libdir/lib$name.$shlibext"
1207 if test -f "$additional_libdir/lib$name.la"; then
1208 found_la="$additional_libdir/lib$name.la"
1211 if test -f "$additional_libdir/lib$name.$libext"; then
1212 found_dir="$additional_libdir"
1213 found_a="$additional_libdir/lib$name.$libext"
1214 if test -f "$additional_libdir/lib$name.la"; then
1215 found_la="$additional_libdir/lib$name.la"
1220 if test "X$found_dir" = "X"; then
1221 for x in $LDFLAGS $LTLIB[]NAME; do
1222 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1225 dir=`echo "X$x" | sed -e 's/^X-L//'`
1226 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1228 found_so="$dir/lib$name.$shlibext"
1229 if test -f "$dir/lib$name.la"; then
1230 found_la="$dir/lib$name.la"
1233 if test -f "$dir/lib$name.$libext"; then
1235 found_a="$dir/lib$name.$libext"
1236 if test -f "$dir/lib$name.la"; then
1237 found_la="$dir/lib$name.la"
1243 if test "X$found_dir" != "X"; then
1248 if test "X$found_dir" != "X"; then
1249 dnl Found the library.
1250 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1251 if test "X$found_so" != "X"; then
1252 dnl Linking with a shared library. We attempt to hardcode its
1253 dnl directory into the executable's runpath, unless it's the
1254 dnl standard /usr/lib.
1255 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1256 dnl No hardcoding is needed.
1257 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1259 dnl Use an explicit option to hardcode DIR into the resulting
1261 dnl Potentially add DIR to ltrpathdirs.
1262 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1264 for x in $ltrpathdirs; do
1265 if test "X$x" = "X$found_dir"; then
1270 if test -z "$haveit"; then
1271 ltrpathdirs="$ltrpathdirs $found_dir"
1273 dnl The hardcoding into $LIBNAME is system dependent.
1274 if test "$hardcode_direct" = yes; then
1275 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1276 dnl resulting binary.
1277 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1279 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1280 dnl Use an explicit option to hardcode DIR into the resulting
1282 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1283 dnl Potentially add DIR to rpathdirs.
1284 dnl The rpathdirs will be appended to $LIBNAME at the end.
1286 for x in $rpathdirs; do
1287 if test "X$x" = "X$found_dir"; then
1292 if test -z "$haveit"; then
1293 rpathdirs="$rpathdirs $found_dir"
1296 dnl Rely on "-L$found_dir".
1297 dnl But don't add it if it's already contained in the LDFLAGS
1298 dnl or the already constructed $LIBNAME
1300 for x in $LDFLAGS $LIB[]NAME; do
1301 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1302 if test "X$x" = "X-L$found_dir"; then
1307 if test -z "$haveit"; then
1308 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1310 if test "$hardcode_minus_L" != no; then
1311 dnl FIXME: Not sure whether we should use
1312 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1314 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1316 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1317 dnl here, because this doesn't fit in flags passed to the
1318 dnl compiler. So give up. No hardcoding. This affects only
1319 dnl very old systems.
1320 dnl FIXME: Not sure whether we should use
1321 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1323 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1329 if test "X$found_a" != "X"; then
1330 dnl Linking with a static library.
1331 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1333 dnl We shouldn't come here, but anyway it's good to have a
1335 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1338 dnl Assume the include files are nearby.
1339 additional_includedir=
1340 case "$found_dir" in
1342 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1343 additional_includedir="$basedir/include"
1346 if test "X$additional_includedir" != "X"; then
1347 dnl Potentially add $additional_includedir to $INCNAME.
1348 dnl But don't add it
1349 dnl 1. if it's the standard /usr/include,
1350 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1351 dnl 3. if it's already present in $CPPFLAGS or the already
1352 dnl constructed $INCNAME,
1353 dnl 4. if it doesn't exist as a directory.
1354 if test "X$additional_includedir" != "X/usr/include"; then
1356 if test "X$additional_includedir" = "X/usr/local/include"; then
1357 if test -n "$GCC"; then
1359 linux*) haveit=yes;;
1363 if test -z "$haveit"; then
1364 for x in $CPPFLAGS $INC[]NAME; do
1365 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1366 if test "X$x" = "X-I$additional_includedir"; then
1371 if test -z "$haveit"; then
1372 if test -d "$additional_includedir"; then
1373 dnl Really add $additional_includedir to $INCNAME.
1374 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1380 dnl Look for dependencies.
1381 if test -n "$found_la"; then
1382 dnl Read the .la file. It defines the variables
1383 dnl dlname, library_names, old_library, dependency_libs, current,
1384 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1385 save_libdir="$libdir"
1387 */* | *\\*) . "$found_la" ;;
1388 *) . "./$found_la" ;;
1390 libdir="$save_libdir"
1391 dnl We use only dependency_libs.
1392 for dep in $dependency_libs; do
1395 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1396 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1397 dnl But don't add it
1398 dnl 1. if it's the standard /usr/lib,
1399 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1400 dnl 3. if it's already present in $LDFLAGS or the already
1401 dnl constructed $LIBNAME,
1402 dnl 4. if it doesn't exist as a directory.
1403 if test "X$additional_libdir" != "X/usr/lib"; then
1405 if test "X$additional_libdir" = "X/usr/local/lib"; then
1406 if test -n "$GCC"; then
1408 linux*) haveit=yes;;
1412 if test -z "$haveit"; then
1414 for x in $LDFLAGS $LIB[]NAME; do
1415 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1416 if test "X$x" = "X-L$additional_libdir"; then
1421 if test -z "$haveit"; then
1422 if test -d "$additional_libdir"; then
1423 dnl Really add $additional_libdir to $LIBNAME.
1424 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1428 for x in $LDFLAGS $LTLIB[]NAME; do
1429 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1430 if test "X$x" = "X-L$additional_libdir"; then
1435 if test -z "$haveit"; then
1436 if test -d "$additional_libdir"; then
1437 dnl Really add $additional_libdir to $LTLIBNAME.
1438 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1445 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1446 if test "$enable_rpath" != no; then
1447 dnl Potentially add DIR to rpathdirs.
1448 dnl The rpathdirs will be appended to $LIBNAME at the end.
1450 for x in $rpathdirs; do
1451 if test "X$x" = "X$dir"; then
1456 if test -z "$haveit"; then
1457 rpathdirs="$rpathdirs $dir"
1459 dnl Potentially add DIR to ltrpathdirs.
1460 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1462 for x in $ltrpathdirs; do
1463 if test "X$x" = "X$dir"; then
1468 if test -z "$haveit"; then
1469 ltrpathdirs="$ltrpathdirs $dir"
1474 dnl Handle this in the next round.
1475 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1478 dnl Handle this in the next round. Throw away the .la's
1479 dnl directory; it is already contained in a preceding -L
1481 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1484 dnl Most likely an immediate library name.
1485 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1486 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1492 dnl Didn't find the library; assume it is in the system directories
1493 dnl known to the linker and runtime loader. (All the system
1494 dnl directories known to the linker should also be known to the
1495 dnl runtime loader, otherwise the system is severely misconfigured.)
1496 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1497 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1503 if test "X$rpathdirs" != "X"; then
1504 if test -n "$hardcode_libdir_separator"; then
1505 dnl Weird platform: only the last -rpath option counts, the user must
1506 dnl pass all path elements in one option. We can arrange that for a
1507 dnl single library, but not when more than one $LIBNAMEs are used.
1509 for found_dir in $rpathdirs; do
1510 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1512 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1513 acl_save_libdir="$libdir"
1515 eval flag=\"$hardcode_libdir_flag_spec\"
1516 libdir="$acl_save_libdir"
1517 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1519 dnl The -rpath options are cumulative.
1520 for found_dir in $rpathdirs; do
1521 acl_save_libdir="$libdir"
1523 eval flag=\"$hardcode_libdir_flag_spec\"
1524 libdir="$acl_save_libdir"
1525 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1529 if test "X$ltrpathdirs" != "X"; then
1530 dnl When using libtool, the option that works for both libraries and
1531 dnl executables is -R. The -R options are cumulative.
1532 for found_dir in $ltrpathdirs; do
1533 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1538 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1539 dnl unless already present in VAR.
1540 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1541 dnl contains two or three consecutive elements that belong together.
1542 AC_DEFUN([AC_LIB_APPENDTOVAR],
1544 for element in [$2]; do
1547 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1548 if test "X$x" = "X$element"; then
1553 if test -z "$haveit"; then
1554 [$1]="${[$1]}${[$1]:+ }$element"
1558 # lib-prefix.m4 serial 3 (gettext-0.13)
1559 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1560 dnl This file is free software, distributed under the terms of the GNU
1561 dnl General Public License. As a special exception to the GNU General
1562 dnl Public License, this file may be distributed as part of a program
1563 dnl that contains a configuration script generated by Autoconf, under
1564 dnl the same distribution terms as the rest of that program.
1566 dnl From Bruno Haible.
1568 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1569 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1570 dnl require excessive bracketing.
1571 ifdef([AC_HELP_STRING],
1572 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1573 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1575 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1576 dnl to access previously installed libraries. The basic assumption is that
1577 dnl a user will want packages to use other packages he previously installed
1578 dnl with the same --prefix option.
1579 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1580 dnl libraries, but is otherwise very convenient.
1581 AC_DEFUN([AC_LIB_PREFIX],
1583 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1584 AC_REQUIRE([AC_PROG_CC])
1585 AC_REQUIRE([AC_CANONICAL_HOST])
1586 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1587 dnl By default, look in $includedir and $libdir.
1589 AC_LIB_WITH_FINAL_PREFIX([
1590 eval additional_includedir=\"$includedir\"
1591 eval additional_libdir=\"$libdir\"
1593 AC_LIB_ARG_WITH([lib-prefix],
1594 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1595 --without-lib-prefix don't search for libraries in includedir and libdir],
1597 if test "X$withval" = "Xno"; then
1600 if test "X$withval" = "X"; then
1601 AC_LIB_WITH_FINAL_PREFIX([
1602 eval additional_includedir=\"$includedir\"
1603 eval additional_libdir=\"$libdir\"
1606 additional_includedir="$withval/include"
1607 additional_libdir="$withval/lib"
1611 if test $use_additional = yes; then
1612 dnl Potentially add $additional_includedir to $CPPFLAGS.
1613 dnl But don't add it
1614 dnl 1. if it's the standard /usr/include,
1615 dnl 2. if it's already present in $CPPFLAGS,
1616 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1617 dnl 4. if it doesn't exist as a directory.
1618 if test "X$additional_includedir" != "X/usr/include"; then
1620 for x in $CPPFLAGS; do
1621 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1622 if test "X$x" = "X-I$additional_includedir"; then
1627 if test -z "$haveit"; then
1628 if test "X$additional_includedir" = "X/usr/local/include"; then
1629 if test -n "$GCC"; then
1631 linux*) haveit=yes;;
1635 if test -z "$haveit"; then
1636 if test -d "$additional_includedir"; then
1637 dnl Really add $additional_includedir to $CPPFLAGS.
1638 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1643 dnl Potentially add $additional_libdir to $LDFLAGS.
1644 dnl But don't add it
1645 dnl 1. if it's the standard /usr/lib,
1646 dnl 2. if it's already present in $LDFLAGS,
1647 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1648 dnl 4. if it doesn't exist as a directory.
1649 if test "X$additional_libdir" != "X/usr/lib"; then
1651 for x in $LDFLAGS; do
1652 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1653 if test "X$x" = "X-L$additional_libdir"; then
1658 if test -z "$haveit"; then
1659 if test "X$additional_libdir" = "X/usr/local/lib"; then
1660 if test -n "$GCC"; then
1662 linux*) haveit=yes;;
1666 if test -z "$haveit"; then
1667 if test -d "$additional_libdir"; then
1668 dnl Really add $additional_libdir to $LDFLAGS.
1669 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1677 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1678 dnl acl_final_exec_prefix, containing the values to which $prefix and
1679 dnl $exec_prefix will expand at the end of the configure script.
1680 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1682 dnl Unfortunately, prefix and exec_prefix get only finally determined
1683 dnl at the end of configure.
1684 if test "X$prefix" = "XNONE"; then
1685 acl_final_prefix="$ac_default_prefix"
1687 acl_final_prefix="$prefix"
1689 if test "X$exec_prefix" = "XNONE"; then
1690 acl_final_exec_prefix='${prefix}'
1692 acl_final_exec_prefix="$exec_prefix"
1694 acl_save_prefix="$prefix"
1695 prefix="$acl_final_prefix"
1696 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1697 prefix="$acl_save_prefix"
1700 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1701 dnl variables prefix and exec_prefix bound to the values they will have
1702 dnl at the end of the configure script.
1703 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1705 acl_save_prefix="$prefix"
1706 prefix="$acl_final_prefix"
1707 acl_save_exec_prefix="$exec_prefix"
1708 exec_prefix="$acl_final_exec_prefix"
1710 exec_prefix="$acl_save_exec_prefix"
1711 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.])
1743 # longlong.m4 serial 4
1744 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
1745 dnl This file is free software, distributed under the terms of the GNU
1746 dnl General Public License. As a special exception to the GNU General
1747 dnl Public License, this file may be distributed as part of a program
1748 dnl that contains a configuration script generated by Autoconf, under
1749 dnl the same distribution terms as the rest of that program.
1751 dnl From Paul Eggert.
1753 # Define HAVE_LONG_LONG if 'long long' works.
1755 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
1757 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1758 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
1759 [long long llmax = (long long) -1;
1760 return ll << i | ll >> i | llmax / ll | llmax % ll;],
1761 ac_cv_type_long_long=yes,
1762 ac_cv_type_long_long=no)])
1763 if test $ac_cv_type_long_long = yes; then
1764 AC_DEFINE(HAVE_LONG_LONG, 1,
1765 [Define if you have the 'long long' type.])
1768 # nls.m4 serial 1 (gettext-0.12)
1769 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1770 dnl This file is free software, distributed under the terms of the GNU
1771 dnl General Public License. As a special exception to the GNU General
1772 dnl Public License, this file may be distributed as part of a program
1773 dnl that contains a configuration script generated by Autoconf, under
1774 dnl the same distribution terms as the rest of that program.
1776 dnl This file can can be used in projects which are not available under
1777 dnl the GNU General Public License or the GNU Library General Public
1778 dnl License but which still want to provide support for the GNU gettext
1780 dnl Please note that the actual code of the GNU gettext library is covered
1781 dnl by the GNU Library General Public License, and the rest of the GNU
1782 dnl gettext package package is covered by the GNU General Public License.
1783 dnl They are *not* in the public domain.
1786 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1787 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1791 AC_MSG_CHECKING([whether NLS is requested])
1792 dnl Default is enabled NLS
1794 [ --disable-nls do not use Native Language Support],
1795 USE_NLS=$enableval, USE_NLS=yes)
1796 AC_MSG_RESULT($USE_NLS)
1800 AC_DEFUN([AM_MKINSTALLDIRS],
1802 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1803 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1804 dnl Try to locate it.
1806 if test -n "$ac_aux_dir"; then
1807 case "$ac_aux_dir" in
1808 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1809 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1812 if test -z "$MKINSTALLDIRS"; then
1813 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1815 AC_SUBST(MKINSTALLDIRS)
1817 # po.m4 serial 3 (gettext-0.14)
1818 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1819 dnl This file is free software, distributed under the terms of the GNU
1820 dnl General Public License. As a special exception to the GNU General
1821 dnl Public License, this file may be distributed as part of a program
1822 dnl that contains a configuration script generated by Autoconf, under
1823 dnl the same distribution terms as the rest of that program.
1825 dnl This file can can be used in projects which are not available under
1826 dnl the GNU General Public License or the GNU Library General Public
1827 dnl License but which still want to provide support for the GNU gettext
1829 dnl Please note that the actual code of the GNU gettext library is covered
1830 dnl by the GNU Library General Public License, and the rest of the GNU
1831 dnl gettext package package is covered by the GNU General Public License.
1832 dnl They are *not* in the public domain.
1835 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1836 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1838 dnl Checks for all prerequisites of the po subdirectory.
1839 AC_DEFUN([AM_PO_SUBDIRS],
1841 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1842 AC_REQUIRE([AC_PROG_INSTALL])dnl
1843 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1844 AC_REQUIRE([AM_NLS])dnl
1846 dnl Perform the following tests also if --disable-nls has been given,
1847 dnl because they are needed for "make dist" to work.
1849 dnl Search for GNU msgfmt in the PATH.
1850 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1851 dnl The second test excludes FreeBSD msgfmt.
1852 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1853 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1854 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1856 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1858 dnl Search for GNU xgettext 0.12 or newer in the PATH.
1859 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1860 dnl The second test excludes FreeBSD xgettext.
1861 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1862 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1863 (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)],
1865 dnl Remove leftover from FreeBSD xgettext call.
1868 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1869 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1870 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1872 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1873 dnl Test whether we really found GNU msgfmt.
1874 if test "$GMSGFMT" != ":"; then
1875 dnl If it is no GNU msgfmt we define it as : so that the
1876 dnl Makefiles still can work.
1877 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1878 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1881 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1883 [found $GMSGFMT program is not GNU msgfmt; ignore it])
1888 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1889 dnl Test whether we really found GNU xgettext.
1890 if test "$XGETTEXT" != ":"; then
1891 dnl If it is no GNU xgettext we define it as : so that the
1892 dnl Makefiles still can work.
1893 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1894 (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
1898 [found xgettext program is not GNU xgettext; ignore it])
1901 dnl Remove leftover from FreeBSD xgettext call.
1905 AC_OUTPUT_COMMANDS([
1906 for ac_file in $CONFIG_FILES; do
1907 # Support "outfile[:infile[:infile...]]"
1909 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1911 # PO directories have a Makefile.in generated from Makefile.in.in.
1912 case "$ac_file" in */Makefile.in)
1913 # Adjust a relative srcdir.
1914 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1915 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1916 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1917 # In autoconf-2.13 it is called $ac_given_srcdir.
1918 # In autoconf-2.50 it is called $srcdir.
1919 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1920 case "$ac_given_srcdir" in
1921 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1922 /*) top_srcdir="$ac_given_srcdir" ;;
1923 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1925 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1926 rm -f "$ac_dir/POTFILES"
1927 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1928 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1929 POMAKEFILEDEPS="POTFILES.in"
1930 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1931 # on $ac_dir but don't depend on user-specified configuration
1933 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1934 # The LINGUAS file contains the set of available languages.
1935 if test -n "$OBSOLETE_ALL_LINGUAS"; then
1936 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1938 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1939 # Hide the ALL_LINGUAS assigment from automake.
1940 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1941 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1943 # The set of available languages was given in configure.in.
1944 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1947 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1948 # Compute UPDATEPOFILES
1949 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1950 # Compute DUMMYPOFILES
1951 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1953 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1954 case "$ac_given_srcdir" in
1956 *) srcdirpre='$(srcdir)/' ;;
1962 for lang in $ALL_LINGUAS; do
1963 POFILES="$POFILES $srcdirpre$lang.po"
1964 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1965 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1966 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1968 # CATALOGS depends on both $ac_dir and the user's LINGUAS
1969 # environment variable.
1971 if test -n "$ALL_LINGUAS"; then
1972 for presentlang in $ALL_LINGUAS; do
1974 if test "%UNSET%" != "$LINGUAS"; then
1975 desiredlanguages="$LINGUAS"
1977 desiredlanguages="$ALL_LINGUAS"
1979 for desiredlang in $desiredlanguages; do
1980 # Use the presentlang catalog if desiredlang is
1981 # a. equal to presentlang, or
1982 # b. a variant of presentlang (because in this case,
1983 # presentlang can be used as a fallback for messages
1984 # which are not translated in the desiredlang catalog).
1985 case "$desiredlang" in
1986 "$presentlang"*) useit=yes;;
1989 if test $useit = yes; then
1990 INST_LINGUAS="$INST_LINGUAS $presentlang"
1995 if test -n "$INST_LINGUAS"; then
1996 for lang in $INST_LINGUAS; do
1997 CATALOGS="$CATALOGS $lang.gmo"
2000 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2001 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"
2002 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2003 if test -f "$f"; then
2005 *.orig | *.bak | *~) ;;
2006 *) cat "$f" >> "$ac_dir/Makefile" ;;
2014 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2015 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2017 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2018 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2019 LINGUAS="${LINGUAS-%UNSET%}"
2023 dnl Postprocesses a Makefile in a directory containing PO files.
2024 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2026 # When this code is run, in config.status, two variables have already been
2028 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2029 # - LINGUAS is the value of the environment variable LINGUAS at configure
2033 # Adjust a relative srcdir.
2034 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2035 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2036 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2037 # In autoconf-2.13 it is called $ac_given_srcdir.
2038 # In autoconf-2.50 it is called $srcdir.
2039 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2040 case "$ac_given_srcdir" in
2041 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2042 /*) top_srcdir="$ac_given_srcdir" ;;
2043 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2046 # Find a way to echo strings without interpreting backslash.
2047 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2050 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2051 gt_echo='printf %s\n'
2062 # A sed script that extracts the value of VARIABLE from a Makefile.
2064 # Test if the hold space is empty.
2069 # Yes it was empty. Look if we have the expected variable definition.
2070 /^[ ]*VARIABLE[ ]*=/{
2071 # Seen the first line of the variable definition.
2072 s/^[ ]*VARIABLE[ ]*=//
2077 # Here we are processing a line from the variable definition.
2078 # Remove comment, more precisely replace it with a space.
2080 # See if the line ends in a backslash.
2084 # Print the line, without the trailing backslash.
2087 # There was no trailing backslash. The end of the variable definition is
2088 # reached. Clear the hold space.
2093 # A trailing backslash means that the variable definition continues in the
2094 # next line. Put a nonempty string into the hold space to indicate this.
2101 # Set POTFILES to the value of the Makefile variable POTFILES.
2102 sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2103 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2104 # Compute POTFILES_DEPS as
2105 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2107 for file in $POTFILES; do
2108 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2112 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2113 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2115 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2116 # The LINGUAS file contains the set of available languages.
2117 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2118 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2120 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2121 sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2122 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2124 # Hide the ALL_LINGUAS assigment from automake.
2125 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2127 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2128 # Compute UPDATEPOFILES
2129 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2130 # Compute DUMMYPOFILES
2131 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2133 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2134 # Compute PROPERTIESFILES
2135 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2136 # Compute CLASSFILES
2137 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2139 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2141 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2142 # Compute RESOURCESDLLFILES
2143 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2144 case "$ac_given_srcdir" in
2146 *) srcdirpre='$(srcdir)/' ;;
2157 for lang in $ALL_LINGUAS; do
2158 POFILES="$POFILES $srcdirpre$lang.po"
2159 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2160 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2161 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2162 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2163 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2164 QMFILES="$QMFILES $srcdirpre$lang.qm"
2165 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2166 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2167 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2168 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2170 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2171 # environment variable.
2173 if test -n "$ALL_LINGUAS"; then
2174 for presentlang in $ALL_LINGUAS; do
2176 if test "%UNSET%" != "$LINGUAS"; then
2177 desiredlanguages="$LINGUAS"
2179 desiredlanguages="$ALL_LINGUAS"
2181 for desiredlang in $desiredlanguages; do
2182 # Use the presentlang catalog if desiredlang is
2183 # a. equal to presentlang, or
2184 # b. a variant of presentlang (because in this case,
2185 # presentlang can be used as a fallback for messages
2186 # which are not translated in the desiredlang catalog).
2187 case "$desiredlang" in
2188 "$presentlang"*) useit=yes;;
2191 if test $useit = yes; then
2192 INST_LINGUAS="$INST_LINGUAS $presentlang"
2201 if test -n "$INST_LINGUAS"; then
2202 for lang in $INST_LINGUAS; do
2203 CATALOGS="$CATALOGS $lang.gmo"
2204 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2205 QTCATALOGS="$QTCATALOGS $lang.qm"
2206 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2207 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2208 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2209 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2213 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"
2214 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2215 # Add dependencies that cannot be formulated as a simple suffix rule.
2216 for lang in $ALL_LINGUAS; do
2217 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2218 cat >> "$ac_file.tmp" <<EOF
2219 $frobbedlang.msg: $lang.po
2220 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2221 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2225 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2226 # Add dependencies that cannot be formulated as a simple suffix rule.
2227 for lang in $ALL_LINGUAS; do
2228 frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2229 cat >> "$ac_file.tmp" <<EOF
2230 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2231 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2232 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2236 if test -n "$POMAKEFILEDEPS"; then
2237 cat >> "$ac_file.tmp" <<EOF
2238 Makefile: $POMAKEFILEDEPS
2241 mv "$ac_file.tmp" "$ac_file"
2243 # printf-posix.m4 serial 2 (gettext-0.13.1)
2244 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2245 dnl This file is free software, distributed under the terms of the GNU
2246 dnl General Public License. As a special exception to the GNU General
2247 dnl Public License, this file may be distributed as part of a program
2248 dnl that contains a configuration script generated by Autoconf, under
2249 dnl the same distribution terms as the rest of that program.
2251 dnl From Bruno Haible.
2252 dnl Test whether the printf() function supports POSIX/XSI format strings with
2255 AC_DEFUN([gt_PRINTF_POSIX],
2257 AC_REQUIRE([AC_PROG_CC])
2258 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
2259 gt_cv_func_printf_posix,
2264 /* The string "%2$d %1$d", with dollar characters protected from the shell's
2265 dollar expansion (possibly an autoconf bug). */
2266 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
2267 static char buf[100];
2270 sprintf (buf, format, 33, 55);
2271 return (strcmp (buf, "55 33") != 0);
2272 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
2274 AC_EGREP_CPP(notposix, [
2275 #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
2278 ], gt_cv_func_printf_posix="guessing no",
2279 gt_cv_func_printf_posix="guessing yes")
2282 case $gt_cv_func_printf_posix in
2284 AC_DEFINE(HAVE_POSIX_PRINTF, 1,
2285 [Define if your printf() function supports format strings with positions.])
2289 # progtest.m4 serial 3 (gettext-0.12)
2290 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2291 dnl This file is free software, distributed under the terms of the GNU
2292 dnl General Public License. As a special exception to the GNU General
2293 dnl Public License, this file may be distributed as part of a program
2294 dnl that contains a configuration script generated by Autoconf, under
2295 dnl the same distribution terms as the rest of that program.
2297 dnl This file can can be used in projects which are not available under
2298 dnl the GNU General Public License or the GNU Library General Public
2299 dnl License but which still want to provide support for the GNU gettext
2301 dnl Please note that the actual code of the GNU gettext library is covered
2302 dnl by the GNU Library General Public License, and the rest of the GNU
2303 dnl gettext package package is covered by the GNU General Public License.
2304 dnl They are *not* in the public domain.
2307 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2309 # Search path for a program which passes the given test.
2311 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2312 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2313 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2315 # Prepare PATH_SEPARATOR.
2316 # The user is always right.
2317 if test "${PATH_SEPARATOR+set}" != set; then
2318 echo "#! /bin/sh" >conf$$.sh
2319 echo "exit 0" >>conf$$.sh
2321 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2329 # Find out how to test for executable files. Don't use a zero-byte file,
2330 # as systems may use methods other than mode bits to determine executability.
2331 cat >conf$$.file <<_ASEOF
2335 chmod +x conf$$.file
2336 if test -x conf$$.file >/dev/null 2>&1; then
2337 ac_executable_p="test -x"
2339 ac_executable_p="test -f"
2343 # Extract the first word of "$2", so it can be a program name with args.
2344 set dummy $2; ac_word=[$]2
2345 AC_MSG_CHECKING([for $ac_word])
2346 AC_CACHE_VAL(ac_cv_path_$1,
2348 [[\\/]]* | ?:[[\\/]]*)
2349 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2352 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2353 for ac_dir in ifelse([$5], , $PATH, [$5]); do
2355 test -z "$ac_dir" && ac_dir=.
2356 for ac_exec_ext in '' $ac_executable_extensions; do
2357 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2359 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2366 dnl If no 4th arg is given, leave the cache variable unset,
2367 dnl so AC_PATH_PROGS will keep looking.
2368 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2373 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2374 AC_MSG_RESULT([$]$1)
2380 # signed.m4 serial 1 (gettext-0.10.40)
2381 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2382 dnl This file is free software, distributed under the terms of the GNU
2383 dnl General Public License. As a special exception to the GNU General
2384 dnl Public License, this file may be distributed as part of a program
2385 dnl that contains a configuration script generated by Autoconf, under
2386 dnl the same distribution terms as the rest of that program.
2388 dnl From Bruno Haible.
2390 AC_DEFUN([bh_C_SIGNED],
2392 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2393 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2394 if test $bh_cv_c_signed = no; then
2396 [Define to empty if the C compiler doesn't support this keyword.])
2399 # size_max.m4 serial 2
2400 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2401 dnl This file is free software, distributed under the terms of the GNU
2402 dnl General Public License. As a special exception to the GNU General
2403 dnl Public License, this file may be distributed as part of a program
2404 dnl that contains a configuration script generated by Autoconf, under
2405 dnl the same distribution terms as the rest of that program.
2407 dnl From Bruno Haible.
2409 AC_DEFUN([gl_SIZE_MAX],
2411 AC_CHECK_HEADERS(stdint.h)
2412 dnl First test whether the system already has SIZE_MAX.
2413 AC_MSG_CHECKING([for SIZE_MAX])
2415 AC_EGREP_CPP([Found it], [
2424 if test -z "$result"; then
2425 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2426 dnl than the type 'unsigned long'.
2427 dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2428 dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2429 _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2430 [#include <stddef.h>], result=?)
2431 _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2432 [#include <stddef.h>], result=?)
2433 _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2434 [#include <stddef.h>], result=?)
2435 if test "$fits_in_uint" = 1; then
2436 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2437 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2438 AC_TRY_COMPILE([#include <stddef.h>
2440 extern unsigned long foo;
2441 ], [], fits_in_uint=0)
2443 if test -z "$result"; then
2444 if test "$fits_in_uint" = 1; then
2445 result="$res_hi$res_lo"U
2447 result="$res_hi$res_lo"UL
2450 dnl Shouldn't happen, but who knows...
2454 AC_MSG_RESULT([$result])
2455 if test "$result" != yes; then
2456 AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
2457 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
2460 # stdint_h.m4 serial 3 (gettext-0.12)
2461 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2462 dnl This file is free software, distributed under the terms of the GNU
2463 dnl General Public License. As a special exception to the GNU General
2464 dnl Public License, this file may be distributed as part of a program
2465 dnl that contains a configuration script generated by Autoconf, under
2466 dnl the same distribution terms as the rest of that program.
2468 dnl From Paul Eggert.
2470 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2471 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2473 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2475 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2477 [#include <sys/types.h>
2478 #include <stdint.h>],
2479 [uintmax_t i = (uintmax_t) -1;],
2480 jm_ac_cv_header_stdint_h=yes,
2481 jm_ac_cv_header_stdint_h=no)])
2482 if test $jm_ac_cv_header_stdint_h = yes; then
2483 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2484 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2485 and declares uintmax_t. ])
2488 # uintmax_t.m4 serial 7 (gettext-0.12)
2489 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2490 dnl This file is free software, distributed under the terms of the GNU
2491 dnl General Public License. As a special exception to the GNU General
2492 dnl Public License, this file may be distributed as part of a program
2493 dnl that contains a configuration script generated by Autoconf, under
2494 dnl the same distribution terms as the rest of that program.
2496 dnl From Paul Eggert.
2500 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2501 # if it is not already defined in <stdint.h> or <inttypes.h>.
2503 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2505 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2506 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2507 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2508 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2509 test $ac_cv_type_unsigned_long_long = yes \
2510 && ac_type='unsigned long long' \
2511 || ac_type='unsigned long'
2512 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2513 [Define to unsigned long or unsigned long long
2514 if <stdint.h> and <inttypes.h> don't define.])
2516 AC_DEFINE(HAVE_UINTMAX_T, 1,
2517 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2520 # ulonglong.m4 serial 3
2521 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2522 dnl This file is free software, distributed under the terms of the GNU
2523 dnl General Public License. As a special exception to the GNU General
2524 dnl Public License, this file may be distributed as part of a program
2525 dnl that contains a configuration script generated by Autoconf, under
2526 dnl the same distribution terms as the rest of that program.
2528 dnl From Paul Eggert.
2530 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2532 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2534 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2535 [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2536 [unsigned long long ullmax = (unsigned long long) -1;
2537 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2538 ac_cv_type_unsigned_long_long=yes,
2539 ac_cv_type_unsigned_long_long=no)])
2540 if test $ac_cv_type_unsigned_long_long = yes; then
2541 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2542 [Define if you have the 'unsigned long long' type.])
2545 # wchar_t.m4 serial 1 (gettext-0.12)
2546 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2547 dnl This file is free software, distributed under the terms of the GNU
2548 dnl General Public License. As a special exception to the GNU General
2549 dnl Public License, this file may be distributed as part of a program
2550 dnl that contains a configuration script generated by Autoconf, under
2551 dnl the same distribution terms as the rest of that program.
2553 dnl From Bruno Haible.
2554 dnl Test whether <stddef.h> has the 'wchar_t' type.
2555 dnl Prerequisite: AC_PROG_CC
2557 AC_DEFUN([gt_TYPE_WCHAR_T],
2559 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2560 [AC_TRY_COMPILE([#include <stddef.h>
2561 wchar_t foo = (wchar_t)'\0';], ,
2562 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
2563 if test $gt_cv_c_wchar_t = yes; then
2564 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
2567 # wint_t.m4 serial 1 (gettext-0.12)
2568 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2569 dnl This file is free software, distributed under the terms of the GNU
2570 dnl General Public License. As a special exception to the GNU General
2571 dnl Public License, this file may be distributed as part of a program
2572 dnl that contains a configuration script generated by Autoconf, under
2573 dnl the same distribution terms as the rest of that program.
2575 dnl From Bruno Haible.
2576 dnl Test whether <wchar.h> has the 'wint_t' type.
2577 dnl Prerequisite: AC_PROG_CC
2579 AC_DEFUN([gt_TYPE_WINT_T],
2581 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2582 [AC_TRY_COMPILE([#include <wchar.h>
2583 wint_t foo = (wchar_t)'\0';], ,
2584 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
2585 if test $gt_cv_c_wint_t = yes; then
2586 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
2590 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2591 dnl This file is free software, distributed under the terms of the GNU
2592 dnl General Public License. As a special exception to the GNU General
2593 dnl Public License, this file may be distributed as part of a program
2594 dnl that contains a configuration script generated by Autoconf, under
2595 dnl the same distribution terms as the rest of that program.
2597 AC_DEFUN([gl_XSIZE],
2599 dnl Prerequisites of lib/xsize.h.
2600 AC_REQUIRE([gl_SIZE_MAX])
2601 AC_CHECK_HEADERS(stdint.h)
2604 # Excerpted from pkg.m4 - Macros to locate and utilise pkg-config
2606 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
2608 # This program is free software; you can redistribute it and/or modify
2609 # it under the terms of the GNU General Public License as published by
2610 # the Free Software Foundation; either version 2 of the License, or
2611 # (at your option) any later version.
2613 # This program is distributed in the hope that it will be useful, but
2614 # WITHOUT ANY WARRANTY; without even the implied warranty of
2615 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2616 # General Public License for more details.
2618 # You should have received a copy of the GNU General Public License
2619 # along with this program; if not, write to the Free Software
2620 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2622 # As a special exception to the GNU General Public License, if you
2623 # distribute this file as part of a program that contains a
2624 # configuration script generated by Autoconf, you may include it under
2625 # the same distribution terms that you use for the rest of that program.
2627 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
2628 # ----------------------------------
2629 AC_DEFUN([PKG_PROG_PKG_CONFIG],
2630 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
2631 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
2632 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
2633 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
2634 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2636 if test -n "$PKG_CONFIG"; then
2637 _pkg_min_version=m4_default([$1], [0.9.0])
2638 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
2639 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
2640 AC_MSG_RESULT([yes])
2647 ])# PKG_PROG_PKG_CONFIG
2649 m4_include([acinclude.m4])