1 # generated automatically by aclocal 1.15 -*- Autoconf -*-
3 # Copyright (C) 1996-2014 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 # Configure paths for GTK+
24 # Owen Taylor 1997-2001
26 dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
27 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
28 dnl pass to pkg-config
30 AC_DEFUN([AM_PATH_GTK_2_0],
32 dnl Get the cflags and libraries from pkg-config
34 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
37 pkg_config_args=gtk+-2.0
42 pkg_config_args="$pkg_config_args gthread-2.0"
49 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
50 PKG_PROG_PKG_CONFIG([0.7])
52 min_gtk_version=ifelse([$1], ,2.0.0,$1)
53 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
55 if test x$PKG_CONFIG != xno ; then
56 ## don't try to run the test against uninstalled libtool libs
57 if $PKG_CONFIG --uninstalled $pkg_config_args; then
58 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
62 if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
69 if test x"$no_gtk" = x ; then
70 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
71 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
72 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
73 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
74 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
75 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
76 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
77 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
78 if test "x$enable_gtktest" = "xyes" ; then
79 ac_save_CFLAGS="$CFLAGS"
81 CFLAGS="$CFLAGS $GTK_CFLAGS"
82 LIBS="$GTK_LIBS $LIBS"
84 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
85 dnl checks the results of pkg-config to some extent)
96 int major, minor, micro;
99 fclose (fopen ("conf.gtktest", "w"));
101 /* HP/UX 9 (%@#!) writes to sscanf strings */
102 tmp_version = g_strdup("$min_gtk_version");
103 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
104 printf("%s, bad version string\n", "$min_gtk_version");
108 if ((gtk_major_version != $gtk_config_major_version) ||
109 (gtk_minor_version != $gtk_config_minor_version) ||
110 (gtk_micro_version != $gtk_config_micro_version))
112 printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
113 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
114 gtk_major_version, gtk_minor_version, gtk_micro_version);
115 printf ("*** was found! If pkg-config was correct, then it is best\n");
116 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
117 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
118 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
119 printf("*** required on your system.\n");
120 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
121 printf("*** to point to the correct configuration files\n");
123 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
124 (gtk_minor_version != GTK_MINOR_VERSION) ||
125 (gtk_micro_version != GTK_MICRO_VERSION))
127 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
128 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
129 printf("*** library (version %d.%d.%d)\n",
130 gtk_major_version, gtk_minor_version, gtk_micro_version);
134 if ((gtk_major_version > major) ||
135 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
136 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
142 printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
143 gtk_major_version, gtk_minor_version, gtk_micro_version);
144 printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
145 major, minor, micro);
146 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
148 printf("*** If you have already installed a sufficiently new version, this error\n");
149 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
150 printf("*** being found. The easiest way to fix this is to remove the old version\n");
151 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
152 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
153 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
154 printf("*** so that the correct libraries are found at run-time))\n");
159 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
160 CFLAGS="$ac_save_CFLAGS"
164 if test "x$no_gtk" = x ; then
165 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
166 ifelse([$2], , :, [$2])
169 if test "$PKG_CONFIG" = "no" ; then
170 echo "*** A new enough version of pkg-config was not found."
171 echo "*** See http://pkgconfig.sourceforge.net"
173 if test -f conf.gtktest ; then
176 echo "*** Could not run GTK+ test program, checking why..."
177 ac_save_CFLAGS="$CFLAGS"
179 CFLAGS="$CFLAGS $GTK_CFLAGS"
180 LIBS="$LIBS $GTK_LIBS"
184 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
185 [ echo "*** The test program compiled, but did not run. This usually means"
186 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
187 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
188 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
189 echo "*** to the installed location Also, make sure you have run ldconfig if that"
190 echo "*** is required on your system"
192 echo "*** If you have an old version installed, it is best to remove it, although"
193 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
194 [ echo "*** The test program failed to compile or link. See the file config.log for the"
195 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
196 CFLAGS="$ac_save_CFLAGS"
202 ifelse([$3], , :, [$3])
209 # Configure paths for GTK+
210 # Owen Taylor 1997-2001
212 dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
213 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
214 dnl pass to pkg-config
216 AC_DEFUN([AM_PATH_GTK_3_0],
217 [m4_warn([obsolete], [AM_PATH_GTK_3_0 is deprecated, use PKG_CHECK_MODULES([GTK], [gtk+-3.0]) instead])
218 dnl Get the cflags and libraries from pkg-config
220 AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
221 , enable_gtktest=yes)
222 min_gtk_version=ifelse([$1], [], [3.0.0], [$1])
224 pkg_config_args="gtk+-3.0 >= $min_gtk_version"
229 pkg_config_args="$pkg_config_args gthread-2.0"
236 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
238 if test x$PKG_CONFIG != xno ; then
239 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
242 echo "*** pkg-config too old; version 0.7 or better required."
250 AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
252 if test x$PKG_CONFIG != xno ; then
253 ## don't try to run the test against uninstalled libtool libs
254 if $PKG_CONFIG --uninstalled $pkg_config_args; then
255 echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
259 if $PKG_CONFIG $pkg_config_args; then
266 if test x"$no_gtk" = x ; then
267 GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
268 GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
269 gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
270 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
271 gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
272 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
273 gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
274 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
275 if test "x$enable_gtktest" = "xyes" ; then
276 ac_save_CFLAGS="$CFLAGS"
278 CFLAGS="$CFLAGS $GTK_CFLAGS"
279 LIBS="$GTK_LIBS $LIBS"
281 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
282 dnl checks the results of pkg-config to some extent)
293 unsigned int major, minor, micro;
295 fclose (fopen ("conf.gtktest", "w"));
297 if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, µ) != 3) {
298 printf("%s, bad version string\n", "$min_gtk_version");
302 if ((gtk_major_version != $gtk_config_major_version) ||
303 (gtk_minor_version != $gtk_config_minor_version) ||
304 (gtk_micro_version != $gtk_config_micro_version))
306 printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
307 $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
308 gtk_major_version, gtk_minor_version, gtk_micro_version);
309 printf ("*** was found! If pkg-config was correct, then it is best\n");
310 printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
311 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
312 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
313 printf("*** required on your system.\n");
314 printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
315 printf("*** to point to the correct configuration files\n");
317 else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
318 (gtk_minor_version != GTK_MINOR_VERSION) ||
319 (gtk_micro_version != GTK_MICRO_VERSION))
321 printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
322 GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
323 printf("*** library (version %d.%d.%d)\n",
324 gtk_major_version, gtk_minor_version, gtk_micro_version);
328 if ((gtk_major_version > major) ||
329 ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
330 ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
336 printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n",
337 gtk_major_version, gtk_minor_version, gtk_micro_version);
338 printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n",
339 major, minor, micro);
340 printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
342 printf("*** If you have already installed a sufficiently new version, this error\n");
343 printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
344 printf("*** being found. The easiest way to fix this is to remove the old version\n");
345 printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
346 printf("*** correct copy of pkg-config. (In this case, you will have to\n");
347 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
348 printf("*** so that the correct libraries are found at run-time))\n");
353 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
354 CFLAGS="$ac_save_CFLAGS"
358 if test "x$no_gtk" = x ; then
359 AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
360 ifelse([$2], , :, [$2])
363 if test "$PKG_CONFIG" = "no" ; then
364 echo "*** A new enough version of pkg-config was not found."
365 echo "*** See http://pkgconfig.sourceforge.net"
367 if test -f conf.gtktest ; then
370 echo "*** Could not run GTK+ test program, checking why..."
371 ac_save_CFLAGS="$CFLAGS"
373 CFLAGS="$CFLAGS $GTK_CFLAGS"
374 LIBS="$LIBS $GTK_LIBS"
378 ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
379 [ echo "*** The test program compiled, but did not run. This usually means"
380 echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
381 echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
382 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
383 echo "*** to the installed location Also, make sure you have run ldconfig if that"
384 echo "*** is required on your system"
386 echo "*** If you have an old version installed, it is best to remove it, although"
387 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
388 [ echo "*** The test program failed to compile or link. See the file config.log for the"
389 echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
390 CFLAGS="$ac_save_CFLAGS"
396 ifelse([$3], , :, [$3])
403 dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
404 dnl Tests for BACKEND-NAME in the GTK targets list
406 AC_DEFUN([GTK_CHECK_BACKEND],
407 [m4_warn([obsolete], [GTK_CHECK_BACKEND is deprecated, use PKG_CHECK_MODULES([GTK_X11], [gtk+-x11-3.0]) or similar instead])
408 pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0)
409 min_gtk_version=ifelse([$2],,3.0.0,$2)
410 pkg_config_args="$pkg_config_args >= $min_gtk_version"
412 AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])])
414 if $PKG_CONFIG $pkg_config_args ; then
420 if test "x$target_found" = "xno"; then
421 ifelse([$4],,[AC_MSG_ERROR([Backend $backend not found.])],[$4])
423 ifelse([$3],,[:],[$3])
427 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
428 dnl serial 11 (pkg-config-0.29.1)
430 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
431 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
433 dnl This program is free software; you can redistribute it and/or modify
434 dnl it under the terms of the GNU General Public License as published by
435 dnl the Free Software Foundation; either version 2 of the License, or
436 dnl (at your option) any later version.
438 dnl This program is distributed in the hope that it will be useful, but
439 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
440 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
441 dnl General Public License for more details.
443 dnl You should have received a copy of the GNU General Public License
444 dnl along with this program; if not, write to the Free Software
445 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
448 dnl As a special exception to the GNU General Public License, if you
449 dnl distribute this file as part of a program that contains a
450 dnl configuration script generated by Autoconf, you may include it under
451 dnl the same distribution terms that you use for the rest of that
454 dnl PKG_PREREQ(MIN-VERSION)
455 dnl -----------------------
458 dnl Verify that the version of the pkg-config macros are at least
459 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
460 dnl installed version of pkg-config, this checks the developer's version
461 dnl of pkg.m4 when generating configure.
463 dnl To ensure that this macro is defined, also add:
464 dnl m4_ifndef([PKG_PREREQ],
465 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
467 dnl See the "Since" comment for each macro you use to see what version
468 dnl of the macros you require.
469 m4_defun([PKG_PREREQ],
470 [m4_define([PKG_MACROS_VERSION], [0.29.1])
471 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
472 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
475 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
476 dnl ----------------------------------
479 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
480 dnl first found in the path. Checks that the version of pkg-config found
481 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
482 dnl used since that's the first version where most current features of
483 dnl pkg-config existed.
484 AC_DEFUN([PKG_PROG_PKG_CONFIG],
485 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
486 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
487 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
488 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
489 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
490 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
492 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
493 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
495 if test -n "$PKG_CONFIG"; then
496 _pkg_min_version=m4_default([$1], [0.9.0])
497 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
498 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
505 ])dnl PKG_PROG_PKG_CONFIG
507 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
508 dnl -------------------------------------------------------------------
511 dnl Check to see whether a particular set of modules exists. Similar to
512 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
514 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
515 dnl only at the first occurence in configure.ac, so if the first place
516 dnl it's called might be skipped (such as if it is within an "if", you
517 dnl have to call PKG_CHECK_EXISTS manually
518 AC_DEFUN([PKG_CHECK_EXISTS],
519 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
520 if test -n "$PKG_CONFIG" && \
521 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
522 m4_default([$2], [:])
523 m4_ifvaln([$3], [else
527 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
528 dnl ---------------------------------------------
529 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
530 dnl pkg_failed based on the result.
531 m4_define([_PKG_CONFIG],
532 [if test -n "$$1"; then
534 elif test -n "$PKG_CONFIG"; then
535 PKG_CHECK_EXISTS([$3],
536 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
537 test "x$?" != "x0" && pkg_failed=yes ],
544 dnl _PKG_SHORT_ERRORS_SUPPORTED
545 dnl ---------------------------
546 dnl Internal check to see if pkg-config supports short errors.
547 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
548 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
549 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
550 _pkg_short_errors_supported=yes
552 _pkg_short_errors_supported=no
554 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
557 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
558 dnl [ACTION-IF-NOT-FOUND])
559 dnl --------------------------------------------------------------
562 dnl Note that if there is a possibility the first call to
563 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
564 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
565 AC_DEFUN([PKG_CHECK_MODULES],
566 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
567 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
568 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
571 AC_MSG_CHECKING([for $1])
573 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
574 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
576 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
577 and $1[]_LIBS to avoid the need to call pkg-config.
578 See the pkg-config man page for more details.])
580 if test $pkg_failed = yes; then
582 _PKG_SHORT_ERRORS_SUPPORTED
583 if test $_pkg_short_errors_supported = yes; then
584 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
586 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
588 # Put the nasty error message in config.log where it belongs
589 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
591 m4_default([$4], [AC_MSG_ERROR(
592 [Package requirements ($2) were not met:
596 Consider adjusting the PKG_CONFIG_PATH environment variable if you
597 installed software in a non-standard prefix.
601 elif test $pkg_failed = untried; then
603 m4_default([$4], [AC_MSG_FAILURE(
604 [The pkg-config script could not be found or is too old. Make sure it
605 is in your PATH or set the PKG_CONFIG environment variable to the full
610 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
613 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
614 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
618 ])dnl PKG_CHECK_MODULES
621 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
622 dnl [ACTION-IF-NOT-FOUND])
623 dnl ---------------------------------------------------------------------
626 dnl Checks for existence of MODULES and gathers its build flags with
627 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
628 dnl and VARIABLE-PREFIX_LIBS from --libs.
630 dnl Note that if there is a possibility the first call to
631 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
632 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
634 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
635 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
636 _save_PKG_CONFIG=$PKG_CONFIG
637 PKG_CONFIG="$PKG_CONFIG --static"
638 PKG_CHECK_MODULES($@)
639 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
640 ])dnl PKG_CHECK_MODULES_STATIC
643 dnl PKG_INSTALLDIR([DIRECTORY])
644 dnl -------------------------
647 dnl Substitutes the variable pkgconfigdir as the location where a module
648 dnl should install pkg-config .pc files. By default the directory is
649 dnl $libdir/pkgconfig, but the default can be changed by passing
650 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
652 AC_DEFUN([PKG_INSTALLDIR],
653 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
654 m4_pushdef([pkg_description],
655 [pkg-config installation directory @<:@]pkg_default[@:>@])
656 AC_ARG_WITH([pkgconfigdir],
657 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
658 [with_pkgconfigdir=]pkg_default)
659 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
660 m4_popdef([pkg_default])
661 m4_popdef([pkg_description])
665 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
666 dnl --------------------------------
669 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
670 dnl module should install arch-independent pkg-config .pc files. By
671 dnl default the directory is $datadir/pkgconfig, but the default can be
672 dnl changed by passing DIRECTORY. The user can override through the
673 dnl --with-noarch-pkgconfigdir parameter.
674 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
675 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
676 m4_pushdef([pkg_description],
677 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
678 AC_ARG_WITH([noarch-pkgconfigdir],
679 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
680 [with_noarch_pkgconfigdir=]pkg_default)
681 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
682 m4_popdef([pkg_default])
683 m4_popdef([pkg_description])
684 ])dnl PKG_NOARCH_INSTALLDIR
687 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
688 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
689 dnl -------------------------------------------
692 dnl Retrieves the value of the pkg-config variable for the given module.
693 AC_DEFUN([PKG_CHECK_VAR],
694 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
695 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
697 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
698 AS_VAR_COPY([$1], [pkg_cv_][$1])
700 AS_VAR_IF([$1], [""], [$5], [$4])dnl
703 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
705 # This file is free software; the Free Software Foundation
706 # gives unlimited permission to copy and/or distribute it,
707 # with or without modifications, as long as this notice is preserved.
709 # AM_AUTOMAKE_VERSION(VERSION)
710 # ----------------------------
711 # Automake X.Y traces this macro to ensure aclocal.m4 has been
712 # generated from the m4 files accompanying Automake X.Y.
713 # (This private macro should not be called outside this file.)
714 AC_DEFUN([AM_AUTOMAKE_VERSION],
715 [am__api_version='1.15'
716 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
717 dnl require some minimum version. Point them to the right macro.
718 m4_if([$1], [1.15], [],
719 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
722 # _AM_AUTOCONF_VERSION(VERSION)
723 # -----------------------------
724 # aclocal traces this macro to find the Autoconf version.
725 # This is a private macro too. Using m4_define simplifies
726 # the logic in aclocal, which can simply ignore this definition.
727 m4_define([_AM_AUTOCONF_VERSION], [])
729 # AM_SET_CURRENT_AUTOMAKE_VERSION
730 # -------------------------------
731 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
732 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
733 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
734 [AM_AUTOMAKE_VERSION([1.15])dnl
735 m4_ifndef([AC_AUTOCONF_VERSION],
736 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
737 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
739 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
741 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
743 # This file is free software; the Free Software Foundation
744 # gives unlimited permission to copy and/or distribute it,
745 # with or without modifications, as long as this notice is preserved.
747 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
748 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
749 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
751 # Of course, Automake must honor this variable whenever it calls a
752 # tool from the auxiliary directory. The problem is that $srcdir (and
753 # therefore $ac_aux_dir as well) can be either absolute or relative,
754 # depending on how configure is run. This is pretty annoying, since
755 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
756 # source directory, any form will work fine, but in subdirectories a
757 # relative path needs to be adjusted first.
759 # $ac_aux_dir/missing
760 # fails when called from a subdirectory if $ac_aux_dir is relative
761 # $top_srcdir/$ac_aux_dir/missing
762 # fails if $ac_aux_dir is absolute,
763 # fails when called from a subdirectory in a VPATH build with
764 # a relative $ac_aux_dir
766 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
767 # are both prefixed by $srcdir. In an in-source build this is usually
768 # harmless because $srcdir is '.', but things will broke when you
769 # start a VPATH build or use an absolute $srcdir.
771 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
772 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
773 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
774 # and then we would define $MISSING as
775 # MISSING="\${SHELL} $am_aux_dir/missing"
776 # This will work as long as MISSING is not called from configure, because
777 # unfortunately $(top_srcdir) has no meaning in configure.
778 # However there are other variables, like CC, which are often used in
779 # configure, and could therefore not use this "fixed" $ac_aux_dir.
781 # Another solution, used here, is to always expand $ac_aux_dir to an
782 # absolute PATH. The drawback is that using absolute paths prevent a
783 # configured tree to be moved without reconfiguration.
785 AC_DEFUN([AM_AUX_DIR_EXPAND],
786 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
787 # Expand $ac_aux_dir to an absolute path.
788 am_aux_dir=`cd "$ac_aux_dir" && pwd`
791 # AM_CONDITIONAL -*- Autoconf -*-
793 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
795 # This file is free software; the Free Software Foundation
796 # gives unlimited permission to copy and/or distribute it,
797 # with or without modifications, as long as this notice is preserved.
799 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
800 # -------------------------------------
801 # Define a conditional.
802 AC_DEFUN([AM_CONDITIONAL],
803 [AC_PREREQ([2.52])dnl
804 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
805 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
806 AC_SUBST([$1_TRUE])dnl
807 AC_SUBST([$1_FALSE])dnl
808 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
809 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
810 m4_define([_AM_COND_VALUE_$1], [$2])dnl
818 AC_CONFIG_COMMANDS_PRE(
819 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
820 AC_MSG_ERROR([[conditional "$1" was never defined.
821 Usually this means the macro was only invoked conditionally.]])
824 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
826 # This file is free software; the Free Software Foundation
827 # gives unlimited permission to copy and/or distribute it,
828 # with or without modifications, as long as this notice is preserved.
831 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
832 # written in clear, in which case automake, when reading aclocal.m4,
833 # will think it sees a *use*, and therefore will trigger all it's
834 # C support machinery. Also note that it means that autoscan, seeing
835 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
838 # _AM_DEPENDENCIES(NAME)
839 # ----------------------
840 # See how the compiler implements dependency checking.
841 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
842 # We try a few techniques and use that to set a single cache variable.
844 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
845 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
846 # dependency, and given that the user is not expected to run this macro,
847 # just rely on AC_PROG_CC.
848 AC_DEFUN([_AM_DEPENDENCIES],
849 [AC_REQUIRE([AM_SET_DEPDIR])dnl
850 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
851 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
852 AC_REQUIRE([AM_DEP_TRACK])dnl
854 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
855 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
856 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
857 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
858 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
859 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
860 [depcc="$$1" am_compiler_list=])
862 AC_CACHE_CHECK([dependency style of $depcc],
863 [am_cv_$1_dependencies_compiler_type],
864 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
865 # We make a subdir and do the tests there. Otherwise we can end up
866 # making bogus files that we don't know about and never remove. For
867 # instance it was reported that on HP-UX the gcc test will end up
868 # making a dummy file named 'D' -- because '-MD' means "put the output
872 # Copy depcomp to subdir because otherwise we won't find it if we're
873 # using a relative directory.
874 cp "$am_depcomp" conftest.dir
876 # We will build objects and dependencies in a subdirectory because
877 # it helps to detect inapplicable dependency modes. For instance
878 # both Tru64's cc and ICC support -MD to output dependencies as a
879 # side effect of compilation, but ICC will put the dependencies in
880 # the current directory while Tru64 will put them in the object
884 am_cv_$1_dependencies_compiler_type=none
885 if test "$am_compiler_list" = ""; then
886 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
890 [case " $depcc " in #(
891 *\ -arch\ *\ -arch\ *) am__universal=true ;;
894 [case " $depcc " in #(
895 *\ -arch\ *\ -arch\ *) am__universal=true ;;
898 for depmode in $am_compiler_list; do
899 # Setup a source with many dependencies, because some compilers
900 # like to wrap large dependency lists on column 80 (with \), and
901 # we should not choose a depcomp mode which is confused by this.
903 # We need to recreate these files for each test, as the compiler may
904 # overwrite some of them when testing with obscure command lines.
905 # This happens at least with the AIX C compiler.
907 for i in 1 2 3 4 5 6; do
908 echo '#include "conftst'$i'.h"' >> sub/conftest.c
909 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
910 # Solaris 10 /bin/sh.
911 echo '/* dummy */' > sub/conftst$i.h
913 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
915 # We check with '-c' and '-o' for the sake of the "dashmstdout"
916 # mode. It turns out that the SunPro C++ compiler does not properly
917 # handle '-M -o', and we need to detect this. Also, some Intel
918 # versions had trouble with output in subdirs.
919 am__obj=sub/conftest.${OBJEXT-o}
920 am__minus_obj="-o $am__obj"
923 # This depmode causes a compiler race in universal mode.
924 test "$am__universal" = false || continue
927 # After this tag, mechanisms are not by side-effect, so they'll
928 # only be used when explicitly requested.
929 if test "x$enable_dependency_tracking" = xyes; then
935 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
936 # This compiler won't grok '-c -o', but also, the minuso test has
937 # not run yet. These depmodes are late enough in the game, and
938 # so weak that their functioning should not be impacted.
939 am__obj=conftest.${OBJEXT-o}
944 if depmode=$depmode \
945 source=sub/conftest.c object=$am__obj \
946 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
947 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
948 >/dev/null 2>conftest.err &&
949 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
950 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
951 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
952 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
953 # icc doesn't choke on unknown options, it will just issue warnings
954 # or remarks (even with -Werror). So we grep stderr for any message
955 # that says an option was ignored or not supported.
956 # When given -MP, icc 7.0 and 7.1 complain thusly:
957 # icc: Command line warning: ignoring option '-M'; no argument required
958 # The diagnosis changed in icc 8.0:
959 # icc: Command line remark: option '-MP' not supported
960 if (grep 'ignoring option' conftest.err ||
961 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
962 am_cv_$1_dependencies_compiler_type=$depmode
971 am_cv_$1_dependencies_compiler_type=none
974 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
975 AM_CONDITIONAL([am__fastdep$1], [
976 test "x$enable_dependency_tracking" != xno \
977 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
983 # Choose a directory name for dependency files.
984 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
985 AC_DEFUN([AM_SET_DEPDIR],
986 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
987 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
993 AC_DEFUN([AM_DEP_TRACK],
994 [AC_ARG_ENABLE([dependency-tracking], [dnl
996 [--enable-dependency-tracking],
997 [do not reject slow dependency extractors])
999 [--disable-dependency-tracking],
1000 [speeds up one-time build])])
1001 if test "x$enable_dependency_tracking" != xno; then
1002 am_depcomp="$ac_aux_dir/depcomp"
1006 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1007 AC_SUBST([AMDEPBACKSLASH])dnl
1008 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1009 AC_SUBST([am__nodep])dnl
1010 _AM_SUBST_NOTMAKE([am__nodep])dnl
1013 # Generate code to set up dependency tracking. -*- Autoconf -*-
1015 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
1017 # This file is free software; the Free Software Foundation
1018 # gives unlimited permission to copy and/or distribute it,
1019 # with or without modifications, as long as this notice is preserved.
1022 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1023 # ------------------------------
1024 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1026 # Older Autoconf quotes --file arguments for eval, but not when files
1027 # are listed without --file. Let's play safe and only enable the eval
1028 # if we detect the quoting.
1029 case $CONFIG_FILES in
1030 *\'*) eval set x "$CONFIG_FILES" ;;
1031 *) set x $CONFIG_FILES ;;
1036 # Strip MF so we end up with the name of the file.
1037 mf=`echo "$mf" | sed -e 's/:.*$//'`
1038 # Check whether this is an Automake generated Makefile or not.
1039 # We used to match only the files named 'Makefile.in', but
1040 # some people rename them; so instead we look at the file content.
1041 # Grep'ing the first line is not enough: some people post-process
1042 # each Makefile.in and add a new line on top of each file to say so.
1043 # Grep'ing the whole file is not good either: AIX grep has a line
1044 # limit of 2048, but all sed's we know have understand at least 4000.
1045 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1046 dirpart=`AS_DIRNAME("$mf")`
1050 # Extract the definition of DEPDIR, am__include, and am__quote
1051 # from the Makefile without running 'make'.
1052 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1053 test -z "$DEPDIR" && continue
1054 am__include=`sed -n 's/^am__include = //p' < "$mf"`
1055 test -z "$am__include" && continue
1056 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1057 # Find all dependency output files, they are included files with
1058 # $(DEPDIR) in their names. We invoke sed twice because it is the
1059 # simplest approach to changing $(DEPDIR) to its actual value in the
1061 for file in `sed -n "
1062 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1063 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1064 # Make sure the directory exists.
1065 test -f "$dirpart/$file" && continue
1066 fdir=`AS_DIRNAME(["$file"])`
1067 AS_MKDIR_P([$dirpart/$fdir])
1068 # echo "creating $dirpart/$file"
1069 echo '# dummy' > "$dirpart/$file"
1073 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1076 # AM_OUTPUT_DEPENDENCY_COMMANDS
1077 # -----------------------------
1078 # This macro should only be invoked once -- use via AC_REQUIRE.
1080 # This code is only required when automatic dependency tracking
1081 # is enabled. FIXME. This creates each '.P' file that we will
1082 # need in order to bootstrap the dependency handling code.
1083 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1084 [AC_CONFIG_COMMANDS([depfiles],
1085 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1086 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1089 # Do all the work for Automake. -*- Autoconf -*-
1091 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
1093 # This file is free software; the Free Software Foundation
1094 # gives unlimited permission to copy and/or distribute it,
1095 # with or without modifications, as long as this notice is preserved.
1097 # This macro actually does too much. Some checks are only needed if
1098 # your package does certain things. But this isn't really a big deal.
1100 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
1101 m4_define([AC_PROG_CC],
1102 m4_defn([AC_PROG_CC])
1106 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1107 # AM_INIT_AUTOMAKE([OPTIONS])
1108 # -----------------------------------------------
1109 # The call with PACKAGE and VERSION arguments is the old style
1110 # call (pre autoconf-2.50), which is being phased out. PACKAGE
1111 # and VERSION should now be passed to AC_INIT and removed from
1112 # the call to AM_INIT_AUTOMAKE.
1113 # We support both call styles for the transition. After
1114 # the next Automake release, Autoconf can make the AC_INIT
1115 # arguments mandatory, and then we can depend on a new Autoconf
1116 # release and drop the old call support.
1117 AC_DEFUN([AM_INIT_AUTOMAKE],
1118 [AC_PREREQ([2.65])dnl
1119 dnl Autoconf wants to disallow AM_ names. We explicitly allow
1120 dnl the ones we care about.
1121 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1122 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1123 AC_REQUIRE([AC_PROG_INSTALL])dnl
1124 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1125 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1126 # is not polluted with repeated "-I."
1127 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1128 # test to see if srcdir already configured
1129 if test -f $srcdir/config.status; then
1130 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1134 # test whether we have cygpath
1135 if test -z "$CYGPATH_W"; then
1136 if (cygpath --version) >/dev/null 2>/dev/null; then
1137 CYGPATH_W='cygpath -w'
1142 AC_SUBST([CYGPATH_W])
1144 # Define the identity of the package.
1145 dnl Distinguish between old-style and new-style calls.
1147 [AC_DIAGNOSE([obsolete],
1148 [$0: two- and three-arguments forms are deprecated.])
1149 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1150 AC_SUBST([PACKAGE], [$1])dnl
1151 AC_SUBST([VERSION], [$2])],
1152 [_AM_SET_OPTIONS([$1])dnl
1153 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1155 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1157 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1158 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1159 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1161 _AM_IF_OPTION([no-define],,
1162 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1163 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1165 # Some tools Automake needs.
1166 AC_REQUIRE([AM_SANITY_CHECK])dnl
1167 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1168 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1169 AM_MISSING_PROG([AUTOCONF], [autoconf])
1170 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1171 AM_MISSING_PROG([AUTOHEADER], [autoheader])
1172 AM_MISSING_PROG([MAKEINFO], [makeinfo])
1173 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1174 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1175 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1176 # For better backward compatibility. To be removed once Automake 1.9.x
1177 # dies out for good. For more background, see:
1178 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1179 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1180 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1181 # We need awk for the "check" target (and possibly the TAP driver). The
1182 # system "awk" is bad on some platforms.
1183 AC_REQUIRE([AC_PROG_AWK])dnl
1184 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1185 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1186 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1187 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1188 [_AM_PROG_TAR([v7])])])
1189 _AM_IF_OPTION([no-dependencies],,
1190 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1191 [_AM_DEPENDENCIES([CC])],
1192 [m4_define([AC_PROG_CC],
1193 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1194 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1195 [_AM_DEPENDENCIES([CXX])],
1196 [m4_define([AC_PROG_CXX],
1197 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1198 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1199 [_AM_DEPENDENCIES([OBJC])],
1200 [m4_define([AC_PROG_OBJC],
1201 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1202 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1203 [_AM_DEPENDENCIES([OBJCXX])],
1204 [m4_define([AC_PROG_OBJCXX],
1205 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1207 AC_REQUIRE([AM_SILENT_RULES])dnl
1208 dnl The testsuite driver may need to know about EXEEXT, so add the
1209 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
1210 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1211 AC_CONFIG_COMMANDS_PRE(dnl
1212 [m4_provide_if([_AM_COMPILER_EXEEXT],
1213 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1215 # POSIX will say in a future version that running "rm -f" with no argument
1216 # is OK; and we want to be able to make that assumption in our Makefile
1217 # recipes. So use an aggressive probe to check that the usage we want is
1218 # actually supported "in the wild" to an acceptable degree.
1219 # See automake bug#10828.
1220 # To make any issue more visible, cause the running configure to be aborted
1221 # by default if the 'rm' program in use doesn't match our expectations; the
1222 # user can still override this though.
1223 if rm -f && rm -fr && rm -rf; then : OK; else
1227 Your 'rm' program seems unable to run without file operands specified
1228 on the command line, even when the '-f' option is present. This is contrary
1229 to the behaviour of most rm programs out there, and not conforming with
1230 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
1232 Please tell bug-automake@gnu.org about your system, including the value
1233 of your $PATH and any error possibly output before this message. This
1234 can help us improve future automake versions.
1237 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
1238 echo 'Configuration will proceed anyway, since you have set the' >&2
1239 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
1243 Aborting the configuration process, to ensure you take notice of the issue.
1245 You can download and install GNU coreutils to get an 'rm' implementation
1246 that behaves properly: <http://www.gnu.org/software/coreutils/>.
1248 If you want to complete the configuration process using your problematic
1249 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
1250 to "yes", and re-run configure.
1253 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
1256 dnl The trailing newline in this macro's definition is deliberate, for
1257 dnl backward compatibility and to allow trailing 'dnl'-style comments
1258 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1261 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
1262 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1263 dnl mangled by Autoconf and run in a shell conditional statement.
1264 m4_define([_AC_COMPILER_EXEEXT],
1265 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1267 # When config.status generates a header, we must update the stamp-h file.
1268 # This file resides in the same directory as the config header
1269 # that is generated. The stamp files are numbered to have different names.
1271 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1272 # loop where config.status creates the headers, so we can generate
1273 # our stamp files there.
1274 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1275 [# Compute $1's index in $config_headers.
1278 for _am_header in $config_headers :; do
1280 $_am_arg | $_am_arg:* )
1283 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1286 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1288 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1290 # This file is free software; the Free Software Foundation
1291 # gives unlimited permission to copy and/or distribute it,
1292 # with or without modifications, as long as this notice is preserved.
1294 # AM_PROG_INSTALL_SH
1295 # ------------------
1296 # Define $install_sh.
1297 AC_DEFUN([AM_PROG_INSTALL_SH],
1298 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1299 if test x"${install_sh+set}" != xset; then
1302 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1304 install_sh="\${SHELL} $am_aux_dir/install-sh"
1307 AC_SUBST([install_sh])])
1309 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
1311 # This file is free software; the Free Software Foundation
1312 # gives unlimited permission to copy and/or distribute it,
1313 # with or without modifications, as long as this notice is preserved.
1315 # Check whether the underlying file-system supports filenames
1316 # with a leading dot. For instance MS-DOS doesn't.
1317 AC_DEFUN([AM_SET_LEADING_DOT],
1318 [rm -rf .tst 2>/dev/null
1319 mkdir .tst 2>/dev/null
1320 if test -d .tst; then
1325 rmdir .tst 2>/dev/null
1326 AC_SUBST([am__leading_dot])])
1328 # Check to see how 'make' treats includes. -*- Autoconf -*-
1330 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1332 # This file is free software; the Free Software Foundation
1333 # gives unlimited permission to copy and/or distribute it,
1334 # with or without modifications, as long as this notice is preserved.
1338 # Check to see how make treats includes.
1339 AC_DEFUN([AM_MAKE_INCLUDE],
1340 [am_make=${MAKE-make}
1341 cat > confinc << 'END'
1343 @echo this is the am__doit target
1346 # If we don't find an include directive, just comment out the code.
1347 AC_MSG_CHECKING([for style of include used by $am_make])
1351 # First try GNU make style include.
1352 echo "include confinc" > confmf
1353 # Ignore all kinds of additional output from 'make'.
1354 case `$am_make -s -f confmf 2> /dev/null` in #(
1355 *the\ am__doit\ target*)
1361 # Now try BSD make style include.
1362 if test "$am__include" = "#"; then
1363 echo '.include "confinc"' > confmf
1364 case `$am_make -s -f confmf 2> /dev/null` in #(
1365 *the\ am__doit\ target*)
1366 am__include=.include
1372 AC_SUBST([am__include])
1373 AC_SUBST([am__quote])
1374 AC_MSG_RESULT([$_am_result])
1375 rm -f confinc confmf
1378 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
1380 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
1382 # This file is free software; the Free Software Foundation
1383 # gives unlimited permission to copy and/or distribute it,
1384 # with or without modifications, as long as this notice is preserved.
1386 # AM_MISSING_PROG(NAME, PROGRAM)
1387 # ------------------------------
1388 AC_DEFUN([AM_MISSING_PROG],
1389 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1390 $1=${$1-"${am_missing_run}$2"}
1393 # AM_MISSING_HAS_RUN
1394 # ------------------
1395 # Define MISSING if not defined so far and test if it is modern enough.
1396 # If it is, set am_missing_run to use it, otherwise, to nothing.
1397 AC_DEFUN([AM_MISSING_HAS_RUN],
1398 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1399 AC_REQUIRE_AUX_FILE([missing])dnl
1400 if test x"${MISSING+set}" != xset; then
1403 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1405 MISSING="\${SHELL} $am_aux_dir/missing" ;;
1408 # Use eval to expand $SHELL
1409 if eval "$MISSING --is-lightweight"; then
1410 am_missing_run="$MISSING "
1413 AC_MSG_WARN(['missing' script is too old or missing])
1417 # Helper functions for option handling. -*- Autoconf -*-
1419 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1421 # This file is free software; the Free Software Foundation
1422 # gives unlimited permission to copy and/or distribute it,
1423 # with or without modifications, as long as this notice is preserved.
1425 # _AM_MANGLE_OPTION(NAME)
1426 # -----------------------
1427 AC_DEFUN([_AM_MANGLE_OPTION],
1428 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1430 # _AM_SET_OPTION(NAME)
1431 # --------------------
1432 # Set option NAME. Presently that only means defining a flag for this option.
1433 AC_DEFUN([_AM_SET_OPTION],
1434 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1436 # _AM_SET_OPTIONS(OPTIONS)
1437 # ------------------------
1438 # OPTIONS is a space-separated list of Automake options.
1439 AC_DEFUN([_AM_SET_OPTIONS],
1440 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1442 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1443 # -------------------------------------------
1444 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1445 AC_DEFUN([_AM_IF_OPTION],
1446 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1448 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
1450 # This file is free software; the Free Software Foundation
1451 # gives unlimited permission to copy and/or distribute it,
1452 # with or without modifications, as long as this notice is preserved.
1456 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
1457 # to automatically call this.
1458 AC_DEFUN([_AM_PROG_CC_C_O],
1459 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1460 AC_REQUIRE_AUX_FILE([compile])dnl
1461 AC_LANG_PUSH([C])dnl
1463 [whether $CC understands -c and -o together],
1464 [am_cv_prog_cc_c_o],
1465 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
1466 # Make sure it works both with $CC and with simple cc.
1467 # Following AC_PROG_CC_C_O, we do the test twice because some
1468 # compilers refuse to overwrite an existing .o file with -o,
1469 # though they will create one.
1470 am_cv_prog_cc_c_o=yes
1472 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
1473 && test -f conftest2.$ac_objext; then
1476 am_cv_prog_cc_c_o=no
1480 rm -f core conftest*
1482 if test "$am_cv_prog_cc_c_o" != yes; then
1483 # Losing compiler, so override with the script.
1484 # FIXME: It is wrong to rewrite CC.
1485 # But if we don't then we get into trouble of one sort or another.
1486 # A longer-term fix would be to have automake use am__CC in this case,
1487 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1488 CC="$am_aux_dir/compile $CC"
1492 # For backward compatibility.
1493 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1495 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1497 # This file is free software; the Free Software Foundation
1498 # gives unlimited permission to copy and/or distribute it,
1499 # with or without modifications, as long as this notice is preserved.
1501 # AM_RUN_LOG(COMMAND)
1502 # -------------------
1503 # Run COMMAND, save the exit status in ac_status, and log it.
1504 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1505 AC_DEFUN([AM_RUN_LOG],
1506 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1507 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1509 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1510 (exit $ac_status); }])
1512 # Check to make sure that the build environment is sane. -*- Autoconf -*-
1514 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
1516 # This file is free software; the Free Software Foundation
1517 # gives unlimited permission to copy and/or distribute it,
1518 # with or without modifications, as long as this notice is preserved.
1522 AC_DEFUN([AM_SANITY_CHECK],
1523 [AC_MSG_CHECKING([whether build environment is sane])
1524 # Reject unsafe characters in $srcdir or the absolute working directory
1525 # name. Accept space and tab only in the latter.
1529 *[[\\\"\#\$\&\'\`$am_lf]]*)
1530 AC_MSG_ERROR([unsafe absolute working directory name]);;
1533 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
1534 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1537 # Do 'set' in a subshell so we don't clobber the current shell's
1538 # arguments. Must try -L first in case configure is actually a
1539 # symlink; some systems play weird games with the mod time of symlinks
1540 # (eg FreeBSD returns the mod time of the symlink's containing
1544 for am_try in 1 2; do
1545 echo "timestamp, slept: $am_has_slept" > conftest.file
1546 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1547 if test "$[*]" = "X"; then
1549 set X `ls -t "$srcdir/configure" conftest.file`
1551 if test "$[*]" != "X $srcdir/configure conftest.file" \
1552 && test "$[*]" != "X conftest.file $srcdir/configure"; then
1554 # If neither matched, then we have a broken ls. This can happen
1555 # if, for instance, CONFIG_SHELL is bash and it inherits a
1556 # broken ls alias from the environment. This has actually
1557 # happened. Such a system could not be considered "sane".
1558 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1559 alias in your environment])
1561 if test "$[2]" = conftest.file || test $am_try -eq 2; then
1568 test "$[2]" = conftest.file
1574 AC_MSG_ERROR([newly created file is older than distributed files!
1575 Check your system clock])
1577 AC_MSG_RESULT([yes])
1578 # If we didn't sleep, we still need to ensure time stamps of config.status and
1579 # generated files are strictly newer.
1581 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
1585 AC_CONFIG_COMMANDS_PRE(
1586 [AC_MSG_CHECKING([that generated files are newer than configure])
1587 if test -n "$am_sleep_pid"; then
1588 # Hide warnings about reused PIDs.
1589 wait $am_sleep_pid 2>/dev/null
1591 AC_MSG_RESULT([done])])
1595 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
1597 # This file is free software; the Free Software Foundation
1598 # gives unlimited permission to copy and/or distribute it,
1599 # with or without modifications, as long as this notice is preserved.
1601 # AM_SILENT_RULES([DEFAULT])
1602 # --------------------------
1603 # Enable less verbose build rules; with the default set to DEFAULT
1604 # ("yes" being less verbose, "no" or empty being verbose).
1605 AC_DEFUN([AM_SILENT_RULES],
1606 [AC_ARG_ENABLE([silent-rules], [dnl
1608 [--enable-silent-rules],
1609 [less verbose build output (undo: "make V=1")])
1611 [--disable-silent-rules],
1612 [verbose build output (undo: "make V=0")])dnl
1614 case $enable_silent_rules in @%:@ (((
1615 yes) AM_DEFAULT_VERBOSITY=0;;
1616 no) AM_DEFAULT_VERBOSITY=1;;
1617 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1620 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1621 dnl do not support nested variable expansions.
1622 dnl See automake bug#9928 and bug#10237.
1623 am_make=${MAKE-make}
1624 AC_CACHE_CHECK([whether $am_make supports nested variables],
1625 [am_cv_make_support_nested_variables],
1626 [if AS_ECHO([['TRUE=$(BAR$(V))
1632 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1633 am_cv_make_support_nested_variables=yes
1635 am_cv_make_support_nested_variables=no
1637 if test $am_cv_make_support_nested_variables = yes; then
1638 dnl Using '$V' instead of '$(V)' breaks IRIX make.
1640 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1642 AM_V=$AM_DEFAULT_VERBOSITY
1643 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1646 AM_SUBST_NOTMAKE([AM_V])dnl
1647 AC_SUBST([AM_DEFAULT_V])dnl
1648 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1649 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1651 AC_SUBST([AM_BACKSLASH])dnl
1652 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1655 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
1657 # This file is free software; the Free Software Foundation
1658 # gives unlimited permission to copy and/or distribute it,
1659 # with or without modifications, as long as this notice is preserved.
1661 # AM_PROG_INSTALL_STRIP
1662 # ---------------------
1663 # One issue with vendor 'install' (even GNU) is that you can't
1664 # specify the program used to strip binaries. This is especially
1665 # annoying in cross-compiling environments, where the build's strip
1666 # is unlikely to handle the host's binaries.
1667 # Fortunately install-sh will honor a STRIPPROG variable, so we
1668 # always use install-sh in "make install-strip", and initialize
1669 # STRIPPROG with the value of the STRIP variable (set by the user).
1670 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1671 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1672 # Installed binaries are usually stripped using 'strip' when the user
1673 # run "make install-strip". However 'strip' might not be the right
1674 # tool to use in cross-compilation environments, therefore Automake
1675 # will honor the 'STRIP' environment variable to overrule this program.
1676 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1677 if test "$cross_compiling" != no; then
1678 AC_CHECK_TOOL([STRIP], [strip], :)
1680 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1681 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1683 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
1685 # This file is free software; the Free Software Foundation
1686 # gives unlimited permission to copy and/or distribute it,
1687 # with or without modifications, as long as this notice is preserved.
1689 # _AM_SUBST_NOTMAKE(VARIABLE)
1690 # ---------------------------
1691 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1692 # This macro is traced by Automake.
1693 AC_DEFUN([_AM_SUBST_NOTMAKE])
1695 # AM_SUBST_NOTMAKE(VARIABLE)
1696 # --------------------------
1697 # Public sister of _AM_SUBST_NOTMAKE.
1698 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1700 # Check how to create a tarball. -*- Autoconf -*-
1702 # Copyright (C) 2004-2014 Free Software Foundation, Inc.
1704 # This file is free software; the Free Software Foundation
1705 # gives unlimited permission to copy and/or distribute it,
1706 # with or without modifications, as long as this notice is preserved.
1708 # _AM_PROG_TAR(FORMAT)
1709 # --------------------
1710 # Check how to create a tarball in format FORMAT.
1711 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
1713 # Substitute a variable $(am__tar) that is a command
1714 # writing to stdout a FORMAT-tarball containing the directory
1716 # tardir=directory && $(am__tar) > result.tar
1718 # Substitute a variable $(am__untar) that extract such
1719 # a tarball read from stdin.
1720 # $(am__untar) < result.tar
1722 AC_DEFUN([_AM_PROG_TAR],
1723 [# Always define AMTAR for backward compatibility. Yes, it's still used
1724 # in the wild :-( We should find a proper way to deprecate it ...
1725 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1727 # We'll loop over all known methods to create a tar archive until one works.
1728 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1731 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1735 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1736 # There is notably a 21 bits limit for the UID and the GID. In fact,
1737 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1739 am_max_uid=2097151 # 2^21 - 1
1740 am_max_gid=$am_max_uid
1741 # The $UID and $GID variables are not portable, so we need to resort
1742 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
1743 # below are definitely unexpected, so allow the users to see them
1744 # (that is, avoid stderr redirection).
1745 am_uid=`id -u || echo unknown`
1746 am_gid=`id -g || echo unknown`
1747 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1748 if test $am_uid -le $am_max_uid; then
1749 AC_MSG_RESULT([yes])
1754 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1755 if test $am_gid -le $am_max_gid; then
1756 AC_MSG_RESULT([yes])
1765 [m4_fatal([Unknown tar format])])
1767 AC_MSG_CHECKING([how to create a $1 tar archive])
1769 # Go ahead even if we have the value already cached. We do so because we
1770 # need to set the values for the 'am__tar' and 'am__untar' variables.
1771 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1773 for _am_tool in $_am_tools; do
1776 for _am_tar in tar gnutar gtar; do
1777 AM_RUN_LOG([$_am_tar --version]) && break
1779 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1780 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1781 am__untar="$_am_tar -xf -"
1784 # Must skip GNU tar: if it does not support --format= it doesn't create
1785 # ustar tarball either.
1786 (tar --version) >/dev/null 2>&1 && continue
1787 am__tar='tar chf - "$$tardir"'
1788 am__tar_='tar chf - "$tardir"'
1789 am__untar='tar xf -'
1792 am__tar='pax -L -x $1 -w "$$tardir"'
1793 am__tar_='pax -L -x $1 -w "$tardir"'
1797 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1798 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1799 am__untar='cpio -i -H $1 -d'
1808 # If the value was cached, stop now. We just wanted to have am__tar
1809 # and am__untar set.
1810 test -n "${am_cv_prog_tar_$1}" && break
1812 # tar/untar a dummy directory, and stop if the command works.
1815 echo GrepMe > conftest.dir/file
1816 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1818 if test -s conftest.tar; then
1819 AM_RUN_LOG([$am__untar <conftest.tar])
1820 AM_RUN_LOG([cat conftest.dir/file])
1821 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1826 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1827 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1830 AC_SUBST([am__untar])