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