1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009 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 m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17 [m4_warning([this file was generated for autoconf 2.65.
18 You have another version of autoconf. It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
22 # codeset.m4 serial 2 (gettext-0.16)
23 dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
24 dnl This file is free software; the Free Software Foundation
25 dnl gives unlimited permission to copy and/or distribute it,
26 dnl with or without modifications, as long as this notice is preserved.
28 dnl From Bruno Haible.
30 AC_DEFUN([AM_LANGINFO_CODESET],
32 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
33 [AC_TRY_LINK([#include <langinfo.h>],
34 [char* cs = nl_langinfo(CODESET); return !cs;],
35 am_cv_langinfo_codeset=yes,
36 am_cv_langinfo_codeset=no)
38 if test $am_cv_langinfo_codeset = yes; then
39 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
40 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
44 # gettext.m4 serial 60 (gettext-0.17)
45 dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
46 dnl This file is free software; the Free Software Foundation
47 dnl gives unlimited permission to copy and/or distribute it,
48 dnl with or without modifications, as long as this notice is preserved.
50 dnl This file can can be used in projects which are not available under
51 dnl the GNU General Public License or the GNU Library General Public
52 dnl License but which still want to provide support for the GNU gettext
54 dnl Please note that the actual code of the GNU gettext library is covered
55 dnl by the GNU Library General Public License, and the rest of the GNU
56 dnl gettext package package is covered by the GNU General Public License.
57 dnl They are *not* in the public domain.
60 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
61 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
63 dnl Macro to add for using GNU gettext.
65 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
66 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
67 dnl default (if it is not specified or empty) is 'no-libtool'.
68 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
69 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
70 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
71 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
72 dnl depending on --{enable,disable}-{shared,static} and on the presence of
73 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
74 dnl $(top_builddir)/intl/libintl.a will be created.
75 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
76 dnl implementations (in libc or libintl) without the ngettext() function
77 dnl will be ignored. If NEEDSYMBOL is specified and is
78 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
79 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
80 dnl INTLDIR is used to find the intl libraries. If empty,
81 dnl the value `$(top_builddir)/intl/' is used.
83 dnl The result of the configuration is one of three cases:
84 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
86 dnl Catalog format: GNU --> install in $(datadir)
87 dnl Catalog extension: .mo after installation, .gmo in source tree
88 dnl 2) GNU gettext has been found in the system's C library.
89 dnl Catalog format: GNU --> install in $(datadir)
90 dnl Catalog extension: .mo after installation, .gmo in source tree
91 dnl 3) No internationalization, always use English msgid.
92 dnl Catalog format: none
93 dnl Catalog extension: none
94 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
95 dnl The use of .gmo is historical (it was needed to avoid overwriting the
96 dnl GNU format catalogs when building on a platform with an X/Open gettext),
97 dnl but we keep it in order not to force irrelevant filename changes on the
100 AC_DEFUN([AM_GNU_GETTEXT],
102 dnl Argument checking.
103 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
104 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
106 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
107 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
109 define([gt_included_intl],
110 ifelse([$1], [external],
111 ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
113 define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
115 AM_GNU_GETTEXT_NEED([$2])
117 AC_REQUIRE([AM_PO_SUBDIRS])dnl
118 ifelse(gt_included_intl, yes, [
119 AC_REQUIRE([AM_INTL_SUBDIR])dnl
122 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
123 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
124 AC_REQUIRE([AC_LIB_RPATH])
126 dnl Sometimes libintl requires libiconv, so first search for libiconv.
127 dnl Ideally we would do this search only after the
128 dnl if test "$USE_NLS" = "yes"; then
129 dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
130 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
131 dnl the configure script would need to contain the same shell code
132 dnl again, outside any 'if'. There are two solutions:
133 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
134 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
135 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
136 dnl documented, we avoid it.
137 ifelse(gt_included_intl, yes, , [
138 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
141 dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
147 ifelse(gt_included_intl, yes, [
148 BUILD_INCLUDED_LIBINTL=no
149 USE_INCLUDED_LIBINTL=no
155 dnl Add a version number to the cache macros.
156 case " $gt_needs " in
157 *" need-formatstring-macros "*) gt_api_version=3 ;;
158 *" need-ngettext "*) gt_api_version=2 ;;
159 *) gt_api_version=1 ;;
161 gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
162 gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
164 dnl If we use NLS figure out what method
165 if test "$USE_NLS" = "yes"; then
166 gt_use_preinstalled_gnugettext=no
167 ifelse(gt_included_intl, yes, [
168 AC_MSG_CHECKING([whether included gettext is requested])
169 AC_ARG_WITH(included-gettext,
170 [ --with-included-gettext use the GNU gettext library included here],
171 nls_cv_force_use_gnu_gettext=$withval,
172 nls_cv_force_use_gnu_gettext=no)
173 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
175 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
176 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
178 dnl User does not insist on using GNU NLS library. Figure out what
179 dnl to use. If GNU gettext is available we use this. Else we have
180 dnl to fall back to GNU NLS library.
182 if test $gt_api_version -ge 3; then
183 gt_revision_test_code='
184 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
185 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
188 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
192 gt_revision_test_code=
194 if test $gt_api_version -ge 2; then
195 gt_expression_test_code=' + * ngettext ("", "", 0)'
197 gt_expression_test_code=
200 AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
201 [AC_TRY_LINK([#include <libintl.h>
202 $gt_revision_test_code
203 extern int _nl_msg_cat_cntr;
204 extern int *_nl_domain_bindings;],
205 [bindtextdomain ("", "");
206 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
207 [eval "$gt_func_gnugettext_libc=yes"],
208 [eval "$gt_func_gnugettext_libc=no"])])
210 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
211 dnl Sometimes libintl requires libiconv, so first search for libiconv.
212 ifelse(gt_included_intl, yes, , [
215 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
216 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
217 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
218 dnl even if libiconv doesn't exist.
219 AC_LIB_LINKFLAGS_BODY([intl])
220 AC_CACHE_CHECK([for GNU gettext in libintl],
221 [$gt_func_gnugettext_libintl],
222 [gt_save_CPPFLAGS="$CPPFLAGS"
223 CPPFLAGS="$CPPFLAGS $INCINTL"
225 LIBS="$LIBS $LIBINTL"
226 dnl Now see whether libintl exists and does not depend on libiconv.
227 AC_TRY_LINK([#include <libintl.h>
228 $gt_revision_test_code
229 extern int _nl_msg_cat_cntr;
234 const char *_nl_expand_alias (const char *);],
235 [bindtextdomain ("", "");
236 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
237 [eval "$gt_func_gnugettext_libintl=yes"],
238 [eval "$gt_func_gnugettext_libintl=no"])
239 dnl Now see whether libintl exists and depends on libiconv.
240 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
241 LIBS="$LIBS $LIBICONV"
242 AC_TRY_LINK([#include <libintl.h>
243 $gt_revision_test_code
244 extern int _nl_msg_cat_cntr;
249 const char *_nl_expand_alias (const char *);],
250 [bindtextdomain ("", "");
251 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
252 [LIBINTL="$LIBINTL $LIBICONV"
253 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
254 eval "$gt_func_gnugettext_libintl=yes"
257 CPPFLAGS="$gt_save_CPPFLAGS"
258 LIBS="$gt_save_LIBS"])
261 dnl If an already present or preinstalled GNU gettext() is found,
262 dnl use it. But if this macro is used in GNU gettext, and GNU
263 dnl gettext is already preinstalled in libintl, we update this
264 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
265 if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
266 || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
267 && test "$PACKAGE" != gettext-runtime \
268 && test "$PACKAGE" != gettext-tools; }; then
269 gt_use_preinstalled_gnugettext=yes
271 dnl Reset the values set by searching for libintl.
277 ifelse(gt_included_intl, yes, [
278 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
279 dnl GNU gettext is not found in the C library.
280 dnl Fall back on included GNU gettext library.
281 nls_cv_use_gnu_gettext=yes
285 if test "$nls_cv_use_gnu_gettext" = "yes"; then
286 dnl Mark actions used to generate GNU NLS library.
287 BUILD_INCLUDED_LIBINTL=yes
288 USE_INCLUDED_LIBINTL=yes
289 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
290 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
291 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
295 if test "$gt_use_preinstalled_gnugettext" = "yes" \
296 || test "$nls_cv_use_gnu_gettext" = "yes"; then
297 dnl Mark actions to use GNU gettext tools.
302 if test -n "$INTL_MACOSX_LIBS"; then
303 if test "$gt_use_preinstalled_gnugettext" = "yes" \
304 || test "$nls_cv_use_gnu_gettext" = "yes"; then
305 dnl Some extra flags are needed during linking.
306 LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
307 LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
311 if test "$gt_use_preinstalled_gnugettext" = "yes" \
312 || test "$nls_cv_use_gnu_gettext" = "yes"; then
313 AC_DEFINE(ENABLE_NLS, 1,
314 [Define to 1 if translation of program messages to the user's native language
321 AC_MSG_CHECKING([whether to use NLS])
322 AC_MSG_RESULT([$USE_NLS])
323 if test "$USE_NLS" = "yes"; then
324 AC_MSG_CHECKING([where the gettext function comes from])
325 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
326 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
327 gt_source="external libintl"
332 gt_source="included intl directory"
334 AC_MSG_RESULT([$gt_source])
337 if test "$USE_NLS" = "yes"; then
339 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
340 if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
341 AC_MSG_CHECKING([how to link with libintl])
342 AC_MSG_RESULT([$LIBINTL])
343 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
346 dnl For backward compatibility. Some packages may be using this.
347 AC_DEFINE(HAVE_GETTEXT, 1,
348 [Define if the GNU gettext() function is already present or preinstalled.])
349 AC_DEFINE(HAVE_DCGETTEXT, 1,
350 [Define if the GNU dcgettext() function is already present or preinstalled.])
353 dnl We need to process the po/ directory.
357 ifelse(gt_included_intl, yes, [
358 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
359 dnl to 'yes' because some of the testsuite requires it.
360 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
361 BUILD_INCLUDED_LIBINTL=yes
364 dnl Make all variables we use known to autoconf.
365 AC_SUBST(BUILD_INCLUDED_LIBINTL)
366 AC_SUBST(USE_INCLUDED_LIBINTL)
369 dnl For backward compatibility. Some configure.ins may be using this.
373 dnl For backward compatibility. Some Makefiles may be using this.
375 AC_SUBST(DATADIRNAME)
377 dnl For backward compatibility. Some Makefiles may be using this.
381 dnl For backward compatibility. Some Makefiles may be using this.
385 dnl For backward compatibility. Some Makefiles may be using this.
387 if test "$USE_INCLUDED_LIBINTL" = yes; then
388 INTLOBJS="\$(GETTOBJS)"
392 dnl Enable libtool support if the surrounding package wishes it.
393 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
394 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
397 dnl For backward compatibility. Some Makefiles may be using this.
401 dnl Make all documented variables known to autoconf.
408 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
409 m4_define([gt_NEEDS_INIT],
411 m4_divert_text([DEFAULTS], [gt_needs=])
412 m4_define([gt_NEEDS_INIT], [])
416 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
417 AC_DEFUN([AM_GNU_GETTEXT_NEED],
419 m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
423 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
424 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
427 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
428 dnl This file is free software; the Free Software Foundation
429 dnl gives unlimited permission to copy and/or distribute it,
430 dnl with or without modifications, as long as this notice is preserved.
432 # Test for the GNU C Library, version 2.0 or newer.
435 AC_DEFUN([gt_GLIBC2],
437 AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
439 [AC_EGREP_CPP([Lucky GNU user],
441 #include <features.h>
442 #ifdef __GNU_LIBRARY__
448 ac_cv_gnu_library_2=yes,
449 ac_cv_gnu_library_2=no)
453 GLIBC2="$ac_cv_gnu_library_2"
457 # glibc21.m4 serial 3
458 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
459 dnl This file is free software; the Free Software Foundation
460 dnl gives unlimited permission to copy and/or distribute it,
461 dnl with or without modifications, as long as this notice is preserved.
463 # Test for the GNU C Library, version 2.1 or newer.
466 AC_DEFUN([gl_GLIBC21],
468 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
469 ac_cv_gnu_library_2_1,
470 [AC_EGREP_CPP([Lucky GNU user],
472 #include <features.h>
473 #ifdef __GNU_LIBRARY__
474 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
479 ac_cv_gnu_library_2_1=yes,
480 ac_cv_gnu_library_2_1=no)
484 GLIBC21="$ac_cv_gnu_library_2_1"
488 # iconv.m4 serial AM6 (gettext-0.17)
489 dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
490 dnl This file is free software; the Free Software Foundation
491 dnl gives unlimited permission to copy and/or distribute it,
492 dnl with or without modifications, as long as this notice is preserved.
494 dnl From Bruno Haible.
496 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
498 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
499 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
500 AC_REQUIRE([AC_LIB_RPATH])
502 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
504 AC_LIB_LINKFLAGS_BODY([iconv])
507 AC_DEFUN([AM_ICONV_LINK],
509 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
510 dnl those with the standalone portable GNU libiconv installed).
511 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
513 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
515 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
517 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
518 dnl because if the user has installed libiconv and not disabled its use
519 dnl via --without-libiconv-prefix, he wants to use it. The first
520 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
521 am_save_CPPFLAGS="$CPPFLAGS"
522 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
524 AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
525 am_cv_func_iconv="no, consider installing GNU libiconv"
527 AC_TRY_LINK([#include <stdlib.h>
529 [iconv_t cd = iconv_open("","");
530 iconv(cd,NULL,NULL,NULL,NULL);
532 am_cv_func_iconv=yes)
533 if test "$am_cv_func_iconv" != yes; then
535 LIBS="$LIBS $LIBICONV"
536 AC_TRY_LINK([#include <stdlib.h>
538 [iconv_t cd = iconv_open("","");
539 iconv(cd,NULL,NULL,NULL,NULL);
542 am_cv_func_iconv=yes)
546 if test "$am_cv_func_iconv" = yes; then
547 AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
548 dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
550 if test $am_cv_lib_iconv = yes; then
551 LIBS="$LIBS $LIBICONV"
558 /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
561 iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
562 if (cd_utf8_to_88591 != (iconv_t)(-1))
564 static const char input[] = "\342\202\254"; /* EURO SIGN */
566 const char *inptr = input;
567 size_t inbytesleft = strlen (input);
569 size_t outbytesleft = sizeof (buf);
570 size_t res = iconv (cd_utf8_to_88591,
571 (char **) &inptr, &inbytesleft,
572 &outptr, &outbytesleft);
577 #if 0 /* This bug could be worked around by the caller. */
578 /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
580 iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
581 if (cd_88591_to_utf8 != (iconv_t)(-1))
583 static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
585 const char *inptr = input;
586 size_t inbytesleft = strlen (input);
588 size_t outbytesleft = sizeof (buf);
589 size_t res = iconv (cd_88591_to_utf8,
590 (char **) &inptr, &inbytesleft,
591 &outptr, &outbytesleft);
597 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
599 if (/* Try standardized names. */
600 iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
601 /* Try IRIX, OSF/1 names. */
602 && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
604 && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
605 /* Try HP-UX names. */
606 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
609 }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
611 aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
612 *) am_cv_func_iconv_works="guessing yes" ;;
616 case "$am_cv_func_iconv_works" in
617 *no) am_func_iconv=no am_cv_lib_iconv=no ;;
618 *) am_func_iconv=yes ;;
621 am_func_iconv=no am_cv_lib_iconv=no
623 if test "$am_func_iconv" = yes; then
624 AC_DEFINE(HAVE_ICONV, 1,
625 [Define if you have the iconv() function and it works.])
627 if test "$am_cv_lib_iconv" = yes; then
628 AC_MSG_CHECKING([how to link with libiconv])
629 AC_MSG_RESULT([$LIBICONV])
631 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
633 CPPFLAGS="$am_save_CPPFLAGS"
644 if test "$am_cv_func_iconv" = yes; then
645 AC_MSG_CHECKING([for iconv declaration])
646 AC_CACHE_VAL(am_cv_proto_iconv, [
654 #if defined(__STDC__) || defined(__cplusplus)
655 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
659 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
660 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);"])
661 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
662 AC_MSG_RESULT([$]{ac_t:-
663 }[$]am_cv_proto_iconv)
664 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
665 [Define as const if the declaration of iconv() needs const.])
669 # intdiv0.m4 serial 2 (gettext-0.17)
670 dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
671 dnl This file is free software; the Free Software Foundation
672 dnl gives unlimited permission to copy and/or distribute it,
673 dnl with or without modifications, as long as this notice is preserved.
675 dnl From Bruno Haible.
677 AC_DEFUN([gt_INTDIV0],
679 AC_REQUIRE([AC_PROG_CC])dnl
680 AC_REQUIRE([AC_CANONICAL_HOST])dnl
682 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
683 gt_cv_int_divbyzero_sigfpe,
685 gt_cv_int_divbyzero_sigfpe=
688 macos* | darwin[6-9]* | darwin[1-9][0-9]*)
689 # On MacOS X 10.2 or newer, just assume the same as when cross-
690 # compiling. If we were to perform the real test, 1 Crash Report
691 # dialog window would pop up.
694 gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
699 if test -z "$gt_cv_int_divbyzero_sigfpe"; then
705 sigfpe_handler (int sig)
707 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
708 exit (sig != SIGFPE);
718 signal (SIGFPE, sigfpe_handler);
719 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
720 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
721 signal (SIGTRAP, sigfpe_handler);
723 /* Linux/SPARC yields signal SIGILL. */
724 #if defined (__sparc__) && defined (__linux__)
725 signal (SIGILL, sigfpe_handler);
732 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
734 # Guess based on the CPU.
737 alpha* | i[34567]86 | x86_64 | m68k | s390*)
738 gt_cv_int_divbyzero_sigfpe="guessing yes";;
740 gt_cv_int_divbyzero_sigfpe="guessing no";;
746 case "$gt_cv_int_divbyzero_sigfpe" in
750 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
751 [Define if integer division by zero raises signal SIGFPE.])
754 # intl.m4 serial 8 (gettext-0.17)
755 dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
756 dnl This file is free software; the Free Software Foundation
757 dnl gives unlimited permission to copy and/or distribute it,
758 dnl with or without modifications, as long as this notice is preserved.
760 dnl This file can can be used in projects which are not available under
761 dnl the GNU General Public License or the GNU Library General Public
762 dnl License but which still want to provide support for the GNU gettext
764 dnl Please note that the actual code of the GNU gettext library is covered
765 dnl by the GNU Library General Public License, and the rest of the GNU
766 dnl gettext package package is covered by the GNU General Public License.
767 dnl They are *not* in the public domain.
770 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
771 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
775 dnl Checks for all prerequisites of the intl subdirectory,
776 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
777 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
778 AC_DEFUN([AM_INTL_SUBDIR],
780 AC_REQUIRE([AC_PROG_INSTALL])dnl
781 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
782 AC_REQUIRE([AC_PROG_CC])dnl
783 AC_REQUIRE([AC_CANONICAL_HOST])dnl
784 AC_REQUIRE([gt_GLIBC2])dnl
785 AC_REQUIRE([AC_PROG_RANLIB])dnl
786 AC_REQUIRE([gl_VISIBILITY])dnl
787 AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
788 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
789 AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
790 AC_REQUIRE([gt_TYPE_WINT_T])dnl
791 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
792 AC_REQUIRE([gt_TYPE_INTMAX_T])
793 AC_REQUIRE([gt_PRINTF_POSIX])
794 AC_REQUIRE([gl_GLIBC21])dnl
795 AC_REQUIRE([gl_XSIZE])dnl
796 AC_REQUIRE([gt_INTL_MACOSX])dnl
798 AC_CHECK_TYPE([ptrdiff_t], ,
799 [AC_DEFINE([ptrdiff_t], [long],
800 [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
802 AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
803 AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
805 dnl Use the _snprintf function only if it is declared (because on NetBSD it
806 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
807 gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
808 gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
810 dnl Use the *_unlocked functions only if they are declared.
811 dnl (because some of them were defined without being declared in Solaris
812 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
813 dnl on Solaris 2.5.1 to run on Solaris 2.6).
814 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
815 gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
817 case $gt_cv_func_printf_posix in
818 *yes) HAVE_POSIX_PRINTF=1 ;;
819 *) HAVE_POSIX_PRINTF=0 ;;
821 AC_SUBST([HAVE_POSIX_PRINTF])
822 if test "$ac_cv_func_asprintf" = yes; then
827 AC_SUBST([HAVE_ASPRINTF])
828 if test "$ac_cv_func_snprintf" = yes; then
833 AC_SUBST([HAVE_SNPRINTF])
834 if test "$ac_cv_func_wprintf" = yes; then
839 AC_SUBST([HAVE_WPRINTF])
844 dnl Compilation on mingw and Cygwin needs special Makefile rules, because
845 dnl 1. when we install a shared library, we must arrange to export
846 dnl auxiliary pointer variables for every exported variable,
847 dnl 2. when we install a shared library and a static library simultaneously,
848 dnl the include file specifies __declspec(dllimport) and therefore we
849 dnl must arrange to define the auxiliary pointer variables for the
850 dnl exported variables _also_ in the static library.
851 if test "$enable_shared" = yes; then
853 mingw* | cygwin*) is_woe32dll=yes ;;
859 WOE32DLL=$is_woe32dll
862 dnl On mingw and Cygwin, we can activate special Makefile rules which add
863 dnl version information to the shared libraries and executables.
865 mingw* | cygwin*) is_woe32=yes ;;
870 if test $WOE32 = yes; then
871 dnl Check for a program that compiles Windows resource files.
872 AC_CHECK_TOOL([WINDRES], [windres])
875 dnl Determine whether when creating a library, "-lc" should be passed to
876 dnl libtool or not. On many platforms, it is required for the libtool option
877 dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
878 dnl in the *.la files - makes it impossible to create multithreaded programs,
879 dnl because libtool also reorders the -lc to come before the -pthread, and
880 dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
887 dnl Rename some macros and functions used for locking.
889 #define __libc_lock_t gl_lock_t
890 #define __libc_lock_define gl_lock_define
891 #define __libc_lock_define_initialized gl_lock_define_initialized
892 #define __libc_lock_init gl_lock_init
893 #define __libc_lock_lock gl_lock_lock
894 #define __libc_lock_unlock gl_lock_unlock
895 #define __libc_lock_recursive_t gl_recursive_lock_t
896 #define __libc_lock_define_recursive gl_recursive_lock_define
897 #define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
898 #define __libc_lock_init_recursive gl_recursive_lock_init
899 #define __libc_lock_lock_recursive gl_recursive_lock_lock
900 #define __libc_lock_unlock_recursive gl_recursive_lock_unlock
901 #define glthread_in_use libintl_thread_in_use
902 #define glthread_lock_init libintl_lock_init
903 #define glthread_lock_lock libintl_lock_lock
904 #define glthread_lock_unlock libintl_lock_unlock
905 #define glthread_lock_destroy libintl_lock_destroy
906 #define glthread_rwlock_init libintl_rwlock_init
907 #define glthread_rwlock_rdlock libintl_rwlock_rdlock
908 #define glthread_rwlock_wrlock libintl_rwlock_wrlock
909 #define glthread_rwlock_unlock libintl_rwlock_unlock
910 #define glthread_rwlock_destroy libintl_rwlock_destroy
911 #define glthread_recursive_lock_init libintl_recursive_lock_init
912 #define glthread_recursive_lock_lock libintl_recursive_lock_lock
913 #define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
914 #define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
915 #define glthread_once libintl_once
916 #define glthread_once_call libintl_once_call
917 #define glthread_once_singlethreaded libintl_once_singlethreaded
922 dnl Checks for the core files of the intl subdirectory:
929 dnl hash-string.h hash-string.c
931 dnl libgnuintl.h.in (except the *printf stuff)
936 dnl plural-exp.h plural-exp.c
938 dnl Used by libglocale.
939 AC_DEFUN([gt_INTL_SUBDIR_CORE],
941 AC_REQUIRE([AC_C_INLINE])dnl
942 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
943 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
944 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
945 AC_REQUIRE([AC_FUNC_MMAP])dnl
946 AC_REQUIRE([gt_INTDIV0])dnl
947 AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
948 AC_REQUIRE([gt_INTTYPES_PRI])dnl
949 AC_REQUIRE([gl_LOCK])dnl
952 [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
954 [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
955 [Define to 1 if the compiler understands __builtin_expect.])])
957 AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
958 AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
959 stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
960 argz_next __fsetlocking])
962 dnl Use the *_unlocked functions only if they are declared.
963 dnl (because some of them were defined without being declared in Solaris
964 dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
965 dnl on Solaris 2.5.1 to run on Solaris 2.6).
966 dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
967 gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
968 gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
972 dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
973 dnl and a _NL_LOCALE_NAME macro always.
974 AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
975 [AC_TRY_LINK([#include <langinfo.h>
976 #include <locale.h>],
977 [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
980 gt_cv_nl_locale_name=yes,
981 gt_cv_nl_locale_name=no)
983 if test $gt_cv_nl_locale_name = yes; then
984 AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
985 [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
988 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
989 dnl because plural.y uses bison specific features. It requires at least
990 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
992 dnl bison is only needed for the maintainer (who touches plural.y). But in
993 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
994 dnl the rule in general Makefile. Now, some people carelessly touch the
995 dnl files or have a broken "make" program, hence the plural.c rule will
996 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
997 dnl present or too old.
998 AC_CHECK_PROGS([INTLBISON], [bison])
999 if test -z "$INTLBISON"; then
1002 dnl Found it, now check the version.
1003 AC_MSG_CHECKING([version of bison])
1004 changequote(<<,>>)dnl
1005 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1006 case $ac_prog_version in
1007 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1008 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1010 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1011 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1013 AC_MSG_RESULT([$ac_prog_version])
1015 if test $ac_verc_fail = yes; then
1021 dnl gt_CHECK_DECL(FUNC, INCLUDES)
1022 dnl Check whether a function is declared.
1023 AC_DEFUN([gt_CHECK_DECL],
1025 AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
1026 [AC_TRY_COMPILE([$2], [
1028 char *p = (char *) $1;
1030 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1031 if test $ac_cv_have_decl_$1 = yes; then
1036 AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1037 [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1040 # intlmacosx.m4 serial 1 (gettext-0.17)
1041 dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
1042 dnl This file is free software; the Free Software Foundation
1043 dnl gives unlimited permission to copy and/or distribute it,
1044 dnl with or without modifications, as long as this notice is preserved.
1046 dnl This file can can be used in projects which are not available under
1047 dnl the GNU General Public License or the GNU Library General Public
1048 dnl License but which still want to provide support for the GNU gettext
1050 dnl Please note that the actual code of the GNU gettext library is covered
1051 dnl by the GNU Library General Public License, and the rest of the GNU
1052 dnl gettext package package is covered by the GNU General Public License.
1053 dnl They are *not* in the public domain.
1055 dnl Checks for special options needed on MacOS X.
1056 dnl Defines INTL_MACOSX_LIBS.
1057 AC_DEFUN([gt_INTL_MACOSX],
1059 dnl Check for API introduced in MacOS X 10.2.
1060 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1061 gt_cv_func_CFPreferencesCopyAppValue,
1062 [gt_save_LIBS="$LIBS"
1063 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1064 AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
1065 [CFPreferencesCopyAppValue(NULL, NULL)],
1066 [gt_cv_func_CFPreferencesCopyAppValue=yes],
1067 [gt_cv_func_CFPreferencesCopyAppValue=no])
1068 LIBS="$gt_save_LIBS"])
1069 if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1070 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
1071 [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1073 dnl Check for API introduced in MacOS X 10.3.
1074 AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
1075 [gt_save_LIBS="$LIBS"
1076 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1077 AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
1078 [gt_cv_func_CFLocaleCopyCurrent=yes],
1079 [gt_cv_func_CFLocaleCopyCurrent=no])
1080 LIBS="$gt_save_LIBS"])
1081 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1082 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
1083 [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1086 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1087 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1089 AC_SUBST([INTL_MACOSX_LIBS])
1092 # intmax.m4 serial 3 (gettext-0.16)
1093 dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
1094 dnl This file is free software; the Free Software Foundation
1095 dnl gives unlimited permission to copy and/or distribute it,
1096 dnl with or without modifications, as long as this notice is preserved.
1098 dnl From Bruno Haible.
1099 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
1100 dnl find a replacement if it is lacking.
1102 AC_DEFUN([gt_TYPE_INTMAX_T],
1104 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1105 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1106 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
1110 #if HAVE_STDINT_H_WITH_UINTMAX
1113 #if HAVE_INTTYPES_H_WITH_UINTMAX
1114 #include <inttypes.h>
1116 ], [intmax_t x = -1;
1118 gt_cv_c_intmax_t=yes,
1119 gt_cv_c_intmax_t=no)])
1120 if test $gt_cv_c_intmax_t = yes; then
1121 AC_DEFINE(HAVE_INTMAX_T, 1,
1122 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
1126 # inttypes-pri.m4 serial 4 (gettext-0.16)
1127 dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
1128 dnl This file is free software; the Free Software Foundation
1129 dnl gives unlimited permission to copy and/or distribute it,
1130 dnl with or without modifications, as long as this notice is preserved.
1132 dnl From Bruno Haible.
1136 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1137 # macros to non-string values. This is the case on AIX 4.3.3.
1139 AC_DEFUN([gt_INTTYPES_PRI],
1141 AC_CHECK_HEADERS([inttypes.h])
1142 if test $ac_cv_header_inttypes_h = yes; then
1143 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1144 gt_cv_inttypes_pri_broken,
1146 AC_TRY_COMPILE([#include <inttypes.h>
1150 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1153 if test "$gt_cv_inttypes_pri_broken" = yes; then
1154 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1155 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1160 AC_SUBST([PRI_MACROS_BROKEN])
1163 # inttypes_h.m4 serial 7
1164 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
1165 dnl This file is free software; the Free Software Foundation
1166 dnl gives unlimited permission to copy and/or distribute it,
1167 dnl with or without modifications, as long as this notice is preserved.
1169 dnl From Paul Eggert.
1171 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1172 # doesn't clash with <sys/types.h>, and declares uintmax_t.
1174 AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1176 AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
1178 [#include <sys/types.h>
1179 #include <inttypes.h>],
1180 [uintmax_t i = (uintmax_t) -1; return !i;],
1181 gl_cv_header_inttypes_h=yes,
1182 gl_cv_header_inttypes_h=no)])
1183 if test $gl_cv_header_inttypes_h = yes; then
1184 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1185 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1186 and declares uintmax_t. ])
1190 # lcmessage.m4 serial 4 (gettext-0.14.2)
1191 dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
1192 dnl This file is free software; the Free Software Foundation
1193 dnl gives unlimited permission to copy and/or distribute it,
1194 dnl with or without modifications, as long as this notice is preserved.
1196 dnl This file can can be used in projects which are not available under
1197 dnl the GNU General Public License or the GNU Library General Public
1198 dnl License but which still want to provide support for the GNU gettext
1200 dnl Please note that the actual code of the GNU gettext library is covered
1201 dnl by the GNU Library General Public License, and the rest of the GNU
1202 dnl gettext package package is covered by the GNU General Public License.
1203 dnl They are *not* in the public domain.
1206 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
1208 # Check whether LC_MESSAGES is available in <locale.h>.
1210 AC_DEFUN([gt_LC_MESSAGES],
1212 AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
1213 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1214 gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
1215 if test $gt_cv_val_LC_MESSAGES = yes; then
1216 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1217 [Define if your <locale.h> file defines LC_MESSAGES.])
1221 # lib-ld.m4 serial 3 (gettext-0.13)
1222 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1223 dnl This file is free software; the Free Software Foundation
1224 dnl gives unlimited permission to copy and/or distribute it,
1225 dnl with or without modifications, as long as this notice is preserved.
1227 dnl Subroutines of libtool.m4,
1228 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1229 dnl with libtool.m4.
1231 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1232 AC_DEFUN([AC_LIB_PROG_LD_GNU],
1233 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1234 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1235 case `$LD -v 2>&1 </dev/null` in
1236 *GNU* | *'with BFD'*)
1237 acl_cv_prog_gnu_ld=yes ;;
1239 acl_cv_prog_gnu_ld=no ;;
1241 with_gnu_ld=$acl_cv_prog_gnu_ld
1244 dnl From libtool-1.4. Sets the variable LD.
1245 AC_DEFUN([AC_LIB_PROG_LD],
1246 [AC_ARG_WITH(gnu-ld,
1247 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1248 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1249 AC_REQUIRE([AC_PROG_CC])dnl
1250 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1251 # Prepare PATH_SEPARATOR.
1252 # The user is always right.
1253 if test "${PATH_SEPARATOR+set}" != set; then
1254 echo "#! /bin/sh" >conf$$.sh
1255 echo "exit 0" >>conf$$.sh
1257 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1265 if test "$GCC" = yes; then
1266 # Check if gcc -print-prog-name=ld gives a path.
1267 AC_MSG_CHECKING([for ld used by GCC])
1270 # gcc leaves a trailing carriage return which upsets mingw
1271 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1273 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1276 # Accept absolute paths.
1277 [[\\/]* | [A-Za-z]:[\\/]*)]
1278 [re_direlt='/[^/][^/]*/\.\./']
1279 # Canonicalize the path of ld
1280 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1281 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1282 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1284 test -z "$LD" && LD="$ac_prog"
1287 # If it fails, then pretend we aren't using GCC.
1291 # If it is relative, then search for the first ld in PATH.
1295 elif test "$with_gnu_ld" = yes; then
1296 AC_MSG_CHECKING([for GNU ld])
1298 AC_MSG_CHECKING([for non-GNU ld])
1300 AC_CACHE_VAL(acl_cv_path_LD,
1301 [if test -z "$LD"; then
1302 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1303 for ac_dir in $PATH; do
1304 test -z "$ac_dir" && ac_dir=.
1305 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1306 acl_cv_path_LD="$ac_dir/$ac_prog"
1307 # Check to see if the program is GNU ld. I'd rather use --version,
1308 # but apparently some GNU ld's only accept -v.
1309 # Break only if it was the GNU/non-GNU ld that we prefer.
1310 case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1311 *GNU* | *'with BFD'*)
1312 test "$with_gnu_ld" != no && break ;;
1314 test "$with_gnu_ld" != yes && break ;;
1320 acl_cv_path_LD="$LD" # Let the user override the test with a path.
1322 LD="$acl_cv_path_LD"
1323 if test -n "$LD"; then
1328 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1332 # lib-link.m4 serial 13 (gettext-0.17)
1333 dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
1334 dnl This file is free software; the Free Software Foundation
1335 dnl gives unlimited permission to copy and/or distribute it,
1336 dnl with or without modifications, as long as this notice is preserved.
1338 dnl From Bruno Haible.
1342 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1343 dnl the libraries corresponding to explicit and implicit dependencies.
1344 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1345 dnl augments the CPPFLAGS variable.
1346 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1347 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1348 AC_DEFUN([AC_LIB_LINKFLAGS],
1350 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1351 AC_REQUIRE([AC_LIB_RPATH])
1352 define([Name],[translit([$1],[./-], [___])])
1353 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1354 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1355 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1356 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1357 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1358 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1359 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1360 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1362 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1363 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1364 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1365 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1366 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1368 AC_SUBST([LTLIB]NAME)
1369 AC_SUBST([LIB]NAME[_PREFIX])
1370 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1371 dnl results of this search when this library appears as a dependency.
1377 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1378 dnl searches for libname and the libraries corresponding to explicit and
1379 dnl implicit dependencies, together with the specified include files and
1380 dnl the ability to compile and link the specified testcode. If found, it
1381 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1382 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1383 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1384 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1385 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1386 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1387 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1389 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1390 AC_REQUIRE([AC_LIB_RPATH])
1391 define([Name],[translit([$1],[./-], [___])])
1392 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1393 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1395 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1397 AC_LIB_LINKFLAGS_BODY([$1], [$2])
1399 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1400 dnl because if the user has installed lib[]Name and not disabled its use
1401 dnl via --without-lib[]Name-prefix, he wants to use it.
1402 ac_save_CPPFLAGS="$CPPFLAGS"
1403 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1405 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1406 ac_save_LIBS="$LIBS"
1407 LIBS="$LIBS $LIB[]NAME"
1408 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1409 LIBS="$ac_save_LIBS"
1411 if test "$ac_cv_lib[]Name" = yes; then
1413 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1414 AC_MSG_CHECKING([how to link with lib[]$1])
1415 AC_MSG_RESULT([$LIB[]NAME])
1418 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1419 dnl $INC[]NAME either.
1420 CPPFLAGS="$ac_save_CPPFLAGS"
1425 AC_SUBST([HAVE_LIB]NAME)
1427 AC_SUBST([LTLIB]NAME)
1428 AC_SUBST([LIB]NAME[_PREFIX])
1433 dnl Determine the platform dependent parameters needed to use rpath:
1436 dnl acl_hardcode_libdir_flag_spec,
1437 dnl acl_hardcode_libdir_separator,
1438 dnl acl_hardcode_direct,
1439 dnl acl_hardcode_minus_L.
1440 AC_DEFUN([AC_LIB_RPATH],
1442 dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1443 m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1444 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1445 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1446 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1447 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1448 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1449 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1450 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1456 acl_libext="$acl_cv_libext"
1457 acl_shlibext="$acl_cv_shlibext"
1458 acl_libname_spec="$acl_cv_libname_spec"
1459 acl_library_names_spec="$acl_cv_library_names_spec"
1460 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1461 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1462 acl_hardcode_direct="$acl_cv_hardcode_direct"
1463 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1464 dnl Determine whether the user wants rpath handling at all.
1465 AC_ARG_ENABLE(rpath,
1466 [ --disable-rpath do not hardcode runtime library paths],
1467 :, enable_rpath=yes)
1470 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1471 dnl the libraries corresponding to explicit and implicit dependencies.
1472 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1473 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1474 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1475 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1477 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1478 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1479 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1480 dnl Autoconf >= 2.61 supports dots in --with options.
1481 define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
1482 dnl By default, look in $includedir and $libdir.
1484 AC_LIB_WITH_FINAL_PREFIX([
1485 eval additional_includedir=\"$includedir\"
1486 eval additional_libdir=\"$libdir\"
1488 AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
1489 [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1490 --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
1492 if test "X$withval" = "Xno"; then
1495 if test "X$withval" = "X"; then
1496 AC_LIB_WITH_FINAL_PREFIX([
1497 eval additional_includedir=\"$includedir\"
1498 eval additional_libdir=\"$libdir\"
1501 additional_includedir="$withval/include"
1502 additional_libdir="$withval/$acl_libdirstem"
1506 dnl Search the library and its dependencies in $additional_libdir and
1507 dnl $LDFLAGS. Using breadth-first-seach.
1514 names_already_handled=
1515 names_next_round='$1 $2'
1516 while test -n "$names_next_round"; do
1517 names_this_round="$names_next_round"
1519 for name in $names_this_round; do
1521 for n in $names_already_handled; do
1522 if test "$n" = "$name"; then
1527 if test -z "$already_handled"; then
1528 names_already_handled="$names_already_handled $name"
1529 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1530 dnl or AC_LIB_HAVE_LINKFLAGS call.
1531 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1532 eval value=\"\$HAVE_LIB$uppername\"
1533 if test -n "$value"; then
1534 if test "$value" = yes; then
1535 eval value=\"\$LIB$uppername\"
1536 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1537 eval value=\"\$LTLIB$uppername\"
1538 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1540 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1541 dnl that this library doesn't exist. So just drop it.
1545 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1546 dnl and the already constructed $LIBNAME/$LTLIBNAME.
1551 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1552 if test -n "$acl_shlibext"; then
1553 shrext=".$acl_shlibext" # typically: shrext=.so
1557 if test $use_additional = yes; then
1558 dir="$additional_libdir"
1559 dnl The same code as in the loop below:
1560 dnl First look for a shared library.
1561 if test -n "$acl_shlibext"; then
1562 if test -f "$dir/$libname$shrext"; then
1564 found_so="$dir/$libname$shrext"
1566 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1567 ver=`(cd "$dir" && \
1568 for f in "$libname$shrext".*; do echo "$f"; done \
1569 | sed -e "s,^$libname$shrext\\\\.,," \
1570 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1571 | sed 1q ) 2>/dev/null`
1572 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1574 found_so="$dir/$libname$shrext.$ver"
1577 eval library_names=\"$acl_library_names_spec\"
1578 for f in $library_names; do
1579 if test -f "$dir/$f"; then
1588 dnl Then look for a static library.
1589 if test "X$found_dir" = "X"; then
1590 if test -f "$dir/$libname.$acl_libext"; then
1592 found_a="$dir/$libname.$acl_libext"
1595 if test "X$found_dir" != "X"; then
1596 if test -f "$dir/$libname.la"; then
1597 found_la="$dir/$libname.la"
1601 if test "X$found_dir" = "X"; then
1602 for x in $LDFLAGS $LTLIB[]NAME; do
1603 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1606 dir=`echo "X$x" | sed -e 's/^X-L//'`
1607 dnl First look for a shared library.
1608 if test -n "$acl_shlibext"; then
1609 if test -f "$dir/$libname$shrext"; then
1611 found_so="$dir/$libname$shrext"
1613 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1614 ver=`(cd "$dir" && \
1615 for f in "$libname$shrext".*; do echo "$f"; done \
1616 | sed -e "s,^$libname$shrext\\\\.,," \
1617 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1618 | sed 1q ) 2>/dev/null`
1619 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1621 found_so="$dir/$libname$shrext.$ver"
1624 eval library_names=\"$acl_library_names_spec\"
1625 for f in $library_names; do
1626 if test -f "$dir/$f"; then
1635 dnl Then look for a static library.
1636 if test "X$found_dir" = "X"; then
1637 if test -f "$dir/$libname.$acl_libext"; then
1639 found_a="$dir/$libname.$acl_libext"
1642 if test "X$found_dir" != "X"; then
1643 if test -f "$dir/$libname.la"; then
1644 found_la="$dir/$libname.la"
1649 if test "X$found_dir" != "X"; then
1654 if test "X$found_dir" != "X"; then
1655 dnl Found the library.
1656 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1657 if test "X$found_so" != "X"; then
1658 dnl Linking with a shared library. We attempt to hardcode its
1659 dnl directory into the executable's runpath, unless it's the
1660 dnl standard /usr/lib.
1661 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1662 dnl No hardcoding is needed.
1663 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1665 dnl Use an explicit option to hardcode DIR into the resulting
1667 dnl Potentially add DIR to ltrpathdirs.
1668 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1670 for x in $ltrpathdirs; do
1671 if test "X$x" = "X$found_dir"; then
1676 if test -z "$haveit"; then
1677 ltrpathdirs="$ltrpathdirs $found_dir"
1679 dnl The hardcoding into $LIBNAME is system dependent.
1680 if test "$acl_hardcode_direct" = yes; then
1681 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1682 dnl resulting binary.
1683 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1685 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1686 dnl Use an explicit option to hardcode DIR into the resulting
1688 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1689 dnl Potentially add DIR to rpathdirs.
1690 dnl The rpathdirs will be appended to $LIBNAME at the end.
1692 for x in $rpathdirs; do
1693 if test "X$x" = "X$found_dir"; then
1698 if test -z "$haveit"; then
1699 rpathdirs="$rpathdirs $found_dir"
1702 dnl Rely on "-L$found_dir".
1703 dnl But don't add it if it's already contained in the LDFLAGS
1704 dnl or the already constructed $LIBNAME
1706 for x in $LDFLAGS $LIB[]NAME; do
1707 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1708 if test "X$x" = "X-L$found_dir"; then
1713 if test -z "$haveit"; then
1714 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1716 if test "$acl_hardcode_minus_L" != no; then
1717 dnl FIXME: Not sure whether we should use
1718 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1720 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1722 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1723 dnl here, because this doesn't fit in flags passed to the
1724 dnl compiler. So give up. No hardcoding. This affects only
1725 dnl very old systems.
1726 dnl FIXME: Not sure whether we should use
1727 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1729 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1735 if test "X$found_a" != "X"; then
1736 dnl Linking with a static library.
1737 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1739 dnl We shouldn't come here, but anyway it's good to have a
1741 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1744 dnl Assume the include files are nearby.
1745 additional_includedir=
1746 case "$found_dir" in
1747 */$acl_libdirstem | */$acl_libdirstem/)
1748 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1749 LIB[]NAME[]_PREFIX="$basedir"
1750 additional_includedir="$basedir/include"
1753 if test "X$additional_includedir" != "X"; then
1754 dnl Potentially add $additional_includedir to $INCNAME.
1755 dnl But don't add it
1756 dnl 1. if it's the standard /usr/include,
1757 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1758 dnl 3. if it's already present in $CPPFLAGS or the already
1759 dnl constructed $INCNAME,
1760 dnl 4. if it doesn't exist as a directory.
1761 if test "X$additional_includedir" != "X/usr/include"; then
1763 if test "X$additional_includedir" = "X/usr/local/include"; then
1764 if test -n "$GCC"; then
1766 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1770 if test -z "$haveit"; then
1771 for x in $CPPFLAGS $INC[]NAME; do
1772 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1773 if test "X$x" = "X-I$additional_includedir"; then
1778 if test -z "$haveit"; then
1779 if test -d "$additional_includedir"; then
1780 dnl Really add $additional_includedir to $INCNAME.
1781 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1787 dnl Look for dependencies.
1788 if test -n "$found_la"; then
1789 dnl Read the .la file. It defines the variables
1790 dnl dlname, library_names, old_library, dependency_libs, current,
1791 dnl age, revision, installed, dlopen, dlpreopen, libdir.
1792 save_libdir="$libdir"
1794 */* | *\\*) . "$found_la" ;;
1795 *) . "./$found_la" ;;
1797 libdir="$save_libdir"
1798 dnl We use only dependency_libs.
1799 for dep in $dependency_libs; do
1802 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1803 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1804 dnl But don't add it
1805 dnl 1. if it's the standard /usr/lib,
1806 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1807 dnl 3. if it's already present in $LDFLAGS or the already
1808 dnl constructed $LIBNAME,
1809 dnl 4. if it doesn't exist as a directory.
1810 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1812 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1813 if test -n "$GCC"; then
1815 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1819 if test -z "$haveit"; then
1821 for x in $LDFLAGS $LIB[]NAME; do
1822 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1823 if test "X$x" = "X-L$additional_libdir"; then
1828 if test -z "$haveit"; then
1829 if test -d "$additional_libdir"; then
1830 dnl Really add $additional_libdir to $LIBNAME.
1831 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1835 for x in $LDFLAGS $LTLIB[]NAME; do
1836 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1837 if test "X$x" = "X-L$additional_libdir"; then
1842 if test -z "$haveit"; then
1843 if test -d "$additional_libdir"; then
1844 dnl Really add $additional_libdir to $LTLIBNAME.
1845 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1852 dir=`echo "X$dep" | sed -e 's/^X-R//'`
1853 if test "$enable_rpath" != no; then
1854 dnl Potentially add DIR to rpathdirs.
1855 dnl The rpathdirs will be appended to $LIBNAME at the end.
1857 for x in $rpathdirs; do
1858 if test "X$x" = "X$dir"; then
1863 if test -z "$haveit"; then
1864 rpathdirs="$rpathdirs $dir"
1866 dnl Potentially add DIR to ltrpathdirs.
1867 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1869 for x in $ltrpathdirs; do
1870 if test "X$x" = "X$dir"; then
1875 if test -z "$haveit"; then
1876 ltrpathdirs="$ltrpathdirs $dir"
1881 dnl Handle this in the next round.
1882 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1885 dnl Handle this in the next round. Throw away the .la's
1886 dnl directory; it is already contained in a preceding -L
1888 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1891 dnl Most likely an immediate library name.
1892 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1893 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1899 dnl Didn't find the library; assume it is in the system directories
1900 dnl known to the linker and runtime loader. (All the system
1901 dnl directories known to the linker should also be known to the
1902 dnl runtime loader, otherwise the system is severely misconfigured.)
1903 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1904 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1910 if test "X$rpathdirs" != "X"; then
1911 if test -n "$acl_hardcode_libdir_separator"; then
1912 dnl Weird platform: only the last -rpath option counts, the user must
1913 dnl pass all path elements in one option. We can arrange that for a
1914 dnl single library, but not when more than one $LIBNAMEs are used.
1916 for found_dir in $rpathdirs; do
1917 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1919 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1920 acl_save_libdir="$libdir"
1922 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1923 libdir="$acl_save_libdir"
1924 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1926 dnl The -rpath options are cumulative.
1927 for found_dir in $rpathdirs; do
1928 acl_save_libdir="$libdir"
1930 eval flag=\"$acl_hardcode_libdir_flag_spec\"
1931 libdir="$acl_save_libdir"
1932 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1936 if test "X$ltrpathdirs" != "X"; then
1937 dnl When using libtool, the option that works for both libraries and
1938 dnl executables is -R. The -R options are cumulative.
1939 for found_dir in $ltrpathdirs; do
1940 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1945 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1946 dnl unless already present in VAR.
1947 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1948 dnl contains two or three consecutive elements that belong together.
1949 AC_DEFUN([AC_LIB_APPENDTOVAR],
1951 for element in [$2]; do
1954 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1955 if test "X$x" = "X$element"; then
1960 if test -z "$haveit"; then
1961 [$1]="${[$1]}${[$1]:+ }$element"
1966 dnl For those cases where a variable contains several -L and -l options
1967 dnl referring to unknown libraries and directories, this macro determines the
1968 dnl necessary additional linker options for the runtime path.
1969 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1970 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1971 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1972 dnl otherwise linking without libtool is assumed.
1973 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1975 AC_REQUIRE([AC_LIB_RPATH])
1976 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1978 if test "$enable_rpath" != no; then
1979 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1980 dnl Use an explicit option to hardcode directories into the resulting
1985 if test -n "$next"; then
1987 dnl No need to hardcode the standard /usr/lib.
1988 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1989 rpathdirs="$rpathdirs $dir"
1995 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1996 dnl No need to hardcode the standard /usr/lib.
1997 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1998 rpathdirs="$rpathdirs $dir"
2005 if test "X$rpathdirs" != "X"; then
2006 if test -n ""$3""; then
2007 dnl libtool is used for linking. Use -R options.
2008 for dir in $rpathdirs; do
2009 $1="${$1}${$1:+ }-R$dir"
2012 dnl The linker is used for linking directly.
2013 if test -n "$acl_hardcode_libdir_separator"; then
2014 dnl Weird platform: only the last -rpath option counts, the user
2015 dnl must pass all path elements in one option.
2017 for dir in $rpathdirs; do
2018 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2020 acl_save_libdir="$libdir"
2022 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2023 libdir="$acl_save_libdir"
2026 dnl The -rpath options are cumulative.
2027 for dir in $rpathdirs; do
2028 acl_save_libdir="$libdir"
2030 eval flag=\"$acl_hardcode_libdir_flag_spec\"
2031 libdir="$acl_save_libdir"
2032 $1="${$1}${$1:+ }$flag"
2042 # lib-prefix.m4 serial 5 (gettext-0.15)
2043 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
2044 dnl This file is free software; the Free Software Foundation
2045 dnl gives unlimited permission to copy and/or distribute it,
2046 dnl with or without modifications, as long as this notice is preserved.
2048 dnl From Bruno Haible.
2050 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2051 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2052 dnl require excessive bracketing.
2053 ifdef([AC_HELP_STRING],
2054 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2055 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2057 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2058 dnl to access previously installed libraries. The basic assumption is that
2059 dnl a user will want packages to use other packages he previously installed
2060 dnl with the same --prefix option.
2061 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2062 dnl libraries, but is otherwise very convenient.
2063 AC_DEFUN([AC_LIB_PREFIX],
2065 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2066 AC_REQUIRE([AC_PROG_CC])
2067 AC_REQUIRE([AC_CANONICAL_HOST])
2068 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2069 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2070 dnl By default, look in $includedir and $libdir.
2072 AC_LIB_WITH_FINAL_PREFIX([
2073 eval additional_includedir=\"$includedir\"
2074 eval additional_libdir=\"$libdir\"
2076 AC_LIB_ARG_WITH([lib-prefix],
2077 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2078 --without-lib-prefix don't search for libraries in includedir and libdir],
2080 if test "X$withval" = "Xno"; then
2083 if test "X$withval" = "X"; then
2084 AC_LIB_WITH_FINAL_PREFIX([
2085 eval additional_includedir=\"$includedir\"
2086 eval additional_libdir=\"$libdir\"
2089 additional_includedir="$withval/include"
2090 additional_libdir="$withval/$acl_libdirstem"
2094 if test $use_additional = yes; then
2095 dnl Potentially add $additional_includedir to $CPPFLAGS.
2096 dnl But don't add it
2097 dnl 1. if it's the standard /usr/include,
2098 dnl 2. if it's already present in $CPPFLAGS,
2099 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2100 dnl 4. if it doesn't exist as a directory.
2101 if test "X$additional_includedir" != "X/usr/include"; then
2103 for x in $CPPFLAGS; do
2104 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2105 if test "X$x" = "X-I$additional_includedir"; then
2110 if test -z "$haveit"; then
2111 if test "X$additional_includedir" = "X/usr/local/include"; then
2112 if test -n "$GCC"; then
2114 linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2118 if test -z "$haveit"; then
2119 if test -d "$additional_includedir"; then
2120 dnl Really add $additional_includedir to $CPPFLAGS.
2121 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2126 dnl Potentially add $additional_libdir to $LDFLAGS.
2127 dnl But don't add it
2128 dnl 1. if it's the standard /usr/lib,
2129 dnl 2. if it's already present in $LDFLAGS,
2130 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2131 dnl 4. if it doesn't exist as a directory.
2132 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2134 for x in $LDFLAGS; do
2135 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2136 if test "X$x" = "X-L$additional_libdir"; then
2141 if test -z "$haveit"; then
2142 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2143 if test -n "$GCC"; then
2145 linux*) haveit=yes;;
2149 if test -z "$haveit"; then
2150 if test -d "$additional_libdir"; then
2151 dnl Really add $additional_libdir to $LDFLAGS.
2152 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2160 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2161 dnl acl_final_exec_prefix, containing the values to which $prefix and
2162 dnl $exec_prefix will expand at the end of the configure script.
2163 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2165 dnl Unfortunately, prefix and exec_prefix get only finally determined
2166 dnl at the end of configure.
2167 if test "X$prefix" = "XNONE"; then
2168 acl_final_prefix="$ac_default_prefix"
2170 acl_final_prefix="$prefix"
2172 if test "X$exec_prefix" = "XNONE"; then
2173 acl_final_exec_prefix='${prefix}'
2175 acl_final_exec_prefix="$exec_prefix"
2177 acl_save_prefix="$prefix"
2178 prefix="$acl_final_prefix"
2179 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2180 prefix="$acl_save_prefix"
2183 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2184 dnl variables prefix and exec_prefix bound to the values they will have
2185 dnl at the end of the configure script.
2186 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2188 acl_save_prefix="$prefix"
2189 prefix="$acl_final_prefix"
2190 acl_save_exec_prefix="$exec_prefix"
2191 exec_prefix="$acl_final_exec_prefix"
2193 exec_prefix="$acl_save_exec_prefix"
2194 prefix="$acl_save_prefix"
2197 dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
2198 dnl the basename of the libdir, either "lib" or "lib64".
2199 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2201 dnl There is no formal standard regarding lib and lib64. The current
2202 dnl practice is that on a system supporting 32-bit and 64-bit instruction
2203 dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
2204 dnl libraries go under $prefix/lib. We determine the compiler's default
2205 dnl mode by looking at the compiler's library search path. If at least
2206 dnl of its elements ends in /lib64 or points to a directory whose absolute
2207 dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
2208 dnl default, namely "lib".
2210 searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2211 if test -n "$searchpath"; then
2212 acl_save_IFS="${IFS= }"; IFS=":"
2213 for searchdir in $searchpath; do
2214 if test -d "$searchdir"; then
2215 case "$searchdir" in
2216 */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2217 *) searchdir=`cd "$searchdir" && pwd`
2218 case "$searchdir" in
2219 */lib64 ) acl_libdirstem=lib64 ;;
2228 # lock.m4 serial 7 (gettext-0.17)
2229 dnl Copyright (C) 2005-2007 Free Software Foundation, Inc.
2230 dnl This file is free software; the Free Software Foundation
2231 dnl gives unlimited permission to copy and/or distribute it,
2232 dnl with or without modifications, as long as this notice is preserved.
2234 dnl From Bruno Haible.
2236 dnl Tests for a multithreading library to be used.
2237 dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
2238 dnl USE_PTH_THREADS, USE_WIN32_THREADS
2239 dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
2240 dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
2242 dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
2243 dnl programs that really need multithread functionality. The difference
2244 dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
2245 dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
2246 dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
2247 dnl multithread-safe programs.
2249 AC_DEFUN([gl_LOCK_EARLY],
2251 AC_REQUIRE([gl_LOCK_EARLY_BODY])
2254 dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
2256 AC_DEFUN([gl_LOCK_EARLY_BODY],
2258 dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
2259 dnl influences the result of the autoconf tests that test for *_unlocked
2260 dnl declarations, on AIX 5 at least. Therefore it must come early.
2261 AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
2262 AC_BEFORE([$0], [gl_ARGP])dnl
2264 AC_REQUIRE([AC_CANONICAL_HOST])
2265 dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
2266 dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
2268 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
2269 [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
2270 [AC_REQUIRE([AC_GNU_SOURCE])])
2271 dnl Check for multithreading.
2272 AC_ARG_ENABLE(threads,
2273 AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
2274 AC_HELP_STRING([--disable-threads], [build without multithread safety]),
2275 [gl_use_threads=$enableval],
2277 dnl Disable multithreading by default on OSF/1, because it interferes
2278 dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
2279 dnl process gets an endless segmentation fault inside execvp().
2280 osf*) gl_use_threads=no ;;
2281 *) gl_use_threads=yes ;;
2284 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
2285 # For using <pthread.h>:
2288 # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
2289 # groks <pthread.h>. cc also understands the flag -pthread, but
2290 # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
2291 # 2. putting a flag into CPPFLAGS that has an effect on the linker
2292 # causes the AC_TRY_LINK test below to succeed unexpectedly,
2293 # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
2294 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
2297 # Some systems optimize for single-threaded programs by default, and
2298 # need special flags to disable these optimizations. For example, the
2299 # definition of 'errno' in <errno.h>.
2301 aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
2302 solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
2307 dnl The guts of gl_LOCK. Needs to be expanded only once.
2309 AC_DEFUN([gl_LOCK_BODY],
2311 AC_REQUIRE([gl_LOCK_EARLY_BODY])
2317 if test "$gl_use_threads" != no; then
2318 dnl Check whether the compiler and linker support weak declarations.
2319 AC_MSG_CHECKING([whether imported symbols can be declared weak])
2321 AC_TRY_LINK([extern void xyzzy ();
2322 #pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
2323 AC_MSG_RESULT([$gl_have_weak])
2324 if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
2325 # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
2326 # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
2327 AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
2328 if test "$gl_have_pthread_h" = yes; then
2329 # Other possible tests:
2330 # -lpthreads (FSU threads, PCthreads)
2333 # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
2334 # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
2335 # the second one only in libpthread, and lock.c needs it.
2336 AC_TRY_LINK([#include <pthread.h>],
2337 [pthread_mutex_lock((pthread_mutex_t*)0);
2338 pthread_mutexattr_init((pthread_mutexattr_t*)0);],
2339 [gl_have_pthread=yes])
2340 # Test for libpthread by looking for pthread_kill. (Not pthread_self,
2341 # since it is defined as a macro on OSF/1.)
2342 if test -n "$gl_have_pthread"; then
2343 # The program links fine without libpthread. But it may actually
2344 # need to link with libpthread in order to create multiple threads.
2345 AC_CHECK_LIB(pthread, pthread_kill,
2346 [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
2347 # On Solaris and HP-UX, most pthread functions exist also in libc.
2348 # Therefore pthread_in_use() needs to actually try to create a
2349 # thread: pthread_create from libc will fail, whereas
2350 # pthread_create will actually create a thread.
2353 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
2354 [Define if the pthread_in_use() detection is hard.])
2358 # Some library is needed. Try libpthread and libc_r.
2359 AC_CHECK_LIB(pthread, pthread_kill,
2360 [gl_have_pthread=yes
2361 LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
2362 LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
2363 if test -z "$gl_have_pthread"; then
2365 AC_CHECK_LIB(c_r, pthread_kill,
2366 [gl_have_pthread=yes
2367 LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
2368 LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
2371 if test -n "$gl_have_pthread"; then
2372 gl_threads_api=posix
2373 AC_DEFINE([USE_POSIX_THREADS], 1,
2374 [Define if the POSIX multithreading library can be used.])
2375 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
2376 if test $gl_have_weak = yes; then
2377 AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
2378 [Define if references to the POSIX multithreading library should be made weak.])
2383 # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
2384 # pthread_rwlock_* functions.
2385 AC_CHECK_TYPE([pthread_rwlock_t],
2386 [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
2387 [Define if the POSIX multithreading library has read/write locks.])],
2389 [#include <pthread.h>])
2390 # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
2391 AC_TRY_COMPILE([#include <pthread.h>],
2392 [#if __FreeBSD__ == 4
2393 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
2395 int x = (int)PTHREAD_MUTEX_RECURSIVE;
2398 [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
2399 [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
2403 if test -z "$gl_have_pthread"; then
2404 if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
2405 gl_have_solaristhread=
2406 gl_save_LIBS="$LIBS"
2407 LIBS="$LIBS -lthread"
2408 AC_TRY_LINK([#include <thread.h>
2409 #include <synch.h>],
2411 [gl_have_solaristhread=yes])
2412 LIBS="$gl_save_LIBS"
2413 if test -n "$gl_have_solaristhread"; then
2414 gl_threads_api=solaris
2416 LTLIBTHREAD=-lthread
2417 LIBMULTITHREAD="$LIBTHREAD"
2418 LTLIBMULTITHREAD="$LTLIBTHREAD"
2419 AC_DEFINE([USE_SOLARIS_THREADS], 1,
2420 [Define if the old Solaris multithreading library can be used.])
2421 if test $gl_have_weak = yes; then
2422 AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
2423 [Define if references to the old Solaris multithreading library should be made weak.])
2430 if test "$gl_use_threads" = pth; then
2431 gl_save_CPPFLAGS="$CPPFLAGS"
2432 AC_LIB_LINKFLAGS(pth)
2434 gl_save_LIBS="$LIBS"
2436 AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
2437 LIBS="$gl_save_LIBS"
2438 if test -n "$gl_have_pth"; then
2441 LTLIBTHREAD="$LTLIBPTH"
2442 LIBMULTITHREAD="$LIBTHREAD"
2443 LTLIBMULTITHREAD="$LTLIBTHREAD"
2444 AC_DEFINE([USE_PTH_THREADS], 1,
2445 [Define if the GNU Pth multithreading library can be used.])
2446 if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
2447 if test $gl_have_weak = yes; then
2448 AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
2449 [Define if references to the GNU Pth multithreading library should be made weak.])
2455 CPPFLAGS="$gl_save_CPPFLAGS"
2458 if test -z "$gl_have_pthread"; then
2459 if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
2460 if { case "$host_os" in
2465 gl_threads_api=win32
2466 AC_DEFINE([USE_WIN32_THREADS], 1,
2467 [Define if the Win32 multithreading API can be used.])
2472 AC_MSG_CHECKING([for multithread API to use])
2473 AC_MSG_RESULT([$gl_threads_api])
2475 AC_SUBST(LTLIBTHREAD)
2476 AC_SUBST(LIBMULTITHREAD)
2477 AC_SUBST(LTLIBMULTITHREAD)
2482 AC_REQUIRE([gl_LOCK_EARLY])
2483 AC_REQUIRE([gl_LOCK_BODY])
2487 # Prerequisites of lib/lock.c.
2488 AC_DEFUN([gl_PREREQ_LOCK], [
2489 AC_REQUIRE([AC_C_INLINE])
2492 dnl Survey of platforms:
2494 dnl Platform Available Compiler Supports test-lock
2495 dnl flavours option weak result
2496 dnl --------------- --------- --------- -------- ---------
2497 dnl Linux 2.4/glibc posix -lpthread Y OK
2499 dnl GNU Hurd/glibc posix
2501 dnl FreeBSD 5.3 posix -lc_r Y
2503 dnl posix -lpthread ? Y
2506 dnl FreeBSD 5.2 posix -lc_r Y
2510 dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
2514 dnl OpenBSD 3.4 posix -lpthread Y OK
2516 dnl MacOS X 10.[123] posix -lpthread Y OK
2518 dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
2519 dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
2521 dnl HP-UX 11 posix -lpthread N (cc) OK
2524 dnl IRIX 6.5 posix -lpthread Y 0.5
2526 dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
2528 dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
2529 dnl -lpthread (gcc) Y
2531 dnl Cygwin posix -lpthread Y OK
2533 dnl Any of the above pth -lpth 0.0
2535 dnl Mingw win32 N OK
2539 dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
2541 dnl OK if all three tests terminate OK,
2542 dnl 0.5 if the first test terminates OK but the second one loops endlessly,
2543 dnl 0.0 if the first test already loops endlessly.
2545 # longlong.m4 serial 13
2546 dnl Copyright (C) 1999-2007 Free Software Foundation, Inc.
2547 dnl This file is free software; the Free Software Foundation
2548 dnl gives unlimited permission to copy and/or distribute it,
2549 dnl with or without modifications, as long as this notice is preserved.
2551 dnl From Paul Eggert.
2553 # Define HAVE_LONG_LONG_INT if 'long long int' works.
2554 # This fixes a bug in Autoconf 2.61, but can be removed once we
2555 # assume 2.62 everywhere.
2557 # Note: If the type 'long long int' exists but is only 32 bits large
2558 # (as on some very old compilers), HAVE_LONG_LONG_INT will not be
2559 # defined. In this case you can treat 'long long int' like 'long int'.
2561 AC_DEFUN([AC_TYPE_LONG_LONG_INT],
2563 AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
2565 [_AC_TYPE_LONG_LONG_SNIPPET],
2566 [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
2567 dnl If cross compiling, assume the bug isn't important, since
2568 dnl nobody cross compiles for this platform as far as we know.
2571 [[@%:@include <limits.h>
2572 @%:@ifndef LLONG_MAX
2574 (1LL << (sizeof (long long int) * CHAR_BIT - 2))
2575 @%:@ define LLONG_MAX (HALF - 1 + HALF)
2577 [[long long int n = 1;
2581 long long int m = n << i;
2584 if (LLONG_MAX / 2 < m)
2588 [ac_cv_type_long_long_int=yes],
2589 [ac_cv_type_long_long_int=no],
2590 [ac_cv_type_long_long_int=yes])],
2591 [ac_cv_type_long_long_int=no])])
2592 if test $ac_cv_type_long_long_int = yes; then
2593 AC_DEFINE([HAVE_LONG_LONG_INT], 1,
2594 [Define to 1 if the system has the type `long long int'.])
2598 # Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
2599 # This fixes a bug in Autoconf 2.61, but can be removed once we
2600 # assume 2.62 everywhere.
2602 # Note: If the type 'unsigned long long int' exists but is only 32 bits
2603 # large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
2604 # will not be defined. In this case you can treat 'unsigned long long int'
2605 # like 'unsigned long int'.
2607 AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
2609 AC_CACHE_CHECK([for unsigned long long int],
2610 [ac_cv_type_unsigned_long_long_int],
2612 [_AC_TYPE_LONG_LONG_SNIPPET],
2613 [ac_cv_type_unsigned_long_long_int=yes],
2614 [ac_cv_type_unsigned_long_long_int=no])])
2615 if test $ac_cv_type_unsigned_long_long_int = yes; then
2616 AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
2617 [Define to 1 if the system has the type `unsigned long long int'.])
2621 # Expands to a C program that can be used to test for simultaneous support
2622 # of 'long long' and 'unsigned long long'. We don't want to say that
2623 # 'long long' is available if 'unsigned long long' is not, or vice versa,
2624 # because too many programs rely on the symmetry between signed and unsigned
2625 # integer types (excluding 'bool').
2626 AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
2629 [[/* Test preprocessor. */
2630 #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2631 error in preprocessor;
2633 #if ! (18446744073709551615ULL <= -1ull)
2634 error in preprocessor;
2636 /* Test literals. */
2637 long long int ll = 9223372036854775807ll;
2638 long long int nll = -9223372036854775807LL;
2639 unsigned long long int ull = 18446744073709551615ULL;
2640 /* Test constant expressions. */
2641 typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2643 typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
2646 [[/* Test availability of runtime routines for shift and division. */
2647 long long int llmax = 9223372036854775807ll;
2648 unsigned long long int ullmax = 18446744073709551615ull;
2649 return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
2650 | (llmax / ll) | (llmax % ll)
2651 | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
2652 | (ullmax / ull) | (ullmax % ull));]])
2655 # nls.m4 serial 3 (gettext-0.15)
2656 dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
2657 dnl This file is free software; the Free Software Foundation
2658 dnl gives unlimited permission to copy and/or distribute it,
2659 dnl with or without modifications, as long as this notice is preserved.
2661 dnl This file can can be used in projects which are not available under
2662 dnl the GNU General Public License or the GNU Library General Public
2663 dnl License but which still want to provide support for the GNU gettext
2665 dnl Please note that the actual code of the GNU gettext library is covered
2666 dnl by the GNU Library General Public License, and the rest of the GNU
2667 dnl gettext package package is covered by the GNU General Public License.
2668 dnl They are *not* in the public domain.
2671 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2672 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2678 AC_MSG_CHECKING([whether NLS is requested])
2679 dnl Default is enabled NLS
2681 [ --disable-nls do not use Native Language Support],
2682 USE_NLS=$enableval, USE_NLS=yes)
2683 AC_MSG_RESULT($USE_NLS)
2687 # po.m4 serial 15 (gettext-0.17)
2688 dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
2689 dnl This file is free software; the Free Software Foundation
2690 dnl gives unlimited permission to copy and/or distribute it,
2691 dnl with or without modifications, as long as this notice is preserved.
2693 dnl This file can can be used in projects which are not available under
2694 dnl the GNU General Public License or the GNU Library General Public
2695 dnl License but which still want to provide support for the GNU gettext
2697 dnl Please note that the actual code of the GNU gettext library is covered
2698 dnl by the GNU Library General Public License, and the rest of the GNU
2699 dnl gettext package package is covered by the GNU General Public License.
2700 dnl They are *not* in the public domain.
2703 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2704 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2708 dnl Checks for all prerequisites of the po subdirectory.
2709 AC_DEFUN([AM_PO_SUBDIRS],
2711 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2712 AC_REQUIRE([AC_PROG_INSTALL])dnl
2713 AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2714 AC_REQUIRE([AM_NLS])dnl
2716 dnl Release version of the gettext macros. This is used to ensure that
2717 dnl the gettext macros and po/Makefile.in.in are in sync.
2718 AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
2720 dnl Perform the following tests also if --disable-nls has been given,
2721 dnl because they are needed for "make dist" to work.
2723 dnl Search for GNU msgfmt in the PATH.
2724 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2725 dnl The second test excludes FreeBSD msgfmt.
2726 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2727 [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2728 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2730 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2732 dnl Test whether it is GNU msgfmt >= 0.15.
2734 case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2735 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2736 *) MSGFMT_015=$MSGFMT ;;
2739 AC_SUBST([MSGFMT_015])
2741 case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2742 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2743 *) GMSGFMT_015=$GMSGFMT ;;
2746 AC_SUBST([GMSGFMT_015])
2748 dnl Search for GNU xgettext 0.12 or newer in the PATH.
2749 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2750 dnl The second test excludes FreeBSD xgettext.
2751 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2752 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2753 (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)],
2755 dnl Remove leftover from FreeBSD xgettext call.
2758 dnl Test whether it is GNU xgettext >= 0.15.
2760 case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2761 '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2762 *) XGETTEXT_015=$XGETTEXT ;;
2765 AC_SUBST([XGETTEXT_015])
2767 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2768 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2769 [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2771 dnl Installation directories.
2772 dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2773 dnl have to define it here, so that it can be used in po/Makefile.
2774 test -n "$localedir" || localedir='${datadir}/locale'
2775 AC_SUBST([localedir])
2777 dnl Support for AM_XGETTEXT_OPTION.
2778 test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2779 AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2781 AC_CONFIG_COMMANDS([po-directories], [[
2782 for ac_file in $CONFIG_FILES; do
2783 # Support "outfile[:infile[:infile...]]"
2785 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2787 # PO directories have a Makefile.in generated from Makefile.in.in.
2788 case "$ac_file" in */Makefile.in)
2789 # Adjust a relative srcdir.
2790 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2791 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2792 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2793 # In autoconf-2.13 it is called $ac_given_srcdir.
2794 # In autoconf-2.50 it is called $srcdir.
2795 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2796 case "$ac_given_srcdir" in
2797 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2798 /*) top_srcdir="$ac_given_srcdir" ;;
2799 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2801 # Treat a directory as a PO directory if and only if it has a
2802 # POTFILES.in file. This allows packages to have multiple PO
2803 # directories under different names or in different locations.
2804 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2805 rm -f "$ac_dir/POTFILES"
2806 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2807 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2808 POMAKEFILEDEPS="POTFILES.in"
2809 # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2810 # on $ac_dir but don't depend on user-specified configuration
2812 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2813 # The LINGUAS file contains the set of available languages.
2814 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2815 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2817 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2818 # Hide the ALL_LINGUAS assigment from automake < 1.5.
2819 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2820 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2822 # The set of available languages was given in configure.in.
2823 # Hide the ALL_LINGUAS assigment from automake < 1.5.
2824 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2827 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2828 # Compute UPDATEPOFILES
2829 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2830 # Compute DUMMYPOFILES
2831 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2833 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2834 case "$ac_given_srcdir" in
2836 *) srcdirpre='$(srcdir)/' ;;
2842 for lang in $ALL_LINGUAS; do
2843 POFILES="$POFILES $srcdirpre$lang.po"
2844 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2845 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2846 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2848 # CATALOGS depends on both $ac_dir and the user's LINGUAS
2849 # environment variable.
2851 if test -n "$ALL_LINGUAS"; then
2852 for presentlang in $ALL_LINGUAS; do
2854 if test "%UNSET%" != "$LINGUAS"; then
2855 desiredlanguages="$LINGUAS"
2857 desiredlanguages="$ALL_LINGUAS"
2859 for desiredlang in $desiredlanguages; do
2860 # Use the presentlang catalog if desiredlang is
2861 # a. equal to presentlang, or
2862 # b. a variant of presentlang (because in this case,
2863 # presentlang can be used as a fallback for messages
2864 # which are not translated in the desiredlang catalog).
2865 case "$desiredlang" in
2866 "$presentlang"*) useit=yes;;
2869 if test $useit = yes; then
2870 INST_LINGUAS="$INST_LINGUAS $presentlang"
2875 if test -n "$INST_LINGUAS"; then
2876 for lang in $INST_LINGUAS; do
2877 CATALOGS="$CATALOGS $lang.gmo"
2880 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2881 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"
2882 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2883 if test -f "$f"; then
2885 *.orig | *.bak | *~) ;;
2886 *) cat "$f" >> "$ac_dir/Makefile" ;;
2894 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2895 # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2896 # from automake < 1.5.
2897 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2898 # Capture the value of LINGUAS because we need it to compute CATALOGS.
2899 LINGUAS="${LINGUAS-%UNSET%}"
2903 dnl Postprocesses a Makefile in a directory containing PO files.
2904 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2906 # When this code is run, in config.status, two variables have already been
2908 # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2909 # - LINGUAS is the value of the environment variable LINGUAS at configure
2913 # Adjust a relative srcdir.
2914 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2915 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2916 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2917 # In autoconf-2.13 it is called $ac_given_srcdir.
2918 # In autoconf-2.50 it is called $srcdir.
2919 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2920 case "$ac_given_srcdir" in
2921 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2922 /*) top_srcdir="$ac_given_srcdir" ;;
2923 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2926 # Find a way to echo strings without interpreting backslash.
2927 if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2930 if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2931 gt_echo='printf %s\n'
2942 # A sed script that extracts the value of VARIABLE from a Makefile.
2944 # Test if the hold space is empty.
2949 # Yes it was empty. Look if we have the expected variable definition.
2950 /^[ ]*VARIABLE[ ]*=/{
2951 # Seen the first line of the variable definition.
2952 s/^[ ]*VARIABLE[ ]*=//
2957 # Here we are processing a line from the variable definition.
2958 # Remove comment, more precisely replace it with a space.
2960 # See if the line ends in a backslash.
2964 # Print the line, without the trailing backslash.
2967 # There was no trailing backslash. The end of the variable definition is
2968 # reached. Clear the hold space.
2973 # A trailing backslash means that the variable definition continues in the
2974 # next line. Put a nonempty string into the hold space to indicate this.
2981 # Set POTFILES to the value of the Makefile variable POTFILES.
2982 sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2983 POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2984 # Compute POTFILES_DEPS as
2985 # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2987 for file in $POTFILES; do
2988 POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2992 if test -n "$OBSOLETE_ALL_LINGUAS"; then
2993 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2995 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2996 # The LINGUAS file contains the set of available languages.
2997 ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2998 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3000 # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3001 sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3002 ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3004 # Hide the ALL_LINGUAS assigment from automake < 1.5.
3005 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3007 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3008 # Compute UPDATEPOFILES
3009 # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3010 # Compute DUMMYPOFILES
3011 # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3013 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3014 # Compute PROPERTIESFILES
3015 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
3016 # Compute CLASSFILES
3017 # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
3019 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3021 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3022 # Compute RESOURCESDLLFILES
3023 # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3024 case "$ac_given_srcdir" in
3026 *) srcdirpre='$(srcdir)/' ;;
3037 for lang in $ALL_LINGUAS; do
3038 POFILES="$POFILES $srcdirpre$lang.po"
3039 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3040 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3041 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3042 PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
3043 CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
3044 QMFILES="$QMFILES $srcdirpre$lang.qm"
3045 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3046 MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3047 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3048 RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3050 # CATALOGS depends on both $ac_dir and the user's LINGUAS
3051 # environment variable.
3053 if test -n "$ALL_LINGUAS"; then
3054 for presentlang in $ALL_LINGUAS; do
3056 if test "%UNSET%" != "$LINGUAS"; then
3057 desiredlanguages="$LINGUAS"
3059 desiredlanguages="$ALL_LINGUAS"
3061 for desiredlang in $desiredlanguages; do
3062 # Use the presentlang catalog if desiredlang is
3063 # a. equal to presentlang, or
3064 # b. a variant of presentlang (because in this case,
3065 # presentlang can be used as a fallback for messages
3066 # which are not translated in the desiredlang catalog).
3067 case "$desiredlang" in
3068 "$presentlang"*) useit=yes;;
3071 if test $useit = yes; then
3072 INST_LINGUAS="$INST_LINGUAS $presentlang"
3081 if test -n "$INST_LINGUAS"; then
3082 for lang in $INST_LINGUAS; do
3083 CATALOGS="$CATALOGS $lang.gmo"
3084 JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3085 QTCATALOGS="$QTCATALOGS $lang.qm"
3086 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3087 TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3088 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3089 CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3093 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"
3094 if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3095 # Add dependencies that cannot be formulated as a simple suffix rule.
3096 for lang in $ALL_LINGUAS; do
3097 frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3098 cat >> "$ac_file.tmp" <<EOF
3099 $frobbedlang.msg: $lang.po
3100 @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3101 \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3105 if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3106 # Add dependencies that cannot be formulated as a simple suffix rule.
3107 for lang in $ALL_LINGUAS; do
3108 frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
3109 cat >> "$ac_file.tmp" <<EOF
3110 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3111 @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3112 \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3116 if test -n "$POMAKEFILEDEPS"; then
3117 cat >> "$ac_file.tmp" <<EOF
3118 Makefile: $POMAKEFILEDEPS
3121 mv "$ac_file.tmp" "$ac_file"
3124 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3125 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3127 XGETTEXT_EXTRA_OPTIONS=
3130 dnl Registers an option to be passed to xgettext in the po subdirectory.
3131 AC_DEFUN([AM_XGETTEXT_OPTION],
3133 AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3134 XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3137 # printf-posix.m4 serial 3 (gettext-0.17)
3138 dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
3139 dnl This file is free software; the Free Software Foundation
3140 dnl gives unlimited permission to copy and/or distribute it,
3141 dnl with or without modifications, as long as this notice is preserved.
3143 dnl From Bruno Haible.
3144 dnl Test whether the printf() function supports POSIX/XSI format strings with
3147 AC_DEFUN([gt_PRINTF_POSIX],
3149 AC_REQUIRE([AC_PROG_CC])
3150 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3151 gt_cv_func_printf_posix,
3156 /* The string "%2$d %1$d", with dollar characters protected from the shell's
3157 dollar expansion (possibly an autoconf bug). */
3158 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3159 static char buf[100];
3162 sprintf (buf, format, 33, 55);
3163 return (strcmp (buf, "55 33") != 0);
3164 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3166 AC_EGREP_CPP(notposix, [
3167 #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3170 ], gt_cv_func_printf_posix="guessing no",
3171 gt_cv_func_printf_posix="guessing yes")
3174 case $gt_cv_func_printf_posix in
3176 AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3177 [Define if your printf() function supports format strings with positions.])
3182 # progtest.m4 serial 4 (gettext-0.14.2)
3183 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
3184 dnl This file is free software; the Free Software Foundation
3185 dnl gives unlimited permission to copy and/or distribute it,
3186 dnl with or without modifications, as long as this notice is preserved.
3188 dnl This file can can be used in projects which are not available under
3189 dnl the GNU General Public License or the GNU Library General Public
3190 dnl License but which still want to provide support for the GNU gettext
3192 dnl Please note that the actual code of the GNU gettext library is covered
3193 dnl by the GNU Library General Public License, and the rest of the GNU
3194 dnl gettext package package is covered by the GNU General Public License.
3195 dnl They are *not* in the public domain.
3198 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3202 # Search path for a program which passes the given test.
3204 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3205 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3206 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3208 # Prepare PATH_SEPARATOR.
3209 # The user is always right.
3210 if test "${PATH_SEPARATOR+set}" != set; then
3211 echo "#! /bin/sh" >conf$$.sh
3212 echo "exit 0" >>conf$$.sh
3214 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
3222 # Find out how to test for executable files. Don't use a zero-byte file,
3223 # as systems may use methods other than mode bits to determine executability.
3224 cat >conf$$.file <<_ASEOF
3228 chmod +x conf$$.file
3229 if test -x conf$$.file >/dev/null 2>&1; then
3230 ac_executable_p="test -x"
3232 ac_executable_p="test -f"
3236 # Extract the first word of "$2", so it can be a program name with args.
3237 set dummy $2; ac_word=[$]2
3238 AC_MSG_CHECKING([for $ac_word])
3239 AC_CACHE_VAL(ac_cv_path_$1,
3241 [[\\/]]* | ?:[[\\/]]*)
3242 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3245 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3246 for ac_dir in ifelse([$5], , $PATH, [$5]); do
3248 test -z "$ac_dir" && ac_dir=.
3249 for ac_exec_ext in '' $ac_executable_extensions; do
3250 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3251 echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
3253 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3260 dnl If no 4th arg is given, leave the cache variable unset,
3261 dnl so AC_PATH_PROGS will keep looking.
3262 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3267 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3268 AC_MSG_RESULT([$]$1)
3275 # size_max.m4 serial 6
3276 dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
3277 dnl This file is free software; the Free Software Foundation
3278 dnl gives unlimited permission to copy and/or distribute it,
3279 dnl with or without modifications, as long as this notice is preserved.
3281 dnl From Bruno Haible.
3283 AC_DEFUN([gl_SIZE_MAX],
3285 AC_CHECK_HEADERS(stdint.h)
3286 dnl First test whether the system already has SIZE_MAX.
3287 AC_MSG_CHECKING([for SIZE_MAX])
3288 AC_CACHE_VAL([gl_cv_size_max], [
3290 AC_EGREP_CPP([Found it], [
3298 ], gl_cv_size_max=yes)
3299 if test -z "$gl_cv_size_max"; then
3300 dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3301 dnl than the type 'unsigned long'. Try hard to find a definition that can
3302 dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
3303 AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
3304 [#include <stddef.h>
3305 #include <limits.h>], size_t_bits_minus_1=)
3306 AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
3307 [#include <stddef.h>], fits_in_uint=)
3308 if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
3309 if test $fits_in_uint = 1; then
3310 dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3311 dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3312 AC_TRY_COMPILE([#include <stddef.h>
3314 extern unsigned long foo;
3315 ], [], fits_in_uint=0)
3317 dnl We cannot use 'expr' to simplify this expression, because 'expr'
3318 dnl works only with 'long' integers in the host environment, while we
3319 dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
3320 if test $fits_in_uint = 1; then
3321 gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
3323 gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
3326 dnl Shouldn't happen, but who knows...
3327 gl_cv_size_max='((size_t)~(size_t)0)'
3331 AC_MSG_RESULT([$gl_cv_size_max])
3332 if test "$gl_cv_size_max" != yes; then
3333 AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
3334 [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3338 dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
3339 dnl Remove this when we can assume autoconf >= 2.61.
3340 m4_ifdef([AC_COMPUTE_INT], [], [
3341 AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
3344 # stdint_h.m4 serial 6
3345 dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
3346 dnl This file is free software; the Free Software Foundation
3347 dnl gives unlimited permission to copy and/or distribute it,
3348 dnl with or without modifications, as long as this notice is preserved.
3350 dnl From Paul Eggert.
3352 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3353 # doesn't clash with <sys/types.h>, and declares uintmax_t.
3355 AC_DEFUN([gl_AC_HEADER_STDINT_H],
3357 AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
3359 [#include <sys/types.h>
3360 #include <stdint.h>],
3361 [uintmax_t i = (uintmax_t) -1; return !i;],
3362 gl_cv_header_stdint_h=yes,
3363 gl_cv_header_stdint_h=no)])
3364 if test $gl_cv_header_stdint_h = yes; then
3365 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3366 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3367 and declares uintmax_t. ])
3371 # uintmax_t.m4 serial 10
3372 dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc.
3373 dnl This file is free software; the Free Software Foundation
3374 dnl gives unlimited permission to copy and/or distribute it,
3375 dnl with or without modifications, as long as this notice is preserved.
3377 dnl From Paul Eggert.
3381 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
3382 # if it is not already defined in <stdint.h> or <inttypes.h>.
3384 AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
3386 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
3387 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
3388 if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
3389 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
3390 test $ac_cv_type_unsigned_long_long_int = yes \
3391 && ac_type='unsigned long long' \
3392 || ac_type='unsigned long'
3393 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3394 [Define to unsigned long or unsigned long long
3395 if <stdint.h> and <inttypes.h> don't define.])
3397 AC_DEFINE(HAVE_UINTMAX_T, 1,
3398 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3402 # visibility.m4 serial 1 (gettext-0.15)
3403 dnl Copyright (C) 2005 Free Software Foundation, Inc.
3404 dnl This file is free software; the Free Software Foundation
3405 dnl gives unlimited permission to copy and/or distribute it,
3406 dnl with or without modifications, as long as this notice is preserved.
3408 dnl From Bruno Haible.
3410 dnl Tests whether the compiler supports the command-line option
3411 dnl -fvisibility=hidden and the function and variable attributes
3412 dnl __attribute__((__visibility__("hidden"))) and
3413 dnl __attribute__((__visibility__("default"))).
3414 dnl Does *not* test for __visibility__("protected") - which has tricky
3415 dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
3417 dnl Does *not* test for __visibility__("internal") - which has processor
3418 dnl dependent semantics.
3419 dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
3420 dnl "really only recommended for legacy code".
3421 dnl Set the variable CFLAG_VISIBILITY.
3422 dnl Defines and sets the variable HAVE_VISIBILITY.
3424 AC_DEFUN([gl_VISIBILITY],
3426 AC_REQUIRE([AC_PROG_CC])
3429 if test -n "$GCC"; then
3430 AC_MSG_CHECKING([for simple visibility declarations])
3431 AC_CACHE_VAL(gl_cv_cc_visibility, [
3432 gl_save_CFLAGS="$CFLAGS"
3433 CFLAGS="$CFLAGS -fvisibility=hidden"
3435 [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
3436 extern __attribute__((__visibility__("default"))) int exportedvar;
3437 extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
3438 extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
3440 gl_cv_cc_visibility=yes,
3441 gl_cv_cc_visibility=no)
3442 CFLAGS="$gl_save_CFLAGS"])
3443 AC_MSG_RESULT([$gl_cv_cc_visibility])
3444 if test $gl_cv_cc_visibility = yes; then
3445 CFLAG_VISIBILITY="-fvisibility=hidden"
3449 AC_SUBST([CFLAG_VISIBILITY])
3450 AC_SUBST([HAVE_VISIBILITY])
3451 AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
3452 [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
3455 # wchar_t.m4 serial 1 (gettext-0.12)
3456 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3457 dnl This file is free software; the Free Software Foundation
3458 dnl gives unlimited permission to copy and/or distribute it,
3459 dnl with or without modifications, as long as this notice is preserved.
3461 dnl From Bruno Haible.
3462 dnl Test whether <stddef.h> has the 'wchar_t' type.
3463 dnl Prerequisite: AC_PROG_CC
3465 AC_DEFUN([gt_TYPE_WCHAR_T],
3467 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
3468 [AC_TRY_COMPILE([#include <stddef.h>
3469 wchar_t foo = (wchar_t)'\0';], ,
3470 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
3471 if test $gt_cv_c_wchar_t = yes; then
3472 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
3476 # wint_t.m4 serial 2 (gettext-0.17)
3477 dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
3478 dnl This file is free software; the Free Software Foundation
3479 dnl gives unlimited permission to copy and/or distribute it,
3480 dnl with or without modifications, as long as this notice is preserved.
3482 dnl From Bruno Haible.
3483 dnl Test whether <wchar.h> has the 'wint_t' type.
3484 dnl Prerequisite: AC_PROG_CC
3486 AC_DEFUN([gt_TYPE_WINT_T],
3488 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
3490 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
3492 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
3493 before <wchar.h>. */
3498 wint_t foo = (wchar_t)'\0';], ,
3499 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
3500 if test $gt_cv_c_wint_t = yes; then
3501 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
3506 dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
3507 dnl This file is free software; the Free Software Foundation
3508 dnl gives unlimited permission to copy and/or distribute it,
3509 dnl with or without modifications, as long as this notice is preserved.
3511 AC_DEFUN([gl_XSIZE],
3513 dnl Prerequisites of lib/xsize.h.
3514 AC_REQUIRE([gl_SIZE_MAX])
3515 AC_REQUIRE([AC_C_INLINE])
3516 AC_CHECK_HEADERS(stdint.h)
3519 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
3521 # This file is free software; the Free Software Foundation
3522 # gives unlimited permission to copy and/or distribute it,
3523 # with or without modifications, as long as this notice is preserved.
3525 # AM_AUTOMAKE_VERSION(VERSION)
3526 # ----------------------------
3527 # Automake X.Y traces this macro to ensure aclocal.m4 has been
3528 # generated from the m4 files accompanying Automake X.Y.
3529 # (This private macro should not be called outside this file.)
3530 AC_DEFUN([AM_AUTOMAKE_VERSION],
3531 [am__api_version='1.11'
3532 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3533 dnl require some minimum version. Point them to the right macro.
3534 m4_if([$1], [1.11.1], [],
3535 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3538 # _AM_AUTOCONF_VERSION(VERSION)
3539 # -----------------------------
3540 # aclocal traces this macro to find the Autoconf version.
3541 # This is a private macro too. Using m4_define simplifies
3542 # the logic in aclocal, which can simply ignore this definition.
3543 m4_define([_AM_AUTOCONF_VERSION], [])
3545 # AM_SET_CURRENT_AUTOMAKE_VERSION
3546 # -------------------------------
3547 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
3548 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
3549 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3550 [AM_AUTOMAKE_VERSION([1.11.1])dnl
3551 m4_ifndef([AC_AUTOCONF_VERSION],
3552 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
3553 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
3555 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
3557 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
3559 # This file is free software; the Free Software Foundation
3560 # gives unlimited permission to copy and/or distribute it,
3561 # with or without modifications, as long as this notice is preserved.
3563 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
3564 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
3565 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
3567 # Of course, Automake must honor this variable whenever it calls a
3568 # tool from the auxiliary directory. The problem is that $srcdir (and
3569 # therefore $ac_aux_dir as well) can be either absolute or relative,
3570 # depending on how configure is run. This is pretty annoying, since
3571 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
3572 # source directory, any form will work fine, but in subdirectories a
3573 # relative path needs to be adjusted first.
3575 # $ac_aux_dir/missing
3576 # fails when called from a subdirectory if $ac_aux_dir is relative
3577 # $top_srcdir/$ac_aux_dir/missing
3578 # fails if $ac_aux_dir is absolute,
3579 # fails when called from a subdirectory in a VPATH build with
3580 # a relative $ac_aux_dir
3582 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
3583 # are both prefixed by $srcdir. In an in-source build this is usually
3584 # harmless because $srcdir is `.', but things will broke when you
3585 # start a VPATH build or use an absolute $srcdir.
3587 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
3588 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
3589 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
3590 # and then we would define $MISSING as
3591 # MISSING="\${SHELL} $am_aux_dir/missing"
3592 # This will work as long as MISSING is not called from configure, because
3593 # unfortunately $(top_srcdir) has no meaning in configure.
3594 # However there are other variables, like CC, which are often used in
3595 # configure, and could therefore not use this "fixed" $ac_aux_dir.
3597 # Another solution, used here, is to always expand $ac_aux_dir to an
3598 # absolute PATH. The drawback is that using absolute paths prevent a
3599 # configured tree to be moved without reconfiguration.
3601 AC_DEFUN([AM_AUX_DIR_EXPAND],
3602 [dnl Rely on autoconf to set up CDPATH properly.
3603 AC_PREREQ([2.50])dnl
3604 # expand $ac_aux_dir to an absolute path
3605 am_aux_dir=`cd $ac_aux_dir && pwd`
3608 # AM_CONDITIONAL -*- Autoconf -*-
3610 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
3611 # Free Software Foundation, Inc.
3613 # This file is free software; the Free Software Foundation
3614 # gives unlimited permission to copy and/or distribute it,
3615 # with or without modifications, as long as this notice is preserved.
3619 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
3620 # -------------------------------------
3621 # Define a conditional.
3622 AC_DEFUN([AM_CONDITIONAL],
3624 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
3625 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
3626 AC_SUBST([$1_TRUE])dnl
3627 AC_SUBST([$1_FALSE])dnl
3628 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
3629 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
3630 m4_define([_AM_COND_VALUE_$1], [$2])dnl
3638 AC_CONFIG_COMMANDS_PRE(
3639 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
3640 AC_MSG_ERROR([[conditional "$1" was never defined.
3641 Usually this means the macro was only invoked conditionally.]])
3644 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
3645 # Free Software Foundation, Inc.
3647 # This file is free software; the Free Software Foundation
3648 # gives unlimited permission to copy and/or distribute it,
3649 # with or without modifications, as long as this notice is preserved.
3653 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
3654 # written in clear, in which case automake, when reading aclocal.m4,
3655 # will think it sees a *use*, and therefore will trigger all it's
3656 # C support machinery. Also note that it means that autoscan, seeing
3657 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
3660 # _AM_DEPENDENCIES(NAME)
3661 # ----------------------
3662 # See how the compiler implements dependency checking.
3663 # NAME is "CC", "CXX", "GCJ", or "OBJC".
3664 # We try a few techniques and use that to set a single cache variable.
3666 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
3667 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
3668 # dependency, and given that the user is not expected to run this macro,
3669 # just rely on AC_PROG_CC.
3670 AC_DEFUN([_AM_DEPENDENCIES],
3671 [AC_REQUIRE([AM_SET_DEPDIR])dnl
3672 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
3673 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
3674 AC_REQUIRE([AM_DEP_TRACK])dnl
3676 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
3677 [$1], CXX, [depcc="$CXX" am_compiler_list=],
3678 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
3679 [$1], UPC, [depcc="$UPC" am_compiler_list=],
3680 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
3681 [depcc="$$1" am_compiler_list=])
3683 AC_CACHE_CHECK([dependency style of $depcc],
3684 [am_cv_$1_dependencies_compiler_type],
3685 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3686 # We make a subdir and do the tests there. Otherwise we can end up
3687 # making bogus files that we don't know about and never remove. For
3688 # instance it was reported that on HP-UX the gcc test will end up
3689 # making a dummy file named `D' -- because `-MD' means `put the output
3692 # Copy depcomp to subdir because otherwise we won't find it if we're
3693 # using a relative directory.
3694 cp "$am_depcomp" conftest.dir
3696 # We will build objects and dependencies in a subdirectory because
3697 # it helps to detect inapplicable dependency modes. For instance
3698 # both Tru64's cc and ICC support -MD to output dependencies as a
3699 # side effect of compilation, but ICC will put the dependencies in
3700 # the current directory while Tru64 will put them in the object
3704 am_cv_$1_dependencies_compiler_type=none
3705 if test "$am_compiler_list" = ""; then
3706 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
3710 [case " $depcc " in #(
3711 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3714 [case " $depcc " in #(
3715 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3718 for depmode in $am_compiler_list; do
3719 # Setup a source with many dependencies, because some compilers
3720 # like to wrap large dependency lists on column 80 (with \), and
3721 # we should not choose a depcomp mode which is confused by this.
3723 # We need to recreate these files for each test, as the compiler may
3724 # overwrite some of them when testing with obscure command lines.
3725 # This happens at least with the AIX C compiler.
3727 for i in 1 2 3 4 5 6; do
3728 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3729 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3730 # Solaris 8's {/usr,}/bin/sh.
3731 touch sub/conftst$i.h
3733 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3735 # We check with `-c' and `-o' for the sake of the "dashmstdout"
3736 # mode. It turns out that the SunPro C++ compiler does not properly
3737 # handle `-M -o', and we need to detect this. Also, some Intel
3738 # versions had trouble with output in subdirs
3739 am__obj=sub/conftest.${OBJEXT-o}
3740 am__minus_obj="-o $am__obj"
3743 # This depmode causes a compiler race in universal mode.
3744 test "$am__universal" = false || continue
3747 # after this tag, mechanisms are not by side-effect, so they'll
3748 # only be used when explicitly requested
3749 if test "x$enable_dependency_tracking" = xyes; then
3755 msvisualcpp | msvcmsys)
3756 # This compiler won't grok `-c -o', but also, the minuso test has
3757 # not run yet. These depmodes are late enough in the game, and
3758 # so weak that their functioning should not be impacted.
3759 am__obj=conftest.${OBJEXT-o}
3764 if depmode=$depmode \
3765 source=sub/conftest.c object=$am__obj \
3766 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3767 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3768 >/dev/null 2>conftest.err &&
3769 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3770 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3771 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3772 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3773 # icc doesn't choke on unknown options, it will just issue warnings
3774 # or remarks (even with -Werror). So we grep stderr for any message
3775 # that says an option was ignored or not supported.
3776 # When given -MP, icc 7.0 and 7.1 complain thusly:
3777 # icc: Command line warning: ignoring option '-M'; no argument required
3778 # The diagnosis changed in icc 8.0:
3779 # icc: Command line remark: option '-MP' not supported
3780 if (grep 'ignoring option' conftest.err ||
3781 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3782 am_cv_$1_dependencies_compiler_type=$depmode
3791 am_cv_$1_dependencies_compiler_type=none
3794 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
3795 AM_CONDITIONAL([am__fastdep$1], [
3796 test "x$enable_dependency_tracking" != xno \
3797 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
3803 # Choose a directory name for dependency files.
3804 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
3805 AC_DEFUN([AM_SET_DEPDIR],
3806 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
3807 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
3813 AC_DEFUN([AM_DEP_TRACK],
3814 [AC_ARG_ENABLE(dependency-tracking,
3815 [ --disable-dependency-tracking speeds up one-time build
3816 --enable-dependency-tracking do not reject slow dependency extractors])
3817 if test "x$enable_dependency_tracking" != xno; then
3818 am_depcomp="$ac_aux_dir/depcomp"
3821 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
3822 AC_SUBST([AMDEPBACKSLASH])dnl
3823 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
3826 # Generate code to set up dependency tracking. -*- Autoconf -*-
3828 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
3829 # Free Software Foundation, Inc.
3831 # This file is free software; the Free Software Foundation
3832 # gives unlimited permission to copy and/or distribute it,
3833 # with or without modifications, as long as this notice is preserved.
3837 # _AM_OUTPUT_DEPENDENCY_COMMANDS
3838 # ------------------------------
3839 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
3841 # Autoconf 2.62 quotes --file arguments for eval, but not when files
3842 # are listed without --file. Let's play safe and only enable the eval
3843 # if we detect the quoting.
3844 case $CONFIG_FILES in
3845 *\'*) eval set x "$CONFIG_FILES" ;;
3846 *) set x $CONFIG_FILES ;;
3851 # Strip MF so we end up with the name of the file.
3852 mf=`echo "$mf" | sed -e 's/:.*$//'`
3853 # Check whether this is an Automake generated Makefile or not.
3854 # We used to match only the files named `Makefile.in', but
3855 # some people rename them; so instead we look at the file content.
3856 # Grep'ing the first line is not enough: some people post-process
3857 # each Makefile.in and add a new line on top of each file to say so.
3858 # Grep'ing the whole file is not good either: AIX grep has a line
3859 # limit of 2048, but all sed's we know have understand at least 4000.
3860 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
3861 dirpart=`AS_DIRNAME("$mf")`
3865 # Extract the definition of DEPDIR, am__include, and am__quote
3866 # from the Makefile without running `make'.
3867 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
3868 test -z "$DEPDIR" && continue
3869 am__include=`sed -n 's/^am__include = //p' < "$mf"`
3870 test -z "am__include" && continue
3871 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
3872 # When using ansi2knr, U may be empty or an underscore; expand it
3873 U=`sed -n 's/^U = //p' < "$mf"`
3874 # Find all dependency output files, they are included files with
3875 # $(DEPDIR) in their names. We invoke sed twice because it is the
3876 # simplest approach to changing $(DEPDIR) to its actual value in the
3878 for file in `sed -n "
3879 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
3880 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
3881 # Make sure the directory exists.
3882 test -f "$dirpart/$file" && continue
3883 fdir=`AS_DIRNAME(["$file"])`
3884 AS_MKDIR_P([$dirpart/$fdir])
3885 # echo "creating $dirpart/$file"
3886 echo '# dummy' > "$dirpart/$file"
3890 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
3893 # AM_OUTPUT_DEPENDENCY_COMMANDS
3894 # -----------------------------
3895 # This macro should only be invoked once -- use via AC_REQUIRE.
3897 # This code is only required when automatic dependency tracking
3898 # is enabled. FIXME. This creates each `.P' file that we will
3899 # need in order to bootstrap the dependency handling code.
3900 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
3901 [AC_CONFIG_COMMANDS([depfiles],
3902 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
3903 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
3906 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
3907 # Free Software Foundation, Inc.
3909 # This file is free software; the Free Software Foundation
3910 # gives unlimited permission to copy and/or distribute it,
3911 # with or without modifications, as long as this notice is preserved.
3915 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
3916 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
3918 # Do all the work for Automake. -*- Autoconf -*-
3920 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3921 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
3923 # This file is free software; the Free Software Foundation
3924 # gives unlimited permission to copy and/or distribute it,
3925 # with or without modifications, as long as this notice is preserved.
3929 # This macro actually does too much. Some checks are only needed if
3930 # your package does certain things. But this isn't really a big deal.
3932 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
3933 # AM_INIT_AUTOMAKE([OPTIONS])
3934 # -----------------------------------------------
3935 # The call with PACKAGE and VERSION arguments is the old style
3936 # call (pre autoconf-2.50), which is being phased out. PACKAGE
3937 # and VERSION should now be passed to AC_INIT and removed from
3938 # the call to AM_INIT_AUTOMAKE.
3939 # We support both call styles for the transition. After
3940 # the next Automake release, Autoconf can make the AC_INIT
3941 # arguments mandatory, and then we can depend on a new Autoconf
3942 # release and drop the old call support.
3943 AC_DEFUN([AM_INIT_AUTOMAKE],
3944 [AC_PREREQ([2.62])dnl
3945 dnl Autoconf wants to disallow AM_ names. We explicitly allow
3946 dnl the ones we care about.
3947 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
3948 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
3949 AC_REQUIRE([AC_PROG_INSTALL])dnl
3950 if test "`cd $srcdir && pwd`" != "`pwd`"; then
3951 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3952 # is not polluted with repeated "-I."
3953 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
3954 # test to see if srcdir already configured
3955 if test -f $srcdir/config.status; then
3956 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
3960 # test whether we have cygpath
3961 if test -z "$CYGPATH_W"; then
3962 if (cygpath --version) >/dev/null 2>/dev/null; then
3963 CYGPATH_W='cygpath -w'
3968 AC_SUBST([CYGPATH_W])
3970 # Define the identity of the package.
3971 dnl Distinguish between old-style and new-style calls.
3973 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
3974 AC_SUBST([PACKAGE], [$1])dnl
3975 AC_SUBST([VERSION], [$2])],
3976 [_AM_SET_OPTIONS([$1])dnl
3977 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
3978 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
3979 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
3980 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
3981 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
3983 _AM_IF_OPTION([no-define],,
3984 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
3985 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
3987 # Some tools Automake needs.
3988 AC_REQUIRE([AM_SANITY_CHECK])dnl
3989 AC_REQUIRE([AC_ARG_PROGRAM])dnl
3990 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
3991 AM_MISSING_PROG(AUTOCONF, autoconf)
3992 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
3993 AM_MISSING_PROG(AUTOHEADER, autoheader)
3994 AM_MISSING_PROG(MAKEINFO, makeinfo)
3995 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3996 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
3997 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
3998 # We need awk for the "check" target. The system "awk" is bad on
4000 AC_REQUIRE([AC_PROG_AWK])dnl
4001 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
4002 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
4003 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
4004 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
4005 [_AM_PROG_TAR([v7])])])
4006 _AM_IF_OPTION([no-dependencies],,
4007 [AC_PROVIDE_IFELSE([AC_PROG_CC],
4008 [_AM_DEPENDENCIES(CC)],
4009 [define([AC_PROG_CC],
4010 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
4011 AC_PROVIDE_IFELSE([AC_PROG_CXX],
4012 [_AM_DEPENDENCIES(CXX)],
4013 [define([AC_PROG_CXX],
4014 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
4015 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
4016 [_AM_DEPENDENCIES(OBJC)],
4017 [define([AC_PROG_OBJC],
4018 defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
4020 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
4021 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
4022 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
4023 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
4024 AC_CONFIG_COMMANDS_PRE(dnl
4025 [m4_provide_if([_AM_COMPILER_EXEEXT],
4026 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
4029 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
4030 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
4031 dnl mangled by Autoconf and run in a shell conditional statement.
4032 m4_define([_AC_COMPILER_EXEEXT],
4033 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
4036 # When config.status generates a header, we must update the stamp-h file.
4037 # This file resides in the same directory as the config header
4038 # that is generated. The stamp files are numbered to have different names.
4040 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
4041 # loop where config.status creates the headers, so we can generate
4042 # our stamp files there.
4043 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
4044 [# Compute $1's index in $config_headers.
4047 for _am_header in $config_headers :; do
4049 $_am_arg | $_am_arg:* )
4052 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
4055 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
4057 # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
4059 # This file is free software; the Free Software Foundation
4060 # gives unlimited permission to copy and/or distribute it,
4061 # with or without modifications, as long as this notice is preserved.
4063 # AM_PROG_INSTALL_SH
4064 # ------------------
4065 # Define $install_sh.
4066 AC_DEFUN([AM_PROG_INSTALL_SH],
4067 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4068 if test x"${install_sh}" != xset; then
4071 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
4073 install_sh="\${SHELL} $am_aux_dir/install-sh"
4076 AC_SUBST(install_sh)])
4078 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
4080 # This file is free software; the Free Software Foundation
4081 # gives unlimited permission to copy and/or distribute it,
4082 # with or without modifications, as long as this notice is preserved.
4086 # Check whether the underlying file-system supports filenames
4087 # with a leading dot. For instance MS-DOS doesn't.
4088 AC_DEFUN([AM_SET_LEADING_DOT],
4089 [rm -rf .tst 2>/dev/null
4090 mkdir .tst 2>/dev/null
4091 if test -d .tst; then
4096 rmdir .tst 2>/dev/null
4097 AC_SUBST([am__leading_dot])])
4099 # Check to see how 'make' treats includes. -*- Autoconf -*-
4101 # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
4103 # This file is free software; the Free Software Foundation
4104 # gives unlimited permission to copy and/or distribute it,
4105 # with or without modifications, as long as this notice is preserved.
4111 # Check to see how make treats includes.
4112 AC_DEFUN([AM_MAKE_INCLUDE],
4113 [am_make=${MAKE-make}
4114 cat > confinc << 'END'
4116 @echo this is the am__doit target
4119 # If we don't find an include directive, just comment out the code.
4120 AC_MSG_CHECKING([for style of include used by $am_make])
4124 # First try GNU make style include.
4125 echo "include confinc" > confmf
4126 # Ignore all kinds of additional output from `make'.
4127 case `$am_make -s -f confmf 2> /dev/null` in #(
4128 *the\ am__doit\ target*)
4134 # Now try BSD make style include.
4135 if test "$am__include" = "#"; then
4136 echo '.include "confinc"' > confmf
4137 case `$am_make -s -f confmf 2> /dev/null` in #(
4138 *the\ am__doit\ target*)
4139 am__include=.include
4145 AC_SUBST([am__include])
4146 AC_SUBST([am__quote])
4147 AC_MSG_RESULT([$_am_result])
4148 rm -f confinc confmf
4151 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
4153 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
4154 # Free Software Foundation, Inc.
4156 # This file is free software; the Free Software Foundation
4157 # gives unlimited permission to copy and/or distribute it,
4158 # with or without modifications, as long as this notice is preserved.
4162 # AM_MISSING_PROG(NAME, PROGRAM)
4163 # ------------------------------
4164 AC_DEFUN([AM_MISSING_PROG],
4165 [AC_REQUIRE([AM_MISSING_HAS_RUN])
4166 $1=${$1-"${am_missing_run}$2"}
4170 # AM_MISSING_HAS_RUN
4171 # ------------------
4172 # Define MISSING if not defined so far and test if it supports --run.
4173 # If it does, set am_missing_run to use it, otherwise, to nothing.
4174 AC_DEFUN([AM_MISSING_HAS_RUN],
4175 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
4176 AC_REQUIRE_AUX_FILE([missing])dnl
4177 if test x"${MISSING+set}" != xset; then
4180 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
4182 MISSING="\${SHELL} $am_aux_dir/missing" ;;
4185 # Use eval to expand $SHELL
4186 if eval "$MISSING --run true"; then
4187 am_missing_run="$MISSING --run "
4190 AC_MSG_WARN([`missing' script is too old or missing])
4194 # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4196 # This file is free software; the Free Software Foundation
4197 # gives unlimited permission to copy and/or distribute it,
4198 # with or without modifications, as long as this notice is preserved.
4202 # Check for `mkdir -p'.
4203 AC_DEFUN([AM_PROG_MKDIR_P],
4204 [AC_PREREQ([2.60])dnl
4205 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
4206 dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
4207 dnl while keeping a definition of mkdir_p for backward compatibility.
4208 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
4209 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
4210 dnl Makefile.ins that do not define MKDIR_P, so we do our own
4211 dnl adjustment using top_builddir (which is defined more often than
4213 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
4215 [[\\/$]]* | ?:[[\\/]]*) ;;
4216 */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
4220 # Helper functions for option handling. -*- Autoconf -*-
4222 # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
4224 # This file is free software; the Free Software Foundation
4225 # gives unlimited permission to copy and/or distribute it,
4226 # with or without modifications, as long as this notice is preserved.
4230 # _AM_MANGLE_OPTION(NAME)
4231 # -----------------------
4232 AC_DEFUN([_AM_MANGLE_OPTION],
4233 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
4235 # _AM_SET_OPTION(NAME)
4236 # ------------------------------
4237 # Set option NAME. Presently that only means defining a flag for this option.
4238 AC_DEFUN([_AM_SET_OPTION],
4239 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
4241 # _AM_SET_OPTIONS(OPTIONS)
4242 # ----------------------------------
4243 # OPTIONS is a space-separated list of Automake options.
4244 AC_DEFUN([_AM_SET_OPTIONS],
4245 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
4247 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
4248 # -------------------------------------------
4249 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
4250 AC_DEFUN([_AM_IF_OPTION],
4251 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
4253 # Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
4254 # Free Software Foundation, Inc.
4256 # This file is free software; the Free Software Foundation
4257 # gives unlimited permission to copy and/or distribute it,
4258 # with or without modifications, as long as this notice is preserved.
4262 AC_DEFUN([AM_C_PROTOTYPES],
4263 [AC_REQUIRE([AC_C_PROTOTYPES])
4264 if test "$ac_cv_prog_cc_stdc" != no; then
4267 U=_ ANSI2KNR=./ansi2knr
4269 # Ensure some checks needed by ansi2knr itself.
4270 AC_REQUIRE([AC_HEADER_STDC])
4271 AC_CHECK_HEADERS([string.h])
4273 AC_SUBST([ANSI2KNR])dnl
4274 _AM_SUBST_NOTMAKE([ANSI2KNR])dnl
4277 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
4279 # Check to make sure that the build environment is sane. -*- Autoconf -*-
4281 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
4282 # Free Software Foundation, Inc.
4284 # This file is free software; the Free Software Foundation
4285 # gives unlimited permission to copy and/or distribute it,
4286 # with or without modifications, as long as this notice is preserved.
4292 AC_DEFUN([AM_SANITY_CHECK],
4293 [AC_MSG_CHECKING([whether build environment is sane])
4296 echo timestamp > conftest.file
4297 # Reject unsafe characters in $srcdir or the absolute working directory
4298 # name. Accept space and tab only in the latter.
4302 *[[\\\"\#\$\&\'\`$am_lf]]*)
4303 AC_MSG_ERROR([unsafe absolute working directory name]);;
4306 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
4307 AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
4310 # Do `set' in a subshell so we don't clobber the current shell's
4311 # arguments. Must try -L first in case configure is actually a
4312 # symlink; some systems play weird games with the mod time of symlinks
4313 # (eg FreeBSD returns the mod time of the symlink's containing
4316 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
4317 if test "$[*]" = "X"; then
4319 set X `ls -t "$srcdir/configure" conftest.file`
4322 if test "$[*]" != "X $srcdir/configure conftest.file" \
4323 && test "$[*]" != "X conftest.file $srcdir/configure"; then
4325 # If neither matched, then we have a broken ls. This can happen
4326 # if, for instance, CONFIG_SHELL is bash and it inherits a
4327 # broken ls alias from the environment. This has actually
4328 # happened. Such a system could not be considered "sane".
4329 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
4330 alias in your environment])
4333 test "$[2]" = conftest.file
4339 AC_MSG_ERROR([newly created file is older than distributed files!
4340 Check your system clock])
4342 AC_MSG_RESULT(yes)])
4344 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
4346 # This file is free software; the Free Software Foundation
4347 # gives unlimited permission to copy and/or distribute it,
4348 # with or without modifications, as long as this notice is preserved.
4350 # AM_PROG_INSTALL_STRIP
4351 # ---------------------
4352 # One issue with vendor `install' (even GNU) is that you can't
4353 # specify the program used to strip binaries. This is especially
4354 # annoying in cross-compiling environments, where the build's strip
4355 # is unlikely to handle the host's binaries.
4356 # Fortunately install-sh will honor a STRIPPROG variable, so we
4357 # always use install-sh in `make install-strip', and initialize
4358 # STRIPPROG with the value of the STRIP variable (set by the user).
4359 AC_DEFUN([AM_PROG_INSTALL_STRIP],
4360 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
4361 # Installed binaries are usually stripped using `strip' when the user
4362 # run `make install-strip'. However `strip' might not be the right
4363 # tool to use in cross-compilation environments, therefore Automake
4364 # will honor the `STRIP' environment variable to overrule this program.
4365 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
4366 if test "$cross_compiling" != no; then
4367 AC_CHECK_TOOL([STRIP], [strip], :)
4369 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
4370 AC_SUBST([INSTALL_STRIP_PROGRAM])])
4372 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
4374 # This file is free software; the Free Software Foundation
4375 # gives unlimited permission to copy and/or distribute it,
4376 # with or without modifications, as long as this notice is preserved.
4380 # _AM_SUBST_NOTMAKE(VARIABLE)
4381 # ---------------------------
4382 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
4383 # This macro is traced by Automake.
4384 AC_DEFUN([_AM_SUBST_NOTMAKE])
4386 # AM_SUBST_NOTMAKE(VARIABLE)
4387 # ---------------------------
4388 # Public sister of _AM_SUBST_NOTMAKE.
4389 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
4391 # Check how to create a tarball. -*- Autoconf -*-
4393 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
4395 # This file is free software; the Free Software Foundation
4396 # gives unlimited permission to copy and/or distribute it,
4397 # with or without modifications, as long as this notice is preserved.
4401 # _AM_PROG_TAR(FORMAT)
4402 # --------------------
4403 # Check how to create a tarball in format FORMAT.
4404 # FORMAT should be one of `v7', `ustar', or `pax'.
4406 # Substitute a variable $(am__tar) that is a command
4407 # writing to stdout a FORMAT-tarball containing the directory
4409 # tardir=directory && $(am__tar) > result.tar
4411 # Substitute a variable $(am__untar) that extract such
4412 # a tarball read from stdin.
4413 # $(am__untar) < result.tar
4414 AC_DEFUN([_AM_PROG_TAR],
4415 [# Always define AMTAR for backward compatibility.
4416 AM_MISSING_PROG([AMTAR], [tar])
4418 [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
4419 [m4_case([$1], [ustar],, [pax],,
4420 [m4_fatal([Unknown tar format])])
4421 AC_MSG_CHECKING([how to create a $1 tar archive])
4422 # Loop over all known methods to create a tar archive until one works.
4423 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
4424 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
4425 # Do not fold the above two line into one, because Tru64 sh and
4426 # Solaris sh will not grok spaces in the rhs of `-'.
4427 for _am_tool in $_am_tools
4431 for _am_tar in tar gnutar gtar;
4433 AM_RUN_LOG([$_am_tar --version]) && break
4435 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
4436 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
4437 am__untar="$_am_tar -xf -"
4440 # Must skip GNU tar: if it does not support --format= it doesn't create
4441 # ustar tarball either.
4442 (tar --version) >/dev/null 2>&1 && continue
4443 am__tar='tar chf - "$$tardir"'
4444 am__tar_='tar chf - "$tardir"'
4445 am__untar='tar xf -'
4448 am__tar='pax -L -x $1 -w "$$tardir"'
4449 am__tar_='pax -L -x $1 -w "$tardir"'
4453 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
4454 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
4455 am__untar='cpio -i -H $1 -d'
4464 # If the value was cached, stop now. We just wanted to have am__tar
4465 # and am__untar set.
4466 test -n "${am_cv_prog_tar_$1}" && break
4468 # tar/untar a dummy directory, and stop if the command works
4471 echo GrepMe > conftest.dir/file
4472 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
4474 if test -s conftest.tar; then
4475 AM_RUN_LOG([$am__untar <conftest.tar])
4476 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
4481 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
4482 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
4484 AC_SUBST([am__untar])
4487 m4_include([acinclude.m4])