Imported Upstream version 3.18.1
[platform/upstream/pygobject2.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.3 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5 # Inc.
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
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, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
859 # Foundation, Inc.
860 #
861 # This file is free software; the Free Software Foundation
862 # gives unlimited permission to copy and/or distribute it,
863 # with or without modifications, as long as this notice is preserved.
864
865 # serial 1
866
867 # AM_AUTOMAKE_VERSION(VERSION)
868 # ----------------------------
869 # Automake X.Y traces this macro to ensure aclocal.m4 has been
870 # generated from the m4 files accompanying Automake X.Y.
871 # (This private macro should not be called outside this file.)
872 AC_DEFUN([AM_AUTOMAKE_VERSION],
873 [am__api_version='1.11'
874 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
875 dnl require some minimum version.  Point them to the right macro.
876 m4_if([$1], [1.11.3], [],
877       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
878 ])
879
880 # _AM_AUTOCONF_VERSION(VERSION)
881 # -----------------------------
882 # aclocal traces this macro to find the Autoconf version.
883 # This is a private macro too.  Using m4_define simplifies
884 # the logic in aclocal, which can simply ignore this definition.
885 m4_define([_AM_AUTOCONF_VERSION], [])
886
887 # AM_SET_CURRENT_AUTOMAKE_VERSION
888 # -------------------------------
889 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
890 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
891 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
892 [AM_AUTOMAKE_VERSION([1.11.3])dnl
893 m4_ifndef([AC_AUTOCONF_VERSION],
894   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
895 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
896
897 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
898
899 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
900 #
901 # This file is free software; the Free Software Foundation
902 # gives unlimited permission to copy and/or distribute it,
903 # with or without modifications, as long as this notice is preserved.
904
905 # serial 1
906
907 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
908 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
909 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
910 #
911 # Of course, Automake must honor this variable whenever it calls a
912 # tool from the auxiliary directory.  The problem is that $srcdir (and
913 # therefore $ac_aux_dir as well) can be either absolute or relative,
914 # depending on how configure is run.  This is pretty annoying, since
915 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
916 # source directory, any form will work fine, but in subdirectories a
917 # relative path needs to be adjusted first.
918 #
919 # $ac_aux_dir/missing
920 #    fails when called from a subdirectory if $ac_aux_dir is relative
921 # $top_srcdir/$ac_aux_dir/missing
922 #    fails if $ac_aux_dir is absolute,
923 #    fails when called from a subdirectory in a VPATH build with
924 #          a relative $ac_aux_dir
925 #
926 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
927 # are both prefixed by $srcdir.  In an in-source build this is usually
928 # harmless because $srcdir is `.', but things will broke when you
929 # start a VPATH build or use an absolute $srcdir.
930 #
931 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
932 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
933 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
934 # and then we would define $MISSING as
935 #   MISSING="\${SHELL} $am_aux_dir/missing"
936 # This will work as long as MISSING is not called from configure, because
937 # unfortunately $(top_srcdir) has no meaning in configure.
938 # However there are other variables, like CC, which are often used in
939 # configure, and could therefore not use this "fixed" $ac_aux_dir.
940 #
941 # Another solution, used here, is to always expand $ac_aux_dir to an
942 # absolute PATH.  The drawback is that using absolute paths prevent a
943 # configured tree to be moved without reconfiguration.
944
945 AC_DEFUN([AM_AUX_DIR_EXPAND],
946 [dnl Rely on autoconf to set up CDPATH properly.
947 AC_PREREQ([2.50])dnl
948 # expand $ac_aux_dir to an absolute path
949 am_aux_dir=`cd $ac_aux_dir && pwd`
950 ])
951
952 # AM_CONDITIONAL                                            -*- Autoconf -*-
953
954 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
955 # Free Software Foundation, Inc.
956 #
957 # This file is free software; the Free Software Foundation
958 # gives unlimited permission to copy and/or distribute it,
959 # with or without modifications, as long as this notice is preserved.
960
961 # serial 9
962
963 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
964 # -------------------------------------
965 # Define a conditional.
966 AC_DEFUN([AM_CONDITIONAL],
967 [AC_PREREQ(2.52)dnl
968  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
969         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
970 AC_SUBST([$1_TRUE])dnl
971 AC_SUBST([$1_FALSE])dnl
972 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
973 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
974 m4_define([_AM_COND_VALUE_$1], [$2])dnl
975 if $2; then
976   $1_TRUE=
977   $1_FALSE='#'
978 else
979   $1_TRUE='#'
980   $1_FALSE=
981 fi
982 AC_CONFIG_COMMANDS_PRE(
983 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
984   AC_MSG_ERROR([[conditional "$1" was never defined.
985 Usually this means the macro was only invoked conditionally.]])
986 fi])])
987
988 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
989 # 2010, 2011 Free Software Foundation, Inc.
990 #
991 # This file is free software; the Free Software Foundation
992 # gives unlimited permission to copy and/or distribute it,
993 # with or without modifications, as long as this notice is preserved.
994
995 # serial 12
996
997 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
998 # written in clear, in which case automake, when reading aclocal.m4,
999 # will think it sees a *use*, and therefore will trigger all it's
1000 # C support machinery.  Also note that it means that autoscan, seeing
1001 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1002
1003
1004 # _AM_DEPENDENCIES(NAME)
1005 # ----------------------
1006 # See how the compiler implements dependency checking.
1007 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1008 # We try a few techniques and use that to set a single cache variable.
1009 #
1010 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1011 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1012 # dependency, and given that the user is not expected to run this macro,
1013 # just rely on AC_PROG_CC.
1014 AC_DEFUN([_AM_DEPENDENCIES],
1015 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1016 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1017 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1018 AC_REQUIRE([AM_DEP_TRACK])dnl
1019
1020 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1021        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1022        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1023        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1024        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1025                    [depcc="$$1"   am_compiler_list=])
1026
1027 AC_CACHE_CHECK([dependency style of $depcc],
1028                [am_cv_$1_dependencies_compiler_type],
1029 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1030   # We make a subdir and do the tests there.  Otherwise we can end up
1031   # making bogus files that we don't know about and never remove.  For
1032   # instance it was reported that on HP-UX the gcc test will end up
1033   # making a dummy file named `D' -- because `-MD' means `put the output
1034   # in D'.
1035   rm -rf conftest.dir
1036   mkdir conftest.dir
1037   # Copy depcomp to subdir because otherwise we won't find it if we're
1038   # using a relative directory.
1039   cp "$am_depcomp" conftest.dir
1040   cd conftest.dir
1041   # We will build objects and dependencies in a subdirectory because
1042   # it helps to detect inapplicable dependency modes.  For instance
1043   # both Tru64's cc and ICC support -MD to output dependencies as a
1044   # side effect of compilation, but ICC will put the dependencies in
1045   # the current directory while Tru64 will put them in the object
1046   # directory.
1047   mkdir sub
1048
1049   am_cv_$1_dependencies_compiler_type=none
1050   if test "$am_compiler_list" = ""; then
1051      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1052   fi
1053   am__universal=false
1054   m4_case([$1], [CC],
1055     [case " $depcc " in #(
1056      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1057      esac],
1058     [CXX],
1059     [case " $depcc " in #(
1060      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1061      esac])
1062
1063   for depmode in $am_compiler_list; do
1064     # Setup a source with many dependencies, because some compilers
1065     # like to wrap large dependency lists on column 80 (with \), and
1066     # we should not choose a depcomp mode which is confused by this.
1067     #
1068     # We need to recreate these files for each test, as the compiler may
1069     # overwrite some of them when testing with obscure command lines.
1070     # This happens at least with the AIX C compiler.
1071     : > sub/conftest.c
1072     for i in 1 2 3 4 5 6; do
1073       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1074       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1075       # Solaris 8's {/usr,}/bin/sh.
1076       touch sub/conftst$i.h
1077     done
1078     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1079
1080     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1081     # mode.  It turns out that the SunPro C++ compiler does not properly
1082     # handle `-M -o', and we need to detect this.  Also, some Intel
1083     # versions had trouble with output in subdirs
1084     am__obj=sub/conftest.${OBJEXT-o}
1085     am__minus_obj="-o $am__obj"
1086     case $depmode in
1087     gcc)
1088       # This depmode causes a compiler race in universal mode.
1089       test "$am__universal" = false || continue
1090       ;;
1091     nosideeffect)
1092       # after this tag, mechanisms are not by side-effect, so they'll
1093       # only be used when explicitly requested
1094       if test "x$enable_dependency_tracking" = xyes; then
1095         continue
1096       else
1097         break
1098       fi
1099       ;;
1100     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1101       # This compiler won't grok `-c -o', but also, the minuso test has
1102       # not run yet.  These depmodes are late enough in the game, and
1103       # so weak that their functioning should not be impacted.
1104       am__obj=conftest.${OBJEXT-o}
1105       am__minus_obj=
1106       ;;
1107     none) break ;;
1108     esac
1109     if depmode=$depmode \
1110        source=sub/conftest.c object=$am__obj \
1111        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1112        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1113          >/dev/null 2>conftest.err &&
1114        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1115        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1116        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1117        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1118       # icc doesn't choke on unknown options, it will just issue warnings
1119       # or remarks (even with -Werror).  So we grep stderr for any message
1120       # that says an option was ignored or not supported.
1121       # When given -MP, icc 7.0 and 7.1 complain thusly:
1122       #   icc: Command line warning: ignoring option '-M'; no argument required
1123       # The diagnosis changed in icc 8.0:
1124       #   icc: Command line remark: option '-MP' not supported
1125       if (grep 'ignoring option' conftest.err ||
1126           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1127         am_cv_$1_dependencies_compiler_type=$depmode
1128         break
1129       fi
1130     fi
1131   done
1132
1133   cd ..
1134   rm -rf conftest.dir
1135 else
1136   am_cv_$1_dependencies_compiler_type=none
1137 fi
1138 ])
1139 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1140 AM_CONDITIONAL([am__fastdep$1], [
1141   test "x$enable_dependency_tracking" != xno \
1142   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1143 ])
1144
1145
1146 # AM_SET_DEPDIR
1147 # -------------
1148 # Choose a directory name for dependency files.
1149 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1150 AC_DEFUN([AM_SET_DEPDIR],
1151 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1152 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1153 ])
1154
1155
1156 # AM_DEP_TRACK
1157 # ------------
1158 AC_DEFUN([AM_DEP_TRACK],
1159 [AC_ARG_ENABLE(dependency-tracking,
1160 [  --disable-dependency-tracking  speeds up one-time build
1161   --enable-dependency-tracking   do not reject slow dependency extractors])
1162 if test "x$enable_dependency_tracking" != xno; then
1163   am_depcomp="$ac_aux_dir/depcomp"
1164   AMDEPBACKSLASH='\'
1165   am__nodep='_no'
1166 fi
1167 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1168 AC_SUBST([AMDEPBACKSLASH])dnl
1169 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1170 AC_SUBST([am__nodep])dnl
1171 _AM_SUBST_NOTMAKE([am__nodep])dnl
1172 ])
1173
1174 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1175
1176 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1177 # Free Software Foundation, Inc.
1178 #
1179 # This file is free software; the Free Software Foundation
1180 # gives unlimited permission to copy and/or distribute it,
1181 # with or without modifications, as long as this notice is preserved.
1182
1183 #serial 5
1184
1185 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1186 # ------------------------------
1187 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1188 [{
1189   # Autoconf 2.62 quotes --file arguments for eval, but not when files
1190   # are listed without --file.  Let's play safe and only enable the eval
1191   # if we detect the quoting.
1192   case $CONFIG_FILES in
1193   *\'*) eval set x "$CONFIG_FILES" ;;
1194   *)   set x $CONFIG_FILES ;;
1195   esac
1196   shift
1197   for mf
1198   do
1199     # Strip MF so we end up with the name of the file.
1200     mf=`echo "$mf" | sed -e 's/:.*$//'`
1201     # Check whether this is an Automake generated Makefile or not.
1202     # We used to match only the files named `Makefile.in', but
1203     # some people rename them; so instead we look at the file content.
1204     # Grep'ing the first line is not enough: some people post-process
1205     # each Makefile.in and add a new line on top of each file to say so.
1206     # Grep'ing the whole file is not good either: AIX grep has a line
1207     # limit of 2048, but all sed's we know have understand at least 4000.
1208     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1209       dirpart=`AS_DIRNAME("$mf")`
1210     else
1211       continue
1212     fi
1213     # Extract the definition of DEPDIR, am__include, and am__quote
1214     # from the Makefile without running `make'.
1215     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1216     test -z "$DEPDIR" && continue
1217     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1218     test -z "am__include" && continue
1219     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1220     # When using ansi2knr, U may be empty or an underscore; expand it
1221     U=`sed -n 's/^U = //p' < "$mf"`
1222     # Find all dependency output files, they are included files with
1223     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1224     # simplest approach to changing $(DEPDIR) to its actual value in the
1225     # expansion.
1226     for file in `sed -n "
1227       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1228          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1229       # Make sure the directory exists.
1230       test -f "$dirpart/$file" && continue
1231       fdir=`AS_DIRNAME(["$file"])`
1232       AS_MKDIR_P([$dirpart/$fdir])
1233       # echo "creating $dirpart/$file"
1234       echo '# dummy' > "$dirpart/$file"
1235     done
1236   done
1237 }
1238 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1239
1240
1241 # AM_OUTPUT_DEPENDENCY_COMMANDS
1242 # -----------------------------
1243 # This macro should only be invoked once -- use via AC_REQUIRE.
1244 #
1245 # This code is only required when automatic dependency tracking
1246 # is enabled.  FIXME.  This creates each `.P' file that we will
1247 # need in order to bootstrap the dependency handling code.
1248 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1249 [AC_CONFIG_COMMANDS([depfiles],
1250      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1251      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1252 ])
1253
1254 # Do all the work for Automake.                             -*- Autoconf -*-
1255
1256 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1257 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1258 #
1259 # This file is free software; the Free Software Foundation
1260 # gives unlimited permission to copy and/or distribute it,
1261 # with or without modifications, as long as this notice is preserved.
1262
1263 # serial 16
1264
1265 # This macro actually does too much.  Some checks are only needed if
1266 # your package does certain things.  But this isn't really a big deal.
1267
1268 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1269 # AM_INIT_AUTOMAKE([OPTIONS])
1270 # -----------------------------------------------
1271 # The call with PACKAGE and VERSION arguments is the old style
1272 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1273 # and VERSION should now be passed to AC_INIT and removed from
1274 # the call to AM_INIT_AUTOMAKE.
1275 # We support both call styles for the transition.  After
1276 # the next Automake release, Autoconf can make the AC_INIT
1277 # arguments mandatory, and then we can depend on a new Autoconf
1278 # release and drop the old call support.
1279 AC_DEFUN([AM_INIT_AUTOMAKE],
1280 [AC_PREREQ([2.62])dnl
1281 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1282 dnl the ones we care about.
1283 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1284 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1285 AC_REQUIRE([AC_PROG_INSTALL])dnl
1286 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1287   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1288   # is not polluted with repeated "-I."
1289   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1290   # test to see if srcdir already configured
1291   if test -f $srcdir/config.status; then
1292     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1293   fi
1294 fi
1295
1296 # test whether we have cygpath
1297 if test -z "$CYGPATH_W"; then
1298   if (cygpath --version) >/dev/null 2>/dev/null; then
1299     CYGPATH_W='cygpath -w'
1300   else
1301     CYGPATH_W=echo
1302   fi
1303 fi
1304 AC_SUBST([CYGPATH_W])
1305
1306 # Define the identity of the package.
1307 dnl Distinguish between old-style and new-style calls.
1308 m4_ifval([$2],
1309 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1310  AC_SUBST([PACKAGE], [$1])dnl
1311  AC_SUBST([VERSION], [$2])],
1312 [_AM_SET_OPTIONS([$1])dnl
1313 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1314 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1315   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1316  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1317  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1318
1319 _AM_IF_OPTION([no-define],,
1320 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1321  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1322
1323 # Some tools Automake needs.
1324 AC_REQUIRE([AM_SANITY_CHECK])dnl
1325 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1326 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1327 AM_MISSING_PROG(AUTOCONF, autoconf)
1328 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1329 AM_MISSING_PROG(AUTOHEADER, autoheader)
1330 AM_MISSING_PROG(MAKEINFO, makeinfo)
1331 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1332 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1333 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1334 # We need awk for the "check" target.  The system "awk" is bad on
1335 # some platforms.
1336 AC_REQUIRE([AC_PROG_AWK])dnl
1337 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1338 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1339 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1340               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1341                              [_AM_PROG_TAR([v7])])])
1342 _AM_IF_OPTION([no-dependencies],,
1343 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1344                   [_AM_DEPENDENCIES(CC)],
1345                   [define([AC_PROG_CC],
1346                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1347 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1348                   [_AM_DEPENDENCIES(CXX)],
1349                   [define([AC_PROG_CXX],
1350                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1351 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1352                   [_AM_DEPENDENCIES(OBJC)],
1353                   [define([AC_PROG_OBJC],
1354                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1355 ])
1356 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1357 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1358 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1359 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1360 AC_CONFIG_COMMANDS_PRE(dnl
1361 [m4_provide_if([_AM_COMPILER_EXEEXT],
1362   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1363 ])
1364
1365 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1366 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1367 dnl mangled by Autoconf and run in a shell conditional statement.
1368 m4_define([_AC_COMPILER_EXEEXT],
1369 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1370
1371
1372 # When config.status generates a header, we must update the stamp-h file.
1373 # This file resides in the same directory as the config header
1374 # that is generated.  The stamp files are numbered to have different names.
1375
1376 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1377 # loop where config.status creates the headers, so we can generate
1378 # our stamp files there.
1379 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1380 [# Compute $1's index in $config_headers.
1381 _am_arg=$1
1382 _am_stamp_count=1
1383 for _am_header in $config_headers :; do
1384   case $_am_header in
1385     $_am_arg | $_am_arg:* )
1386       break ;;
1387     * )
1388       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1389   esac
1390 done
1391 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1392
1393 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
1394 # 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 # serial 1
1401
1402 # AM_PROG_INSTALL_SH
1403 # ------------------
1404 # Define $install_sh.
1405 AC_DEFUN([AM_PROG_INSTALL_SH],
1406 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1407 if test x"${install_sh}" != xset; then
1408   case $am_aux_dir in
1409   *\ * | *\     *)
1410     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1411   *)
1412     install_sh="\${SHELL} $am_aux_dir/install-sh"
1413   esac
1414 fi
1415 AC_SUBST(install_sh)])
1416
1417 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1418 #
1419 # This file is free software; the Free Software Foundation
1420 # gives unlimited permission to copy and/or distribute it,
1421 # with or without modifications, as long as this notice is preserved.
1422
1423 # serial 2
1424
1425 # Check whether the underlying file-system supports filenames
1426 # with a leading dot.  For instance MS-DOS doesn't.
1427 AC_DEFUN([AM_SET_LEADING_DOT],
1428 [rm -rf .tst 2>/dev/null
1429 mkdir .tst 2>/dev/null
1430 if test -d .tst; then
1431   am__leading_dot=.
1432 else
1433   am__leading_dot=_
1434 fi
1435 rmdir .tst 2>/dev/null
1436 AC_SUBST([am__leading_dot])])
1437
1438 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1439
1440 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1441 #
1442 # This file is free software; the Free Software Foundation
1443 # gives unlimited permission to copy and/or distribute it,
1444 # with or without modifications, as long as this notice is preserved.
1445
1446 # serial 4
1447
1448 # AM_MAKE_INCLUDE()
1449 # -----------------
1450 # Check to see how make treats includes.
1451 AC_DEFUN([AM_MAKE_INCLUDE],
1452 [am_make=${MAKE-make}
1453 cat > confinc << 'END'
1454 am__doit:
1455         @echo this is the am__doit target
1456 .PHONY: am__doit
1457 END
1458 # If we don't find an include directive, just comment out the code.
1459 AC_MSG_CHECKING([for style of include used by $am_make])
1460 am__include="#"
1461 am__quote=
1462 _am_result=none
1463 # First try GNU make style include.
1464 echo "include confinc" > confmf
1465 # Ignore all kinds of additional output from `make'.
1466 case `$am_make -s -f confmf 2> /dev/null` in #(
1467 *the\ am__doit\ target*)
1468   am__include=include
1469   am__quote=
1470   _am_result=GNU
1471   ;;
1472 esac
1473 # Now try BSD make style include.
1474 if test "$am__include" = "#"; then
1475    echo '.include "confinc"' > confmf
1476    case `$am_make -s -f confmf 2> /dev/null` in #(
1477    *the\ am__doit\ target*)
1478      am__include=.include
1479      am__quote="\""
1480      _am_result=BSD
1481      ;;
1482    esac
1483 fi
1484 AC_SUBST([am__include])
1485 AC_SUBST([am__quote])
1486 AC_MSG_RESULT([$_am_result])
1487 rm -f confinc confmf
1488 ])
1489
1490 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
1491 # Free Software Foundation, Inc.
1492 #
1493 # This file is free software; the Free Software Foundation
1494 # gives unlimited permission to copy and/or distribute it,
1495 # with or without modifications, as long as this notice is preserved.
1496
1497 # serial 6
1498
1499 # AM_PROG_CC_C_O
1500 # --------------
1501 # Like AC_PROG_CC_C_O, but changed for automake.
1502 AC_DEFUN([AM_PROG_CC_C_O],
1503 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
1504 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1505 AC_REQUIRE_AUX_FILE([compile])dnl
1506 # FIXME: we rely on the cache variable name because
1507 # there is no other way.
1508 set dummy $CC
1509 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
1510 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
1511 if test "$am_t" != yes; then
1512    # Losing compiler, so override with the script.
1513    # FIXME: It is wrong to rewrite CC.
1514    # But if we don't then we get into trouble of one sort or another.
1515    # A longer-term fix would be to have automake use am__CC in this case,
1516    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1517    CC="$am_aux_dir/compile $CC"
1518 fi
1519 dnl Make sure AC_PROG_CC is never called again, or it will override our
1520 dnl setting of CC.
1521 m4_define([AC_PROG_CC],
1522           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
1523 ])
1524
1525 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1526
1527 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1528 # Free Software Foundation, Inc.
1529 #
1530 # This file is free software; the Free Software Foundation
1531 # gives unlimited permission to copy and/or distribute it,
1532 # with or without modifications, as long as this notice is preserved.
1533
1534 # serial 6
1535
1536 # AM_MISSING_PROG(NAME, PROGRAM)
1537 # ------------------------------
1538 AC_DEFUN([AM_MISSING_PROG],
1539 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1540 $1=${$1-"${am_missing_run}$2"}
1541 AC_SUBST($1)])
1542
1543
1544 # AM_MISSING_HAS_RUN
1545 # ------------------
1546 # Define MISSING if not defined so far and test if it supports --run.
1547 # If it does, set am_missing_run to use it, otherwise, to nothing.
1548 AC_DEFUN([AM_MISSING_HAS_RUN],
1549 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1550 AC_REQUIRE_AUX_FILE([missing])dnl
1551 if test x"${MISSING+set}" != xset; then
1552   case $am_aux_dir in
1553   *\ * | *\     *)
1554     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1555   *)
1556     MISSING="\${SHELL} $am_aux_dir/missing" ;;
1557   esac
1558 fi
1559 # Use eval to expand $SHELL
1560 if eval "$MISSING --run true"; then
1561   am_missing_run="$MISSING --run "
1562 else
1563   am_missing_run=
1564   AC_MSG_WARN([`missing' script is too old or missing])
1565 fi
1566 ])
1567
1568 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
1569 # Inc.
1570 #
1571 # This file is free software; the Free Software Foundation
1572 # gives unlimited permission to copy and/or distribute it,
1573 # with or without modifications, as long as this notice is preserved.
1574
1575 # serial 1
1576
1577 # AM_PROG_MKDIR_P
1578 # ---------------
1579 # Check for `mkdir -p'.
1580 AC_DEFUN([AM_PROG_MKDIR_P],
1581 [AC_PREREQ([2.60])dnl
1582 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1583 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1584 dnl while keeping a definition of mkdir_p for backward compatibility.
1585 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1586 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1587 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1588 dnl adjustment using top_builddir (which is defined more often than
1589 dnl MKDIR_P).
1590 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1591 case $mkdir_p in
1592   [[\\/$]]* | ?:[[\\/]]*) ;;
1593   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1594 esac
1595 ])
1596
1597 # Helper functions for option handling.                     -*- Autoconf -*-
1598
1599 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
1600 # Foundation, Inc.
1601 #
1602 # This file is free software; the Free Software Foundation
1603 # gives unlimited permission to copy and/or distribute it,
1604 # with or without modifications, as long as this notice is preserved.
1605
1606 # serial 5
1607
1608 # _AM_MANGLE_OPTION(NAME)
1609 # -----------------------
1610 AC_DEFUN([_AM_MANGLE_OPTION],
1611 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1612
1613 # _AM_SET_OPTION(NAME)
1614 # --------------------
1615 # Set option NAME.  Presently that only means defining a flag for this option.
1616 AC_DEFUN([_AM_SET_OPTION],
1617 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1618
1619 # _AM_SET_OPTIONS(OPTIONS)
1620 # ------------------------
1621 # OPTIONS is a space-separated list of Automake options.
1622 AC_DEFUN([_AM_SET_OPTIONS],
1623 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1624
1625 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1626 # -------------------------------------------
1627 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1628 AC_DEFUN([_AM_IF_OPTION],
1629 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1630
1631 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009,
1632 # 2011 Free Software Foundation, Inc.
1633 #
1634 # This file is free software; the Free Software Foundation
1635 # gives unlimited permission to copy and/or distribute it,
1636 # with or without modifications, as long as this notice is preserved.
1637
1638 # serial 2
1639
1640 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1641 # ---------------------------------------------------------------------------
1642 # Adds support for distributing Python modules and packages.  To
1643 # install modules, copy them to $(pythondir), using the python_PYTHON
1644 # automake variable.  To install a package with the same name as the
1645 # automake package, install to $(pkgpythondir), or use the
1646 # pkgpython_PYTHON automake variable.
1647 #
1648 # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
1649 # locations to install python extension modules (shared libraries).
1650 # Another macro is required to find the appropriate flags to compile
1651 # extension modules.
1652 #
1653 # If your package is configured with a different prefix to python,
1654 # users will have to add the install directory to the PYTHONPATH
1655 # environment variable, or create a .pth file (see the python
1656 # documentation for details).
1657 #
1658 # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
1659 # cause an error if the version of python installed on the system
1660 # doesn't meet the requirement.  MINIMUM-VERSION should consist of
1661 # numbers and dots only.
1662 AC_DEFUN([AM_PATH_PYTHON],
1663  [
1664   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
1665   dnl supported. (2.0 was released on October 16, 2000).
1666   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
1667 [python python2 python3 python3.2 python3.1 python3.0 python2.7 dnl
1668  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
1669
1670   AC_ARG_VAR([PYTHON], [the Python interpreter])
1671
1672   m4_if([$1],[],[
1673     dnl No version check is needed.
1674     # Find any Python interpreter.
1675     if test -z "$PYTHON"; then
1676       AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
1677     fi
1678     am_display_PYTHON=python
1679   ], [
1680     dnl A version check is needed.
1681     if test -n "$PYTHON"; then
1682       # If the user set $PYTHON, use it and don't search something else.
1683       AC_MSG_CHECKING([whether $PYTHON version >= $1])
1684       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
1685                               [AC_MSG_RESULT(yes)],
1686                               [AC_MSG_ERROR(too old)])
1687       am_display_PYTHON=$PYTHON
1688     else
1689       # Otherwise, try each interpreter until we find one that satisfies
1690       # VERSION.
1691       AC_CACHE_CHECK([for a Python interpreter with version >= $1],
1692         [am_cv_pathless_PYTHON],[
1693         for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
1694           test "$am_cv_pathless_PYTHON" = none && break
1695           AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
1696         done])
1697       # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
1698       if test "$am_cv_pathless_PYTHON" = none; then
1699         PYTHON=:
1700       else
1701         AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
1702       fi
1703       am_display_PYTHON=$am_cv_pathless_PYTHON
1704     fi
1705   ])
1706
1707   if test "$PYTHON" = :; then
1708   dnl Run any user-specified action, or abort.
1709     m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
1710   else
1711
1712   dnl Query Python for its version number.  Getting [:3] seems to be
1713   dnl the best way to do this; it's what "site.py" does in the standard
1714   dnl library.
1715
1716   AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
1717     [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
1718   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
1719
1720   dnl Use the values of $prefix and $exec_prefix for the corresponding
1721   dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
1722   dnl distinct variables so they can be overridden if need be.  However,
1723   dnl general consensus is that you shouldn't need this ability.
1724
1725   AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
1726   AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
1727
1728   dnl At times (like when building shared libraries) you may want
1729   dnl to know which OS platform Python thinks this is.
1730
1731   AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
1732     [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
1733   AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
1734
1735
1736   dnl Set up 4 directories:
1737
1738   dnl pythondir -- where to install python scripts.  This is the
1739   dnl   site-packages directory, not the python standard library
1740   dnl   directory like in previous automake betas.  This behavior
1741   dnl   is more consistent with lispdir.m4 for example.
1742   dnl Query distutils for this directory.
1743   AC_CACHE_CHECK([for $am_display_PYTHON script directory],
1744     [am_cv_python_pythondir],
1745     [if test "x$prefix" = xNONE
1746      then
1747        am_py_prefix=$ac_default_prefix
1748      else
1749        am_py_prefix=$prefix
1750      fi
1751      am_cv_python_pythondir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(0,0,prefix='$am_py_prefix'))" 2>/dev/null`
1752      case $am_cv_python_pythondir in
1753      $am_py_prefix*)
1754        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
1755        am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
1756        ;;
1757      *)
1758        case $am_py_prefix in
1759          /usr|/System*) ;;
1760          *)
1761           am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
1762           ;;
1763        esac
1764        ;;
1765      esac
1766     ])
1767   AC_SUBST([pythondir], [$am_cv_python_pythondir])
1768
1769   dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
1770   dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
1771   dnl   more consistent with the rest of automake.
1772
1773   AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
1774
1775   dnl pyexecdir -- directory for installing python extension modules
1776   dnl   (shared libraries)
1777   dnl Query distutils for this directory.
1778   AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
1779     [am_cv_python_pyexecdir],
1780     [if test "x$exec_prefix" = xNONE
1781      then
1782        am_py_exec_prefix=$am_py_prefix
1783      else
1784        am_py_exec_prefix=$exec_prefix
1785      fi
1786      am_cv_python_pyexecdir=`$PYTHON -c "import sys; from distutils import sysconfig; sys.stdout.write(sysconfig.get_python_lib(1,0,prefix='$am_py_exec_prefix'))" 2>/dev/null`
1787      case $am_cv_python_pyexecdir in
1788      $am_py_exec_prefix*)
1789        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
1790        am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
1791        ;;
1792      *)
1793        case $am_py_exec_prefix in
1794          /usr|/System*) ;;
1795          *)
1796            am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
1797            ;;
1798        esac
1799        ;;
1800      esac
1801     ])
1802   AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
1803
1804   dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
1805
1806   AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
1807
1808   dnl Run any user-specified action.
1809   $2
1810   fi
1811
1812 ])
1813
1814
1815 # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1816 # ---------------------------------------------------------------------------
1817 # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
1818 # Run ACTION-IF-FALSE otherwise.
1819 # This test uses sys.hexversion instead of the string equivalent (first
1820 # word of sys.version), in order to cope with versions such as 2.2c1.
1821 # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
1822 AC_DEFUN([AM_PYTHON_CHECK_VERSION],
1823  [prog="import sys
1824 # split strings by '.' and convert to numeric.  Append some zeros
1825 # because we need at least 4 digits for the hex conversion.
1826 # map returns an iterator in Python 3.0 and a list in 2.x
1827 minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
1828 minverhex = 0
1829 # xrange is not present in Python 3.0 and range returns an iterator
1830 for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
1831 sys.exit(sys.hexversion < minverhex)"
1832   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
1833
1834 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1835 #
1836 # This file is free software; the Free Software Foundation
1837 # gives unlimited permission to copy and/or distribute it,
1838 # with or without modifications, as long as this notice is preserved.
1839
1840 # serial 1
1841
1842 # AM_RUN_LOG(COMMAND)
1843 # -------------------
1844 # Run COMMAND, save the exit status in ac_status, and log it.
1845 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1846 AC_DEFUN([AM_RUN_LOG],
1847 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1848    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1849    ac_status=$?
1850    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1851    (exit $ac_status); }])
1852
1853 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1854
1855 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1856 # Free Software Foundation, Inc.
1857 #
1858 # This file is free software; the Free Software Foundation
1859 # gives unlimited permission to copy and/or distribute it,
1860 # with or without modifications, as long as this notice is preserved.
1861
1862 # serial 5
1863
1864 # AM_SANITY_CHECK
1865 # ---------------
1866 AC_DEFUN([AM_SANITY_CHECK],
1867 [AC_MSG_CHECKING([whether build environment is sane])
1868 # Just in case
1869 sleep 1
1870 echo timestamp > conftest.file
1871 # Reject unsafe characters in $srcdir or the absolute working directory
1872 # name.  Accept space and tab only in the latter.
1873 am_lf='
1874 '
1875 case `pwd` in
1876   *[[\\\"\#\$\&\'\`$am_lf]]*)
1877     AC_MSG_ERROR([unsafe absolute working directory name]);;
1878 esac
1879 case $srcdir in
1880   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
1881     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1882 esac
1883
1884 # Do `set' in a subshell so we don't clobber the current shell's
1885 # arguments.  Must try -L first in case configure is actually a
1886 # symlink; some systems play weird games with the mod time of symlinks
1887 # (eg FreeBSD returns the mod time of the symlink's containing
1888 # directory).
1889 if (
1890    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1891    if test "$[*]" = "X"; then
1892       # -L didn't work.
1893       set X `ls -t "$srcdir/configure" conftest.file`
1894    fi
1895    rm -f conftest.file
1896    if test "$[*]" != "X $srcdir/configure conftest.file" \
1897       && test "$[*]" != "X conftest.file $srcdir/configure"; then
1898
1899       # If neither matched, then we have a broken ls.  This can happen
1900       # if, for instance, CONFIG_SHELL is bash and it inherits a
1901       # broken ls alias from the environment.  This has actually
1902       # happened.  Such a system could not be considered "sane".
1903       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1904 alias in your environment])
1905    fi
1906
1907    test "$[2]" = conftest.file
1908    )
1909 then
1910    # Ok.
1911    :
1912 else
1913    AC_MSG_ERROR([newly created file is older than distributed files!
1914 Check your system clock])
1915 fi
1916 AC_MSG_RESULT(yes)])
1917
1918 # Copyright (C) 2009, 2011  Free Software Foundation, Inc.
1919 #
1920 # This file is free software; the Free Software Foundation
1921 # gives unlimited permission to copy and/or distribute it,
1922 # with or without modifications, as long as this notice is preserved.
1923
1924 # serial 2
1925
1926 # AM_SILENT_RULES([DEFAULT])
1927 # --------------------------
1928 # Enable less verbose build rules; with the default set to DEFAULT
1929 # (`yes' being less verbose, `no' or empty being verbose).
1930 AC_DEFUN([AM_SILENT_RULES],
1931 [AC_ARG_ENABLE([silent-rules],
1932 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
1933   --disable-silent-rules         verbose build output (undo: `make V=0')])
1934 case $enable_silent_rules in
1935 yes) AM_DEFAULT_VERBOSITY=0;;
1936 no)  AM_DEFAULT_VERBOSITY=1;;
1937 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1938 esac
1939 dnl
1940 dnl A few `make' implementations (e.g., NonStop OS and NextStep)
1941 dnl do not support nested variable expansions.
1942 dnl See automake bug#9928 and bug#10237.
1943 am_make=${MAKE-make}
1944 AC_CACHE_CHECK([whether $am_make supports nested variables],
1945    [am_cv_make_support_nested_variables],
1946    [if AS_ECHO([['TRUE=$(BAR$(V))
1947 BAR0=false
1948 BAR1=true
1949 V=1
1950 am__doit:
1951         @$(TRUE)
1952 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1953   am_cv_make_support_nested_variables=yes
1954 else
1955   am_cv_make_support_nested_variables=no
1956 fi])
1957 if test $am_cv_make_support_nested_variables = yes; then
1958   dnl Using `$V' instead of `$(V)' breaks IRIX make.
1959   AM_V='$(V)'
1960   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1961 else
1962   AM_V=$AM_DEFAULT_VERBOSITY
1963   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1964 fi
1965 AC_SUBST([AM_V])dnl
1966 AM_SUBST_NOTMAKE([AM_V])dnl
1967 AC_SUBST([AM_DEFAULT_V])dnl
1968 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1969 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1970 AM_BACKSLASH='\'
1971 AC_SUBST([AM_BACKSLASH])dnl
1972 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1973 ])
1974
1975 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1976 #
1977 # This file is free software; the Free Software Foundation
1978 # gives unlimited permission to copy and/or distribute it,
1979 # with or without modifications, as long as this notice is preserved.
1980
1981 # serial 1
1982
1983 # AM_PROG_INSTALL_STRIP
1984 # ---------------------
1985 # One issue with vendor `install' (even GNU) is that you can't
1986 # specify the program used to strip binaries.  This is especially
1987 # annoying in cross-compiling environments, where the build's strip
1988 # is unlikely to handle the host's binaries.
1989 # Fortunately install-sh will honor a STRIPPROG variable, so we
1990 # always use install-sh in `make install-strip', and initialize
1991 # STRIPPROG with the value of the STRIP variable (set by the user).
1992 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1993 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1994 # Installed binaries are usually stripped using `strip' when the user
1995 # run `make install-strip'.  However `strip' might not be the right
1996 # tool to use in cross-compilation environments, therefore Automake
1997 # will honor the `STRIP' environment variable to overrule this program.
1998 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1999 if test "$cross_compiling" != no; then
2000   AC_CHECK_TOOL([STRIP], [strip], :)
2001 fi
2002 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2003 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2004
2005 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
2006 #
2007 # This file is free software; the Free Software Foundation
2008 # gives unlimited permission to copy and/or distribute it,
2009 # with or without modifications, as long as this notice is preserved.
2010
2011 # serial 3
2012
2013 # _AM_SUBST_NOTMAKE(VARIABLE)
2014 # ---------------------------
2015 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2016 # This macro is traced by Automake.
2017 AC_DEFUN([_AM_SUBST_NOTMAKE])
2018
2019 # AM_SUBST_NOTMAKE(VARIABLE)
2020 # --------------------------
2021 # Public sister of _AM_SUBST_NOTMAKE.
2022 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2023
2024 # Check how to create a tarball.                            -*- Autoconf -*-
2025
2026 # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
2027 #
2028 # This file is free software; the Free Software Foundation
2029 # gives unlimited permission to copy and/or distribute it,
2030 # with or without modifications, as long as this notice is preserved.
2031
2032 # serial 2
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 AC_DEFUN([_AM_PROG_TAR],
2048 [# Always define AMTAR for backward compatibility.  Yes, it's still used
2049 # in the wild :-(  We should find a proper way to deprecate it ...
2050 AC_SUBST([AMTAR], ['$${TAR-tar}'])
2051 m4_if([$1], [v7],
2052      [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
2053      [m4_case([$1], [ustar],, [pax],,
2054               [m4_fatal([Unknown tar format])])
2055 AC_MSG_CHECKING([how to create a $1 tar archive])
2056 # Loop over all known methods to create a tar archive until one works.
2057 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2058 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2059 # Do not fold the above two line into one, because Tru64 sh and
2060 # Solaris sh will not grok spaces in the rhs of `-'.
2061 for _am_tool in $_am_tools
2062 do
2063   case $_am_tool in
2064   gnutar)
2065     for _am_tar in tar gnutar gtar;
2066     do
2067       AM_RUN_LOG([$_am_tar --version]) && break
2068     done
2069     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2070     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2071     am__untar="$_am_tar -xf -"
2072     ;;
2073   plaintar)
2074     # Must skip GNU tar: if it does not support --format= it doesn't create
2075     # ustar tarball either.
2076     (tar --version) >/dev/null 2>&1 && continue
2077     am__tar='tar chf - "$$tardir"'
2078     am__tar_='tar chf - "$tardir"'
2079     am__untar='tar xf -'
2080     ;;
2081   pax)
2082     am__tar='pax -L -x $1 -w "$$tardir"'
2083     am__tar_='pax -L -x $1 -w "$tardir"'
2084     am__untar='pax -r'
2085     ;;
2086   cpio)
2087     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2088     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2089     am__untar='cpio -i -H $1 -d'
2090     ;;
2091   none)
2092     am__tar=false
2093     am__tar_=false
2094     am__untar=false
2095     ;;
2096   esac
2097
2098   # If the value was cached, stop now.  We just wanted to have am__tar
2099   # and am__untar set.
2100   test -n "${am_cv_prog_tar_$1}" && break
2101
2102   # tar/untar a dummy directory, and stop if the command works
2103   rm -rf conftest.dir
2104   mkdir conftest.dir
2105   echo GrepMe > conftest.dir/file
2106   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2107   rm -rf conftest.dir
2108   if test -s conftest.tar; then
2109     AM_RUN_LOG([$am__untar <conftest.tar])
2110     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2111   fi
2112 done
2113 rm -rf conftest.dir
2114
2115 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2116 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2117 AC_SUBST([am__tar])
2118 AC_SUBST([am__untar])
2119 ]) # _AM_PROG_TAR
2120
2121 m4_include([m4/as-ac-expand.m4])
2122 m4_include([m4/jhflags.m4])
2123 m4_include([m4/libtool.m4])
2124 m4_include([m4/ltoptions.m4])
2125 m4_include([m4/ltsugar.m4])
2126 m4_include([m4/ltversion.m4])
2127 m4_include([m4/lt~obsolete.m4])
2128 m4_include([m4/python.m4])