a2c2f1e0acc961418b6aef56b7cbf8c7a40c2f99
[citadel.git] / webcit / aclocal.m4
1 # generated automatically by aclocal 1.9.2 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
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 AM1 (gettext-0.10.40)
15 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
16 dnl This file is free software, distributed under the terms of the GNU
17 dnl General Public License.  As a special exception to the GNU General
18 dnl Public License, this file may be distributed as part of a program
19 dnl that contains a configuration script generated by Autoconf, under
20 dnl the same distribution terms as the rest of that program.
21
22 dnl From Bruno Haible.
23
24 AC_DEFUN([AM_LANGINFO_CODESET],
25 [
26   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
27     [AC_TRY_LINK([#include <langinfo.h>],
28       [char* cs = nl_langinfo(CODESET);],
29       am_cv_langinfo_codeset=yes,
30       am_cv_langinfo_codeset=no)
31     ])
32   if test $am_cv_langinfo_codeset = yes; then
33     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
34       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
35   fi
36 ])
37
38 # gettext.m4 serial 28 (gettext-0.13)
39 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
40 dnl This file is free software, distributed under the terms of the GNU
41 dnl General Public License.  As a special exception to the GNU General
42 dnl Public License, this file may be distributed as part of a program
43 dnl that contains a configuration script generated by Autoconf, under
44 dnl the same distribution terms as the rest of that program.
45 dnl
46 dnl This file can can be used in projects which are not available under
47 dnl the GNU General Public License or the GNU Library General Public
48 dnl License but which still want to provide support for the GNU gettext
49 dnl functionality.
50 dnl Please note that the actual code of the GNU gettext library is covered
51 dnl by the GNU Library General Public License, and the rest of the GNU
52 dnl gettext package package is covered by the GNU General Public License.
53 dnl They are *not* in the public domain.
54
55 dnl Authors:
56 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
57 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
58
59 dnl Macro to add for using GNU gettext.
60
61 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
62 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
63 dnl    default (if it is not specified or empty) is 'no-libtool'.
64 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
65 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
66 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
67 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
68 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
69 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
70 dnl    $(top_builddir)/intl/libintl.a will be created.
71 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
72 dnl    implementations (in libc or libintl) without the ngettext() function
73 dnl    will be ignored.  If NEEDSYMBOL is specified and is
74 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
75 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
76 dnl INTLDIR is used to find the intl libraries.  If empty,
77 dnl    the value `$(top_builddir)/intl/' is used.
78 dnl
79 dnl The result of the configuration is one of three cases:
80 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
81 dnl    and used.
82 dnl    Catalog format: GNU --> install in $(datadir)
83 dnl    Catalog extension: .mo after installation, .gmo in source tree
84 dnl 2) GNU gettext has been found in the system's C library.
85 dnl    Catalog format: GNU --> install in $(datadir)
86 dnl    Catalog extension: .mo after installation, .gmo in source tree
87 dnl 3) No internationalization, always use English msgid.
88 dnl    Catalog format: none
89 dnl    Catalog extension: none
90 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
91 dnl The use of .gmo is historical (it was needed to avoid overwriting the
92 dnl GNU format catalogs when building on a platform with an X/Open gettext),
93 dnl but we keep it in order not to force irrelevant filename changes on the
94 dnl maintainers.
95 dnl
96 AC_DEFUN([AM_GNU_GETTEXT],
97 [
98   dnl Argument checking.
99   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
100     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
101 ])])])])])
102   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
103     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
104 ])])])])
105   define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
106   define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
107
108   AC_REQUIRE([AM_PO_SUBDIRS])dnl
109   ifelse(gt_included_intl, yes, [
110     AC_REQUIRE([AM_INTL_SUBDIR])dnl
111   ])
112
113   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
114   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
115   AC_REQUIRE([AC_LIB_RPATH])
116
117   dnl Sometimes libintl requires libiconv, so first search for libiconv.
118   dnl Ideally we would do this search only after the
119   dnl      if test "$USE_NLS" = "yes"; then
120   dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
121   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
122   dnl the configure script would need to contain the same shell code
123   dnl again, outside any 'if'. There are two solutions:
124   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
125   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
126   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
127   dnl documented, we avoid it.
128   ifelse(gt_included_intl, yes, , [
129     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
130   ])
131
132   dnl Set USE_NLS.
133   AM_NLS
134
135   ifelse(gt_included_intl, yes, [
136     BUILD_INCLUDED_LIBINTL=no
137     USE_INCLUDED_LIBINTL=no
138   ])
139   LIBINTL=
140   LTLIBINTL=
141   POSUB=
142
143   dnl If we use NLS figure out what method
144   if test "$USE_NLS" = "yes"; then
145     gt_use_preinstalled_gnugettext=no
146     ifelse(gt_included_intl, yes, [
147       AC_MSG_CHECKING([whether included gettext is requested])
148       AC_ARG_WITH(included-gettext,
149         [  --with-included-gettext use the GNU gettext library included here],
150         nls_cv_force_use_gnu_gettext=$withval,
151         nls_cv_force_use_gnu_gettext=no)
152       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
153
154       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
155       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
156     ])
157         dnl User does not insist on using GNU NLS library.  Figure out what
158         dnl to use.  If GNU gettext is available we use this.  Else we have
159         dnl to fall back to GNU NLS library.
160
161         dnl Add a version number to the cache macros.
162         define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
163         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
164         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
165
166         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
167          [AC_TRY_LINK([#include <libintl.h>
168 ]ifelse([$2], [need-formatstring-macros],
169 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
170 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
171 #endif
172 changequote(,)dnl
173 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
174 changequote([,])dnl
175 ], [])[extern int _nl_msg_cat_cntr;
176 extern int *_nl_domain_bindings;],
177             [bindtextdomain ("", "");
178 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
179             gt_cv_func_gnugettext_libc=yes,
180             gt_cv_func_gnugettext_libc=no)])
181
182         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
183           dnl Sometimes libintl requires libiconv, so first search for libiconv.
184           ifelse(gt_included_intl, yes, , [
185             AM_ICONV_LINK
186           ])
187           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
188           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
189           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
190           dnl even if libiconv doesn't exist.
191           AC_LIB_LINKFLAGS_BODY([intl])
192           AC_CACHE_CHECK([for GNU gettext in libintl],
193             gt_cv_func_gnugettext_libintl,
194            [gt_save_CPPFLAGS="$CPPFLAGS"
195             CPPFLAGS="$CPPFLAGS $INCINTL"
196             gt_save_LIBS="$LIBS"
197             LIBS="$LIBS $LIBINTL"
198             dnl Now see whether libintl exists and does not depend on libiconv.
199             AC_TRY_LINK([#include <libintl.h>
200 ]ifelse([$2], [need-formatstring-macros],
201 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
202 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
203 #endif
204 changequote(,)dnl
205 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
206 changequote([,])dnl
207 ], [])[extern int _nl_msg_cat_cntr;
208 extern
209 #ifdef __cplusplus
210 "C"
211 #endif
212 const char *_nl_expand_alias ();],
213               [bindtextdomain ("", "");
214 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
215               gt_cv_func_gnugettext_libintl=yes,
216               gt_cv_func_gnugettext_libintl=no)
217             dnl Now see whether libintl exists and depends on libiconv.
218             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
219               LIBS="$LIBS $LIBICONV"
220               AC_TRY_LINK([#include <libintl.h>
221 ]ifelse([$2], [need-formatstring-macros],
222 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
223 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
224 #endif
225 changequote(,)dnl
226 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
227 changequote([,])dnl
228 ], [])[extern int _nl_msg_cat_cntr;
229 extern
230 #ifdef __cplusplus
231 "C"
232 #endif
233 const char *_nl_expand_alias ();],
234                 [bindtextdomain ("", "");
235 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
236                [LIBINTL="$LIBINTL $LIBICONV"
237                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
238                 gt_cv_func_gnugettext_libintl=yes
239                ])
240             fi
241             CPPFLAGS="$gt_save_CPPFLAGS"
242             LIBS="$gt_save_LIBS"])
243         fi
244
245         dnl If an already present or preinstalled GNU gettext() is found,
246         dnl use it.  But if this macro is used in GNU gettext, and GNU
247         dnl gettext is already preinstalled in libintl, we update this
248         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
249         if test "$gt_cv_func_gnugettext_libc" = "yes" \
250            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
251                 && test "$PACKAGE" != gettext-runtime \
252                 && test "$PACKAGE" != gettext-tools; }; then
253           gt_use_preinstalled_gnugettext=yes
254         else
255           dnl Reset the values set by searching for libintl.
256           LIBINTL=
257           LTLIBINTL=
258           INCINTL=
259         fi
260
261     ifelse(gt_included_intl, yes, [
262         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
263           dnl GNU gettext is not found in the C library.
264           dnl Fall back on included GNU gettext library.
265           nls_cv_use_gnu_gettext=yes
266         fi
267       fi
268
269       if test "$nls_cv_use_gnu_gettext" = "yes"; then
270         dnl Mark actions used to generate GNU NLS library.
271         BUILD_INCLUDED_LIBINTL=yes
272         USE_INCLUDED_LIBINTL=yes
273         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
274         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
275         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
276       fi
277
278       if test "$gt_use_preinstalled_gnugettext" = "yes" \
279          || test "$nls_cv_use_gnu_gettext" = "yes"; then
280         dnl Mark actions to use GNU gettext tools.
281         CATOBJEXT=.gmo
282       fi
283     ])
284
285     if test "$gt_use_preinstalled_gnugettext" = "yes" \
286        || test "$nls_cv_use_gnu_gettext" = "yes"; then
287       AC_DEFINE(ENABLE_NLS, 1,
288         [Define to 1 if translation of program messages to the user's native language
289    is requested.])
290     else
291       USE_NLS=no
292     fi
293   fi
294
295   AC_MSG_CHECKING([whether to use NLS])
296   AC_MSG_RESULT([$USE_NLS])
297   if test "$USE_NLS" = "yes"; then
298     AC_MSG_CHECKING([where the gettext function comes from])
299     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
300       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
301         gt_source="external libintl"
302       else
303         gt_source="libc"
304       fi
305     else
306       gt_source="included intl directory"
307     fi
308     AC_MSG_RESULT([$gt_source])
309   fi
310
311   if test "$USE_NLS" = "yes"; then
312
313     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
314       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
315         AC_MSG_CHECKING([how to link with libintl])
316         AC_MSG_RESULT([$LIBINTL])
317         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
318       fi
319
320       dnl For backward compatibility. Some packages may be using this.
321       AC_DEFINE(HAVE_GETTEXT, 1,
322        [Define if the GNU gettext() function is already present or preinstalled.])
323       AC_DEFINE(HAVE_DCGETTEXT, 1,
324        [Define if the GNU dcgettext() function is already present or preinstalled.])
325     fi
326
327     dnl We need to process the po/ directory.
328     POSUB=po
329   fi
330
331   ifelse(gt_included_intl, yes, [
332     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
333     dnl to 'yes' because some of the testsuite requires it.
334     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
335       BUILD_INCLUDED_LIBINTL=yes
336     fi
337
338     dnl Make all variables we use known to autoconf.
339     AC_SUBST(BUILD_INCLUDED_LIBINTL)
340     AC_SUBST(USE_INCLUDED_LIBINTL)
341     AC_SUBST(CATOBJEXT)
342
343     dnl For backward compatibility. Some configure.ins may be using this.
344     nls_cv_header_intl=
345     nls_cv_header_libgt=
346
347     dnl For backward compatibility. Some Makefiles may be using this.
348     DATADIRNAME=share
349     AC_SUBST(DATADIRNAME)
350
351     dnl For backward compatibility. Some Makefiles may be using this.
352     INSTOBJEXT=.mo
353     AC_SUBST(INSTOBJEXT)
354
355     dnl For backward compatibility. Some Makefiles may be using this.
356     GENCAT=gencat
357     AC_SUBST(GENCAT)
358
359     dnl For backward compatibility. Some Makefiles may be using this.
360     if test "$USE_INCLUDED_LIBINTL" = yes; then
361       INTLOBJS="\$(GETTOBJS)"
362     fi
363     AC_SUBST(INTLOBJS)
364
365     dnl Enable libtool support if the surrounding package wishes it.
366     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
367     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
368   ])
369
370   dnl For backward compatibility. Some Makefiles may be using this.
371   INTLLIBS="$LIBINTL"
372   AC_SUBST(INTLLIBS)
373
374   dnl Make all documented variables known to autoconf.
375   AC_SUBST(LIBINTL)
376   AC_SUBST(LTLIBINTL)
377   AC_SUBST(POSUB)
378 ])
379
380
381 dnl Checks for all prerequisites of the intl subdirectory,
382 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
383 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
384 AC_DEFUN([AM_INTL_SUBDIR],
385 [
386   AC_REQUIRE([AC_PROG_INSTALL])dnl
387   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
388   AC_REQUIRE([AC_PROG_CC])dnl
389   AC_REQUIRE([AC_CANONICAL_HOST])dnl
390   AC_REQUIRE([AC_PROG_RANLIB])dnl
391   AC_REQUIRE([AC_ISC_POSIX])dnl
392   AC_REQUIRE([AC_HEADER_STDC])dnl
393   AC_REQUIRE([AC_C_CONST])dnl
394   AC_REQUIRE([bh_C_SIGNED])dnl
395   AC_REQUIRE([AC_C_INLINE])dnl
396   AC_REQUIRE([AC_TYPE_OFF_T])dnl
397   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
398   AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
399   AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
400   AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
401   AC_REQUIRE([gt_TYPE_WINT_T])dnl
402   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
403   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
404   AC_REQUIRE([gt_TYPE_INTMAX_T])
405   AC_REQUIRE([gt_PRINTF_POSIX])
406   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
407   AC_REQUIRE([AC_FUNC_MMAP])dnl
408   AC_REQUIRE([jm_GLIBC21])dnl
409   AC_REQUIRE([gt_INTDIV0])dnl
410   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
411   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
412   AC_REQUIRE([gt_INTTYPES_PRI])dnl
413   AC_REQUIRE([gl_XSIZE])dnl
414
415   AC_CHECK_TYPE([ptrdiff_t], ,
416     [AC_DEFINE([ptrdiff_t], [long],
417        [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
418     ])
419   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
420 stdlib.h string.h unistd.h sys/param.h])
421   AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
422 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
423 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
424 __fsetlocking])
425
426   dnl Use the _snprintf function only if it is declared (because on NetBSD it
427   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
428   gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
429   gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
430
431   dnl Use the *_unlocked functions only if they are declared.
432   dnl (because some of them were defined without being declared in Solaris
433   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
434   dnl on Solaris 2.5.1 to run on Solaris 2.6).
435   dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
436   gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
437   gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
438   gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
439
440   case $gt_cv_func_printf_posix in
441     *yes) HAVE_POSIX_PRINTF=1 ;;
442     *) HAVE_POSIX_PRINTF=0 ;;
443   esac
444   AC_SUBST([HAVE_POSIX_PRINTF])
445   if test "$ac_cv_func_asprintf" = yes; then
446     HAVE_ASPRINTF=1
447   else
448     HAVE_ASPRINTF=0
449   fi
450   AC_SUBST([HAVE_ASPRINTF])
451   if test "$ac_cv_func_snprintf" = yes; then
452     HAVE_SNPRINTF=1
453   else
454     HAVE_SNPRINTF=0
455   fi
456   AC_SUBST([HAVE_SNPRINTF])
457   if test "$ac_cv_func_wprintf" = yes; then
458     HAVE_WPRINTF=1
459   else
460     HAVE_WPRINTF=0
461   fi
462   AC_SUBST([HAVE_WPRINTF])
463
464   AM_ICONV
465   AM_LANGINFO_CODESET
466   if test $ac_cv_header_locale_h = yes; then
467     AM_LC_MESSAGES
468   fi
469
470   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
471   dnl because plural.y uses bison specific features. It requires at least
472   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
473   dnl compile.
474   dnl bison is only needed for the maintainer (who touches plural.y). But in
475   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
476   dnl the rule in general Makefile. Now, some people carelessly touch the
477   dnl files or have a broken "make" program, hence the plural.c rule will
478   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
479   dnl present or too old.
480   AC_CHECK_PROGS([INTLBISON], [bison])
481   if test -z "$INTLBISON"; then
482     ac_verc_fail=yes
483   else
484     dnl Found it, now check the version.
485     AC_MSG_CHECKING([version of bison])
486 changequote(<<,>>)dnl
487     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
488     case $ac_prog_version in
489       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
490       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
491 changequote([,])dnl
492          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
493       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
494     esac
495     AC_MSG_RESULT([$ac_prog_version])
496   fi
497   if test $ac_verc_fail = yes; then
498     INTLBISON=:
499   fi
500 ])
501
502
503 dnl gt_CHECK_DECL(FUNC, INCLUDES)
504 dnl Check whether a function is declared.
505 AC_DEFUN([gt_CHECK_DECL],
506 [
507   AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
508     [AC_TRY_COMPILE([$2], [
509 #ifndef $1
510   char *p = (char *) $1;
511 #endif
512 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
513   if test $ac_cv_have_decl_$1 = yes; then
514     gt_value=1
515   else
516     gt_value=0
517   fi
518   AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
519     [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
520 ])
521
522
523 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
524 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
525
526 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
527 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
528 dnl This file is free software, distributed under the terms of the GNU
529 dnl General Public License.  As a special exception to the GNU General
530 dnl Public License, this file may be distributed as part of a program
531 dnl that contains a configuration script generated by Autoconf, under
532 dnl the same distribution terms as the rest of that program.
533
534 # Test for the GNU C Library, version 2.1 or newer.
535 # From Bruno Haible.
536
537 AC_DEFUN([jm_GLIBC21],
538   [
539     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
540       ac_cv_gnu_library_2_1,
541       [AC_EGREP_CPP([Lucky GNU user],
542         [
543 #include <features.h>
544 #ifdef __GNU_LIBRARY__
545  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
546   Lucky GNU user
547  #endif
548 #endif
549         ],
550         ac_cv_gnu_library_2_1=yes,
551         ac_cv_gnu_library_2_1=no)
552       ]
553     )
554     AC_SUBST(GLIBC21)
555     GLIBC21="$ac_cv_gnu_library_2_1"
556   ]
557 )
558
559 # iconv.m4 serial AM4 (gettext-0.11.3)
560 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
561 dnl This file is free software, distributed under the terms of the GNU
562 dnl General Public License.  As a special exception to the GNU General
563 dnl Public License, this file may be distributed as part of a program
564 dnl that contains a configuration script generated by Autoconf, under
565 dnl the same distribution terms as the rest of that program.
566
567 dnl From Bruno Haible.
568
569 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
570 [
571   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
572   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
573   AC_REQUIRE([AC_LIB_RPATH])
574
575   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
576   dnl accordingly.
577   AC_LIB_LINKFLAGS_BODY([iconv])
578 ])
579
580 AC_DEFUN([AM_ICONV_LINK],
581 [
582   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
583   dnl those with the standalone portable GNU libiconv installed).
584
585   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
586   dnl accordingly.
587   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
588
589   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
590   dnl because if the user has installed libiconv and not disabled its use
591   dnl via --without-libiconv-prefix, he wants to use it. The first
592   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
593   am_save_CPPFLAGS="$CPPFLAGS"
594   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
595
596   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
597     am_cv_func_iconv="no, consider installing GNU libiconv"
598     am_cv_lib_iconv=no
599     AC_TRY_LINK([#include <stdlib.h>
600 #include <iconv.h>],
601       [iconv_t cd = iconv_open("","");
602        iconv(cd,NULL,NULL,NULL,NULL);
603        iconv_close(cd);],
604       am_cv_func_iconv=yes)
605     if test "$am_cv_func_iconv" != yes; then
606       am_save_LIBS="$LIBS"
607       LIBS="$LIBS $LIBICONV"
608       AC_TRY_LINK([#include <stdlib.h>
609 #include <iconv.h>],
610         [iconv_t cd = iconv_open("","");
611          iconv(cd,NULL,NULL,NULL,NULL);
612          iconv_close(cd);],
613         am_cv_lib_iconv=yes
614         am_cv_func_iconv=yes)
615       LIBS="$am_save_LIBS"
616     fi
617   ])
618   if test "$am_cv_func_iconv" = yes; then
619     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
620   fi
621   if test "$am_cv_lib_iconv" = yes; then
622     AC_MSG_CHECKING([how to link with libiconv])
623     AC_MSG_RESULT([$LIBICONV])
624   else
625     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
626     dnl either.
627     CPPFLAGS="$am_save_CPPFLAGS"
628     LIBICONV=
629     LTLIBICONV=
630   fi
631   AC_SUBST(LIBICONV)
632   AC_SUBST(LTLIBICONV)
633 ])
634
635 AC_DEFUN([AM_ICONV],
636 [
637   AM_ICONV_LINK
638   if test "$am_cv_func_iconv" = yes; then
639     AC_MSG_CHECKING([for iconv declaration])
640     AC_CACHE_VAL(am_cv_proto_iconv, [
641       AC_TRY_COMPILE([
642 #include <stdlib.h>
643 #include <iconv.h>
644 extern
645 #ifdef __cplusplus
646 "C"
647 #endif
648 #if defined(__STDC__) || defined(__cplusplus)
649 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
650 #else
651 size_t iconv();
652 #endif
653 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
654       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
655     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
656     AC_MSG_RESULT([$]{ac_t:-
657          }[$]am_cv_proto_iconv)
658     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
659       [Define as const if the declaration of iconv() needs const.])
660   fi
661 ])
662
663 # intdiv0.m4 serial 1 (gettext-0.11.3)
664 dnl Copyright (C) 2002 Free Software Foundation, Inc.
665 dnl This file is free software, distributed under the terms of the GNU
666 dnl General Public License.  As a special exception to the GNU General
667 dnl Public License, this file may be distributed as part of a program
668 dnl that contains a configuration script generated by Autoconf, under
669 dnl the same distribution terms as the rest of that program.
670
671 dnl From Bruno Haible.
672
673 AC_DEFUN([gt_INTDIV0],
674 [
675   AC_REQUIRE([AC_PROG_CC])dnl
676   AC_REQUIRE([AC_CANONICAL_HOST])dnl
677
678   AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
679     gt_cv_int_divbyzero_sigfpe,
680     [
681       AC_TRY_RUN([
682 #include <stdlib.h>
683 #include <signal.h>
684
685 static void
686 #ifdef __cplusplus
687 sigfpe_handler (int sig)
688 #else
689 sigfpe_handler (sig) int sig;
690 #endif
691 {
692   /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
693   exit (sig != SIGFPE);
694 }
695
696 int x = 1;
697 int y = 0;
698 int z;
699 int nan;
700
701 int main ()
702 {
703   signal (SIGFPE, sigfpe_handler);
704 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
705 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
706   signal (SIGTRAP, sigfpe_handler);
707 #endif
708 /* Linux/SPARC yields signal SIGILL.  */
709 #if defined (__sparc__) && defined (__linux__)
710   signal (SIGILL, sigfpe_handler);
711 #endif
712
713   z = x / y;
714   nan = y / y;
715   exit (1);
716 }
717 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
718         [
719           # Guess based on the CPU.
720           case "$host_cpu" in
721             alpha* | i[34567]86 | m68k | s390*)
722               gt_cv_int_divbyzero_sigfpe="guessing yes";;
723             *)
724               gt_cv_int_divbyzero_sigfpe="guessing no";;
725           esac
726         ])
727     ])
728   case "$gt_cv_int_divbyzero_sigfpe" in
729     *yes) value=1;;
730     *) value=0;;
731   esac
732   AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
733     [Define if integer division by zero raises signal SIGFPE.])
734 ])
735
736 # intmax.m4 serial 1 (gettext-0.12)
737 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
738 dnl This file is free software, distributed under the terms of the GNU
739 dnl General Public License.  As a special exception to the GNU General
740 dnl Public License, this file may be distributed as part of a program
741 dnl that contains a configuration script generated by Autoconf, under
742 dnl the same distribution terms as the rest of that program.
743
744 dnl From Bruno Haible.
745 dnl Test whether the system has the 'intmax_t' type, but don't attempt to
746 dnl find a replacement if it is lacking.
747
748 AC_DEFUN([gt_TYPE_INTMAX_T],
749 [
750   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
751   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
752   AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
753     [AC_TRY_COMPILE([
754 #include <stddef.h> 
755 #include <stdlib.h>
756 #if HAVE_STDINT_H_WITH_UINTMAX
757 #include <stdint.h>
758 #endif
759 #if HAVE_INTTYPES_H_WITH_UINTMAX
760 #include <inttypes.h>
761 #endif
762 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
763   if test $gt_cv_c_intmax_t = yes; then
764     AC_DEFINE(HAVE_INTMAX_T, 1,
765       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
766   fi
767 ])
768
769 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
770 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
771 dnl This file is free software, distributed under the terms of the GNU
772 dnl General Public License.  As a special exception to the GNU General
773 dnl Public License, this file may be distributed as part of a program
774 dnl that contains a configuration script generated by Autoconf, under
775 dnl the same distribution terms as the rest of that program.
776
777 dnl From Bruno Haible.
778
779 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
780 # macros to non-string values.  This is the case on AIX 4.3.3.
781
782 AC_DEFUN([gt_INTTYPES_PRI],
783 [
784   AC_REQUIRE([gt_HEADER_INTTYPES_H])
785   if test $gt_cv_header_inttypes_h = yes; then
786     AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
787       gt_cv_inttypes_pri_broken,
788       [
789         AC_TRY_COMPILE([#include <inttypes.h>
790 #ifdef PRId32
791 char *p = PRId32;
792 #endif
793 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
794       ])
795   fi
796   if test "$gt_cv_inttypes_pri_broken" = yes; then
797     AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
798       [Define if <inttypes.h> exists and defines unusable PRI* macros.])
799   fi
800 ])
801
802 # inttypes.m4 serial 1 (gettext-0.11.4)
803 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
804 dnl This file is free software, distributed under the terms of the GNU
805 dnl General Public License.  As a special exception to the GNU General
806 dnl Public License, this file may be distributed as part of a program
807 dnl that contains a configuration script generated by Autoconf, under
808 dnl the same distribution terms as the rest of that program.
809
810 dnl From Paul Eggert.
811
812 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
813 # <sys/types.h>.
814
815 AC_DEFUN([gt_HEADER_INTTYPES_H],
816 [
817   AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
818   [
819     AC_TRY_COMPILE(
820       [#include <sys/types.h>
821 #include <inttypes.h>],
822       [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
823   ])
824   if test $gt_cv_header_inttypes_h = yes; then
825     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
826       [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
827   fi
828 ])
829
830 # inttypes_h.m4 serial 5 (gettext-0.12)
831 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
832 dnl This file is free software, distributed under the terms of the GNU
833 dnl General Public License.  As a special exception to the GNU General
834 dnl Public License, this file may be distributed as part of a program
835 dnl that contains a configuration script generated by Autoconf, under
836 dnl the same distribution terms as the rest of that program.
837
838 dnl From Paul Eggert.
839
840 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
841 # doesn't clash with <sys/types.h>, and declares uintmax_t.
842
843 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
844 [
845   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
846   [AC_TRY_COMPILE(
847     [#include <sys/types.h>
848 #include <inttypes.h>],
849     [uintmax_t i = (uintmax_t) -1;],
850     jm_ac_cv_header_inttypes_h=yes,
851     jm_ac_cv_header_inttypes_h=no)])
852   if test $jm_ac_cv_header_inttypes_h = yes; then
853     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
854       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
855        and declares uintmax_t. ])
856   fi
857 ])
858
859 # lcmessage.m4 serial 3 (gettext-0.11.3)
860 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
861 dnl This file is free software, distributed under the terms of the GNU
862 dnl General Public License.  As a special exception to the GNU General
863 dnl Public License, this file may be distributed as part of a program
864 dnl that contains a configuration script generated by Autoconf, under
865 dnl the same distribution terms as the rest of that program.
866 dnl
867 dnl This file can can be used in projects which are not available under
868 dnl the GNU General Public License or the GNU Library General Public
869 dnl License but which still want to provide support for the GNU gettext
870 dnl functionality.
871 dnl Please note that the actual code of the GNU gettext library is covered
872 dnl by the GNU Library General Public License, and the rest of the GNU
873 dnl gettext package package is covered by the GNU General Public License.
874 dnl They are *not* in the public domain.
875
876 dnl Authors:
877 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
878
879 # Check whether LC_MESSAGES is available in <locale.h>.
880
881 AC_DEFUN([AM_LC_MESSAGES],
882 [
883   AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
884     [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
885        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
886   if test $am_cv_val_LC_MESSAGES = yes; then
887     AC_DEFINE(HAVE_LC_MESSAGES, 1,
888       [Define if your <locale.h> file defines LC_MESSAGES.])
889   fi
890 ])
891
892 # lib-ld.m4 serial 3 (gettext-0.13)
893 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
894 dnl This file is free software, distributed under the terms of the GNU
895 dnl General Public License.  As a special exception to the GNU General
896 dnl Public License, this file may be distributed as part of a program
897 dnl that contains a configuration script generated by Autoconf, under
898 dnl the same distribution terms as the rest of that program.
899
900 dnl Subroutines of libtool.m4,
901 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
902 dnl with libtool.m4.
903
904 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
905 AC_DEFUN([AC_LIB_PROG_LD_GNU],
906 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
907 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
908 case `$LD -v 2>&1 </dev/null` in
909 *GNU* | *'with BFD'*)
910   acl_cv_prog_gnu_ld=yes ;;
911 *)
912   acl_cv_prog_gnu_ld=no ;;
913 esac])
914 with_gnu_ld=$acl_cv_prog_gnu_ld
915 ])
916
917 dnl From libtool-1.4. Sets the variable LD.
918 AC_DEFUN([AC_LIB_PROG_LD],
919 [AC_ARG_WITH(gnu-ld,
920 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
921 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
922 AC_REQUIRE([AC_PROG_CC])dnl
923 AC_REQUIRE([AC_CANONICAL_HOST])dnl
924 # Prepare PATH_SEPARATOR.
925 # The user is always right.
926 if test "${PATH_SEPARATOR+set}" != set; then
927   echo "#! /bin/sh" >conf$$.sh
928   echo  "exit 0"   >>conf$$.sh
929   chmod +x conf$$.sh
930   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
931     PATH_SEPARATOR=';'
932   else
933     PATH_SEPARATOR=:
934   fi
935   rm -f conf$$.sh
936 fi
937 ac_prog=ld
938 if test "$GCC" = yes; then
939   # Check if gcc -print-prog-name=ld gives a path.
940   AC_MSG_CHECKING([for ld used by GCC])
941   case $host in
942   *-*-mingw*)
943     # gcc leaves a trailing carriage return which upsets mingw
944     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
945   *)
946     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
947   esac
948   case $ac_prog in
949     # Accept absolute paths.
950     [[\\/]* | [A-Za-z]:[\\/]*)]
951       [re_direlt='/[^/][^/]*/\.\./']
952       # Canonicalize the path of ld
953       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
954       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
955         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
956       done
957       test -z "$LD" && LD="$ac_prog"
958       ;;
959   "")
960     # If it fails, then pretend we aren't using GCC.
961     ac_prog=ld
962     ;;
963   *)
964     # If it is relative, then search for the first ld in PATH.
965     with_gnu_ld=unknown
966     ;;
967   esac
968 elif test "$with_gnu_ld" = yes; then
969   AC_MSG_CHECKING([for GNU ld])
970 else
971   AC_MSG_CHECKING([for non-GNU ld])
972 fi
973 AC_CACHE_VAL(acl_cv_path_LD,
974 [if test -z "$LD"; then
975   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
976   for ac_dir in $PATH; do
977     test -z "$ac_dir" && ac_dir=.
978     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
979       acl_cv_path_LD="$ac_dir/$ac_prog"
980       # Check to see if the program is GNU ld.  I'd rather use --version,
981       # but apparently some GNU ld's only accept -v.
982       # Break only if it was the GNU/non-GNU ld that we prefer.
983       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
984       *GNU* | *'with BFD'*)
985         test "$with_gnu_ld" != no && break ;;
986       *)
987         test "$with_gnu_ld" != yes && break ;;
988       esac
989     fi
990   done
991   IFS="$ac_save_ifs"
992 else
993   acl_cv_path_LD="$LD" # Let the user override the test with a path.
994 fi])
995 LD="$acl_cv_path_LD"
996 if test -n "$LD"; then
997   AC_MSG_RESULT($LD)
998 else
999   AC_MSG_RESULT(no)
1000 fi
1001 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1002 AC_LIB_PROG_LD_GNU
1003 ])
1004
1005 # lib-link.m4 serial 4 (gettext-0.12)
1006 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1007 dnl This file is free software, distributed under the terms of the GNU
1008 dnl General Public License.  As a special exception to the GNU General
1009 dnl Public License, this file may be distributed as part of a program
1010 dnl that contains a configuration script generated by Autoconf, under
1011 dnl the same distribution terms as the rest of that program.
1012
1013 dnl From Bruno Haible.
1014
1015 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1016 dnl the libraries corresponding to explicit and implicit dependencies.
1017 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1018 dnl augments the CPPFLAGS variable.
1019 AC_DEFUN([AC_LIB_LINKFLAGS],
1020 [
1021   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1022   AC_REQUIRE([AC_LIB_RPATH])
1023   define([Name],[translit([$1],[./-], [___])])
1024   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1025                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1026   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1027     AC_LIB_LINKFLAGS_BODY([$1], [$2])
1028     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1029     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1030     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1031   ])
1032   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1033   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1034   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1035   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1036   AC_SUBST([LIB]NAME)
1037   AC_SUBST([LTLIB]NAME)
1038   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1039   dnl results of this search when this library appears as a dependency.
1040   HAVE_LIB[]NAME=yes
1041   undefine([Name])
1042   undefine([NAME])
1043 ])
1044
1045 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1046 dnl searches for libname and the libraries corresponding to explicit and
1047 dnl implicit dependencies, together with the specified include files and
1048 dnl the ability to compile and link the specified testcode. If found, it
1049 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1050 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1051 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1052 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1053 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1054 [
1055   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1056   AC_REQUIRE([AC_LIB_RPATH])
1057   define([Name],[translit([$1],[./-], [___])])
1058   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1059                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1060
1061   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1062   dnl accordingly.
1063   AC_LIB_LINKFLAGS_BODY([$1], [$2])
1064
1065   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1066   dnl because if the user has installed lib[]Name and not disabled its use
1067   dnl via --without-lib[]Name-prefix, he wants to use it.
1068   ac_save_CPPFLAGS="$CPPFLAGS"
1069   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1070
1071   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1072     ac_save_LIBS="$LIBS"
1073     LIBS="$LIBS $LIB[]NAME"
1074     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1075     LIBS="$ac_save_LIBS"
1076   ])
1077   if test "$ac_cv_lib[]Name" = yes; then
1078     HAVE_LIB[]NAME=yes
1079     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1080     AC_MSG_CHECKING([how to link with lib[]$1])
1081     AC_MSG_RESULT([$LIB[]NAME])
1082   else
1083     HAVE_LIB[]NAME=no
1084     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1085     dnl $INC[]NAME either.
1086     CPPFLAGS="$ac_save_CPPFLAGS"
1087     LIB[]NAME=
1088     LTLIB[]NAME=
1089   fi
1090   AC_SUBST([HAVE_LIB]NAME)
1091   AC_SUBST([LIB]NAME)
1092   AC_SUBST([LTLIB]NAME)
1093   undefine([Name])
1094   undefine([NAME])
1095 ])
1096
1097 dnl Determine the platform dependent parameters needed to use rpath:
1098 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1099 dnl hardcode_direct, hardcode_minus_L.
1100 AC_DEFUN([AC_LIB_RPATH],
1101 [
1102   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1103   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1104   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1105   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1106   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1107     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1108     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1109     . ./conftest.sh
1110     rm -f ./conftest.sh
1111     acl_cv_rpath=done
1112   ])
1113   wl="$acl_cv_wl"
1114   libext="$acl_cv_libext"
1115   shlibext="$acl_cv_shlibext"
1116   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1117   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1118   hardcode_direct="$acl_cv_hardcode_direct"
1119   hardcode_minus_L="$acl_cv_hardcode_minus_L"
1120   dnl Determine whether the user wants rpath handling at all.
1121   AC_ARG_ENABLE(rpath,
1122     [  --disable-rpath         do not hardcode runtime library paths],
1123     :, enable_rpath=yes)
1124 ])
1125
1126 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1127 dnl the libraries corresponding to explicit and implicit dependencies.
1128 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1129 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1130 [
1131   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1132                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1133   dnl By default, look in $includedir and $libdir.
1134   use_additional=yes
1135   AC_LIB_WITH_FINAL_PREFIX([
1136     eval additional_includedir=\"$includedir\"
1137     eval additional_libdir=\"$libdir\"
1138   ])
1139   AC_LIB_ARG_WITH([lib$1-prefix],
1140 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1141   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1142 [
1143     if test "X$withval" = "Xno"; then
1144       use_additional=no
1145     else
1146       if test "X$withval" = "X"; then
1147         AC_LIB_WITH_FINAL_PREFIX([
1148           eval additional_includedir=\"$includedir\"
1149           eval additional_libdir=\"$libdir\"
1150         ])
1151       else
1152         additional_includedir="$withval/include"
1153         additional_libdir="$withval/lib"
1154       fi
1155     fi
1156 ])
1157   dnl Search the library and its dependencies in $additional_libdir and
1158   dnl $LDFLAGS. Using breadth-first-seach.
1159   LIB[]NAME=
1160   LTLIB[]NAME=
1161   INC[]NAME=
1162   rpathdirs=
1163   ltrpathdirs=
1164   names_already_handled=
1165   names_next_round='$1 $2'
1166   while test -n "$names_next_round"; do
1167     names_this_round="$names_next_round"
1168     names_next_round=
1169     for name in $names_this_round; do
1170       already_handled=
1171       for n in $names_already_handled; do
1172         if test "$n" = "$name"; then
1173           already_handled=yes
1174           break
1175         fi
1176       done
1177       if test -z "$already_handled"; then
1178         names_already_handled="$names_already_handled $name"
1179         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1180         dnl or AC_LIB_HAVE_LINKFLAGS call.
1181         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1182         eval value=\"\$HAVE_LIB$uppername\"
1183         if test -n "$value"; then
1184           if test "$value" = yes; then
1185             eval value=\"\$LIB$uppername\"
1186             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1187             eval value=\"\$LTLIB$uppername\"
1188             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1189           else
1190             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1191             dnl that this library doesn't exist. So just drop it.
1192             :
1193           fi
1194         else
1195           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1196           dnl and the already constructed $LIBNAME/$LTLIBNAME.
1197           found_dir=
1198           found_la=
1199           found_so=
1200           found_a=
1201           if test $use_additional = yes; then
1202             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1203               found_dir="$additional_libdir"
1204               found_so="$additional_libdir/lib$name.$shlibext"
1205               if test -f "$additional_libdir/lib$name.la"; then
1206                 found_la="$additional_libdir/lib$name.la"
1207               fi
1208             else
1209               if test -f "$additional_libdir/lib$name.$libext"; then
1210                 found_dir="$additional_libdir"
1211                 found_a="$additional_libdir/lib$name.$libext"
1212                 if test -f "$additional_libdir/lib$name.la"; then
1213                   found_la="$additional_libdir/lib$name.la"
1214                 fi
1215               fi
1216             fi
1217           fi
1218           if test "X$found_dir" = "X"; then
1219             for x in $LDFLAGS $LTLIB[]NAME; do
1220               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1221               case "$x" in
1222                 -L*)
1223                   dir=`echo "X$x" | sed -e 's/^X-L//'`
1224                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1225                     found_dir="$dir"
1226                     found_so="$dir/lib$name.$shlibext"
1227                     if test -f "$dir/lib$name.la"; then
1228                       found_la="$dir/lib$name.la"
1229                     fi
1230                   else
1231                     if test -f "$dir/lib$name.$libext"; then
1232                       found_dir="$dir"
1233                       found_a="$dir/lib$name.$libext"
1234                       if test -f "$dir/lib$name.la"; then
1235                         found_la="$dir/lib$name.la"
1236                       fi
1237                     fi
1238                   fi
1239                   ;;
1240               esac
1241               if test "X$found_dir" != "X"; then
1242                 break
1243               fi
1244             done
1245           fi
1246           if test "X$found_dir" != "X"; then
1247             dnl Found the library.
1248             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1249             if test "X$found_so" != "X"; then
1250               dnl Linking with a shared library. We attempt to hardcode its
1251               dnl directory into the executable's runpath, unless it's the
1252               dnl standard /usr/lib.
1253               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1254                 dnl No hardcoding is needed.
1255                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1256               else
1257                 dnl Use an explicit option to hardcode DIR into the resulting
1258                 dnl binary.
1259                 dnl Potentially add DIR to ltrpathdirs.
1260                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1261                 haveit=
1262                 for x in $ltrpathdirs; do
1263                   if test "X$x" = "X$found_dir"; then
1264                     haveit=yes
1265                     break
1266                   fi
1267                 done
1268                 if test -z "$haveit"; then
1269                   ltrpathdirs="$ltrpathdirs $found_dir"
1270                 fi
1271                 dnl The hardcoding into $LIBNAME is system dependent.
1272                 if test "$hardcode_direct" = yes; then
1273                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1274                   dnl resulting binary.
1275                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1276                 else
1277                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1278                     dnl Use an explicit option to hardcode DIR into the resulting
1279                     dnl binary.
1280                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1281                     dnl Potentially add DIR to rpathdirs.
1282                     dnl The rpathdirs will be appended to $LIBNAME at the end.
1283                     haveit=
1284                     for x in $rpathdirs; do
1285                       if test "X$x" = "X$found_dir"; then
1286                         haveit=yes
1287                         break
1288                       fi
1289                     done
1290                     if test -z "$haveit"; then
1291                       rpathdirs="$rpathdirs $found_dir"
1292                     fi
1293                   else
1294                     dnl Rely on "-L$found_dir".
1295                     dnl But don't add it if it's already contained in the LDFLAGS
1296                     dnl or the already constructed $LIBNAME
1297                     haveit=
1298                     for x in $LDFLAGS $LIB[]NAME; do
1299                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1300                       if test "X$x" = "X-L$found_dir"; then
1301                         haveit=yes
1302                         break
1303                       fi
1304                     done
1305                     if test -z "$haveit"; then
1306                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1307                     fi
1308                     if test "$hardcode_minus_L" != no; then
1309                       dnl FIXME: Not sure whether we should use
1310                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1311                       dnl here.
1312                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1313                     else
1314                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1315                       dnl here, because this doesn't fit in flags passed to the
1316                       dnl compiler. So give up. No hardcoding. This affects only
1317                       dnl very old systems.
1318                       dnl FIXME: Not sure whether we should use
1319                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1320                       dnl here.
1321                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1322                     fi
1323                   fi
1324                 fi
1325               fi
1326             else
1327               if test "X$found_a" != "X"; then
1328                 dnl Linking with a static library.
1329                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1330               else
1331                 dnl We shouldn't come here, but anyway it's good to have a
1332                 dnl fallback.
1333                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1334               fi
1335             fi
1336             dnl Assume the include files are nearby.
1337             additional_includedir=
1338             case "$found_dir" in
1339               */lib | */lib/)
1340                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1341                 additional_includedir="$basedir/include"
1342                 ;;
1343             esac
1344             if test "X$additional_includedir" != "X"; then
1345               dnl Potentially add $additional_includedir to $INCNAME.
1346               dnl But don't add it
1347               dnl   1. if it's the standard /usr/include,
1348               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1349               dnl   3. if it's already present in $CPPFLAGS or the already
1350               dnl      constructed $INCNAME,
1351               dnl   4. if it doesn't exist as a directory.
1352               if test "X$additional_includedir" != "X/usr/include"; then
1353                 haveit=
1354                 if test "X$additional_includedir" = "X/usr/local/include"; then
1355                   if test -n "$GCC"; then
1356                     case $host_os in
1357                       linux*) haveit=yes;;
1358                     esac
1359                   fi
1360                 fi
1361                 if test -z "$haveit"; then
1362                   for x in $CPPFLAGS $INC[]NAME; do
1363                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1364                     if test "X$x" = "X-I$additional_includedir"; then
1365                       haveit=yes
1366                       break
1367                     fi
1368                   done
1369                   if test -z "$haveit"; then
1370                     if test -d "$additional_includedir"; then
1371                       dnl Really add $additional_includedir to $INCNAME.
1372                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1373                     fi
1374                   fi
1375                 fi
1376               fi
1377             fi
1378             dnl Look for dependencies.
1379             if test -n "$found_la"; then
1380               dnl Read the .la file. It defines the variables
1381               dnl dlname, library_names, old_library, dependency_libs, current,
1382               dnl age, revision, installed, dlopen, dlpreopen, libdir.
1383               save_libdir="$libdir"
1384               case "$found_la" in
1385                 */* | *\\*) . "$found_la" ;;
1386                 *) . "./$found_la" ;;
1387               esac
1388               libdir="$save_libdir"
1389               dnl We use only dependency_libs.
1390               for dep in $dependency_libs; do
1391                 case "$dep" in
1392                   -L*)
1393                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1394                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1395                     dnl But don't add it
1396                     dnl   1. if it's the standard /usr/lib,
1397                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1398                     dnl   3. if it's already present in $LDFLAGS or the already
1399                     dnl      constructed $LIBNAME,
1400                     dnl   4. if it doesn't exist as a directory.
1401                     if test "X$additional_libdir" != "X/usr/lib"; then
1402                       haveit=
1403                       if test "X$additional_libdir" = "X/usr/local/lib"; then
1404                         if test -n "$GCC"; then
1405                           case $host_os in
1406                             linux*) haveit=yes;;
1407                           esac
1408                         fi
1409                       fi
1410                       if test -z "$haveit"; then
1411                         haveit=
1412                         for x in $LDFLAGS $LIB[]NAME; do
1413                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1414                           if test "X$x" = "X-L$additional_libdir"; then
1415                             haveit=yes
1416                             break
1417                           fi
1418                         done
1419                         if test -z "$haveit"; then
1420                           if test -d "$additional_libdir"; then
1421                             dnl Really add $additional_libdir to $LIBNAME.
1422                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1423                           fi
1424                         fi
1425                         haveit=
1426                         for x in $LDFLAGS $LTLIB[]NAME; do
1427                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1428                           if test "X$x" = "X-L$additional_libdir"; then
1429                             haveit=yes
1430                             break
1431                           fi
1432                         done
1433                         if test -z "$haveit"; then
1434                           if test -d "$additional_libdir"; then
1435                             dnl Really add $additional_libdir to $LTLIBNAME.
1436                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1437                           fi
1438                         fi
1439                       fi
1440                     fi
1441                     ;;
1442                   -R*)
1443                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
1444                     if test "$enable_rpath" != no; then
1445                       dnl Potentially add DIR to rpathdirs.
1446                       dnl The rpathdirs will be appended to $LIBNAME at the end.
1447                       haveit=
1448                       for x in $rpathdirs; do
1449                         if test "X$x" = "X$dir"; then
1450                           haveit=yes
1451                           break
1452                         fi
1453                       done
1454                       if test -z "$haveit"; then
1455                         rpathdirs="$rpathdirs $dir"
1456                       fi
1457                       dnl Potentially add DIR to ltrpathdirs.
1458                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1459                       haveit=
1460                       for x in $ltrpathdirs; do
1461                         if test "X$x" = "X$dir"; then
1462                           haveit=yes
1463                           break
1464                         fi
1465                       done
1466                       if test -z "$haveit"; then
1467                         ltrpathdirs="$ltrpathdirs $dir"
1468                       fi
1469                     fi
1470                     ;;
1471                   -l*)
1472                     dnl Handle this in the next round.
1473                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1474                     ;;
1475                   *.la)
1476                     dnl Handle this in the next round. Throw away the .la's
1477                     dnl directory; it is already contained in a preceding -L
1478                     dnl option.
1479                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1480                     ;;
1481                   *)
1482                     dnl Most likely an immediate library name.
1483                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1484                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1485                     ;;
1486                 esac
1487               done
1488             fi
1489           else
1490             dnl Didn't find the library; assume it is in the system directories
1491             dnl known to the linker and runtime loader. (All the system
1492             dnl directories known to the linker should also be known to the
1493             dnl runtime loader, otherwise the system is severely misconfigured.)
1494             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1495             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1496           fi
1497         fi
1498       fi
1499     done
1500   done
1501   if test "X$rpathdirs" != "X"; then
1502     if test -n "$hardcode_libdir_separator"; then
1503       dnl Weird platform: only the last -rpath option counts, the user must
1504       dnl pass all path elements in one option. We can arrange that for a
1505       dnl single library, but not when more than one $LIBNAMEs are used.
1506       alldirs=
1507       for found_dir in $rpathdirs; do
1508         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1509       done
1510       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1511       acl_save_libdir="$libdir"
1512       libdir="$alldirs"
1513       eval flag=\"$hardcode_libdir_flag_spec\"
1514       libdir="$acl_save_libdir"
1515       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1516     else
1517       dnl The -rpath options are cumulative.
1518       for found_dir in $rpathdirs; do
1519         acl_save_libdir="$libdir"
1520         libdir="$found_dir"
1521         eval flag=\"$hardcode_libdir_flag_spec\"
1522         libdir="$acl_save_libdir"
1523         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1524       done
1525     fi
1526   fi
1527   if test "X$ltrpathdirs" != "X"; then
1528     dnl When using libtool, the option that works for both libraries and
1529     dnl executables is -R. The -R options are cumulative.
1530     for found_dir in $ltrpathdirs; do
1531       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1532     done
1533   fi
1534 ])
1535
1536 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1537 dnl unless already present in VAR.
1538 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1539 dnl contains two or three consecutive elements that belong together.
1540 AC_DEFUN([AC_LIB_APPENDTOVAR],
1541 [
1542   for element in [$2]; do
1543     haveit=
1544     for x in $[$1]; do
1545       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1546       if test "X$x" = "X$element"; then
1547         haveit=yes
1548         break
1549       fi
1550     done
1551     if test -z "$haveit"; then
1552       [$1]="${[$1]}${[$1]:+ }$element"
1553     fi
1554   done
1555 ])
1556
1557 # lib-prefix.m4 serial 3 (gettext-0.13)
1558 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1559 dnl This file is free software, distributed under the terms of the GNU
1560 dnl General Public License.  As a special exception to the GNU General
1561 dnl Public License, this file may be distributed as part of a program
1562 dnl that contains a configuration script generated by Autoconf, under
1563 dnl the same distribution terms as the rest of that program.
1564
1565 dnl From Bruno Haible.
1566
1567 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1568 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1569 dnl require excessive bracketing.
1570 ifdef([AC_HELP_STRING],
1571 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1572 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1573
1574 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1575 dnl to access previously installed libraries. The basic assumption is that
1576 dnl a user will want packages to use other packages he previously installed
1577 dnl with the same --prefix option.
1578 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1579 dnl libraries, but is otherwise very convenient.
1580 AC_DEFUN([AC_LIB_PREFIX],
1581 [
1582   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1583   AC_REQUIRE([AC_PROG_CC])
1584   AC_REQUIRE([AC_CANONICAL_HOST])
1585   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1586   dnl By default, look in $includedir and $libdir.
1587   use_additional=yes
1588   AC_LIB_WITH_FINAL_PREFIX([
1589     eval additional_includedir=\"$includedir\"
1590     eval additional_libdir=\"$libdir\"
1591   ])
1592   AC_LIB_ARG_WITH([lib-prefix],
1593 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1594   --without-lib-prefix    don't search for libraries in includedir and libdir],
1595 [
1596     if test "X$withval" = "Xno"; then
1597       use_additional=no
1598     else
1599       if test "X$withval" = "X"; then
1600         AC_LIB_WITH_FINAL_PREFIX([
1601           eval additional_includedir=\"$includedir\"
1602           eval additional_libdir=\"$libdir\"
1603         ])
1604       else
1605         additional_includedir="$withval/include"
1606         additional_libdir="$withval/lib"
1607       fi
1608     fi
1609 ])
1610   if test $use_additional = yes; then
1611     dnl Potentially add $additional_includedir to $CPPFLAGS.
1612     dnl But don't add it
1613     dnl   1. if it's the standard /usr/include,
1614     dnl   2. if it's already present in $CPPFLAGS,
1615     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1616     dnl   4. if it doesn't exist as a directory.
1617     if test "X$additional_includedir" != "X/usr/include"; then
1618       haveit=
1619       for x in $CPPFLAGS; do
1620         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1621         if test "X$x" = "X-I$additional_includedir"; then
1622           haveit=yes
1623           break
1624         fi
1625       done
1626       if test -z "$haveit"; then
1627         if test "X$additional_includedir" = "X/usr/local/include"; then
1628           if test -n "$GCC"; then
1629             case $host_os in
1630               linux*) haveit=yes;;
1631             esac
1632           fi
1633         fi
1634         if test -z "$haveit"; then
1635           if test -d "$additional_includedir"; then
1636             dnl Really add $additional_includedir to $CPPFLAGS.
1637             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1638           fi
1639         fi
1640       fi
1641     fi
1642     dnl Potentially add $additional_libdir to $LDFLAGS.
1643     dnl But don't add it
1644     dnl   1. if it's the standard /usr/lib,
1645     dnl   2. if it's already present in $LDFLAGS,
1646     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1647     dnl   4. if it doesn't exist as a directory.
1648     if test "X$additional_libdir" != "X/usr/lib"; then
1649       haveit=
1650       for x in $LDFLAGS; do
1651         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1652         if test "X$x" = "X-L$additional_libdir"; then
1653           haveit=yes
1654           break
1655         fi
1656       done
1657       if test -z "$haveit"; then
1658         if test "X$additional_libdir" = "X/usr/local/lib"; then
1659           if test -n "$GCC"; then
1660             case $host_os in
1661               linux*) haveit=yes;;
1662             esac
1663           fi
1664         fi
1665         if test -z "$haveit"; then
1666           if test -d "$additional_libdir"; then
1667             dnl Really add $additional_libdir to $LDFLAGS.
1668             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1669           fi
1670         fi
1671       fi
1672     fi
1673   fi
1674 ])
1675
1676 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1677 dnl acl_final_exec_prefix, containing the values to which $prefix and
1678 dnl $exec_prefix will expand at the end of the configure script.
1679 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1680 [
1681   dnl Unfortunately, prefix and exec_prefix get only finally determined
1682   dnl at the end of configure.
1683   if test "X$prefix" = "XNONE"; then
1684     acl_final_prefix="$ac_default_prefix"
1685   else
1686     acl_final_prefix="$prefix"
1687   fi
1688   if test "X$exec_prefix" = "XNONE"; then
1689     acl_final_exec_prefix='${prefix}'
1690   else
1691     acl_final_exec_prefix="$exec_prefix"
1692   fi
1693   acl_save_prefix="$prefix"
1694   prefix="$acl_final_prefix"
1695   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1696   prefix="$acl_save_prefix"
1697 ])
1698
1699 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1700 dnl variables prefix and exec_prefix bound to the values they will have
1701 dnl at the end of the configure script.
1702 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1703 [
1704   acl_save_prefix="$prefix"
1705   prefix="$acl_final_prefix"
1706   acl_save_exec_prefix="$exec_prefix"
1707   exec_prefix="$acl_final_exec_prefix"
1708   $1
1709   exec_prefix="$acl_save_exec_prefix"
1710   prefix="$acl_save_prefix"
1711 ])
1712
1713 # longdouble.m4 serial 1 (gettext-0.12)
1714 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
1715 dnl This file is free software, distributed under the terms of the GNU
1716 dnl General Public License.  As a special exception to the GNU General
1717 dnl Public License, this file may be distributed as part of a program
1718 dnl that contains a configuration script generated by Autoconf, under
1719 dnl the same distribution terms as the rest of that program.
1720
1721 dnl From Bruno Haible.
1722 dnl Test whether the compiler supports the 'long double' type.
1723 dnl Prerequisite: AC_PROG_CC
1724
1725 AC_DEFUN([gt_TYPE_LONGDOUBLE],
1726 [
1727   AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
1728     [if test "$GCC" = yes; then
1729        gt_cv_c_long_double=yes
1730      else
1731        AC_TRY_COMPILE([
1732          /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
1733          long double foo = 0.0;
1734          /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
1735          int array [2*(sizeof(long double) >= sizeof(double)) - 1];
1736          ], ,
1737          gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
1738      fi])
1739   if test $gt_cv_c_long_double = yes; then
1740     AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
1741   fi
1742 ])
1743
1744 # longlong.m4 serial 4
1745 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
1746 dnl This file is free software, distributed under the terms of the GNU
1747 dnl General Public License.  As a special exception to the GNU General
1748 dnl Public License, this file may be distributed as part of a program
1749 dnl that contains a configuration script generated by Autoconf, under
1750 dnl the same distribution terms as the rest of that program.
1751
1752 dnl From Paul Eggert.
1753
1754 # Define HAVE_LONG_LONG if 'long long' works.
1755
1756 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
1757 [
1758   AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
1759   [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
1760     [long long llmax = (long long) -1;
1761      return ll << i | ll >> i | llmax / ll | llmax % ll;],
1762     ac_cv_type_long_long=yes,
1763     ac_cv_type_long_long=no)])
1764   if test $ac_cv_type_long_long = yes; then
1765     AC_DEFINE(HAVE_LONG_LONG, 1,
1766       [Define if you have the 'long long' type.])
1767   fi
1768 ])
1769
1770 # nls.m4 serial 1 (gettext-0.12)
1771 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1772 dnl This file is free software, distributed under the terms of the GNU
1773 dnl General Public License.  As a special exception to the GNU General
1774 dnl Public License, this file may be distributed as part of a program
1775 dnl that contains a configuration script generated by Autoconf, under
1776 dnl the same distribution terms as the rest of that program.
1777 dnl
1778 dnl This file can can be used in projects which are not available under
1779 dnl the GNU General Public License or the GNU Library General Public
1780 dnl License but which still want to provide support for the GNU gettext
1781 dnl functionality.
1782 dnl Please note that the actual code of the GNU gettext library is covered
1783 dnl by the GNU Library General Public License, and the rest of the GNU
1784 dnl gettext package package is covered by the GNU General Public License.
1785 dnl They are *not* in the public domain.
1786
1787 dnl Authors:
1788 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1789 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1790
1791 AC_DEFUN([AM_NLS],
1792 [
1793   AC_MSG_CHECKING([whether NLS is requested])
1794   dnl Default is enabled NLS
1795   AC_ARG_ENABLE(nls,
1796     [  --disable-nls           do not use Native Language Support],
1797     USE_NLS=$enableval, USE_NLS=yes)
1798   AC_MSG_RESULT($USE_NLS)
1799   AC_SUBST(USE_NLS)
1800 ])
1801
1802 AC_DEFUN([AM_MKINSTALLDIRS],
1803 [
1804   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1805   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1806   dnl Try to locate it.
1807   MKINSTALLDIRS=
1808   if test -n "$ac_aux_dir"; then
1809     case "$ac_aux_dir" in
1810       /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1811       *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1812     esac
1813   fi
1814   if test -z "$MKINSTALLDIRS"; then
1815     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1816   fi
1817   AC_SUBST(MKINSTALLDIRS)
1818 ])
1819
1820 # po.m4 serial 3 (gettext-0.14)
1821 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1822 dnl This file is free software, distributed under the terms of the GNU
1823 dnl General Public License.  As a special exception to the GNU General
1824 dnl Public License, this file may be distributed as part of a program
1825 dnl that contains a configuration script generated by Autoconf, under
1826 dnl the same distribution terms as the rest of that program.
1827 dnl
1828 dnl This file can can be used in projects which are not available under
1829 dnl the GNU General Public License or the GNU Library General Public
1830 dnl License but which still want to provide support for the GNU gettext
1831 dnl functionality.
1832 dnl Please note that the actual code of the GNU gettext library is covered
1833 dnl by the GNU Library General Public License, and the rest of the GNU
1834 dnl gettext package package is covered by the GNU General Public License.
1835 dnl They are *not* in the public domain.
1836
1837 dnl Authors:
1838 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1839 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1840
1841 dnl Checks for all prerequisites of the po subdirectory.
1842 AC_DEFUN([AM_PO_SUBDIRS],
1843 [
1844   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1845   AC_REQUIRE([AC_PROG_INSTALL])dnl
1846   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1847   AC_REQUIRE([AM_NLS])dnl
1848
1849   dnl Perform the following tests also if --disable-nls has been given,
1850   dnl because they are needed for "make dist" to work.
1851
1852   dnl Search for GNU msgfmt in the PATH.
1853   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1854   dnl The second test excludes FreeBSD msgfmt.
1855   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1856     [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1857      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1858     :)
1859   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1860
1861   dnl Search for GNU xgettext 0.12 or newer in the PATH.
1862   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1863   dnl The second test excludes FreeBSD xgettext.
1864   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1865     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1866      (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1867     :)
1868   dnl Remove leftover from FreeBSD xgettext call.
1869   rm -f messages.po
1870
1871   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1872   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1873     [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1874
1875   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1876   dnl Test whether we really found GNU msgfmt.
1877   if test "$GMSGFMT" != ":"; then
1878     dnl If it is no GNU msgfmt we define it as : so that the
1879     dnl Makefiles still can work.
1880     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1881        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1882       : ;
1883     else
1884       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1885       AC_MSG_RESULT(
1886         [found $GMSGFMT program is not GNU msgfmt; ignore it])
1887       GMSGFMT=":"
1888     fi
1889   fi
1890
1891   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1892   dnl Test whether we really found GNU xgettext.
1893   if test "$XGETTEXT" != ":"; then
1894     dnl If it is no GNU xgettext we define it as : so that the
1895     dnl Makefiles still can work.
1896     if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1897        (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1898       : ;
1899     else
1900       AC_MSG_RESULT(
1901         [found xgettext program is not GNU xgettext; ignore it])
1902       XGETTEXT=":"
1903     fi
1904     dnl Remove leftover from FreeBSD xgettext call.
1905     rm -f messages.po
1906   fi
1907
1908   AC_OUTPUT_COMMANDS([
1909     for ac_file in $CONFIG_FILES; do
1910       # Support "outfile[:infile[:infile...]]"
1911       case "$ac_file" in
1912         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1913       esac
1914       # PO directories have a Makefile.in generated from Makefile.in.in.
1915       case "$ac_file" in */Makefile.in)
1916         # Adjust a relative srcdir.
1917         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1918         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1919         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1920         # In autoconf-2.13 it is called $ac_given_srcdir.
1921         # In autoconf-2.50 it is called $srcdir.
1922         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1923         case "$ac_given_srcdir" in
1924           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1925           /*) top_srcdir="$ac_given_srcdir" ;;
1926           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1927         esac
1928         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1929           rm -f "$ac_dir/POTFILES"
1930           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1931           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1932           POMAKEFILEDEPS="POTFILES.in"
1933           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1934           # on $ac_dir but don't depend on user-specified configuration
1935           # parameters.
1936           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1937             # The LINGUAS file contains the set of available languages.
1938             if test -n "$OBSOLETE_ALL_LINGUAS"; then
1939               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1940             fi
1941             ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1942             # Hide the ALL_LINGUAS assigment from automake.
1943             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1944             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1945           else
1946             # The set of available languages was given in configure.in.
1947             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1948           fi
1949           # Compute POFILES
1950           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1951           # Compute UPDATEPOFILES
1952           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1953           # Compute DUMMYPOFILES
1954           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1955           # Compute GMOFILES
1956           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1957           case "$ac_given_srcdir" in
1958             .) srcdirpre= ;;
1959             *) srcdirpre='$(srcdir)/' ;;
1960           esac
1961           POFILES=
1962           UPDATEPOFILES=
1963           DUMMYPOFILES=
1964           GMOFILES=
1965           for lang in $ALL_LINGUAS; do
1966             POFILES="$POFILES $srcdirpre$lang.po"
1967             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1968             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1969             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1970           done
1971           # CATALOGS depends on both $ac_dir and the user's LINGUAS
1972           # environment variable.
1973           INST_LINGUAS=
1974           if test -n "$ALL_LINGUAS"; then
1975             for presentlang in $ALL_LINGUAS; do
1976               useit=no
1977               if test "%UNSET%" != "$LINGUAS"; then
1978                 desiredlanguages="$LINGUAS"
1979               else
1980                 desiredlanguages="$ALL_LINGUAS"
1981               fi
1982               for desiredlang in $desiredlanguages; do
1983                 # Use the presentlang catalog if desiredlang is
1984                 #   a. equal to presentlang, or
1985                 #   b. a variant of presentlang (because in this case,
1986                 #      presentlang can be used as a fallback for messages
1987                 #      which are not translated in the desiredlang catalog).
1988                 case "$desiredlang" in
1989                   "$presentlang"*) useit=yes;;
1990                 esac
1991               done
1992               if test $useit = yes; then
1993                 INST_LINGUAS="$INST_LINGUAS $presentlang"
1994               fi
1995             done
1996           fi
1997           CATALOGS=
1998           if test -n "$INST_LINGUAS"; then
1999             for lang in $INST_LINGUAS; do
2000               CATALOGS="$CATALOGS $lang.gmo"
2001             done
2002           fi
2003           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2004           sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2005           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2006             if test -f "$f"; then
2007               case "$f" in
2008                 *.orig | *.bak | *~) ;;
2009                 *) cat "$f" >> "$ac_dir/Makefile" ;;
2010               esac
2011             fi
2012           done
2013         fi
2014         ;;
2015       esac
2016     done],
2017    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2018     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2019     # from automake.
2020     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2021     # Capture the value of LINGUAS because we need it to compute CATALOGS.
2022     LINGUAS="${LINGUAS-%UNSET%}"
2023    ])
2024 ])
2025
2026 dnl Postprocesses a Makefile in a directory containing PO files.
2027 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2028 [
2029   # When this code is run, in config.status, two variables have already been
2030   # set:
2031   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2032   # - LINGUAS is the value of the environment variable LINGUAS at configure
2033   #   time.
2034
2035 changequote(,)dnl
2036   # Adjust a relative srcdir.
2037   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2038   ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2039   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2040   # In autoconf-2.13 it is called $ac_given_srcdir.
2041   # In autoconf-2.50 it is called $srcdir.
2042   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2043   case "$ac_given_srcdir" in
2044     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2045     /*) top_srcdir="$ac_given_srcdir" ;;
2046     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2047   esac
2048
2049   # Find a way to echo strings without interpreting backslash.
2050   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2051     gt_echo='echo'
2052   else
2053     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2054       gt_echo='printf %s\n'
2055     else
2056       echo_func () {
2057         cat <<EOT
2058 $*
2059 EOT
2060       }
2061       gt_echo='echo_func'
2062     fi
2063   fi
2064
2065   # A sed script that extracts the value of VARIABLE from a Makefile.
2066   sed_x_variable='
2067 # Test if the hold space is empty.
2068 x
2069 s/P/P/
2070 x
2071 ta
2072 # Yes it was empty. Look if we have the expected variable definition.
2073 /^[      ]*VARIABLE[     ]*=/{
2074   # Seen the first line of the variable definition.
2075   s/^[   ]*VARIABLE[     ]*=//
2076   ba
2077 }
2078 bd
2079 :a
2080 # Here we are processing a line from the variable definition.
2081 # Remove comment, more precisely replace it with a space.
2082 s/#.*$/ /
2083 # See if the line ends in a backslash.
2084 tb
2085 :b
2086 s/\\$//
2087 # Print the line, without the trailing backslash.
2088 p
2089 tc
2090 # There was no trailing backslash. The end of the variable definition is
2091 # reached. Clear the hold space.
2092 s/^.*$//
2093 x
2094 bd
2095 :c
2096 # A trailing backslash means that the variable definition continues in the
2097 # next line. Put a nonempty string into the hold space to indicate this.
2098 s/^.*$/P/
2099 x
2100 :d
2101 '
2102 changequote([,])dnl
2103
2104   # Set POTFILES to the value of the Makefile variable POTFILES.
2105   sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2106   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2107   # Compute POTFILES_DEPS as
2108   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2109   POTFILES_DEPS=
2110   for file in $POTFILES; do
2111     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2112   done
2113   POMAKEFILEDEPS=""
2114
2115   if test -n "$OBSOLETE_ALL_LINGUAS"; then
2116     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2117   fi
2118   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2119     # The LINGUAS file contains the set of available languages.
2120     ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2121     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2122   else
2123     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2124     sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2125     ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2126   fi
2127   # Hide the ALL_LINGUAS assigment from automake.
2128   eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2129   # Compute POFILES
2130   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2131   # Compute UPDATEPOFILES
2132   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2133   # Compute DUMMYPOFILES
2134   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2135   # Compute GMOFILES
2136   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2137   # Compute PROPERTIESFILES
2138   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2139   # Compute CLASSFILES
2140   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2141   # Compute QMFILES
2142   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2143   # Compute MSGFILES
2144   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2145   # Compute RESOURCESDLLFILES
2146   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2147   case "$ac_given_srcdir" in
2148     .) srcdirpre= ;;
2149     *) srcdirpre='$(srcdir)/' ;;
2150   esac
2151   POFILES=
2152   UPDATEPOFILES=
2153   DUMMYPOFILES=
2154   GMOFILES=
2155   PROPERTIESFILES=
2156   CLASSFILES=
2157   QMFILES=
2158   MSGFILES=
2159   RESOURCESDLLFILES=
2160   for lang in $ALL_LINGUAS; do
2161     POFILES="$POFILES $srcdirpre$lang.po"
2162     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2163     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2164     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2165     PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2166     CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2167     QMFILES="$QMFILES $srcdirpre$lang.qm"
2168     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2169     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2170     frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2171     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2172   done
2173   # CATALOGS depends on both $ac_dir and the user's LINGUAS
2174   # environment variable.
2175   INST_LINGUAS=
2176   if test -n "$ALL_LINGUAS"; then
2177     for presentlang in $ALL_LINGUAS; do
2178       useit=no
2179       if test "%UNSET%" != "$LINGUAS"; then
2180         desiredlanguages="$LINGUAS"
2181       else
2182         desiredlanguages="$ALL_LINGUAS"
2183       fi
2184       for desiredlang in $desiredlanguages; do
2185         # Use the presentlang catalog if desiredlang is
2186         #   a. equal to presentlang, or
2187         #   b. a variant of presentlang (because in this case,
2188         #      presentlang can be used as a fallback for messages
2189         #      which are not translated in the desiredlang catalog).
2190         case "$desiredlang" in
2191           "$presentlang"*) useit=yes;;
2192         esac
2193       done
2194       if test $useit = yes; then
2195         INST_LINGUAS="$INST_LINGUAS $presentlang"
2196       fi
2197     done
2198   fi
2199   CATALOGS=
2200   JAVACATALOGS=
2201   QTCATALOGS=
2202   TCLCATALOGS=
2203   CSHARPCATALOGS=
2204   if test -n "$INST_LINGUAS"; then
2205     for lang in $INST_LINGUAS; do
2206       CATALOGS="$CATALOGS $lang.gmo"
2207       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2208       QTCATALOGS="$QTCATALOGS $lang.qm"
2209       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2210       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2211       frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2212       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2213     done
2214   fi
2215
2216   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2217   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2218     # Add dependencies that cannot be formulated as a simple suffix rule.
2219     for lang in $ALL_LINGUAS; do
2220       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2221       cat >> "$ac_file.tmp" <<EOF
2222 $frobbedlang.msg: $lang.po
2223         @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2224         \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2225 EOF
2226     done
2227   fi
2228   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2229     # Add dependencies that cannot be formulated as a simple suffix rule.
2230     for lang in $ALL_LINGUAS; do
2231       frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2232       cat >> "$ac_file.tmp" <<EOF
2233 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2234         @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2235         \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2236 EOF
2237     done
2238   fi
2239   if test -n "$POMAKEFILEDEPS"; then
2240     cat >> "$ac_file.tmp" <<EOF
2241 Makefile: $POMAKEFILEDEPS
2242 EOF
2243   fi
2244   mv "$ac_file.tmp" "$ac_file"
2245 ])
2246
2247 # printf-posix.m4 serial 2 (gettext-0.13.1)
2248 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2249 dnl This file is free software, distributed under the terms of the GNU
2250 dnl General Public License.  As a special exception to the GNU General
2251 dnl Public License, this file may be distributed as part of a program
2252 dnl that contains a configuration script generated by Autoconf, under
2253 dnl the same distribution terms as the rest of that program.
2254
2255 dnl From Bruno Haible.
2256 dnl Test whether the printf() function supports POSIX/XSI format strings with
2257 dnl positions.
2258
2259 AC_DEFUN([gt_PRINTF_POSIX],
2260 [
2261   AC_REQUIRE([AC_PROG_CC])
2262   AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
2263     gt_cv_func_printf_posix,
2264     [
2265       AC_TRY_RUN([
2266 #include <stdio.h>
2267 #include <string.h>
2268 /* The string "%2$d %1$d", with dollar characters protected from the shell's
2269    dollar expansion (possibly an autoconf bug).  */
2270 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
2271 static char buf[100];
2272 int main ()
2273 {
2274   sprintf (buf, format, 33, 55);
2275   return (strcmp (buf, "55 33") != 0);
2276 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
2277       [
2278         AC_EGREP_CPP(notposix, [
2279 #if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
2280   notposix
2281 #endif
2282         ], gt_cv_func_printf_posix="guessing no",
2283            gt_cv_func_printf_posix="guessing yes")
2284       ])
2285     ])
2286   case $gt_cv_func_printf_posix in
2287     *yes)
2288       AC_DEFINE(HAVE_POSIX_PRINTF, 1,
2289         [Define if your printf() function supports format strings with positions.])
2290       ;;
2291   esac
2292 ])
2293
2294 # progtest.m4 serial 3 (gettext-0.12)
2295 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2296 dnl This file is free software, distributed under the terms of the GNU
2297 dnl General Public License.  As a special exception to the GNU General
2298 dnl Public License, this file may be distributed as part of a program
2299 dnl that contains a configuration script generated by Autoconf, under
2300 dnl the same distribution terms as the rest of that program.
2301 dnl
2302 dnl This file can can be used in projects which are not available under
2303 dnl the GNU General Public License or the GNU Library General Public
2304 dnl License but which still want to provide support for the GNU gettext
2305 dnl functionality.
2306 dnl Please note that the actual code of the GNU gettext library is covered
2307 dnl by the GNU Library General Public License, and the rest of the GNU
2308 dnl gettext package package is covered by the GNU General Public License.
2309 dnl They are *not* in the public domain.
2310
2311 dnl Authors:
2312 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2313
2314 # Search path for a program which passes the given test.
2315
2316 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2317 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2318 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2319 [
2320 # Prepare PATH_SEPARATOR.
2321 # The user is always right.
2322 if test "${PATH_SEPARATOR+set}" != set; then
2323   echo "#! /bin/sh" >conf$$.sh
2324   echo  "exit 0"   >>conf$$.sh
2325   chmod +x conf$$.sh
2326   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2327     PATH_SEPARATOR=';'
2328   else
2329     PATH_SEPARATOR=:
2330   fi
2331   rm -f conf$$.sh
2332 fi
2333
2334 # Find out how to test for executable files. Don't use a zero-byte file,
2335 # as systems may use methods other than mode bits to determine executability.
2336 cat >conf$$.file <<_ASEOF
2337 #! /bin/sh
2338 exit 0
2339 _ASEOF
2340 chmod +x conf$$.file
2341 if test -x conf$$.file >/dev/null 2>&1; then
2342   ac_executable_p="test -x"
2343 else
2344   ac_executable_p="test -f"
2345 fi
2346 rm -f conf$$.file
2347
2348 # Extract the first word of "$2", so it can be a program name with args.
2349 set dummy $2; ac_word=[$]2
2350 AC_MSG_CHECKING([for $ac_word])
2351 AC_CACHE_VAL(ac_cv_path_$1,
2352 [case "[$]$1" in
2353   [[\\/]]* | ?:[[\\/]]*)
2354     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2355     ;;
2356   *)
2357     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2358     for ac_dir in ifelse([$5], , $PATH, [$5]); do
2359       IFS="$ac_save_IFS"
2360       test -z "$ac_dir" && ac_dir=.
2361       for ac_exec_ext in '' $ac_executable_extensions; do
2362         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2363           if [$3]; then
2364             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2365             break 2
2366           fi
2367         fi
2368       done
2369     done
2370     IFS="$ac_save_IFS"
2371 dnl If no 4th arg is given, leave the cache variable unset,
2372 dnl so AC_PATH_PROGS will keep looking.
2373 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2374 ])dnl
2375     ;;
2376 esac])dnl
2377 $1="$ac_cv_path_$1"
2378 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2379   AC_MSG_RESULT([$]$1)
2380 else
2381   AC_MSG_RESULT(no)
2382 fi
2383 AC_SUBST($1)dnl
2384 ])
2385
2386 # signed.m4 serial 1 (gettext-0.10.40)
2387 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2388 dnl This file is free software, distributed under the terms of the GNU
2389 dnl General Public License.  As a special exception to the GNU General
2390 dnl Public License, this file may be distributed as part of a program
2391 dnl that contains a configuration script generated by Autoconf, under
2392 dnl the same distribution terms as the rest of that program.
2393
2394 dnl From Bruno Haible.
2395
2396 AC_DEFUN([bh_C_SIGNED],
2397 [
2398   AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2399    [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2400   if test $bh_cv_c_signed = no; then
2401     AC_DEFINE(signed, ,
2402               [Define to empty if the C compiler doesn't support this keyword.])
2403   fi
2404 ])
2405
2406 # size_max.m4 serial 2
2407 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2408 dnl This file is free software, distributed under the terms of the GNU
2409 dnl General Public License.  As a special exception to the GNU General
2410 dnl Public License, this file may be distributed as part of a program
2411 dnl that contains a configuration script generated by Autoconf, under
2412 dnl the same distribution terms as the rest of that program.
2413
2414 dnl From Bruno Haible.
2415
2416 AC_DEFUN([gl_SIZE_MAX],
2417 [
2418   AC_CHECK_HEADERS(stdint.h)
2419   dnl First test whether the system already has SIZE_MAX.
2420   AC_MSG_CHECKING([for SIZE_MAX])
2421   result=
2422   AC_EGREP_CPP([Found it], [
2423 #include <limits.h>
2424 #if HAVE_STDINT_H
2425 #include <stdint.h>
2426 #endif
2427 #ifdef SIZE_MAX
2428 Found it
2429 #endif
2430 ], result=yes)
2431   if test -z "$result"; then
2432     dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2433     dnl than the type 'unsigned long'.
2434     dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2435     dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2436     _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2437       [#include <stddef.h>], result=?)
2438     _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2439       [#include <stddef.h>], result=?)
2440     _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2441       [#include <stddef.h>], result=?)
2442     if test "$fits_in_uint" = 1; then
2443       dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2444       dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2445       AC_TRY_COMPILE([#include <stddef.h>
2446         extern size_t foo;
2447         extern unsigned long foo;
2448         ], [], fits_in_uint=0)
2449     fi
2450     if test -z "$result"; then
2451       if test "$fits_in_uint" = 1; then
2452         result="$res_hi$res_lo"U
2453       else
2454         result="$res_hi$res_lo"UL
2455       fi
2456     else
2457       dnl Shouldn't happen, but who knows...
2458       result='~(size_t)0'
2459     fi
2460   fi
2461   AC_MSG_RESULT([$result])
2462   if test "$result" != yes; then
2463     AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
2464       [Define as the maximum value of type 'size_t', if the system doesn't define it.])
2465   fi
2466 ])
2467
2468 # stdint_h.m4 serial 3 (gettext-0.12)
2469 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2470 dnl This file is free software, distributed under the terms of the GNU
2471 dnl General Public License.  As a special exception to the GNU General
2472 dnl Public License, this file may be distributed as part of a program
2473 dnl that contains a configuration script generated by Autoconf, under
2474 dnl the same distribution terms as the rest of that program.
2475
2476 dnl From Paul Eggert.
2477
2478 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2479 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2480
2481 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2482 [
2483   AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2484   [AC_TRY_COMPILE(
2485     [#include <sys/types.h>
2486 #include <stdint.h>],
2487     [uintmax_t i = (uintmax_t) -1;],
2488     jm_ac_cv_header_stdint_h=yes,
2489     jm_ac_cv_header_stdint_h=no)])
2490   if test $jm_ac_cv_header_stdint_h = yes; then
2491     AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2492       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2493        and declares uintmax_t. ])
2494   fi
2495 ])
2496
2497 # uintmax_t.m4 serial 7 (gettext-0.12)
2498 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2499 dnl This file is free software, distributed under the terms of the GNU
2500 dnl General Public License.  As a special exception to the GNU General
2501 dnl Public License, this file may be distributed as part of a program
2502 dnl that contains a configuration script generated by Autoconf, under
2503 dnl the same distribution terms as the rest of that program.
2504
2505 dnl From Paul Eggert.
2506
2507 AC_PREREQ(2.13)
2508
2509 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2510 # if it is not already defined in <stdint.h> or <inttypes.h>.
2511
2512 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2513 [
2514   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2515   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2516   if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2517     AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2518     test $ac_cv_type_unsigned_long_long = yes \
2519       && ac_type='unsigned long long' \
2520       || ac_type='unsigned long'
2521     AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2522       [Define to unsigned long or unsigned long long
2523        if <stdint.h> and <inttypes.h> don't define.])
2524   else
2525     AC_DEFINE(HAVE_UINTMAX_T, 1,
2526       [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2527   fi
2528 ])
2529
2530 # ulonglong.m4 serial 3
2531 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2532 dnl This file is free software, distributed under the terms of the GNU
2533 dnl General Public License.  As a special exception to the GNU General
2534 dnl Public License, this file may be distributed as part of a program
2535 dnl that contains a configuration script generated by Autoconf, under
2536 dnl the same distribution terms as the rest of that program.
2537
2538 dnl From Paul Eggert.
2539
2540 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2541
2542 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2543 [
2544   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2545   [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2546     [unsigned long long ullmax = (unsigned long long) -1;
2547      return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2548     ac_cv_type_unsigned_long_long=yes,
2549     ac_cv_type_unsigned_long_long=no)])
2550   if test $ac_cv_type_unsigned_long_long = yes; then
2551     AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2552       [Define if you have the 'unsigned long long' type.])
2553   fi
2554 ])
2555
2556 # wchar_t.m4 serial 1 (gettext-0.12)
2557 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2558 dnl This file is free software, distributed under the terms of the GNU
2559 dnl General Public License.  As a special exception to the GNU General
2560 dnl Public License, this file may be distributed as part of a program
2561 dnl that contains a configuration script generated by Autoconf, under
2562 dnl the same distribution terms as the rest of that program.
2563
2564 dnl From Bruno Haible.
2565 dnl Test whether <stddef.h> has the 'wchar_t' type.
2566 dnl Prerequisite: AC_PROG_CC
2567
2568 AC_DEFUN([gt_TYPE_WCHAR_T],
2569 [
2570   AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2571     [AC_TRY_COMPILE([#include <stddef.h>
2572        wchar_t foo = (wchar_t)'\0';], ,
2573        gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
2574   if test $gt_cv_c_wchar_t = yes; then
2575     AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
2576   fi
2577 ])
2578
2579 # wint_t.m4 serial 1 (gettext-0.12)
2580 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2581 dnl This file is free software, distributed under the terms of the GNU
2582 dnl General Public License.  As a special exception to the GNU General
2583 dnl Public License, this file may be distributed as part of a program
2584 dnl that contains a configuration script generated by Autoconf, under
2585 dnl the same distribution terms as the rest of that program.
2586
2587 dnl From Bruno Haible.
2588 dnl Test whether <wchar.h> has the 'wint_t' type.
2589 dnl Prerequisite: AC_PROG_CC
2590
2591 AC_DEFUN([gt_TYPE_WINT_T],
2592 [
2593   AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2594     [AC_TRY_COMPILE([#include <wchar.h>
2595        wint_t foo = (wchar_t)'\0';], ,
2596        gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
2597   if test $gt_cv_c_wint_t = yes; then
2598     AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
2599   fi
2600 ])
2601
2602 # xsize.m4 serial 2
2603 dnl Copyright (C) 2003 Free Software Foundation, Inc.
2604 dnl This file is free software, distributed under the terms of the GNU
2605 dnl General Public License.  As a special exception to the GNU General
2606 dnl Public License, this file may be distributed as part of a program
2607 dnl that contains a configuration script generated by Autoconf, under
2608 dnl the same distribution terms as the rest of that program.
2609
2610 AC_DEFUN([gl_XSIZE],
2611 [
2612   dnl Prerequisites of lib/xsize.h.
2613   AC_REQUIRE([gl_SIZE_MAX])
2614   AC_CHECK_HEADERS(stdint.h)
2615 ])
2616
2617 # AM_AUX_DIR_EXPAND
2618
2619 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
2620
2621 # This program is free software; you can redistribute it and/or modify
2622 # it under the terms of the GNU General Public License as published by
2623 # the Free Software Foundation; either version 2, or (at your option)
2624 # any later version.
2625
2626 # This program is distributed in the hope that it will be useful,
2627 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2628 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2629 # GNU General Public License for more details.
2630
2631 # You should have received a copy of the GNU General Public License
2632 # along with this program; if not, write to the Free Software
2633 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2634 # 02111-1307, USA.
2635
2636 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2637 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
2638 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2639 #
2640 # Of course, Automake must honor this variable whenever it calls a
2641 # tool from the auxiliary directory.  The problem is that $srcdir (and
2642 # therefore $ac_aux_dir as well) can be either absolute or relative,
2643 # depending on how configure is run.  This is pretty annoying, since
2644 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2645 # source directory, any form will work fine, but in subdirectories a
2646 # relative path needs to be adjusted first.
2647 #
2648 # $ac_aux_dir/missing
2649 #    fails when called from a subdirectory if $ac_aux_dir is relative
2650 # $top_srcdir/$ac_aux_dir/missing
2651 #    fails if $ac_aux_dir is absolute,
2652 #    fails when called from a subdirectory in a VPATH build with
2653 #          a relative $ac_aux_dir
2654 #
2655 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2656 # are both prefixed by $srcdir.  In an in-source build this is usually
2657 # harmless because $srcdir is `.', but things will broke when you
2658 # start a VPATH build or use an absolute $srcdir.
2659 #
2660 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2661 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2662 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2663 # and then we would define $MISSING as
2664 #   MISSING="\${SHELL} $am_aux_dir/missing"
2665 # This will work as long as MISSING is not called from configure, because
2666 # unfortunately $(top_srcdir) has no meaning in configure.
2667 # However there are other variables, like CC, which are often used in
2668 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2669 #
2670 # Another solution, used here, is to always expand $ac_aux_dir to an
2671 # absolute PATH.  The drawback is that using absolute paths prevent a
2672 # configured tree to be moved without reconfiguration.
2673
2674 AC_DEFUN([AM_AUX_DIR_EXPAND],
2675 [dnl Rely on autoconf to set up CDPATH properly.
2676 AC_PREREQ([2.50])dnl
2677 # expand $ac_aux_dir to an absolute path
2678 am_aux_dir=`cd $ac_aux_dir && pwd`
2679 ])
2680
2681 #  -*- Autoconf -*-
2682
2683
2684 # Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
2685
2686 # This program is free software; you can redistribute it and/or modify
2687 # it under the terms of the GNU General Public License as published by
2688 # the Free Software Foundation; either version 2, or (at your option)
2689 # any later version.
2690
2691 # This program is distributed in the hope that it will be useful,
2692 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2693 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2694 # GNU General Public License for more details.
2695
2696 # You should have received a copy of the GNU General Public License
2697 # along with this program; if not, write to the Free Software
2698 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2699 # 02111-1307, USA.
2700
2701 # serial 3
2702
2703 # AM_MISSING_PROG(NAME, PROGRAM)
2704 # ------------------------------
2705 AC_DEFUN([AM_MISSING_PROG],
2706 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2707 $1=${$1-"${am_missing_run}$2"}
2708 AC_SUBST($1)])
2709
2710
2711 # AM_MISSING_HAS_RUN
2712 # ------------------
2713 # Define MISSING if not defined so far and test if it supports --run.
2714 # If it does, set am_missing_run to use it, otherwise, to nothing.
2715 AC_DEFUN([AM_MISSING_HAS_RUN],
2716 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2717 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
2718 # Use eval to expand $SHELL
2719 if eval "$MISSING --run true"; then
2720   am_missing_run="$MISSING --run "
2721 else
2722   am_missing_run=
2723   AC_MSG_WARN([`missing' script is too old or missing])
2724 fi
2725 ])
2726