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