1# generated automatically by aclocal 1.11 -*- Autoconf -*-
2
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.
8
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
12# PARTICULAR PURPOSE.
13
14# codeset.m4 serial 2 (gettext-0.16)
15dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
16dnl This file is free software; the Free Software Foundation
17dnl gives unlimited permission to copy and/or distribute it,
18dnl with or without modifications, as long as this notice is preserved.
19
20dnl From Bruno Haible.
21
22AC_DEFUN([AM_LANGINFO_CODESET],
23[
24  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
25    [AC_TRY_LINK([#include <langinfo.h>],
26      [char* cs = nl_langinfo(CODESET); return !cs;],
27      am_cv_langinfo_codeset=yes,
28      am_cv_langinfo_codeset=no)
29    ])
30  if test $am_cv_langinfo_codeset = yes; then
31    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
32      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
33  fi
34])
35
36# gettext.m4 serial 60 (gettext-0.17)
37dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
38dnl This file is free software; the Free Software Foundation
39dnl gives unlimited permission to copy and/or distribute it,
40dnl with or without modifications, as long as this notice is preserved.
41dnl
42dnl This file can can be used in projects which are not available under
43dnl the GNU General Public License or the GNU Library General Public
44dnl License but which still want to provide support for the GNU gettext
45dnl functionality.
46dnl Please note that the actual code of the GNU gettext library is covered
47dnl by the GNU Library General Public License, and the rest of the GNU
48dnl gettext package package is covered by the GNU General Public License.
49dnl They are *not* in the public domain.
50
51dnl Authors:
52dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
53dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
54
55dnl Macro to add for using GNU gettext.
56
57dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
58dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
59dnl    default (if it is not specified or empty) is 'no-libtool'.
60dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
61dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
62dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
63dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
64dnl    depending on --{enable,disable}-{shared,static} and on the presence of
65dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
66dnl    $(top_builddir)/intl/libintl.a will be created.
67dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
68dnl    implementations (in libc or libintl) without the ngettext() function
69dnl    will be ignored.  If NEEDSYMBOL is specified and is
70dnl    'need-formatstring-macros', then GNU gettext implementations that don't
71dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
72dnl INTLDIR is used to find the intl libraries.  If empty,
73dnl    the value `$(top_builddir)/intl/' is used.
74dnl
75dnl The result of the configuration is one of three cases:
76dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
77dnl    and used.
78dnl    Catalog format: GNU --> install in $(datadir)
79dnl    Catalog extension: .mo after installation, .gmo in source tree
80dnl 2) GNU gettext has been found in the system's C library.
81dnl    Catalog format: GNU --> install in $(datadir)
82dnl    Catalog extension: .mo after installation, .gmo in source tree
83dnl 3) No internationalization, always use English msgid.
84dnl    Catalog format: none
85dnl    Catalog extension: none
86dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
87dnl The use of .gmo is historical (it was needed to avoid overwriting the
88dnl GNU format catalogs when building on a platform with an X/Open gettext),
89dnl but we keep it in order not to force irrelevant filename changes on the
90dnl maintainers.
91dnl
92AC_DEFUN([AM_GNU_GETTEXT],
93[
94  dnl Argument checking.
95  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
96    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
97])])])])])
98  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
99    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
100])])])])
101  define([gt_included_intl],
102    ifelse([$1], [external],
103      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
104      [yes]))
105  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
106  gt_NEEDS_INIT
107  AM_GNU_GETTEXT_NEED([$2])
108
109  AC_REQUIRE([AM_PO_SUBDIRS])dnl
110  ifelse(gt_included_intl, yes, [
111    AC_REQUIRE([AM_INTL_SUBDIR])dnl
112  ])
113
114  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
115  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
116  AC_REQUIRE([AC_LIB_RPATH])
117
118  dnl Sometimes libintl requires libiconv, so first search for libiconv.
119  dnl Ideally we would do this search only after the
120  dnl      if test "$USE_NLS" = "yes"; then
121  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
122  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
123  dnl the configure script would need to contain the same shell code
124  dnl again, outside any 'if'. There are two solutions:
125  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
126  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
127  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
128  dnl documented, we avoid it.
129  ifelse(gt_included_intl, yes, , [
130    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
131  ])
132
133  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
134  gt_INTL_MACOSX
135
136  dnl Set USE_NLS.
137  AC_REQUIRE([AM_NLS])
138
139  ifelse(gt_included_intl, yes, [
140    BUILD_INCLUDED_LIBINTL=no
141    USE_INCLUDED_LIBINTL=no
142  ])
143  LIBINTL=
144  LTLIBINTL=
145  POSUB=
146
147  dnl Add a version number to the cache macros.
148  case " $gt_needs " in
149    *" need-formatstring-macros "*) gt_api_version=3 ;;
150    *" need-ngettext "*) gt_api_version=2 ;;
151    *) gt_api_version=1 ;;
152  esac
153  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
154  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
155
156  dnl If we use NLS figure out what method
157  if test "$USE_NLS" = "yes"; then
158    gt_use_preinstalled_gnugettext=no
159    ifelse(gt_included_intl, yes, [
160      AC_MSG_CHECKING([whether included gettext is requested])
161      AC_ARG_WITH(included-gettext,
162        [  --with-included-gettext use the GNU gettext library included here],
163        nls_cv_force_use_gnu_gettext=$withval,
164        nls_cv_force_use_gnu_gettext=no)
165      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
166
167      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
168      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
169    ])
170        dnl User does not insist on using GNU NLS library.  Figure out what
171        dnl to use.  If GNU gettext is available we use this.  Else we have
172        dnl to fall back to GNU NLS library.
173
174        if test $gt_api_version -ge 3; then
175          gt_revision_test_code='
176#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
177#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
178#endif
179changequote(,)dnl
180typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
181changequote([,])dnl
182'
183        else
184          gt_revision_test_code=
185        fi
186        if test $gt_api_version -ge 2; then
187          gt_expression_test_code=' + * ngettext ("", "", 0)'
188        else
189          gt_expression_test_code=
190        fi
191
192        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
193         [AC_TRY_LINK([#include <libintl.h>
194$gt_revision_test_code
195extern int _nl_msg_cat_cntr;
196extern int *_nl_domain_bindings;],
197            [bindtextdomain ("", "");
198return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
199            [eval "$gt_func_gnugettext_libc=yes"],
200            [eval "$gt_func_gnugettext_libc=no"])])
201
202        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
203          dnl Sometimes libintl requires libiconv, so first search for libiconv.
204          ifelse(gt_included_intl, yes, , [
205            AM_ICONV_LINK
206          ])
207          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
208          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
209          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
210          dnl even if libiconv doesn't exist.
211          AC_LIB_LINKFLAGS_BODY([intl])
212          AC_CACHE_CHECK([for GNU gettext in libintl],
213            [$gt_func_gnugettext_libintl],
214           [gt_save_CPPFLAGS="$CPPFLAGS"
215            CPPFLAGS="$CPPFLAGS $INCINTL"
216            gt_save_LIBS="$LIBS"
217            LIBS="$LIBS $LIBINTL"
218            dnl Now see whether libintl exists and does not depend on libiconv.
219            AC_TRY_LINK([#include <libintl.h>
220$gt_revision_test_code
221extern int _nl_msg_cat_cntr;
222extern
223#ifdef __cplusplus
224"C"
225#endif
226const char *_nl_expand_alias (const char *);],
227              [bindtextdomain ("", "");
228return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
229              [eval "$gt_func_gnugettext_libintl=yes"],
230              [eval "$gt_func_gnugettext_libintl=no"])
231            dnl Now see whether libintl exists and depends on libiconv.
232            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
233              LIBS="$LIBS $LIBICONV"
234              AC_TRY_LINK([#include <libintl.h>
235$gt_revision_test_code
236extern int _nl_msg_cat_cntr;
237extern
238#ifdef __cplusplus
239"C"
240#endif
241const char *_nl_expand_alias (const char *);],
242                [bindtextdomain ("", "");
243return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
244               [LIBINTL="$LIBINTL $LIBICONV"
245                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
246                eval "$gt_func_gnugettext_libintl=yes"
247               ])
248            fi
249            CPPFLAGS="$gt_save_CPPFLAGS"
250            LIBS="$gt_save_LIBS"])
251        fi
252
253        dnl If an already present or preinstalled GNU gettext() is found,
254        dnl use it.  But if this macro is used in GNU gettext, and GNU
255        dnl gettext is already preinstalled in libintl, we update this
256        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
257        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
258           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
259                && test "$PACKAGE" != gettext-runtime \
260                && test "$PACKAGE" != gettext-tools; }; then
261          gt_use_preinstalled_gnugettext=yes
262        else
263          dnl Reset the values set by searching for libintl.
264          LIBINTL=
265          LTLIBINTL=
266          INCINTL=
267        fi
268
269    ifelse(gt_included_intl, yes, [
270        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
271          dnl GNU gettext is not found in the C library.
272          dnl Fall back on included GNU gettext library.
273          nls_cv_use_gnu_gettext=yes
274        fi
275      fi
276
277      if test "$nls_cv_use_gnu_gettext" = "yes"; then
278        dnl Mark actions used to generate GNU NLS library.
279        BUILD_INCLUDED_LIBINTL=yes
280        USE_INCLUDED_LIBINTL=yes
281        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
282        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
283        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
284      fi
285
286      CATOBJEXT=
287      if test "$gt_use_preinstalled_gnugettext" = "yes" \
288         || test "$nls_cv_use_gnu_gettext" = "yes"; then
289        dnl Mark actions to use GNU gettext tools.
290        CATOBJEXT=.gmo
291      fi
292    ])
293
294    if test -n "$INTL_MACOSX_LIBS"; then
295      if test "$gt_use_preinstalled_gnugettext" = "yes" \
296         || test "$nls_cv_use_gnu_gettext" = "yes"; then
297        dnl Some extra flags are needed during linking.
298        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
299        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
300      fi
301    fi
302
303    if test "$gt_use_preinstalled_gnugettext" = "yes" \
304       || test "$nls_cv_use_gnu_gettext" = "yes"; then
305      AC_DEFINE(ENABLE_NLS, 1,
306        [Define to 1 if translation of program messages to the user's native language
307   is requested.])
308    else
309      USE_NLS=no
310    fi
311  fi
312
313  AC_MSG_CHECKING([whether to use NLS])
314  AC_MSG_RESULT([$USE_NLS])
315  if test "$USE_NLS" = "yes"; then
316    AC_MSG_CHECKING([where the gettext function comes from])
317    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
318      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
319        gt_source="external libintl"
320      else
321        gt_source="libc"
322      fi
323    else
324      gt_source="included intl directory"
325    fi
326    AC_MSG_RESULT([$gt_source])
327  fi
328
329  if test "$USE_NLS" = "yes"; then
330
331    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
332      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
333        AC_MSG_CHECKING([how to link with libintl])
334        AC_MSG_RESULT([$LIBINTL])
335        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
336      fi
337
338      dnl For backward compatibility. Some packages may be using this.
339      AC_DEFINE(HAVE_GETTEXT, 1,
340       [Define if the GNU gettext() function is already present or preinstalled.])
341      AC_DEFINE(HAVE_DCGETTEXT, 1,
342       [Define if the GNU dcgettext() function is already present or preinstalled.])
343    fi
344
345    dnl We need to process the po/ directory.
346    POSUB=po
347  fi
348
349  ifelse(gt_included_intl, yes, [
350    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
351    dnl to 'yes' because some of the testsuite requires it.
352    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
353      BUILD_INCLUDED_LIBINTL=yes
354    fi
355
356    dnl Make all variables we use known to autoconf.
357    AC_SUBST(BUILD_INCLUDED_LIBINTL)
358    AC_SUBST(USE_INCLUDED_LIBINTL)
359    AC_SUBST(CATOBJEXT)
360
361    dnl For backward compatibility. Some configure.ins may be using this.
362    nls_cv_header_intl=
363    nls_cv_header_libgt=
364
365    dnl For backward compatibility. Some Makefiles may be using this.
366    DATADIRNAME=share
367    AC_SUBST(DATADIRNAME)
368
369    dnl For backward compatibility. Some Makefiles may be using this.
370    INSTOBJEXT=.mo
371    AC_SUBST(INSTOBJEXT)
372
373    dnl For backward compatibility. Some Makefiles may be using this.
374    GENCAT=gencat
375    AC_SUBST(GENCAT)
376
377    dnl For backward compatibility. Some Makefiles may be using this.
378    INTLOBJS=
379    if test "$USE_INCLUDED_LIBINTL" = yes; then
380      INTLOBJS="\$(GETTOBJS)"
381    fi
382    AC_SUBST(INTLOBJS)
383
384    dnl Enable libtool support if the surrounding package wishes it.
385    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
386    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
387  ])
388
389  dnl For backward compatibility. Some Makefiles may be using this.
390  INTLLIBS="$LIBINTL"
391  AC_SUBST(INTLLIBS)
392
393  dnl Make all documented variables known to autoconf.
394  AC_SUBST(LIBINTL)
395  AC_SUBST(LTLIBINTL)
396  AC_SUBST(POSUB)
397])
398
399
400dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
401m4_define([gt_NEEDS_INIT],
402[
403  m4_divert_text([DEFAULTS], [gt_needs=])
404  m4_define([gt_NEEDS_INIT], [])
405])
406
407
408dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
409AC_DEFUN([AM_GNU_GETTEXT_NEED],
410[
411  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
412])
413
414
415dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
416AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
417
418# glibc2.m4 serial 1
419dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
420dnl This file is free software; the Free Software Foundation
421dnl gives unlimited permission to copy and/or distribute it,
422dnl with or without modifications, as long as this notice is preserved.
423
424# Test for the GNU C Library, version 2.0 or newer.
425# From Bruno Haible.
426
427AC_DEFUN([gt_GLIBC2],
428  [
429    AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
430      ac_cv_gnu_library_2,
431      [AC_EGREP_CPP([Lucky GNU user],
432	[
433#include <features.h>
434#ifdef __GNU_LIBRARY__
435 #if (__GLIBC__ >= 2)
436  Lucky GNU user
437 #endif
438#endif
439	],
440	ac_cv_gnu_library_2=yes,
441	ac_cv_gnu_library_2=no)
442      ]
443    )
444    AC_SUBST(GLIBC2)
445    GLIBC2="$ac_cv_gnu_library_2"
446  ]
447)
448
449# glibc21.m4 serial 3
450dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
451dnl This file is free software; the Free Software Foundation
452dnl gives unlimited permission to copy and/or distribute it,
453dnl with or without modifications, as long as this notice is preserved.
454
455# Test for the GNU C Library, version 2.1 or newer.
456# From Bruno Haible.
457
458AC_DEFUN([gl_GLIBC21],
459  [
460    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
461      ac_cv_gnu_library_2_1,
462      [AC_EGREP_CPP([Lucky GNU user],
463	[
464#include <features.h>
465#ifdef __GNU_LIBRARY__
466 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
467  Lucky GNU user
468 #endif
469#endif
470	],
471	ac_cv_gnu_library_2_1=yes,
472	ac_cv_gnu_library_2_1=no)
473      ]
474    )
475    AC_SUBST(GLIBC21)
476    GLIBC21="$ac_cv_gnu_library_2_1"
477  ]
478)
479
480# iconv.m4 serial AM6 (gettext-0.17)
481dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
482dnl This file is free software; the Free Software Foundation
483dnl gives unlimited permission to copy and/or distribute it,
484dnl with or without modifications, as long as this notice is preserved.
485
486dnl From Bruno Haible.
487
488AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
489[
490  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
491  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
492  AC_REQUIRE([AC_LIB_RPATH])
493
494  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
495  dnl accordingly.
496  AC_LIB_LINKFLAGS_BODY([iconv])
497])
498
499AC_DEFUN([AM_ICONV_LINK],
500[
501  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
502  dnl those with the standalone portable GNU libiconv installed).
503  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
504
505  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
506  dnl accordingly.
507  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
508
509  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
510  dnl because if the user has installed libiconv and not disabled its use
511  dnl via --without-libiconv-prefix, he wants to use it. The first
512  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
513  am_save_CPPFLAGS="$CPPFLAGS"
514  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
515
516  AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
517    am_cv_func_iconv="no, consider installing GNU libiconv"
518    am_cv_lib_iconv=no
519    AC_TRY_LINK([#include <stdlib.h>
520#include <iconv.h>],
521      [iconv_t cd = iconv_open("","");
522       iconv(cd,NULL,NULL,NULL,NULL);
523       iconv_close(cd);],
524      am_cv_func_iconv=yes)
525    if test "$am_cv_func_iconv" != yes; then
526      am_save_LIBS="$LIBS"
527      LIBS="$LIBS $LIBICONV"
528      AC_TRY_LINK([#include <stdlib.h>
529#include <iconv.h>],
530        [iconv_t cd = iconv_open("","");
531         iconv(cd,NULL,NULL,NULL,NULL);
532         iconv_close(cd);],
533        am_cv_lib_iconv=yes
534        am_cv_func_iconv=yes)
535      LIBS="$am_save_LIBS"
536    fi
537  ])
538  if test "$am_cv_func_iconv" = yes; then
539    AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
540      dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
541      am_save_LIBS="$LIBS"
542      if test $am_cv_lib_iconv = yes; then
543        LIBS="$LIBS $LIBICONV"
544      fi
545      AC_TRY_RUN([
546#include <iconv.h>
547#include <string.h>
548int main ()
549{
550  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
551     returns.  */
552  {
553    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
554    if (cd_utf8_to_88591 != (iconv_t)(-1))
555      {
556        static const char input[] = "\342\202\254"; /* EURO SIGN */
557        char buf[10];
558        const char *inptr = input;
559        size_t inbytesleft = strlen (input);
560        char *outptr = buf;
561        size_t outbytesleft = sizeof (buf);
562        size_t res = iconv (cd_utf8_to_88591,
563                            (char **) &inptr, &inbytesleft,
564                            &outptr, &outbytesleft);
565        if (res == 0)
566          return 1;
567      }
568  }
569#if 0 /* This bug could be worked around by the caller.  */
570  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
571  {
572    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
573    if (cd_88591_to_utf8 != (iconv_t)(-1))
574      {
575        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
576        char buf[50];
577        const char *inptr = input;
578        size_t inbytesleft = strlen (input);
579        char *outptr = buf;
580        size_t outbytesleft = sizeof (buf);
581        size_t res = iconv (cd_88591_to_utf8,
582                            (char **) &inptr, &inbytesleft,
583                            &outptr, &outbytesleft);
584        if ((int)res > 0)
585          return 1;
586      }
587  }
588#endif
589  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
590     provided.  */
591  if (/* Try standardized names.  */
592      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
593      /* Try IRIX, OSF/1 names.  */
594      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
595      /* Try AIX names.  */
596      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
597      /* Try HP-UX names.  */
598      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
599    return 1;
600  return 0;
601}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
602        [case "$host_os" in
603           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
604           *)            am_cv_func_iconv_works="guessing yes" ;;
605         esac])
606      LIBS="$am_save_LIBS"
607    ])
608    case "$am_cv_func_iconv_works" in
609      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
610      *)   am_func_iconv=yes ;;
611    esac
612  else
613    am_func_iconv=no am_cv_lib_iconv=no
614  fi
615  if test "$am_func_iconv" = yes; then
616    AC_DEFINE(HAVE_ICONV, 1,
617      [Define if you have the iconv() function and it works.])
618  fi
619  if test "$am_cv_lib_iconv" = yes; then
620    AC_MSG_CHECKING([how to link with libiconv])
621    AC_MSG_RESULT([$LIBICONV])
622  else
623    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
624    dnl either.
625    CPPFLAGS="$am_save_CPPFLAGS"
626    LIBICONV=
627    LTLIBICONV=
628  fi
629  AC_SUBST(LIBICONV)
630  AC_SUBST(LTLIBICONV)
631])
632
633AC_DEFUN([AM_ICONV],
634[
635  AM_ICONV_LINK
636  if test "$am_cv_func_iconv" = yes; then
637    AC_MSG_CHECKING([for iconv declaration])
638    AC_CACHE_VAL(am_cv_proto_iconv, [
639      AC_TRY_COMPILE([
640#include <stdlib.h>
641#include <iconv.h>
642extern
643#ifdef __cplusplus
644"C"
645#endif
646#if defined(__STDC__) || defined(__cplusplus)
647size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
648#else
649size_t iconv();
650#endif
651], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
652      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);"])
653    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
654    AC_MSG_RESULT([$]{ac_t:-
655         }[$]am_cv_proto_iconv)
656    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
657      [Define as const if the declaration of iconv() needs const.])
658  fi
659])
660
661# intdiv0.m4 serial 2 (gettext-0.17)
662dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
663dnl This file is free software; the Free Software Foundation
664dnl gives unlimited permission to copy and/or distribute it,
665dnl with or without modifications, as long as this notice is preserved.
666
667dnl From Bruno Haible.
668
669AC_DEFUN([gt_INTDIV0],
670[
671  AC_REQUIRE([AC_PROG_CC])dnl
672  AC_REQUIRE([AC_CANONICAL_HOST])dnl
673
674  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
675    gt_cv_int_divbyzero_sigfpe,
676    [
677      gt_cv_int_divbyzero_sigfpe=
678changequote(,)dnl
679      case "$host_os" in
680        macos* | darwin[6-9]* | darwin[1-9][0-9]*)
681          # On MacOS X 10.2 or newer, just assume the same as when cross-
682          # compiling. If we were to perform the real test, 1 Crash Report
683          # dialog window would pop up.
684          case "$host_cpu" in
685            i[34567]86 | x86_64)
686              gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
687          esac
688          ;;
689      esac
690changequote([,])dnl
691      if test -z "$gt_cv_int_divbyzero_sigfpe"; then
692        AC_TRY_RUN([
693#include <stdlib.h>
694#include <signal.h>
695
696static void
697sigfpe_handler (int sig)
698{
699  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
700  exit (sig != SIGFPE);
701}
702
703int x = 1;
704int y = 0;
705int z;
706int nan;
707
708int main ()
709{
710  signal (SIGFPE, sigfpe_handler);
711/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
712#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
713  signal (SIGTRAP, sigfpe_handler);
714#endif
715/* Linux/SPARC yields signal SIGILL.  */
716#if defined (__sparc__) && defined (__linux__)
717  signal (SIGILL, sigfpe_handler);
718#endif
719
720  z = x / y;
721  nan = y / y;
722  exit (1);
723}
724], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
725          [
726            # Guess based on the CPU.
727changequote(,)dnl
728            case "$host_cpu" in
729              alpha* | i[34567]86 | x86_64 | m68k | s390*)
730                gt_cv_int_divbyzero_sigfpe="guessing yes";;
731              *)
732                gt_cv_int_divbyzero_sigfpe="guessing no";;
733            esac
734changequote([,])dnl
735          ])
736      fi
737    ])
738  case "$gt_cv_int_divbyzero_sigfpe" in
739    *yes) value=1;;
740    *) value=0;;
741  esac
742  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
743    [Define if integer division by zero raises signal SIGFPE.])
744])
745
746# intl.m4 serial 8 (gettext-0.17)
747dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
748dnl This file is free software; the Free Software Foundation
749dnl gives unlimited permission to copy and/or distribute it,
750dnl with or without modifications, as long as this notice is preserved.
751dnl
752dnl This file can can be used in projects which are not available under
753dnl the GNU General Public License or the GNU Library General Public
754dnl License but which still want to provide support for the GNU gettext
755dnl functionality.
756dnl Please note that the actual code of the GNU gettext library is covered
757dnl by the GNU Library General Public License, and the rest of the GNU
758dnl gettext package package is covered by the GNU General Public License.
759dnl They are *not* in the public domain.
760
761dnl Authors:
762dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
763dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
764
765AC_PREREQ(2.52)
766
767dnl Checks for all prerequisites of the intl subdirectory,
768dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
769dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
770AC_DEFUN([AM_INTL_SUBDIR],
771[
772  AC_REQUIRE([AC_PROG_INSTALL])dnl
773  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
774  AC_REQUIRE([AC_PROG_CC])dnl
775  AC_REQUIRE([AC_CANONICAL_HOST])dnl
776  AC_REQUIRE([gt_GLIBC2])dnl
777  AC_REQUIRE([AC_PROG_RANLIB])dnl
778  AC_REQUIRE([gl_VISIBILITY])dnl
779  AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
780  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
781  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
782  AC_REQUIRE([gt_TYPE_WINT_T])dnl
783  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
784  AC_REQUIRE([gt_TYPE_INTMAX_T])
785  AC_REQUIRE([gt_PRINTF_POSIX])
786  AC_REQUIRE([gl_GLIBC21])dnl
787  AC_REQUIRE([gl_XSIZE])dnl
788  AC_REQUIRE([gt_INTL_MACOSX])dnl
789
790  AC_CHECK_TYPE([ptrdiff_t], ,
791    [AC_DEFINE([ptrdiff_t], [long],
792       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
793    ])
794  AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
795  AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
796
797  dnl Use the _snprintf function only if it is declared (because on NetBSD it
798  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
799  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
800  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
801
802  dnl Use the *_unlocked functions only if they are declared.
803  dnl (because some of them were defined without being declared in Solaris
804  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
805  dnl on Solaris 2.5.1 to run on Solaris 2.6).
806  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
807  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
808
809  case $gt_cv_func_printf_posix in
810    *yes) HAVE_POSIX_PRINTF=1 ;;
811    *) HAVE_POSIX_PRINTF=0 ;;
812  esac
813  AC_SUBST([HAVE_POSIX_PRINTF])
814  if test "$ac_cv_func_asprintf" = yes; then
815    HAVE_ASPRINTF=1
816  else
817    HAVE_ASPRINTF=0
818  fi
819  AC_SUBST([HAVE_ASPRINTF])
820  if test "$ac_cv_func_snprintf" = yes; then
821    HAVE_SNPRINTF=1
822  else
823    HAVE_SNPRINTF=0
824  fi
825  AC_SUBST([HAVE_SNPRINTF])
826  if test "$ac_cv_func_wprintf" = yes; then
827    HAVE_WPRINTF=1
828  else
829    HAVE_WPRINTF=0
830  fi
831  AC_SUBST([HAVE_WPRINTF])
832
833  AM_LANGINFO_CODESET
834  gt_LC_MESSAGES
835
836  dnl Compilation on mingw and Cygwin needs special Makefile rules, because
837  dnl 1. when we install a shared library, we must arrange to export
838  dnl    auxiliary pointer variables for every exported variable,
839  dnl 2. when we install a shared library and a static library simultaneously,
840  dnl    the include file specifies __declspec(dllimport) and therefore we
841  dnl    must arrange to define the auxiliary pointer variables for the
842  dnl    exported variables _also_ in the static library.
843  if test "$enable_shared" = yes; then
844    case "$host_os" in
845      mingw* | cygwin*) is_woe32dll=yes ;;
846      *) is_woe32dll=no ;;
847    esac
848  else
849    is_woe32dll=no
850  fi
851  WOE32DLL=$is_woe32dll
852  AC_SUBST([WOE32DLL])
853
854  dnl On mingw and Cygwin, we can activate special Makefile rules which add
855  dnl version information to the shared libraries and executables.
856  case "$host_os" in
857    mingw* | cygwin*) is_woe32=yes ;;
858    *) is_woe32=no ;;
859  esac
860  WOE32=$is_woe32
861  AC_SUBST([WOE32])
862  if test $WOE32 = yes; then
863    dnl Check for a program that compiles Windows resource files.
864    AC_CHECK_TOOL([WINDRES], [windres])
865  fi
866
867  dnl Determine whether when creating a library, "-lc" should be passed to
868  dnl libtool or not. On many platforms, it is required for the libtool option
869  dnl -no-undefined to work. On HP-UX, however, the -lc - stored by libtool
870  dnl in the *.la files - makes it impossible to create multithreaded programs,
871  dnl because libtool also reorders the -lc to come before the -pthread, and
872  dnl this disables pthread_create() <http://docs.hp.com/en/1896/pthreads.html>.
873  case "$host_os" in
874    hpux*) LTLIBC="" ;;
875    *)     LTLIBC="-lc" ;;
876  esac
877  AC_SUBST([LTLIBC])
878
879  dnl Rename some macros and functions used for locking.
880  AH_BOTTOM([
881#define __libc_lock_t                   gl_lock_t
882#define __libc_lock_define              gl_lock_define
883#define __libc_lock_define_initialized  gl_lock_define_initialized
884#define __libc_lock_init                gl_lock_init
885#define __libc_lock_lock                gl_lock_lock
886#define __libc_lock_unlock              gl_lock_unlock
887#define __libc_lock_recursive_t                   gl_recursive_lock_t
888#define __libc_lock_define_recursive              gl_recursive_lock_define
889#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized
890#define __libc_lock_init_recursive                gl_recursive_lock_init
891#define __libc_lock_lock_recursive                gl_recursive_lock_lock
892#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
893#define glthread_in_use  libintl_thread_in_use
894#define glthread_lock_init     libintl_lock_init
895#define glthread_lock_lock     libintl_lock_lock
896#define glthread_lock_unlock   libintl_lock_unlock
897#define glthread_lock_destroy  libintl_lock_destroy
898#define glthread_rwlock_init     libintl_rwlock_init
899#define glthread_rwlock_rdlock   libintl_rwlock_rdlock
900#define glthread_rwlock_wrlock   libintl_rwlock_wrlock
901#define glthread_rwlock_unlock   libintl_rwlock_unlock
902#define glthread_rwlock_destroy  libintl_rwlock_destroy
903#define glthread_recursive_lock_init     libintl_recursive_lock_init
904#define glthread_recursive_lock_lock     libintl_recursive_lock_lock
905#define glthread_recursive_lock_unlock   libintl_recursive_lock_unlock
906#define glthread_recursive_lock_destroy  libintl_recursive_lock_destroy
907#define glthread_once                 libintl_once
908#define glthread_once_call            libintl_once_call
909#define glthread_once_singlethreaded  libintl_once_singlethreaded
910])
911])
912
913
914dnl Checks for the core files of the intl subdirectory:
915dnl   dcigettext.c
916dnl   eval-plural.h
917dnl   explodename.c
918dnl   finddomain.c
919dnl   gettextP.h
920dnl   gmo.h
921dnl   hash-string.h hash-string.c
922dnl   l10nflist.c
923dnl   libgnuintl.h.in (except the *printf stuff)
924dnl   loadinfo.h
925dnl   loadmsgcat.c
926dnl   localealias.c
927dnl   log.c
928dnl   plural-exp.h plural-exp.c
929dnl   plural.y
930dnl Used by libglocale.
931AC_DEFUN([gt_INTL_SUBDIR_CORE],
932[
933  AC_REQUIRE([AC_C_INLINE])dnl
934  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
935  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
936  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
937  AC_REQUIRE([AC_FUNC_MMAP])dnl
938  AC_REQUIRE([gt_INTDIV0])dnl
939  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
940  AC_REQUIRE([gt_INTTYPES_PRI])dnl
941  AC_REQUIRE([gl_LOCK])dnl
942
943  AC_TRY_LINK(
944    [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
945    [],
946    [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
947       [Define to 1 if the compiler understands __builtin_expect.])])
948
949  AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
950  AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
951    stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
952    argz_next __fsetlocking])
953
954  dnl Use the *_unlocked functions only if they are declared.
955  dnl (because some of them were defined without being declared in Solaris
956  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
957  dnl on Solaris 2.5.1 to run on Solaris 2.6).
958  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
959  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
960  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
961
962  AM_ICONV
963
964  dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
965  dnl and a _NL_LOCALE_NAME macro always.
966  AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
967    [AC_TRY_LINK([#include <langinfo.h>
968#include <locale.h>],
969      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
970       return !cs;
971      ],
972      gt_cv_nl_locale_name=yes,
973      gt_cv_nl_locale_name=no)
974    ])
975  if test $gt_cv_nl_locale_name = yes; then
976    AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
977      [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
978  fi
979
980  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
981  dnl because plural.y uses bison specific features. It requires at least
982  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
983  dnl compile.
984  dnl bison is only needed for the maintainer (who touches plural.y). But in
985  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
986  dnl the rule in general Makefile. Now, some people carelessly touch the
987  dnl files or have a broken "make" program, hence the plural.c rule will
988  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
989  dnl present or too old.
990  AC_CHECK_PROGS([INTLBISON], [bison])
991  if test -z "$INTLBISON"; then
992    ac_verc_fail=yes
993  else
994    dnl Found it, now check the version.
995    AC_MSG_CHECKING([version of bison])
996changequote(<<,>>)dnl
997    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
998    case $ac_prog_version in
999      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1000      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1001changequote([,])dnl
1002         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1003      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1004    esac
1005    AC_MSG_RESULT([$ac_prog_version])
1006  fi
1007  if test $ac_verc_fail = yes; then
1008    INTLBISON=:
1009  fi
1010])
1011
1012
1013dnl gt_CHECK_DECL(FUNC, INCLUDES)
1014dnl Check whether a function is declared.
1015AC_DEFUN([gt_CHECK_DECL],
1016[
1017  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
1018    [AC_TRY_COMPILE([$2], [
1019#ifndef $1
1020  char *p = (char *) $1;
1021#endif
1022], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1023  if test $ac_cv_have_decl_$1 = yes; then
1024    gt_value=1
1025  else
1026    gt_value=0
1027  fi
1028  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1029    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1030])
1031
1032# intlmacosx.m4 serial 1 (gettext-0.17)
1033dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
1034dnl This file is free software; the Free Software Foundation
1035dnl gives unlimited permission to copy and/or distribute it,
1036dnl with or without modifications, as long as this notice is preserved.
1037dnl
1038dnl This file can can be used in projects which are not available under
1039dnl the GNU General Public License or the GNU Library General Public
1040dnl License but which still want to provide support for the GNU gettext
1041dnl functionality.
1042dnl Please note that the actual code of the GNU gettext library is covered
1043dnl by the GNU Library General Public License, and the rest of the GNU
1044dnl gettext package package is covered by the GNU General Public License.
1045dnl They are *not* in the public domain.
1046
1047dnl Checks for special options needed on MacOS X.
1048dnl Defines INTL_MACOSX_LIBS.
1049AC_DEFUN([gt_INTL_MACOSX],
1050[
1051  dnl Check for API introduced in MacOS X 10.2.
1052  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
1053    gt_cv_func_CFPreferencesCopyAppValue,
1054    [gt_save_LIBS="$LIBS"
1055     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1056     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
1057       [CFPreferencesCopyAppValue(NULL, NULL)],
1058       [gt_cv_func_CFPreferencesCopyAppValue=yes],
1059       [gt_cv_func_CFPreferencesCopyAppValue=no])
1060     LIBS="$gt_save_LIBS"])
1061  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
1062    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
1063      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
1064  fi
1065  dnl Check for API introduced in MacOS X 10.3.
1066  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
1067    [gt_save_LIBS="$LIBS"
1068     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
1069     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
1070       [gt_cv_func_CFLocaleCopyCurrent=yes],
1071       [gt_cv_func_CFLocaleCopyCurrent=no])
1072     LIBS="$gt_save_LIBS"])
1073  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1074    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
1075      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
1076  fi
1077  INTL_MACOSX_LIBS=
1078  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
1079    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
1080  fi
1081  AC_SUBST([INTL_MACOSX_LIBS])
1082])
1083
1084# intmax.m4 serial 3 (gettext-0.16)
1085dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
1086dnl This file is free software; the Free Software Foundation
1087dnl gives unlimited permission to copy and/or distribute it,
1088dnl with or without modifications, as long as this notice is preserved.
1089
1090dnl From Bruno Haible.
1091dnl Test whether the system has the 'intmax_t' type, but don't attempt to
1092dnl find a replacement if it is lacking.
1093
1094AC_DEFUN([gt_TYPE_INTMAX_T],
1095[
1096  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1097  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1098  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
1099    [AC_TRY_COMPILE([
1100#include <stddef.h>
1101#include <stdlib.h>
1102#if HAVE_STDINT_H_WITH_UINTMAX
1103#include <stdint.h>
1104#endif
1105#if HAVE_INTTYPES_H_WITH_UINTMAX
1106#include <inttypes.h>
1107#endif
1108],     [intmax_t x = -1;
1109        return !x;],
1110       gt_cv_c_intmax_t=yes,
1111       gt_cv_c_intmax_t=no)])
1112  if test $gt_cv_c_intmax_t = yes; then
1113    AC_DEFINE(HAVE_INTMAX_T, 1,
1114      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
1115  fi
1116])
1117
1118# inttypes-pri.m4 serial 4 (gettext-0.16)
1119dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
1120dnl This file is free software; the Free Software Foundation
1121dnl gives unlimited permission to copy and/or distribute it,
1122dnl with or without modifications, as long as this notice is preserved.
1123
1124dnl From Bruno Haible.
1125
1126AC_PREREQ(2.52)
1127
1128# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1129# macros to non-string values.  This is the case on AIX 4.3.3.
1130
1131AC_DEFUN([gt_INTTYPES_PRI],
1132[
1133  AC_CHECK_HEADERS([inttypes.h])
1134  if test $ac_cv_header_inttypes_h = yes; then
1135    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1136      gt_cv_inttypes_pri_broken,
1137      [
1138        AC_TRY_COMPILE([#include <inttypes.h>
1139#ifdef PRId32
1140char *p = PRId32;
1141#endif
1142], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1143      ])
1144  fi
1145  if test "$gt_cv_inttypes_pri_broken" = yes; then
1146    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1147      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1148    PRI_MACROS_BROKEN=1
1149  else
1150    PRI_MACROS_BROKEN=0
1151  fi
1152  AC_SUBST([PRI_MACROS_BROKEN])
1153])
1154
1155# inttypes_h.m4 serial 7
1156dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
1157dnl This file is free software; the Free Software Foundation
1158dnl gives unlimited permission to copy and/or distribute it,
1159dnl with or without modifications, as long as this notice is preserved.
1160
1161dnl From Paul Eggert.
1162
1163# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1164# doesn't clash with <sys/types.h>, and declares uintmax_t.
1165
1166AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1167[
1168  AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
1169  [AC_TRY_COMPILE(
1170    [#include <sys/types.h>
1171#include <inttypes.h>],
1172    [uintmax_t i = (uintmax_t) -1; return !i;],
1173    gl_cv_header_inttypes_h=yes,
1174    gl_cv_header_inttypes_h=no)])
1175  if test $gl_cv_header_inttypes_h = yes; then
1176    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1177      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1178       and declares uintmax_t. ])
1179  fi
1180])
1181
1182# lcmessage.m4 serial 4 (gettext-0.14.2)
1183dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
1184dnl This file is free software; the Free Software Foundation
1185dnl gives unlimited permission to copy and/or distribute it,
1186dnl with or without modifications, as long as this notice is preserved.
1187dnl
1188dnl This file can can be used in projects which are not available under
1189dnl the GNU General Public License or the GNU Library General Public
1190dnl License but which still want to provide support for the GNU gettext
1191dnl functionality.
1192dnl Please note that the actual code of the GNU gettext library is covered
1193dnl by the GNU Library General Public License, and the rest of the GNU
1194dnl gettext package package is covered by the GNU General Public License.
1195dnl They are *not* in the public domain.
1196
1197dnl Authors:
1198dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
1199
1200# Check whether LC_MESSAGES is available in <locale.h>.
1201
1202AC_DEFUN([gt_LC_MESSAGES],
1203[
1204  AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
1205    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1206       gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
1207  if test $gt_cv_val_LC_MESSAGES = yes; then
1208    AC_DEFINE(HAVE_LC_MESSAGES, 1,
1209      [Define if your <locale.h> file defines LC_MESSAGES.])
1210  fi
1211])
1212
1213# lib-ld.m4 serial 3 (gettext-0.13)
1214dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1215dnl This file is free software; the Free Software Foundation
1216dnl gives unlimited permission to copy and/or distribute it,
1217dnl with or without modifications, as long as this notice is preserved.
1218
1219dnl Subroutines of libtool.m4,
1220dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1221dnl with libtool.m4.
1222
1223dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1224AC_DEFUN([AC_LIB_PROG_LD_GNU],
1225[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1226[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1227case `$LD -v 2>&1 </dev/null` in
1228*GNU* | *'with BFD'*)
1229  acl_cv_prog_gnu_ld=yes ;;
1230*)
1231  acl_cv_prog_gnu_ld=no ;;
1232esac])
1233with_gnu_ld=$acl_cv_prog_gnu_ld
1234])
1235
1236dnl From libtool-1.4. Sets the variable LD.
1237AC_DEFUN([AC_LIB_PROG_LD],
1238[AC_ARG_WITH(gnu-ld,
1239[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
1240test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1241AC_REQUIRE([AC_PROG_CC])dnl
1242AC_REQUIRE([AC_CANONICAL_HOST])dnl
1243# Prepare PATH_SEPARATOR.
1244# The user is always right.
1245if test "${PATH_SEPARATOR+set}" != set; then
1246  echo "#! /bin/sh" >conf$$.sh
1247  echo  "exit 0"   >>conf$$.sh
1248  chmod +x conf$$.sh
1249  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1250    PATH_SEPARATOR=';'
1251  else
1252    PATH_SEPARATOR=:
1253  fi
1254  rm -f conf$$.sh
1255fi
1256ac_prog=ld
1257if test "$GCC" = yes; then
1258  # Check if gcc -print-prog-name=ld gives a path.
1259  AC_MSG_CHECKING([for ld used by GCC])
1260  case $host in
1261  *-*-mingw*)
1262    # gcc leaves a trailing carriage return which upsets mingw
1263    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1264  *)
1265    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1266  esac
1267  case $ac_prog in
1268    # Accept absolute paths.
1269    [[\\/]* | [A-Za-z]:[\\/]*)]
1270      [re_direlt='/[^/][^/]*/\.\./']
1271      # Canonicalize the path of ld
1272      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1273      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1274	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1275      done
1276      test -z "$LD" && LD="$ac_prog"
1277      ;;
1278  "")
1279    # If it fails, then pretend we aren't using GCC.
1280    ac_prog=ld
1281    ;;
1282  *)
1283    # If it is relative, then search for the first ld in PATH.
1284    with_gnu_ld=unknown
1285    ;;
1286  esac
1287elif test "$with_gnu_ld" = yes; then
1288  AC_MSG_CHECKING([for GNU ld])
1289else
1290  AC_MSG_CHECKING([for non-GNU ld])
1291fi
1292AC_CACHE_VAL(acl_cv_path_LD,
1293[if test -z "$LD"; then
1294  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1295  for ac_dir in $PATH; do
1296    test -z "$ac_dir" && ac_dir=.
1297    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1298      acl_cv_path_LD="$ac_dir/$ac_prog"
1299      # Check to see if the program is GNU ld.  I'd rather use --version,
1300      # but apparently some GNU ld's only accept -v.
1301      # Break only if it was the GNU/non-GNU ld that we prefer.
1302      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1303      *GNU* | *'with BFD'*)
1304	test "$with_gnu_ld" != no && break ;;
1305      *)
1306	test "$with_gnu_ld" != yes && break ;;
1307      esac
1308    fi
1309  done
1310  IFS="$ac_save_ifs"
1311else
1312  acl_cv_path_LD="$LD" # Let the user override the test with a path.
1313fi])
1314LD="$acl_cv_path_LD"
1315if test -n "$LD"; then
1316  AC_MSG_RESULT($LD)
1317else
1318  AC_MSG_RESULT(no)
1319fi
1320test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1321AC_LIB_PROG_LD_GNU
1322])
1323
1324# lib-link.m4 serial 13 (gettext-0.17)
1325dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
1326dnl This file is free software; the Free Software Foundation
1327dnl gives unlimited permission to copy and/or distribute it,
1328dnl with or without modifications, as long as this notice is preserved.
1329
1330dnl From Bruno Haible.
1331
1332AC_PREREQ(2.54)
1333
1334dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1335dnl the libraries corresponding to explicit and implicit dependencies.
1336dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1337dnl augments the CPPFLAGS variable.
1338dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1339dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1340AC_DEFUN([AC_LIB_LINKFLAGS],
1341[
1342  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1343  AC_REQUIRE([AC_LIB_RPATH])
1344  define([Name],[translit([$1],[./-], [___])])
1345  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1346                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1347  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1348    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1349    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1350    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1351    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1352    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
1353  ])
1354  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1355  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1356  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1357  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
1358  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1359  AC_SUBST([LIB]NAME)
1360  AC_SUBST([LTLIB]NAME)
1361  AC_SUBST([LIB]NAME[_PREFIX])
1362  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1363  dnl results of this search when this library appears as a dependency.
1364  HAVE_LIB[]NAME=yes
1365  undefine([Name])
1366  undefine([NAME])
1367])
1368
1369dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1370dnl searches for libname and the libraries corresponding to explicit and
1371dnl implicit dependencies, together with the specified include files and
1372dnl the ability to compile and link the specified testcode. If found, it
1373dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1374dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1375dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1376dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1377dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
1378dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1379AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1380[
1381  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1382  AC_REQUIRE([AC_LIB_RPATH])
1383  define([Name],[translit([$1],[./-], [___])])
1384  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1385                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1386
1387  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1388  dnl accordingly.
1389  AC_LIB_LINKFLAGS_BODY([$1], [$2])
1390
1391  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1392  dnl because if the user has installed lib[]Name and not disabled its use
1393  dnl via --without-lib[]Name-prefix, he wants to use it.
1394  ac_save_CPPFLAGS="$CPPFLAGS"
1395  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1396
1397  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1398    ac_save_LIBS="$LIBS"
1399    LIBS="$LIBS $LIB[]NAME"
1400    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1401    LIBS="$ac_save_LIBS"
1402  ])
1403  if test "$ac_cv_lib[]Name" = yes; then
1404    HAVE_LIB[]NAME=yes
1405    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1406    AC_MSG_CHECKING([how to link with lib[]$1])
1407    AC_MSG_RESULT([$LIB[]NAME])
1408  else
1409    HAVE_LIB[]NAME=no
1410    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1411    dnl $INC[]NAME either.
1412    CPPFLAGS="$ac_save_CPPFLAGS"
1413    LIB[]NAME=
1414    LTLIB[]NAME=
1415    LIB[]NAME[]_PREFIX=
1416  fi
1417  AC_SUBST([HAVE_LIB]NAME)
1418  AC_SUBST([LIB]NAME)
1419  AC_SUBST([LTLIB]NAME)
1420  AC_SUBST([LIB]NAME[_PREFIX])
1421  undefine([Name])
1422  undefine([NAME])
1423])
1424
1425dnl Determine the platform dependent parameters needed to use rpath:
1426dnl   acl_libext,
1427dnl   acl_shlibext,
1428dnl   acl_hardcode_libdir_flag_spec,
1429dnl   acl_hardcode_libdir_separator,
1430dnl   acl_hardcode_direct,
1431dnl   acl_hardcode_minus_L.
1432AC_DEFUN([AC_LIB_RPATH],
1433[
1434  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1435  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1436  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1437  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1438  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1439  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1440  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1441    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1442    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1443    . ./conftest.sh
1444    rm -f ./conftest.sh
1445    acl_cv_rpath=done
1446  ])
1447  wl="$acl_cv_wl"
1448  acl_libext="$acl_cv_libext"
1449  acl_shlibext="$acl_cv_shlibext"
1450  acl_libname_spec="$acl_cv_libname_spec"
1451  acl_library_names_spec="$acl_cv_library_names_spec"
1452  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1453  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1454  acl_hardcode_direct="$acl_cv_hardcode_direct"
1455  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1456  dnl Determine whether the user wants rpath handling at all.
1457  AC_ARG_ENABLE(rpath,
1458    [  --disable-rpath         do not hardcode runtime library paths],
1459    :, enable_rpath=yes)
1460])
1461
1462dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1463dnl the libraries corresponding to explicit and implicit dependencies.
1464dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1465dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1466dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1467AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1468[
1469  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1470  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1471                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1472  dnl Autoconf >= 2.61 supports dots in --with options.
1473  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
1474  dnl By default, look in $includedir and $libdir.
1475  use_additional=yes
1476  AC_LIB_WITH_FINAL_PREFIX([
1477    eval additional_includedir=\"$includedir\"
1478    eval additional_libdir=\"$libdir\"
1479  ])
1480  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
1481[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1482  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
1483[
1484    if test "X$withval" = "Xno"; then
1485      use_additional=no
1486    else
1487      if test "X$withval" = "X"; then
1488        AC_LIB_WITH_FINAL_PREFIX([
1489          eval additional_includedir=\"$includedir\"
1490          eval additional_libdir=\"$libdir\"
1491        ])
1492      else
1493        additional_includedir="$withval/include"
1494        additional_libdir="$withval/$acl_libdirstem"
1495      fi
1496    fi
1497])
1498  dnl Search the library and its dependencies in $additional_libdir and
1499  dnl $LDFLAGS. Using breadth-first-seach.
1500  LIB[]NAME=
1501  LTLIB[]NAME=
1502  INC[]NAME=
1503  LIB[]NAME[]_PREFIX=
1504  rpathdirs=
1505  ltrpathdirs=
1506  names_already_handled=
1507  names_next_round='$1 $2'
1508  while test -n "$names_next_round"; do
1509    names_this_round="$names_next_round"
1510    names_next_round=
1511    for name in $names_this_round; do
1512      already_handled=
1513      for n in $names_already_handled; do
1514        if test "$n" = "$name"; then
1515          already_handled=yes
1516          break
1517        fi
1518      done
1519      if test -z "$already_handled"; then
1520        names_already_handled="$names_already_handled $name"
1521        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1522        dnl or AC_LIB_HAVE_LINKFLAGS call.
1523        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1524        eval value=\"\$HAVE_LIB$uppername\"
1525        if test -n "$value"; then
1526          if test "$value" = yes; then
1527            eval value=\"\$LIB$uppername\"
1528            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1529            eval value=\"\$LTLIB$uppername\"
1530            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1531          else
1532            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1533            dnl that this library doesn't exist. So just drop it.
1534            :
1535          fi
1536        else
1537          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1538          dnl and the already constructed $LIBNAME/$LTLIBNAME.
1539          found_dir=
1540          found_la=
1541          found_so=
1542          found_a=
1543          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
1544          if test -n "$acl_shlibext"; then
1545            shrext=".$acl_shlibext"             # typically: shrext=.so
1546          else
1547            shrext=
1548          fi
1549          if test $use_additional = yes; then
1550            dir="$additional_libdir"
1551            dnl The same code as in the loop below:
1552            dnl First look for a shared library.
1553            if test -n "$acl_shlibext"; then
1554              if test -f "$dir/$libname$shrext"; then
1555                found_dir="$dir"
1556                found_so="$dir/$libname$shrext"
1557              else
1558                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1559                  ver=`(cd "$dir" && \
1560                        for f in "$libname$shrext".*; do echo "$f"; done \
1561                        | sed -e "s,^$libname$shrext\\\\.,," \
1562                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1563                        | sed 1q ) 2>/dev/null`
1564                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1565                    found_dir="$dir"
1566                    found_so="$dir/$libname$shrext.$ver"
1567                  fi
1568                else
1569                  eval library_names=\"$acl_library_names_spec\"
1570                  for f in $library_names; do
1571                    if test -f "$dir/$f"; then
1572                      found_dir="$dir"
1573                      found_so="$dir/$f"
1574                      break
1575                    fi
1576                  done
1577                fi
1578              fi
1579            fi
1580            dnl Then look for a static library.
1581            if test "X$found_dir" = "X"; then
1582              if test -f "$dir/$libname.$acl_libext"; then
1583                found_dir="$dir"
1584                found_a="$dir/$libname.$acl_libext"
1585              fi
1586            fi
1587            if test "X$found_dir" != "X"; then
1588              if test -f "$dir/$libname.la"; then
1589                found_la="$dir/$libname.la"
1590              fi
1591            fi
1592          fi
1593          if test "X$found_dir" = "X"; then
1594            for x in $LDFLAGS $LTLIB[]NAME; do
1595              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1596              case "$x" in
1597                -L*)
1598                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1599                  dnl First look for a shared library.
1600                  if test -n "$acl_shlibext"; then
1601                    if test -f "$dir/$libname$shrext"; then
1602                      found_dir="$dir"
1603                      found_so="$dir/$libname$shrext"
1604                    else
1605                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1606                        ver=`(cd "$dir" && \
1607                              for f in "$libname$shrext".*; do echo "$f"; done \
1608                              | sed -e "s,^$libname$shrext\\\\.,," \
1609                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1610                              | sed 1q ) 2>/dev/null`
1611                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1612                          found_dir="$dir"
1613                          found_so="$dir/$libname$shrext.$ver"
1614                        fi
1615                      else
1616                        eval library_names=\"$acl_library_names_spec\"
1617                        for f in $library_names; do
1618                          if test -f "$dir/$f"; then
1619                            found_dir="$dir"
1620                            found_so="$dir/$f"
1621                            break
1622                          fi
1623                        done
1624                      fi
1625                    fi
1626                  fi
1627                  dnl Then look for a static library.
1628                  if test "X$found_dir" = "X"; then
1629                    if test -f "$dir/$libname.$acl_libext"; then
1630                      found_dir="$dir"
1631                      found_a="$dir/$libname.$acl_libext"
1632                    fi
1633                  fi
1634                  if test "X$found_dir" != "X"; then
1635                    if test -f "$dir/$libname.la"; then
1636                      found_la="$dir/$libname.la"
1637                    fi
1638                  fi
1639                  ;;
1640              esac
1641              if test "X$found_dir" != "X"; then
1642                break
1643              fi
1644            done
1645          fi
1646          if test "X$found_dir" != "X"; then
1647            dnl Found the library.
1648            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1649            if test "X$found_so" != "X"; then
1650              dnl Linking with a shared library. We attempt to hardcode its
1651              dnl directory into the executable's runpath, unless it's the
1652              dnl standard /usr/lib.
1653              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1654                dnl No hardcoding is needed.
1655                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1656              else
1657                dnl Use an explicit option to hardcode DIR into the resulting
1658                dnl binary.
1659                dnl Potentially add DIR to ltrpathdirs.
1660                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1661                haveit=
1662                for x in $ltrpathdirs; do
1663                  if test "X$x" = "X$found_dir"; then
1664                    haveit=yes
1665                    break
1666                  fi
1667                done
1668                if test -z "$haveit"; then
1669                  ltrpathdirs="$ltrpathdirs $found_dir"
1670                fi
1671                dnl The hardcoding into $LIBNAME is system dependent.
1672                if test "$acl_hardcode_direct" = yes; then
1673                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1674                  dnl resulting binary.
1675                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1676                else
1677                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1678                    dnl Use an explicit option to hardcode DIR into the resulting
1679                    dnl binary.
1680                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1681                    dnl Potentially add DIR to rpathdirs.
1682                    dnl The rpathdirs will be appended to $LIBNAME at the end.
1683                    haveit=
1684                    for x in $rpathdirs; do
1685                      if test "X$x" = "X$found_dir"; then
1686                        haveit=yes
1687                        break
1688                      fi
1689                    done
1690                    if test -z "$haveit"; then
1691                      rpathdirs="$rpathdirs $found_dir"
1692                    fi
1693                  else
1694                    dnl Rely on "-L$found_dir".
1695                    dnl But don't add it if it's already contained in the LDFLAGS
1696                    dnl or the already constructed $LIBNAME
1697                    haveit=
1698                    for x in $LDFLAGS $LIB[]NAME; do
1699                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1700                      if test "X$x" = "X-L$found_dir"; then
1701                        haveit=yes
1702                        break
1703                      fi
1704                    done
1705                    if test -z "$haveit"; then
1706                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1707                    fi
1708                    if test "$acl_hardcode_minus_L" != no; then
1709                      dnl FIXME: Not sure whether we should use
1710                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1711                      dnl here.
1712                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1713                    else
1714                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1715                      dnl here, because this doesn't fit in flags passed to the
1716                      dnl compiler. So give up. No hardcoding. This affects only
1717                      dnl very old systems.
1718                      dnl FIXME: Not sure whether we should use
1719                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1720                      dnl here.
1721                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1722                    fi
1723                  fi
1724                fi
1725              fi
1726            else
1727              if test "X$found_a" != "X"; then
1728                dnl Linking with a static library.
1729                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1730              else
1731                dnl We shouldn't come here, but anyway it's good to have a
1732                dnl fallback.
1733                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1734              fi
1735            fi
1736            dnl Assume the include files are nearby.
1737            additional_includedir=
1738            case "$found_dir" in
1739              */$acl_libdirstem | */$acl_libdirstem/)
1740                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1741                LIB[]NAME[]_PREFIX="$basedir"
1742                additional_includedir="$basedir/include"
1743                ;;
1744            esac
1745            if test "X$additional_includedir" != "X"; then
1746              dnl Potentially add $additional_includedir to $INCNAME.
1747              dnl But don't add it
1748              dnl   1. if it's the standard /usr/include,
1749              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1750              dnl   3. if it's already present in $CPPFLAGS or the already
1751              dnl      constructed $INCNAME,
1752              dnl   4. if it doesn't exist as a directory.
1753              if test "X$additional_includedir" != "X/usr/include"; then
1754                haveit=
1755                if test "X$additional_includedir" = "X/usr/local/include"; then
1756                  if test -n "$GCC"; then
1757                    case $host_os in
1758                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1759                    esac
1760                  fi
1761                fi
1762                if test -z "$haveit"; then
1763                  for x in $CPPFLAGS $INC[]NAME; do
1764                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1765                    if test "X$x" = "X-I$additional_includedir"; then
1766                      haveit=yes
1767                      break
1768                    fi
1769                  done
1770                  if test -z "$haveit"; then
1771                    if test -d "$additional_includedir"; then
1772                      dnl Really add $additional_includedir to $INCNAME.
1773                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1774                    fi
1775                  fi
1776                fi
1777              fi
1778            fi
1779            dnl Look for dependencies.
1780            if test -n "$found_la"; then
1781              dnl Read the .la file. It defines the variables
1782              dnl dlname, library_names, old_library, dependency_libs, current,
1783              dnl age, revision, installed, dlopen, dlpreopen, libdir.
1784              save_libdir="$libdir"
1785              case "$found_la" in
1786                */* | *\\*) . "$found_la" ;;
1787                *) . "./$found_la" ;;
1788              esac
1789              libdir="$save_libdir"
1790              dnl We use only dependency_libs.
1791              for dep in $dependency_libs; do
1792                case "$dep" in
1793                  -L*)
1794                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1795                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1796                    dnl But don't add it
1797                    dnl   1. if it's the standard /usr/lib,
1798                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1799                    dnl   3. if it's already present in $LDFLAGS or the already
1800                    dnl      constructed $LIBNAME,
1801                    dnl   4. if it doesn't exist as a directory.
1802                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1803                      haveit=
1804                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1805                        if test -n "$GCC"; then
1806                          case $host_os in
1807                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1808                          esac
1809                        fi
1810                      fi
1811                      if test -z "$haveit"; then
1812                        haveit=
1813                        for x in $LDFLAGS $LIB[]NAME; do
1814                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1815                          if test "X$x" = "X-L$additional_libdir"; then
1816                            haveit=yes
1817                            break
1818                          fi
1819                        done
1820                        if test -z "$haveit"; then
1821                          if test -d "$additional_libdir"; then
1822                            dnl Really add $additional_libdir to $LIBNAME.
1823                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1824                          fi
1825                        fi
1826                        haveit=
1827                        for x in $LDFLAGS $LTLIB[]NAME; do
1828                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1829                          if test "X$x" = "X-L$additional_libdir"; then
1830                            haveit=yes
1831                            break
1832                          fi
1833                        done
1834                        if test -z "$haveit"; then
1835                          if test -d "$additional_libdir"; then
1836                            dnl Really add $additional_libdir to $LTLIBNAME.
1837                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1838                          fi
1839                        fi
1840                      fi
1841                    fi
1842                    ;;
1843                  -R*)
1844                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
1845                    if test "$enable_rpath" != no; then
1846                      dnl Potentially add DIR to rpathdirs.
1847                      dnl The rpathdirs will be appended to $LIBNAME at the end.
1848                      haveit=
1849                      for x in $rpathdirs; do
1850                        if test "X$x" = "X$dir"; then
1851                          haveit=yes
1852                          break
1853                        fi
1854                      done
1855                      if test -z "$haveit"; then
1856                        rpathdirs="$rpathdirs $dir"
1857                      fi
1858                      dnl Potentially add DIR to ltrpathdirs.
1859                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1860                      haveit=
1861                      for x in $ltrpathdirs; do
1862                        if test "X$x" = "X$dir"; then
1863                          haveit=yes
1864                          break
1865                        fi
1866                      done
1867                      if test -z "$haveit"; then
1868                        ltrpathdirs="$ltrpathdirs $dir"
1869                      fi
1870                    fi
1871                    ;;
1872                  -l*)
1873                    dnl Handle this in the next round.
1874                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1875                    ;;
1876                  *.la)
1877                    dnl Handle this in the next round. Throw away the .la's
1878                    dnl directory; it is already contained in a preceding -L
1879                    dnl option.
1880                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1881                    ;;
1882                  *)
1883                    dnl Most likely an immediate library name.
1884                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1885                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1886                    ;;
1887                esac
1888              done
1889            fi
1890          else
1891            dnl Didn't find the library; assume it is in the system directories
1892            dnl known to the linker and runtime loader. (All the system
1893            dnl directories known to the linker should also be known to the
1894            dnl runtime loader, otherwise the system is severely misconfigured.)
1895            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1896            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1897          fi
1898        fi
1899      fi
1900    done
1901  done
1902  if test "X$rpathdirs" != "X"; then
1903    if test -n "$acl_hardcode_libdir_separator"; then
1904      dnl Weird platform: only the last -rpath option counts, the user must
1905      dnl pass all path elements in one option. We can arrange that for a
1906      dnl single library, but not when more than one $LIBNAMEs are used.
1907      alldirs=
1908      for found_dir in $rpathdirs; do
1909        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1910      done
1911      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1912      acl_save_libdir="$libdir"
1913      libdir="$alldirs"
1914      eval flag=\"$acl_hardcode_libdir_flag_spec\"
1915      libdir="$acl_save_libdir"
1916      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1917    else
1918      dnl The -rpath options are cumulative.
1919      for found_dir in $rpathdirs; do
1920        acl_save_libdir="$libdir"
1921        libdir="$found_dir"
1922        eval flag=\"$acl_hardcode_libdir_flag_spec\"
1923        libdir="$acl_save_libdir"
1924        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1925      done
1926    fi
1927  fi
1928  if test "X$ltrpathdirs" != "X"; then
1929    dnl When using libtool, the option that works for both libraries and
1930    dnl executables is -R. The -R options are cumulative.
1931    for found_dir in $ltrpathdirs; do
1932      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1933    done
1934  fi
1935])
1936
1937dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1938dnl unless already present in VAR.
1939dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1940dnl contains two or three consecutive elements that belong together.
1941AC_DEFUN([AC_LIB_APPENDTOVAR],
1942[
1943  for element in [$2]; do
1944    haveit=
1945    for x in $[$1]; do
1946      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1947      if test "X$x" = "X$element"; then
1948        haveit=yes
1949        break
1950      fi
1951    done
1952    if test -z "$haveit"; then
1953      [$1]="${[$1]}${[$1]:+ }$element"
1954    fi
1955  done
1956])
1957
1958dnl For those cases where a variable contains several -L and -l options
1959dnl referring to unknown libraries and directories, this macro determines the
1960dnl necessary additional linker options for the runtime path.
1961dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1962dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1963dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1964dnl otherwise linking without libtool is assumed.
1965AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1966[
1967  AC_REQUIRE([AC_LIB_RPATH])
1968  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1969  $1=
1970  if test "$enable_rpath" != no; then
1971    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1972      dnl Use an explicit option to hardcode directories into the resulting
1973      dnl binary.
1974      rpathdirs=
1975      next=
1976      for opt in $2; do
1977        if test -n "$next"; then
1978          dir="$next"
1979          dnl No need to hardcode the standard /usr/lib.
1980          if test "X$dir" != "X/usr/$acl_libdirstem"; then
1981            rpathdirs="$rpathdirs $dir"
1982          fi
1983          next=
1984        else
1985          case $opt in
1986            -L) next=yes ;;
1987            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1988                 dnl No need to hardcode the standard /usr/lib.
1989                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
1990                   rpathdirs="$rpathdirs $dir"
1991                 fi
1992                 next= ;;
1993            *) next= ;;
1994          esac
1995        fi
1996      done
1997      if test "X$rpathdirs" != "X"; then
1998        if test -n ""$3""; then
1999          dnl libtool is used for linking. Use -R options.
2000          for dir in $rpathdirs; do
2001            $1="${$1}${$1:+ }-R$dir"
2002          done
2003        else
2004          dnl The linker is used for linking directly.
2005          if test -n "$acl_hardcode_libdir_separator"; then
2006            dnl Weird platform: only the last -rpath option counts, the user
2007            dnl must pass all path elements in one option.
2008            alldirs=
2009            for dir in $rpathdirs; do
2010              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
2011            done
2012            acl_save_libdir="$libdir"
2013            libdir="$alldirs"
2014            eval flag=\"$acl_hardcode_libdir_flag_spec\"
2015            libdir="$acl_save_libdir"
2016            $1="$flag"
2017          else
2018            dnl The -rpath options are cumulative.
2019            for dir in $rpathdirs; do
2020              acl_save_libdir="$libdir"
2021              libdir="$dir"
2022              eval flag=\"$acl_hardcode_libdir_flag_spec\"
2023              libdir="$acl_save_libdir"
2024              $1="${$1}${$1:+ }$flag"
2025            done
2026          fi
2027        fi
2028      fi
2029    fi
2030  fi
2031  AC_SUBST([$1])
2032])
2033
2034# lib-prefix.m4 serial 5 (gettext-0.15)
2035dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
2036dnl This file is free software; the Free Software Foundation
2037dnl gives unlimited permission to copy and/or distribute it,
2038dnl with or without modifications, as long as this notice is preserved.
2039
2040dnl From Bruno Haible.
2041
2042dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2043dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2044dnl require excessive bracketing.
2045ifdef([AC_HELP_STRING],
2046[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2047[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2048
2049dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2050dnl to access previously installed libraries. The basic assumption is that
2051dnl a user will want packages to use other packages he previously installed
2052dnl with the same --prefix option.
2053dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2054dnl libraries, but is otherwise very convenient.
2055AC_DEFUN([AC_LIB_PREFIX],
2056[
2057  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2058  AC_REQUIRE([AC_PROG_CC])
2059  AC_REQUIRE([AC_CANONICAL_HOST])
2060  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2061  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2062  dnl By default, look in $includedir and $libdir.
2063  use_additional=yes
2064  AC_LIB_WITH_FINAL_PREFIX([
2065    eval additional_includedir=\"$includedir\"
2066    eval additional_libdir=\"$libdir\"
2067  ])
2068  AC_LIB_ARG_WITH([lib-prefix],
2069[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2070  --without-lib-prefix    don't search for libraries in includedir and libdir],
2071[
2072    if test "X$withval" = "Xno"; then
2073      use_additional=no
2074    else
2075      if test "X$withval" = "X"; then
2076        AC_LIB_WITH_FINAL_PREFIX([
2077          eval additional_includedir=\"$includedir\"
2078          eval additional_libdir=\"$libdir\"
2079        ])
2080      else
2081        additional_includedir="$withval/include"
2082        additional_libdir="$withval/$acl_libdirstem"
2083      fi
2084    fi
2085])
2086  if test $use_additional = yes; then
2087    dnl Potentially add $additional_includedir to $CPPFLAGS.
2088    dnl But don't add it
2089    dnl   1. if it's the standard /usr/include,
2090    dnl   2. if it's already present in $CPPFLAGS,
2091    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
2092    dnl   4. if it doesn't exist as a directory.
2093    if test "X$additional_includedir" != "X/usr/include"; then
2094      haveit=
2095      for x in $CPPFLAGS; do
2096        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2097        if test "X$x" = "X-I$additional_includedir"; then
2098          haveit=yes
2099          break
2100        fi
2101      done
2102      if test -z "$haveit"; then
2103        if test "X$additional_includedir" = "X/usr/local/include"; then
2104          if test -n "$GCC"; then
2105            case $host_os in
2106              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2107            esac
2108          fi
2109        fi
2110        if test -z "$haveit"; then
2111          if test -d "$additional_includedir"; then
2112            dnl Really add $additional_includedir to $CPPFLAGS.
2113            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2114          fi
2115        fi
2116      fi
2117    fi
2118    dnl Potentially add $additional_libdir to $LDFLAGS.
2119    dnl But don't add it
2120    dnl   1. if it's the standard /usr/lib,
2121    dnl   2. if it's already present in $LDFLAGS,
2122    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
2123    dnl   4. if it doesn't exist as a directory.
2124    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2125      haveit=
2126      for x in $LDFLAGS; do
2127        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2128        if test "X$x" = "X-L$additional_libdir"; then
2129          haveit=yes
2130          break
2131        fi
2132      done
2133      if test -z "$haveit"; then
2134        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2135          if test -n "$GCC"; then
2136            case $host_os in
2137              linux*) haveit=yes;;
2138            esac
2139          fi
2140        fi
2141        if test -z "$haveit"; then
2142          if test -d "$additional_libdir"; then
2143            dnl Really add $additional_libdir to $LDFLAGS.
2144            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2145          fi
2146        fi
2147      fi
2148    fi
2149  fi
2150])
2151
2152dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2153dnl acl_final_exec_prefix, containing the values to which $prefix and
2154dnl $exec_prefix will expand at the end of the configure script.
2155AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2156[
2157  dnl Unfortunately, prefix and exec_prefix get only finally determined
2158  dnl at the end of configure.
2159  if test "X$prefix" = "XNONE"; then
2160    acl_final_prefix="$ac_default_prefix"
2161  else
2162    acl_final_prefix="$prefix"
2163  fi
2164  if test "X$exec_prefix" = "XNONE"; then
2165    acl_final_exec_prefix='${prefix}'
2166  else
2167    acl_final_exec_prefix="$exec_prefix"
2168  fi
2169  acl_save_prefix="$prefix"
2170  prefix="$acl_final_prefix"
2171  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2172  prefix="$acl_save_prefix"
2173])
2174
2175dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2176dnl variables prefix and exec_prefix bound to the values they will have
2177dnl at the end of the configure script.
2178AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2179[
2180  acl_save_prefix="$prefix"
2181  prefix="$acl_final_prefix"
2182  acl_save_exec_prefix="$exec_prefix"
2183  exec_prefix="$acl_final_exec_prefix"
2184  $1
2185  exec_prefix="$acl_save_exec_prefix"
2186  prefix="$acl_save_prefix"
2187])
2188
2189dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
2190dnl the basename of the libdir, either "lib" or "lib64".
2191AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2192[
2193  dnl There is no formal standard regarding lib and lib64. The current
2194  dnl practice is that on a system supporting 32-bit and 64-bit instruction
2195  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
2196  dnl libraries go under $prefix/lib. We determine the compiler's default
2197  dnl mode by looking at the compiler's library search path. If at least
2198  dnl of its elements ends in /lib64 or points to a directory whose absolute
2199  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
2200  dnl default, namely "lib".
2201  acl_libdirstem=lib
2202  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2203  if test -n "$searchpath"; then
2204    acl_save_IFS="${IFS= 	}"; IFS=":"
2205    for searchdir in $searchpath; do
2206      if test -d "$searchdir"; then
2207        case "$searchdir" in
2208          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2209          *) searchdir=`cd "$searchdir" && pwd`
2210             case "$searchdir" in
2211               */lib64 ) acl_libdirstem=lib64 ;;
2212             esac ;;
2213        esac
2214      fi
2215    done
2216    IFS="$acl_save_IFS"
2217  fi
2218])
2219
2220# lock.m4 serial 7 (gettext-0.17)
2221dnl Copyright (C) 2005-2007 Free Software Foundation, Inc.
2222dnl This file is free software; the Free Software Foundation
2223dnl gives unlimited permission to copy and/or distribute it,
2224dnl with or without modifications, as long as this notice is preserved.
2225
2226dnl From Bruno Haible.
2227
2228dnl Tests for a multithreading library to be used.
2229dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
2230dnl USE_PTH_THREADS, USE_WIN32_THREADS
2231dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
2232dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
2233dnl libtool).
2234dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
2235dnl programs that really need multithread functionality. The difference
2236dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
2237dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
2238dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
2239dnl multithread-safe programs.
2240
2241AC_DEFUN([gl_LOCK_EARLY],
2242[
2243  AC_REQUIRE([gl_LOCK_EARLY_BODY])
2244])
2245
2246dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
2247
2248AC_DEFUN([gl_LOCK_EARLY_BODY],
2249[
2250  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
2251  dnl influences the result of the autoconf tests that test for *_unlocked
2252  dnl declarations, on AIX 5 at least. Therefore it must come early.
2253  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
2254  AC_BEFORE([$0], [gl_ARGP])dnl
2255
2256  AC_REQUIRE([AC_CANONICAL_HOST])
2257  dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
2258  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
2259  dnl AC_GNU_SOURCE.
2260  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
2261    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
2262    [AC_REQUIRE([AC_GNU_SOURCE])])
2263  dnl Check for multithreading.
2264  AC_ARG_ENABLE(threads,
2265AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
2266AC_HELP_STRING([--disable-threads], [build without multithread safety]),
2267    [gl_use_threads=$enableval],
2268    [case "$host_os" in
2269       dnl Disable multithreading by default on OSF/1, because it interferes
2270       dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
2271       dnl process gets an endless segmentation fault inside execvp().
2272       osf*) gl_use_threads=no ;;
2273       *)    gl_use_threads=yes ;;
2274     esac
2275    ])
2276  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
2277    # For using <pthread.h>:
2278    case "$host_os" in
2279      osf*)
2280        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
2281        # groks <pthread.h>. cc also understands the flag -pthread, but
2282        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
2283        # 2. putting a flag into CPPFLAGS that has an effect on the linker
2284        # causes the AC_TRY_LINK test below to succeed unexpectedly,
2285        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
2286        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
2287        ;;
2288    esac
2289    # Some systems optimize for single-threaded programs by default, and
2290    # need special flags to disable these optimizations. For example, the
2291    # definition of 'errno' in <errno.h>.
2292    case "$host_os" in
2293      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
2294      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
2295    esac
2296  fi
2297])
2298
2299dnl The guts of gl_LOCK. Needs to be expanded only once.
2300
2301AC_DEFUN([gl_LOCK_BODY],
2302[
2303  AC_REQUIRE([gl_LOCK_EARLY_BODY])
2304  gl_threads_api=none
2305  LIBTHREAD=
2306  LTLIBTHREAD=
2307  LIBMULTITHREAD=
2308  LTLIBMULTITHREAD=
2309  if test "$gl_use_threads" != no; then
2310    dnl Check whether the compiler and linker support weak declarations.
2311    AC_MSG_CHECKING([whether imported symbols can be declared weak])
2312    gl_have_weak=no
2313    AC_TRY_LINK([extern void xyzzy ();
2314#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
2315    AC_MSG_RESULT([$gl_have_weak])
2316    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
2317      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
2318      # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
2319      AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
2320      if test "$gl_have_pthread_h" = yes; then
2321        # Other possible tests:
2322        #   -lpthreads (FSU threads, PCthreads)
2323        #   -lgthreads
2324        gl_have_pthread=
2325        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
2326        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
2327        # the second one only in libpthread, and lock.c needs it.
2328        AC_TRY_LINK([#include <pthread.h>],
2329          [pthread_mutex_lock((pthread_mutex_t*)0);
2330           pthread_mutexattr_init((pthread_mutexattr_t*)0);],
2331          [gl_have_pthread=yes])
2332        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
2333        # since it is defined as a macro on OSF/1.)
2334        if test -n "$gl_have_pthread"; then
2335          # The program links fine without libpthread. But it may actually
2336          # need to link with libpthread in order to create multiple threads.
2337          AC_CHECK_LIB(pthread, pthread_kill,
2338            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
2339             # On Solaris and HP-UX, most pthread functions exist also in libc.
2340             # Therefore pthread_in_use() needs to actually try to create a
2341             # thread: pthread_create from libc will fail, whereas
2342             # pthread_create will actually create a thread.
2343             case "$host_os" in
2344               solaris* | hpux*)
2345                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
2346                   [Define if the pthread_in_use() detection is hard.])
2347             esac
2348            ])
2349        else
2350          # Some library is needed. Try libpthread and libc_r.
2351          AC_CHECK_LIB(pthread, pthread_kill,
2352            [gl_have_pthread=yes
2353             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
2354             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
2355          if test -z "$gl_have_pthread"; then
2356            # For FreeBSD 4.
2357            AC_CHECK_LIB(c_r, pthread_kill,
2358              [gl_have_pthread=yes
2359               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
2360               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
2361          fi
2362        fi
2363        if test -n "$gl_have_pthread"; then
2364          gl_threads_api=posix
2365          AC_DEFINE([USE_POSIX_THREADS], 1,
2366            [Define if the POSIX multithreading library can be used.])
2367          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
2368            if test $gl_have_weak = yes; then
2369              AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
2370                [Define if references to the POSIX multithreading library should be made weak.])
2371              LIBTHREAD=
2372              LTLIBTHREAD=
2373            fi
2374          fi
2375          # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
2376          # pthread_rwlock_* functions.
2377          AC_CHECK_TYPE([pthread_rwlock_t],
2378            [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
2379               [Define if the POSIX multithreading library has read/write locks.])],
2380            [],
2381            [#include <pthread.h>])
2382          # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
2383          AC_TRY_COMPILE([#include <pthread.h>],
2384            [#if __FreeBSD__ == 4
2385error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
2386#else
2387int x = (int)PTHREAD_MUTEX_RECURSIVE;
2388return !x;
2389#endif],
2390            [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
2391               [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
2392        fi
2393      fi
2394    fi
2395    if test -z "$gl_have_pthread"; then
2396      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
2397        gl_have_solaristhread=
2398        gl_save_LIBS="$LIBS"
2399        LIBS="$LIBS -lthread"
2400        AC_TRY_LINK([#include <thread.h>
2401#include <synch.h>],
2402          [thr_self();],
2403          [gl_have_solaristhread=yes])
2404        LIBS="$gl_save_LIBS"
2405        if test -n "$gl_have_solaristhread"; then
2406          gl_threads_api=solaris
2407          LIBTHREAD=-lthread
2408          LTLIBTHREAD=-lthread
2409          LIBMULTITHREAD="$LIBTHREAD"
2410          LTLIBMULTITHREAD="$LTLIBTHREAD"
2411          AC_DEFINE([USE_SOLARIS_THREADS], 1,
2412            [Define if the old Solaris multithreading library can be used.])
2413          if test $gl_have_weak = yes; then
2414            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
2415              [Define if references to the old Solaris multithreading library should be made weak.])
2416            LIBTHREAD=
2417            LTLIBTHREAD=
2418          fi
2419        fi
2420      fi
2421    fi
2422    if test "$gl_use_threads" = pth; then
2423      gl_save_CPPFLAGS="$CPPFLAGS"
2424      AC_LIB_LINKFLAGS(pth)
2425      gl_have_pth=
2426      gl_save_LIBS="$LIBS"
2427      LIBS="$LIBS -lpth"
2428      AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
2429      LIBS="$gl_save_LIBS"
2430      if test -n "$gl_have_pth"; then
2431        gl_threads_api=pth
2432        LIBTHREAD="$LIBPTH"
2433        LTLIBTHREAD="$LTLIBPTH"
2434        LIBMULTITHREAD="$LIBTHREAD"
2435        LTLIBMULTITHREAD="$LTLIBTHREAD"
2436        AC_DEFINE([USE_PTH_THREADS], 1,
2437          [Define if the GNU Pth multithreading library can be used.])
2438        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
2439          if test $gl_have_weak = yes; then
2440            AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
2441              [Define if references to the GNU Pth multithreading library should be made weak.])
2442            LIBTHREAD=
2443            LTLIBTHREAD=
2444          fi
2445        fi
2446      else
2447        CPPFLAGS="$gl_save_CPPFLAGS"
2448      fi
2449    fi
2450    if test -z "$gl_have_pthread"; then
2451      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
2452        if { case "$host_os" in
2453               mingw*) true;;
2454               *) false;;
2455             esac
2456           }; then
2457          gl_threads_api=win32
2458          AC_DEFINE([USE_WIN32_THREADS], 1,
2459            [Define if the Win32 multithreading API can be used.])
2460        fi
2461      fi
2462    fi
2463  fi
2464  AC_MSG_CHECKING([for multithread API to use])
2465  AC_MSG_RESULT([$gl_threads_api])
2466  AC_SUBST(LIBTHREAD)
2467  AC_SUBST(LTLIBTHREAD)
2468  AC_SUBST(LIBMULTITHREAD)
2469  AC_SUBST(LTLIBMULTITHREAD)
2470])
2471
2472AC_DEFUN([gl_LOCK],
2473[
2474  AC_REQUIRE([gl_LOCK_EARLY])
2475  AC_REQUIRE([gl_LOCK_BODY])
2476  gl_PREREQ_LOCK
2477])
2478
2479# Prerequisites of lib/lock.c.
2480AC_DEFUN([gl_PREREQ_LOCK], [
2481  AC_REQUIRE([AC_C_INLINE])
2482])
2483
2484dnl Survey of platforms:
2485dnl
2486dnl Platform          Available   Compiler    Supports   test-lock
2487dnl                   flavours    option      weak       result
2488dnl ---------------   ---------   ---------   --------   ---------
2489dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
2490dnl
2491dnl GNU Hurd/glibc    posix
2492dnl
2493dnl FreeBSD 5.3       posix       -lc_r           Y
2494dnl                   posix       -lkse ?         Y
2495dnl                   posix       -lpthread ?     Y
2496dnl                   posix       -lthr           Y
2497dnl
2498dnl FreeBSD 5.2       posix       -lc_r           Y
2499dnl                   posix       -lkse           Y
2500dnl                   posix       -lthr           Y
2501dnl
2502dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
2503dnl
2504dnl NetBSD 1.6        --
2505dnl
2506dnl OpenBSD 3.4       posix       -lpthread       Y      OK
2507dnl
2508dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
2509dnl
2510dnl Solaris 7,8,9     posix       -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
2511dnl                   solaris     -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
2512dnl
2513dnl HP-UX 11          posix       -lpthread       N (cc) OK
2514dnl                                               Y (gcc)
2515dnl
2516dnl IRIX 6.5          posix       -lpthread       Y      0.5
2517dnl
2518dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
2519dnl
2520dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
2521dnl                               -lpthread (gcc) Y
2522dnl
2523dnl Cygwin            posix       -lpthread       Y      OK
2524dnl
2525dnl Any of the above  pth         -lpth                  0.0
2526dnl
2527dnl Mingw             win32                       N      OK
2528dnl
2529dnl BeOS 5            --
2530dnl
2531dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
2532dnl turned off:
2533dnl   OK if all three tests terminate OK,
2534dnl   0.5 if the first test terminates OK but the second one loops endlessly,
2535dnl   0.0 if the first test already loops endlessly.
2536
2537# longlong.m4 serial 13
2538dnl Copyright (C) 1999-2007 Free Software Foundation, Inc.
2539dnl This file is free software; the Free Software Foundation
2540dnl gives unlimited permission to copy and/or distribute it,
2541dnl with or without modifications, as long as this notice is preserved.
2542
2543dnl From Paul Eggert.
2544
2545# Define HAVE_LONG_LONG_INT if 'long long int' works.
2546# This fixes a bug in Autoconf 2.61, but can be removed once we
2547# assume 2.62 everywhere.
2548
2549# Note: If the type 'long long int' exists but is only 32 bits large
2550# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
2551# defined. In this case you can treat 'long long int' like 'long int'.
2552
2553AC_DEFUN([AC_TYPE_LONG_LONG_INT],
2554[
2555  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
2556    [AC_LINK_IFELSE(
2557       [_AC_TYPE_LONG_LONG_SNIPPET],
2558       [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
2559	dnl If cross compiling, assume the bug isn't important, since
2560	dnl nobody cross compiles for this platform as far as we know.
2561	AC_RUN_IFELSE(
2562	  [AC_LANG_PROGRAM(
2563	     [[@%:@include <limits.h>
2564	       @%:@ifndef LLONG_MAX
2565	       @%:@ define HALF \
2566			(1LL << (sizeof (long long int) * CHAR_BIT - 2))
2567	       @%:@ define LLONG_MAX (HALF - 1 + HALF)
2568	       @%:@endif]],
2569	     [[long long int n = 1;
2570	       int i;
2571	       for (i = 0; ; i++)
2572		 {
2573		   long long int m = n << i;
2574		   if (m >> i != n)
2575		     return 1;
2576		   if (LLONG_MAX / 2 < m)
2577		     break;
2578		 }
2579	       return 0;]])],
2580	  [ac_cv_type_long_long_int=yes],
2581	  [ac_cv_type_long_long_int=no],
2582	  [ac_cv_type_long_long_int=yes])],
2583       [ac_cv_type_long_long_int=no])])
2584  if test $ac_cv_type_long_long_int = yes; then
2585    AC_DEFINE([HAVE_LONG_LONG_INT], 1,
2586      [Define to 1 if the system has the type `long long int'.])
2587  fi
2588])
2589
2590# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
2591# This fixes a bug in Autoconf 2.61, but can be removed once we
2592# assume 2.62 everywhere.
2593
2594# Note: If the type 'unsigned long long int' exists but is only 32 bits
2595# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
2596# will not be defined. In this case you can treat 'unsigned long long int'
2597# like 'unsigned long int'.
2598
2599AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
2600[
2601  AC_CACHE_CHECK([for unsigned long long int],
2602    [ac_cv_type_unsigned_long_long_int],
2603    [AC_LINK_IFELSE(
2604       [_AC_TYPE_LONG_LONG_SNIPPET],
2605       [ac_cv_type_unsigned_long_long_int=yes],
2606       [ac_cv_type_unsigned_long_long_int=no])])
2607  if test $ac_cv_type_unsigned_long_long_int = yes; then
2608    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
2609      [Define to 1 if the system has the type `unsigned long long int'.])
2610  fi
2611])
2612
2613# Expands to a C program that can be used to test for simultaneous support
2614# of 'long long' and 'unsigned long long'. We don't want to say that
2615# 'long long' is available if 'unsigned long long' is not, or vice versa,
2616# because too many programs rely on the symmetry between signed and unsigned
2617# integer types (excluding 'bool').
2618AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
2619[
2620  AC_LANG_PROGRAM(
2621    [[/* Test preprocessor.  */
2622      #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2623        error in preprocessor;
2624      #endif
2625      #if ! (18446744073709551615ULL <= -1ull)
2626        error in preprocessor;
2627      #endif
2628      /* Test literals.  */
2629      long long int ll = 9223372036854775807ll;
2630      long long int nll = -9223372036854775807LL;
2631      unsigned long long int ull = 18446744073709551615ULL;
2632      /* Test constant expressions.   */
2633      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
2634		     ? 1 : -1)];
2635      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
2636		     ? 1 : -1)];
2637      int i = 63;]],
2638    [[/* Test availability of runtime routines for shift and division.  */
2639      long long int llmax = 9223372036854775807ll;
2640      unsigned long long int ullmax = 18446744073709551615ull;
2641      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
2642	      | (llmax / ll) | (llmax % ll)
2643	      | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
2644	      | (ullmax / ull) | (ullmax % ull));]])
2645])
2646
2647# nls.m4 serial 3 (gettext-0.15)
2648dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
2649dnl This file is free software; the Free Software Foundation
2650dnl gives unlimited permission to copy and/or distribute it,
2651dnl with or without modifications, as long as this notice is preserved.
2652dnl
2653dnl This file can can be used in projects which are not available under
2654dnl the GNU General Public License or the GNU Library General Public
2655dnl License but which still want to provide support for the GNU gettext
2656dnl functionality.
2657dnl Please note that the actual code of the GNU gettext library is covered
2658dnl by the GNU Library General Public License, and the rest of the GNU
2659dnl gettext package package is covered by the GNU General Public License.
2660dnl They are *not* in the public domain.
2661
2662dnl Authors:
2663dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2664dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2665
2666AC_PREREQ(2.50)
2667
2668AC_DEFUN([AM_NLS],
2669[
2670  AC_MSG_CHECKING([whether NLS is requested])
2671  dnl Default is enabled NLS
2672  AC_ARG_ENABLE(nls,
2673    [  --disable-nls           do not use Native Language Support],
2674    USE_NLS=$enableval, USE_NLS=yes)
2675  AC_MSG_RESULT($USE_NLS)
2676  AC_SUBST(USE_NLS)
2677])
2678
2679# po.m4 serial 15 (gettext-0.17)
2680dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
2681dnl This file is free software; the Free Software Foundation
2682dnl gives unlimited permission to copy and/or distribute it,
2683dnl with or without modifications, as long as this notice is preserved.
2684dnl
2685dnl This file can can be used in projects which are not available under
2686dnl the GNU General Public License or the GNU Library General Public
2687dnl License but which still want to provide support for the GNU gettext
2688dnl functionality.
2689dnl Please note that the actual code of the GNU gettext library is covered
2690dnl by the GNU Library General Public License, and the rest of the GNU
2691dnl gettext package package is covered by the GNU General Public License.
2692dnl They are *not* in the public domain.
2693
2694dnl Authors:
2695dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2696dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2697
2698AC_PREREQ(2.50)
2699
2700dnl Checks for all prerequisites of the po subdirectory.
2701AC_DEFUN([AM_PO_SUBDIRS],
2702[
2703  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2704  AC_REQUIRE([AC_PROG_INSTALL])dnl
2705  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2706  AC_REQUIRE([AM_NLS])dnl
2707
2708  dnl Release version of the gettext macros. This is used to ensure that
2709  dnl the gettext macros and po/Makefile.in.in are in sync.
2710  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
2711
2712  dnl Perform the following tests also if --disable-nls has been given,
2713  dnl because they are needed for "make dist" to work.
2714
2715  dnl Search for GNU msgfmt in the PATH.
2716  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2717  dnl The second test excludes FreeBSD msgfmt.
2718  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2719    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2720     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2721    :)
2722  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2723
2724  dnl Test whether it is GNU msgfmt >= 0.15.
2725changequote(,)dnl
2726  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2727    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2728    *) MSGFMT_015=$MSGFMT ;;
2729  esac
2730changequote([,])dnl
2731  AC_SUBST([MSGFMT_015])
2732changequote(,)dnl
2733  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2734    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2735    *) GMSGFMT_015=$GMSGFMT ;;
2736  esac
2737changequote([,])dnl
2738  AC_SUBST([GMSGFMT_015])
2739
2740  dnl Search for GNU xgettext 0.12 or newer in the PATH.
2741  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2742  dnl The second test excludes FreeBSD xgettext.
2743  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2744    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2745     (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)],
2746    :)
2747  dnl Remove leftover from FreeBSD xgettext call.
2748  rm -f messages.po
2749
2750  dnl Test whether it is GNU xgettext >= 0.15.
2751changequote(,)dnl
2752  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2753    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2754    *) XGETTEXT_015=$XGETTEXT ;;
2755  esac
2756changequote([,])dnl
2757  AC_SUBST([XGETTEXT_015])
2758
2759  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2760  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2761    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2762
2763  dnl Installation directories.
2764  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2765  dnl have to define it here, so that it can be used in po/Makefile.
2766  test -n "$localedir" || localedir='${datadir}/locale'
2767  AC_SUBST([localedir])
2768
2769  dnl Support for AM_XGETTEXT_OPTION.
2770  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2771  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2772
2773  AC_CONFIG_COMMANDS([po-directories], [[
2774    for ac_file in $CONFIG_FILES; do
2775      # Support "outfile[:infile[:infile...]]"
2776      case "$ac_file" in
2777        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2778      esac
2779      # PO directories have a Makefile.in generated from Makefile.in.in.
2780      case "$ac_file" in */Makefile.in)
2781        # Adjust a relative srcdir.
2782        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2783        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2784        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2785        # In autoconf-2.13 it is called $ac_given_srcdir.
2786        # In autoconf-2.50 it is called $srcdir.
2787        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2788        case "$ac_given_srcdir" in
2789          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2790          /*) top_srcdir="$ac_given_srcdir" ;;
2791          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2792        esac
2793        # Treat a directory as a PO directory if and only if it has a
2794        # POTFILES.in file. This allows packages to have multiple PO
2795        # directories under different names or in different locations.
2796        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2797          rm -f "$ac_dir/POTFILES"
2798          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2799          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2800          POMAKEFILEDEPS="POTFILES.in"
2801          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2802          # on $ac_dir but don't depend on user-specified configuration
2803          # parameters.
2804          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2805            # The LINGUAS file contains the set of available languages.
2806            if test -n "$OBSOLETE_ALL_LINGUAS"; then
2807              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2808            fi
2809            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2810            # Hide the ALL_LINGUAS assigment from automake < 1.5.
2811            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2812            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2813          else
2814            # The set of available languages was given in configure.in.
2815            # Hide the ALL_LINGUAS assigment from automake < 1.5.
2816            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2817          fi
2818          # Compute POFILES
2819          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2820          # Compute UPDATEPOFILES
2821          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2822          # Compute DUMMYPOFILES
2823          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2824          # Compute GMOFILES
2825          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2826          case "$ac_given_srcdir" in
2827            .) srcdirpre= ;;
2828            *) srcdirpre='$(srcdir)/' ;;
2829          esac
2830          POFILES=
2831          UPDATEPOFILES=
2832          DUMMYPOFILES=
2833          GMOFILES=
2834          for lang in $ALL_LINGUAS; do
2835            POFILES="$POFILES $srcdirpre$lang.po"
2836            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2837            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2838            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2839          done
2840          # CATALOGS depends on both $ac_dir and the user's LINGUAS
2841          # environment variable.
2842          INST_LINGUAS=
2843          if test -n "$ALL_LINGUAS"; then
2844            for presentlang in $ALL_LINGUAS; do
2845              useit=no
2846              if test "%UNSET%" != "$LINGUAS"; then
2847                desiredlanguages="$LINGUAS"
2848              else
2849                desiredlanguages="$ALL_LINGUAS"
2850              fi
2851              for desiredlang in $desiredlanguages; do
2852                # Use the presentlang catalog if desiredlang is
2853                #   a. equal to presentlang, or
2854                #   b. a variant of presentlang (because in this case,
2855                #      presentlang can be used as a fallback for messages
2856                #      which are not translated in the desiredlang catalog).
2857                case "$desiredlang" in
2858                  "$presentlang"*) useit=yes;;
2859                esac
2860              done
2861              if test $useit = yes; then
2862                INST_LINGUAS="$INST_LINGUAS $presentlang"
2863              fi
2864            done
2865          fi
2866          CATALOGS=
2867          if test -n "$INST_LINGUAS"; then
2868            for lang in $INST_LINGUAS; do
2869              CATALOGS="$CATALOGS $lang.gmo"
2870            done
2871          fi
2872          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2873          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"
2874          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2875            if test -f "$f"; then
2876              case "$f" in
2877                *.orig | *.bak | *~) ;;
2878                *) cat "$f" >> "$ac_dir/Makefile" ;;
2879              esac
2880            fi
2881          done
2882        fi
2883        ;;
2884      esac
2885    done]],
2886   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2887    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2888    # from automake < 1.5.
2889    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2890    # Capture the value of LINGUAS because we need it to compute CATALOGS.
2891    LINGUAS="${LINGUAS-%UNSET%}"
2892   ])
2893])
2894
2895dnl Postprocesses a Makefile in a directory containing PO files.
2896AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2897[
2898  # When this code is run, in config.status, two variables have already been
2899  # set:
2900  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2901  # - LINGUAS is the value of the environment variable LINGUAS at configure
2902  #   time.
2903
2904changequote(,)dnl
2905  # Adjust a relative srcdir.
2906  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2907  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2908  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2909  # In autoconf-2.13 it is called $ac_given_srcdir.
2910  # In autoconf-2.50 it is called $srcdir.
2911  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2912  case "$ac_given_srcdir" in
2913    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2914    /*) top_srcdir="$ac_given_srcdir" ;;
2915    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2916  esac
2917
2918  # Find a way to echo strings without interpreting backslash.
2919  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2920    gt_echo='echo'
2921  else
2922    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2923      gt_echo='printf %s\n'
2924    else
2925      echo_func () {
2926        cat <<EOT
2927$*
2928EOT
2929      }
2930      gt_echo='echo_func'
2931    fi
2932  fi
2933
2934  # A sed script that extracts the value of VARIABLE from a Makefile.
2935  sed_x_variable='
2936# Test if the hold space is empty.
2937x
2938s/P/P/
2939x
2940ta
2941# Yes it was empty. Look if we have the expected variable definition.
2942/^[	 ]*VARIABLE[	 ]*=/{
2943  # Seen the first line of the variable definition.
2944  s/^[	 ]*VARIABLE[	 ]*=//
2945  ba
2946}
2947bd
2948:a
2949# Here we are processing a line from the variable definition.
2950# Remove comment, more precisely replace it with a space.
2951s/#.*$/ /
2952# See if the line ends in a backslash.
2953tb
2954:b
2955s/\\$//
2956# Print the line, without the trailing backslash.
2957p
2958tc
2959# There was no trailing backslash. The end of the variable definition is
2960# reached. Clear the hold space.
2961s/^.*$//
2962x
2963bd
2964:c
2965# A trailing backslash means that the variable definition continues in the
2966# next line. Put a nonempty string into the hold space to indicate this.
2967s/^.*$/P/
2968x
2969:d
2970'
2971changequote([,])dnl
2972
2973  # Set POTFILES to the value of the Makefile variable POTFILES.
2974  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2975  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2976  # Compute POTFILES_DEPS as
2977  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2978  POTFILES_DEPS=
2979  for file in $POTFILES; do
2980    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2981  done
2982  POMAKEFILEDEPS=""
2983
2984  if test -n "$OBSOLETE_ALL_LINGUAS"; then
2985    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2986  fi
2987  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2988    # The LINGUAS file contains the set of available languages.
2989    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2990    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2991  else
2992    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2993    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2994    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2995  fi
2996  # Hide the ALL_LINGUAS assigment from automake < 1.5.
2997  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2998  # Compute POFILES
2999  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3000  # Compute UPDATEPOFILES
3001  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3002  # Compute DUMMYPOFILES
3003  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3004  # Compute GMOFILES
3005  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3006  # Compute PROPERTIESFILES
3007  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
3008  # Compute CLASSFILES
3009  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
3010  # Compute QMFILES
3011  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3012  # Compute MSGFILES
3013  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3014  # Compute RESOURCESDLLFILES
3015  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3016  case "$ac_given_srcdir" in
3017    .) srcdirpre= ;;
3018    *) srcdirpre='$(srcdir)/' ;;
3019  esac
3020  POFILES=
3021  UPDATEPOFILES=
3022  DUMMYPOFILES=
3023  GMOFILES=
3024  PROPERTIESFILES=
3025  CLASSFILES=
3026  QMFILES=
3027  MSGFILES=
3028  RESOURCESDLLFILES=
3029  for lang in $ALL_LINGUAS; do
3030    POFILES="$POFILES $srcdirpre$lang.po"
3031    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3032    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3033    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3034    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
3035    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
3036    QMFILES="$QMFILES $srcdirpre$lang.qm"
3037    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3038    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3039    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/'`
3040    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3041  done
3042  # CATALOGS depends on both $ac_dir and the user's LINGUAS
3043  # environment variable.
3044  INST_LINGUAS=
3045  if test -n "$ALL_LINGUAS"; then
3046    for presentlang in $ALL_LINGUAS; do
3047      useit=no
3048      if test "%UNSET%" != "$LINGUAS"; then
3049        desiredlanguages="$LINGUAS"
3050      else
3051        desiredlanguages="$ALL_LINGUAS"
3052      fi
3053      for desiredlang in $desiredlanguages; do
3054        # Use the presentlang catalog if desiredlang is
3055        #   a. equal to presentlang, or
3056        #   b. a variant of presentlang (because in this case,
3057        #      presentlang can be used as a fallback for messages
3058        #      which are not translated in the desiredlang catalog).
3059        case "$desiredlang" in
3060          "$presentlang"*) useit=yes;;
3061        esac
3062      done
3063      if test $useit = yes; then
3064        INST_LINGUAS="$INST_LINGUAS $presentlang"
3065      fi
3066    done
3067  fi
3068  CATALOGS=
3069  JAVACATALOGS=
3070  QTCATALOGS=
3071  TCLCATALOGS=
3072  CSHARPCATALOGS=
3073  if test -n "$INST_LINGUAS"; then
3074    for lang in $INST_LINGUAS; do
3075      CATALOGS="$CATALOGS $lang.gmo"
3076      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3077      QTCATALOGS="$QTCATALOGS $lang.qm"
3078      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3079      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3080      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/'`
3081      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3082    done
3083  fi
3084
3085  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"
3086  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3087    # Add dependencies that cannot be formulated as a simple suffix rule.
3088    for lang in $ALL_LINGUAS; do
3089      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3090      cat >> "$ac_file.tmp" <<EOF
3091$frobbedlang.msg: $lang.po
3092	@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3093	\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3094EOF
3095    done
3096  fi
3097  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3098    # Add dependencies that cannot be formulated as a simple suffix rule.
3099    for lang in $ALL_LINGUAS; do
3100      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/'`
3101      cat >> "$ac_file.tmp" <<EOF
3102$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3103	@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3104	\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3105EOF
3106    done
3107  fi
3108  if test -n "$POMAKEFILEDEPS"; then
3109    cat >> "$ac_file.tmp" <<EOF
3110Makefile: $POMAKEFILEDEPS
3111EOF
3112  fi
3113  mv "$ac_file.tmp" "$ac_file"
3114])
3115
3116dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
3117AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
3118[
3119  XGETTEXT_EXTRA_OPTIONS=
3120])
3121
3122dnl Registers an option to be passed to xgettext in the po subdirectory.
3123AC_DEFUN([AM_XGETTEXT_OPTION],
3124[
3125  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
3126  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
3127])
3128
3129# printf-posix.m4 serial 3 (gettext-0.17)
3130dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
3131dnl This file is free software; the Free Software Foundation
3132dnl gives unlimited permission to copy and/or distribute it,
3133dnl with or without modifications, as long as this notice is preserved.
3134
3135dnl From Bruno Haible.
3136dnl Test whether the printf() function supports POSIX/XSI format strings with
3137dnl positions.
3138
3139AC_DEFUN([gt_PRINTF_POSIX],
3140[
3141  AC_REQUIRE([AC_PROG_CC])
3142  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3143    gt_cv_func_printf_posix,
3144    [
3145      AC_TRY_RUN([
3146#include <stdio.h>
3147#include <string.h>
3148/* The string "%2$d %1$d", with dollar characters protected from the shell's
3149   dollar expansion (possibly an autoconf bug).  */
3150static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3151static char buf[100];
3152int main ()
3153{
3154  sprintf (buf, format, 33, 55);
3155  return (strcmp (buf, "55 33") != 0);
3156}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3157      [
3158        AC_EGREP_CPP(notposix, [
3159#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3160  notposix
3161#endif
3162        ], gt_cv_func_printf_posix="guessing no",
3163           gt_cv_func_printf_posix="guessing yes")
3164      ])
3165    ])
3166  case $gt_cv_func_printf_posix in
3167    *yes)
3168      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3169        [Define if your printf() function supports format strings with positions.])
3170      ;;
3171  esac
3172])
3173
3174# progtest.m4 serial 4 (gettext-0.14.2)
3175dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
3176dnl This file is free software; the Free Software Foundation
3177dnl gives unlimited permission to copy and/or distribute it,
3178dnl with or without modifications, as long as this notice is preserved.
3179dnl
3180dnl This file can can be used in projects which are not available under
3181dnl the GNU General Public License or the GNU Library General Public
3182dnl License but which still want to provide support for the GNU gettext
3183dnl functionality.
3184dnl Please note that the actual code of the GNU gettext library is covered
3185dnl by the GNU Library General Public License, and the rest of the GNU
3186dnl gettext package package is covered by the GNU General Public License.
3187dnl They are *not* in the public domain.
3188
3189dnl Authors:
3190dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
3191
3192AC_PREREQ(2.50)
3193
3194# Search path for a program which passes the given test.
3195
3196dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3197dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3198AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3199[
3200# Prepare PATH_SEPARATOR.
3201# The user is always right.
3202if test "${PATH_SEPARATOR+set}" != set; then
3203  echo "#! /bin/sh" >conf$$.sh
3204  echo  "exit 0"   >>conf$$.sh
3205  chmod +x conf$$.sh
3206  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
3207    PATH_SEPARATOR=';'
3208  else
3209    PATH_SEPARATOR=:
3210  fi
3211  rm -f conf$$.sh
3212fi
3213
3214# Find out how to test for executable files. Don't use a zero-byte file,
3215# as systems may use methods other than mode bits to determine executability.
3216cat >conf$$.file <<_ASEOF
3217#! /bin/sh
3218exit 0
3219_ASEOF
3220chmod +x conf$$.file
3221if test -x conf$$.file >/dev/null 2>&1; then
3222  ac_executable_p="test -x"
3223else
3224  ac_executable_p="test -f"
3225fi
3226rm -f conf$$.file
3227
3228# Extract the first word of "$2", so it can be a program name with args.
3229set dummy $2; ac_word=[$]2
3230AC_MSG_CHECKING([for $ac_word])
3231AC_CACHE_VAL(ac_cv_path_$1,
3232[case "[$]$1" in
3233  [[\\/]]* | ?:[[\\/]]*)
3234    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
3235    ;;
3236  *)
3237    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
3238    for ac_dir in ifelse([$5], , $PATH, [$5]); do
3239      IFS="$ac_save_IFS"
3240      test -z "$ac_dir" && ac_dir=.
3241      for ac_exec_ext in '' $ac_executable_extensions; do
3242        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
3243          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
3244          if [$3]; then
3245            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
3246            break 2
3247          fi
3248        fi
3249      done
3250    done
3251    IFS="$ac_save_IFS"
3252dnl If no 4th arg is given, leave the cache variable unset,
3253dnl so AC_PATH_PROGS will keep looking.
3254ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
3255])dnl
3256    ;;
3257esac])dnl
3258$1="$ac_cv_path_$1"
3259if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
3260  AC_MSG_RESULT([$]$1)
3261else
3262  AC_MSG_RESULT(no)
3263fi
3264AC_SUBST($1)dnl
3265])
3266
3267# size_max.m4 serial 6
3268dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
3269dnl This file is free software; the Free Software Foundation
3270dnl gives unlimited permission to copy and/or distribute it,
3271dnl with or without modifications, as long as this notice is preserved.
3272
3273dnl From Bruno Haible.
3274
3275AC_DEFUN([gl_SIZE_MAX],
3276[
3277  AC_CHECK_HEADERS(stdint.h)
3278  dnl First test whether the system already has SIZE_MAX.
3279  AC_MSG_CHECKING([for SIZE_MAX])
3280  AC_CACHE_VAL([gl_cv_size_max], [
3281    gl_cv_size_max=
3282    AC_EGREP_CPP([Found it], [
3283#include <limits.h>
3284#if HAVE_STDINT_H
3285#include <stdint.h>
3286#endif
3287#ifdef SIZE_MAX
3288Found it
3289#endif
3290], gl_cv_size_max=yes)
3291    if test -z "$gl_cv_size_max"; then
3292      dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3293      dnl than the type 'unsigned long'. Try hard to find a definition that can
3294      dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
3295      AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
3296        [#include <stddef.h>
3297#include <limits.h>], size_t_bits_minus_1=)
3298      AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
3299        [#include <stddef.h>], fits_in_uint=)
3300      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
3301        if test $fits_in_uint = 1; then
3302          dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3303          dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3304          AC_TRY_COMPILE([#include <stddef.h>
3305            extern size_t foo;
3306            extern unsigned long foo;
3307            ], [], fits_in_uint=0)
3308        fi
3309        dnl We cannot use 'expr' to simplify this expression, because 'expr'
3310        dnl works only with 'long' integers in the host environment, while we
3311        dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
3312        if test $fits_in_uint = 1; then
3313          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
3314        else
3315          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
3316        fi
3317      else
3318        dnl Shouldn't happen, but who knows...
3319        gl_cv_size_max='((size_t)~(size_t)0)'
3320      fi
3321    fi
3322  ])
3323  AC_MSG_RESULT([$gl_cv_size_max])
3324  if test "$gl_cv_size_max" != yes; then
3325    AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
3326      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3327  fi
3328])
3329
3330dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
3331dnl Remove this when we can assume autoconf >= 2.61.
3332m4_ifdef([AC_COMPUTE_INT], [], [
3333  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
3334])
3335
3336# stdint_h.m4 serial 6
3337dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
3338dnl This file is free software; the Free Software Foundation
3339dnl gives unlimited permission to copy and/or distribute it,
3340dnl with or without modifications, as long as this notice is preserved.
3341
3342dnl From Paul Eggert.
3343
3344# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3345# doesn't clash with <sys/types.h>, and declares uintmax_t.
3346
3347AC_DEFUN([gl_AC_HEADER_STDINT_H],
3348[
3349  AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
3350  [AC_TRY_COMPILE(
3351    [#include <sys/types.h>
3352#include <stdint.h>],
3353    [uintmax_t i = (uintmax_t) -1; return !i;],
3354    gl_cv_header_stdint_h=yes,
3355    gl_cv_header_stdint_h=no)])
3356  if test $gl_cv_header_stdint_h = yes; then
3357    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3358      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3359       and declares uintmax_t. ])
3360  fi
3361])
3362
3363# uintmax_t.m4 serial 10
3364dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc.
3365dnl This file is free software; the Free Software Foundation
3366dnl gives unlimited permission to copy and/or distribute it,
3367dnl with or without modifications, as long as this notice is preserved.
3368
3369dnl From Paul Eggert.
3370
3371AC_PREREQ(2.13)
3372
3373# Define uintmax_t to 'unsigned long' or 'unsigned long long'
3374# if it is not already defined in <stdint.h> or <inttypes.h>.
3375
3376AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
3377[
3378  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
3379  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
3380  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
3381    AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
3382    test $ac_cv_type_unsigned_long_long_int = yes \
3383      && ac_type='unsigned long long' \
3384      || ac_type='unsigned long'
3385    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3386      [Define to unsigned long or unsigned long long
3387       if <stdint.h> and <inttypes.h> don't define.])
3388  else
3389    AC_DEFINE(HAVE_UINTMAX_T, 1,
3390      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3391  fi
3392])
3393
3394# visibility.m4 serial 1 (gettext-0.15)
3395dnl Copyright (C) 2005 Free Software Foundation, Inc.
3396dnl This file is free software; the Free Software Foundation
3397dnl gives unlimited permission to copy and/or distribute it,
3398dnl with or without modifications, as long as this notice is preserved.
3399
3400dnl From Bruno Haible.
3401
3402dnl Tests whether the compiler supports the command-line option
3403dnl -fvisibility=hidden and the function and variable attributes
3404dnl __attribute__((__visibility__("hidden"))) and
3405dnl __attribute__((__visibility__("default"))).
3406dnl Does *not* test for __visibility__("protected") - which has tricky
3407dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
3408dnl MacOS X.
3409dnl Does *not* test for __visibility__("internal") - which has processor
3410dnl dependent semantics.
3411dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
3412dnl "really only recommended for legacy code".
3413dnl Set the variable CFLAG_VISIBILITY.
3414dnl Defines and sets the variable HAVE_VISIBILITY.
3415
3416AC_DEFUN([gl_VISIBILITY],
3417[
3418  AC_REQUIRE([AC_PROG_CC])
3419  CFLAG_VISIBILITY=
3420  HAVE_VISIBILITY=0
3421  if test -n "$GCC"; then
3422    AC_MSG_CHECKING([for simple visibility declarations])
3423    AC_CACHE_VAL(gl_cv_cc_visibility, [
3424      gl_save_CFLAGS="$CFLAGS"
3425      CFLAGS="$CFLAGS -fvisibility=hidden"
3426      AC_TRY_COMPILE(
3427        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
3428         extern __attribute__((__visibility__("default"))) int exportedvar;
3429         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
3430         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
3431        [],
3432        gl_cv_cc_visibility=yes,
3433        gl_cv_cc_visibility=no)
3434      CFLAGS="$gl_save_CFLAGS"])
3435    AC_MSG_RESULT([$gl_cv_cc_visibility])
3436    if test $gl_cv_cc_visibility = yes; then
3437      CFLAG_VISIBILITY="-fvisibility=hidden"
3438      HAVE_VISIBILITY=1
3439    fi
3440  fi
3441  AC_SUBST([CFLAG_VISIBILITY])
3442  AC_SUBST([HAVE_VISIBILITY])
3443  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
3444    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
3445])
3446
3447# wchar_t.m4 serial 1 (gettext-0.12)
3448dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3449dnl This file is free software; the Free Software Foundation
3450dnl gives unlimited permission to copy and/or distribute it,
3451dnl with or without modifications, as long as this notice is preserved.
3452
3453dnl From Bruno Haible.
3454dnl Test whether <stddef.h> has the 'wchar_t' type.
3455dnl Prerequisite: AC_PROG_CC
3456
3457AC_DEFUN([gt_TYPE_WCHAR_T],
3458[
3459  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
3460    [AC_TRY_COMPILE([#include <stddef.h>
3461       wchar_t foo = (wchar_t)'\0';], ,
3462       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
3463  if test $gt_cv_c_wchar_t = yes; then
3464    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
3465  fi
3466])
3467
3468# wint_t.m4 serial 2 (gettext-0.17)
3469dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
3470dnl This file is free software; the Free Software Foundation
3471dnl gives unlimited permission to copy and/or distribute it,
3472dnl with or without modifications, as long as this notice is preserved.
3473
3474dnl From Bruno Haible.
3475dnl Test whether <wchar.h> has the 'wint_t' type.
3476dnl Prerequisite: AC_PROG_CC
3477
3478AC_DEFUN([gt_TYPE_WINT_T],
3479[
3480  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
3481    [AC_TRY_COMPILE([
3482/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
3483   <wchar.h>.
3484   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
3485   before <wchar.h>.  */
3486#include <stddef.h>
3487#include <stdio.h>
3488#include <time.h>
3489#include <wchar.h>
3490       wint_t foo = (wchar_t)'\0';], ,
3491       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
3492  if test $gt_cv_c_wint_t = yes; then
3493    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
3494  fi
3495])
3496
3497# xsize.m4 serial 3
3498dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
3499dnl This file is free software; the Free Software Foundation
3500dnl gives unlimited permission to copy and/or distribute it,
3501dnl with or without modifications, as long as this notice is preserved.
3502
3503AC_DEFUN([gl_XSIZE],
3504[
3505  dnl Prerequisites of lib/xsize.h.
3506  AC_REQUIRE([gl_SIZE_MAX])
3507  AC_REQUIRE([AC_C_INLINE])
3508  AC_CHECK_HEADERS(stdint.h)
3509])
3510
3511# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
3512#
3513# This file is free software; the Free Software Foundation
3514# gives unlimited permission to copy and/or distribute it,
3515# with or without modifications, as long as this notice is preserved.
3516
3517# AM_PROG_MKDIR_P
3518# ---------------
3519# Check for `mkdir -p'.
3520AC_DEFUN([AM_PROG_MKDIR_P],
3521[AC_PREREQ([2.60])dnl
3522AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3523dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
3524dnl while keeping a definition of mkdir_p for backward compatibility.
3525dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
3526dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
3527dnl Makefile.ins that do not define MKDIR_P, so we do our own
3528dnl adjustment using top_builddir (which is defined more often than
3529dnl MKDIR_P).
3530AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
3531case $mkdir_p in
3532  [[\\/$]]* | ?:[[\\/]]*) ;;
3533  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
3534esac
3535])
3536
3537m4_include([m4/neon/neon-test.m4])
3538m4_include([m4/neon/neon-xml-parser.m4])
3539m4_include([m4/neon/neon.m4])
3540m4_include([m4/inttypes.m4])
3541m4_include([m4/longlong.m4])
3542m4_include([m4/prereq.m4])
3543m4_include([m4/readline.m4])
3544m4_include([m4/strftime.m4])
3545