1 # generated automatically by aclocal 1.13.4 -*- Autoconf -*-
3 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
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
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'.])])
23 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24 # serial 1 (pkg-config-0.24)
26 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
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.
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.
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.
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.
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])
57 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
58 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
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
70 ])# PKG_PROG_PKG_CONFIG
72 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
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.
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
91 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
92 # ---------------------------------------------
93 m4_define([_PKG_CONFIG],
94 [if test -n "$$1"; then
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 ],
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
113 _pkg_short_errors_supported=no
115 ])# _PKG_SHORT_ERRORS_SUPPORTED
118 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
119 # [ACTION-IF-NOT-FOUND])
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
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
134 AC_MSG_CHECKING([for $1])
136 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
137 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
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.])
143 if test $pkg_failed = yes; then
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`
149 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
151 # Put the nasty error message in config.log where it belongs
152 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
154 m4_default([$4], [AC_MSG_ERROR(
155 [Package requirements ($2) were not met:
159 Consider adjusting the PKG_CONFIG_PATH environment variable if you
160 installed software in a non-standard prefix.
164 elif test $pkg_failed = untried; then
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
173 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
176 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
177 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
181 ])# PKG_CHECK_MODULES
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
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
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
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
232 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
233 AS_VAR_COPY([$1], [pkg_cv_][$1])
235 AS_VAR_IF([$1], [""], [$5], [$4])dnl
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.
253 # Note that all optimisation flags in CFLAGS must be disabled when code
254 # coverage is enabled.
261 # @CODE_COVERAGE_RULES@
262 # my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
263 # my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
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.
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
280 # Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
281 # This file is licenced under LGPLv2.1+.
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)
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])
299 # List of supported lcov versions.
300 lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
302 AC_CHECK_PROG([LCOV], [lcov], [lcov])
303 AC_CHECK_PROG([GENHTML], [genhtml], [genhtml])
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)"
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])
320 case $ax_cv_lcov_version in
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])
328 AS_IF([ test -z "$GENHTML" ], [
329 AC_MSG_ERROR([Could not find genhtml from the lcov package])
332 dnl Build the code coverage flags
333 CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"
334 CODE_COVERAGE_LDFLAGS="-lgcov"
336 AC_SUBST([CODE_COVERAGE_CFLAGS])
337 AC_SUBST([CODE_COVERAGE_LDFLAGS])
340 CODE_COVERAGE_RULES='
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.
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
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.
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 ?=
370 code_coverage_quiet = $(code_coverage_quiet_$(V))
371 code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY))
372 code_coverage_quiet_0 = --quiet
374 # Use recursive makes in order to ignore errors during check
376 ifeq ($(CODE_COVERAGE_ENABLED),yes)
377 -$(MAKE) $(AM_MAKEFLAGS) -k check
378 $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture
380 @echo "Need to reconfigure with --enable-code-coverage"
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"
392 @echo "Need to reconfigure with --enable-code-coverage"
395 # Hook rule executed before code-coverage-capture, overridable by the user
396 code-coverage-capture-hook:
398 ifeq ($(CODE_COVERAGE_ENABLED),yes)
399 clean: 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
407 GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY)
409 DISTCHECK_CONFIGURE_FLAGS ?=
410 DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage
412 .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean
415 AC_SUBST([CODE_COVERAGE_RULES])
416 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])])
419 # Configure paths for GLIB
420 # Owen Taylor 1997-2001
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
426 AC_DEFUN([AM_PATH_GLIB_2_0],
428 dnl Get the cflags and libraries from pkg-config
430 AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
431 , enable_glibtest=yes)
433 pkg_config_args=glib-2.0
438 pkg_config_args="$pkg_config_args gmodule-2.0"
441 pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
444 pkg_config_args="$pkg_config_args gobject-2.0"
447 pkg_config_args="$pkg_config_args gthread-2.0"
450 pkg_config_args="$pkg_config_args $module-2.0"
455 PKG_PROG_PKG_CONFIG([0.16])
459 if test "x$PKG_CONFIG" = x ; then
464 min_glib_version=ifelse([$1], ,2.0.0,$1)
465 AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
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"
474 if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
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`
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"
498 CFLAGS="$CFLAGS $GLIB_CFLAGS"
499 LIBS="$GLIB_LIBS $LIBS"
501 dnl Now check if the installed GLIB is sufficiently new. (Also sanity
502 dnl checks the results of pkg-config to some extent)
513 unsigned int major, minor, micro;
515 fclose (fopen ("conf.glibtest", "w"));
517 if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, µ) != 3) {
518 printf("%s, bad version string\n", "$min_glib_version");
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))
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");
537 else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
538 (glib_minor_version != GLIB_MINOR_VERSION) ||
539 (glib_micro_version != GLIB_MICRO_VERSION))
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);
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)))
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");
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");
573 ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
574 CFLAGS="$ac_save_CFLAGS"
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])
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/"
587 if test -f conf.glibtest ; then
590 echo "*** Could not run GLIB test program, checking why..."
591 ac_save_CFLAGS="$CFLAGS"
593 CFLAGS="$CFLAGS $GLIB_CFLAGS"
594 LIBS="$LIBS $GLIB_LIBS"
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"
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"
619 GLIB_COMPILE_RESOURCES=""
620 ifelse([$3], , :, [$3])
622 AC_SUBST(GLIB_CFLAGS)
624 AC_SUBST(GLIB_GENMARSHAL)
625 AC_SUBST(GOBJECT_QUERY)
626 AC_SUBST(GLIB_MKENUMS)
627 AC_SUBST(GLIB_COMPILE_RESOURCES)
631 dnl GNOME_CODE_COVERAGE
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.
640 dnl Note that all optimisation flags in CFLAGS must be disabled when code
641 dnl coverage is enabled.
643 dnl Derived from Makefile.decl in GLib, originally licenced under LGPLv2.1+.
644 dnl This file is licenced under LGPLv2.1+.
648 dnl GNOME_CODE_COVERAGE
651 dnl @GNOME_CODE_COVERAGE_RULES@
652 dnl my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
653 dnl my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
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.
662 AU_DEFUN([GNOME_CODE_COVERAGE],[
664 GNOME_CODE_COVERAGE_RULES=$CODE_COVERAGE_RULES
666 AC_SUBST([GNOME_CODE_COVERAGE_RULES])
667 m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([GNOME_CODE_COVERAGE_RULES])])
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]])
673 # gnome-compiler-flags.m4
678 dnl GNOME_COMPILE_WARNINGS
679 dnl Turn on many useful compiler warnings and substitute the result into
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.
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 ******************************
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])"])
697 if test "x$GCC" != xyes; then
698 enable_compile_warnings=no
702 realsave_CFLAGS="$CFLAGS"
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.
708 -Wstrict-prototypes \
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.
717 -Werror=missing-prototypes \
718 -Werror=implicit-function-declaration \
719 -Werror=pointer-arith \
721 -Werror=format-security \
723 -Werror=missing-include-dirs \
724 -Werror=return-type \
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],[])"
732 case "$enable_compile_warnings" in
737 warning_flags="-Wall"
740 warning_flags="$base_warn_flags $base_error_flags $additional_flags"
743 AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
747 if test "$enable_compile_warnings" = "error" ; then
748 warning_flags="$warning_flags -Werror"
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([], [],
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"
768 CFLAGS="$realsave_CFLAGS"
769 AC_MSG_CHECKING(what warning flags to pass to the C compiler)
770 AC_MSG_RESULT($tested_warning_flags)
773 AS_HELP_STRING([--enable-iso-c],
774 [Try to warn if code is not ISO C ]),,
777 AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
779 if test "x$enable_iso_c" != "xno"; then
780 if test "x$GCC" = "xyes"; then
782 *[\ \ ]-ansi[\ \ ]*) ;;
783 *) complCFLAGS="$complCFLAGS -ansi" ;;
786 *[\ \ ]-pedantic[\ \ ]*) ;;
787 *) complCFLAGS="$complCFLAGS -pedantic" ;;
791 AC_MSG_RESULT($complCFLAGS)
793 WARN_CFLAGS="$tested_warning_flags $complCFLAGS"
794 AC_SUBST(WARN_CFLAGS)
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]])
800 dnl For C++, do basically the same thing.
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])"])
808 AC_MSG_CHECKING(what warning flags to pass to the C++ compiler)
810 if test "x$GXX" != xyes; then
811 enable_cxx_warnings=no
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" ;;
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"
827 AC_MSG_RESULT($warnCXXFLAGS)
829 AC_ARG_ENABLE(iso-cxx,
830 AS_HELP_STRING([--enable-iso-cxx],
831 [Try to warn if code is not ISO C++ ]),,
834 AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler)
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" ;;
843 case " $CXXFLAGS " in
844 *[\ \ ]-pedantic[\ \ ]*) ;;
845 *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;;
849 AC_MSG_RESULT($complCXXFLAGS)
851 WARN_CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS"
852 AC_SUBST(WARN_CXXFLAGS)
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]])
858 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
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.
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
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], [])
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]))])
894 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
896 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
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/../..'.
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.
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
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.
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.
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.
940 AC_DEFUN([AM_AUX_DIR_EXPAND],
941 [dnl Rely on autoconf to set up CDPATH properly.
943 # expand $ac_aux_dir to an absolute path
944 am_aux_dir=`cd $ac_aux_dir && pwd`
947 # AM_CONDITIONAL -*- Autoconf -*-
949 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
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.
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
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.]])
980 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
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.
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...
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.
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
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=])
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
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
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
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`
1046 [case " $depcc " in #(
1047 *\ -arch\ *\ -arch\ *) am__universal=true ;;
1050 [case " $depcc " in #(
1051 *\ -arch\ *\ -arch\ *) am__universal=true ;;
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.
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.
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
1069 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
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"
1079 # This depmode causes a compiler race in universal mode.
1080 test "$am__universal" = false || continue
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
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}
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
1127 am_cv_$1_dependencies_compiler_type=none
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])
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
1149 AC_DEFUN([AM_DEP_TRACK],
1150 [AC_ARG_ENABLE([dependency-tracking], [dnl
1152 [--enable-dependency-tracking],
1153 [do not reject slow dependency extractors])
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"
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
1169 # Generate code to set up dependency tracking. -*- Autoconf -*-
1171 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
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.
1178 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1179 # ------------------------------
1180 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
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 ;;
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")`
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
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"
1229 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1232 # AM_OUTPUT_DEPENDENCY_COMMANDS
1233 # -----------------------------
1234 # This macro should only be invoked once -- use via AC_REQUIRE.
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"])
1245 # Do all the work for Automake. -*- Autoconf -*-
1247 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
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.
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.
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])
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'
1292 AC_SUBST([CYGPATH_W])
1294 # Define the identity of the package.
1295 dnl Distinguish between old-style and new-style calls.
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.
1305 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [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
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
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
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
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
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])])
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.
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.
1384 for _am_header in $config_headers :; do
1386 $_am_arg | $_am_arg:* )
1389 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1392 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1394 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
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
1408 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1410 install_sh="\${SHELL} $am_aux_dir/install-sh"
1413 AC_SUBST([install_sh])])
1415 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
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.
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
1431 rmdir .tst 2>/dev/null
1432 AC_SUBST([am__leading_dot])])
1434 # Check to see how 'make' treats includes. -*- Autoconf -*-
1436 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
1444 # Check to see how make treats includes.
1445 AC_DEFUN([AM_MAKE_INCLUDE],
1446 [am_make=${MAKE-make}
1447 cat > confinc << 'END'
1449 @echo this is the am__doit target
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])
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*)
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
1478 AC_SUBST([am__include])
1479 AC_SUBST([am__quote])
1480 AC_MSG_RESULT([$_am_result])
1481 rm -f confinc confmf
1484 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
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.
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.
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"
1510 dnl Make sure AC_PROG_CC is never called again, or it will override our
1512 m4_define([AC_PROG_CC],
1513 [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
1516 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1518 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
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.
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"}
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
1541 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1543 MISSING="\${SHELL} $am_aux_dir/missing" ;;
1546 # Use eval to expand $SHELL
1547 if eval "$MISSING --is-lightweight"; then
1548 am_missing_run="$MISSING "
1551 AC_MSG_WARN(['missing' script is too old or missing])
1555 # Helper functions for option handling. -*- Autoconf -*-
1557 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
1563 # _AM_MANGLE_OPTION(NAME)
1564 # -----------------------
1565 AC_DEFUN([_AM_MANGLE_OPTION],
1566 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
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])])
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)])])
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])])
1586 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
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.
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.
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.
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).
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],
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])
1623 AC_ARG_VAR([PYTHON], [the Python interpreter])
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, :)
1631 am_display_PYTHON=python
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
1643 # Otherwise, try each interpreter until we find one that satisfies
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])
1651 # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
1652 if test "$am_cv_pathless_PYTHON" = none; then
1655 AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
1657 am_display_PYTHON=$am_cv_pathless_PYTHON
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])])
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
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])
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.
1679 AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
1680 AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
1682 dnl At times (like when building shared libraries) you may want
1683 dnl to know which OS platform Python thinks this is.
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])
1689 # Just factor out some code duplication.
1690 am_python_setup_sysconfig="\
1692 # Prefer sysconfig over distutils.sysconfig, for better compatibility
1693 # with python 3.x. See automake bug#10227.
1697 can_use_sysconfig = 0
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>
1703 from platform import python_implementation
1704 if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
1705 can_use_sysconfig = 0
1709 dnl Set up 4 directories:
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
1720 am_py_prefix=$ac_default_prefix
1722 am_py_prefix=$prefix
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'})
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
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,"`
1738 case $am_py_prefix in
1741 am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
1747 AC_SUBST([pythondir], [$am_cv_python_pythondir])
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.
1753 AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
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
1762 am_py_exec_prefix=$am_py_prefix
1764 am_py_exec_prefix=$exec_prefix
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'})
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,"`
1780 case $am_py_exec_prefix in
1783 am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
1789 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
1791 dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
1793 AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
1795 dnl Run any user-specified action.
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],
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]]
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])])
1821 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
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
1835 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1836 (exit $ac_status); }])
1838 # Check to make sure that the build environment is sane. -*- Autoconf -*-
1840 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
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.
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.
1855 *[[\\\"\#\$\&\'\`$am_lf]]*)
1856 AC_MSG_ERROR([unsafe absolute working directory name]);;
1859 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
1860 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
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
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
1875 set X `ls -t "$srcdir/configure" conftest.file`
1877 if test "$[*]" != "X $srcdir/configure conftest.file" \
1878 && test "$[*]" != "X conftest.file $srcdir/configure"; then
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])
1887 if test "$[2]" = conftest.file || test $am_try -eq 2; then
1894 test "$[2]" = conftest.file
1900 AC_MSG_ERROR([newly created file is older than distributed files!
1901 Check your system clock])
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.
1907 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
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
1917 AC_MSG_RESULT([done])])
1921 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
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.
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
1934 [--enable-silent-rules],
1935 [less verbose build output (undo: "make V=1")])
1937 [--disable-silent-rules],
1938 [verbose build output (undo: "make V=0")])dnl
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]);;
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))
1958 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1959 am_cv_make_support_nested_variables=yes
1961 am_cv_make_support_nested_variables=no
1963 if test $am_cv_make_support_nested_variables = yes; then
1964 dnl Using '$V' instead of '$(V)' breaks IRIX make.
1966 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1968 AM_V=$AM_DEFAULT_VERBOSITY
1969 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
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
1977 AC_SUBST([AM_BACKSLASH])dnl
1978 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1981 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
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.
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], :)
2006 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2007 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2009 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
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.
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])
2021 # AM_SUBST_NOTMAKE(VARIABLE)
2022 # --------------------------
2023 # Public sister of _AM_SUBST_NOTMAKE.
2024 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2026 # Check how to create a tarball. -*- Autoconf -*-
2028 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
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.
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'.
2039 # Substitute a variable $(am__tar) that is a command
2040 # writing to stdout a FORMAT-tarball containing the directory
2042 # tardir=directory && $(am__tar) > result.tar
2044 # Substitute a variable $(am__untar) that extract such
2045 # a tarball read from stdin.
2046 # $(am__untar) < result.tar
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}'])
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'
2057 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
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
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])
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])
2091 [m4_fatal([Unknown tar format])])
2093 AC_MSG_CHECKING([how to create a $1 tar archive])
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}
2099 for _am_tool in $_am_tools; do
2102 for _am_tar in tar gnutar gtar; do
2103 AM_RUN_LOG([$_am_tar --version]) && break
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 -"
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 -'
2118 am__tar='pax -L -x $1 -w "$$tardir"'
2119 am__tar_='pax -L -x $1 -w "$tardir"'
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'
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
2138 # tar/untar a dummy directory, and stop if the command works.
2141 echo GrepMe > conftest.dir/file
2142 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
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
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])])
2156 AC_SUBST([am__untar])
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])