1be3e8dc73a7bc2abb9a8f710d695f63f61ebb26
[psensor-pkg-debian.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17 [m4_warning([this file was generated for autoconf 2.68.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22 # gettext.m4 serial 63 (gettext-0.18)
23 dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
24 dnl This file is free software; the Free Software Foundation
25 dnl gives unlimited permission to copy and/or distribute it,
26 dnl with or without modifications, as long as this notice is preserved.
27 dnl
28 dnl This file can can be used in projects which are not available under
29 dnl the GNU General Public License or the GNU Library General Public
30 dnl License but which still want to provide support for the GNU gettext
31 dnl functionality.
32 dnl Please note that the actual code of the GNU gettext library is covered
33 dnl by the GNU Library General Public License, and the rest of the GNU
34 dnl gettext package package is covered by the GNU General Public License.
35 dnl They are *not* in the public domain.
36
37 dnl Authors:
38 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
39 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
40
41 dnl Macro to add for using GNU gettext.
42
43 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
44 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
45 dnl    default (if it is not specified or empty) is 'no-libtool'.
46 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
47 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
48 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
49 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
50 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
51 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
52 dnl    $(top_builddir)/intl/libintl.a will be created.
53 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
54 dnl    implementations (in libc or libintl) without the ngettext() function
55 dnl    will be ignored.  If NEEDSYMBOL is specified and is
56 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
57 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
58 dnl INTLDIR is used to find the intl libraries.  If empty,
59 dnl    the value `$(top_builddir)/intl/' is used.
60 dnl
61 dnl The result of the configuration is one of three cases:
62 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
63 dnl    and used.
64 dnl    Catalog format: GNU --> install in $(datadir)
65 dnl    Catalog extension: .mo after installation, .gmo in source tree
66 dnl 2) GNU gettext has been found in the system's C library.
67 dnl    Catalog format: GNU --> install in $(datadir)
68 dnl    Catalog extension: .mo after installation, .gmo in source tree
69 dnl 3) No internationalization, always use English msgid.
70 dnl    Catalog format: none
71 dnl    Catalog extension: none
72 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
73 dnl The use of .gmo is historical (it was needed to avoid overwriting the
74 dnl GNU format catalogs when building on a platform with an X/Open gettext),
75 dnl but we keep it in order not to force irrelevant filename changes on the
76 dnl maintainers.
77 dnl
78 AC_DEFUN([AM_GNU_GETTEXT],
79 [
80   dnl Argument checking.
81   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
82     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
83 ])])])])])
84   ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
85     [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
86   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
87     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
88 ])])])])
89   define([gt_included_intl],
90     ifelse([$1], [external],
91       ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
92       [yes]))
93   define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
94   gt_NEEDS_INIT
95   AM_GNU_GETTEXT_NEED([$2])
96
97   AC_REQUIRE([AM_PO_SUBDIRS])dnl
98   ifelse(gt_included_intl, yes, [
99     AC_REQUIRE([AM_INTL_SUBDIR])dnl
100   ])
101
102   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
103   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
104   AC_REQUIRE([AC_LIB_RPATH])
105
106   dnl Sometimes libintl requires libiconv, so first search for libiconv.
107   dnl Ideally we would do this search only after the
108   dnl      if test "$USE_NLS" = "yes"; then
109   dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
110   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
111   dnl the configure script would need to contain the same shell code
112   dnl again, outside any 'if'. There are two solutions:
113   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
114   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
115   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
116   dnl documented, we avoid it.
117   ifelse(gt_included_intl, yes, , [
118     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
119   ])
120
121   dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
122   gt_INTL_MACOSX
123
124   dnl Set USE_NLS.
125   AC_REQUIRE([AM_NLS])
126
127   ifelse(gt_included_intl, yes, [
128     BUILD_INCLUDED_LIBINTL=no
129     USE_INCLUDED_LIBINTL=no
130   ])
131   LIBINTL=
132   LTLIBINTL=
133   POSUB=
134
135   dnl Add a version number to the cache macros.
136   case " $gt_needs " in
137     *" need-formatstring-macros "*) gt_api_version=3 ;;
138     *" need-ngettext "*) gt_api_version=2 ;;
139     *) gt_api_version=1 ;;
140   esac
141   gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
142   gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
143
144   dnl If we use NLS figure out what method
145   if test "$USE_NLS" = "yes"; then
146     gt_use_preinstalled_gnugettext=no
147     ifelse(gt_included_intl, yes, [
148       AC_MSG_CHECKING([whether included gettext is requested])
149       AC_ARG_WITH([included-gettext],
150         [  --with-included-gettext use the GNU gettext library included here],
151         nls_cv_force_use_gnu_gettext=$withval,
152         nls_cv_force_use_gnu_gettext=no)
153       AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
154
155       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
156       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
157     ])
158         dnl User does not insist on using GNU NLS library.  Figure out what
159         dnl to use.  If GNU gettext is available we use this.  Else we have
160         dnl to fall back to GNU NLS library.
161
162         if test $gt_api_version -ge 3; then
163           gt_revision_test_code='
164 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
165 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
166 #endif
167 changequote(,)dnl
168 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
169 changequote([,])dnl
170 '
171         else
172           gt_revision_test_code=
173         fi
174         if test $gt_api_version -ge 2; then
175           gt_expression_test_code=' + * ngettext ("", "", 0)'
176         else
177           gt_expression_test_code=
178         fi
179
180         AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
181          [AC_TRY_LINK([#include <libintl.h>
182 $gt_revision_test_code
183 extern int _nl_msg_cat_cntr;
184 extern int *_nl_domain_bindings;],
185             [bindtextdomain ("", "");
186 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
187             [eval "$gt_func_gnugettext_libc=yes"],
188             [eval "$gt_func_gnugettext_libc=no"])])
189
190         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
191           dnl Sometimes libintl requires libiconv, so first search for libiconv.
192           ifelse(gt_included_intl, yes, , [
193             AM_ICONV_LINK
194           ])
195           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
196           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
197           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
198           dnl even if libiconv doesn't exist.
199           AC_LIB_LINKFLAGS_BODY([intl])
200           AC_CACHE_CHECK([for GNU gettext in libintl],
201             [$gt_func_gnugettext_libintl],
202            [gt_save_CPPFLAGS="$CPPFLAGS"
203             CPPFLAGS="$CPPFLAGS $INCINTL"
204             gt_save_LIBS="$LIBS"
205             LIBS="$LIBS $LIBINTL"
206             dnl Now see whether libintl exists and does not depend on libiconv.
207             AC_TRY_LINK([#include <libintl.h>
208 $gt_revision_test_code
209 extern int _nl_msg_cat_cntr;
210 extern
211 #ifdef __cplusplus
212 "C"
213 #endif
214 const char *_nl_expand_alias (const char *);],
215               [bindtextdomain ("", "");
216 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
217               [eval "$gt_func_gnugettext_libintl=yes"],
218               [eval "$gt_func_gnugettext_libintl=no"])
219             dnl Now see whether libintl exists and depends on libiconv.
220             if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
221               LIBS="$LIBS $LIBICONV"
222               AC_TRY_LINK([#include <libintl.h>
223 $gt_revision_test_code
224 extern int _nl_msg_cat_cntr;
225 extern
226 #ifdef __cplusplus
227 "C"
228 #endif
229 const char *_nl_expand_alias (const char *);],
230                 [bindtextdomain ("", "");
231 return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
232                [LIBINTL="$LIBINTL $LIBICONV"
233                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
234                 eval "$gt_func_gnugettext_libintl=yes"
235                ])
236             fi
237             CPPFLAGS="$gt_save_CPPFLAGS"
238             LIBS="$gt_save_LIBS"])
239         fi
240
241         dnl If an already present or preinstalled GNU gettext() is found,
242         dnl use it.  But if this macro is used in GNU gettext, and GNU
243         dnl gettext is already preinstalled in libintl, we update this
244         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
245         if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
246            || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
247                 && test "$PACKAGE" != gettext-runtime \
248                 && test "$PACKAGE" != gettext-tools; }; then
249           gt_use_preinstalled_gnugettext=yes
250         else
251           dnl Reset the values set by searching for libintl.
252           LIBINTL=
253           LTLIBINTL=
254           INCINTL=
255         fi
256
257     ifelse(gt_included_intl, yes, [
258         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
259           dnl GNU gettext is not found in the C library.
260           dnl Fall back on included GNU gettext library.
261           nls_cv_use_gnu_gettext=yes
262         fi
263       fi
264
265       if test "$nls_cv_use_gnu_gettext" = "yes"; then
266         dnl Mark actions used to generate GNU NLS library.
267         BUILD_INCLUDED_LIBINTL=yes
268         USE_INCLUDED_LIBINTL=yes
269         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
270         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
271         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
272       fi
273
274       CATOBJEXT=
275       if test "$gt_use_preinstalled_gnugettext" = "yes" \
276          || test "$nls_cv_use_gnu_gettext" = "yes"; then
277         dnl Mark actions to use GNU gettext tools.
278         CATOBJEXT=.gmo
279       fi
280     ])
281
282     if test -n "$INTL_MACOSX_LIBS"; then
283       if test "$gt_use_preinstalled_gnugettext" = "yes" \
284          || test "$nls_cv_use_gnu_gettext" = "yes"; then
285         dnl Some extra flags are needed during linking.
286         LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
287         LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
288       fi
289     fi
290
291     if test "$gt_use_preinstalled_gnugettext" = "yes" \
292        || test "$nls_cv_use_gnu_gettext" = "yes"; then
293       AC_DEFINE([ENABLE_NLS], [1],
294         [Define to 1 if translation of program messages to the user's native language
295    is requested.])
296     else
297       USE_NLS=no
298     fi
299   fi
300
301   AC_MSG_CHECKING([whether to use NLS])
302   AC_MSG_RESULT([$USE_NLS])
303   if test "$USE_NLS" = "yes"; then
304     AC_MSG_CHECKING([where the gettext function comes from])
305     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
306       if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
307         gt_source="external libintl"
308       else
309         gt_source="libc"
310       fi
311     else
312       gt_source="included intl directory"
313     fi
314     AC_MSG_RESULT([$gt_source])
315   fi
316
317   if test "$USE_NLS" = "yes"; then
318
319     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
320       if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
321         AC_MSG_CHECKING([how to link with libintl])
322         AC_MSG_RESULT([$LIBINTL])
323         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
324       fi
325
326       dnl For backward compatibility. Some packages may be using this.
327       AC_DEFINE([HAVE_GETTEXT], [1],
328        [Define if the GNU gettext() function is already present or preinstalled.])
329       AC_DEFINE([HAVE_DCGETTEXT], [1],
330        [Define if the GNU dcgettext() function is already present or preinstalled.])
331     fi
332
333     dnl We need to process the po/ directory.
334     POSUB=po
335   fi
336
337   ifelse(gt_included_intl, yes, [
338     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
339     dnl to 'yes' because some of the testsuite requires it.
340     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
341       BUILD_INCLUDED_LIBINTL=yes
342     fi
343
344     dnl Make all variables we use known to autoconf.
345     AC_SUBST([BUILD_INCLUDED_LIBINTL])
346     AC_SUBST([USE_INCLUDED_LIBINTL])
347     AC_SUBST([CATOBJEXT])
348
349     dnl For backward compatibility. Some configure.ins may be using this.
350     nls_cv_header_intl=
351     nls_cv_header_libgt=
352
353     dnl For backward compatibility. Some Makefiles may be using this.
354     DATADIRNAME=share
355     AC_SUBST([DATADIRNAME])
356
357     dnl For backward compatibility. Some Makefiles may be using this.
358     INSTOBJEXT=.mo
359     AC_SUBST([INSTOBJEXT])
360
361     dnl For backward compatibility. Some Makefiles may be using this.
362     GENCAT=gencat
363     AC_SUBST([GENCAT])
364
365     dnl For backward compatibility. Some Makefiles may be using this.
366     INTLOBJS=
367     if test "$USE_INCLUDED_LIBINTL" = yes; then
368       INTLOBJS="\$(GETTOBJS)"
369     fi
370     AC_SUBST([INTLOBJS])
371
372     dnl Enable libtool support if the surrounding package wishes it.
373     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
374     AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
375   ])
376
377   dnl For backward compatibility. Some Makefiles may be using this.
378   INTLLIBS="$LIBINTL"
379   AC_SUBST([INTLLIBS])
380
381   dnl Make all documented variables known to autoconf.
382   AC_SUBST([LIBINTL])
383   AC_SUBST([LTLIBINTL])
384   AC_SUBST([POSUB])
385 ])
386
387
388 dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
389 m4_define([gt_NEEDS_INIT],
390 [
391   m4_divert_text([DEFAULTS], [gt_needs=])
392   m4_define([gt_NEEDS_INIT], [])
393 ])
394
395
396 dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
397 AC_DEFUN([AM_GNU_GETTEXT_NEED],
398 [
399   m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
400 ])
401
402
403 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
404 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
405
406 # iconv.m4 serial 11 (gettext-0.18.1)
407 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
408 dnl This file is free software; the Free Software Foundation
409 dnl gives unlimited permission to copy and/or distribute it,
410 dnl with or without modifications, as long as this notice is preserved.
411
412 dnl From Bruno Haible.
413
414 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
415 [
416   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
417   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
418   AC_REQUIRE([AC_LIB_RPATH])
419
420   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
421   dnl accordingly.
422   AC_LIB_LINKFLAGS_BODY([iconv])
423 ])
424
425 AC_DEFUN([AM_ICONV_LINK],
426 [
427   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
428   dnl those with the standalone portable GNU libiconv installed).
429   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
430
431   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
432   dnl accordingly.
433   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
434
435   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
436   dnl because if the user has installed libiconv and not disabled its use
437   dnl via --without-libiconv-prefix, he wants to use it. The first
438   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
439   am_save_CPPFLAGS="$CPPFLAGS"
440   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
441
442   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
443     am_cv_func_iconv="no, consider installing GNU libiconv"
444     am_cv_lib_iconv=no
445     AC_TRY_LINK([#include <stdlib.h>
446 #include <iconv.h>],
447       [iconv_t cd = iconv_open("","");
448        iconv(cd,NULL,NULL,NULL,NULL);
449        iconv_close(cd);],
450       [am_cv_func_iconv=yes])
451     if test "$am_cv_func_iconv" != yes; then
452       am_save_LIBS="$LIBS"
453       LIBS="$LIBS $LIBICONV"
454       AC_TRY_LINK([#include <stdlib.h>
455 #include <iconv.h>],
456         [iconv_t cd = iconv_open("","");
457          iconv(cd,NULL,NULL,NULL,NULL);
458          iconv_close(cd);],
459         [am_cv_lib_iconv=yes]
460         [am_cv_func_iconv=yes])
461       LIBS="$am_save_LIBS"
462     fi
463   ])
464   if test "$am_cv_func_iconv" = yes; then
465     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
466       dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
467       am_save_LIBS="$LIBS"
468       if test $am_cv_lib_iconv = yes; then
469         LIBS="$LIBS $LIBICONV"
470       fi
471       AC_TRY_RUN([
472 #include <iconv.h>
473 #include <string.h>
474 int main ()
475 {
476   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
477      returns.  */
478   {
479     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
480     if (cd_utf8_to_88591 != (iconv_t)(-1))
481       {
482         static const char input[] = "\342\202\254"; /* EURO SIGN */
483         char buf[10];
484         const char *inptr = input;
485         size_t inbytesleft = strlen (input);
486         char *outptr = buf;
487         size_t outbytesleft = sizeof (buf);
488         size_t res = iconv (cd_utf8_to_88591,
489                             (char **) &inptr, &inbytesleft,
490                             &outptr, &outbytesleft);
491         if (res == 0)
492           return 1;
493       }
494   }
495   /* Test against Solaris 10 bug: Failures are not distinguishable from
496      successful returns.  */
497   {
498     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
499     if (cd_ascii_to_88591 != (iconv_t)(-1))
500       {
501         static const char input[] = "\263";
502         char buf[10];
503         const char *inptr = input;
504         size_t inbytesleft = strlen (input);
505         char *outptr = buf;
506         size_t outbytesleft = sizeof (buf);
507         size_t res = iconv (cd_ascii_to_88591,
508                             (char **) &inptr, &inbytesleft,
509                             &outptr, &outbytesleft);
510         if (res == 0)
511           return 1;
512       }
513   }
514 #if 0 /* This bug could be worked around by the caller.  */
515   /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
516   {
517     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
518     if (cd_88591_to_utf8 != (iconv_t)(-1))
519       {
520         static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
521         char buf[50];
522         const char *inptr = input;
523         size_t inbytesleft = strlen (input);
524         char *outptr = buf;
525         size_t outbytesleft = sizeof (buf);
526         size_t res = iconv (cd_88591_to_utf8,
527                             (char **) &inptr, &inbytesleft,
528                             &outptr, &outbytesleft);
529         if ((int)res > 0)
530           return 1;
531       }
532   }
533 #endif
534   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
535      provided.  */
536   if (/* Try standardized names.  */
537       iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
538       /* Try IRIX, OSF/1 names.  */
539       && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
540       /* Try AIX names.  */
541       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
542       /* Try HP-UX names.  */
543       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
544     return 1;
545   return 0;
546 }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
547         [case "$host_os" in
548            aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
549            *)            am_cv_func_iconv_works="guessing yes" ;;
550          esac])
551       LIBS="$am_save_LIBS"
552     ])
553     case "$am_cv_func_iconv_works" in
554       *no) am_func_iconv=no am_cv_lib_iconv=no ;;
555       *)   am_func_iconv=yes ;;
556     esac
557   else
558     am_func_iconv=no am_cv_lib_iconv=no
559   fi
560   if test "$am_func_iconv" = yes; then
561     AC_DEFINE([HAVE_ICONV], [1],
562       [Define if you have the iconv() function and it works.])
563   fi
564   if test "$am_cv_lib_iconv" = yes; then
565     AC_MSG_CHECKING([how to link with libiconv])
566     AC_MSG_RESULT([$LIBICONV])
567   else
568     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
569     dnl either.
570     CPPFLAGS="$am_save_CPPFLAGS"
571     LIBICONV=
572     LTLIBICONV=
573   fi
574   AC_SUBST([LIBICONV])
575   AC_SUBST([LTLIBICONV])
576 ])
577
578 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
579 dnl avoid warnings like
580 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
581 dnl This is tricky because of the way 'aclocal' is implemented:
582 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
583 dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
584 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
585 dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
586 dnl   warnings.
587 m4_define([gl_iconv_AC_DEFUN],
588   m4_version_prereq([2.64],
589     [[AC_DEFUN_ONCE(
590         [$1], [$2])]],
591     [[AC_DEFUN(
592         [$1], [$2])]]))
593 gl_iconv_AC_DEFUN([AM_ICONV],
594 [
595   AM_ICONV_LINK
596   if test "$am_cv_func_iconv" = yes; then
597     AC_MSG_CHECKING([for iconv declaration])
598     AC_CACHE_VAL([am_cv_proto_iconv], [
599       AC_TRY_COMPILE([
600 #include <stdlib.h>
601 #include <iconv.h>
602 extern
603 #ifdef __cplusplus
604 "C"
605 #endif
606 #if defined(__STDC__) || defined(__cplusplus)
607 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
608 #else
609 size_t iconv();
610 #endif
611 ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
612       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);"])
613     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
614     AC_MSG_RESULT([
615          $am_cv_proto_iconv])
616     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
617       [Define as const if the declaration of iconv() needs const.])
618   fi
619 ])
620
621 # intlmacosx.m4 serial 3 (gettext-0.18)
622 dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
623 dnl This file is free software; the Free Software Foundation
624 dnl gives unlimited permission to copy and/or distribute it,
625 dnl with or without modifications, as long as this notice is preserved.
626 dnl
627 dnl This file can can be used in projects which are not available under
628 dnl the GNU General Public License or the GNU Library General Public
629 dnl License but which still want to provide support for the GNU gettext
630 dnl functionality.
631 dnl Please note that the actual code of the GNU gettext library is covered
632 dnl by the GNU Library General Public License, and the rest of the GNU
633 dnl gettext package package is covered by the GNU General Public License.
634 dnl They are *not* in the public domain.
635
636 dnl Checks for special options needed on MacOS X.
637 dnl Defines INTL_MACOSX_LIBS.
638 AC_DEFUN([gt_INTL_MACOSX],
639 [
640   dnl Check for API introduced in MacOS X 10.2.
641   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
642     [gt_cv_func_CFPreferencesCopyAppValue],
643     [gt_save_LIBS="$LIBS"
644      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
645      AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
646        [CFPreferencesCopyAppValue(NULL, NULL)],
647        [gt_cv_func_CFPreferencesCopyAppValue=yes],
648        [gt_cv_func_CFPreferencesCopyAppValue=no])
649      LIBS="$gt_save_LIBS"])
650   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
651     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
652       [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
653   fi
654   dnl Check for API introduced in MacOS X 10.3.
655   AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
656     [gt_save_LIBS="$LIBS"
657      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
658      AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
659        [gt_cv_func_CFLocaleCopyCurrent=yes],
660        [gt_cv_func_CFLocaleCopyCurrent=no])
661      LIBS="$gt_save_LIBS"])
662   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
663     AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
664       [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
665   fi
666   INTL_MACOSX_LIBS=
667   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
668     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
669   fi
670   AC_SUBST([INTL_MACOSX_LIBS])
671 ])
672
673 # lib-ld.m4 serial 4 (gettext-0.18)
674 dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
675 dnl This file is free software; the Free Software Foundation
676 dnl gives unlimited permission to copy and/or distribute it,
677 dnl with or without modifications, as long as this notice is preserved.
678
679 dnl Subroutines of libtool.m4,
680 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
681 dnl with libtool.m4.
682
683 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
684 AC_DEFUN([AC_LIB_PROG_LD_GNU],
685 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
686 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
687 case `$LD -v 2>&1 </dev/null` in
688 *GNU* | *'with BFD'*)
689   acl_cv_prog_gnu_ld=yes ;;
690 *)
691   acl_cv_prog_gnu_ld=no ;;
692 esac])
693 with_gnu_ld=$acl_cv_prog_gnu_ld
694 ])
695
696 dnl From libtool-1.4. Sets the variable LD.
697 AC_DEFUN([AC_LIB_PROG_LD],
698 [AC_ARG_WITH([gnu-ld],
699 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
700 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
701 AC_REQUIRE([AC_PROG_CC])dnl
702 AC_REQUIRE([AC_CANONICAL_HOST])dnl
703 # Prepare PATH_SEPARATOR.
704 # The user is always right.
705 if test "${PATH_SEPARATOR+set}" != set; then
706   echo "#! /bin/sh" >conf$$.sh
707   echo  "exit 0"   >>conf$$.sh
708   chmod +x conf$$.sh
709   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
710     PATH_SEPARATOR=';'
711   else
712     PATH_SEPARATOR=:
713   fi
714   rm -f conf$$.sh
715 fi
716 ac_prog=ld
717 if test "$GCC" = yes; then
718   # Check if gcc -print-prog-name=ld gives a path.
719   AC_MSG_CHECKING([for ld used by GCC])
720   case $host in
721   *-*-mingw*)
722     # gcc leaves a trailing carriage return which upsets mingw
723     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
724   *)
725     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
726   esac
727   case $ac_prog in
728     # Accept absolute paths.
729     [[\\/]* | [A-Za-z]:[\\/]*)]
730       [re_direlt='/[^/][^/]*/\.\./']
731       # Canonicalize the path of ld
732       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
733       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
734         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
735       done
736       test -z "$LD" && LD="$ac_prog"
737       ;;
738   "")
739     # If it fails, then pretend we aren't using GCC.
740     ac_prog=ld
741     ;;
742   *)
743     # If it is relative, then search for the first ld in PATH.
744     with_gnu_ld=unknown
745     ;;
746   esac
747 elif test "$with_gnu_ld" = yes; then
748   AC_MSG_CHECKING([for GNU ld])
749 else
750   AC_MSG_CHECKING([for non-GNU ld])
751 fi
752 AC_CACHE_VAL([acl_cv_path_LD],
753 [if test -z "$LD"; then
754   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
755   for ac_dir in $PATH; do
756     test -z "$ac_dir" && ac_dir=.
757     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
758       acl_cv_path_LD="$ac_dir/$ac_prog"
759       # Check to see if the program is GNU ld.  I'd rather use --version,
760       # but apparently some GNU ld's only accept -v.
761       # Break only if it was the GNU/non-GNU ld that we prefer.
762       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
763       *GNU* | *'with BFD'*)
764         test "$with_gnu_ld" != no && break ;;
765       *)
766         test "$with_gnu_ld" != yes && break ;;
767       esac
768     fi
769   done
770   IFS="$ac_save_ifs"
771 else
772   acl_cv_path_LD="$LD" # Let the user override the test with a path.
773 fi])
774 LD="$acl_cv_path_LD"
775 if test -n "$LD"; then
776   AC_MSG_RESULT([$LD])
777 else
778   AC_MSG_RESULT([no])
779 fi
780 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
781 AC_LIB_PROG_LD_GNU
782 ])
783
784 # lib-link.m4 serial 21 (gettext-0.18)
785 dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
786 dnl This file is free software; the Free Software Foundation
787 dnl gives unlimited permission to copy and/or distribute it,
788 dnl with or without modifications, as long as this notice is preserved.
789
790 dnl From Bruno Haible.
791
792 AC_PREREQ([2.54])
793
794 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
795 dnl the libraries corresponding to explicit and implicit dependencies.
796 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
797 dnl augments the CPPFLAGS variable.
798 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
799 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
800 AC_DEFUN([AC_LIB_LINKFLAGS],
801 [
802   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
803   AC_REQUIRE([AC_LIB_RPATH])
804   pushdef([Name],[translit([$1],[./-], [___])])
805   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
806                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
807   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
808     AC_LIB_LINKFLAGS_BODY([$1], [$2])
809     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
810     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
811     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
812     ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
813   ])
814   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
815   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
816   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
817   LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
818   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
819   AC_SUBST([LIB]NAME)
820   AC_SUBST([LTLIB]NAME)
821   AC_SUBST([LIB]NAME[_PREFIX])
822   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
823   dnl results of this search when this library appears as a dependency.
824   HAVE_LIB[]NAME=yes
825   popdef([NAME])
826   popdef([Name])
827 ])
828
829 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
830 dnl searches for libname and the libraries corresponding to explicit and
831 dnl implicit dependencies, together with the specified include files and
832 dnl the ability to compile and link the specified testcode. The missing-message
833 dnl defaults to 'no' and may contain additional hints for the user.
834 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
835 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
836 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
837 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
838 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
839 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
840 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
841 [
842   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
843   AC_REQUIRE([AC_LIB_RPATH])
844   pushdef([Name],[translit([$1],[./-], [___])])
845   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
846                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
847
848   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
849   dnl accordingly.
850   AC_LIB_LINKFLAGS_BODY([$1], [$2])
851
852   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
853   dnl because if the user has installed lib[]Name and not disabled its use
854   dnl via --without-lib[]Name-prefix, he wants to use it.
855   ac_save_CPPFLAGS="$CPPFLAGS"
856   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
857
858   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
859     ac_save_LIBS="$LIBS"
860     dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
861     dnl because these -l options might require -L options that are present in
862     dnl LIBS. -l options benefit only from the -L options listed before it.
863     dnl Otherwise, add it to the front of LIBS, because it may be a static
864     dnl library that depends on another static library that is present in LIBS.
865     dnl Static libraries benefit only from the static libraries listed after
866     dnl it.
867     case " $LIB[]NAME" in
868       *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
869       *)       LIBS="$LIB[]NAME $LIBS" ;;
870     esac
871     AC_TRY_LINK([$3], [$4],
872       [ac_cv_lib[]Name=yes],
873       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
874     LIBS="$ac_save_LIBS"
875   ])
876   if test "$ac_cv_lib[]Name" = yes; then
877     HAVE_LIB[]NAME=yes
878     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
879     AC_MSG_CHECKING([how to link with lib[]$1])
880     AC_MSG_RESULT([$LIB[]NAME])
881   else
882     HAVE_LIB[]NAME=no
883     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
884     dnl $INC[]NAME either.
885     CPPFLAGS="$ac_save_CPPFLAGS"
886     LIB[]NAME=
887     LTLIB[]NAME=
888     LIB[]NAME[]_PREFIX=
889   fi
890   AC_SUBST([HAVE_LIB]NAME)
891   AC_SUBST([LIB]NAME)
892   AC_SUBST([LTLIB]NAME)
893   AC_SUBST([LIB]NAME[_PREFIX])
894   popdef([NAME])
895   popdef([Name])
896 ])
897
898 dnl Determine the platform dependent parameters needed to use rpath:
899 dnl   acl_libext,
900 dnl   acl_shlibext,
901 dnl   acl_hardcode_libdir_flag_spec,
902 dnl   acl_hardcode_libdir_separator,
903 dnl   acl_hardcode_direct,
904 dnl   acl_hardcode_minus_L.
905 AC_DEFUN([AC_LIB_RPATH],
906 [
907   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
908   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
909   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
910   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
911   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
912   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
913   AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
914     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
915     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
916     . ./conftest.sh
917     rm -f ./conftest.sh
918     acl_cv_rpath=done
919   ])
920   wl="$acl_cv_wl"
921   acl_libext="$acl_cv_libext"
922   acl_shlibext="$acl_cv_shlibext"
923   acl_libname_spec="$acl_cv_libname_spec"
924   acl_library_names_spec="$acl_cv_library_names_spec"
925   acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
926   acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
927   acl_hardcode_direct="$acl_cv_hardcode_direct"
928   acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
929   dnl Determine whether the user wants rpath handling at all.
930   AC_ARG_ENABLE([rpath],
931     [  --disable-rpath         do not hardcode runtime library paths],
932     :, enable_rpath=yes)
933 ])
934
935 dnl AC_LIB_FROMPACKAGE(name, package)
936 dnl declares that libname comes from the given package. The configure file
937 dnl will then not have a --with-libname-prefix option but a
938 dnl --with-package-prefix option. Several libraries can come from the same
939 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
940 dnl macro call that searches for libname.
941 AC_DEFUN([AC_LIB_FROMPACKAGE],
942 [
943   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
944                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
945   define([acl_frompackage_]NAME, [$2])
946   popdef([NAME])
947   pushdef([PACK],[$2])
948   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
949                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
950   define([acl_libsinpackage_]PACKUP,
951     m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
952   popdef([PACKUP])
953   popdef([PACK])
954 ])
955
956 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
957 dnl the libraries corresponding to explicit and implicit dependencies.
958 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
959 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
960 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
961 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
962 [
963   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
964   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
965                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
966   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
967   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
968                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
969   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
970   dnl Autoconf >= 2.61 supports dots in --with options.
971   pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
972   dnl By default, look in $includedir and $libdir.
973   use_additional=yes
974   AC_LIB_WITH_FINAL_PREFIX([
975     eval additional_includedir=\"$includedir\"
976     eval additional_libdir=\"$libdir\"
977   ])
978   AC_ARG_WITH(P_A_C_K[-prefix],
979 [[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
980   --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
981 [
982     if test "X$withval" = "Xno"; then
983       use_additional=no
984     else
985       if test "X$withval" = "X"; then
986         AC_LIB_WITH_FINAL_PREFIX([
987           eval additional_includedir=\"$includedir\"
988           eval additional_libdir=\"$libdir\"
989         ])
990       else
991         additional_includedir="$withval/include"
992         additional_libdir="$withval/$acl_libdirstem"
993         if test "$acl_libdirstem2" != "$acl_libdirstem" \
994            && ! test -d "$withval/$acl_libdirstem"; then
995           additional_libdir="$withval/$acl_libdirstem2"
996         fi
997       fi
998     fi
999 ])
1000   dnl Search the library and its dependencies in $additional_libdir and
1001   dnl $LDFLAGS. Using breadth-first-seach.
1002   LIB[]NAME=
1003   LTLIB[]NAME=
1004   INC[]NAME=
1005   LIB[]NAME[]_PREFIX=
1006   dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1007   dnl computed. So it has to be reset here.
1008   HAVE_LIB[]NAME=
1009   rpathdirs=
1010   ltrpathdirs=
1011   names_already_handled=
1012   names_next_round='$1 $2'
1013   while test -n "$names_next_round"; do
1014     names_this_round="$names_next_round"
1015     names_next_round=
1016     for name in $names_this_round; do
1017       already_handled=
1018       for n in $names_already_handled; do
1019         if test "$n" = "$name"; then
1020           already_handled=yes
1021           break
1022         fi
1023       done
1024       if test -z "$already_handled"; then
1025         names_already_handled="$names_already_handled $name"
1026         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1027         dnl or AC_LIB_HAVE_LINKFLAGS call.
1028         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1029         eval value=\"\$HAVE_LIB$uppername\"
1030         if test -n "$value"; then
1031           if test "$value" = yes; then
1032             eval value=\"\$LIB$uppername\"
1033             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1034             eval value=\"\$LTLIB$uppername\"
1035             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1036           else
1037             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1038             dnl that this library doesn't exist. So just drop it.
1039             :
1040           fi
1041         else
1042           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1043           dnl and the already constructed $LIBNAME/$LTLIBNAME.
1044           found_dir=
1045           found_la=
1046           found_so=
1047           found_a=
1048           eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
1049           if test -n "$acl_shlibext"; then
1050             shrext=".$acl_shlibext"             # typically: shrext=.so
1051           else
1052             shrext=
1053           fi
1054           if test $use_additional = yes; then
1055             dir="$additional_libdir"
1056             dnl The same code as in the loop below:
1057             dnl First look for a shared library.
1058             if test -n "$acl_shlibext"; then
1059               if test -f "$dir/$libname$shrext"; then
1060                 found_dir="$dir"
1061                 found_so="$dir/$libname$shrext"
1062               else
1063                 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1064                   ver=`(cd "$dir" && \
1065                         for f in "$libname$shrext".*; do echo "$f"; done \
1066                         | sed -e "s,^$libname$shrext\\\\.,," \
1067                         | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1068                         | sed 1q ) 2>/dev/null`
1069                   if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1070                     found_dir="$dir"
1071                     found_so="$dir/$libname$shrext.$ver"
1072                   fi
1073                 else
1074                   eval library_names=\"$acl_library_names_spec\"
1075                   for f in $library_names; do
1076                     if test -f "$dir/$f"; then
1077                       found_dir="$dir"
1078                       found_so="$dir/$f"
1079                       break
1080                     fi
1081                   done
1082                 fi
1083               fi
1084             fi
1085             dnl Then look for a static library.
1086             if test "X$found_dir" = "X"; then
1087               if test -f "$dir/$libname.$acl_libext"; then
1088                 found_dir="$dir"
1089                 found_a="$dir/$libname.$acl_libext"
1090               fi
1091             fi
1092             if test "X$found_dir" != "X"; then
1093               if test -f "$dir/$libname.la"; then
1094                 found_la="$dir/$libname.la"
1095               fi
1096             fi
1097           fi
1098           if test "X$found_dir" = "X"; then
1099             for x in $LDFLAGS $LTLIB[]NAME; do
1100               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1101               case "$x" in
1102                 -L*)
1103                   dir=`echo "X$x" | sed -e 's/^X-L//'`
1104                   dnl First look for a shared library.
1105                   if test -n "$acl_shlibext"; then
1106                     if test -f "$dir/$libname$shrext"; then
1107                       found_dir="$dir"
1108                       found_so="$dir/$libname$shrext"
1109                     else
1110                       if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1111                         ver=`(cd "$dir" && \
1112                               for f in "$libname$shrext".*; do echo "$f"; done \
1113                               | sed -e "s,^$libname$shrext\\\\.,," \
1114                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1115                               | sed 1q ) 2>/dev/null`
1116                         if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1117                           found_dir="$dir"
1118                           found_so="$dir/$libname$shrext.$ver"
1119                         fi
1120                       else
1121                         eval library_names=\"$acl_library_names_spec\"
1122                         for f in $library_names; do
1123                           if test -f "$dir/$f"; then
1124                             found_dir="$dir"
1125                             found_so="$dir/$f"
1126                             break
1127                           fi
1128                         done
1129                       fi
1130                     fi
1131                   fi
1132                   dnl Then look for a static library.
1133                   if test "X$found_dir" = "X"; then
1134                     if test -f "$dir/$libname.$acl_libext"; then
1135                       found_dir="$dir"
1136                       found_a="$dir/$libname.$acl_libext"
1137                     fi
1138                   fi
1139                   if test "X$found_dir" != "X"; then
1140                     if test -f "$dir/$libname.la"; then
1141                       found_la="$dir/$libname.la"
1142                     fi
1143                   fi
1144                   ;;
1145               esac
1146               if test "X$found_dir" != "X"; then
1147                 break
1148               fi
1149             done
1150           fi
1151           if test "X$found_dir" != "X"; then
1152             dnl Found the library.
1153             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1154             if test "X$found_so" != "X"; then
1155               dnl Linking with a shared library. We attempt to hardcode its
1156               dnl directory into the executable's runpath, unless it's the
1157               dnl standard /usr/lib.
1158               if test "$enable_rpath" = no \
1159                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
1160                  || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
1161                 dnl No hardcoding is needed.
1162                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1163               else
1164                 dnl Use an explicit option to hardcode DIR into the resulting
1165                 dnl binary.
1166                 dnl Potentially add DIR to ltrpathdirs.
1167                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1168                 haveit=
1169                 for x in $ltrpathdirs; do
1170                   if test "X$x" = "X$found_dir"; then
1171                     haveit=yes
1172                     break
1173                   fi
1174                 done
1175                 if test -z "$haveit"; then
1176                   ltrpathdirs="$ltrpathdirs $found_dir"
1177                 fi
1178                 dnl The hardcoding into $LIBNAME is system dependent.
1179                 if test "$acl_hardcode_direct" = yes; then
1180                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1181                   dnl resulting binary.
1182                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1183                 else
1184                   if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1185                     dnl Use an explicit option to hardcode DIR into the resulting
1186                     dnl binary.
1187                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1188                     dnl Potentially add DIR to rpathdirs.
1189                     dnl The rpathdirs will be appended to $LIBNAME at the end.
1190                     haveit=
1191                     for x in $rpathdirs; do
1192                       if test "X$x" = "X$found_dir"; then
1193                         haveit=yes
1194                         break
1195                       fi
1196                     done
1197                     if test -z "$haveit"; then
1198                       rpathdirs="$rpathdirs $found_dir"
1199                     fi
1200                   else
1201                     dnl Rely on "-L$found_dir".
1202                     dnl But don't add it if it's already contained in the LDFLAGS
1203                     dnl or the already constructed $LIBNAME
1204                     haveit=
1205                     for x in $LDFLAGS $LIB[]NAME; do
1206                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1207                       if test "X$x" = "X-L$found_dir"; then
1208                         haveit=yes
1209                         break
1210                       fi
1211                     done
1212                     if test -z "$haveit"; then
1213                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1214                     fi
1215                     if test "$acl_hardcode_minus_L" != no; then
1216                       dnl FIXME: Not sure whether we should use
1217                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1218                       dnl here.
1219                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1220                     else
1221                       dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1222                       dnl here, because this doesn't fit in flags passed to the
1223                       dnl compiler. So give up. No hardcoding. This affects only
1224                       dnl very old systems.
1225                       dnl FIXME: Not sure whether we should use
1226                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1227                       dnl here.
1228                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1229                     fi
1230                   fi
1231                 fi
1232               fi
1233             else
1234               if test "X$found_a" != "X"; then
1235                 dnl Linking with a static library.
1236                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1237               else
1238                 dnl We shouldn't come here, but anyway it's good to have a
1239                 dnl fallback.
1240                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1241               fi
1242             fi
1243             dnl Assume the include files are nearby.
1244             additional_includedir=
1245             case "$found_dir" in
1246               */$acl_libdirstem | */$acl_libdirstem/)
1247                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1248                 if test "$name" = '$1'; then
1249                   LIB[]NAME[]_PREFIX="$basedir"
1250                 fi
1251                 additional_includedir="$basedir/include"
1252                 ;;
1253               */$acl_libdirstem2 | */$acl_libdirstem2/)
1254                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
1255                 if test "$name" = '$1'; then
1256                   LIB[]NAME[]_PREFIX="$basedir"
1257                 fi
1258                 additional_includedir="$basedir/include"
1259                 ;;
1260             esac
1261             if test "X$additional_includedir" != "X"; then
1262               dnl Potentially add $additional_includedir to $INCNAME.
1263               dnl But don't add it
1264               dnl   1. if it's the standard /usr/include,
1265               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1266               dnl   3. if it's already present in $CPPFLAGS or the already
1267               dnl      constructed $INCNAME,
1268               dnl   4. if it doesn't exist as a directory.
1269               if test "X$additional_includedir" != "X/usr/include"; then
1270                 haveit=
1271                 if test "X$additional_includedir" = "X/usr/local/include"; then
1272                   if test -n "$GCC"; then
1273                     case $host_os in
1274                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1275                     esac
1276                   fi
1277                 fi
1278                 if test -z "$haveit"; then
1279                   for x in $CPPFLAGS $INC[]NAME; do
1280                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1281                     if test "X$x" = "X-I$additional_includedir"; then
1282                       haveit=yes
1283                       break
1284                     fi
1285                   done
1286                   if test -z "$haveit"; then
1287                     if test -d "$additional_includedir"; then
1288                       dnl Really add $additional_includedir to $INCNAME.
1289                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1290                     fi
1291                   fi
1292                 fi
1293               fi
1294             fi
1295             dnl Look for dependencies.
1296             if test -n "$found_la"; then
1297               dnl Read the .la file. It defines the variables
1298               dnl dlname, library_names, old_library, dependency_libs, current,
1299               dnl age, revision, installed, dlopen, dlpreopen, libdir.
1300               save_libdir="$libdir"
1301               case "$found_la" in
1302                 */* | *\\*) . "$found_la" ;;
1303                 *) . "./$found_la" ;;
1304               esac
1305               libdir="$save_libdir"
1306               dnl We use only dependency_libs.
1307               for dep in $dependency_libs; do
1308                 case "$dep" in
1309                   -L*)
1310                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1311                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1312                     dnl But don't add it
1313                     dnl   1. if it's the standard /usr/lib,
1314                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
1315                     dnl   3. if it's already present in $LDFLAGS or the already
1316                     dnl      constructed $LIBNAME,
1317                     dnl   4. if it doesn't exist as a directory.
1318                     if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
1319                        && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
1320                       haveit=
1321                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
1322                          || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
1323                         if test -n "$GCC"; then
1324                           case $host_os in
1325                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1326                           esac
1327                         fi
1328                       fi
1329                       if test -z "$haveit"; then
1330                         haveit=
1331                         for x in $LDFLAGS $LIB[]NAME; do
1332                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1333                           if test "X$x" = "X-L$additional_libdir"; then
1334                             haveit=yes
1335                             break
1336                           fi
1337                         done
1338                         if test -z "$haveit"; then
1339                           if test -d "$additional_libdir"; then
1340                             dnl Really add $additional_libdir to $LIBNAME.
1341                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1342                           fi
1343                         fi
1344                         haveit=
1345                         for x in $LDFLAGS $LTLIB[]NAME; do
1346                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1347                           if test "X$x" = "X-L$additional_libdir"; then
1348                             haveit=yes
1349                             break
1350                           fi
1351                         done
1352                         if test -z "$haveit"; then
1353                           if test -d "$additional_libdir"; then
1354                             dnl Really add $additional_libdir to $LTLIBNAME.
1355                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1356                           fi
1357                         fi
1358                       fi
1359                     fi
1360                     ;;
1361                   -R*)
1362                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
1363                     if test "$enable_rpath" != no; then
1364                       dnl Potentially add DIR to rpathdirs.
1365                       dnl The rpathdirs will be appended to $LIBNAME at the end.
1366                       haveit=
1367                       for x in $rpathdirs; do
1368                         if test "X$x" = "X$dir"; then
1369                           haveit=yes
1370                           break
1371                         fi
1372                       done
1373                       if test -z "$haveit"; then
1374                         rpathdirs="$rpathdirs $dir"
1375                       fi
1376                       dnl Potentially add DIR to ltrpathdirs.
1377                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1378                       haveit=
1379                       for x in $ltrpathdirs; do
1380                         if test "X$x" = "X$dir"; then
1381                           haveit=yes
1382                           break
1383                         fi
1384                       done
1385                       if test -z "$haveit"; then
1386                         ltrpathdirs="$ltrpathdirs $dir"
1387                       fi
1388                     fi
1389                     ;;
1390                   -l*)
1391                     dnl Handle this in the next round.
1392                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1393                     ;;
1394                   *.la)
1395                     dnl Handle this in the next round. Throw away the .la's
1396                     dnl directory; it is already contained in a preceding -L
1397                     dnl option.
1398                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1399                     ;;
1400                   *)
1401                     dnl Most likely an immediate library name.
1402                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1403                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1404                     ;;
1405                 esac
1406               done
1407             fi
1408           else
1409             dnl Didn't find the library; assume it is in the system directories
1410             dnl known to the linker and runtime loader. (All the system
1411             dnl directories known to the linker should also be known to the
1412             dnl runtime loader, otherwise the system is severely misconfigured.)
1413             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1414             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1415           fi
1416         fi
1417       fi
1418     done
1419   done
1420   if test "X$rpathdirs" != "X"; then
1421     if test -n "$acl_hardcode_libdir_separator"; then
1422       dnl Weird platform: only the last -rpath option counts, the user must
1423       dnl pass all path elements in one option. We can arrange that for a
1424       dnl single library, but not when more than one $LIBNAMEs are used.
1425       alldirs=
1426       for found_dir in $rpathdirs; do
1427         alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1428       done
1429       dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1430       acl_save_libdir="$libdir"
1431       libdir="$alldirs"
1432       eval flag=\"$acl_hardcode_libdir_flag_spec\"
1433       libdir="$acl_save_libdir"
1434       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1435     else
1436       dnl The -rpath options are cumulative.
1437       for found_dir in $rpathdirs; do
1438         acl_save_libdir="$libdir"
1439         libdir="$found_dir"
1440         eval flag=\"$acl_hardcode_libdir_flag_spec\"
1441         libdir="$acl_save_libdir"
1442         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1443       done
1444     fi
1445   fi
1446   if test "X$ltrpathdirs" != "X"; then
1447     dnl When using libtool, the option that works for both libraries and
1448     dnl executables is -R. The -R options are cumulative.
1449     for found_dir in $ltrpathdirs; do
1450       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1451     done
1452   fi
1453   popdef([P_A_C_K])
1454   popdef([PACKLIBS])
1455   popdef([PACKUP])
1456   popdef([PACK])
1457   popdef([NAME])
1458 ])
1459
1460 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1461 dnl unless already present in VAR.
1462 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1463 dnl contains two or three consecutive elements that belong together.
1464 AC_DEFUN([AC_LIB_APPENDTOVAR],
1465 [
1466   for element in [$2]; do
1467     haveit=
1468     for x in $[$1]; do
1469       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1470       if test "X$x" = "X$element"; then
1471         haveit=yes
1472         break
1473       fi
1474     done
1475     if test -z "$haveit"; then
1476       [$1]="${[$1]}${[$1]:+ }$element"
1477     fi
1478   done
1479 ])
1480
1481 dnl For those cases where a variable contains several -L and -l options
1482 dnl referring to unknown libraries and directories, this macro determines the
1483 dnl necessary additional linker options for the runtime path.
1484 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1485 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1486 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1487 dnl otherwise linking without libtool is assumed.
1488 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1489 [
1490   AC_REQUIRE([AC_LIB_RPATH])
1491   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1492   $1=
1493   if test "$enable_rpath" != no; then
1494     if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1495       dnl Use an explicit option to hardcode directories into the resulting
1496       dnl binary.
1497       rpathdirs=
1498       next=
1499       for opt in $2; do
1500         if test -n "$next"; then
1501           dir="$next"
1502           dnl No need to hardcode the standard /usr/lib.
1503           if test "X$dir" != "X/usr/$acl_libdirstem" \
1504              && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1505             rpathdirs="$rpathdirs $dir"
1506           fi
1507           next=
1508         else
1509           case $opt in
1510             -L) next=yes ;;
1511             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1512                  dnl No need to hardcode the standard /usr/lib.
1513                  if test "X$dir" != "X/usr/$acl_libdirstem" \
1514                     && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1515                    rpathdirs="$rpathdirs $dir"
1516                  fi
1517                  next= ;;
1518             *) next= ;;
1519           esac
1520         fi
1521       done
1522       if test "X$rpathdirs" != "X"; then
1523         if test -n ""$3""; then
1524           dnl libtool is used for linking. Use -R options.
1525           for dir in $rpathdirs; do
1526             $1="${$1}${$1:+ }-R$dir"
1527           done
1528         else
1529           dnl The linker is used for linking directly.
1530           if test -n "$acl_hardcode_libdir_separator"; then
1531             dnl Weird platform: only the last -rpath option counts, the user
1532             dnl must pass all path elements in one option.
1533             alldirs=
1534             for dir in $rpathdirs; do
1535               alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1536             done
1537             acl_save_libdir="$libdir"
1538             libdir="$alldirs"
1539             eval flag=\"$acl_hardcode_libdir_flag_spec\"
1540             libdir="$acl_save_libdir"
1541             $1="$flag"
1542           else
1543             dnl The -rpath options are cumulative.
1544             for dir in $rpathdirs; do
1545               acl_save_libdir="$libdir"
1546               libdir="$dir"
1547               eval flag=\"$acl_hardcode_libdir_flag_spec\"
1548               libdir="$acl_save_libdir"
1549               $1="${$1}${$1:+ }$flag"
1550             done
1551           fi
1552         fi
1553       fi
1554     fi
1555   fi
1556   AC_SUBST([$1])
1557 ])
1558
1559 # lib-prefix.m4 serial 7 (gettext-0.18)
1560 dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
1561 dnl This file is free software; the Free Software Foundation
1562 dnl gives unlimited permission to copy and/or distribute it,
1563 dnl with or without modifications, as long as this notice is preserved.
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_MULTILIB])
1586   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1587   dnl By default, look in $includedir and $libdir.
1588   use_additional=yes
1589   AC_LIB_WITH_FINAL_PREFIX([
1590     eval additional_includedir=\"$includedir\"
1591     eval additional_libdir=\"$libdir\"
1592   ])
1593   AC_LIB_ARG_WITH([lib-prefix],
1594 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1595   --without-lib-prefix    don't search for libraries in includedir and libdir],
1596 [
1597     if test "X$withval" = "Xno"; then
1598       use_additional=no
1599     else
1600       if test "X$withval" = "X"; then
1601         AC_LIB_WITH_FINAL_PREFIX([
1602           eval additional_includedir=\"$includedir\"
1603           eval additional_libdir=\"$libdir\"
1604         ])
1605       else
1606         additional_includedir="$withval/include"
1607         additional_libdir="$withval/$acl_libdirstem"
1608       fi
1609     fi
1610 ])
1611   if test $use_additional = yes; then
1612     dnl Potentially add $additional_includedir to $CPPFLAGS.
1613     dnl But don't add it
1614     dnl   1. if it's the standard /usr/include,
1615     dnl   2. if it's already present in $CPPFLAGS,
1616     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1617     dnl   4. if it doesn't exist as a directory.
1618     if test "X$additional_includedir" != "X/usr/include"; then
1619       haveit=
1620       for x in $CPPFLAGS; do
1621         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1622         if test "X$x" = "X-I$additional_includedir"; then
1623           haveit=yes
1624           break
1625         fi
1626       done
1627       if test -z "$haveit"; then
1628         if test "X$additional_includedir" = "X/usr/local/include"; then
1629           if test -n "$GCC"; then
1630             case $host_os in
1631               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1632             esac
1633           fi
1634         fi
1635         if test -z "$haveit"; then
1636           if test -d "$additional_includedir"; then
1637             dnl Really add $additional_includedir to $CPPFLAGS.
1638             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1639           fi
1640         fi
1641       fi
1642     fi
1643     dnl Potentially add $additional_libdir to $LDFLAGS.
1644     dnl But don't add it
1645     dnl   1. if it's the standard /usr/lib,
1646     dnl   2. if it's already present in $LDFLAGS,
1647     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1648     dnl   4. if it doesn't exist as a directory.
1649     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1650       haveit=
1651       for x in $LDFLAGS; do
1652         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1653         if test "X$x" = "X-L$additional_libdir"; then
1654           haveit=yes
1655           break
1656         fi
1657       done
1658       if test -z "$haveit"; then
1659         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1660           if test -n "$GCC"; then
1661             case $host_os in
1662               linux*) haveit=yes;;
1663             esac
1664           fi
1665         fi
1666         if test -z "$haveit"; then
1667           if test -d "$additional_libdir"; then
1668             dnl Really add $additional_libdir to $LDFLAGS.
1669             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1670           fi
1671         fi
1672       fi
1673     fi
1674   fi
1675 ])
1676
1677 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1678 dnl acl_final_exec_prefix, containing the values to which $prefix and
1679 dnl $exec_prefix will expand at the end of the configure script.
1680 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1681 [
1682   dnl Unfortunately, prefix and exec_prefix get only finally determined
1683   dnl at the end of configure.
1684   if test "X$prefix" = "XNONE"; then
1685     acl_final_prefix="$ac_default_prefix"
1686   else
1687     acl_final_prefix="$prefix"
1688   fi
1689   if test "X$exec_prefix" = "XNONE"; then
1690     acl_final_exec_prefix='${prefix}'
1691   else
1692     acl_final_exec_prefix="$exec_prefix"
1693   fi
1694   acl_save_prefix="$prefix"
1695   prefix="$acl_final_prefix"
1696   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1697   prefix="$acl_save_prefix"
1698 ])
1699
1700 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1701 dnl variables prefix and exec_prefix bound to the values they will have
1702 dnl at the end of the configure script.
1703 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1704 [
1705   acl_save_prefix="$prefix"
1706   prefix="$acl_final_prefix"
1707   acl_save_exec_prefix="$exec_prefix"
1708   exec_prefix="$acl_final_exec_prefix"
1709   $1
1710   exec_prefix="$acl_save_exec_prefix"
1711   prefix="$acl_save_prefix"
1712 ])
1713
1714 dnl AC_LIB_PREPARE_MULTILIB creates
1715 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1716 dnl   "lib" or "lib64" or "lib/64",
1717 dnl - a variable acl_libdirstem2, as a secondary possible value for
1718 dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1719 dnl   "lib/amd64".
1720 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1721 [
1722   dnl There is no formal standard regarding lib and lib64.
1723   dnl On glibc systems, the current practice is that on a system supporting
1724   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1725   dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1726   dnl the compiler's default mode by looking at the compiler's library search
1727   dnl path. If at least one of its elements ends in /lib64 or points to a
1728   dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1729   dnl Otherwise we use the default, namely "lib".
1730   dnl On Solaris systems, the current practice is that on a system supporting
1731   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1732   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1733   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1734   AC_REQUIRE([AC_CANONICAL_HOST])
1735   acl_libdirstem=lib
1736   acl_libdirstem2=
1737   case "$host_os" in
1738     solaris*)
1739       dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1740       dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1741       dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1742       dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1743       dnl symlink is missing, so we set acl_libdirstem2 too.
1744       AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1745         [AC_EGREP_CPP([sixtyfour bits], [
1746 #ifdef _LP64
1747 sixtyfour bits
1748 #endif
1749            ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1750         ])
1751       if test $gl_cv_solaris_64bit = yes; then
1752         acl_libdirstem=lib/64
1753         case "$host_cpu" in
1754           sparc*)        acl_libdirstem2=lib/sparcv9 ;;
1755           i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1756         esac
1757       fi
1758       ;;
1759     *)
1760       searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1761       if test -n "$searchpath"; then
1762         acl_save_IFS="${IFS=    }"; IFS=":"
1763         for searchdir in $searchpath; do
1764           if test -d "$searchdir"; then
1765             case "$searchdir" in
1766               */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1767               */../ | */.. )
1768                 # Better ignore directories of this form. They are misleading.
1769                 ;;
1770               *) searchdir=`cd "$searchdir" && pwd`
1771                  case "$searchdir" in
1772                    */lib64 ) acl_libdirstem=lib64 ;;
1773                  esac ;;
1774             esac
1775           fi
1776         done
1777         IFS="$acl_save_IFS"
1778       fi
1779       ;;
1780   esac
1781   test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1782 ])
1783
1784 # nls.m4 serial 5 (gettext-0.18)
1785 dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1786 dnl Inc.
1787 dnl This file is free software; the Free Software Foundation
1788 dnl gives unlimited permission to copy and/or distribute it,
1789 dnl with or without modifications, as long as this notice is preserved.
1790 dnl
1791 dnl This file can can be used in projects which are not available under
1792 dnl the GNU General Public License or the GNU Library General Public
1793 dnl License but which still want to provide support for the GNU gettext
1794 dnl functionality.
1795 dnl Please note that the actual code of the GNU gettext library is covered
1796 dnl by the GNU Library General Public License, and the rest of the GNU
1797 dnl gettext package package is covered by the GNU General Public License.
1798 dnl They are *not* in the public domain.
1799
1800 dnl Authors:
1801 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1802 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1803
1804 AC_PREREQ([2.50])
1805
1806 AC_DEFUN([AM_NLS],
1807 [
1808   AC_MSG_CHECKING([whether NLS is requested])
1809   dnl Default is enabled NLS
1810   AC_ARG_ENABLE([nls],
1811     [  --disable-nls           do not use Native Language Support],
1812     USE_NLS=$enableval, USE_NLS=yes)
1813   AC_MSG_RESULT([$USE_NLS])
1814   AC_SUBST([USE_NLS])
1815 ])
1816
1817 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1818 # serial 1 (pkg-config-0.24)
1819
1820 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
1821 #
1822 # This program is free software; you can redistribute it and/or modify
1823 # it under the terms of the GNU General Public License as published by
1824 # the Free Software Foundation; either version 2 of the License, or
1825 # (at your option) any later version.
1826 #
1827 # This program is distributed in the hope that it will be useful, but
1828 # WITHOUT ANY WARRANTY; without even the implied warranty of
1829 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1830 # General Public License for more details.
1831 #
1832 # You should have received a copy of the GNU General Public License
1833 # along with this program; if not, write to the Free Software
1834 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1835 #
1836 # As a special exception to the GNU General Public License, if you
1837 # distribute this file as part of a program that contains a
1838 # configuration script generated by Autoconf, you may include it under
1839 # the same distribution terms that you use for the rest of that program.
1840
1841 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1842 # ----------------------------------
1843 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1844 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1845 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1846 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1847 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1848 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1849 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1850
1851 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1852         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1853 fi
1854 if test -n "$PKG_CONFIG"; then
1855         _pkg_min_version=m4_default([$1], [0.9.0])
1856         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1857         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1858                 AC_MSG_RESULT([yes])
1859         else
1860                 AC_MSG_RESULT([no])
1861                 PKG_CONFIG=""
1862         fi
1863 fi[]dnl
1864 ])# PKG_PROG_PKG_CONFIG
1865
1866 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1867 #
1868 # Check to see whether a particular set of modules exists.  Similar
1869 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1870 #
1871 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1872 # only at the first occurence in configure.ac, so if the first place
1873 # it's called might be skipped (such as if it is within an "if", you
1874 # have to call PKG_CHECK_EXISTS manually
1875 # --------------------------------------------------------------
1876 AC_DEFUN([PKG_CHECK_EXISTS],
1877 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1878 if test -n "$PKG_CONFIG" && \
1879     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1880   m4_default([$2], [:])
1881 m4_ifvaln([$3], [else
1882   $3])dnl
1883 fi])
1884
1885 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1886 # ---------------------------------------------
1887 m4_define([_PKG_CONFIG],
1888 [if test -n "$$1"; then
1889     pkg_cv_[]$1="$$1"
1890  elif test -n "$PKG_CONFIG"; then
1891     PKG_CHECK_EXISTS([$3],
1892                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1893                       test "x$?" != "x0" && pkg_failed=yes ],
1894                      [pkg_failed=yes])
1895  else
1896     pkg_failed=untried
1897 fi[]dnl
1898 ])# _PKG_CONFIG
1899
1900 # _PKG_SHORT_ERRORS_SUPPORTED
1901 # -----------------------------
1902 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1903 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1904 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1905         _pkg_short_errors_supported=yes
1906 else
1907         _pkg_short_errors_supported=no
1908 fi[]dnl
1909 ])# _PKG_SHORT_ERRORS_SUPPORTED
1910
1911
1912 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1913 # [ACTION-IF-NOT-FOUND])
1914 #
1915 #
1916 # Note that if there is a possibility the first call to
1917 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1918 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1919 #
1920 #
1921 # --------------------------------------------------------------
1922 AC_DEFUN([PKG_CHECK_MODULES],
1923 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1924 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1925 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1926
1927 pkg_failed=no
1928 AC_MSG_CHECKING([for $1])
1929
1930 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1931 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1932
1933 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1934 and $1[]_LIBS to avoid the need to call pkg-config.
1935 See the pkg-config man page for more details.])
1936
1937 if test $pkg_failed = yes; then
1938         AC_MSG_RESULT([no])
1939         _PKG_SHORT_ERRORS_SUPPORTED
1940         if test $_pkg_short_errors_supported = yes; then
1941                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1942         else 
1943                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1944         fi
1945         # Put the nasty error message in config.log where it belongs
1946         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1947
1948         m4_default([$4], [AC_MSG_ERROR(
1949 [Package requirements ($2) were not met:
1950
1951 $$1_PKG_ERRORS
1952
1953 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1954 installed software in a non-standard prefix.
1955
1956 _PKG_TEXT])[]dnl
1957         ])
1958 elif test $pkg_failed = untried; then
1959         AC_MSG_RESULT([no])
1960         m4_default([$4], [AC_MSG_FAILURE(
1961 [The pkg-config script could not be found or is too old.  Make sure it
1962 is in your PATH or set the PKG_CONFIG environment variable to the full
1963 path to pkg-config.
1964
1965 _PKG_TEXT
1966
1967 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1968         ])
1969 else
1970         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1971         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1972         AC_MSG_RESULT([yes])
1973         $3
1974 fi[]dnl
1975 ])# PKG_CHECK_MODULES
1976
1977 # po.m4 serial 17 (gettext-0.18)
1978 dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
1979 dnl This file is free software; the Free Software Foundation
1980 dnl gives unlimited permission to copy and/or distribute it,
1981 dnl with or without modifications, as long as this notice is preserved.
1982 dnl
1983 dnl This file can can be used in projects which are not available under
1984 dnl the GNU General Public License or the GNU Library General Public
1985 dnl License but which still want to provide support for the GNU gettext
1986 dnl functionality.
1987 dnl Please note that the actual code of the GNU gettext library is covered
1988 dnl by the GNU Library General Public License, and the rest of the GNU
1989 dnl gettext package package is covered by the GNU General Public License.
1990 dnl They are *not* in the public domain.
1991
1992 dnl Authors:
1993 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1994 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1995
1996 AC_PREREQ([2.50])
1997
1998 dnl Checks for all prerequisites of the po subdirectory.
1999 AC_DEFUN([AM_PO_SUBDIRS],
2000 [
2001   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2002   AC_REQUIRE([AC_PROG_INSTALL])dnl
2003   AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2004   AC_REQUIRE([AM_NLS])dnl
2005
2006   dnl Release version of the gettext macros. This is used to ensure that
2007   dnl the gettext macros and po/Makefile.in.in are in sync.
2008   AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
2009
2010   dnl Perform the following tests also if --disable-nls has been given,
2011   dnl because they are needed for "make dist" to work.
2012
2013   dnl Search for GNU msgfmt in the PATH.
2014   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2015   dnl The second test excludes FreeBSD msgfmt.
2016   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2017     [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2018      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2019     :)
2020   AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
2021
2022   dnl Test whether it is GNU msgfmt >= 0.15.
2023 changequote(,)dnl
2024   case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2025     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2026     *) MSGFMT_015=$MSGFMT ;;
2027   esac
2028 changequote([,])dnl
2029   AC_SUBST([MSGFMT_015])
2030 changequote(,)dnl
2031   case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2032     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2033     *) GMSGFMT_015=$GMSGFMT ;;
2034   esac
2035 changequote([,])dnl
2036   AC_SUBST([GMSGFMT_015])
2037
2038   dnl Search for GNU xgettext 0.12 or newer in the PATH.
2039   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2040   dnl The second test excludes FreeBSD xgettext.
2041   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2042     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2043      (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)],
2044     :)
2045   dnl Remove leftover from FreeBSD xgettext call.
2046   rm -f messages.po
2047
2048   dnl Test whether it is GNU xgettext >= 0.15.
2049 changequote(,)dnl
2050   case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2051     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2052     *) XGETTEXT_015=$XGETTEXT ;;
2053   esac
2054 changequote([,])dnl
2055   AC_SUBST([XGETTEXT_015])
2056
2057   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2058   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2059     [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2060
2061   dnl Installation directories.
2062   dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2063   dnl have to define it here, so that it can be used in po/Makefile.
2064   test -n "$localedir" || localedir='${datadir}/locale'
2065   AC_SUBST([localedir])
2066
2067   dnl Support for AM_XGETTEXT_OPTION.
2068   test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2069   AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2070
2071   AC_CONFIG_COMMANDS([po-directories], [[
2072     for ac_file in $CONFIG_FILES; do
2073       # Support "outfile[:infile[:infile...]]"
2074       case "$ac_file" in
2075         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2076       esac
2077       # PO directories have a Makefile.in generated from Makefile.in.in.
2078       case "$ac_file" in */Makefile.in)
2079         # Adjust a relative srcdir.
2080         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2081         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2082         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2083         # In autoconf-2.13 it is called $ac_given_srcdir.
2084         # In autoconf-2.50 it is called $srcdir.
2085         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2086         case "$ac_given_srcdir" in
2087           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2088           /*) top_srcdir="$ac_given_srcdir" ;;
2089           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2090         esac
2091         # Treat a directory as a PO directory if and only if it has a
2092         # POTFILES.in file. This allows packages to have multiple PO
2093         # directories under different names or in different locations.
2094         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2095           rm -f "$ac_dir/POTFILES"
2096           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2097           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2098           POMAKEFILEDEPS="POTFILES.in"
2099           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2100           # on $ac_dir but don't depend on user-specified configuration
2101           # parameters.
2102           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2103             # The LINGUAS file contains the set of available languages.
2104             if test -n "$OBSOLETE_ALL_LINGUAS"; then
2105               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2106             fi
2107             ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2108             # Hide the ALL_LINGUAS assigment from automake < 1.5.
2109             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2110             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2111           else
2112             # The set of available languages was given in configure.in.
2113             # Hide the ALL_LINGUAS assigment from automake < 1.5.
2114             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2115           fi
2116           # Compute POFILES
2117           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2118           # Compute UPDATEPOFILES
2119           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2120           # Compute DUMMYPOFILES
2121           # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2122           # Compute GMOFILES
2123           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2124           case "$ac_given_srcdir" in
2125             .) srcdirpre= ;;
2126             *) srcdirpre='$(srcdir)/' ;;
2127           esac
2128           POFILES=
2129           UPDATEPOFILES=
2130           DUMMYPOFILES=
2131           GMOFILES=
2132           for lang in $ALL_LINGUAS; do
2133             POFILES="$POFILES $srcdirpre$lang.po"
2134             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2135             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2136             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2137           done
2138           # CATALOGS depends on both $ac_dir and the user's LINGUAS
2139           # environment variable.
2140           INST_LINGUAS=
2141           if test -n "$ALL_LINGUAS"; then
2142             for presentlang in $ALL_LINGUAS; do
2143               useit=no
2144               if test "%UNSET%" != "$LINGUAS"; then
2145                 desiredlanguages="$LINGUAS"
2146               else
2147                 desiredlanguages="$ALL_LINGUAS"
2148               fi
2149               for desiredlang in $desiredlanguages; do
2150                 # Use the presentlang catalog if desiredlang is
2151                 #   a. equal to presentlang, or
2152                 #   b. a variant of presentlang (because in this case,
2153                 #      presentlang can be used as a fallback for messages
2154                 #      which are not translated in the desiredlang catalog).
2155                 case "$desiredlang" in
2156                   "$presentlang"*) useit=yes;;
2157                 esac
2158               done
2159               if test $useit = yes; then
2160                 INST_LINGUAS="$INST_LINGUAS $presentlang"
2161               fi
2162             done
2163           fi
2164           CATALOGS=
2165           if test -n "$INST_LINGUAS"; then
2166             for lang in $INST_LINGUAS; do
2167               CATALOGS="$CATALOGS $lang.gmo"
2168             done
2169           fi
2170           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2171           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"
2172           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2173             if test -f "$f"; then
2174               case "$f" in
2175                 *.orig | *.bak | *~) ;;
2176                 *) cat "$f" >> "$ac_dir/Makefile" ;;
2177               esac
2178             fi
2179           done
2180         fi
2181         ;;
2182       esac
2183     done]],
2184    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2185     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2186     # from automake < 1.5.
2187     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2188     # Capture the value of LINGUAS because we need it to compute CATALOGS.
2189     LINGUAS="${LINGUAS-%UNSET%}"
2190    ])
2191 ])
2192
2193 dnl Postprocesses a Makefile in a directory containing PO files.
2194 AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2195 [
2196   # When this code is run, in config.status, two variables have already been
2197   # set:
2198   # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2199   # - LINGUAS is the value of the environment variable LINGUAS at configure
2200   #   time.
2201
2202 changequote(,)dnl
2203   # Adjust a relative srcdir.
2204   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2205   ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2206   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2207   # In autoconf-2.13 it is called $ac_given_srcdir.
2208   # In autoconf-2.50 it is called $srcdir.
2209   test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2210   case "$ac_given_srcdir" in
2211     .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2212     /*) top_srcdir="$ac_given_srcdir" ;;
2213     *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2214   esac
2215
2216   # Find a way to echo strings without interpreting backslash.
2217   if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2218     gt_echo='echo'
2219   else
2220     if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2221       gt_echo='printf %s\n'
2222     else
2223       echo_func () {
2224         cat <<EOT
2225 $*
2226 EOT
2227       }
2228       gt_echo='echo_func'
2229     fi
2230   fi
2231
2232   # A sed script that extracts the value of VARIABLE from a Makefile.
2233   sed_x_variable='
2234 # Test if the hold space is empty.
2235 x
2236 s/P/P/
2237 x
2238 ta
2239 # Yes it was empty. Look if we have the expected variable definition.
2240 /^[      ]*VARIABLE[     ]*=/{
2241   # Seen the first line of the variable definition.
2242   s/^[   ]*VARIABLE[     ]*=//
2243   ba
2244 }
2245 bd
2246 :a
2247 # Here we are processing a line from the variable definition.
2248 # Remove comment, more precisely replace it with a space.
2249 s/#.*$/ /
2250 # See if the line ends in a backslash.
2251 tb
2252 :b
2253 s/\\$//
2254 # Print the line, without the trailing backslash.
2255 p
2256 tc
2257 # There was no trailing backslash. The end of the variable definition is
2258 # reached. Clear the hold space.
2259 s/^.*$//
2260 x
2261 bd
2262 :c
2263 # A trailing backslash means that the variable definition continues in the
2264 # next line. Put a nonempty string into the hold space to indicate this.
2265 s/^.*$/P/
2266 x
2267 :d
2268 '
2269 changequote([,])dnl
2270
2271   # Set POTFILES to the value of the Makefile variable POTFILES.
2272   sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2273   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2274   # Compute POTFILES_DEPS as
2275   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2276   POTFILES_DEPS=
2277   for file in $POTFILES; do
2278     POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2279   done
2280   POMAKEFILEDEPS=""
2281
2282   if test -n "$OBSOLETE_ALL_LINGUAS"; then
2283     test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2284   fi
2285   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2286     # The LINGUAS file contains the set of available languages.
2287     ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2288     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2289   else
2290     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2291     sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2292     ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2293   fi
2294   # Hide the ALL_LINGUAS assigment from automake < 1.5.
2295   eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2296   # Compute POFILES
2297   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2298   # Compute UPDATEPOFILES
2299   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2300   # Compute DUMMYPOFILES
2301   # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2302   # Compute GMOFILES
2303   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2304   # Compute PROPERTIESFILES
2305   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2306   # Compute CLASSFILES
2307   # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2308   # Compute QMFILES
2309   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2310   # Compute MSGFILES
2311   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2312   # Compute RESOURCESDLLFILES
2313   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2314   case "$ac_given_srcdir" in
2315     .) srcdirpre= ;;
2316     *) srcdirpre='$(srcdir)/' ;;
2317   esac
2318   POFILES=
2319   UPDATEPOFILES=
2320   DUMMYPOFILES=
2321   GMOFILES=
2322   PROPERTIESFILES=
2323   CLASSFILES=
2324   QMFILES=
2325   MSGFILES=
2326   RESOURCESDLLFILES=
2327   for lang in $ALL_LINGUAS; do
2328     POFILES="$POFILES $srcdirpre$lang.po"
2329     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2330     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2331     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2332     PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2333     CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2334     QMFILES="$QMFILES $srcdirpre$lang.qm"
2335     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2336     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2337     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/'`
2338     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2339   done
2340   # CATALOGS depends on both $ac_dir and the user's LINGUAS
2341   # environment variable.
2342   INST_LINGUAS=
2343   if test -n "$ALL_LINGUAS"; then
2344     for presentlang in $ALL_LINGUAS; do
2345       useit=no
2346       if test "%UNSET%" != "$LINGUAS"; then
2347         desiredlanguages="$LINGUAS"
2348       else
2349         desiredlanguages="$ALL_LINGUAS"
2350       fi
2351       for desiredlang in $desiredlanguages; do
2352         # Use the presentlang catalog if desiredlang is
2353         #   a. equal to presentlang, or
2354         #   b. a variant of presentlang (because in this case,
2355         #      presentlang can be used as a fallback for messages
2356         #      which are not translated in the desiredlang catalog).
2357         case "$desiredlang" in
2358           "$presentlang"*) useit=yes;;
2359         esac
2360       done
2361       if test $useit = yes; then
2362         INST_LINGUAS="$INST_LINGUAS $presentlang"
2363       fi
2364     done
2365   fi
2366   CATALOGS=
2367   JAVACATALOGS=
2368   QTCATALOGS=
2369   TCLCATALOGS=
2370   CSHARPCATALOGS=
2371   if test -n "$INST_LINGUAS"; then
2372     for lang in $INST_LINGUAS; do
2373       CATALOGS="$CATALOGS $lang.gmo"
2374       JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2375       QTCATALOGS="$QTCATALOGS $lang.qm"
2376       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2377       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2378       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/'`
2379       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2380     done
2381   fi
2382
2383   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"
2384   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2385     # Add dependencies that cannot be formulated as a simple suffix rule.
2386     for lang in $ALL_LINGUAS; do
2387       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2388       cat >> "$ac_file.tmp" <<EOF
2389 $frobbedlang.msg: $lang.po
2390         @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2391         \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2392 EOF
2393     done
2394   fi
2395   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2396     # Add dependencies that cannot be formulated as a simple suffix rule.
2397     for lang in $ALL_LINGUAS; do
2398       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/'`
2399       cat >> "$ac_file.tmp" <<EOF
2400 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2401         @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2402         \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2403 EOF
2404     done
2405   fi
2406   if test -n "$POMAKEFILEDEPS"; then
2407     cat >> "$ac_file.tmp" <<EOF
2408 Makefile: $POMAKEFILEDEPS
2409 EOF
2410   fi
2411   mv "$ac_file.tmp" "$ac_file"
2412 ])
2413
2414 dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2415 AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2416 [
2417   XGETTEXT_EXTRA_OPTIONS=
2418 ])
2419
2420 dnl Registers an option to be passed to xgettext in the po subdirectory.
2421 AC_DEFUN([AM_XGETTEXT_OPTION],
2422 [
2423   AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2424   XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2425 ])
2426
2427 # progtest.m4 serial 6 (gettext-0.18)
2428 dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
2429 dnl This file is free software; the Free Software Foundation
2430 dnl gives unlimited permission to copy and/or distribute it,
2431 dnl with or without modifications, as long as this notice is preserved.
2432 dnl
2433 dnl This file can can be used in projects which are not available under
2434 dnl the GNU General Public License or the GNU Library General Public
2435 dnl License but which still want to provide support for the GNU gettext
2436 dnl functionality.
2437 dnl Please note that the actual code of the GNU gettext library is covered
2438 dnl by the GNU Library General Public License, and the rest of the GNU
2439 dnl gettext package package is covered by the GNU General Public License.
2440 dnl They are *not* in the public domain.
2441
2442 dnl Authors:
2443 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2444
2445 AC_PREREQ([2.50])
2446
2447 # Search path for a program which passes the given test.
2448
2449 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2450 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2451 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2452 [
2453 # Prepare PATH_SEPARATOR.
2454 # The user is always right.
2455 if test "${PATH_SEPARATOR+set}" != set; then
2456   echo "#! /bin/sh" >conf$$.sh
2457   echo  "exit 0"   >>conf$$.sh
2458   chmod +x conf$$.sh
2459   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2460     PATH_SEPARATOR=';'
2461   else
2462     PATH_SEPARATOR=:
2463   fi
2464   rm -f conf$$.sh
2465 fi
2466
2467 # Find out how to test for executable files. Don't use a zero-byte file,
2468 # as systems may use methods other than mode bits to determine executability.
2469 cat >conf$$.file <<_ASEOF
2470 #! /bin/sh
2471 exit 0
2472 _ASEOF
2473 chmod +x conf$$.file
2474 if test -x conf$$.file >/dev/null 2>&1; then
2475   ac_executable_p="test -x"
2476 else
2477   ac_executable_p="test -f"
2478 fi
2479 rm -f conf$$.file
2480
2481 # Extract the first word of "$2", so it can be a program name with args.
2482 set dummy $2; ac_word=[$]2
2483 AC_MSG_CHECKING([for $ac_word])
2484 AC_CACHE_VAL([ac_cv_path_$1],
2485 [case "[$]$1" in
2486   [[\\/]]* | ?:[[\\/]]*)
2487     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2488     ;;
2489   *)
2490     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2491     for ac_dir in ifelse([$5], , $PATH, [$5]); do
2492       IFS="$ac_save_IFS"
2493       test -z "$ac_dir" && ac_dir=.
2494       for ac_exec_ext in '' $ac_executable_extensions; do
2495         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2496           echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2497           if [$3]; then
2498             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2499             break 2
2500           fi
2501         fi
2502       done
2503     done
2504     IFS="$ac_save_IFS"
2505 dnl If no 4th arg is given, leave the cache variable unset,
2506 dnl so AC_PATH_PROGS will keep looking.
2507 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2508 ])dnl
2509     ;;
2510 esac])dnl
2511 $1="$ac_cv_path_$1"
2512 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2513   AC_MSG_RESULT([$][$1])
2514 else
2515   AC_MSG_RESULT([no])
2516 fi
2517 AC_SUBST([$1])dnl
2518 ])
2519
2520 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
2521 #
2522 # This file is free software; the Free Software Foundation
2523 # gives unlimited permission to copy and/or distribute it,
2524 # with or without modifications, as long as this notice is preserved.
2525
2526 # AM_AUTOMAKE_VERSION(VERSION)
2527 # ----------------------------
2528 # Automake X.Y traces this macro to ensure aclocal.m4 has been
2529 # generated from the m4 files accompanying Automake X.Y.
2530 # (This private macro should not be called outside this file.)
2531 AC_DEFUN([AM_AUTOMAKE_VERSION],
2532 [am__api_version='1.11'
2533 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
2534 dnl require some minimum version.  Point them to the right macro.
2535 m4_if([$1], [1.11.1], [],
2536       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
2537 ])
2538
2539 # _AM_AUTOCONF_VERSION(VERSION)
2540 # -----------------------------
2541 # aclocal traces this macro to find the Autoconf version.
2542 # This is a private macro too.  Using m4_define simplifies
2543 # the logic in aclocal, which can simply ignore this definition.
2544 m4_define([_AM_AUTOCONF_VERSION], [])
2545
2546 # AM_SET_CURRENT_AUTOMAKE_VERSION
2547 # -------------------------------
2548 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
2549 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
2550 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
2551 [AM_AUTOMAKE_VERSION([1.11.1])dnl
2552 m4_ifndef([AC_AUTOCONF_VERSION],
2553   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
2554 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
2555
2556 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
2557
2558 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2559 #
2560 # This file is free software; the Free Software Foundation
2561 # gives unlimited permission to copy and/or distribute it,
2562 # with or without modifications, as long as this notice is preserved.
2563
2564 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
2565 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
2566 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
2567 #
2568 # Of course, Automake must honor this variable whenever it calls a
2569 # tool from the auxiliary directory.  The problem is that $srcdir (and
2570 # therefore $ac_aux_dir as well) can be either absolute or relative,
2571 # depending on how configure is run.  This is pretty annoying, since
2572 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
2573 # source directory, any form will work fine, but in subdirectories a
2574 # relative path needs to be adjusted first.
2575 #
2576 # $ac_aux_dir/missing
2577 #    fails when called from a subdirectory if $ac_aux_dir is relative
2578 # $top_srcdir/$ac_aux_dir/missing
2579 #    fails if $ac_aux_dir is absolute,
2580 #    fails when called from a subdirectory in a VPATH build with
2581 #          a relative $ac_aux_dir
2582 #
2583 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
2584 # are both prefixed by $srcdir.  In an in-source build this is usually
2585 # harmless because $srcdir is `.', but things will broke when you
2586 # start a VPATH build or use an absolute $srcdir.
2587 #
2588 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
2589 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
2590 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
2591 # and then we would define $MISSING as
2592 #   MISSING="\${SHELL} $am_aux_dir/missing"
2593 # This will work as long as MISSING is not called from configure, because
2594 # unfortunately $(top_srcdir) has no meaning in configure.
2595 # However there are other variables, like CC, which are often used in
2596 # configure, and could therefore not use this "fixed" $ac_aux_dir.
2597 #
2598 # Another solution, used here, is to always expand $ac_aux_dir to an
2599 # absolute PATH.  The drawback is that using absolute paths prevent a
2600 # configured tree to be moved without reconfiguration.
2601
2602 AC_DEFUN([AM_AUX_DIR_EXPAND],
2603 [dnl Rely on autoconf to set up CDPATH properly.
2604 AC_PREREQ([2.50])dnl
2605 # expand $ac_aux_dir to an absolute path
2606 am_aux_dir=`cd $ac_aux_dir && pwd`
2607 ])
2608
2609 # AM_CONDITIONAL                                            -*- Autoconf -*-
2610
2611 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
2612 # Free Software Foundation, Inc.
2613 #
2614 # This file is free software; the Free Software Foundation
2615 # gives unlimited permission to copy and/or distribute it,
2616 # with or without modifications, as long as this notice is preserved.
2617
2618 # serial 9
2619
2620 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
2621 # -------------------------------------
2622 # Define a conditional.
2623 AC_DEFUN([AM_CONDITIONAL],
2624 [AC_PREREQ(2.52)dnl
2625  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
2626         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
2627 AC_SUBST([$1_TRUE])dnl
2628 AC_SUBST([$1_FALSE])dnl
2629 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
2630 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
2631 m4_define([_AM_COND_VALUE_$1], [$2])dnl
2632 if $2; then
2633   $1_TRUE=
2634   $1_FALSE='#'
2635 else
2636   $1_TRUE='#'
2637   $1_FALSE=
2638 fi
2639 AC_CONFIG_COMMANDS_PRE(
2640 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
2641   AC_MSG_ERROR([[conditional "$1" was never defined.
2642 Usually this means the macro was only invoked conditionally.]])
2643 fi])])
2644
2645 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
2646 # Free Software Foundation, Inc.
2647 #
2648 # This file is free software; the Free Software Foundation
2649 # gives unlimited permission to copy and/or distribute it,
2650 # with or without modifications, as long as this notice is preserved.
2651
2652 # serial 10
2653
2654 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
2655 # written in clear, in which case automake, when reading aclocal.m4,
2656 # will think it sees a *use*, and therefore will trigger all it's
2657 # C support machinery.  Also note that it means that autoscan, seeing
2658 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
2659
2660
2661 # _AM_DEPENDENCIES(NAME)
2662 # ----------------------
2663 # See how the compiler implements dependency checking.
2664 # NAME is "CC", "CXX", "GCJ", or "OBJC".
2665 # We try a few techniques and use that to set a single cache variable.
2666 #
2667 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
2668 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
2669 # dependency, and given that the user is not expected to run this macro,
2670 # just rely on AC_PROG_CC.
2671 AC_DEFUN([_AM_DEPENDENCIES],
2672 [AC_REQUIRE([AM_SET_DEPDIR])dnl
2673 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
2674 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
2675 AC_REQUIRE([AM_DEP_TRACK])dnl
2676
2677 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
2678        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
2679        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
2680        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
2681        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
2682                    [depcc="$$1"   am_compiler_list=])
2683
2684 AC_CACHE_CHECK([dependency style of $depcc],
2685                [am_cv_$1_dependencies_compiler_type],
2686 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
2687   # We make a subdir and do the tests there.  Otherwise we can end up
2688   # making bogus files that we don't know about and never remove.  For
2689   # instance it was reported that on HP-UX the gcc test will end up
2690   # making a dummy file named `D' -- because `-MD' means `put the output
2691   # in D'.
2692   mkdir conftest.dir
2693   # Copy depcomp to subdir because otherwise we won't find it if we're
2694   # using a relative directory.
2695   cp "$am_depcomp" conftest.dir
2696   cd conftest.dir
2697   # We will build objects and dependencies in a subdirectory because
2698   # it helps to detect inapplicable dependency modes.  For instance
2699   # both Tru64's cc and ICC support -MD to output dependencies as a
2700   # side effect of compilation, but ICC will put the dependencies in
2701   # the current directory while Tru64 will put them in the object
2702   # directory.
2703   mkdir sub
2704
2705   am_cv_$1_dependencies_compiler_type=none
2706   if test "$am_compiler_list" = ""; then
2707      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
2708   fi
2709   am__universal=false
2710   m4_case([$1], [CC],
2711     [case " $depcc " in #(
2712      *\ -arch\ *\ -arch\ *) am__universal=true ;;
2713      esac],
2714     [CXX],
2715     [case " $depcc " in #(
2716      *\ -arch\ *\ -arch\ *) am__universal=true ;;
2717      esac])
2718
2719   for depmode in $am_compiler_list; do
2720     # Setup a source with many dependencies, because some compilers
2721     # like to wrap large dependency lists on column 80 (with \), and
2722     # we should not choose a depcomp mode which is confused by this.
2723     #
2724     # We need to recreate these files for each test, as the compiler may
2725     # overwrite some of them when testing with obscure command lines.
2726     # This happens at least with the AIX C compiler.
2727     : > sub/conftest.c
2728     for i in 1 2 3 4 5 6; do
2729       echo '#include "conftst'$i'.h"' >> sub/conftest.c
2730       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
2731       # Solaris 8's {/usr,}/bin/sh.
2732       touch sub/conftst$i.h
2733     done
2734     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
2735
2736     # We check with `-c' and `-o' for the sake of the "dashmstdout"
2737     # mode.  It turns out that the SunPro C++ compiler does not properly
2738     # handle `-M -o', and we need to detect this.  Also, some Intel
2739     # versions had trouble with output in subdirs
2740     am__obj=sub/conftest.${OBJEXT-o}
2741     am__minus_obj="-o $am__obj"
2742     case $depmode in
2743     gcc)
2744       # This depmode causes a compiler race in universal mode.
2745       test "$am__universal" = false || continue
2746       ;;
2747     nosideeffect)
2748       # after this tag, mechanisms are not by side-effect, so they'll
2749       # only be used when explicitly requested
2750       if test "x$enable_dependency_tracking" = xyes; then
2751         continue
2752       else
2753         break
2754       fi
2755       ;;
2756     msvisualcpp | msvcmsys)
2757       # This compiler won't grok `-c -o', but also, the minuso test has
2758       # not run yet.  These depmodes are late enough in the game, and
2759       # so weak that their functioning should not be impacted.
2760       am__obj=conftest.${OBJEXT-o}
2761       am__minus_obj=
2762       ;;
2763     none) break ;;
2764     esac
2765     if depmode=$depmode \
2766        source=sub/conftest.c object=$am__obj \
2767        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
2768        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
2769          >/dev/null 2>conftest.err &&
2770        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
2771        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
2772        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
2773        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
2774       # icc doesn't choke on unknown options, it will just issue warnings
2775       # or remarks (even with -Werror).  So we grep stderr for any message
2776       # that says an option was ignored or not supported.
2777       # When given -MP, icc 7.0 and 7.1 complain thusly:
2778       #   icc: Command line warning: ignoring option '-M'; no argument required
2779       # The diagnosis changed in icc 8.0:
2780       #   icc: Command line remark: option '-MP' not supported
2781       if (grep 'ignoring option' conftest.err ||
2782           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
2783         am_cv_$1_dependencies_compiler_type=$depmode
2784         break
2785       fi
2786     fi
2787   done
2788
2789   cd ..
2790   rm -rf conftest.dir
2791 else
2792   am_cv_$1_dependencies_compiler_type=none
2793 fi
2794 ])
2795 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
2796 AM_CONDITIONAL([am__fastdep$1], [
2797   test "x$enable_dependency_tracking" != xno \
2798   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
2799 ])
2800
2801
2802 # AM_SET_DEPDIR
2803 # -------------
2804 # Choose a directory name for dependency files.
2805 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
2806 AC_DEFUN([AM_SET_DEPDIR],
2807 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2808 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
2809 ])
2810
2811
2812 # AM_DEP_TRACK
2813 # ------------
2814 AC_DEFUN([AM_DEP_TRACK],
2815 [AC_ARG_ENABLE(dependency-tracking,
2816 [  --disable-dependency-tracking  speeds up one-time build
2817   --enable-dependency-tracking   do not reject slow dependency extractors])
2818 if test "x$enable_dependency_tracking" != xno; then
2819   am_depcomp="$ac_aux_dir/depcomp"
2820   AMDEPBACKSLASH='\'
2821 fi
2822 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
2823 AC_SUBST([AMDEPBACKSLASH])dnl
2824 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
2825 ])
2826
2827 # Generate code to set up dependency tracking.              -*- Autoconf -*-
2828
2829 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
2830 # Free Software Foundation, Inc.
2831 #
2832 # This file is free software; the Free Software Foundation
2833 # gives unlimited permission to copy and/or distribute it,
2834 # with or without modifications, as long as this notice is preserved.
2835
2836 #serial 5
2837
2838 # _AM_OUTPUT_DEPENDENCY_COMMANDS
2839 # ------------------------------
2840 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
2841 [{
2842   # Autoconf 2.62 quotes --file arguments for eval, but not when files
2843   # are listed without --file.  Let's play safe and only enable the eval
2844   # if we detect the quoting.
2845   case $CONFIG_FILES in
2846   *\'*) eval set x "$CONFIG_FILES" ;;
2847   *)   set x $CONFIG_FILES ;;
2848   esac
2849   shift
2850   for mf
2851   do
2852     # Strip MF so we end up with the name of the file.
2853     mf=`echo "$mf" | sed -e 's/:.*$//'`
2854     # Check whether this is an Automake generated Makefile or not.
2855     # We used to match only the files named `Makefile.in', but
2856     # some people rename them; so instead we look at the file content.
2857     # Grep'ing the first line is not enough: some people post-process
2858     # each Makefile.in and add a new line on top of each file to say so.
2859     # Grep'ing the whole file is not good either: AIX grep has a line
2860     # limit of 2048, but all sed's we know have understand at least 4000.
2861     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
2862       dirpart=`AS_DIRNAME("$mf")`
2863     else
2864       continue
2865     fi
2866     # Extract the definition of DEPDIR, am__include, and am__quote
2867     # from the Makefile without running `make'.
2868     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
2869     test -z "$DEPDIR" && continue
2870     am__include=`sed -n 's/^am__include = //p' < "$mf"`
2871     test -z "am__include" && continue
2872     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
2873     # When using ansi2knr, U may be empty or an underscore; expand it
2874     U=`sed -n 's/^U = //p' < "$mf"`
2875     # Find all dependency output files, they are included files with
2876     # $(DEPDIR) in their names.  We invoke sed twice because it is the
2877     # simplest approach to changing $(DEPDIR) to its actual value in the
2878     # expansion.
2879     for file in `sed -n "
2880       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
2881          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
2882       # Make sure the directory exists.
2883       test -f "$dirpart/$file" && continue
2884       fdir=`AS_DIRNAME(["$file"])`
2885       AS_MKDIR_P([$dirpart/$fdir])
2886       # echo "creating $dirpart/$file"
2887       echo '# dummy' > "$dirpart/$file"
2888     done
2889   done
2890 }
2891 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
2892
2893
2894 # AM_OUTPUT_DEPENDENCY_COMMANDS
2895 # -----------------------------
2896 # This macro should only be invoked once -- use via AC_REQUIRE.
2897 #
2898 # This code is only required when automatic dependency tracking
2899 # is enabled.  FIXME.  This creates each `.P' file that we will
2900 # need in order to bootstrap the dependency handling code.
2901 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
2902 [AC_CONFIG_COMMANDS([depfiles],
2903      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
2904      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
2905 ])
2906
2907 # Do all the work for Automake.                             -*- Autoconf -*-
2908
2909 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2910 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
2911 #
2912 # This file is free software; the Free Software Foundation
2913 # gives unlimited permission to copy and/or distribute it,
2914 # with or without modifications, as long as this notice is preserved.
2915
2916 # serial 16
2917
2918 # This macro actually does too much.  Some checks are only needed if
2919 # your package does certain things.  But this isn't really a big deal.
2920
2921 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
2922 # AM_INIT_AUTOMAKE([OPTIONS])
2923 # -----------------------------------------------
2924 # The call with PACKAGE and VERSION arguments is the old style
2925 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
2926 # and VERSION should now be passed to AC_INIT and removed from
2927 # the call to AM_INIT_AUTOMAKE.
2928 # We support both call styles for the transition.  After
2929 # the next Automake release, Autoconf can make the AC_INIT
2930 # arguments mandatory, and then we can depend on a new Autoconf
2931 # release and drop the old call support.
2932 AC_DEFUN([AM_INIT_AUTOMAKE],
2933 [AC_PREREQ([2.62])dnl
2934 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
2935 dnl the ones we care about.
2936 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
2937 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
2938 AC_REQUIRE([AC_PROG_INSTALL])dnl
2939 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2940   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2941   # is not polluted with repeated "-I."
2942   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2943   # test to see if srcdir already configured
2944   if test -f $srcdir/config.status; then
2945     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2946   fi
2947 fi
2948
2949 # test whether we have cygpath
2950 if test -z "$CYGPATH_W"; then
2951   if (cygpath --version) >/dev/null 2>/dev/null; then
2952     CYGPATH_W='cygpath -w'
2953   else
2954     CYGPATH_W=echo
2955   fi
2956 fi
2957 AC_SUBST([CYGPATH_W])
2958
2959 # Define the identity of the package.
2960 dnl Distinguish between old-style and new-style calls.
2961 m4_ifval([$2],
2962 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2963  AC_SUBST([PACKAGE], [$1])dnl
2964  AC_SUBST([VERSION], [$2])],
2965 [_AM_SET_OPTIONS([$1])dnl
2966 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2967 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
2968   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2969  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2970  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2971
2972 _AM_IF_OPTION([no-define],,
2973 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
2974  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
2975
2976 # Some tools Automake needs.
2977 AC_REQUIRE([AM_SANITY_CHECK])dnl
2978 AC_REQUIRE([AC_ARG_PROGRAM])dnl
2979 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
2980 AM_MISSING_PROG(AUTOCONF, autoconf)
2981 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
2982 AM_MISSING_PROG(AUTOHEADER, autoheader)
2983 AM_MISSING_PROG(MAKEINFO, makeinfo)
2984 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2985 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2986 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
2987 # We need awk for the "check" target.  The system "awk" is bad on
2988 # some platforms.
2989 AC_REQUIRE([AC_PROG_AWK])dnl
2990 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2991 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2992 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2993               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2994                              [_AM_PROG_TAR([v7])])])
2995 _AM_IF_OPTION([no-dependencies],,
2996 [AC_PROVIDE_IFELSE([AC_PROG_CC],
2997                   [_AM_DEPENDENCIES(CC)],
2998                   [define([AC_PROG_CC],
2999                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
3000 AC_PROVIDE_IFELSE([AC_PROG_CXX],
3001                   [_AM_DEPENDENCIES(CXX)],
3002                   [define([AC_PROG_CXX],
3003                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
3004 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
3005                   [_AM_DEPENDENCIES(OBJC)],
3006                   [define([AC_PROG_OBJC],
3007                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
3008 ])
3009 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
3010 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
3011 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
3012 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
3013 AC_CONFIG_COMMANDS_PRE(dnl
3014 [m4_provide_if([_AM_COMPILER_EXEEXT],
3015   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
3016 ])
3017
3018 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
3019 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
3020 dnl mangled by Autoconf and run in a shell conditional statement.
3021 m4_define([_AC_COMPILER_EXEEXT],
3022 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
3023
3024
3025 # When config.status generates a header, we must update the stamp-h file.
3026 # This file resides in the same directory as the config header
3027 # that is generated.  The stamp files are numbered to have different names.
3028
3029 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
3030 # loop where config.status creates the headers, so we can generate
3031 # our stamp files there.
3032 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
3033 [# Compute $1's index in $config_headers.
3034 _am_arg=$1
3035 _am_stamp_count=1
3036 for _am_header in $config_headers :; do
3037   case $_am_header in
3038     $_am_arg | $_am_arg:* )
3039       break ;;
3040     * )
3041       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
3042   esac
3043 done
3044 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
3045
3046 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
3047 #
3048 # This file is free software; the Free Software Foundation
3049 # gives unlimited permission to copy and/or distribute it,
3050 # with or without modifications, as long as this notice is preserved.
3051
3052 # AM_PROG_INSTALL_SH
3053 # ------------------
3054 # Define $install_sh.
3055 AC_DEFUN([AM_PROG_INSTALL_SH],
3056 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3057 if test x"${install_sh}" != xset; then
3058   case $am_aux_dir in
3059   *\ * | *\     *)
3060     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
3061   *)
3062     install_sh="\${SHELL} $am_aux_dir/install-sh"
3063   esac
3064 fi
3065 AC_SUBST(install_sh)])
3066
3067 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
3068 #
3069 # This file is free software; the Free Software Foundation
3070 # gives unlimited permission to copy and/or distribute it,
3071 # with or without modifications, as long as this notice is preserved.
3072
3073 # serial 2
3074
3075 # Check whether the underlying file-system supports filenames
3076 # with a leading dot.  For instance MS-DOS doesn't.
3077 AC_DEFUN([AM_SET_LEADING_DOT],
3078 [rm -rf .tst 2>/dev/null
3079 mkdir .tst 2>/dev/null
3080 if test -d .tst; then
3081   am__leading_dot=.
3082 else
3083   am__leading_dot=_
3084 fi
3085 rmdir .tst 2>/dev/null
3086 AC_SUBST([am__leading_dot])])
3087
3088 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
3089
3090 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
3091 #
3092 # This file is free software; the Free Software Foundation
3093 # gives unlimited permission to copy and/or distribute it,
3094 # with or without modifications, as long as this notice is preserved.
3095
3096 # serial 4
3097
3098 # AM_MAKE_INCLUDE()
3099 # -----------------
3100 # Check to see how make treats includes.
3101 AC_DEFUN([AM_MAKE_INCLUDE],
3102 [am_make=${MAKE-make}
3103 cat > confinc << 'END'
3104 am__doit:
3105         @echo this is the am__doit target
3106 .PHONY: am__doit
3107 END
3108 # If we don't find an include directive, just comment out the code.
3109 AC_MSG_CHECKING([for style of include used by $am_make])
3110 am__include="#"
3111 am__quote=
3112 _am_result=none
3113 # First try GNU make style include.
3114 echo "include confinc" > confmf
3115 # Ignore all kinds of additional output from `make'.
3116 case `$am_make -s -f confmf 2> /dev/null` in #(
3117 *the\ am__doit\ target*)
3118   am__include=include
3119   am__quote=
3120   _am_result=GNU
3121   ;;
3122 esac
3123 # Now try BSD make style include.
3124 if test "$am__include" = "#"; then
3125    echo '.include "confinc"' > confmf
3126    case `$am_make -s -f confmf 2> /dev/null` in #(
3127    *the\ am__doit\ target*)
3128      am__include=.include
3129      am__quote="\""
3130      _am_result=BSD
3131      ;;
3132    esac
3133 fi
3134 AC_SUBST([am__include])
3135 AC_SUBST([am__quote])
3136 AC_MSG_RESULT([$_am_result])
3137 rm -f confinc confmf
3138 ])
3139
3140 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
3141 # Free Software Foundation, Inc.
3142 #
3143 # This file is free software; the Free Software Foundation
3144 # gives unlimited permission to copy and/or distribute it,
3145 # with or without modifications, as long as this notice is preserved.
3146
3147 # serial 6
3148
3149 # AM_PROG_CC_C_O
3150 # --------------
3151 # Like AC_PROG_CC_C_O, but changed for automake.
3152 AC_DEFUN([AM_PROG_CC_C_O],
3153 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
3154 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3155 AC_REQUIRE_AUX_FILE([compile])dnl
3156 # FIXME: we rely on the cache variable name because
3157 # there is no other way.
3158 set dummy $CC
3159 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
3160 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
3161 if test "$am_t" != yes; then
3162    # Losing compiler, so override with the script.
3163    # FIXME: It is wrong to rewrite CC.
3164    # But if we don't then we get into trouble of one sort or another.
3165    # A longer-term fix would be to have automake use am__CC in this case,
3166    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3167    CC="$am_aux_dir/compile $CC"
3168 fi
3169 dnl Make sure AC_PROG_CC is never called again, or it will override our
3170 dnl setting of CC.
3171 m4_define([AC_PROG_CC],
3172           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
3173 ])
3174
3175 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
3176
3177 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
3178 # Free Software Foundation, Inc.
3179 #
3180 # This file is free software; the Free Software Foundation
3181 # gives unlimited permission to copy and/or distribute it,
3182 # with or without modifications, as long as this notice is preserved.
3183
3184 # serial 6
3185
3186 # AM_MISSING_PROG(NAME, PROGRAM)
3187 # ------------------------------
3188 AC_DEFUN([AM_MISSING_PROG],
3189 [AC_REQUIRE([AM_MISSING_HAS_RUN])
3190 $1=${$1-"${am_missing_run}$2"}
3191 AC_SUBST($1)])
3192
3193
3194 # AM_MISSING_HAS_RUN
3195 # ------------------
3196 # Define MISSING if not defined so far and test if it supports --run.
3197 # If it does, set am_missing_run to use it, otherwise, to nothing.
3198 AC_DEFUN([AM_MISSING_HAS_RUN],
3199 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
3200 AC_REQUIRE_AUX_FILE([missing])dnl
3201 if test x"${MISSING+set}" != xset; then
3202   case $am_aux_dir in
3203   *\ * | *\     *)
3204     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
3205   *)
3206     MISSING="\${SHELL} $am_aux_dir/missing" ;;
3207   esac
3208 fi
3209 # Use eval to expand $SHELL
3210 if eval "$MISSING --run true"; then
3211   am_missing_run="$MISSING --run "
3212 else
3213   am_missing_run=
3214   AC_MSG_WARN([`missing' script is too old or missing])
3215 fi
3216 ])
3217
3218 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
3219 #
3220 # This file is free software; the Free Software Foundation
3221 # gives unlimited permission to copy and/or distribute it,
3222 # with or without modifications, as long as this notice is preserved.
3223
3224 # AM_PROG_MKDIR_P
3225 # ---------------
3226 # Check for `mkdir -p'.
3227 AC_DEFUN([AM_PROG_MKDIR_P],
3228 [AC_PREREQ([2.60])dnl
3229 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
3230 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
3231 dnl while keeping a definition of mkdir_p for backward compatibility.
3232 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
3233 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
3234 dnl Makefile.ins that do not define MKDIR_P, so we do our own
3235 dnl adjustment using top_builddir (which is defined more often than
3236 dnl MKDIR_P).
3237 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
3238 case $mkdir_p in
3239   [[\\/$]]* | ?:[[\\/]]*) ;;
3240   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
3241 esac
3242 ])
3243
3244 # Helper functions for option handling.                     -*- Autoconf -*-
3245
3246 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
3247 #
3248 # This file is free software; the Free Software Foundation
3249 # gives unlimited permission to copy and/or distribute it,
3250 # with or without modifications, as long as this notice is preserved.
3251
3252 # serial 4
3253
3254 # _AM_MANGLE_OPTION(NAME)
3255 # -----------------------
3256 AC_DEFUN([_AM_MANGLE_OPTION],
3257 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
3258
3259 # _AM_SET_OPTION(NAME)
3260 # ------------------------------
3261 # Set option NAME.  Presently that only means defining a flag for this option.
3262 AC_DEFUN([_AM_SET_OPTION],
3263 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
3264
3265 # _AM_SET_OPTIONS(OPTIONS)
3266 # ----------------------------------
3267 # OPTIONS is a space-separated list of Automake options.
3268 AC_DEFUN([_AM_SET_OPTIONS],
3269 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
3270
3271 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
3272 # -------------------------------------------
3273 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
3274 AC_DEFUN([_AM_IF_OPTION],
3275 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
3276
3277 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
3278
3279 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
3280 # Free Software Foundation, Inc.
3281 #
3282 # This file is free software; the Free Software Foundation
3283 # gives unlimited permission to copy and/or distribute it,
3284 # with or without modifications, as long as this notice is preserved.
3285
3286 # serial 5
3287
3288 # AM_SANITY_CHECK
3289 # ---------------
3290 AC_DEFUN([AM_SANITY_CHECK],
3291 [AC_MSG_CHECKING([whether build environment is sane])
3292 # Just in case
3293 sleep 1
3294 echo timestamp > conftest.file
3295 # Reject unsafe characters in $srcdir or the absolute working directory
3296 # name.  Accept space and tab only in the latter.
3297 am_lf='
3298 '
3299 case `pwd` in
3300   *[[\\\"\#\$\&\'\`$am_lf]]*)
3301     AC_MSG_ERROR([unsafe absolute working directory name]);;
3302 esac
3303 case $srcdir in
3304   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
3305     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
3306 esac
3307
3308 # Do `set' in a subshell so we don't clobber the current shell's
3309 # arguments.  Must try -L first in case configure is actually a
3310 # symlink; some systems play weird games with the mod time of symlinks
3311 # (eg FreeBSD returns the mod time of the symlink's containing
3312 # directory).
3313 if (
3314    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
3315    if test "$[*]" = "X"; then
3316       # -L didn't work.
3317       set X `ls -t "$srcdir/configure" conftest.file`
3318    fi
3319    rm -f conftest.file
3320    if test "$[*]" != "X $srcdir/configure conftest.file" \
3321       && test "$[*]" != "X conftest.file $srcdir/configure"; then
3322
3323       # If neither matched, then we have a broken ls.  This can happen
3324       # if, for instance, CONFIG_SHELL is bash and it inherits a
3325       # broken ls alias from the environment.  This has actually
3326       # happened.  Such a system could not be considered "sane".
3327       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
3328 alias in your environment])
3329    fi
3330
3331    test "$[2]" = conftest.file
3332    )
3333 then
3334    # Ok.
3335    :
3336 else
3337    AC_MSG_ERROR([newly created file is older than distributed files!
3338 Check your system clock])
3339 fi
3340 AC_MSG_RESULT(yes)])
3341
3342 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
3343 #
3344 # This file is free software; the Free Software Foundation
3345 # gives unlimited permission to copy and/or distribute it,
3346 # with or without modifications, as long as this notice is preserved.
3347
3348 # AM_PROG_INSTALL_STRIP
3349 # ---------------------
3350 # One issue with vendor `install' (even GNU) is that you can't
3351 # specify the program used to strip binaries.  This is especially
3352 # annoying in cross-compiling environments, where the build's strip
3353 # is unlikely to handle the host's binaries.
3354 # Fortunately install-sh will honor a STRIPPROG variable, so we
3355 # always use install-sh in `make install-strip', and initialize
3356 # STRIPPROG with the value of the STRIP variable (set by the user).
3357 AC_DEFUN([AM_PROG_INSTALL_STRIP],
3358 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
3359 # Installed binaries are usually stripped using `strip' when the user
3360 # run `make install-strip'.  However `strip' might not be the right
3361 # tool to use in cross-compilation environments, therefore Automake
3362 # will honor the `STRIP' environment variable to overrule this program.
3363 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
3364 if test "$cross_compiling" != no; then
3365   AC_CHECK_TOOL([STRIP], [strip], :)
3366 fi
3367 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3368 AC_SUBST([INSTALL_STRIP_PROGRAM])])
3369
3370 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
3371 #
3372 # This file is free software; the Free Software Foundation
3373 # gives unlimited permission to copy and/or distribute it,
3374 # with or without modifications, as long as this notice is preserved.
3375
3376 # serial 2
3377
3378 # _AM_SUBST_NOTMAKE(VARIABLE)
3379 # ---------------------------
3380 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
3381 # This macro is traced by Automake.
3382 AC_DEFUN([_AM_SUBST_NOTMAKE])
3383
3384 # AM_SUBST_NOTMAKE(VARIABLE)
3385 # ---------------------------
3386 # Public sister of _AM_SUBST_NOTMAKE.
3387 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
3388
3389 # Check how to create a tarball.                            -*- Autoconf -*-
3390
3391 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
3392 #
3393 # This file is free software; the Free Software Foundation
3394 # gives unlimited permission to copy and/or distribute it,
3395 # with or without modifications, as long as this notice is preserved.
3396
3397 # serial 2
3398
3399 # _AM_PROG_TAR(FORMAT)
3400 # --------------------
3401 # Check how to create a tarball in format FORMAT.
3402 # FORMAT should be one of `v7', `ustar', or `pax'.
3403 #
3404 # Substitute a variable $(am__tar) that is a command
3405 # writing to stdout a FORMAT-tarball containing the directory
3406 # $tardir.
3407 #     tardir=directory && $(am__tar) > result.tar
3408 #
3409 # Substitute a variable $(am__untar) that extract such
3410 # a tarball read from stdin.
3411 #     $(am__untar) < result.tar
3412 AC_DEFUN([_AM_PROG_TAR],
3413 [# Always define AMTAR for backward compatibility.
3414 AM_MISSING_PROG([AMTAR], [tar])
3415 m4_if([$1], [v7],
3416      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
3417      [m4_case([$1], [ustar],, [pax],,
3418               [m4_fatal([Unknown tar format])])
3419 AC_MSG_CHECKING([how to create a $1 tar archive])
3420 # Loop over all known methods to create a tar archive until one works.
3421 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
3422 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
3423 # Do not fold the above two line into one, because Tru64 sh and
3424 # Solaris sh will not grok spaces in the rhs of `-'.
3425 for _am_tool in $_am_tools
3426 do
3427   case $_am_tool in
3428   gnutar)
3429     for _am_tar in tar gnutar gtar;
3430     do
3431       AM_RUN_LOG([$_am_tar --version]) && break
3432     done
3433     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
3434     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
3435     am__untar="$_am_tar -xf -"
3436     ;;
3437   plaintar)
3438     # Must skip GNU tar: if it does not support --format= it doesn't create
3439     # ustar tarball either.
3440     (tar --version) >/dev/null 2>&1 && continue
3441     am__tar='tar chf - "$$tardir"'
3442     am__tar_='tar chf - "$tardir"'
3443     am__untar='tar xf -'
3444     ;;
3445   pax)
3446     am__tar='pax -L -x $1 -w "$$tardir"'
3447     am__tar_='pax -L -x $1 -w "$tardir"'
3448     am__untar='pax -r'
3449     ;;
3450   cpio)
3451     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
3452     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
3453     am__untar='cpio -i -H $1 -d'
3454     ;;
3455   none)
3456     am__tar=false
3457     am__tar_=false
3458     am__untar=false
3459     ;;
3460   esac
3461
3462   # If the value was cached, stop now.  We just wanted to have am__tar
3463   # and am__untar set.
3464   test -n "${am_cv_prog_tar_$1}" && break
3465
3466   # tar/untar a dummy directory, and stop if the command works
3467   rm -rf conftest.dir
3468   mkdir conftest.dir
3469   echo GrepMe > conftest.dir/file
3470   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
3471   rm -rf conftest.dir
3472   if test -s conftest.tar; then
3473     AM_RUN_LOG([$am__untar <conftest.tar])
3474     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
3475   fi
3476 done
3477 rm -rf conftest.dir
3478
3479 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
3480 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
3481 AC_SUBST([am__tar])
3482 AC_SUBST([am__untar])
3483 ]) # _AM_PROG_TAR
3484