]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/aclocal.m4
- Create French and Italian translation files (fr.po, it.po).
[bacula/bacula] / bacula / autoconf / aclocal.m4
1 # generated automatically by aclocal 1.9.5 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005  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 # gettext.m4 serial 37 (gettext-0.14.4)
15 dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
16 dnl This file is free software; the Free Software Foundation
17 dnl gives unlimited permission to copy and/or distribute it,
18 dnl with or without modifications, as long as this notice is preserved.
19 dnl
20 dnl This file can can be used in projects which are not available under
21 dnl the GNU General Public License or the GNU Library General Public
22 dnl License but which still want to provide support for the GNU gettext
23 dnl functionality.
24 dnl Please note that the actual code of the GNU gettext library is covered
25 dnl by the GNU Library General Public License, and the rest of the GNU
26 dnl gettext package package is covered by the GNU General Public License.
27 dnl They are *not* in the public domain.
28
29 dnl Authors:
30 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
31 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
32
33 dnl Macro to add for using GNU gettext.
34
35 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
36 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
37 dnl    default (if it is not specified or empty) is 'no-libtool'.
38 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
39 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
40 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
41 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
42 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
43 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
44 dnl    $(top_builddir)/intl/libintl.a will be created.
45 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
46 dnl    implementations (in libc or libintl) without the ngettext() function
47 dnl    will be ignored.  If NEEDSYMBOL is specified and is
48 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
49 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
50 dnl INTLDIR is used to find the intl libraries.  If empty,
51 dnl    the value `$(top_builddir)/intl/' is used.
52 dnl
53 dnl The result of the configuration is one of three cases:
54 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
55 dnl    and used.
56 dnl    Catalog format: GNU --> install in $(datadir)
57 dnl    Catalog extension: .mo after installation, .gmo in source tree
58 dnl 2) GNU gettext has been found in the system's C library.
59 dnl    Catalog format: GNU --> install in $(datadir)
60 dnl    Catalog extension: .mo after installation, .gmo in source tree
61 dnl 3) No internationalization, always use English msgid.
62 dnl    Catalog format: none
63 dnl    Catalog extension: none
64 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
65 dnl The use of .gmo is historical (it was needed to avoid overwriting the
66 dnl GNU format catalogs when building on a platform with an X/Open gettext),
67 dnl but we keep it in order not to force irrelevant filename changes on the
68 dnl maintainers.
69 dnl
70 AC_DEFUN([AM_GNU_GETTEXT],
71 [
72   dnl Argument checking.
73   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
74     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
75 ])])])])])
76   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
77     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
78 ])])])])
79   define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
80   define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
81
82   AC_REQUIRE([AM_PO_SUBDIRS])dnl
83   ifelse(gt_included_intl, yes, [
84     AC_REQUIRE([AM_INTL_SUBDIR])dnl
85   ])
86
87   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
88   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
89   AC_REQUIRE([AC_LIB_RPATH])
90
91   dnl Sometimes libintl requires libiconv, so first search for libiconv.
92   dnl Ideally we would do this search only after the
93   dnl      if test "$USE_NLS" = "yes"; then
94   dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
95   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
96   dnl the configure script would need to contain the same shell code
97   dnl again, outside any 'if'. There are two solutions:
98   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
99   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
100   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
101   dnl documented, we avoid it.
102   ifelse(gt_included_intl, yes, , [
103     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
104   ])
105
106   dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
107   gt_INTL_MACOSX
108
109   dnl Set USE_NLS.
110   AM_NLS
111
112   ifelse(gt_included_intl, yes, [
113     BUILD_INCLUDED_LIBINTL=no
114     USE_INCLUDED_LIBINTL=no
115   ])
116   LIBINTL=
117   LTLIBINTL=
118   POSUB=
119
120   dnl If we use NLS figure out what method
121   if test "$USE_NLS" = "yes"; then
122     gt_use_preinstalled_gnugettext=no
123     ifelse(gt_included_intl, yes, [
124       AC_MSG_CHECKING([whether included gettext is requested])
125       AC_ARG_WITH(included-gettext,
126         [  --with-included-gettext use the GNU gettext library included here],
127         nls_cv_force_use_gnu_gettext=$withval,
128         nls_cv_force_use_gnu_gettext=no)
129       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
130
131       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
132       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
133     ])
134         dnl User does not insist on using GNU NLS library.  Figure out what
135         dnl to use.  If GNU gettext is available we use this.  Else we have
136         dnl to fall back to GNU NLS library.
137
138         dnl Add a version number to the cache macros.
139         define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
140         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
141         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
142
143         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
144          [AC_TRY_LINK([#include <libintl.h>
145 ]ifelse([$2], [need-formatstring-macros],
146 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
147 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
148 #endif
149 changequote(,)dnl
150 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
151 changequote([,])dnl
152 ], [])[extern int _nl_msg_cat_cntr;
153 extern int *_nl_domain_bindings;],
154             [bindtextdomain ("", "");
155 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
156             gt_cv_func_gnugettext_libc=yes,
157             gt_cv_func_gnugettext_libc=no)])
158
159         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
160           dnl Sometimes libintl requires libiconv, so first search for libiconv.
161           ifelse(gt_included_intl, yes, , [
162             AM_ICONV_LINK
163           ])
164           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
165           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
166           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
167           dnl even if libiconv doesn't exist.
168           AC_LIB_LINKFLAGS_BODY([intl])
169           AC_CACHE_CHECK([for GNU gettext in libintl],
170             gt_cv_func_gnugettext_libintl,
171            [gt_save_CPPFLAGS="$CPPFLAGS"
172             CPPFLAGS="$CPPFLAGS $INCINTL"
173             gt_save_LIBS="$LIBS"
174             LIBS="$LIBS $LIBINTL"
175             dnl Now see whether libintl exists and does not depend on libiconv.
176             AC_TRY_LINK([#include <libintl.h>
177 ]ifelse([$2], [need-formatstring-macros],
178 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
179 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
180 #endif
181 changequote(,)dnl
182 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
183 changequote([,])dnl
184 ], [])[extern int _nl_msg_cat_cntr;
185 extern
186 #ifdef __cplusplus
187 "C"
188 #endif
189 const char *_nl_expand_alias (const char *);],
190               [bindtextdomain ("", "");
191 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
192               gt_cv_func_gnugettext_libintl=yes,
193               gt_cv_func_gnugettext_libintl=no)
194             dnl Now see whether libintl exists and depends on libiconv.
195             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
196               LIBS="$LIBS $LIBICONV"
197               AC_TRY_LINK([#include <libintl.h>
198 ]ifelse([$2], [need-formatstring-macros],
199 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
200 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
201 #endif
202 changequote(,)dnl
203 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
204 changequote([,])dnl
205 ], [])[extern int _nl_msg_cat_cntr;
206 extern
207 #ifdef __cplusplus
208 "C"
209 #endif
210 const char *_nl_expand_alias (const char *);],
211                 [bindtextdomain ("", "");
212 return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
213                [LIBINTL="$LIBINTL $LIBICONV"
214                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
215                 gt_cv_func_gnugettext_libintl=yes
216                ])
217             fi
218             CPPFLAGS="$gt_save_CPPFLAGS"
219             LIBS="$gt_save_LIBS"])
220         fi
221
222         dnl If an already present or preinstalled GNU gettext() is found,
223         dnl use it.  But if this macro is used in GNU gettext, and GNU
224         dnl gettext is already preinstalled in libintl, we update this
225         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
226         if test "$gt_cv_func_gnugettext_libc" = "yes" \
227            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
228                 && test "$PACKAGE" != gettext-runtime \
229                 && test "$PACKAGE" != gettext-tools; }; then
230           gt_use_preinstalled_gnugettext=yes
231         else
232           dnl Reset the values set by searching for libintl.
233           LIBINTL=
234           LTLIBINTL=
235           INCINTL=
236         fi
237
238     ifelse(gt_included_intl, yes, [
239         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
240           dnl GNU gettext is not found in the C library.
241           dnl Fall back on included GNU gettext library.
242           nls_cv_use_gnu_gettext=yes
243         fi
244       fi
245
246       if test "$nls_cv_use_gnu_gettext" = "yes"; then
247         dnl Mark actions used to generate GNU NLS library.
248         BUILD_INCLUDED_LIBINTL=yes
249         USE_INCLUDED_LIBINTL=yes
250         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
251         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
252         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
253       fi
254
255       CATOBJEXT=
256       if test "$gt_use_preinstalled_gnugettext" = "yes" \
257          || test "$nls_cv_use_gnu_gettext" = "yes"; then
258         dnl Mark actions to use GNU gettext tools.
259         CATOBJEXT=.gmo
260       fi
261     ])
262
263     if test -n "$INTL_MACOSX_LIBS"; then
264       if test "$gt_use_preinstalled_gnugettext" = "yes" \
265          || test "$nls_cv_use_gnu_gettext" = "yes"; then
266         dnl Some extra flags are needed during linking.
267         LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
268         LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
269       fi
270     fi
271
272     if test "$gt_use_preinstalled_gnugettext" = "yes" \
273        || test "$nls_cv_use_gnu_gettext" = "yes"; then
274       AC_DEFINE(ENABLE_NLS, 1,
275         [Define to 1 if translation of program messages to the user's native language
276    is requested.])
277     else
278       USE_NLS=no
279     fi
280   fi
281
282   AC_MSG_CHECKING([whether to use NLS])
283   AC_MSG_RESULT([$USE_NLS])
284   if test "$USE_NLS" = "yes"; then
285     AC_MSG_CHECKING([where the gettext function comes from])
286     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
287       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
288         gt_source="external libintl"
289       else
290         gt_source="libc"
291       fi
292     else
293       gt_source="included intl directory"
294     fi
295     AC_MSG_RESULT([$gt_source])
296   fi
297
298   if test "$USE_NLS" = "yes"; then
299
300     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
301       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
302         AC_MSG_CHECKING([how to link with libintl])
303         AC_MSG_RESULT([$LIBINTL])
304         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
305       fi
306
307       dnl For backward compatibility. Some packages may be using this.
308       AC_DEFINE(HAVE_GETTEXT, 1,
309        [Define if the GNU gettext() function is already present or preinstalled.])
310       AC_DEFINE(HAVE_DCGETTEXT, 1,
311        [Define if the GNU dcgettext() function is already present or preinstalled.])
312     fi
313
314     dnl We need to process the po/ directory.
315     POSUB=po
316   fi
317
318   ifelse(gt_included_intl, yes, [
319     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
320     dnl to 'yes' because some of the testsuite requires it.
321     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
322       BUILD_INCLUDED_LIBINTL=yes
323     fi
324
325     dnl Make all variables we use known to autoconf.
326     AC_SUBST(BUILD_INCLUDED_LIBINTL)
327     AC_SUBST(USE_INCLUDED_LIBINTL)
328     AC_SUBST(CATOBJEXT)
329
330     dnl For backward compatibility. Some configure.ins may be using this.
331     nls_cv_header_intl=
332     nls_cv_header_libgt=
333
334     dnl For backward compatibility. Some Makefiles may be using this.
335     DATADIRNAME=share
336     AC_SUBST(DATADIRNAME)
337
338     dnl For backward compatibility. Some Makefiles may be using this.
339     INSTOBJEXT=.mo
340     AC_SUBST(INSTOBJEXT)
341
342     dnl For backward compatibility. Some Makefiles may be using this.
343     GENCAT=gencat
344     AC_SUBST(GENCAT)
345
346     dnl For backward compatibility. Some Makefiles may be using this.
347     INTLOBJS=
348     if test "$USE_INCLUDED_LIBINTL" = yes; then
349       INTLOBJS="\$(GETTOBJS)"
350     fi
351     AC_SUBST(INTLOBJS)
352
353     dnl Enable libtool support if the surrounding package wishes it.
354     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
355     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
356   ])
357
358   dnl For backward compatibility. Some Makefiles may be using this.
359   INTLLIBS="$LIBINTL"
360   AC_SUBST(INTLLIBS)
361
362   dnl Make all documented variables known to autoconf.
363   AC_SUBST(LIBINTL)
364   AC_SUBST(LTLIBINTL)
365   AC_SUBST(POSUB)
366 ])
367
368
369 dnl Checks for all prerequisites of the intl subdirectory,
370 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
371 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
372 AC_DEFUN([AM_INTL_SUBDIR],
373 [
374   AC_REQUIRE([AC_PROG_INSTALL])dnl
375   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
376   AC_REQUIRE([AC_PROG_CC])dnl
377   AC_REQUIRE([AC_CANONICAL_HOST])dnl
378   AC_REQUIRE([gt_GLIBC2])dnl
379   AC_REQUIRE([AC_PROG_RANLIB])dnl
380   AC_REQUIRE([AC_ISC_POSIX])dnl
381   AC_REQUIRE([AC_HEADER_STDC])dnl
382   AC_REQUIRE([AC_C_CONST])dnl
383   AC_REQUIRE([bh_C_SIGNED])dnl
384   AC_REQUIRE([AC_C_INLINE])dnl
385   AC_REQUIRE([AC_TYPE_OFF_T])dnl
386   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
387   AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
388   AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
389   AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
390   AC_REQUIRE([gt_TYPE_WINT_T])dnl
391   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
392   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
393   AC_REQUIRE([gt_TYPE_INTMAX_T])
394   AC_REQUIRE([gt_PRINTF_POSIX])
395   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
396   AC_REQUIRE([AC_FUNC_MMAP])dnl
397   AC_REQUIRE([gl_GLIBC21])dnl
398   AC_REQUIRE([gt_INTDIV0])dnl
399   AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
400   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
401   AC_REQUIRE([gt_INTTYPES_PRI])dnl
402   AC_REQUIRE([gl_XSIZE])dnl
403   AC_REQUIRE([gt_INTL_MACOSX])dnl
404
405   AC_CHECK_TYPE([ptrdiff_t], ,
406     [AC_DEFINE([ptrdiff_t], [long],
407        [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
408     ])
409   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
410 stdlib.h string.h unistd.h sys/param.h])
411   AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
412 mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
413 strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
414 __fsetlocking])
415
416   dnl Use the _snprintf function only if it is declared (because on NetBSD it
417   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
418   gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
419   gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
420
421   dnl Use the *_unlocked functions only if they are declared.
422   dnl (because some of them were defined without being declared in Solaris
423   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
424   dnl on Solaris 2.5.1 to run on Solaris 2.6).
425   dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
426   gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
427   gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
428   gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
429
430   case $gt_cv_func_printf_posix in
431     *yes) HAVE_POSIX_PRINTF=1 ;;
432     *) HAVE_POSIX_PRINTF=0 ;;
433   esac
434   AC_SUBST([HAVE_POSIX_PRINTF])
435   if test "$ac_cv_func_asprintf" = yes; then
436     HAVE_ASPRINTF=1
437   else
438     HAVE_ASPRINTF=0
439   fi
440   AC_SUBST([HAVE_ASPRINTF])
441   if test "$ac_cv_func_snprintf" = yes; then
442     HAVE_SNPRINTF=1
443   else
444     HAVE_SNPRINTF=0
445   fi
446   AC_SUBST([HAVE_SNPRINTF])
447   if test "$ac_cv_func_wprintf" = yes; then
448     HAVE_WPRINTF=1
449   else
450     HAVE_WPRINTF=0
451   fi
452   AC_SUBST([HAVE_WPRINTF])
453
454   AM_ICONV
455   AM_LANGINFO_CODESET
456   if test $ac_cv_header_locale_h = yes; then
457     gt_LC_MESSAGES
458   fi
459
460   if test -n "$INTL_MACOSX_LIBS"; then
461     CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
462   fi
463
464   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
465   dnl because plural.y uses bison specific features. It requires at least
466   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
467   dnl compile.
468   dnl bison is only needed for the maintainer (who touches plural.y). But in
469   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
470   dnl the rule in general Makefile. Now, some people carelessly touch the
471   dnl files or have a broken "make" program, hence the plural.c rule will
472   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
473   dnl present or too old.
474   AC_CHECK_PROGS([INTLBISON], [bison])
475   if test -z "$INTLBISON"; then
476     ac_verc_fail=yes
477   else
478     dnl Found it, now check the version.
479     AC_MSG_CHECKING([version of bison])
480 changequote(<<,>>)dnl
481     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
482     case $ac_prog_version in
483       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
484       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
485 changequote([,])dnl
486          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
487       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
488     esac
489     AC_MSG_RESULT([$ac_prog_version])
490   fi
491   if test $ac_verc_fail = yes; then
492     INTLBISON=:
493   fi
494 ])
495
496
497 dnl Checks for special options needed on MacOS X.
498 dnl Defines INTL_MACOSX_LIBS.
499 AC_DEFUN([gt_INTL_MACOSX],
500 [
501   dnl Check for API introduced in MacOS X 10.2.
502   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
503     gt_cv_func_CFPreferencesCopyAppValue,
504     [gt_save_CPPFLAGS="$CPPFLAGS"
505      CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
506      gt_save_LIBS="$LIBS"
507      LIBS="$LIBS -framework CoreFoundation"
508      AC_TRY_LINK([#include <CFPreferences.h>],
509        [CFPreferencesCopyAppValue(NULL, NULL)],
510        [gt_cv_func_CFPreferencesCopyAppValue=yes],
511        [gt_cv_func_CFPreferencesCopyAppValue=no])
512      CPPFLAGS="$gt_save_CPPFLAGS"
513      LIBS="$gt_save_LIBS"])
514   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
515     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
516       [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
517   fi
518   dnl Check for API introduced in MacOS X 10.3.
519   AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
520     [gt_save_CPPFLAGS="$CPPFLAGS"
521      CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
522      gt_save_LIBS="$LIBS"
523      LIBS="$LIBS -framework CoreFoundation"
524      AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
525        [gt_cv_func_CFLocaleCopyCurrent=yes],
526        [gt_cv_func_CFLocaleCopyCurrent=no])
527      CPPFLAGS="$gt_save_CPPFLAGS"
528      LIBS="$gt_save_LIBS"])
529   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
530     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
531       [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
532   fi
533   INTL_MACOSX_LIBS=
534   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
535     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
536   fi
537   AC_SUBST([INTL_MACOSX_LIBS])
538 ])
539
540
541 dnl gt_CHECK_DECL(FUNC, INCLUDES)
542 dnl Check whether a function is declared.
543 AC_DEFUN([gt_CHECK_DECL],
544 [
545   AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
546     [AC_TRY_COMPILE([$2], [
547 #ifndef $1
548   char *p = (char *) $1;
549 #endif
550 ], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
551   if test $ac_cv_have_decl_$1 = yes; then
552     gt_value=1
553   else
554     gt_value=0
555   fi
556   AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
557     [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
558 ])
559
560
561 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
562 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
563
564 # iconv.m4 serial AM4 (gettext-0.11.3)
565 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
566 dnl This file is free software; the Free Software Foundation
567 dnl gives unlimited permission to copy and/or distribute it,
568 dnl with or without modifications, as long as this notice is preserved.
569
570 dnl From Bruno Haible.
571
572 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
573 [
574   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
575   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
576   AC_REQUIRE([AC_LIB_RPATH])
577
578   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
579   dnl accordingly.
580   AC_LIB_LINKFLAGS_BODY([iconv])
581 ])
582
583 AC_DEFUN([AM_ICONV_LINK],
584 [
585   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
586   dnl those with the standalone portable GNU libiconv installed).
587
588   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
589   dnl accordingly.
590   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
591
592   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
593   dnl because if the user has installed libiconv and not disabled its use
594   dnl via --without-libiconv-prefix, he wants to use it. The first
595   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
596   am_save_CPPFLAGS="$CPPFLAGS"
597   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
598
599   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
600     am_cv_func_iconv="no, consider installing GNU libiconv"
601     am_cv_lib_iconv=no
602     AC_TRY_LINK([#include <stdlib.h>
603 #include <iconv.h>],
604       [iconv_t cd = iconv_open("","");
605        iconv(cd,NULL,NULL,NULL,NULL);
606        iconv_close(cd);],
607       am_cv_func_iconv=yes)
608     if test "$am_cv_func_iconv" != yes; then
609       am_save_LIBS="$LIBS"
610       LIBS="$LIBS $LIBICONV"
611       AC_TRY_LINK([#include <stdlib.h>
612 #include <iconv.h>],
613         [iconv_t cd = iconv_open("","");
614          iconv(cd,NULL,NULL,NULL,NULL);
615          iconv_close(cd);],
616         am_cv_lib_iconv=yes
617         am_cv_func_iconv=yes)
618       LIBS="$am_save_LIBS"
619     fi
620   ])
621   if test "$am_cv_func_iconv" = yes; then
622     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
623   fi
624   if test "$am_cv_lib_iconv" = yes; then
625     AC_MSG_CHECKING([how to link with libiconv])
626     AC_MSG_RESULT([$LIBICONV])
627   else
628     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
629     dnl either.
630     CPPFLAGS="$am_save_CPPFLAGS"
631     LIBICONV=
632     LTLIBICONV=
633   fi
634   AC_SUBST(LIBICONV)
635   AC_SUBST(LTLIBICONV)
636 ])
637
638 AC_DEFUN([AM_ICONV],
639 [
640   AM_ICONV_LINK
641   if test "$am_cv_func_iconv" = yes; then
642     AC_MSG_CHECKING([for iconv declaration])
643     AC_CACHE_VAL(am_cv_proto_iconv, [
644       AC_TRY_COMPILE([
645 #include <stdlib.h>
646 #include <iconv.h>
647 extern
648 #ifdef __cplusplus
649 "C"
650 #endif
651 #if defined(__STDC__) || defined(__cplusplus)
652 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
653 #else
654 size_t iconv();
655 #endif
656 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
657       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);"])
658     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
659     AC_MSG_RESULT([$]{ac_t:-
660          }[$]am_cv_proto_iconv)
661     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
662       [Define as const if the declaration of iconv() needs const.])
663   fi
664 ])
665
666 # lib-ld.m4 serial 3 (gettext-0.13)
667 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
668 dnl This file is free software; the Free Software Foundation
669 dnl gives unlimited permission to copy and/or distribute it,
670 dnl with or without modifications, as long as this notice is preserved.
671
672 dnl Subroutines of libtool.m4,
673 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
674 dnl with libtool.m4.
675
676 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
677 AC_DEFUN([AC_LIB_PROG_LD_GNU],
678 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
679 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
680 case `$LD -v 2>&1 </dev/null` in
681 *GNU* | *'with BFD'*)
682   acl_cv_prog_gnu_ld=yes ;;
683 *)
684   acl_cv_prog_gnu_ld=no ;;
685 esac])
686 with_gnu_ld=$acl_cv_prog_gnu_ld
687 ])
688
689 dnl From libtool-1.4. Sets the variable LD.
690 AC_DEFUN([AC_LIB_PROG_LD],
691 [AC_ARG_WITH(gnu-ld,
692 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
693 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
694 AC_REQUIRE([AC_PROG_CC])dnl
695 AC_REQUIRE([AC_CANONICAL_HOST])dnl
696 # Prepare PATH_SEPARATOR.
697 # The user is always right.
698 if test "${PATH_SEPARATOR+set}" != set; then
699   echo "#! /bin/sh" >conf$$.sh
700   echo  "exit 0"   >>conf$$.sh
701   chmod +x conf$$.sh
702   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
703     PATH_SEPARATOR=';'
704   else
705     PATH_SEPARATOR=:
706   fi
707   rm -f conf$$.sh
708 fi
709 ac_prog=ld
710 if test "$GCC" = yes; then
711   # Check if gcc -print-prog-name=ld gives a path.
712   AC_MSG_CHECKING([for ld used by GCC])
713   case $host in
714   *-*-mingw*)
715     # gcc leaves a trailing carriage return which upsets mingw
716     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
717   *)
718     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
719   esac
720   case $ac_prog in
721     # Accept absolute paths.
722     [[\\/]* | [A-Za-z]:[\\/]*)]
723       [re_direlt='/[^/][^/]*/\.\./']
724       # Canonicalize the path of ld
725       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
726       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
727         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
728       done
729       test -z "$LD" && LD="$ac_prog"
730       ;;
731   "")
732     # If it fails, then pretend we aren't using GCC.
733     ac_prog=ld
734     ;;
735   *)
736     # If it is relative, then search for the first ld in PATH.
737     with_gnu_ld=unknown
738     ;;
739   esac
740 elif test "$with_gnu_ld" = yes; then
741   AC_MSG_CHECKING([for GNU ld])
742 else
743   AC_MSG_CHECKING([for non-GNU ld])
744 fi
745 AC_CACHE_VAL(acl_cv_path_LD,
746 [if test -z "$LD"; then
747   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
748   for ac_dir in $PATH; do
749     test -z "$ac_dir" && ac_dir=.
750     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
751       acl_cv_path_LD="$ac_dir/$ac_prog"
752       # Check to see if the program is GNU ld.  I'd rather use --version,
753       # but apparently some GNU ld's only accept -v.
754       # Break only if it was the GNU/non-GNU ld that we prefer.
755       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
756       *GNU* | *'with BFD'*)
757         test "$with_gnu_ld" != no && break ;;
758       *)
759         test "$with_gnu_ld" != yes && break ;;
760       esac
761     fi
762   done
763   IFS="$ac_save_ifs"
764 else
765   acl_cv_path_LD="$LD" # Let the user override the test with a path.
766 fi])
767 LD="$acl_cv_path_LD"
768 if test -n "$LD"; then
769   AC_MSG_RESULT($LD)
770 else
771   AC_MSG_RESULT(no)
772 fi
773 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
774 AC_LIB_PROG_LD_GNU
775 ])
776
777 # lib-link.m4 serial 6 (gettext-0.14.3)
778 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
779 dnl This file is free software; the Free Software Foundation
780 dnl gives unlimited permission to copy and/or distribute it,
781 dnl with or without modifications, as long as this notice is preserved.
782
783 dnl From Bruno Haible.
784
785 AC_PREREQ(2.50)
786
787 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
788 dnl the libraries corresponding to explicit and implicit dependencies.
789 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
790 dnl augments the CPPFLAGS variable.
791 AC_DEFUN([AC_LIB_LINKFLAGS],
792 [
793   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
794   AC_REQUIRE([AC_LIB_RPATH])
795   define([Name],[translit([$1],[./-], [___])])
796   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
797                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
798   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
799     AC_LIB_LINKFLAGS_BODY([$1], [$2])
800     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
801     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
802     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
803   ])
804   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
805   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
806   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
807   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
808   AC_SUBST([LIB]NAME)
809   AC_SUBST([LTLIB]NAME)
810   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
811   dnl results of this search when this library appears as a dependency.
812   HAVE_LIB[]NAME=yes
813   undefine([Name])
814   undefine([NAME])
815 ])
816
817 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
818 dnl searches for libname and the libraries corresponding to explicit and
819 dnl implicit dependencies, together with the specified include files and
820 dnl the ability to compile and link the specified testcode. If found, it
821 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
822 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
823 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
824 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
825 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
826 [
827   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
828   AC_REQUIRE([AC_LIB_RPATH])
829   define([Name],[translit([$1],[./-], [___])])
830   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
831                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
832
833   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
834   dnl accordingly.
835   AC_LIB_LINKFLAGS_BODY([$1], [$2])
836
837   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
838   dnl because if the user has installed lib[]Name and not disabled its use
839   dnl via --without-lib[]Name-prefix, he wants to use it.
840   ac_save_CPPFLAGS="$CPPFLAGS"
841   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
842
843   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
844     ac_save_LIBS="$LIBS"
845     LIBS="$LIBS $LIB[]NAME"
846     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
847     LIBS="$ac_save_LIBS"
848   ])
849   if test "$ac_cv_lib[]Name" = yes; then
850     HAVE_LIB[]NAME=yes
851     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
852     AC_MSG_CHECKING([how to link with lib[]$1])
853     AC_MSG_RESULT([$LIB[]NAME])
854   else
855     HAVE_LIB[]NAME=no
856     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
857     dnl $INC[]NAME either.
858     CPPFLAGS="$ac_save_CPPFLAGS"
859     LIB[]NAME=
860     LTLIB[]NAME=
861   fi
862   AC_SUBST([HAVE_LIB]NAME)
863   AC_SUBST([LIB]NAME)
864   AC_SUBST([LTLIB]NAME)
865   undefine([Name])
866   undefine([NAME])
867 ])
868
869 dnl Determine the platform dependent parameters needed to use rpath:
870 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
871 dnl hardcode_direct, hardcode_minus_L.
872 AC_DEFUN([AC_LIB_RPATH],
873 [
874   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
875   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
876   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
877   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
878   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
879   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
880   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
881     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
882     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
883     . ./conftest.sh
884     rm -f ./conftest.sh
885     acl_cv_rpath=done
886   ])
887   wl="$acl_cv_wl"
888   libext="$acl_cv_libext"
889   shlibext="$acl_cv_shlibext"
890   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
891   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
892   hardcode_direct="$acl_cv_hardcode_direct"
893   hardcode_minus_L="$acl_cv_hardcode_minus_L"
894   dnl Determine whether the user wants rpath handling at all.
895   AC_ARG_ENABLE(rpath,
896     [  --disable-rpath         do not hardcode runtime library paths],
897     :, enable_rpath=yes)
898 ])
899
900 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
901 dnl the libraries corresponding to explicit and implicit dependencies.
902 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
903 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
904 [
905   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
906                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
907   dnl By default, look in $includedir and $libdir.
908   use_additional=yes
909   AC_LIB_WITH_FINAL_PREFIX([
910     eval additional_includedir=\"$includedir\"
911     eval additional_libdir=\"$libdir\"
912   ])
913   AC_LIB_ARG_WITH([lib$1-prefix],
914 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
915   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
916 [
917     if test "X$withval" = "Xno"; then
918       use_additional=no
919     else
920       if test "X$withval" = "X"; then
921         AC_LIB_WITH_FINAL_PREFIX([
922           eval additional_includedir=\"$includedir\"
923           eval additional_libdir=\"$libdir\"
924         ])
925       else
926         additional_includedir="$withval/include"
927         additional_libdir="$withval/lib"
928       fi
929     fi
930 ])
931   dnl Search the library and its dependencies in $additional_libdir and
932   dnl $LDFLAGS. Using breadth-first-seach.
933   LIB[]NAME=
934   LTLIB[]NAME=
935   INC[]NAME=
936   rpathdirs=
937   ltrpathdirs=
938   names_already_handled=
939   names_next_round='$1 $2'
940   while test -n "$names_next_round"; do
941     names_this_round="$names_next_round"
942     names_next_round=
943     for name in $names_this_round; do
944       already_handled=
945       for n in $names_already_handled; do
946         if test "$n" = "$name"; then
947           already_handled=yes
948           break
949         fi
950       done
951       if test -z "$already_handled"; then
952         names_already_handled="$names_already_handled $name"
953         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
954         dnl or AC_LIB_HAVE_LINKFLAGS call.
955         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
956         eval value=\"\$HAVE_LIB$uppername\"
957         if test -n "$value"; then
958           if test "$value" = yes; then
959             eval value=\"\$LIB$uppername\"
960             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
961             eval value=\"\$LTLIB$uppername\"
962             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
963           else
964             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
965             dnl that this library doesn't exist. So just drop it.
966             :
967           fi
968         else
969           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
970           dnl and the already constructed $LIBNAME/$LTLIBNAME.
971           found_dir=
972           found_la=
973           found_so=
974           found_a=
975           if test $use_additional = yes; then
976             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
977               found_dir="$additional_libdir"
978               found_so="$additional_libdir/lib$name.$shlibext"
979               if test -f "$additional_libdir/lib$name.la"; then
980                 found_la="$additional_libdir/lib$name.la"
981               fi
982             else
983               if test -f "$additional_libdir/lib$name.$libext"; then
984                 found_dir="$additional_libdir"
985                 found_a="$additional_libdir/lib$name.$libext"
986                 if test -f "$additional_libdir/lib$name.la"; then
987                   found_la="$additional_libdir/lib$name.la"
988                 fi
989               fi
990             fi
991           fi
992           if test "X$found_dir" = "X"; then
993             for x in $LDFLAGS $LTLIB[]NAME; do
994               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
995               case "$x" in
996                 -L*)
997                   dir=`echo "X$x" | sed -e 's/^X-L//'`
998                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
999                     found_dir="$dir"
1000                     found_so="$dir/lib$name.$shlibext"
1001                     if test -f "$dir/lib$name.la"; then
1002                       found_la="$dir/lib$name.la"
1003                     fi
1004                   else
1005                     if test -f "$dir/lib$name.$libext"; then
1006                       found_dir="$dir"
1007                       found_a="$dir/lib$name.$libext"
1008                       if test -f "$dir/lib$name.la"; then
1009                         found_la="$dir/lib$name.la"
1010                       fi
1011                     fi
1012                   fi
1013                   ;;
1014               esac
1015               if test "X$found_dir" != "X"; then
1016                 break
1017               fi
1018             done
1019           fi
1020           if test "X$found_dir" != "X"; then
1021             dnl Found the library.
1022             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1023             if test "X$found_so" != "X"; then
1024               dnl Linking with a shared library. We attempt to hardcode its
1025               dnl directory into the executable's runpath, unless it's the
1026               dnl standard /usr/lib.
1027               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1028                 dnl No hardcoding is needed.
1029                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1030               else
1031                 dnl Use an explicit option to hardcode DIR into the resulting
1032                 dnl binary.
1033                 dnl Potentially add DIR to ltrpathdirs.
1034                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1035                 haveit=
1036                 for x in $ltrpathdirs; do
1037                   if test "X$x" = "X$found_dir"; then
1038                     haveit=yes
1039                     break
1040                   fi
1041                 done
1042                 if test -z "$haveit"; then
1043                   ltrpathdirs="$ltrpathdirs $found_dir"
1044                 fi
1045                 dnl The hardcoding into $LIBNAME is system dependent.
1046                 if test "$hardcode_direct" = yes; then
1047                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1048                   dnl resulting binary.
1049                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1050                 else
1051                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1052                     dnl Use an explicit option to hardcode DIR into the resulting
1053                     dnl binary.
1054                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1055                     dnl Potentially add DIR to rpathdirs.
1056                     dnl The rpathdirs will be appended to $LIBNAME at the end.
1057                     haveit=
1058                     for x in $rpathdirs; do
1059                       if test "X$x" = "X$found_dir"; then
1060                         haveit=yes
1061                         break
1062                       fi
1063                     done
1064                     if test -z "$haveit"; then
1065                       rpathdirs="$rpathdirs $found_dir"
1066                     fi
1067                   else
1068                     dnl Rely on "-L$found_dir".
1069                     dnl But don't add it if it's already contained in the LDFLAGS
1070                     dnl or the already constructed $LIBNAME
1071                     haveit=
1072                     for x in $LDFLAGS $LIB[]NAME; do
1073                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1074                       if test "X$x" = "X-L$found_dir"; then
1075                         haveit=yes
1076                         break
1077                       fi
1078                     done
1079                     if test -z "$haveit"; then
1080                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1081                     fi
1082                     if test "$hardcode_minus_L" != no; then
1083                       dnl FIXME: Not sure whether we should use
1084                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1085                       dnl here.
1086                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1087                     else
1088                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1089                       dnl here, because this doesn't fit in flags passed to the
1090                       dnl compiler. So give up. No hardcoding. This affects only
1091                       dnl very old systems.
1092                       dnl FIXME: Not sure whether we should use
1093                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1094                       dnl here.
1095                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1096                     fi
1097                   fi
1098                 fi
1099               fi
1100             else
1101               if test "X$found_a" != "X"; then
1102                 dnl Linking with a static library.
1103                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1104               else
1105                 dnl We shouldn't come here, but anyway it's good to have a
1106                 dnl fallback.
1107                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1108               fi
1109             fi
1110             dnl Assume the include files are nearby.
1111             additional_includedir=
1112             case "$found_dir" in
1113               */lib | */lib/)
1114                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1115                 additional_includedir="$basedir/include"
1116                 ;;
1117             esac
1118             if test "X$additional_includedir" != "X"; then
1119               dnl Potentially add $additional_includedir to $INCNAME.
1120               dnl But don't add it
1121               dnl   1. if it's the standard /usr/include,
1122               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1123               dnl   3. if it's already present in $CPPFLAGS or the already
1124               dnl      constructed $INCNAME,
1125               dnl   4. if it doesn't exist as a directory.
1126               if test "X$additional_includedir" != "X/usr/include"; then
1127                 haveit=
1128                 if test "X$additional_includedir" = "X/usr/local/include"; then
1129                   if test -n "$GCC"; then
1130                     case $host_os in
1131                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1132                     esac
1133                   fi
1134                 fi
1135                 if test -z "$haveit"; then
1136                   for x in $CPPFLAGS $INC[]NAME; do
1137                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1138                     if test "X$x" = "X-I$additional_includedir"; then
1139                       haveit=yes
1140                       break
1141                     fi
1142                   done
1143                   if test -z "$haveit"; then
1144                     if test -d "$additional_includedir"; then
1145                       dnl Really add $additional_includedir to $INCNAME.
1146                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1147                     fi
1148                   fi
1149                 fi
1150               fi
1151             fi
1152             dnl Look for dependencies.
1153             if test -n "$found_la"; then
1154               dnl Read the .la file. It defines the variables
1155               dnl dlname, library_names, old_library, dependency_libs, current,
1156               dnl age, revision, installed, dlopen, dlpreopen, libdir.
1157               save_libdir="$libdir"
1158               case "$found_la" in
1159                 */* | *\\*) . "$found_la" ;;
1160                 *) . "./$found_la" ;;
1161               esac
1162               libdir="$save_libdir"
1163               dnl We use only dependency_libs.
1164               for dep in $dependency_libs; do
1165                 case "$dep" in
1166                   -L*)
1167                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1168                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1169                     dnl But don't add it
1170                     dnl   1. if it's the standard /usr/lib,
1171                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1172                     dnl   3. if it's already present in $LDFLAGS or the already
1173                     dnl      constructed $LIBNAME,
1174                     dnl   4. if it doesn't exist as a directory.
1175                     if test "X$additional_libdir" != "X/usr/lib"; then
1176                       haveit=
1177                       if test "X$additional_libdir" = "X/usr/local/lib"; then
1178                         if test -n "$GCC"; then
1179                           case $host_os in
1180                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1181                           esac
1182                         fi
1183                       fi
1184                       if test -z "$haveit"; then
1185                         haveit=
1186                         for x in $LDFLAGS $LIB[]NAME; do
1187                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1188                           if test "X$x" = "X-L$additional_libdir"; then
1189                             haveit=yes
1190                             break
1191                           fi
1192                         done
1193                         if test -z "$haveit"; then
1194                           if test -d "$additional_libdir"; then
1195                             dnl Really add $additional_libdir to $LIBNAME.
1196                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1197                           fi
1198                         fi
1199                         haveit=
1200                         for x in $LDFLAGS $LTLIB[]NAME; do
1201                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1202                           if test "X$x" = "X-L$additional_libdir"; then
1203                             haveit=yes
1204                             break
1205                           fi
1206                         done
1207                         if test -z "$haveit"; then
1208                           if test -d "$additional_libdir"; then
1209                             dnl Really add $additional_libdir to $LTLIBNAME.
1210                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1211                           fi
1212                         fi
1213                       fi
1214                     fi
1215                     ;;
1216                   -R*)
1217                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
1218                     if test "$enable_rpath" != no; then
1219                       dnl Potentially add DIR to rpathdirs.
1220                       dnl The rpathdirs will be appended to $LIBNAME at the end.
1221                       haveit=
1222                       for x in $rpathdirs; do
1223                         if test "X$x" = "X$dir"; then
1224                           haveit=yes
1225                           break
1226                         fi
1227                       done
1228                       if test -z "$haveit"; then
1229                         rpathdirs="$rpathdirs $dir"
1230                       fi
1231                       dnl Potentially add DIR to ltrpathdirs.
1232                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1233                       haveit=
1234                       for x in $ltrpathdirs; do
1235                         if test "X$x" = "X$dir"; then
1236                           haveit=yes
1237                           break
1238                         fi
1239                       done
1240                       if test -z "$haveit"; then
1241                         ltrpathdirs="$ltrpathdirs $dir"
1242                       fi
1243                     fi
1244                     ;;
1245                   -l*)
1246                     dnl Handle this in the next round.
1247                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1248                     ;;
1249                   *.la)
1250                     dnl Handle this in the next round. Throw away the .la's
1251                     dnl directory; it is already contained in a preceding -L
1252                     dnl option.
1253                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1254                     ;;
1255                   *)
1256                     dnl Most likely an immediate library name.
1257                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1258                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1259                     ;;
1260                 esac
1261               done
1262             fi
1263           else
1264             dnl Didn't find the library; assume it is in the system directories
1265             dnl known to the linker and runtime loader. (All the system
1266             dnl directories known to the linker should also be known to the
1267             dnl runtime loader, otherwise the system is severely misconfigured.)
1268             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1269             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1270           fi
1271         fi
1272       fi
1273     done
1274   done
1275   if test "X$rpathdirs" != "X"; then
1276     if test -n "$hardcode_libdir_separator"; then
1277       dnl Weird platform: only the last -rpath option counts, the user must
1278       dnl pass all path elements in one option. We can arrange that for a
1279       dnl single library, but not when more than one $LIBNAMEs are used.
1280       alldirs=
1281       for found_dir in $rpathdirs; do
1282         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1283       done
1284       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1285       acl_save_libdir="$libdir"
1286       libdir="$alldirs"
1287       eval flag=\"$hardcode_libdir_flag_spec\"
1288       libdir="$acl_save_libdir"
1289       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1290     else
1291       dnl The -rpath options are cumulative.
1292       for found_dir in $rpathdirs; do
1293         acl_save_libdir="$libdir"
1294         libdir="$found_dir"
1295         eval flag=\"$hardcode_libdir_flag_spec\"
1296         libdir="$acl_save_libdir"
1297         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1298       done
1299     fi
1300   fi
1301   if test "X$ltrpathdirs" != "X"; then
1302     dnl When using libtool, the option that works for both libraries and
1303     dnl executables is -R. The -R options are cumulative.
1304     for found_dir in $ltrpathdirs; do
1305       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1306     done
1307   fi
1308 ])
1309
1310 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1311 dnl unless already present in VAR.
1312 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1313 dnl contains two or three consecutive elements that belong together.
1314 AC_DEFUN([AC_LIB_APPENDTOVAR],
1315 [
1316   for element in [$2]; do
1317     haveit=
1318     for x in $[$1]; do
1319       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1320       if test "X$x" = "X$element"; then
1321         haveit=yes
1322         break
1323       fi
1324     done
1325     if test -z "$haveit"; then
1326       [$1]="${[$1]}${[$1]:+ }$element"
1327     fi
1328   done
1329 ])
1330
1331 # lib-prefix.m4 serial 4 (gettext-0.14.2)
1332 dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1333 dnl This file is free software; the Free Software Foundation
1334 dnl gives unlimited permission to copy and/or distribute it,
1335 dnl with or without modifications, as long as this notice is preserved.
1336
1337 dnl From Bruno Haible.
1338
1339 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1340 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1341 dnl require excessive bracketing.
1342 ifdef([AC_HELP_STRING],
1343 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1344 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1345
1346 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1347 dnl to access previously installed libraries. The basic assumption is that
1348 dnl a user will want packages to use other packages he previously installed
1349 dnl with the same --prefix option.
1350 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1351 dnl libraries, but is otherwise very convenient.
1352 AC_DEFUN([AC_LIB_PREFIX],
1353 [
1354   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1355   AC_REQUIRE([AC_PROG_CC])
1356   AC_REQUIRE([AC_CANONICAL_HOST])
1357   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1358   dnl By default, look in $includedir and $libdir.
1359   use_additional=yes
1360   AC_LIB_WITH_FINAL_PREFIX([
1361     eval additional_includedir=\"$includedir\"
1362     eval additional_libdir=\"$libdir\"
1363   ])
1364   AC_LIB_ARG_WITH([lib-prefix],
1365 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1366   --without-lib-prefix    don't search for libraries in includedir and libdir],
1367 [
1368     if test "X$withval" = "Xno"; then
1369       use_additional=no
1370     else
1371       if test "X$withval" = "X"; then
1372         AC_LIB_WITH_FINAL_PREFIX([
1373           eval additional_includedir=\"$includedir\"
1374           eval additional_libdir=\"$libdir\"
1375         ])
1376       else
1377         additional_includedir="$withval/include"
1378         additional_libdir="$withval/lib"
1379       fi
1380     fi
1381 ])
1382   if test $use_additional = yes; then
1383     dnl Potentially add $additional_includedir to $CPPFLAGS.
1384     dnl But don't add it
1385     dnl   1. if it's the standard /usr/include,
1386     dnl   2. if it's already present in $CPPFLAGS,
1387     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1388     dnl   4. if it doesn't exist as a directory.
1389     if test "X$additional_includedir" != "X/usr/include"; then
1390       haveit=
1391       for x in $CPPFLAGS; do
1392         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1393         if test "X$x" = "X-I$additional_includedir"; then
1394           haveit=yes
1395           break
1396         fi
1397       done
1398       if test -z "$haveit"; then
1399         if test "X$additional_includedir" = "X/usr/local/include"; then
1400           if test -n "$GCC"; then
1401             case $host_os in
1402               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1403             esac
1404           fi
1405         fi
1406         if test -z "$haveit"; then
1407           if test -d "$additional_includedir"; then
1408             dnl Really add $additional_includedir to $CPPFLAGS.
1409             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1410           fi
1411         fi
1412       fi
1413     fi
1414     dnl Potentially add $additional_libdir to $LDFLAGS.
1415     dnl But don't add it
1416     dnl   1. if it's the standard /usr/lib,
1417     dnl   2. if it's already present in $LDFLAGS,
1418     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1419     dnl   4. if it doesn't exist as a directory.
1420     if test "X$additional_libdir" != "X/usr/lib"; then
1421       haveit=
1422       for x in $LDFLAGS; do
1423         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1424         if test "X$x" = "X-L$additional_libdir"; then
1425           haveit=yes
1426           break
1427         fi
1428       done
1429       if test -z "$haveit"; then
1430         if test "X$additional_libdir" = "X/usr/local/lib"; then
1431           if test -n "$GCC"; then
1432             case $host_os in
1433               linux*) haveit=yes;;
1434             esac
1435           fi
1436         fi
1437         if test -z "$haveit"; then
1438           if test -d "$additional_libdir"; then
1439             dnl Really add $additional_libdir to $LDFLAGS.
1440             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1441           fi
1442         fi
1443       fi
1444     fi
1445   fi
1446 ])
1447
1448 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1449 dnl acl_final_exec_prefix, containing the values to which $prefix and
1450 dnl $exec_prefix will expand at the end of the configure script.
1451 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1452 [
1453   dnl Unfortunately, prefix and exec_prefix get only finally determined
1454   dnl at the end of configure.
1455   if test "X$prefix" = "XNONE"; then
1456     acl_final_prefix="$ac_default_prefix"
1457   else
1458     acl_final_prefix="$prefix"
1459   fi
1460   if test "X$exec_prefix" = "XNONE"; then
1461     acl_final_exec_prefix='${prefix}'
1462   else
1463     acl_final_exec_prefix="$exec_prefix"
1464   fi
1465   acl_save_prefix="$prefix"
1466   prefix="$acl_final_prefix"
1467   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1468   prefix="$acl_save_prefix"
1469 ])
1470
1471 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1472 dnl variables prefix and exec_prefix bound to the values they will have
1473 dnl at the end of the configure script.
1474 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1475 [
1476   acl_save_prefix="$prefix"
1477   prefix="$acl_final_prefix"
1478   acl_save_exec_prefix="$exec_prefix"
1479   exec_prefix="$acl_final_exec_prefix"
1480   $1
1481   exec_prefix="$acl_save_exec_prefix"
1482   prefix="$acl_save_prefix"
1483 ])
1484
1485 # nls.m4 serial 2 (gettext-0.14.3)
1486 dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
1487 dnl This file is free software; the Free Software Foundation
1488 dnl gives unlimited permission to copy and/or distribute it,
1489 dnl with or without modifications, as long as this notice is preserved.
1490 dnl
1491 dnl This file can can be used in projects which are not available under
1492 dnl the GNU General Public License or the GNU Library General Public
1493 dnl License but which still want to provide support for the GNU gettext
1494 dnl functionality.
1495 dnl Please note that the actual code of the GNU gettext library is covered
1496 dnl by the GNU Library General Public License, and the rest of the GNU
1497 dnl gettext package package is covered by the GNU General Public License.
1498 dnl They are *not* in the public domain.
1499
1500 dnl Authors:
1501 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1502 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1503
1504 AC_PREREQ(2.50)
1505
1506 AC_DEFUN([AM_NLS],
1507 [
1508   AC_MSG_CHECKING([whether NLS is requested])
1509   dnl Default is enabled NLS
1510   AC_ARG_ENABLE(nls,
1511     [  --disable-nls           do not use Native Language Support],
1512     USE_NLS=$enableval, USE_NLS=yes)
1513   AC_MSG_RESULT($USE_NLS)
1514   AC_SUBST(USE_NLS)
1515 ])
1516
1517 AC_DEFUN([AM_MKINSTALLDIRS],
1518 [
1519   dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing.
1520   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])])
1521   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1522   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1523   dnl Try to locate it.
1524   MKINSTALLDIRS=
1525   if test -n "$ac_aux_dir"; then
1526     case "$ac_aux_dir" in
1527       /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1528       *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1529     esac
1530   fi
1531   if test -z "$MKINSTALLDIRS"; then
1532     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1533   fi
1534   AC_SUBST(MKINSTALLDIRS)
1535 ])
1536
1537 # po.m4 serial 7 (gettext-0.14.3)
1538 dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
1539 dnl This file is free software; the Free Software Foundation
1540 dnl gives unlimited permission to copy and/or distribute it,
1541 dnl with or without modifications, as long as this notice is preserved.
1542 dnl
1543 dnl This file can can be used in projects which are not available under
1544 dnl the GNU General Public License or the GNU Library General Public
1545 dnl License but which still want to provide support for the GNU gettext
1546 dnl functionality.
1547 dnl Please note that the actual code of the GNU gettext library is covered
1548 dnl by the GNU Library General Public License, and the rest of the GNU
1549 dnl gettext package package is covered by the GNU General Public License.
1550 dnl They are *not* in the public domain.
1551
1552 dnl Authors:
1553 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1554 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1555
1556 AC_PREREQ(2.50)
1557
1558 dnl Checks for all prerequisites of the po subdirectory.
1559 AC_DEFUN([AM_PO_SUBDIRS],
1560 [
1561   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1562   AC_REQUIRE([AC_PROG_INSTALL])dnl
1563   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1564   AC_REQUIRE([AM_NLS])dnl
1565
1566   dnl Perform the following tests also if --disable-nls has been given,
1567   dnl because they are needed for "make dist" to work.
1568
1569   dnl Search for GNU msgfmt in the PATH.
1570   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1571   dnl The second test excludes FreeBSD msgfmt.
1572   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1573     [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1574      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1575     :)
1576   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1577
1578   dnl Search for GNU xgettext 0.12 or newer in the PATH.
1579   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1580   dnl The second test excludes FreeBSD xgettext.
1581   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1582     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1583      (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)],
1584     :)
1585   dnl Remove leftover from FreeBSD xgettext call.
1586   rm -f messages.po
1587
1588   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1589   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1590     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1591
1592   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1593   dnl Test whether we really found GNU msgfmt.
1594   if test "$GMSGFMT" != ":"; then
1595     dnl If it is no GNU msgfmt we define it as : so that the
1596     dnl Makefiles still can work.
1597     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1598        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1599       : ;
1600     else
1601       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1602       AC_MSG_RESULT(
1603         [found $GMSGFMT program is not GNU msgfmt; ignore it])
1604       GMSGFMT=":"
1605     fi
1606   fi
1607
1608   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1609   dnl Test whether we really found GNU xgettext.
1610   if test "$XGETTEXT" != ":"; then
1611     dnl If it is no GNU xgettext we define it as : so that the
1612     dnl Makefiles still can work.
1613     if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1614        (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
1615       : ;
1616     else
1617       AC_MSG_RESULT(
1618         [found xgettext program is not GNU xgettext; ignore it])
1619       XGETTEXT=":"
1620     fi
1621     dnl Remove leftover from FreeBSD xgettext call.
1622     rm -f messages.po
1623   fi
1624
1625   AC_OUTPUT_COMMANDS([
1626     for ac_file in $CONFIG_FILES; do
1627       # Support "outfile[:infile[:infile...]]"
1628       case "$ac_file" in
1629         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1630       esac
1631       # PO directories have a Makefile.in generated from Makefile.in.in.
1632       case "$ac_file" in */Makefile.in)
1633         # Adjust a relative srcdir.
1634         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1635         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1636         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1637         # In autoconf-2.13 it is called $ac_given_srcdir.
1638         # In autoconf-2.50 it is called $srcdir.
1639         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1640         case "$ac_given_srcdir" in
1641           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1642           /*) top_srcdir="$ac_given_srcdir" ;;
1643           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1644         esac
1645         # Treat a directory as a PO directory if and only if it has a
1646         # POTFILES.in file. This allows packages to have multiple PO
1647         # directories under different names or in different locations.
1648         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1649           rm -f "$ac_dir/POTFILES"
1650           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1651           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1652           POMAKEFILEDEPS="POTFILES.in"
1653           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1654           # on $ac_dir but don't depend on user-specified configuration
1655           # parameters.
1656           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1657             # The LINGUAS file contains the set of available languages.
1658             if test -n "$OBSOLETE_ALL_LINGUAS"; then
1659               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1660             fi
1661             ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1662             # Hide the ALL_LINGUAS assigment from automake.
1663             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1664             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1665           else
1666             # The set of available languages was given in configure.in.
1667             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1668           fi
1669           # Compute POFILES
1670           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1671           # Compute UPDATEPOFILES
1672           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1673           # Compute DUMMYPOFILES
1674           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1675           # Compute GMOFILES
1676           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1677           case "$ac_given_srcdir" in
1678             .) srcdirpre= ;;
1679             *) srcdirpre='$(srcdir)/' ;;
1680           esac
1681           POFILES=
1682           UPDATEPOFILES=
1683           DUMMYPOFILES=
1684           GMOFILES=
1685           for lang in $ALL_LINGUAS; do
1686             POFILES="$POFILES $srcdirpre$lang.po"
1687             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1688             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1689             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1690           done
1691           # CATALOGS depends on both $ac_dir and the user's LINGUAS
1692           # environment variable.
1693           INST_LINGUAS=
1694           if test -n "$ALL_LINGUAS"; then
1695             for presentlang in $ALL_LINGUAS; do
1696               useit=no
1697               if test "%UNSET%" != "$LINGUAS"; then
1698                 desiredlanguages="$LINGUAS"
1699               else
1700                 desiredlanguages="$ALL_LINGUAS"
1701               fi
1702               for desiredlang in $desiredlanguages; do
1703                 # Use the presentlang catalog if desiredlang is
1704                 #   a. equal to presentlang, or
1705                 #   b. a variant of presentlang (because in this case,
1706                 #      presentlang can be used as a fallback for messages
1707                 #      which are not translated in the desiredlang catalog).
1708                 case "$desiredlang" in
1709                   "$presentlang"*) useit=yes;;
1710                 esac
1711               done
1712               if test $useit = yes; then
1713                 INST_LINGUAS="$INST_LINGUAS $presentlang"
1714               fi
1715             done
1716           fi
1717           CATALOGS=
1718           if test -n "$INST_LINGUAS"; then
1719             for lang in $INST_LINGUAS; do
1720               CATALOGS="$CATALOGS $lang.gmo"
1721             done
1722           fi
1723           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1724           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"
1725           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1726             if test -f "$f"; then
1727               case "$f" in
1728                 *.orig | *.bak | *~) ;;
1729                 *) cat "$f" >> "$ac_dir/Makefile" ;;
1730               esac
1731             fi
1732           done
1733         fi
1734         ;;
1735       esac
1736     done],
1737    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1738     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
1739     # from automake.
1740     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1741     # Capture the value of LINGUAS because we need it to compute CATALOGS.
1742     LINGUAS="${LINGUAS-%UNSET%}"
1743    ])
1744 ])
1745
1746 dnl Postprocesses a Makefile in a directory containing PO files.
1747 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
1748 [
1749   # When this code is run, in config.status, two variables have already been
1750   # set:
1751   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
1752   # - LINGUAS is the value of the environment variable LINGUAS at configure
1753   #   time.
1754
1755 changequote(,)dnl
1756   # Adjust a relative srcdir.
1757   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1758   ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1759   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1760   # In autoconf-2.13 it is called $ac_given_srcdir.
1761   # In autoconf-2.50 it is called $srcdir.
1762   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1763   case "$ac_given_srcdir" in
1764     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1765     /*) top_srcdir="$ac_given_srcdir" ;;
1766     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1767   esac
1768
1769   # Find a way to echo strings without interpreting backslash.
1770   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
1771     gt_echo='echo'
1772   else
1773     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
1774       gt_echo='printf %s\n'
1775     else
1776       echo_func () {
1777         cat <<EOT
1778 $*
1779 EOT
1780       }
1781       gt_echo='echo_func'
1782     fi
1783   fi
1784
1785   # A sed script that extracts the value of VARIABLE from a Makefile.
1786   sed_x_variable='
1787 # Test if the hold space is empty.
1788 x
1789 s/P/P/
1790 x
1791 ta
1792 # Yes it was empty. Look if we have the expected variable definition.
1793 /^[      ]*VARIABLE[     ]*=/{
1794   # Seen the first line of the variable definition.
1795   s/^[   ]*VARIABLE[     ]*=//
1796   ba
1797 }
1798 bd
1799 :a
1800 # Here we are processing a line from the variable definition.
1801 # Remove comment, more precisely replace it with a space.
1802 s/#.*$/ /
1803 # See if the line ends in a backslash.
1804 tb
1805 :b
1806 s/\\$//
1807 # Print the line, without the trailing backslash.
1808 p
1809 tc
1810 # There was no trailing backslash. The end of the variable definition is
1811 # reached. Clear the hold space.
1812 s/^.*$//
1813 x
1814 bd
1815 :c
1816 # A trailing backslash means that the variable definition continues in the
1817 # next line. Put a nonempty string into the hold space to indicate this.
1818 s/^.*$/P/
1819 x
1820 :d
1821 '
1822 changequote([,])dnl
1823
1824   # Set POTFILES to the value of the Makefile variable POTFILES.
1825   sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
1826   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
1827   # Compute POTFILES_DEPS as
1828   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
1829   POTFILES_DEPS=
1830   for file in $POTFILES; do
1831     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
1832   done
1833   POMAKEFILEDEPS=""
1834
1835   if test -n "$OBSOLETE_ALL_LINGUAS"; then
1836     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1837   fi
1838   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1839     # The LINGUAS file contains the set of available languages.
1840     ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1841     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1842   else
1843     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
1844     sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
1845     ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
1846   fi
1847   # Hide the ALL_LINGUAS assigment from automake.
1848   eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1849   # Compute POFILES
1850   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1851   # Compute UPDATEPOFILES
1852   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1853   # Compute DUMMYPOFILES
1854   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1855   # Compute GMOFILES
1856   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1857   # Compute PROPERTIESFILES
1858   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1859   # Compute CLASSFILES
1860   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
1861   # Compute QMFILES
1862   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
1863   # Compute MSGFILES
1864   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
1865   # Compute RESOURCESDLLFILES
1866   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
1867   case "$ac_given_srcdir" in
1868     .) srcdirpre= ;;
1869     *) srcdirpre='$(srcdir)/' ;;
1870   esac
1871   POFILES=
1872   UPDATEPOFILES=
1873   DUMMYPOFILES=
1874   GMOFILES=
1875   PROPERTIESFILES=
1876   CLASSFILES=
1877   QMFILES=
1878   MSGFILES=
1879   RESOURCESDLLFILES=
1880   for lang in $ALL_LINGUAS; do
1881     POFILES="$POFILES $srcdirpre$lang.po"
1882     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1883     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1884     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1885     PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
1886     CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
1887     QMFILES="$QMFILES $srcdirpre$lang.qm"
1888     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1889     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
1890     frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1891     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
1892   done
1893   # CATALOGS depends on both $ac_dir and the user's LINGUAS
1894   # environment variable.
1895   INST_LINGUAS=
1896   if test -n "$ALL_LINGUAS"; then
1897     for presentlang in $ALL_LINGUAS; do
1898       useit=no
1899       if test "%UNSET%" != "$LINGUAS"; then
1900         desiredlanguages="$LINGUAS"
1901       else
1902         desiredlanguages="$ALL_LINGUAS"
1903       fi
1904       for desiredlang in $desiredlanguages; do
1905         # Use the presentlang catalog if desiredlang is
1906         #   a. equal to presentlang, or
1907         #   b. a variant of presentlang (because in this case,
1908         #      presentlang can be used as a fallback for messages
1909         #      which are not translated in the desiredlang catalog).
1910         case "$desiredlang" in
1911           "$presentlang"*) useit=yes;;
1912         esac
1913       done
1914       if test $useit = yes; then
1915         INST_LINGUAS="$INST_LINGUAS $presentlang"
1916       fi
1917     done
1918   fi
1919   CATALOGS=
1920   JAVACATALOGS=
1921   QTCATALOGS=
1922   TCLCATALOGS=
1923   CSHARPCATALOGS=
1924   if test -n "$INST_LINGUAS"; then
1925     for lang in $INST_LINGUAS; do
1926       CATALOGS="$CATALOGS $lang.gmo"
1927       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
1928       QTCATALOGS="$QTCATALOGS $lang.qm"
1929       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1930       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
1931       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1932       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
1933     done
1934   fi
1935
1936   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"
1937   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
1938     # Add dependencies that cannot be formulated as a simple suffix rule.
1939     for lang in $ALL_LINGUAS; do
1940       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1941       cat >> "$ac_file.tmp" <<EOF
1942 $frobbedlang.msg: $lang.po
1943         @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
1944         \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1945 EOF
1946     done
1947   fi
1948   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
1949     # Add dependencies that cannot be formulated as a simple suffix rule.
1950     for lang in $ALL_LINGUAS; do
1951       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
1952       cat >> "$ac_file.tmp" <<EOF
1953 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
1954         @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
1955         \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1956 EOF
1957     done
1958   fi
1959   if test -n "$POMAKEFILEDEPS"; then
1960     cat >> "$ac_file.tmp" <<EOF
1961 Makefile: $POMAKEFILEDEPS
1962 EOF
1963   fi
1964   mv "$ac_file.tmp" "$ac_file"
1965 ])
1966
1967 # progtest.m4 serial 4 (gettext-0.14.2)
1968 dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
1969 dnl This file is free software; the Free Software Foundation
1970 dnl gives unlimited permission to copy and/or distribute it,
1971 dnl with or without modifications, as long as this notice is preserved.
1972 dnl
1973 dnl This file can can be used in projects which are not available under
1974 dnl the GNU General Public License or the GNU Library General Public
1975 dnl License but which still want to provide support for the GNU gettext
1976 dnl functionality.
1977 dnl Please note that the actual code of the GNU gettext library is covered
1978 dnl by the GNU Library General Public License, and the rest of the GNU
1979 dnl gettext package package is covered by the GNU General Public License.
1980 dnl They are *not* in the public domain.
1981
1982 dnl Authors:
1983 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
1984
1985 AC_PREREQ(2.50)
1986
1987 # Search path for a program which passes the given test.
1988
1989 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1990 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1991 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1992 [
1993 # Prepare PATH_SEPARATOR.
1994 # The user is always right.
1995 if test "${PATH_SEPARATOR+set}" != set; then
1996   echo "#! /bin/sh" >conf$$.sh
1997   echo  "exit 0"   >>conf$$.sh
1998   chmod +x conf$$.sh
1999   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2000     PATH_SEPARATOR=';'
2001   else
2002     PATH_SEPARATOR=:
2003   fi
2004   rm -f conf$$.sh
2005 fi
2006
2007 # Find out how to test for executable files. Don't use a zero-byte file,
2008 # as systems may use methods other than mode bits to determine executability.
2009 cat >conf$$.file <<_ASEOF
2010 #! /bin/sh
2011 exit 0
2012 _ASEOF
2013 chmod +x conf$$.file
2014 if test -x conf$$.file >/dev/null 2>&1; then
2015   ac_executable_p="test -x"
2016 else
2017   ac_executable_p="test -f"
2018 fi
2019 rm -f conf$$.file
2020
2021 # Extract the first word of "$2", so it can be a program name with args.
2022 set dummy $2; ac_word=[$]2
2023 AC_MSG_CHECKING([for $ac_word])
2024 AC_CACHE_VAL(ac_cv_path_$1,
2025 [case "[$]$1" in
2026   [[\\/]]* | ?:[[\\/]]*)
2027     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2028     ;;
2029   *)
2030     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2031     for ac_dir in ifelse([$5], , $PATH, [$5]); do
2032       IFS="$ac_save_IFS"
2033       test -z "$ac_dir" && ac_dir=.
2034       for ac_exec_ext in '' $ac_executable_extensions; do
2035         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2036           echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2037           if [$3]; then
2038             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2039             break 2
2040           fi
2041         fi
2042       done
2043     done
2044     IFS="$ac_save_IFS"
2045 dnl If no 4th arg is given, leave the cache variable unset,
2046 dnl so AC_PATH_PROGS will keep looking.
2047 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2048 ])dnl
2049     ;;
2050 esac])dnl
2051 $1="$ac_cv_path_$1"
2052 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2053   AC_MSG_RESULT([$]$1)
2054 else
2055   AC_MSG_RESULT(no)
2056 fi
2057 AC_SUBST($1)dnl
2058 ])
2059
2060 m4_include([bacula-macros/db.m4])
2061 m4_include([bacula-macros/largefiles.m4])
2062 m4_include([bacula-macros/os.m4])