Imported Upstream version 3.13.91
[platform/upstream/pygobject2.git] / aclocal.m4
1 # generated automatically by aclocal 1.13.4 -*- 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 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
24 # serial 1 (pkg-config-0.24)
25
26 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27 #
28 # This program is free software; you can redistribute it and/or modify
29 # it under the terms of the GNU General Public License as published by
30 # the Free Software Foundation; either version 2 of the License, or
31 # (at your option) any later version.
32 #
33 # This program is distributed in the hope that it will be useful, but
34 # WITHOUT ANY WARRANTY; without even the implied warranty of
35 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
36 # General Public License for more details.
37 #
38 # You should have received a copy of the GNU General Public License
39 # along with this program; if not, write to the Free Software
40 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41 #
42 # As a special exception to the GNU General Public License, if you
43 # distribute this file as part of a program that contains a
44 # configuration script generated by Autoconf, you may include it under
45 # the same distribution terms that you use for the rest of that program.
46
47 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
48 # ----------------------------------
49 AC_DEFUN([PKG_PROG_PKG_CONFIG],
50 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
51 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
52 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
53 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
54 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
55 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
56
57 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
58         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
59 fi
60 if test -n "$PKG_CONFIG"; then
61         _pkg_min_version=m4_default([$1], [0.9.0])
62         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
63         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
64                 AC_MSG_RESULT([yes])
65         else
66                 AC_MSG_RESULT([no])
67                 PKG_CONFIG=""
68         fi
69 fi[]dnl
70 ])# PKG_PROG_PKG_CONFIG
71
72 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
73 #
74 # Check to see whether a particular set of modules exists.  Similar
75 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
76 #
77 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
78 # only at the first occurence in configure.ac, so if the first place
79 # it's called might be skipped (such as if it is within an "if", you
80 # have to call PKG_CHECK_EXISTS manually
81 # --------------------------------------------------------------
82 AC_DEFUN([PKG_CHECK_EXISTS],
83 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
84 if test -n "$PKG_CONFIG" && \
85     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86   m4_default([$2], [:])
87 m4_ifvaln([$3], [else
88   $3])dnl
89 fi])
90
91 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
92 # ---------------------------------------------
93 m4_define([_PKG_CONFIG],
94 [if test -n "$$1"; then
95     pkg_cv_[]$1="$$1"
96  elif test -n "$PKG_CONFIG"; then
97     PKG_CHECK_EXISTS([$3],
98                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
99                       test "x$?" != "x0" && pkg_failed=yes ],
100                      [pkg_failed=yes])
101  else
102     pkg_failed=untried
103 fi[]dnl
104 ])# _PKG_CONFIG
105
106 # _PKG_SHORT_ERRORS_SUPPORTED
107 # -----------------------------
108 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
109 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
110 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
111         _pkg_short_errors_supported=yes
112 else
113         _pkg_short_errors_supported=no
114 fi[]dnl
115 ])# _PKG_SHORT_ERRORS_SUPPORTED
116
117
118 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
119 # [ACTION-IF-NOT-FOUND])
120 #
121 #
122 # Note that if there is a possibility the first call to
123 # PKG_CHECK_MODULES might not happen, you should be sure to include an
124 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
125 #
126 #
127 # --------------------------------------------------------------
128 AC_DEFUN([PKG_CHECK_MODULES],
129 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
130 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
131 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
132
133 pkg_failed=no
134 AC_MSG_CHECKING([for $1])
135
136 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
137 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
138
139 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
140 and $1[]_LIBS to avoid the need to call pkg-config.
141 See the pkg-config man page for more details.])
142
143 if test $pkg_failed = yes; then
144         AC_MSG_RESULT([no])
145         _PKG_SHORT_ERRORS_SUPPORTED
146         if test $_pkg_short_errors_supported = yes; then
147                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
148         else 
149                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
150         fi
151         # Put the nasty error message in config.log where it belongs
152         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
153
154         m4_default([$4], [AC_MSG_ERROR(
155 [Package requirements ($2) were not met:
156
157 $$1_PKG_ERRORS
158
159 Consider adjusting the PKG_CONFIG_PATH environment variable if you
160 installed software in a non-standard prefix.
161
162 _PKG_TEXT])[]dnl
163         ])
164 elif test $pkg_failed = untried; then
165         AC_MSG_RESULT([no])
166         m4_default([$4], [AC_MSG_FAILURE(
167 [The pkg-config script could not be found or is too old.  Make sure it
168 is in your PATH or set the PKG_CONFIG environment variable to the full
169 path to pkg-config.
170
171 _PKG_TEXT
172
173 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
174         ])
175 else
176         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
178         AC_MSG_RESULT([yes])
179         $3
180 fi[]dnl
181 ])# PKG_CHECK_MODULES
182
183
184 # PKG_INSTALLDIR(DIRECTORY)
185 # -------------------------
186 # Substitutes the variable pkgconfigdir as the location where a module
187 # should install pkg-config .pc files. By default the directory is
188 # $libdir/pkgconfig, but the default can be changed by passing
189 # DIRECTORY. The user can override through the --with-pkgconfigdir
190 # parameter.
191 AC_DEFUN([PKG_INSTALLDIR],
192 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
193 m4_pushdef([pkg_description],
194     [pkg-config installation directory @<:@]pkg_default[@:>@])
195 AC_ARG_WITH([pkgconfigdir],
196     [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
197     [with_pkgconfigdir=]pkg_default)
198 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
199 m4_popdef([pkg_default])
200 m4_popdef([pkg_description])
201 ]) dnl PKG_INSTALLDIR
202
203
204 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
205 # -------------------------
206 # Substitutes the variable noarch_pkgconfigdir as the location where a
207 # module should install arch-independent pkg-config .pc files. By
208 # default the directory is $datadir/pkgconfig, but the default can be
209 # changed by passing DIRECTORY. The user can override through the
210 # --with-noarch-pkgconfigdir parameter.
211 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
212 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
213 m4_pushdef([pkg_description],
214     [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
215 AC_ARG_WITH([noarch-pkgconfigdir],
216     [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
217     [with_noarch_pkgconfigdir=]pkg_default)
218 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
219 m4_popdef([pkg_default])
220 m4_popdef([pkg_description])
221 ]) dnl PKG_NOARCH_INSTALLDIR
222
223
224 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
225 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
226 # -------------------------------------------
227 # Retrieves the value of the pkg-config variable for the given module.
228 AC_DEFUN([PKG_CHECK_VAR],
229 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
230 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
231
232 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
233 AS_VAR_COPY([$1], [pkg_cv_][$1])
234
235 AS_VAR_IF([$1], [""], [$5], [$4])dnl
236 ])# PKG_CHECK_VAR
237
238 # Configure paths for GLIB
239 # Owen Taylor     1997-2001
240
241 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
242 dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
243 dnl gthread, or gio is specified in MODULES, pass to pkg-config
244 dnl
245 AC_DEFUN([AM_PATH_GLIB_2_0],
246 [dnl 
247 dnl Get the cflags and libraries from pkg-config
248 dnl
249 AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
250                     , enable_glibtest=yes)
251
252   pkg_config_args=glib-2.0
253   for module in . $4
254   do
255       case "$module" in
256          gmodule) 
257              pkg_config_args="$pkg_config_args gmodule-2.0"
258          ;;
259          gmodule-no-export) 
260              pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
261          ;;
262          gobject) 
263              pkg_config_args="$pkg_config_args gobject-2.0"
264          ;;
265          gthread) 
266              pkg_config_args="$pkg_config_args gthread-2.0"
267          ;;
268          gio*) 
269              pkg_config_args="$pkg_config_args $module-2.0"
270          ;;
271       esac
272   done
273
274   PKG_PROG_PKG_CONFIG([0.16])
275
276   no_glib=""
277
278   if test "x$PKG_CONFIG" = x ; then
279     no_glib=yes
280     PKG_CONFIG=no
281   fi
282
283   min_glib_version=ifelse([$1], ,2.0.0,$1)
284   AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
285
286   if test x$PKG_CONFIG != xno ; then
287     ## don't try to run the test against uninstalled libtool libs
288     if $PKG_CONFIG --uninstalled $pkg_config_args; then
289           echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
290           enable_glibtest=no
291     fi
292
293     if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
294           :
295     else
296           no_glib=yes
297     fi
298   fi
299
300   if test x"$no_glib" = x ; then
301     GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
302     GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
303     GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
304     GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
305
306     GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
307     GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
308     glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
309            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
310     glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
311            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
312     glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
313            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
314     if test "x$enable_glibtest" = "xyes" ; then
315       ac_save_CFLAGS="$CFLAGS"
316       ac_save_LIBS="$LIBS"
317       CFLAGS="$CFLAGS $GLIB_CFLAGS"
318       LIBS="$GLIB_LIBS $LIBS"
319 dnl
320 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
321 dnl checks the results of pkg-config to some extent)
322 dnl
323       rm -f conf.glibtest
324       AC_TRY_RUN([
325 #include <glib.h>
326 #include <stdio.h>
327 #include <stdlib.h>
328
329 int 
330 main ()
331 {
332   unsigned int major, minor, micro;
333
334   fclose (fopen ("conf.glibtest", "w"));
335
336   if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, &micro) != 3) {
337      printf("%s, bad version string\n", "$min_glib_version");
338      exit(1);
339    }
340
341   if ((glib_major_version != $glib_config_major_version) ||
342       (glib_minor_version != $glib_config_minor_version) ||
343       (glib_micro_version != $glib_config_micro_version))
344     {
345       printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
346              $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
347              glib_major_version, glib_minor_version, glib_micro_version);
348       printf ("*** was found! If pkg-config was correct, then it is best\n");
349       printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
350       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
351       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
352       printf("*** required on your system.\n");
353       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
354       printf("*** to point to the correct configuration files\n");
355     } 
356   else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
357            (glib_minor_version != GLIB_MINOR_VERSION) ||
358            (glib_micro_version != GLIB_MICRO_VERSION))
359     {
360       printf("*** GLIB header files (version %d.%d.%d) do not match\n",
361              GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
362       printf("*** library (version %d.%d.%d)\n",
363              glib_major_version, glib_minor_version, glib_micro_version);
364     }
365   else
366     {
367       if ((glib_major_version > major) ||
368         ((glib_major_version == major) && (glib_minor_version > minor)) ||
369         ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
370       {
371         return 0;
372        }
373      else
374       {
375         printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
376                glib_major_version, glib_minor_version, glib_micro_version);
377         printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
378                major, minor, micro);
379         printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
380         printf("***\n");
381         printf("*** If you have already installed a sufficiently new version, this error\n");
382         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
383         printf("*** being found. The easiest way to fix this is to remove the old version\n");
384         printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
385         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
386         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
387         printf("*** so that the correct libraries are found at run-time))\n");
388       }
389     }
390   return 1;
391 }
392 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
393        CFLAGS="$ac_save_CFLAGS"
394        LIBS="$ac_save_LIBS"
395      fi
396   fi
397   if test "x$no_glib" = x ; then
398      AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
399      ifelse([$2], , :, [$2])     
400   else
401      AC_MSG_RESULT(no)
402      if test "$PKG_CONFIG" = "no" ; then
403        echo "*** A new enough version of pkg-config was not found."
404        echo "*** See http://www.freedesktop.org/software/pkgconfig/"
405      else
406        if test -f conf.glibtest ; then
407         :
408        else
409           echo "*** Could not run GLIB test program, checking why..."
410           ac_save_CFLAGS="$CFLAGS"
411           ac_save_LIBS="$LIBS"
412           CFLAGS="$CFLAGS $GLIB_CFLAGS"
413           LIBS="$LIBS $GLIB_LIBS"
414           AC_TRY_LINK([
415 #include <glib.h>
416 #include <stdio.h>
417 ],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
418         [ echo "*** The test program compiled, but did not run. This usually means"
419           echo "*** that the run-time linker is not finding GLIB or finding the wrong"
420           echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
421           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
422           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
423           echo "*** is required on your system"
424           echo "***"
425           echo "*** If you have an old version installed, it is best to remove it, although"
426           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
427         [ echo "*** The test program failed to compile or link. See the file config.log for the"
428           echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
429           CFLAGS="$ac_save_CFLAGS"
430           LIBS="$ac_save_LIBS"
431        fi
432      fi
433      GLIB_CFLAGS=""
434      GLIB_LIBS=""
435      GLIB_GENMARSHAL=""
436      GOBJECT_QUERY=""
437      GLIB_MKENUMS=""
438      GLIB_COMPILE_RESOURCES=""
439      ifelse([$3], , :, [$3])
440   fi
441   AC_SUBST(GLIB_CFLAGS)
442   AC_SUBST(GLIB_LIBS)
443   AC_SUBST(GLIB_GENMARSHAL)
444   AC_SUBST(GOBJECT_QUERY)
445   AC_SUBST(GLIB_MKENUMS)
446   AC_SUBST(GLIB_COMPILE_RESOURCES)
447   rm -f conf.glibtest
448 ])
449
450 dnl GNOME_CODE_COVERAGE
451 dnl
452 dnl Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be
453 dnl included in the CFLAGS and LIBS/LDFLAGS variables of every build target
454 dnl (program or library) which should be built with code coverage support.
455 dnl Also defines GNOME_CODE_COVERAGE_RULES which should be substituted in your
456 dnl Makefile; and $enable_code_coverage which can be used in subsequent
457 dnl configure output.
458 dnl
459 dnl Note that all optimisation flags in CFLAGS must be disabled when code
460 dnl coverage is enabled.
461 dnl
462 dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
463 dnl This file is licenced under LGPLv2.1+.
464 dnl
465 dnl Usage example:
466 dnl configure.ac:
467 dnl    GNOME_CODE_COVERAGE
468 dnl
469 dnl Makefile.am:
470 dnl    @GNOME_CODE_COVERAGE_RULES@
471 dnl    my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
472 dnl    my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
473 dnl
474 dnl This results in a “check-code-coverage” rule being added to any Makefile.am
475 dnl which includes “@GNOME_CODE_COVERAGE_RULES@” (assuming the module has been
476 dnl configured with --enable-code-coverage). Running `make check-code-coverage`
477 dnl in that directory will run the module’s test suite (`make check`) and build
478 dnl a code coverage report detailing the code which was touched, then print the
479 dnl URI for the report.
480
481 AC_DEFUN([GNOME_CODE_COVERAGE],[
482         dnl Check for --enable-code-coverage
483         AC_MSG_CHECKING([whether to build with code coverage support])
484         AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no)
485         AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes])
486         AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage])
487         AC_MSG_RESULT($enable_code_coverage)
488
489         AS_IF([ test "$enable_code_coverage" = "yes" ], [
490                 dnl Check if gcc is being used
491                 AS_IF([ test "$GCC" = "no" ], [
492                         AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage])
493                 ])
494
495                 # List of supported lcov versions.
496                 lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
497
498                 AC_CHECK_PROG([LCOV], [lcov], [lcov])
499                 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
500
501                 AS_IF([ test "$LCOV" ], [
502                         AC_CACHE_CHECK([for lcov version], gnome_cv_lcov_version, [
503                                 gnome_cv_lcov_version=invalid
504                                 lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
505                                 for lcov_check_version in $lcov_version_list; do
506                                         if test "$lcov_version" = "$lcov_check_version"; then
507                                                 gnome_cv_lcov_version="$lcov_check_version (ok)"
508                                         fi
509                                 done
510                         ])
511                 ], [
512                         lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
513                         AC_MSG_ERROR([$lcov_msg])
514                 ])
515
516                 case $gnome_cv_lcov_version in
517                         ""|invalid[)]
518                                 lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
519                                 AC_MSG_ERROR([$lcov_msg])
520                                 LCOV="exit 0;"
521                         ;;
522                 esac
523
524                 AS_IF([ test -z "$GENHTML" ], [
525                         AC_MSG_ERROR([Could not find genhtml from the lcov package])
526                 ])
527
528                 dnl Build the code coverage flags
529                 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
530                 CODE_COVERAGE_LDFLAGS="-lgcov"
531
532                 AC_SUBST([CODE_COVERAGE_CFLAGS])
533                 AC_SUBST([CODE_COVERAGE_LDFLAGS])
534         ])
535
536 GNOME_CODE_COVERAGE_RULES='
537 # Code coverage
538 #
539 # Optional:
540 #  - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting.
541 #    (Default: $(top_builddir))
542 #  - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated
543 #    by lcov for code coverage. (Default:
544 #    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info)
545 #  - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage
546 #    reports to be created. (Default:
547 #    $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage)
548 #  - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance.
549 #    (Default: empty)
550 #  - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml
551 #    instance. (Default: empty)
552 #  - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore
553 #
554 # The generated report will be titled using the $(PACKAGE_NAME) and
555 # $(PACKAGE_VERSION). In order to add the current git hash to the title,
556 # use the git-version-gen script, available online.
557
558 # Optional variables
559 CODE_COVERAGE_DIRECTORY ?= $(top_builddir)
560 CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info
561 CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage
562 CODE_COVERAGE_LCOV_OPTIONS ?=
563 CODE_COVERAGE_GENHTML_OPTIONS ?=
564 CODE_COVERAGE_IGNORE_PATTERN ?=
565
566 code_coverage_quiet = $(code_coverage_quiet_$(V))
567 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
568 code_coverage_quiet_0 = --quiet
569
570 # Use recursive makes in order to ignore errors during check
571 check-code-coverage:
572 ifeq ($(CODE_COVERAGE_ENABLED),yes)
573         -$(MAKE) $(AM_MAKEFLAGS) -k check
574         $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
575 else
576         @echo "Need to reconfigure with --enable-code-coverage"
577 endif
578
579 # Capture code coverage data
580 code-coverage-capture: code-coverage-capture-hook
581 ifeq ($(CODE_COVERAGE_ENABLED),yes)
582         $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS)
583         $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)"
584         -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp
585         LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS)
586         @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html"
587 else
588         @echo "Need to reconfigure with --enable-code-coverage"
589 endif
590
591 # Hook rule executed before code-coverage-capture, overridable by the user
592 code-coverage-capture-hook:
593
594 ifeq ($(CODE_COVERAGE_ENABLED),yes)
595 clean: code-coverage-clean
596 code-coverage-clean:
597         -$(LCOV) --directory $(top_builddir) -z
598         -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
599         -find . -name "*.gcda" -o -name "*.gcov" -delete
600 endif
601
602 GITIGNOREFILES ?=
603 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
604
605 DISTCHECK_CONFIGURE_FLAGS ?=
606 DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
607
608 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
609 '
610
611         AC_SUBST([GNOME_CODE_COVERAGE_RULES])
612         m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
613 ])
614
615 # gnome-compiler-flags.m4
616 #
617 # serial 2
618 #
619
620 dnl GNOME_COMPILE_WARNINGS
621 dnl Turn on many useful compiler warnings and substitute the result into
622 dnl WARN_CFLAGS
623 dnl For now, only works on GCC
624 dnl Pass the default value of the --enable-compile-warnings configure option as
625 dnl the first argument to the macro, defaulting to 'yes'.
626 dnl Additional warning/error flags can be passed as an optional second argument.
627 dnl
628 dnl For example: GNOME_COMPILE_WARNINGS([maximum],[-Werror=some-flag -Wfoobar])
629 AC_DEFUN([GNOME_COMPILE_WARNINGS],[
630     dnl ******************************
631     dnl More compiler warnings
632     dnl ******************************
633
634     AC_ARG_ENABLE(compile-warnings, 
635                   AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
636                                  [Turn on compiler warnings]),,
637                   [enable_compile_warnings="m4_default([$1],[yes])"])
638
639     if test "x$GCC" != xyes; then
640         enable_compile_warnings=no
641     fi
642
643     warning_flags=
644     realsave_CFLAGS="$CFLAGS"
645
646     dnl These are warning flags that aren't marked as fatal.  Can be
647     dnl overridden on a per-project basis with -Wno-foo.
648     base_warn_flags=" \
649         -Wall \
650         -Wstrict-prototypes \
651         -Wnested-externs \
652     "
653
654     dnl These compiler flags typically indicate very broken or suspicious
655     dnl code.  Some of them such as implicit-function-declaration are
656     dnl just not default because gcc compiles a lot of legacy code.
657     dnl We choose to make this set into explicit errors.
658     base_error_flags=" \
659         -Werror=missing-prototypes \
660         -Werror=implicit-function-declaration \
661         -Werror=pointer-arith \
662         -Werror=init-self \
663         -Werror=format-security \
664         -Werror=format=2 \
665         -Werror=missing-include-dirs \
666     "
667
668     dnl Additional warning or error flags provided by the module author to
669     dnl allow stricter standards to be imposed on a per-module basis.
670     dnl The author can pass -W or -Werror flags here as they see fit.
671     additional_flags="m4_default([$2],[])"
672
673     case "$enable_compile_warnings" in
674     no)
675         warning_flags="-w"
676         ;;
677     minimum)
678         warning_flags="-Wall"
679         ;;
680     yes|maximum|error)
681         warning_flags="$base_warn_flags $base_error_flags $additional_flags"
682         ;;
683     *)
684         AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
685         ;;
686     esac
687
688     if test "$enable_compile_warnings" = "error" ; then
689         warning_flags="$warning_flags -Werror"
690     fi
691
692     dnl Check whether GCC supports the warning options
693     for option in $warning_flags; do
694         save_CFLAGS="$CFLAGS"
695         CFLAGS="$CFLAGS $option"
696         AC_MSG_CHECKING([whether gcc understands $option])
697         AC_TRY_COMPILE([], [],
698             has_option=yes,
699             has_option=no,)
700         CFLAGS="$save_CFLAGS"
701         AC_MSG_RESULT([$has_option])
702         if test $has_option = yes; then
703             tested_warning_flags="$tested_warning_flags $option"
704         fi
705         unset has_option
706         unset save_CFLAGS
707     done
708     unset option
709     CFLAGS="$realsave_CFLAGS"
710     AC_MSG_CHECKING(what warning flags to pass to the C compiler)
711     AC_MSG_RESULT($tested_warning_flags)
712
713     AC_ARG_ENABLE(iso-c,
714                   AS_HELP_STRING([--enable-iso-c],
715                                  [Try to warn if code is not ISO C ]),,
716                   [enable_iso_c=no])
717
718     AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
719     complCFLAGS=
720     if test "x$enable_iso_c" != "xno"; then
721         if test "x$GCC" = "xyes"; then
722         case " $CFLAGS " in
723             *[\ \       ]-ansi[\ \      ]*) ;;
724             *) complCFLAGS="$complCFLAGS -ansi" ;;
725         esac
726         case " $CFLAGS " in
727             *[\ \       ]-pedantic[\ \  ]*) ;;
728             *) complCFLAGS="$complCFLAGS -pedantic" ;;
729         esac
730         fi
731     fi
732     AC_MSG_RESULT($complCFLAGS)
733
734     WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
735     AC_SUBST(WARN_CFLAGS)
736 ])
737
738 dnl For C++, do basically the same thing.
739
740 AC_DEFUN([GNOME_CXX_WARNINGS],[
741   AC_ARG_ENABLE(cxx-warnings,
742                 AS_HELP_STRING([--enable-cxx-warnings=@<:@no/minimum/yes@:>@]
743                                [Turn on compiler warnings.]),,
744                 [enable_cxx_warnings="m4_default([$1],[minimum])"])
745
746   AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
747   warnCXXFLAGS=
748   if test "x$GXX" != xyes; then
749     enable_cxx_warnings=no
750   fi
751   if test "x$enable_cxx_warnings" != "xno"; then
752     if test "x$GXX" = "xyes"; then
753       case " $CXXFLAGS " in
754       *[\ \     ]-Wall[\ \      ]*) ;;
755       *) warnCXXFLAGS="-Wall -Wno-unused" ;;
756       esac
757
758       ## -W is not all that useful.  And it cannot be controlled
759       ## with individual -Wno-xxx flags, unlike -Wall
760       if test "x$enable_cxx_warnings" = "xyes"; then
761         warnCXXFLAGS="$warnCXXFLAGS -Wshadow -Woverloaded-virtual"
762       fi
763     fi
764   fi
765   AC_MSG_RESULT($warnCXXFLAGS)
766
767    AC_ARG_ENABLE(iso-cxx,
768                  AS_HELP_STRING([--enable-iso-cxx],
769                                 [Try to warn if code is not ISO C++ ]),,
770                  [enable_iso_cxx=no])
771
772    AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
773    complCXXFLAGS=
774    if test "x$enable_iso_cxx" != "xno"; then
775      if test "x$GXX" = "xyes"; then
776       case " $CXXFLAGS " in
777       *[\ \     ]-ansi[\ \      ]*) ;;
778       *) complCXXFLAGS="$complCXXFLAGS -ansi" ;;
779       esac
780
781       case " $CXXFLAGS " in
782       *[\ \     ]-pedantic[\ \  ]*) ;;
783       *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
784       esac
785      fi
786    fi
787   AC_MSG_RESULT($complCXXFLAGS)
788
789   WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
790   AC_SUBST(WARN_CXXFLAGS)
791 ])
792
793 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
794 #
795 # This file is free software; the Free Software Foundation
796 # gives unlimited permission to copy and/or distribute it,
797 # with or without modifications, as long as this notice is preserved.
798
799 # AM_AUTOMAKE_VERSION(VERSION)
800 # ----------------------------
801 # Automake X.Y traces this macro to ensure aclocal.m4 has been
802 # generated from the m4 files accompanying Automake X.Y.
803 # (This private macro should not be called outside this file.)
804 AC_DEFUN([AM_AUTOMAKE_VERSION],
805 [am__api_version='1.13'
806 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
807 dnl require some minimum version.  Point them to the right macro.
808 m4_if([$1], [1.13.4], [],
809       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
810 ])
811
812 # _AM_AUTOCONF_VERSION(VERSION)
813 # -----------------------------
814 # aclocal traces this macro to find the Autoconf version.
815 # This is a private macro too.  Using m4_define simplifies
816 # the logic in aclocal, which can simply ignore this definition.
817 m4_define([_AM_AUTOCONF_VERSION], [])
818
819 # AM_SET_CURRENT_AUTOMAKE_VERSION
820 # -------------------------------
821 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
822 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
823 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
824 [AM_AUTOMAKE_VERSION([1.13.4])dnl
825 m4_ifndef([AC_AUTOCONF_VERSION],
826   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
827 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
828
829 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
830
831 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
832 #
833 # This file is free software; the Free Software Foundation
834 # gives unlimited permission to copy and/or distribute it,
835 # with or without modifications, as long as this notice is preserved.
836
837 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
838 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
839 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
840 #
841 # Of course, Automake must honor this variable whenever it calls a
842 # tool from the auxiliary directory.  The problem is that $srcdir (and
843 # therefore $ac_aux_dir as well) can be either absolute or relative,
844 # depending on how configure is run.  This is pretty annoying, since
845 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
846 # source directory, any form will work fine, but in subdirectories a
847 # relative path needs to be adjusted first.
848 #
849 # $ac_aux_dir/missing
850 #    fails when called from a subdirectory if $ac_aux_dir is relative
851 # $top_srcdir/$ac_aux_dir/missing
852 #    fails if $ac_aux_dir is absolute,
853 #    fails when called from a subdirectory in a VPATH build with
854 #          a relative $ac_aux_dir
855 #
856 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
857 # are both prefixed by $srcdir.  In an in-source build this is usually
858 # harmless because $srcdir is '.', but things will broke when you
859 # start a VPATH build or use an absolute $srcdir.
860 #
861 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
862 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
863 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
864 # and then we would define $MISSING as
865 #   MISSING="\${SHELL} $am_aux_dir/missing"
866 # This will work as long as MISSING is not called from configure, because
867 # unfortunately $(top_srcdir) has no meaning in configure.
868 # However there are other variables, like CC, which are often used in
869 # configure, and could therefore not use this "fixed" $ac_aux_dir.
870 #
871 # Another solution, used here, is to always expand $ac_aux_dir to an
872 # absolute PATH.  The drawback is that using absolute paths prevent a
873 # configured tree to be moved without reconfiguration.
874
875 AC_DEFUN([AM_AUX_DIR_EXPAND],
876 [dnl Rely on autoconf to set up CDPATH properly.
877 AC_PREREQ([2.50])dnl
878 # expand $ac_aux_dir to an absolute path
879 am_aux_dir=`cd $ac_aux_dir && pwd`
880 ])
881
882 # AM_CONDITIONAL                                            -*- Autoconf -*-
883
884 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
885 #
886 # This file is free software; the Free Software Foundation
887 # gives unlimited permission to copy and/or distribute it,
888 # with or without modifications, as long as this notice is preserved.
889
890 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
891 # -------------------------------------
892 # Define a conditional.
893 AC_DEFUN([AM_CONDITIONAL],
894 [AC_PREREQ([2.52])dnl
895  m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
896        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
897 AC_SUBST([$1_TRUE])dnl
898 AC_SUBST([$1_FALSE])dnl
899 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
900 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
901 m4_define([_AM_COND_VALUE_$1], [$2])dnl
902 if $2; then
903   $1_TRUE=
904   $1_FALSE='#'
905 else
906   $1_TRUE='#'
907   $1_FALSE=
908 fi
909 AC_CONFIG_COMMANDS_PRE(
910 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
911   AC_MSG_ERROR([[conditional "$1" was never defined.
912 Usually this means the macro was only invoked conditionally.]])
913 fi])])
914
915 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
916 #
917 # This file is free software; the Free Software Foundation
918 # gives unlimited permission to copy and/or distribute it,
919 # with or without modifications, as long as this notice is preserved.
920
921
922 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
923 # written in clear, in which case automake, when reading aclocal.m4,
924 # will think it sees a *use*, and therefore will trigger all it's
925 # C support machinery.  Also note that it means that autoscan, seeing
926 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
927
928
929 # _AM_DEPENDENCIES(NAME)
930 # ----------------------
931 # See how the compiler implements dependency checking.
932 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
933 # We try a few techniques and use that to set a single cache variable.
934 #
935 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
936 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
937 # dependency, and given that the user is not expected to run this macro,
938 # just rely on AC_PROG_CC.
939 AC_DEFUN([_AM_DEPENDENCIES],
940 [AC_REQUIRE([AM_SET_DEPDIR])dnl
941 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
942 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
943 AC_REQUIRE([AM_DEP_TRACK])dnl
944
945 m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
946       [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
947       [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
948       [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
949       [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
950       [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
951                     [depcc="$$1"   am_compiler_list=])
952
953 AC_CACHE_CHECK([dependency style of $depcc],
954                [am_cv_$1_dependencies_compiler_type],
955 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
956   # We make a subdir and do the tests there.  Otherwise we can end up
957   # making bogus files that we don't know about and never remove.  For
958   # instance it was reported that on HP-UX the gcc test will end up
959   # making a dummy file named 'D' -- because '-MD' means "put the output
960   # in D".
961   rm -rf conftest.dir
962   mkdir conftest.dir
963   # Copy depcomp to subdir because otherwise we won't find it if we're
964   # using a relative directory.
965   cp "$am_depcomp" conftest.dir
966   cd conftest.dir
967   # We will build objects and dependencies in a subdirectory because
968   # it helps to detect inapplicable dependency modes.  For instance
969   # both Tru64's cc and ICC support -MD to output dependencies as a
970   # side effect of compilation, but ICC will put the dependencies in
971   # the current directory while Tru64 will put them in the object
972   # directory.
973   mkdir sub
974
975   am_cv_$1_dependencies_compiler_type=none
976   if test "$am_compiler_list" = ""; then
977      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
978   fi
979   am__universal=false
980   m4_case([$1], [CC],
981     [case " $depcc " in #(
982      *\ -arch\ *\ -arch\ *) am__universal=true ;;
983      esac],
984     [CXX],
985     [case " $depcc " in #(
986      *\ -arch\ *\ -arch\ *) am__universal=true ;;
987      esac])
988
989   for depmode in $am_compiler_list; do
990     # Setup a source with many dependencies, because some compilers
991     # like to wrap large dependency lists on column 80 (with \), and
992     # we should not choose a depcomp mode which is confused by this.
993     #
994     # We need to recreate these files for each test, as the compiler may
995     # overwrite some of them when testing with obscure command lines.
996     # This happens at least with the AIX C compiler.
997     : > sub/conftest.c
998     for i in 1 2 3 4 5 6; do
999       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1000       # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1001       # Solaris 10 /bin/sh.
1002       echo '/* dummy */' > sub/conftst$i.h
1003     done
1004     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1005
1006     # We check with '-c' and '-o' for the sake of the "dashmstdout"
1007     # mode.  It turns out that the SunPro C++ compiler does not properly
1008     # handle '-M -o', and we need to detect this.  Also, some Intel
1009     # versions had trouble with output in subdirs.
1010     am__obj=sub/conftest.${OBJEXT-o}
1011     am__minus_obj="-o $am__obj"
1012     case $depmode in
1013     gcc)
1014       # This depmode causes a compiler race in universal mode.
1015       test "$am__universal" = false || continue
1016       ;;
1017     nosideeffect)
1018       # After this tag, mechanisms are not by side-effect, so they'll
1019       # only be used when explicitly requested.
1020       if test "x$enable_dependency_tracking" = xyes; then
1021         continue
1022       else
1023         break
1024       fi
1025       ;;
1026     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1027       # This compiler won't grok '-c -o', but also, the minuso test has
1028       # not run yet.  These depmodes are late enough in the game, and
1029       # so weak that their functioning should not be impacted.
1030       am__obj=conftest.${OBJEXT-o}
1031       am__minus_obj=
1032       ;;
1033     none) break ;;
1034     esac
1035     if depmode=$depmode \
1036        source=sub/conftest.c object=$am__obj \
1037        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1038        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1039          >/dev/null 2>conftest.err &&
1040        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1041        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1042        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1043        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1044       # icc doesn't choke on unknown options, it will just issue warnings
1045       # or remarks (even with -Werror).  So we grep stderr for any message
1046       # that says an option was ignored or not supported.
1047       # When given -MP, icc 7.0 and 7.1 complain thusly:
1048       #   icc: Command line warning: ignoring option '-M'; no argument required
1049       # The diagnosis changed in icc 8.0:
1050       #   icc: Command line remark: option '-MP' not supported
1051       if (grep 'ignoring option' conftest.err ||
1052           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1053         am_cv_$1_dependencies_compiler_type=$depmode
1054         break
1055       fi
1056     fi
1057   done
1058
1059   cd ..
1060   rm -rf conftest.dir
1061 else
1062   am_cv_$1_dependencies_compiler_type=none
1063 fi
1064 ])
1065 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1066 AM_CONDITIONAL([am__fastdep$1], [
1067   test "x$enable_dependency_tracking" != xno \
1068   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1069 ])
1070
1071
1072 # AM_SET_DEPDIR
1073 # -------------
1074 # Choose a directory name for dependency files.
1075 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1076 AC_DEFUN([AM_SET_DEPDIR],
1077 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1078 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1079 ])
1080
1081
1082 # AM_DEP_TRACK
1083 # ------------
1084 AC_DEFUN([AM_DEP_TRACK],
1085 [AC_ARG_ENABLE([dependency-tracking], [dnl
1086 AS_HELP_STRING(
1087   [--enable-dependency-tracking],
1088   [do not reject slow dependency extractors])
1089 AS_HELP_STRING(
1090   [--disable-dependency-tracking],
1091   [speeds up one-time build])])
1092 if test "x$enable_dependency_tracking" != xno; then
1093   am_depcomp="$ac_aux_dir/depcomp"
1094   AMDEPBACKSLASH='\'
1095   am__nodep='_no'
1096 fi
1097 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1098 AC_SUBST([AMDEPBACKSLASH])dnl
1099 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1100 AC_SUBST([am__nodep])dnl
1101 _AM_SUBST_NOTMAKE([am__nodep])dnl
1102 ])
1103
1104 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1105
1106 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1107 #
1108 # This file is free software; the Free Software Foundation
1109 # gives unlimited permission to copy and/or distribute it,
1110 # with or without modifications, as long as this notice is preserved.
1111
1112
1113 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1114 # ------------------------------
1115 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1116 [{
1117   # Older Autoconf quotes --file arguments for eval, but not when files
1118   # are listed without --file.  Let's play safe and only enable the eval
1119   # if we detect the quoting.
1120   case $CONFIG_FILES in
1121   *\'*) eval set x "$CONFIG_FILES" ;;
1122   *)   set x $CONFIG_FILES ;;
1123   esac
1124   shift
1125   for mf
1126   do
1127     # Strip MF so we end up with the name of the file.
1128     mf=`echo "$mf" | sed -e 's/:.*$//'`
1129     # Check whether this is an Automake generated Makefile or not.
1130     # We used to match only the files named 'Makefile.in', but
1131     # some people rename them; so instead we look at the file content.
1132     # Grep'ing the first line is not enough: some people post-process
1133     # each Makefile.in and add a new line on top of each file to say so.
1134     # Grep'ing the whole file is not good either: AIX grep has a line
1135     # limit of 2048, but all sed's we know have understand at least 4000.
1136     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1137       dirpart=`AS_DIRNAME("$mf")`
1138     else
1139       continue
1140     fi
1141     # Extract the definition of DEPDIR, am__include, and am__quote
1142     # from the Makefile without running 'make'.
1143     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1144     test -z "$DEPDIR" && continue
1145     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1146     test -z "$am__include" && continue
1147     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1148     # Find all dependency output files, they are included files with
1149     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1150     # simplest approach to changing $(DEPDIR) to its actual value in the
1151     # expansion.
1152     for file in `sed -n "
1153       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1154          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1155       # Make sure the directory exists.
1156       test -f "$dirpart/$file" && continue
1157       fdir=`AS_DIRNAME(["$file"])`
1158       AS_MKDIR_P([$dirpart/$fdir])
1159       # echo "creating $dirpart/$file"
1160       echo '# dummy' > "$dirpart/$file"
1161     done
1162   done
1163 }
1164 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1165
1166
1167 # AM_OUTPUT_DEPENDENCY_COMMANDS
1168 # -----------------------------
1169 # This macro should only be invoked once -- use via AC_REQUIRE.
1170 #
1171 # This code is only required when automatic dependency tracking
1172 # is enabled.  FIXME.  This creates each '.P' file that we will
1173 # need in order to bootstrap the dependency handling code.
1174 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1175 [AC_CONFIG_COMMANDS([depfiles],
1176      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1177      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1178 ])
1179
1180 # Do all the work for Automake.                             -*- Autoconf -*-
1181
1182 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
1183 #
1184 # This file is free software; the Free Software Foundation
1185 # gives unlimited permission to copy and/or distribute it,
1186 # with or without modifications, as long as this notice is preserved.
1187
1188 # This macro actually does too much.  Some checks are only needed if
1189 # your package does certain things.  But this isn't really a big deal.
1190
1191 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1192 # AM_INIT_AUTOMAKE([OPTIONS])
1193 # -----------------------------------------------
1194 # The call with PACKAGE and VERSION arguments is the old style
1195 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1196 # and VERSION should now be passed to AC_INIT and removed from
1197 # the call to AM_INIT_AUTOMAKE.
1198 # We support both call styles for the transition.  After
1199 # the next Automake release, Autoconf can make the AC_INIT
1200 # arguments mandatory, and then we can depend on a new Autoconf
1201 # release and drop the old call support.
1202 AC_DEFUN([AM_INIT_AUTOMAKE],
1203 [AC_PREREQ([2.65])dnl
1204 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1205 dnl the ones we care about.
1206 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1207 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1208 AC_REQUIRE([AC_PROG_INSTALL])dnl
1209 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1210   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1211   # is not polluted with repeated "-I."
1212   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1213   # test to see if srcdir already configured
1214   if test -f $srcdir/config.status; then
1215     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1216   fi
1217 fi
1218
1219 # test whether we have cygpath
1220 if test -z "$CYGPATH_W"; then
1221   if (cygpath --version) >/dev/null 2>/dev/null; then
1222     CYGPATH_W='cygpath -w'
1223   else
1224     CYGPATH_W=echo
1225   fi
1226 fi
1227 AC_SUBST([CYGPATH_W])
1228
1229 # Define the identity of the package.
1230 dnl Distinguish between old-style and new-style calls.
1231 m4_ifval([$2],
1232 [AC_DIAGNOSE([obsolete],
1233              [$0: two- and three-arguments forms are deprecated.])
1234 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1235  AC_SUBST([PACKAGE], [$1])dnl
1236  AC_SUBST([VERSION], [$2])],
1237 [_AM_SET_OPTIONS([$1])dnl
1238 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1239 m4_if(
1240   m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1241   [ok:ok],,
1242   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1243  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1244  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1245
1246 _AM_IF_OPTION([no-define],,
1247 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1248  AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1249
1250 # Some tools Automake needs.
1251 AC_REQUIRE([AM_SANITY_CHECK])dnl
1252 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1253 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1254 AM_MISSING_PROG([AUTOCONF], [autoconf])
1255 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1256 AM_MISSING_PROG([AUTOHEADER], [autoheader])
1257 AM_MISSING_PROG([MAKEINFO], [makeinfo])
1258 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1259 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1260 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1261 # For better backward compatibility.  To be removed once Automake 1.9.x
1262 # dies out for good.  For more background, see:
1263 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1264 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1265 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1266 # We need awk for the "check" target.  The system "awk" is bad on
1267 # some platforms.
1268 AC_REQUIRE([AC_PROG_AWK])dnl
1269 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1270 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1271 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1272               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1273                              [_AM_PROG_TAR([v7])])])
1274 _AM_IF_OPTION([no-dependencies],,
1275 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1276                   [_AM_DEPENDENCIES([CC])],
1277                   [m4_define([AC_PROG_CC],
1278                              m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1279 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1280                   [_AM_DEPENDENCIES([CXX])],
1281                   [m4_define([AC_PROG_CXX],
1282                              m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1283 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1284                   [_AM_DEPENDENCIES([OBJC])],
1285                   [m4_define([AC_PROG_OBJC],
1286                              m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1287 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1288                   [_AM_DEPENDENCIES([OBJCXX])],
1289                   [m4_define([AC_PROG_OBJCXX],
1290                              m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1291 ])
1292 AC_REQUIRE([AM_SILENT_RULES])dnl
1293 dnl The testsuite driver may need to know about EXEEXT, so add the
1294 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
1295 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1296 AC_CONFIG_COMMANDS_PRE(dnl
1297 [m4_provide_if([_AM_COMPILER_EXEEXT],
1298   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1299 ])
1300
1301 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1302 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1303 dnl mangled by Autoconf and run in a shell conditional statement.
1304 m4_define([_AC_COMPILER_EXEEXT],
1305 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1306
1307
1308 # When config.status generates a header, we must update the stamp-h file.
1309 # This file resides in the same directory as the config header
1310 # that is generated.  The stamp files are numbered to have different names.
1311
1312 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1313 # loop where config.status creates the headers, so we can generate
1314 # our stamp files there.
1315 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1316 [# Compute $1's index in $config_headers.
1317 _am_arg=$1
1318 _am_stamp_count=1
1319 for _am_header in $config_headers :; do
1320   case $_am_header in
1321     $_am_arg | $_am_arg:* )
1322       break ;;
1323     * )
1324       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1325   esac
1326 done
1327 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1328
1329 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1330 #
1331 # This file is free software; the Free Software Foundation
1332 # gives unlimited permission to copy and/or distribute it,
1333 # with or without modifications, as long as this notice is preserved.
1334
1335 # AM_PROG_INSTALL_SH
1336 # ------------------
1337 # Define $install_sh.
1338 AC_DEFUN([AM_PROG_INSTALL_SH],
1339 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1340 if test x"${install_sh}" != xset; then
1341   case $am_aux_dir in
1342   *\ * | *\     *)
1343     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1344   *)
1345     install_sh="\${SHELL} $am_aux_dir/install-sh"
1346   esac
1347 fi
1348 AC_SUBST([install_sh])])
1349
1350 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
1351 #
1352 # This file is free software; the Free Software Foundation
1353 # gives unlimited permission to copy and/or distribute it,
1354 # with or without modifications, as long as this notice is preserved.
1355
1356 # Check whether the underlying file-system supports filenames
1357 # with a leading dot.  For instance MS-DOS doesn't.
1358 AC_DEFUN([AM_SET_LEADING_DOT],
1359 [rm -rf .tst 2>/dev/null
1360 mkdir .tst 2>/dev/null
1361 if test -d .tst; then
1362   am__leading_dot=.
1363 else
1364   am__leading_dot=_
1365 fi
1366 rmdir .tst 2>/dev/null
1367 AC_SUBST([am__leading_dot])])
1368
1369 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1370
1371 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1372 #
1373 # This file is free software; the Free Software Foundation
1374 # gives unlimited permission to copy and/or distribute it,
1375 # with or without modifications, as long as this notice is preserved.
1376
1377 # AM_MAKE_INCLUDE()
1378 # -----------------
1379 # Check to see how make treats includes.
1380 AC_DEFUN([AM_MAKE_INCLUDE],
1381 [am_make=${MAKE-make}
1382 cat > confinc << 'END'
1383 am__doit:
1384         @echo this is the am__doit target
1385 .PHONY: am__doit
1386 END
1387 # If we don't find an include directive, just comment out the code.
1388 AC_MSG_CHECKING([for style of include used by $am_make])
1389 am__include="#"
1390 am__quote=
1391 _am_result=none
1392 # First try GNU make style include.
1393 echo "include confinc" > confmf
1394 # Ignore all kinds of additional output from 'make'.
1395 case `$am_make -s -f confmf 2> /dev/null` in #(
1396 *the\ am__doit\ target*)
1397   am__include=include
1398   am__quote=
1399   _am_result=GNU
1400   ;;
1401 esac
1402 # Now try BSD make style include.
1403 if test "$am__include" = "#"; then
1404    echo '.include "confinc"' > confmf
1405    case `$am_make -s -f confmf 2> /dev/null` in #(
1406    *the\ am__doit\ target*)
1407      am__include=.include
1408      am__quote="\""
1409      _am_result=BSD
1410      ;;
1411    esac
1412 fi
1413 AC_SUBST([am__include])
1414 AC_SUBST([am__quote])
1415 AC_MSG_RESULT([$_am_result])
1416 rm -f confinc confmf
1417 ])
1418
1419 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1420 #
1421 # This file is free software; the Free Software Foundation
1422 # gives unlimited permission to copy and/or distribute it,
1423 # with or without modifications, as long as this notice is preserved.
1424
1425 # AM_PROG_CC_C_O
1426 # --------------
1427 # Like AC_PROG_CC_C_O, but changed for automake.
1428 AC_DEFUN([AM_PROG_CC_C_O],
1429 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
1430 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1431 AC_REQUIRE_AUX_FILE([compile])dnl
1432 # FIXME: we rely on the cache variable name because
1433 # there is no other way.
1434 set dummy $CC
1435 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1436 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
1437 if test "$am_t" != yes; then
1438    # Losing compiler, so override with the script.
1439    # FIXME: It is wrong to rewrite CC.
1440    # But if we don't then we get into trouble of one sort or another.
1441    # A longer-term fix would be to have automake use am__CC in this case,
1442    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1443    CC="$am_aux_dir/compile $CC"
1444 fi
1445 dnl Make sure AC_PROG_CC is never called again, or it will override our
1446 dnl setting of CC.
1447 m4_define([AC_PROG_CC],
1448           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
1449 ])
1450
1451 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1452
1453 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
1454 #
1455 # This file is free software; the Free Software Foundation
1456 # gives unlimited permission to copy and/or distribute it,
1457 # with or without modifications, as long as this notice is preserved.
1458
1459 # AM_MISSING_PROG(NAME, PROGRAM)
1460 # ------------------------------
1461 AC_DEFUN([AM_MISSING_PROG],
1462 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1463 $1=${$1-"${am_missing_run}$2"}
1464 AC_SUBST($1)])
1465
1466 # AM_MISSING_HAS_RUN
1467 # ------------------
1468 # Define MISSING if not defined so far and test if it is modern enough.
1469 # If it is, set am_missing_run to use it, otherwise, to nothing.
1470 AC_DEFUN([AM_MISSING_HAS_RUN],
1471 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1472 AC_REQUIRE_AUX_FILE([missing])dnl
1473 if test x"${MISSING+set}" != xset; then
1474   case $am_aux_dir in
1475   *\ * | *\     *)
1476     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1477   *)
1478     MISSING="\${SHELL} $am_aux_dir/missing" ;;
1479   esac
1480 fi
1481 # Use eval to expand $SHELL
1482 if eval "$MISSING --is-lightweight"; then
1483   am_missing_run="$MISSING "
1484 else
1485   am_missing_run=
1486   AC_MSG_WARN(['missing' script is too old or missing])
1487 fi
1488 ])
1489
1490 # Helper functions for option handling.                     -*- Autoconf -*-
1491
1492 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1493 #
1494 # This file is free software; the Free Software Foundation
1495 # gives unlimited permission to copy and/or distribute it,
1496 # with or without modifications, as long as this notice is preserved.
1497
1498 # _AM_MANGLE_OPTION(NAME)
1499 # -----------------------
1500 AC_DEFUN([_AM_MANGLE_OPTION],
1501 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1502
1503 # _AM_SET_OPTION(NAME)
1504 # --------------------
1505 # Set option NAME.  Presently that only means defining a flag for this option.
1506 AC_DEFUN([_AM_SET_OPTION],
1507 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1508
1509 # _AM_SET_OPTIONS(OPTIONS)
1510 # ------------------------
1511 # OPTIONS is a space-separated list of Automake options.
1512 AC_DEFUN([_AM_SET_OPTIONS],
1513 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1514
1515 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1516 # -------------------------------------------
1517 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1518 AC_DEFUN([_AM_IF_OPTION],
1519 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1520
1521 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1522 #
1523 # This file is free software; the Free Software Foundation
1524 # gives unlimited permission to copy and/or distribute it,
1525 # with or without modifications, as long as this notice is preserved.
1526
1527
1528 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1529 # ---------------------------------------------------------------------------
1530 # Adds support for distributing Python modules and packages.  To
1531 # install modules, copy them to $(pythondir), using the python_PYTHON
1532 # automake variable.  To install a package with the same name as the
1533 # automake package, install to $(pkgpythondir), or use the
1534 # pkgpython_PYTHON automake variable.
1535 #
1536 # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
1537 # locations to install python extension modules (shared libraries).
1538 # Another macro is required to find the appropriate flags to compile
1539 # extension modules.
1540 #
1541 # If your package is configured with a different prefix to python,
1542 # users will have to add the install directory to the PYTHONPATH
1543 # environment variable, or create a .pth file (see the python
1544 # documentation for details).
1545 #
1546 # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
1547 # cause an error if the version of python installed on the system
1548 # doesn't meet the requirement.  MINIMUM-VERSION should consist of
1549 # numbers and dots only.
1550 AC_DEFUN([AM_PATH_PYTHON],
1551  [
1552   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
1553   dnl supported. (2.0 was released on October 16, 2000).
1554   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
1555 [python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
1556  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
1557
1558   AC_ARG_VAR([PYTHON], [the Python interpreter])
1559
1560   m4_if([$1],[],[
1561     dnl No version check is needed.
1562     # Find any Python interpreter.
1563     if test -z "$PYTHON"; then
1564       AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
1565     fi
1566     am_display_PYTHON=python
1567   ], [
1568     dnl A version check is needed.
1569     if test -n "$PYTHON"; then
1570       # If the user set $PYTHON, use it and don't search something else.
1571       AC_MSG_CHECKING([whether $PYTHON version is >= $1])
1572       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
1573                               [AC_MSG_RESULT([yes])],
1574                               [AC_MSG_RESULT([no])
1575                                AC_MSG_ERROR([Python interpreter is too old])])
1576       am_display_PYTHON=$PYTHON
1577     else
1578       # Otherwise, try each interpreter until we find one that satisfies
1579       # VERSION.
1580       AC_CACHE_CHECK([for a Python interpreter with version >= $1],
1581         [am_cv_pathless_PYTHON],[
1582         for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
1583           test "$am_cv_pathless_PYTHON" = none && break
1584           AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
1585         done])
1586       # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
1587       if test "$am_cv_pathless_PYTHON" = none; then
1588         PYTHON=:
1589       else
1590         AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
1591       fi
1592       am_display_PYTHON=$am_cv_pathless_PYTHON
1593     fi
1594   ])
1595
1596   if test "$PYTHON" = :; then
1597   dnl Run any user-specified action, or abort.
1598     m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
1599   else
1600
1601   dnl Query Python for its version number.  Getting [:3] seems to be
1602   dnl the best way to do this; it's what "site.py" does in the standard
1603   dnl library.
1604
1605   AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
1606     [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
1607   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
1608
1609   dnl Use the values of $prefix and $exec_prefix for the corresponding
1610   dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
1611   dnl distinct variables so they can be overridden if need be.  However,
1612   dnl general consensus is that you shouldn't need this ability.
1613
1614   AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
1615   AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
1616
1617   dnl At times (like when building shared libraries) you may want
1618   dnl to know which OS platform Python thinks this is.
1619
1620   AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
1621     [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
1622   AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
1623
1624   # Just factor out some code duplication.
1625   am_python_setup_sysconfig="\
1626 import sys
1627 # Prefer sysconfig over distutils.sysconfig, for better compatibility
1628 # with python 3.x.  See automake bug#10227.
1629 try:
1630     import sysconfig
1631 except ImportError:
1632     can_use_sysconfig = 0
1633 else:
1634     can_use_sysconfig = 1
1635 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
1636 # <https://github.com/pypa/virtualenv/issues/118>
1637 try:
1638     from platform import python_implementation
1639     if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
1640         can_use_sysconfig = 0
1641 except ImportError:
1642     pass"
1643
1644   dnl Set up 4 directories:
1645
1646   dnl pythondir -- where to install python scripts.  This is the
1647   dnl   site-packages directory, not the python standard library
1648   dnl   directory like in previous automake betas.  This behavior
1649   dnl   is more consistent with lispdir.m4 for example.
1650   dnl Query distutils for this directory.
1651   AC_CACHE_CHECK([for $am_display_PYTHON script directory],
1652     [am_cv_python_pythondir],
1653     [if test "x$prefix" = xNONE
1654      then
1655        am_py_prefix=$ac_default_prefix
1656      else
1657        am_py_prefix=$prefix
1658      fi
1659      am_cv_python_pythondir=`$PYTHON -c "
1660 $am_python_setup_sysconfig
1661 if can_use_sysconfig:
1662     sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
1663 else:
1664     from distutils import sysconfig
1665     sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
1666 sys.stdout.write(sitedir)"`
1667      case $am_cv_python_pythondir in
1668      $am_py_prefix*)
1669        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
1670        am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
1671        ;;
1672      *)
1673        case $am_py_prefix in
1674          /usr|/System*) ;;
1675          *)
1676           am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
1677           ;;
1678        esac
1679        ;;
1680      esac
1681     ])
1682   AC_SUBST([pythondir], [$am_cv_python_pythondir])
1683
1684   dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
1685   dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
1686   dnl   more consistent with the rest of automake.
1687
1688   AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
1689
1690   dnl pyexecdir -- directory for installing python extension modules
1691   dnl   (shared libraries)
1692   dnl Query distutils for this directory.
1693   AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
1694     [am_cv_python_pyexecdir],
1695     [if test "x$exec_prefix" = xNONE
1696      then
1697        am_py_exec_prefix=$am_py_prefix
1698      else
1699        am_py_exec_prefix=$exec_prefix
1700      fi
1701      am_cv_python_pyexecdir=`$PYTHON -c "
1702 $am_python_setup_sysconfig
1703 if can_use_sysconfig:
1704     sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
1705 else:
1706     from distutils import sysconfig
1707     sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
1708 sys.stdout.write(sitedir)"`
1709      case $am_cv_python_pyexecdir in
1710      $am_py_exec_prefix*)
1711        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
1712        am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
1713        ;;
1714      *)
1715        case $am_py_exec_prefix in
1716          /usr|/System*) ;;
1717          *)
1718            am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
1719            ;;
1720        esac
1721        ;;
1722      esac
1723     ])
1724   AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
1725
1726   dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
1727
1728   AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
1729
1730   dnl Run any user-specified action.
1731   $2
1732   fi
1733
1734 ])
1735
1736
1737 # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1738 # ---------------------------------------------------------------------------
1739 # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
1740 # Run ACTION-IF-FALSE otherwise.
1741 # This test uses sys.hexversion instead of the string equivalent (first
1742 # word of sys.version), in order to cope with versions such as 2.2c1.
1743 # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
1744 AC_DEFUN([AM_PYTHON_CHECK_VERSION],
1745  [prog="import sys
1746 # split strings by '.' and convert to numeric.  Append some zeros
1747 # because we need at least 4 digits for the hex conversion.
1748 # map returns an iterator in Python 3.0 and a list in 2.x
1749 minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
1750 minverhex = 0
1751 # xrange is not present in Python 3.0 and range returns an iterator
1752 for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
1753 sys.exit(sys.hexversion < minverhex)"
1754   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
1755
1756 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1757 #
1758 # This file is free software; the Free Software Foundation
1759 # gives unlimited permission to copy and/or distribute it,
1760 # with or without modifications, as long as this notice is preserved.
1761
1762 # AM_RUN_LOG(COMMAND)
1763 # -------------------
1764 # Run COMMAND, save the exit status in ac_status, and log it.
1765 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1766 AC_DEFUN([AM_RUN_LOG],
1767 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1768    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1769    ac_status=$?
1770    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1771    (exit $ac_status); }])
1772
1773 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1774
1775 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
1776 #
1777 # This file is free software; the Free Software Foundation
1778 # gives unlimited permission to copy and/or distribute it,
1779 # with or without modifications, as long as this notice is preserved.
1780
1781 # AM_SANITY_CHECK
1782 # ---------------
1783 AC_DEFUN([AM_SANITY_CHECK],
1784 [AC_MSG_CHECKING([whether build environment is sane])
1785 # Reject unsafe characters in $srcdir or the absolute working directory
1786 # name.  Accept space and tab only in the latter.
1787 am_lf='
1788 '
1789 case `pwd` in
1790   *[[\\\"\#\$\&\'\`$am_lf]]*)
1791     AC_MSG_ERROR([unsafe absolute working directory name]);;
1792 esac
1793 case $srcdir in
1794   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
1795     AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1796 esac
1797
1798 # Do 'set' in a subshell so we don't clobber the current shell's
1799 # arguments.  Must try -L first in case configure is actually a
1800 # symlink; some systems play weird games with the mod time of symlinks
1801 # (eg FreeBSD returns the mod time of the symlink's containing
1802 # directory).
1803 if (
1804    am_has_slept=no
1805    for am_try in 1 2; do
1806      echo "timestamp, slept: $am_has_slept" > conftest.file
1807      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1808      if test "$[*]" = "X"; then
1809         # -L didn't work.
1810         set X `ls -t "$srcdir/configure" conftest.file`
1811      fi
1812      if test "$[*]" != "X $srcdir/configure conftest.file" \
1813         && test "$[*]" != "X conftest.file $srcdir/configure"; then
1814
1815         # If neither matched, then we have a broken ls.  This can happen
1816         # if, for instance, CONFIG_SHELL is bash and it inherits a
1817         # broken ls alias from the environment.  This has actually
1818         # happened.  Such a system could not be considered "sane".
1819         AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1820   alias in your environment])
1821      fi
1822      if test "$[2]" = conftest.file || test $am_try -eq 2; then
1823        break
1824      fi
1825      # Just in case.
1826      sleep 1
1827      am_has_slept=yes
1828    done
1829    test "$[2]" = conftest.file
1830    )
1831 then
1832    # Ok.
1833    :
1834 else
1835    AC_MSG_ERROR([newly created file is older than distributed files!
1836 Check your system clock])
1837 fi
1838 AC_MSG_RESULT([yes])
1839 # If we didn't sleep, we still need to ensure time stamps of config.status and
1840 # generated files are strictly newer.
1841 am_sleep_pid=
1842 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
1843   ( sleep 1 ) &
1844   am_sleep_pid=$!
1845 fi
1846 AC_CONFIG_COMMANDS_PRE(
1847   [AC_MSG_CHECKING([that generated files are newer than configure])
1848    if test -n "$am_sleep_pid"; then
1849      # Hide warnings about reused PIDs.
1850      wait $am_sleep_pid 2>/dev/null
1851    fi
1852    AC_MSG_RESULT([done])])
1853 rm -f conftest.file
1854 ])
1855
1856 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
1857 #
1858 # This file is free software; the Free Software Foundation
1859 # gives unlimited permission to copy and/or distribute it,
1860 # with or without modifications, as long as this notice is preserved.
1861
1862 # AM_SILENT_RULES([DEFAULT])
1863 # --------------------------
1864 # Enable less verbose build rules; with the default set to DEFAULT
1865 # ("yes" being less verbose, "no" or empty being verbose).
1866 AC_DEFUN([AM_SILENT_RULES],
1867 [AC_ARG_ENABLE([silent-rules], [dnl
1868 AS_HELP_STRING(
1869   [--enable-silent-rules],
1870   [less verbose build output (undo: "make V=1")])
1871 AS_HELP_STRING(
1872   [--disable-silent-rules],
1873   [verbose build output (undo: "make V=0")])dnl
1874 ])
1875 case $enable_silent_rules in @%:@ (((
1876   yes) AM_DEFAULT_VERBOSITY=0;;
1877    no) AM_DEFAULT_VERBOSITY=1;;
1878     *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1879 esac
1880 dnl
1881 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1882 dnl do not support nested variable expansions.
1883 dnl See automake bug#9928 and bug#10237.
1884 am_make=${MAKE-make}
1885 AC_CACHE_CHECK([whether $am_make supports nested variables],
1886    [am_cv_make_support_nested_variables],
1887    [if AS_ECHO([['TRUE=$(BAR$(V))
1888 BAR0=false
1889 BAR1=true
1890 V=1
1891 am__doit:
1892         @$(TRUE)
1893 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1894   am_cv_make_support_nested_variables=yes
1895 else
1896   am_cv_make_support_nested_variables=no
1897 fi])
1898 if test $am_cv_make_support_nested_variables = yes; then
1899   dnl Using '$V' instead of '$(V)' breaks IRIX make.
1900   AM_V='$(V)'
1901   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1902 else
1903   AM_V=$AM_DEFAULT_VERBOSITY
1904   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1905 fi
1906 AC_SUBST([AM_V])dnl
1907 AM_SUBST_NOTMAKE([AM_V])dnl
1908 AC_SUBST([AM_DEFAULT_V])dnl
1909 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1910 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1911 AM_BACKSLASH='\'
1912 AC_SUBST([AM_BACKSLASH])dnl
1913 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1914 ])
1915
1916 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1917 #
1918 # This file is free software; the Free Software Foundation
1919 # gives unlimited permission to copy and/or distribute it,
1920 # with or without modifications, as long as this notice is preserved.
1921
1922 # AM_PROG_INSTALL_STRIP
1923 # ---------------------
1924 # One issue with vendor 'install' (even GNU) is that you can't
1925 # specify the program used to strip binaries.  This is especially
1926 # annoying in cross-compiling environments, where the build's strip
1927 # is unlikely to handle the host's binaries.
1928 # Fortunately install-sh will honor a STRIPPROG variable, so we
1929 # always use install-sh in "make install-strip", and initialize
1930 # STRIPPROG with the value of the STRIP variable (set by the user).
1931 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1932 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1933 # Installed binaries are usually stripped using 'strip' when the user
1934 # run "make install-strip".  However 'strip' might not be the right
1935 # tool to use in cross-compilation environments, therefore Automake
1936 # will honor the 'STRIP' environment variable to overrule this program.
1937 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1938 if test "$cross_compiling" != no; then
1939   AC_CHECK_TOOL([STRIP], [strip], :)
1940 fi
1941 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1942 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1943
1944 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1945 #
1946 # This file is free software; the Free Software Foundation
1947 # gives unlimited permission to copy and/or distribute it,
1948 # with or without modifications, as long as this notice is preserved.
1949
1950 # _AM_SUBST_NOTMAKE(VARIABLE)
1951 # ---------------------------
1952 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1953 # This macro is traced by Automake.
1954 AC_DEFUN([_AM_SUBST_NOTMAKE])
1955
1956 # AM_SUBST_NOTMAKE(VARIABLE)
1957 # --------------------------
1958 # Public sister of _AM_SUBST_NOTMAKE.
1959 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1960
1961 # Check how to create a tarball.                            -*- Autoconf -*-
1962
1963 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
1964 #
1965 # This file is free software; the Free Software Foundation
1966 # gives unlimited permission to copy and/or distribute it,
1967 # with or without modifications, as long as this notice is preserved.
1968
1969 # _AM_PROG_TAR(FORMAT)
1970 # --------------------
1971 # Check how to create a tarball in format FORMAT.
1972 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
1973 #
1974 # Substitute a variable $(am__tar) that is a command
1975 # writing to stdout a FORMAT-tarball containing the directory
1976 # $tardir.
1977 #     tardir=directory && $(am__tar) > result.tar
1978 #
1979 # Substitute a variable $(am__untar) that extract such
1980 # a tarball read from stdin.
1981 #     $(am__untar) < result.tar
1982 #
1983 AC_DEFUN([_AM_PROG_TAR],
1984 [# Always define AMTAR for backward compatibility.  Yes, it's still used
1985 # in the wild :-(  We should find a proper way to deprecate it ...
1986 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1987
1988 # We'll loop over all known methods to create a tar archive until one works.
1989 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1990
1991 m4_if([$1], [v7],
1992   [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1993
1994   [m4_case([$1],
1995     [ustar],
1996      [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1997       # There is notably a 21 bits limit for the UID and the GID.  In fact,
1998       # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1999       # and bug#13588).
2000       am_max_uid=2097151 # 2^21 - 1
2001       am_max_gid=$am_max_uid
2002       # The $UID and $GID variables are not portable, so we need to resort
2003       # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
2004       # below are definitely unexpected, so allow the users to see them
2005       # (that is, avoid stderr redirection).
2006       am_uid=`id -u || echo unknown`
2007       am_gid=`id -g || echo unknown`
2008       AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
2009       if test $am_uid -le $am_max_uid; then
2010          AC_MSG_RESULT([yes])
2011       else
2012          AC_MSG_RESULT([no])
2013          _am_tools=none
2014       fi
2015       AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
2016       if test $am_gid -le $am_max_gid; then
2017          AC_MSG_RESULT([yes])
2018       else
2019         AC_MSG_RESULT([no])
2020         _am_tools=none
2021       fi],
2022
2023   [pax],
2024     [],
2025
2026   [m4_fatal([Unknown tar format])])
2027
2028   AC_MSG_CHECKING([how to create a $1 tar archive])
2029
2030   # Go ahead even if we have the value already cached.  We do so because we
2031   # need to set the values for the 'am__tar' and 'am__untar' variables.
2032   _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2033
2034   for _am_tool in $_am_tools; do
2035     case $_am_tool in
2036     gnutar)
2037       for _am_tar in tar gnutar gtar; do
2038         AM_RUN_LOG([$_am_tar --version]) && break
2039       done
2040       am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2041       am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2042       am__untar="$_am_tar -xf -"
2043       ;;
2044     plaintar)
2045       # Must skip GNU tar: if it does not support --format= it doesn't create
2046       # ustar tarball either.
2047       (tar --version) >/dev/null 2>&1 && continue
2048       am__tar='tar chf - "$$tardir"'
2049       am__tar_='tar chf - "$tardir"'
2050       am__untar='tar xf -'
2051       ;;
2052     pax)
2053       am__tar='pax -L -x $1 -w "$$tardir"'
2054       am__tar_='pax -L -x $1 -w "$tardir"'
2055       am__untar='pax -r'
2056       ;;
2057     cpio)
2058       am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2059       am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2060       am__untar='cpio -i -H $1 -d'
2061       ;;
2062     none)
2063       am__tar=false
2064       am__tar_=false
2065       am__untar=false
2066       ;;
2067     esac
2068
2069     # If the value was cached, stop now.  We just wanted to have am__tar
2070     # and am__untar set.
2071     test -n "${am_cv_prog_tar_$1}" && break
2072
2073     # tar/untar a dummy directory, and stop if the command works.
2074     rm -rf conftest.dir
2075     mkdir conftest.dir
2076     echo GrepMe > conftest.dir/file
2077     AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2078     rm -rf conftest.dir
2079     if test -s conftest.tar; then
2080       AM_RUN_LOG([$am__untar <conftest.tar])
2081       AM_RUN_LOG([cat conftest.dir/file])
2082       grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2083     fi
2084   done
2085   rm -rf conftest.dir
2086
2087   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2088   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2089
2090 AC_SUBST([am__tar])
2091 AC_SUBST([am__untar])
2092 ]) # _AM_PROG_TAR
2093
2094 m4_include([m4/as-ac-expand.m4])
2095 m4_include([m4/jhflags.m4])
2096 m4_include([m4/libtool.m4])
2097 m4_include([m4/ltoptions.m4])
2098 m4_include([m4/ltsugar.m4])
2099 m4_include([m4/ltversion.m4])
2100 m4_include([m4/lt~obsolete.m4])
2101 m4_include([m4/python.m4])