17ec3b29aSmrg# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
232001f49Smrg
37ec3b29aSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
432001f49Smrg
532001f49Smrg# This file is free software; the Free Software Foundation
632001f49Smrg# gives unlimited permission to copy and/or distribute it,
732001f49Smrg# with or without modifications, as long as this notice is preserved.
832001f49Smrg
932001f49Smrg# This program is distributed in the hope that it will be useful,
1032001f49Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1132001f49Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1232001f49Smrg# PARTICULAR PURPOSE.
1332001f49Smrg
1432001f49Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
1532001f49Smrgm4_ifndef([AC_AUTOCONF_VERSION],
1632001f49Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1732001f49Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
1832001f49Smrg[m4_warning([this file was generated for autoconf 2.69.
1932001f49SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
2032001f49SmrgIf you have problems, you may need to regenerate the build system entirely.
2132001f49SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
2232001f49Smrg
237ec3b29aSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
247ec3b29aSmrgdnl serial 11 (pkg-config-0.29)
257ec3b29aSmrgdnl
267ec3b29aSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
277ec3b29aSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
287ec3b29aSmrgdnl
297ec3b29aSmrgdnl This program is free software; you can redistribute it and/or modify
307ec3b29aSmrgdnl it under the terms of the GNU General Public License as published by
317ec3b29aSmrgdnl the Free Software Foundation; either version 2 of the License, or
327ec3b29aSmrgdnl (at your option) any later version.
337ec3b29aSmrgdnl
347ec3b29aSmrgdnl This program is distributed in the hope that it will be useful, but
357ec3b29aSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
367ec3b29aSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
377ec3b29aSmrgdnl General Public License for more details.
387ec3b29aSmrgdnl
397ec3b29aSmrgdnl You should have received a copy of the GNU General Public License
407ec3b29aSmrgdnl along with this program; if not, write to the Free Software
417ec3b29aSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
427ec3b29aSmrgdnl 02111-1307, USA.
437ec3b29aSmrgdnl
447ec3b29aSmrgdnl As a special exception to the GNU General Public License, if you
457ec3b29aSmrgdnl distribute this file as part of a program that contains a
467ec3b29aSmrgdnl configuration script generated by Autoconf, you may include it under
477ec3b29aSmrgdnl the same distribution terms that you use for the rest of that
487ec3b29aSmrgdnl program.
497ec3b29aSmrg
507ec3b29aSmrgdnl PKG_PREREQ(MIN-VERSION)
517ec3b29aSmrgdnl -----------------------
527ec3b29aSmrgdnl Since: 0.29
537ec3b29aSmrgdnl
547ec3b29aSmrgdnl Verify that the version of the pkg-config macros are at least
557ec3b29aSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
567ec3b29aSmrgdnl installed version of pkg-config, this checks the developer's version
577ec3b29aSmrgdnl of pkg.m4 when generating configure.
587ec3b29aSmrgdnl
597ec3b29aSmrgdnl To ensure that this macro is defined, also add:
607ec3b29aSmrgdnl m4_ifndef([PKG_PREREQ],
617ec3b29aSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
627ec3b29aSmrgdnl
637ec3b29aSmrgdnl See the "Since" comment for each macro you use to see what version
647ec3b29aSmrgdnl of the macros you require.
657ec3b29aSmrgm4_defun([PKG_PREREQ],
667ec3b29aSmrg[m4_define([PKG_MACROS_VERSION], [0.29])
677ec3b29aSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
687ec3b29aSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
697ec3b29aSmrg])dnl PKG_PREREQ
707ec3b29aSmrg
717ec3b29aSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
727ec3b29aSmrgdnl ----------------------------------
737ec3b29aSmrgdnl Since: 0.16
747ec3b29aSmrgdnl
757ec3b29aSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
767ec3b29aSmrgdnl first found in the path. Checks that the version of pkg-config found
777ec3b29aSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
787ec3b29aSmrgdnl used since that's the first version where most current features of
797ec3b29aSmrgdnl pkg-config existed.
8032001f49SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8132001f49Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8232001f49Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
8332001f49Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
8432001f49SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
8532001f49SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
8632001f49SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
8732001f49Smrg
8832001f49Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8932001f49Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9032001f49Smrgfi
9132001f49Smrgif test -n "$PKG_CONFIG"; then
9232001f49Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
9332001f49Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9432001f49Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9532001f49Smrg		AC_MSG_RESULT([yes])
9632001f49Smrg	else
9732001f49Smrg		AC_MSG_RESULT([no])
9832001f49Smrg		PKG_CONFIG=""
9932001f49Smrg	fi
10032001f49Smrgfi[]dnl
1017ec3b29aSmrg])dnl PKG_PROG_PKG_CONFIG
10232001f49Smrg
1037ec3b29aSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1047ec3b29aSmrgdnl -------------------------------------------------------------------
1057ec3b29aSmrgdnl Since: 0.18
1067ec3b29aSmrgdnl
1077ec3b29aSmrgdnl Check to see whether a particular set of modules exists. Similar to
1087ec3b29aSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
1097ec3b29aSmrgdnl
1107ec3b29aSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1117ec3b29aSmrgdnl only at the first occurence in configure.ac, so if the first place
1127ec3b29aSmrgdnl it's called might be skipped (such as if it is within an "if", you
1137ec3b29aSmrgdnl have to call PKG_CHECK_EXISTS manually
11432001f49SmrgAC_DEFUN([PKG_CHECK_EXISTS],
11532001f49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
11632001f49Smrgif test -n "$PKG_CONFIG" && \
11732001f49Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
11832001f49Smrg  m4_default([$2], [:])
11932001f49Smrgm4_ifvaln([$3], [else
12032001f49Smrg  $3])dnl
12132001f49Smrgfi])
12232001f49Smrg
1237ec3b29aSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1247ec3b29aSmrgdnl ---------------------------------------------
1257ec3b29aSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1267ec3b29aSmrgdnl pkg_failed based on the result.
12732001f49Smrgm4_define([_PKG_CONFIG],
12832001f49Smrg[if test -n "$$1"; then
12932001f49Smrg    pkg_cv_[]$1="$$1"
13032001f49Smrg elif test -n "$PKG_CONFIG"; then
13132001f49Smrg    PKG_CHECK_EXISTS([$3],
13232001f49Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
13332001f49Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
13432001f49Smrg		     [pkg_failed=yes])
13532001f49Smrg else
13632001f49Smrg    pkg_failed=untried
13732001f49Smrgfi[]dnl
1387ec3b29aSmrg])dnl _PKG_CONFIG
13932001f49Smrg
1407ec3b29aSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
1417ec3b29aSmrgdnl ---------------------------
1427ec3b29aSmrgdnl Internal check to see if pkg-config supports short errors.
14332001f49SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
14432001f49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
14532001f49Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
14632001f49Smrg        _pkg_short_errors_supported=yes
14732001f49Smrgelse
14832001f49Smrg        _pkg_short_errors_supported=no
14932001f49Smrgfi[]dnl
1507ec3b29aSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
15132001f49Smrg
15232001f49Smrg
1537ec3b29aSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1547ec3b29aSmrgdnl   [ACTION-IF-NOT-FOUND])
1557ec3b29aSmrgdnl --------------------------------------------------------------
1567ec3b29aSmrgdnl Since: 0.4.0
1577ec3b29aSmrgdnl
1587ec3b29aSmrgdnl Note that if there is a possibility the first call to
1597ec3b29aSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
1607ec3b29aSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
16132001f49SmrgAC_DEFUN([PKG_CHECK_MODULES],
16232001f49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
16332001f49SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
16432001f49SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
16532001f49Smrg
16632001f49Smrgpkg_failed=no
16732001f49SmrgAC_MSG_CHECKING([for $1])
16832001f49Smrg
16932001f49Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
17032001f49Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
17132001f49Smrg
17232001f49Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
17332001f49Smrgand $1[]_LIBS to avoid the need to call pkg-config.
17432001f49SmrgSee the pkg-config man page for more details.])
17532001f49Smrg
17632001f49Smrgif test $pkg_failed = yes; then
17732001f49Smrg   	AC_MSG_RESULT([no])
17832001f49Smrg        _PKG_SHORT_ERRORS_SUPPORTED
17932001f49Smrg        if test $_pkg_short_errors_supported = yes; then
18032001f49Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
18132001f49Smrg        else 
18232001f49Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
18332001f49Smrg        fi
18432001f49Smrg	# Put the nasty error message in config.log where it belongs
18532001f49Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
18632001f49Smrg
18732001f49Smrg	m4_default([$4], [AC_MSG_ERROR(
18832001f49Smrg[Package requirements ($2) were not met:
18932001f49Smrg
19032001f49Smrg$$1_PKG_ERRORS
19132001f49Smrg
19232001f49SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
19332001f49Smrginstalled software in a non-standard prefix.
19432001f49Smrg
19532001f49Smrg_PKG_TEXT])[]dnl
19632001f49Smrg        ])
19732001f49Smrgelif test $pkg_failed = untried; then
19832001f49Smrg     	AC_MSG_RESULT([no])
19932001f49Smrg	m4_default([$4], [AC_MSG_FAILURE(
20032001f49Smrg[The pkg-config script could not be found or is too old.  Make sure it
20132001f49Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
20232001f49Smrgpath to pkg-config.
20332001f49Smrg
20432001f49Smrg_PKG_TEXT
20532001f49Smrg
20632001f49SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
20732001f49Smrg        ])
20832001f49Smrgelse
20932001f49Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
21032001f49Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
21132001f49Smrg        AC_MSG_RESULT([yes])
21232001f49Smrg	$3
21332001f49Smrgfi[]dnl
2147ec3b29aSmrg])dnl PKG_CHECK_MODULES
2157ec3b29aSmrg
2167ec3b29aSmrg
2177ec3b29aSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
2187ec3b29aSmrgdnl   [ACTION-IF-NOT-FOUND])
2197ec3b29aSmrgdnl ---------------------------------------------------------------------
2207ec3b29aSmrgdnl Since: 0.29
2217ec3b29aSmrgdnl
2227ec3b29aSmrgdnl Checks for existence of MODULES and gathers its build flags with
2237ec3b29aSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
2247ec3b29aSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
2257ec3b29aSmrgdnl
2267ec3b29aSmrgdnl Note that if there is a possibility the first call to
2277ec3b29aSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
2287ec3b29aSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
2297ec3b29aSmrgdnl configure.ac.
2307ec3b29aSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
2317ec3b29aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
2327ec3b29aSmrg_save_PKG_CONFIG=$PKG_CONFIG
2337ec3b29aSmrgPKG_CONFIG="$PKG_CONFIG --static"
2347ec3b29aSmrgPKG_CHECK_MODULES($@)
2357ec3b29aSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
2367ec3b29aSmrg])dnl PKG_CHECK_MODULES_STATIC
23732001f49Smrg
23832001f49Smrg
2397ec3b29aSmrgdnl PKG_INSTALLDIR([DIRECTORY])
2407ec3b29aSmrgdnl -------------------------
2417ec3b29aSmrgdnl Since: 0.27
2427ec3b29aSmrgdnl
2437ec3b29aSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
2447ec3b29aSmrgdnl should install pkg-config .pc files. By default the directory is
2457ec3b29aSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
2467ec3b29aSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
2477ec3b29aSmrgdnl parameter.
24832001f49SmrgAC_DEFUN([PKG_INSTALLDIR],
24932001f49Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
25032001f49Smrgm4_pushdef([pkg_description],
25132001f49Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
25232001f49SmrgAC_ARG_WITH([pkgconfigdir],
25332001f49Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
25432001f49Smrg    [with_pkgconfigdir=]pkg_default)
25532001f49SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
25632001f49Smrgm4_popdef([pkg_default])
25732001f49Smrgm4_popdef([pkg_description])
2587ec3b29aSmrg])dnl PKG_INSTALLDIR
25932001f49Smrg
26032001f49Smrg
2617ec3b29aSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
2627ec3b29aSmrgdnl --------------------------------
2637ec3b29aSmrgdnl Since: 0.27
2647ec3b29aSmrgdnl
2657ec3b29aSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
2667ec3b29aSmrgdnl module should install arch-independent pkg-config .pc files. By
2677ec3b29aSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
2687ec3b29aSmrgdnl changed by passing DIRECTORY. The user can override through the
2697ec3b29aSmrgdnl --with-noarch-pkgconfigdir parameter.
27032001f49SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
27132001f49Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
27232001f49Smrgm4_pushdef([pkg_description],
27332001f49Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
27432001f49SmrgAC_ARG_WITH([noarch-pkgconfigdir],
27532001f49Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
27632001f49Smrg    [with_noarch_pkgconfigdir=]pkg_default)
27732001f49SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
27832001f49Smrgm4_popdef([pkg_default])
27932001f49Smrgm4_popdef([pkg_description])
2807ec3b29aSmrg])dnl PKG_NOARCH_INSTALLDIR
28132001f49Smrg
28232001f49Smrg
2837ec3b29aSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
2847ec3b29aSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2857ec3b29aSmrgdnl -------------------------------------------
2867ec3b29aSmrgdnl Since: 0.28
2877ec3b29aSmrgdnl
2887ec3b29aSmrgdnl Retrieves the value of the pkg-config variable for the given module.
28932001f49SmrgAC_DEFUN([PKG_CHECK_VAR],
29032001f49Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
29132001f49SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
29232001f49Smrg
29332001f49Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
29432001f49SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
29532001f49Smrg
29632001f49SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
2977ec3b29aSmrg])dnl PKG_CHECK_VAR
29832001f49Smrg
2997ec3b29aSmrg# Copyright (C) 2002-2017 Free Software Foundation, Inc.
30032001f49Smrg#
30132001f49Smrg# This file is free software; the Free Software Foundation
30232001f49Smrg# gives unlimited permission to copy and/or distribute it,
30332001f49Smrg# with or without modifications, as long as this notice is preserved.
30432001f49Smrg
30532001f49Smrg# AM_AUTOMAKE_VERSION(VERSION)
30632001f49Smrg# ----------------------------
30732001f49Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
30832001f49Smrg# generated from the m4 files accompanying Automake X.Y.
30932001f49Smrg# (This private macro should not be called outside this file.)
31032001f49SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
3117ec3b29aSmrg[am__api_version='1.15'
31232001f49Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
31332001f49Smrgdnl require some minimum version.  Point them to the right macro.
3147ec3b29aSmrgm4_if([$1], [1.15.1], [],
31532001f49Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
31632001f49Smrg])
31732001f49Smrg
31832001f49Smrg# _AM_AUTOCONF_VERSION(VERSION)
31932001f49Smrg# -----------------------------
32032001f49Smrg# aclocal traces this macro to find the Autoconf version.
32132001f49Smrg# This is a private macro too.  Using m4_define simplifies
32232001f49Smrg# the logic in aclocal, which can simply ignore this definition.
32332001f49Smrgm4_define([_AM_AUTOCONF_VERSION], [])
32432001f49Smrg
32532001f49Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
32632001f49Smrg# -------------------------------
32732001f49Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
32832001f49Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
32932001f49SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
3307ec3b29aSmrg[AM_AUTOMAKE_VERSION([1.15.1])dnl
33132001f49Smrgm4_ifndef([AC_AUTOCONF_VERSION],
33232001f49Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
33332001f49Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
33432001f49Smrg
33532001f49Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
33632001f49Smrg
3377ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
33832001f49Smrg#
33932001f49Smrg# This file is free software; the Free Software Foundation
34032001f49Smrg# gives unlimited permission to copy and/or distribute it,
34132001f49Smrg# with or without modifications, as long as this notice is preserved.
34232001f49Smrg
34332001f49Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
34432001f49Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
34532001f49Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
34632001f49Smrg#
34732001f49Smrg# Of course, Automake must honor this variable whenever it calls a
34832001f49Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
34932001f49Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
35032001f49Smrg# depending on how configure is run.  This is pretty annoying, since
35132001f49Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
35232001f49Smrg# source directory, any form will work fine, but in subdirectories a
35332001f49Smrg# relative path needs to be adjusted first.
35432001f49Smrg#
35532001f49Smrg# $ac_aux_dir/missing
35632001f49Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
35732001f49Smrg# $top_srcdir/$ac_aux_dir/missing
35832001f49Smrg#    fails if $ac_aux_dir is absolute,
35932001f49Smrg#    fails when called from a subdirectory in a VPATH build with
36032001f49Smrg#          a relative $ac_aux_dir
36132001f49Smrg#
36232001f49Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
36332001f49Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
36432001f49Smrg# harmless because $srcdir is '.', but things will broke when you
36532001f49Smrg# start a VPATH build or use an absolute $srcdir.
36632001f49Smrg#
36732001f49Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
36832001f49Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
36932001f49Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
37032001f49Smrg# and then we would define $MISSING as
37132001f49Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
37232001f49Smrg# This will work as long as MISSING is not called from configure, because
37332001f49Smrg# unfortunately $(top_srcdir) has no meaning in configure.
37432001f49Smrg# However there are other variables, like CC, which are often used in
37532001f49Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
37632001f49Smrg#
37732001f49Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
37832001f49Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
37932001f49Smrg# configured tree to be moved without reconfiguration.
38032001f49Smrg
38132001f49SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
3827ec3b29aSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
3837ec3b29aSmrg# Expand $ac_aux_dir to an absolute path.
3847ec3b29aSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
38532001f49Smrg])
38632001f49Smrg
38732001f49Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
38832001f49Smrg
3897ec3b29aSmrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
39032001f49Smrg#
39132001f49Smrg# This file is free software; the Free Software Foundation
39232001f49Smrg# gives unlimited permission to copy and/or distribute it,
39332001f49Smrg# with or without modifications, as long as this notice is preserved.
39432001f49Smrg
39532001f49Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
39632001f49Smrg# -------------------------------------
39732001f49Smrg# Define a conditional.
39832001f49SmrgAC_DEFUN([AM_CONDITIONAL],
39932001f49Smrg[AC_PREREQ([2.52])dnl
40032001f49Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
40132001f49Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
40232001f49SmrgAC_SUBST([$1_TRUE])dnl
40332001f49SmrgAC_SUBST([$1_FALSE])dnl
40432001f49Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
40532001f49Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
40632001f49Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
40732001f49Smrgif $2; then
40832001f49Smrg  $1_TRUE=
40932001f49Smrg  $1_FALSE='#'
41032001f49Smrgelse
41132001f49Smrg  $1_TRUE='#'
41232001f49Smrg  $1_FALSE=
41332001f49Smrgfi
41432001f49SmrgAC_CONFIG_COMMANDS_PRE(
41532001f49Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
41632001f49Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
41732001f49SmrgUsually this means the macro was only invoked conditionally.]])
41832001f49Smrgfi])])
41932001f49Smrg
4207ec3b29aSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
42132001f49Smrg#
42232001f49Smrg# This file is free software; the Free Software Foundation
42332001f49Smrg# gives unlimited permission to copy and/or distribute it,
42432001f49Smrg# with or without modifications, as long as this notice is preserved.
42532001f49Smrg
42632001f49Smrg
42732001f49Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
42832001f49Smrg# written in clear, in which case automake, when reading aclocal.m4,
42932001f49Smrg# will think it sees a *use*, and therefore will trigger all it's
43032001f49Smrg# C support machinery.  Also note that it means that autoscan, seeing
43132001f49Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
43232001f49Smrg
43332001f49Smrg
43432001f49Smrg# _AM_DEPENDENCIES(NAME)
43532001f49Smrg# ----------------------
43632001f49Smrg# See how the compiler implements dependency checking.
43732001f49Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
43832001f49Smrg# We try a few techniques and use that to set a single cache variable.
43932001f49Smrg#
44032001f49Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
44132001f49Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
44232001f49Smrg# dependency, and given that the user is not expected to run this macro,
44332001f49Smrg# just rely on AC_PROG_CC.
44432001f49SmrgAC_DEFUN([_AM_DEPENDENCIES],
44532001f49Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
44632001f49SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
44732001f49SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
44832001f49SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
44932001f49Smrg
45032001f49Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
45132001f49Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
45232001f49Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
45332001f49Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
45432001f49Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
45532001f49Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
45632001f49Smrg                    [depcc="$$1"   am_compiler_list=])
45732001f49Smrg
45832001f49SmrgAC_CACHE_CHECK([dependency style of $depcc],
45932001f49Smrg               [am_cv_$1_dependencies_compiler_type],
46032001f49Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
46132001f49Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
46232001f49Smrg  # making bogus files that we don't know about and never remove.  For
46332001f49Smrg  # instance it was reported that on HP-UX the gcc test will end up
46432001f49Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
46532001f49Smrg  # in D".
46632001f49Smrg  rm -rf conftest.dir
46732001f49Smrg  mkdir conftest.dir
46832001f49Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
46932001f49Smrg  # using a relative directory.
47032001f49Smrg  cp "$am_depcomp" conftest.dir
47132001f49Smrg  cd conftest.dir
47232001f49Smrg  # We will build objects and dependencies in a subdirectory because
47332001f49Smrg  # it helps to detect inapplicable dependency modes.  For instance
47432001f49Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
47532001f49Smrg  # side effect of compilation, but ICC will put the dependencies in
47632001f49Smrg  # the current directory while Tru64 will put them in the object
47732001f49Smrg  # directory.
47832001f49Smrg  mkdir sub
47932001f49Smrg
48032001f49Smrg  am_cv_$1_dependencies_compiler_type=none
48132001f49Smrg  if test "$am_compiler_list" = ""; then
48232001f49Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
48332001f49Smrg  fi
48432001f49Smrg  am__universal=false
48532001f49Smrg  m4_case([$1], [CC],
48632001f49Smrg    [case " $depcc " in #(
48732001f49Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
48832001f49Smrg     esac],
48932001f49Smrg    [CXX],
49032001f49Smrg    [case " $depcc " in #(
49132001f49Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
49232001f49Smrg     esac])
49332001f49Smrg
49432001f49Smrg  for depmode in $am_compiler_list; do
49532001f49Smrg    # Setup a source with many dependencies, because some compilers
49632001f49Smrg    # like to wrap large dependency lists on column 80 (with \), and
49732001f49Smrg    # we should not choose a depcomp mode which is confused by this.
49832001f49Smrg    #
49932001f49Smrg    # We need to recreate these files for each test, as the compiler may
50032001f49Smrg    # overwrite some of them when testing with obscure command lines.
50132001f49Smrg    # This happens at least with the AIX C compiler.
50232001f49Smrg    : > sub/conftest.c
50332001f49Smrg    for i in 1 2 3 4 5 6; do
50432001f49Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
50532001f49Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
50632001f49Smrg      # Solaris 10 /bin/sh.
50732001f49Smrg      echo '/* dummy */' > sub/conftst$i.h
50832001f49Smrg    done
50932001f49Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
51032001f49Smrg
51132001f49Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
51232001f49Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
51332001f49Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
51432001f49Smrg    # versions had trouble with output in subdirs.
51532001f49Smrg    am__obj=sub/conftest.${OBJEXT-o}
51632001f49Smrg    am__minus_obj="-o $am__obj"
51732001f49Smrg    case $depmode in
51832001f49Smrg    gcc)
51932001f49Smrg      # This depmode causes a compiler race in universal mode.
52032001f49Smrg      test "$am__universal" = false || continue
52132001f49Smrg      ;;
52232001f49Smrg    nosideeffect)
52332001f49Smrg      # After this tag, mechanisms are not by side-effect, so they'll
52432001f49Smrg      # only be used when explicitly requested.
52532001f49Smrg      if test "x$enable_dependency_tracking" = xyes; then
52632001f49Smrg	continue
52732001f49Smrg      else
52832001f49Smrg	break
52932001f49Smrg      fi
53032001f49Smrg      ;;
53132001f49Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
53232001f49Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
53332001f49Smrg      # not run yet.  These depmodes are late enough in the game, and
53432001f49Smrg      # so weak that their functioning should not be impacted.
53532001f49Smrg      am__obj=conftest.${OBJEXT-o}
53632001f49Smrg      am__minus_obj=
53732001f49Smrg      ;;
53832001f49Smrg    none) break ;;
53932001f49Smrg    esac
54032001f49Smrg    if depmode=$depmode \
54132001f49Smrg       source=sub/conftest.c object=$am__obj \
54232001f49Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
54332001f49Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
54432001f49Smrg         >/dev/null 2>conftest.err &&
54532001f49Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
54632001f49Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
54732001f49Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
54832001f49Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
54932001f49Smrg      # icc doesn't choke on unknown options, it will just issue warnings
55032001f49Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
55132001f49Smrg      # that says an option was ignored or not supported.
55232001f49Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
55332001f49Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
55432001f49Smrg      # The diagnosis changed in icc 8.0:
55532001f49Smrg      #   icc: Command line remark: option '-MP' not supported
55632001f49Smrg      if (grep 'ignoring option' conftest.err ||
55732001f49Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
55832001f49Smrg        am_cv_$1_dependencies_compiler_type=$depmode
55932001f49Smrg        break
56032001f49Smrg      fi
56132001f49Smrg    fi
56232001f49Smrg  done
56332001f49Smrg
56432001f49Smrg  cd ..
56532001f49Smrg  rm -rf conftest.dir
56632001f49Smrgelse
56732001f49Smrg  am_cv_$1_dependencies_compiler_type=none
56832001f49Smrgfi
56932001f49Smrg])
57032001f49SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
57132001f49SmrgAM_CONDITIONAL([am__fastdep$1], [
57232001f49Smrg  test "x$enable_dependency_tracking" != xno \
57332001f49Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
57432001f49Smrg])
57532001f49Smrg
57632001f49Smrg
57732001f49Smrg# AM_SET_DEPDIR
57832001f49Smrg# -------------
57932001f49Smrg# Choose a directory name for dependency files.
58032001f49Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
58132001f49SmrgAC_DEFUN([AM_SET_DEPDIR],
58232001f49Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
58332001f49SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
58432001f49Smrg])
58532001f49Smrg
58632001f49Smrg
58732001f49Smrg# AM_DEP_TRACK
58832001f49Smrg# ------------
58932001f49SmrgAC_DEFUN([AM_DEP_TRACK],
59032001f49Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
59132001f49SmrgAS_HELP_STRING(
59232001f49Smrg  [--enable-dependency-tracking],
59332001f49Smrg  [do not reject slow dependency extractors])
59432001f49SmrgAS_HELP_STRING(
59532001f49Smrg  [--disable-dependency-tracking],
59632001f49Smrg  [speeds up one-time build])])
59732001f49Smrgif test "x$enable_dependency_tracking" != xno; then
59832001f49Smrg  am_depcomp="$ac_aux_dir/depcomp"
59932001f49Smrg  AMDEPBACKSLASH='\'
60032001f49Smrg  am__nodep='_no'
60132001f49Smrgfi
60232001f49SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
60332001f49SmrgAC_SUBST([AMDEPBACKSLASH])dnl
60432001f49Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
60532001f49SmrgAC_SUBST([am__nodep])dnl
60632001f49Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
60732001f49Smrg])
60832001f49Smrg
60932001f49Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
61032001f49Smrg
6117ec3b29aSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
61232001f49Smrg#
61332001f49Smrg# This file is free software; the Free Software Foundation
61432001f49Smrg# gives unlimited permission to copy and/or distribute it,
61532001f49Smrg# with or without modifications, as long as this notice is preserved.
61632001f49Smrg
61732001f49Smrg
61832001f49Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
61932001f49Smrg# ------------------------------
62032001f49SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
62132001f49Smrg[{
62232001f49Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
62332001f49Smrg  # are listed without --file.  Let's play safe and only enable the eval
62432001f49Smrg  # if we detect the quoting.
62532001f49Smrg  case $CONFIG_FILES in
62632001f49Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
62732001f49Smrg  *)   set x $CONFIG_FILES ;;
62832001f49Smrg  esac
62932001f49Smrg  shift
63032001f49Smrg  for mf
63132001f49Smrg  do
63232001f49Smrg    # Strip MF so we end up with the name of the file.
63332001f49Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
63432001f49Smrg    # Check whether this is an Automake generated Makefile or not.
63532001f49Smrg    # We used to match only the files named 'Makefile.in', but
63632001f49Smrg    # some people rename them; so instead we look at the file content.
63732001f49Smrg    # Grep'ing the first line is not enough: some people post-process
63832001f49Smrg    # each Makefile.in and add a new line on top of each file to say so.
63932001f49Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
64032001f49Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
64132001f49Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
64232001f49Smrg      dirpart=`AS_DIRNAME("$mf")`
64332001f49Smrg    else
64432001f49Smrg      continue
64532001f49Smrg    fi
64632001f49Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
64732001f49Smrg    # from the Makefile without running 'make'.
64832001f49Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
64932001f49Smrg    test -z "$DEPDIR" && continue
65032001f49Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
65132001f49Smrg    test -z "$am__include" && continue
65232001f49Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
65332001f49Smrg    # Find all dependency output files, they are included files with
65432001f49Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
65532001f49Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
65632001f49Smrg    # expansion.
65732001f49Smrg    for file in `sed -n "
65832001f49Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
65932001f49Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
66032001f49Smrg      # Make sure the directory exists.
66132001f49Smrg      test -f "$dirpart/$file" && continue
66232001f49Smrg      fdir=`AS_DIRNAME(["$file"])`
66332001f49Smrg      AS_MKDIR_P([$dirpart/$fdir])
66432001f49Smrg      # echo "creating $dirpart/$file"
66532001f49Smrg      echo '# dummy' > "$dirpart/$file"
66632001f49Smrg    done
66732001f49Smrg  done
66832001f49Smrg}
66932001f49Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
67032001f49Smrg
67132001f49Smrg
67232001f49Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
67332001f49Smrg# -----------------------------
67432001f49Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
67532001f49Smrg#
67632001f49Smrg# This code is only required when automatic dependency tracking
67732001f49Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
67832001f49Smrg# need in order to bootstrap the dependency handling code.
67932001f49SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
68032001f49Smrg[AC_CONFIG_COMMANDS([depfiles],
68132001f49Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
68232001f49Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
68332001f49Smrg])
68432001f49Smrg
68532001f49Smrg# Do all the work for Automake.                             -*- Autoconf -*-
68632001f49Smrg
6877ec3b29aSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
68832001f49Smrg#
68932001f49Smrg# This file is free software; the Free Software Foundation
69032001f49Smrg# gives unlimited permission to copy and/or distribute it,
69132001f49Smrg# with or without modifications, as long as this notice is preserved.
69232001f49Smrg
69332001f49Smrg# This macro actually does too much.  Some checks are only needed if
69432001f49Smrg# your package does certain things.  But this isn't really a big deal.
69532001f49Smrg
69632001f49Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
69732001f49Smrgm4_define([AC_PROG_CC],
69832001f49Smrgm4_defn([AC_PROG_CC])
69932001f49Smrg[_AM_PROG_CC_C_O
70032001f49Smrg])
70132001f49Smrg
70232001f49Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
70332001f49Smrg# AM_INIT_AUTOMAKE([OPTIONS])
70432001f49Smrg# -----------------------------------------------
70532001f49Smrg# The call with PACKAGE and VERSION arguments is the old style
70632001f49Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
70732001f49Smrg# and VERSION should now be passed to AC_INIT and removed from
70832001f49Smrg# the call to AM_INIT_AUTOMAKE.
70932001f49Smrg# We support both call styles for the transition.  After
71032001f49Smrg# the next Automake release, Autoconf can make the AC_INIT
71132001f49Smrg# arguments mandatory, and then we can depend on a new Autoconf
71232001f49Smrg# release and drop the old call support.
71332001f49SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
71432001f49Smrg[AC_PREREQ([2.65])dnl
71532001f49Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
71632001f49Smrgdnl the ones we care about.
71732001f49Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
71832001f49SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
71932001f49SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
72032001f49Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
72132001f49Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
72232001f49Smrg  # is not polluted with repeated "-I."
72332001f49Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
72432001f49Smrg  # test to see if srcdir already configured
72532001f49Smrg  if test -f $srcdir/config.status; then
72632001f49Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
72732001f49Smrg  fi
72832001f49Smrgfi
72932001f49Smrg
73032001f49Smrg# test whether we have cygpath
73132001f49Smrgif test -z "$CYGPATH_W"; then
73232001f49Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
73332001f49Smrg    CYGPATH_W='cygpath -w'
73432001f49Smrg  else
73532001f49Smrg    CYGPATH_W=echo
73632001f49Smrg  fi
73732001f49Smrgfi
73832001f49SmrgAC_SUBST([CYGPATH_W])
73932001f49Smrg
74032001f49Smrg# Define the identity of the package.
74132001f49Smrgdnl Distinguish between old-style and new-style calls.
74232001f49Smrgm4_ifval([$2],
74332001f49Smrg[AC_DIAGNOSE([obsolete],
74432001f49Smrg             [$0: two- and three-arguments forms are deprecated.])
74532001f49Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
74632001f49Smrg AC_SUBST([PACKAGE], [$1])dnl
74732001f49Smrg AC_SUBST([VERSION], [$2])],
74832001f49Smrg[_AM_SET_OPTIONS([$1])dnl
74932001f49Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
75032001f49Smrgm4_if(
75132001f49Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
75232001f49Smrg  [ok:ok],,
75332001f49Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
75432001f49Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
75532001f49Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
75632001f49Smrg
75732001f49Smrg_AM_IF_OPTION([no-define],,
75832001f49Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
75932001f49Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
76032001f49Smrg
76132001f49Smrg# Some tools Automake needs.
76232001f49SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
76332001f49SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
76432001f49SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
76532001f49SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
76632001f49SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
76732001f49SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
76832001f49SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
76932001f49SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
77032001f49SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
77132001f49SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
77232001f49Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
77332001f49Smrg# dies out for good.  For more background, see:
77432001f49Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
77532001f49Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
77632001f49SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
7777ec3b29aSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
7787ec3b29aSmrg# system "awk" is bad on some platforms.
77932001f49SmrgAC_REQUIRE([AC_PROG_AWK])dnl
78032001f49SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
78132001f49SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
78232001f49Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
78332001f49Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
78432001f49Smrg			     [_AM_PROG_TAR([v7])])])
78532001f49Smrg_AM_IF_OPTION([no-dependencies],,
78632001f49Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
78732001f49Smrg		  [_AM_DEPENDENCIES([CC])],
78832001f49Smrg		  [m4_define([AC_PROG_CC],
78932001f49Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
79032001f49SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
79132001f49Smrg		  [_AM_DEPENDENCIES([CXX])],
79232001f49Smrg		  [m4_define([AC_PROG_CXX],
79332001f49Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
79432001f49SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
79532001f49Smrg		  [_AM_DEPENDENCIES([OBJC])],
79632001f49Smrg		  [m4_define([AC_PROG_OBJC],
79732001f49Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
79832001f49SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
79932001f49Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
80032001f49Smrg		  [m4_define([AC_PROG_OBJCXX],
80132001f49Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
80232001f49Smrg])
80332001f49SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
80432001f49Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
80532001f49Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
80632001f49Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
80732001f49SmrgAC_CONFIG_COMMANDS_PRE(dnl
80832001f49Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
80932001f49Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
81032001f49Smrg
81132001f49Smrg# POSIX will say in a future version that running "rm -f" with no argument
81232001f49Smrg# is OK; and we want to be able to make that assumption in our Makefile
81332001f49Smrg# recipes.  So use an aggressive probe to check that the usage we want is
81432001f49Smrg# actually supported "in the wild" to an acceptable degree.
81532001f49Smrg# See automake bug#10828.
81632001f49Smrg# To make any issue more visible, cause the running configure to be aborted
81732001f49Smrg# by default if the 'rm' program in use doesn't match our expectations; the
81832001f49Smrg# user can still override this though.
81932001f49Smrgif rm -f && rm -fr && rm -rf; then : OK; else
82032001f49Smrg  cat >&2 <<'END'
82132001f49SmrgOops!
82232001f49Smrg
82332001f49SmrgYour 'rm' program seems unable to run without file operands specified
82432001f49Smrgon the command line, even when the '-f' option is present.  This is contrary
82532001f49Smrgto the behaviour of most rm programs out there, and not conforming with
82632001f49Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
82732001f49Smrg
82832001f49SmrgPlease tell bug-automake@gnu.org about your system, including the value
82932001f49Smrgof your $PATH and any error possibly output before this message.  This
83032001f49Smrgcan help us improve future automake versions.
83132001f49Smrg
83232001f49SmrgEND
83332001f49Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
83432001f49Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
83532001f49Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
83632001f49Smrg    echo >&2
83732001f49Smrg  else
83832001f49Smrg    cat >&2 <<'END'
83932001f49SmrgAborting the configuration process, to ensure you take notice of the issue.
84032001f49Smrg
84132001f49SmrgYou can download and install GNU coreutils to get an 'rm' implementation
84232001f49Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
84332001f49Smrg
84432001f49SmrgIf you want to complete the configuration process using your problematic
84532001f49Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
84632001f49Smrgto "yes", and re-run configure.
84732001f49Smrg
84832001f49SmrgEND
84932001f49Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
85032001f49Smrg  fi
85132001f49Smrgfi
8527ec3b29aSmrgdnl The trailing newline in this macro's definition is deliberate, for
8537ec3b29aSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
8547ec3b29aSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
85532001f49Smrg])
85632001f49Smrg
85732001f49Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
85832001f49Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
85932001f49Smrgdnl mangled by Autoconf and run in a shell conditional statement.
86032001f49Smrgm4_define([_AC_COMPILER_EXEEXT],
86132001f49Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
86232001f49Smrg
86332001f49Smrg# When config.status generates a header, we must update the stamp-h file.
86432001f49Smrg# This file resides in the same directory as the config header
86532001f49Smrg# that is generated.  The stamp files are numbered to have different names.
86632001f49Smrg
86732001f49Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
86832001f49Smrg# loop where config.status creates the headers, so we can generate
86932001f49Smrg# our stamp files there.
87032001f49SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
87132001f49Smrg[# Compute $1's index in $config_headers.
87232001f49Smrg_am_arg=$1
87332001f49Smrg_am_stamp_count=1
87432001f49Smrgfor _am_header in $config_headers :; do
87532001f49Smrg  case $_am_header in
87632001f49Smrg    $_am_arg | $_am_arg:* )
87732001f49Smrg      break ;;
87832001f49Smrg    * )
87932001f49Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
88032001f49Smrg  esac
88132001f49Smrgdone
88232001f49Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
88332001f49Smrg
8847ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
88532001f49Smrg#
88632001f49Smrg# This file is free software; the Free Software Foundation
88732001f49Smrg# gives unlimited permission to copy and/or distribute it,
88832001f49Smrg# with or without modifications, as long as this notice is preserved.
88932001f49Smrg
89032001f49Smrg# AM_PROG_INSTALL_SH
89132001f49Smrg# ------------------
89232001f49Smrg# Define $install_sh.
89332001f49SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
89432001f49Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8957ec3b29aSmrgif test x"${install_sh+set}" != xset; then
89632001f49Smrg  case $am_aux_dir in
89732001f49Smrg  *\ * | *\	*)
89832001f49Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
89932001f49Smrg  *)
90032001f49Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
90132001f49Smrg  esac
90232001f49Smrgfi
90332001f49SmrgAC_SUBST([install_sh])])
90432001f49Smrg
9057ec3b29aSmrg# Copyright (C) 2003-2017 Free Software Foundation, Inc.
90632001f49Smrg#
90732001f49Smrg# This file is free software; the Free Software Foundation
90832001f49Smrg# gives unlimited permission to copy and/or distribute it,
90932001f49Smrg# with or without modifications, as long as this notice is preserved.
91032001f49Smrg
91132001f49Smrg# Check whether the underlying file-system supports filenames
91232001f49Smrg# with a leading dot.  For instance MS-DOS doesn't.
91332001f49SmrgAC_DEFUN([AM_SET_LEADING_DOT],
91432001f49Smrg[rm -rf .tst 2>/dev/null
91532001f49Smrgmkdir .tst 2>/dev/null
91632001f49Smrgif test -d .tst; then
91732001f49Smrg  am__leading_dot=.
91832001f49Smrgelse
91932001f49Smrg  am__leading_dot=_
92032001f49Smrgfi
92132001f49Smrgrmdir .tst 2>/dev/null
92232001f49SmrgAC_SUBST([am__leading_dot])])
92332001f49Smrg
92432001f49Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
92532001f49Smrg
9267ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
92732001f49Smrg#
92832001f49Smrg# This file is free software; the Free Software Foundation
92932001f49Smrg# gives unlimited permission to copy and/or distribute it,
93032001f49Smrg# with or without modifications, as long as this notice is preserved.
93132001f49Smrg
93232001f49Smrg# AM_MAKE_INCLUDE()
93332001f49Smrg# -----------------
93432001f49Smrg# Check to see how make treats includes.
93532001f49SmrgAC_DEFUN([AM_MAKE_INCLUDE],
93632001f49Smrg[am_make=${MAKE-make}
93732001f49Smrgcat > confinc << 'END'
93832001f49Smrgam__doit:
93932001f49Smrg	@echo this is the am__doit target
94032001f49Smrg.PHONY: am__doit
94132001f49SmrgEND
94232001f49Smrg# If we don't find an include directive, just comment out the code.
94332001f49SmrgAC_MSG_CHECKING([for style of include used by $am_make])
94432001f49Smrgam__include="#"
94532001f49Smrgam__quote=
94632001f49Smrg_am_result=none
94732001f49Smrg# First try GNU make style include.
94832001f49Smrgecho "include confinc" > confmf
94932001f49Smrg# Ignore all kinds of additional output from 'make'.
95032001f49Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
95132001f49Smrg*the\ am__doit\ target*)
95232001f49Smrg  am__include=include
95332001f49Smrg  am__quote=
95432001f49Smrg  _am_result=GNU
95532001f49Smrg  ;;
95632001f49Smrgesac
95732001f49Smrg# Now try BSD make style include.
95832001f49Smrgif test "$am__include" = "#"; then
95932001f49Smrg   echo '.include "confinc"' > confmf
96032001f49Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
96132001f49Smrg   *the\ am__doit\ target*)
96232001f49Smrg     am__include=.include
96332001f49Smrg     am__quote="\""
96432001f49Smrg     _am_result=BSD
96532001f49Smrg     ;;
96632001f49Smrg   esac
96732001f49Smrgfi
96832001f49SmrgAC_SUBST([am__include])
96932001f49SmrgAC_SUBST([am__quote])
97032001f49SmrgAC_MSG_RESULT([$_am_result])
97132001f49Smrgrm -f confinc confmf
97232001f49Smrg])
97332001f49Smrg
97432001f49Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
97532001f49Smrg
9767ec3b29aSmrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
97732001f49Smrg#
97832001f49Smrg# This file is free software; the Free Software Foundation
97932001f49Smrg# gives unlimited permission to copy and/or distribute it,
98032001f49Smrg# with or without modifications, as long as this notice is preserved.
98132001f49Smrg
98232001f49Smrg# AM_MISSING_PROG(NAME, PROGRAM)
98332001f49Smrg# ------------------------------
98432001f49SmrgAC_DEFUN([AM_MISSING_PROG],
98532001f49Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
98632001f49Smrg$1=${$1-"${am_missing_run}$2"}
98732001f49SmrgAC_SUBST($1)])
98832001f49Smrg
98932001f49Smrg# AM_MISSING_HAS_RUN
99032001f49Smrg# ------------------
99132001f49Smrg# Define MISSING if not defined so far and test if it is modern enough.
99232001f49Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
99332001f49SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
99432001f49Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
99532001f49SmrgAC_REQUIRE_AUX_FILE([missing])dnl
99632001f49Smrgif test x"${MISSING+set}" != xset; then
99732001f49Smrg  case $am_aux_dir in
99832001f49Smrg  *\ * | *\	*)
99932001f49Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
100032001f49Smrg  *)
100132001f49Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
100232001f49Smrg  esac
100332001f49Smrgfi
100432001f49Smrg# Use eval to expand $SHELL
100532001f49Smrgif eval "$MISSING --is-lightweight"; then
100632001f49Smrg  am_missing_run="$MISSING "
100732001f49Smrgelse
100832001f49Smrg  am_missing_run=
100932001f49Smrg  AC_MSG_WARN(['missing' script is too old or missing])
101032001f49Smrgfi
101132001f49Smrg])
101232001f49Smrg
101332001f49Smrg# Helper functions for option handling.                     -*- Autoconf -*-
101432001f49Smrg
10157ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
101632001f49Smrg#
101732001f49Smrg# This file is free software; the Free Software Foundation
101832001f49Smrg# gives unlimited permission to copy and/or distribute it,
101932001f49Smrg# with or without modifications, as long as this notice is preserved.
102032001f49Smrg
102132001f49Smrg# _AM_MANGLE_OPTION(NAME)
102232001f49Smrg# -----------------------
102332001f49SmrgAC_DEFUN([_AM_MANGLE_OPTION],
102432001f49Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
102532001f49Smrg
102632001f49Smrg# _AM_SET_OPTION(NAME)
102732001f49Smrg# --------------------
102832001f49Smrg# Set option NAME.  Presently that only means defining a flag for this option.
102932001f49SmrgAC_DEFUN([_AM_SET_OPTION],
103032001f49Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
103132001f49Smrg
103232001f49Smrg# _AM_SET_OPTIONS(OPTIONS)
103332001f49Smrg# ------------------------
103432001f49Smrg# OPTIONS is a space-separated list of Automake options.
103532001f49SmrgAC_DEFUN([_AM_SET_OPTIONS],
103632001f49Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
103732001f49Smrg
103832001f49Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
103932001f49Smrg# -------------------------------------------
104032001f49Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
104132001f49SmrgAC_DEFUN([_AM_IF_OPTION],
104232001f49Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
104332001f49Smrg
10447ec3b29aSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
104532001f49Smrg#
104632001f49Smrg# This file is free software; the Free Software Foundation
104732001f49Smrg# gives unlimited permission to copy and/or distribute it,
104832001f49Smrg# with or without modifications, as long as this notice is preserved.
104932001f49Smrg
105032001f49Smrg# _AM_PROG_CC_C_O
105132001f49Smrg# ---------------
105232001f49Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
105332001f49Smrg# to automatically call this.
105432001f49SmrgAC_DEFUN([_AM_PROG_CC_C_O],
105532001f49Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
105632001f49SmrgAC_REQUIRE_AUX_FILE([compile])dnl
105732001f49SmrgAC_LANG_PUSH([C])dnl
105832001f49SmrgAC_CACHE_CHECK(
105932001f49Smrg  [whether $CC understands -c and -o together],
106032001f49Smrg  [am_cv_prog_cc_c_o],
106132001f49Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
106232001f49Smrg  # Make sure it works both with $CC and with simple cc.
106332001f49Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
106432001f49Smrg  # compilers refuse to overwrite an existing .o file with -o,
106532001f49Smrg  # though they will create one.
106632001f49Smrg  am_cv_prog_cc_c_o=yes
106732001f49Smrg  for am_i in 1 2; do
106832001f49Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
106932001f49Smrg         && test -f conftest2.$ac_objext; then
107032001f49Smrg      : OK
107132001f49Smrg    else
107232001f49Smrg      am_cv_prog_cc_c_o=no
107332001f49Smrg      break
107432001f49Smrg    fi
107532001f49Smrg  done
107632001f49Smrg  rm -f core conftest*
107732001f49Smrg  unset am_i])
107832001f49Smrgif test "$am_cv_prog_cc_c_o" != yes; then
107932001f49Smrg   # Losing compiler, so override with the script.
108032001f49Smrg   # FIXME: It is wrong to rewrite CC.
108132001f49Smrg   # But if we don't then we get into trouble of one sort or another.
108232001f49Smrg   # A longer-term fix would be to have automake use am__CC in this case,
108332001f49Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
108432001f49Smrg   CC="$am_aux_dir/compile $CC"
108532001f49Smrgfi
108632001f49SmrgAC_LANG_POP([C])])
108732001f49Smrg
108832001f49Smrg# For backward compatibility.
108932001f49SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
109032001f49Smrg
10917ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
109232001f49Smrg#
109332001f49Smrg# This file is free software; the Free Software Foundation
109432001f49Smrg# gives unlimited permission to copy and/or distribute it,
109532001f49Smrg# with or without modifications, as long as this notice is preserved.
109632001f49Smrg
109732001f49Smrg# AM_RUN_LOG(COMMAND)
109832001f49Smrg# -------------------
109932001f49Smrg# Run COMMAND, save the exit status in ac_status, and log it.
110032001f49Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
110132001f49SmrgAC_DEFUN([AM_RUN_LOG],
110232001f49Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
110332001f49Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
110432001f49Smrg   ac_status=$?
110532001f49Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
110632001f49Smrg   (exit $ac_status); }])
110732001f49Smrg
110832001f49Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
110932001f49Smrg
11107ec3b29aSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
111132001f49Smrg#
111232001f49Smrg# This file is free software; the Free Software Foundation
111332001f49Smrg# gives unlimited permission to copy and/or distribute it,
111432001f49Smrg# with or without modifications, as long as this notice is preserved.
111532001f49Smrg
111632001f49Smrg# AM_SANITY_CHECK
111732001f49Smrg# ---------------
111832001f49SmrgAC_DEFUN([AM_SANITY_CHECK],
111932001f49Smrg[AC_MSG_CHECKING([whether build environment is sane])
112032001f49Smrg# Reject unsafe characters in $srcdir or the absolute working directory
112132001f49Smrg# name.  Accept space and tab only in the latter.
112232001f49Smrgam_lf='
112332001f49Smrg'
112432001f49Smrgcase `pwd` in
112532001f49Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
112632001f49Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
112732001f49Smrgesac
112832001f49Smrgcase $srcdir in
112932001f49Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
113032001f49Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
113132001f49Smrgesac
113232001f49Smrg
113332001f49Smrg# Do 'set' in a subshell so we don't clobber the current shell's
113432001f49Smrg# arguments.  Must try -L first in case configure is actually a
113532001f49Smrg# symlink; some systems play weird games with the mod time of symlinks
113632001f49Smrg# (eg FreeBSD returns the mod time of the symlink's containing
113732001f49Smrg# directory).
113832001f49Smrgif (
113932001f49Smrg   am_has_slept=no
114032001f49Smrg   for am_try in 1 2; do
114132001f49Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
114232001f49Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
114332001f49Smrg     if test "$[*]" = "X"; then
114432001f49Smrg	# -L didn't work.
114532001f49Smrg	set X `ls -t "$srcdir/configure" conftest.file`
114632001f49Smrg     fi
114732001f49Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
114832001f49Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
114932001f49Smrg
115032001f49Smrg	# If neither matched, then we have a broken ls.  This can happen
115132001f49Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
115232001f49Smrg	# broken ls alias from the environment.  This has actually
115332001f49Smrg	# happened.  Such a system could not be considered "sane".
115432001f49Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
115532001f49Smrg  alias in your environment])
115632001f49Smrg     fi
115732001f49Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
115832001f49Smrg       break
115932001f49Smrg     fi
116032001f49Smrg     # Just in case.
116132001f49Smrg     sleep 1
116232001f49Smrg     am_has_slept=yes
116332001f49Smrg   done
116432001f49Smrg   test "$[2]" = conftest.file
116532001f49Smrg   )
116632001f49Smrgthen
116732001f49Smrg   # Ok.
116832001f49Smrg   :
116932001f49Smrgelse
117032001f49Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
117132001f49SmrgCheck your system clock])
117232001f49Smrgfi
117332001f49SmrgAC_MSG_RESULT([yes])
117432001f49Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
117532001f49Smrg# generated files are strictly newer.
117632001f49Smrgam_sleep_pid=
117732001f49Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
117832001f49Smrg  ( sleep 1 ) &
117932001f49Smrg  am_sleep_pid=$!
118032001f49Smrgfi
118132001f49SmrgAC_CONFIG_COMMANDS_PRE(
118232001f49Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
118332001f49Smrg   if test -n "$am_sleep_pid"; then
118432001f49Smrg     # Hide warnings about reused PIDs.
118532001f49Smrg     wait $am_sleep_pid 2>/dev/null
118632001f49Smrg   fi
118732001f49Smrg   AC_MSG_RESULT([done])])
118832001f49Smrgrm -f conftest.file
118932001f49Smrg])
119032001f49Smrg
11917ec3b29aSmrg# Copyright (C) 2009-2017 Free Software Foundation, Inc.
119232001f49Smrg#
119332001f49Smrg# This file is free software; the Free Software Foundation
119432001f49Smrg# gives unlimited permission to copy and/or distribute it,
119532001f49Smrg# with or without modifications, as long as this notice is preserved.
119632001f49Smrg
119732001f49Smrg# AM_SILENT_RULES([DEFAULT])
119832001f49Smrg# --------------------------
119932001f49Smrg# Enable less verbose build rules; with the default set to DEFAULT
120032001f49Smrg# ("yes" being less verbose, "no" or empty being verbose).
120132001f49SmrgAC_DEFUN([AM_SILENT_RULES],
120232001f49Smrg[AC_ARG_ENABLE([silent-rules], [dnl
120332001f49SmrgAS_HELP_STRING(
120432001f49Smrg  [--enable-silent-rules],
120532001f49Smrg  [less verbose build output (undo: "make V=1")])
120632001f49SmrgAS_HELP_STRING(
120732001f49Smrg  [--disable-silent-rules],
120832001f49Smrg  [verbose build output (undo: "make V=0")])dnl
120932001f49Smrg])
121032001f49Smrgcase $enable_silent_rules in @%:@ (((
121132001f49Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
121232001f49Smrg   no) AM_DEFAULT_VERBOSITY=1;;
121332001f49Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
121432001f49Smrgesac
121532001f49Smrgdnl
121632001f49Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
121732001f49Smrgdnl do not support nested variable expansions.
121832001f49Smrgdnl See automake bug#9928 and bug#10237.
121932001f49Smrgam_make=${MAKE-make}
122032001f49SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
122132001f49Smrg   [am_cv_make_support_nested_variables],
122232001f49Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
122332001f49SmrgBAR0=false
122432001f49SmrgBAR1=true
122532001f49SmrgV=1
122632001f49Smrgam__doit:
122732001f49Smrg	@$(TRUE)
122832001f49Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
122932001f49Smrg  am_cv_make_support_nested_variables=yes
123032001f49Smrgelse
123132001f49Smrg  am_cv_make_support_nested_variables=no
123232001f49Smrgfi])
123332001f49Smrgif test $am_cv_make_support_nested_variables = yes; then
123432001f49Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
123532001f49Smrg  AM_V='$(V)'
123632001f49Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
123732001f49Smrgelse
123832001f49Smrg  AM_V=$AM_DEFAULT_VERBOSITY
123932001f49Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
124032001f49Smrgfi
124132001f49SmrgAC_SUBST([AM_V])dnl
124232001f49SmrgAM_SUBST_NOTMAKE([AM_V])dnl
124332001f49SmrgAC_SUBST([AM_DEFAULT_V])dnl
124432001f49SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
124532001f49SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
124632001f49SmrgAM_BACKSLASH='\'
124732001f49SmrgAC_SUBST([AM_BACKSLASH])dnl
124832001f49Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
124932001f49Smrg])
125032001f49Smrg
12517ec3b29aSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
125232001f49Smrg#
125332001f49Smrg# This file is free software; the Free Software Foundation
125432001f49Smrg# gives unlimited permission to copy and/or distribute it,
125532001f49Smrg# with or without modifications, as long as this notice is preserved.
125632001f49Smrg
125732001f49Smrg# AM_PROG_INSTALL_STRIP
125832001f49Smrg# ---------------------
125932001f49Smrg# One issue with vendor 'install' (even GNU) is that you can't
126032001f49Smrg# specify the program used to strip binaries.  This is especially
126132001f49Smrg# annoying in cross-compiling environments, where the build's strip
126232001f49Smrg# is unlikely to handle the host's binaries.
126332001f49Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
126432001f49Smrg# always use install-sh in "make install-strip", and initialize
126532001f49Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
126632001f49SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
126732001f49Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
126832001f49Smrg# Installed binaries are usually stripped using 'strip' when the user
126932001f49Smrg# run "make install-strip".  However 'strip' might not be the right
127032001f49Smrg# tool to use in cross-compilation environments, therefore Automake
127132001f49Smrg# will honor the 'STRIP' environment variable to overrule this program.
127232001f49Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
127332001f49Smrgif test "$cross_compiling" != no; then
127432001f49Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
127532001f49Smrgfi
127632001f49SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
127732001f49SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
127832001f49Smrg
12797ec3b29aSmrg# Copyright (C) 2006-2017 Free Software Foundation, Inc.
128032001f49Smrg#
128132001f49Smrg# This file is free software; the Free Software Foundation
128232001f49Smrg# gives unlimited permission to copy and/or distribute it,
128332001f49Smrg# with or without modifications, as long as this notice is preserved.
128432001f49Smrg
128532001f49Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
128632001f49Smrg# ---------------------------
128732001f49Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
128832001f49Smrg# This macro is traced by Automake.
128932001f49SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
129032001f49Smrg
129132001f49Smrg# AM_SUBST_NOTMAKE(VARIABLE)
129232001f49Smrg# --------------------------
129332001f49Smrg# Public sister of _AM_SUBST_NOTMAKE.
129432001f49SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
129532001f49Smrg
129632001f49Smrg# Check how to create a tarball.                            -*- Autoconf -*-
129732001f49Smrg
12987ec3b29aSmrg# Copyright (C) 2004-2017 Free Software Foundation, Inc.
129932001f49Smrg#
130032001f49Smrg# This file is free software; the Free Software Foundation
130132001f49Smrg# gives unlimited permission to copy and/or distribute it,
130232001f49Smrg# with or without modifications, as long as this notice is preserved.
130332001f49Smrg
130432001f49Smrg# _AM_PROG_TAR(FORMAT)
130532001f49Smrg# --------------------
130632001f49Smrg# Check how to create a tarball in format FORMAT.
130732001f49Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
130832001f49Smrg#
130932001f49Smrg# Substitute a variable $(am__tar) that is a command
131032001f49Smrg# writing to stdout a FORMAT-tarball containing the directory
131132001f49Smrg# $tardir.
131232001f49Smrg#     tardir=directory && $(am__tar) > result.tar
131332001f49Smrg#
131432001f49Smrg# Substitute a variable $(am__untar) that extract such
131532001f49Smrg# a tarball read from stdin.
131632001f49Smrg#     $(am__untar) < result.tar
131732001f49Smrg#
131832001f49SmrgAC_DEFUN([_AM_PROG_TAR],
131932001f49Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
132032001f49Smrg# in the wild :-(  We should find a proper way to deprecate it ...
132132001f49SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
132232001f49Smrg
132332001f49Smrg# We'll loop over all known methods to create a tar archive until one works.
132432001f49Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
132532001f49Smrg
132632001f49Smrgm4_if([$1], [v7],
132732001f49Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
132832001f49Smrg
132932001f49Smrg  [m4_case([$1],
133032001f49Smrg    [ustar],
133132001f49Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
133232001f49Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
133332001f49Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
133432001f49Smrg      # and bug#13588).
133532001f49Smrg      am_max_uid=2097151 # 2^21 - 1
133632001f49Smrg      am_max_gid=$am_max_uid
133732001f49Smrg      # The $UID and $GID variables are not portable, so we need to resort
133832001f49Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
133932001f49Smrg      # below are definitely unexpected, so allow the users to see them
134032001f49Smrg      # (that is, avoid stderr redirection).
134132001f49Smrg      am_uid=`id -u || echo unknown`
134232001f49Smrg      am_gid=`id -g || echo unknown`
134332001f49Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
134432001f49Smrg      if test $am_uid -le $am_max_uid; then
134532001f49Smrg         AC_MSG_RESULT([yes])
134632001f49Smrg      else
134732001f49Smrg         AC_MSG_RESULT([no])
134832001f49Smrg         _am_tools=none
134932001f49Smrg      fi
135032001f49Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
135132001f49Smrg      if test $am_gid -le $am_max_gid; then
135232001f49Smrg         AC_MSG_RESULT([yes])
135332001f49Smrg      else
135432001f49Smrg        AC_MSG_RESULT([no])
135532001f49Smrg        _am_tools=none
135632001f49Smrg      fi],
135732001f49Smrg
135832001f49Smrg  [pax],
135932001f49Smrg    [],
136032001f49Smrg
136132001f49Smrg  [m4_fatal([Unknown tar format])])
136232001f49Smrg
136332001f49Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
136432001f49Smrg
136532001f49Smrg  # Go ahead even if we have the value already cached.  We do so because we
136632001f49Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
136732001f49Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
136832001f49Smrg
136932001f49Smrg  for _am_tool in $_am_tools; do
137032001f49Smrg    case $_am_tool in
137132001f49Smrg    gnutar)
137232001f49Smrg      for _am_tar in tar gnutar gtar; do
137332001f49Smrg        AM_RUN_LOG([$_am_tar --version]) && break
137432001f49Smrg      done
137532001f49Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
137632001f49Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
137732001f49Smrg      am__untar="$_am_tar -xf -"
137832001f49Smrg      ;;
137932001f49Smrg    plaintar)
138032001f49Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
138132001f49Smrg      # ustar tarball either.
138232001f49Smrg      (tar --version) >/dev/null 2>&1 && continue
138332001f49Smrg      am__tar='tar chf - "$$tardir"'
138432001f49Smrg      am__tar_='tar chf - "$tardir"'
138532001f49Smrg      am__untar='tar xf -'
138632001f49Smrg      ;;
138732001f49Smrg    pax)
138832001f49Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
138932001f49Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
139032001f49Smrg      am__untar='pax -r'
139132001f49Smrg      ;;
139232001f49Smrg    cpio)
139332001f49Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
139432001f49Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
139532001f49Smrg      am__untar='cpio -i -H $1 -d'
139632001f49Smrg      ;;
139732001f49Smrg    none)
139832001f49Smrg      am__tar=false
139932001f49Smrg      am__tar_=false
140032001f49Smrg      am__untar=false
140132001f49Smrg      ;;
140232001f49Smrg    esac
140332001f49Smrg
140432001f49Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
140532001f49Smrg    # and am__untar set.
140632001f49Smrg    test -n "${am_cv_prog_tar_$1}" && break
140732001f49Smrg
140832001f49Smrg    # tar/untar a dummy directory, and stop if the command works.
140932001f49Smrg    rm -rf conftest.dir
141032001f49Smrg    mkdir conftest.dir
141132001f49Smrg    echo GrepMe > conftest.dir/file
141232001f49Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
141332001f49Smrg    rm -rf conftest.dir
141432001f49Smrg    if test -s conftest.tar; then
141532001f49Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
141632001f49Smrg      AM_RUN_LOG([cat conftest.dir/file])
141732001f49Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
141832001f49Smrg    fi
141932001f49Smrg  done
142032001f49Smrg  rm -rf conftest.dir
142132001f49Smrg
142232001f49Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
142332001f49Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
142432001f49Smrg
142532001f49SmrgAC_SUBST([am__tar])
142632001f49SmrgAC_SUBST([am__untar])
142732001f49Smrg]) # _AM_PROG_TAR
142832001f49Smrg
142932001f49Smrgm4_include([m4/ac_define_dir.m4])
143032001f49Smrgm4_include([m4/libtool.m4])
143132001f49Smrgm4_include([m4/ltoptions.m4])
143232001f49Smrgm4_include([m4/ltsugar.m4])
143332001f49Smrgm4_include([m4/ltversion.m4])
143432001f49Smrgm4_include([m4/lt~obsolete.m4])
1435