xref: /freebsd/contrib/lutok/aclocal.m4 (revision 132f818ddbf457ee67d502cd89b5a18e0a34713d)
1*132f818dSEnji Cooper# generated automatically by aclocal 1.17 -*- Autoconf -*-
2*132f818dSEnji Cooper
3*132f818dSEnji Cooper# Copyright (C) 1996-2024 Free Software Foundation, Inc.
4*132f818dSEnji Cooper
5*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
6*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
7*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
8*132f818dSEnji Cooper
9*132f818dSEnji Cooper# This program is distributed in the hope that it will be useful,
10*132f818dSEnji Cooper# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11*132f818dSEnji Cooper# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12*132f818dSEnji Cooper# PARTICULAR PURPOSE.
13*132f818dSEnji Cooper
14*132f818dSEnji Cooperm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15*132f818dSEnji Cooperm4_ifndef([AC_AUTOCONF_VERSION],
16*132f818dSEnji Cooper  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17*132f818dSEnji Cooperm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
18*132f818dSEnji Cooper[m4_warning([this file was generated for autoconf 2.72.
19*132f818dSEnji CooperYou have another version of autoconf.  It may work, but is not guaranteed to.
20*132f818dSEnji CooperIf you have problems, you may need to regenerate the build system entirely.
21*132f818dSEnji CooperTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22*132f818dSEnji Cooper
23*132f818dSEnji Cooper# pkg.m4 - Macros to locate and use pkg-config.   -*- Autoconf -*-
24*132f818dSEnji Cooper# serial 13 (pkgconf)
25*132f818dSEnji Cooper
26*132f818dSEnji Cooperdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27*132f818dSEnji Cooperdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
28*132f818dSEnji Cooperdnl
29*132f818dSEnji Cooperdnl This program is free software; you can redistribute it and/or modify
30*132f818dSEnji Cooperdnl it under the terms of the GNU General Public License as published by
31*132f818dSEnji Cooperdnl the Free Software Foundation; either version 2 of the License, or
32*132f818dSEnji Cooperdnl (at your option) any later version.
33*132f818dSEnji Cooperdnl
34*132f818dSEnji Cooperdnl This program is distributed in the hope that it will be useful, but
35*132f818dSEnji Cooperdnl WITHOUT ANY WARRANTY; without even the implied warranty of
36*132f818dSEnji Cooperdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37*132f818dSEnji Cooperdnl General Public License for more details.
38*132f818dSEnji Cooperdnl
39*132f818dSEnji Cooperdnl You should have received a copy of the GNU General Public License
40*132f818dSEnji Cooperdnl along with this program; if not, see <https://www.gnu.org/licenses/>.
41*132f818dSEnji Cooperdnl
42*132f818dSEnji Cooperdnl As a special exception to the GNU General Public License, if you
43*132f818dSEnji Cooperdnl distribute this file as part of a program that contains a
44*132f818dSEnji Cooperdnl configuration script generated by Autoconf, you may include it under
45*132f818dSEnji Cooperdnl the same distribution terms that you use for the rest of that
46*132f818dSEnji Cooperdnl program.
47*132f818dSEnji Cooper
48*132f818dSEnji Cooperdnl PKG_PREREQ(MIN-VERSION)
49*132f818dSEnji Cooperdnl -----------------------
50*132f818dSEnji Cooperdnl Since: 0.29
51*132f818dSEnji Cooperdnl
52*132f818dSEnji Cooperdnl Verify that the version of the pkg-config macros are at least
53*132f818dSEnji Cooperdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
54*132f818dSEnji Cooperdnl installed version of pkg-config, this checks the developer's version
55*132f818dSEnji Cooperdnl of pkg.m4 when generating configure.
56*132f818dSEnji Cooperdnl
57*132f818dSEnji Cooperdnl To ensure that this macro is defined, also add:
58*132f818dSEnji Cooperdnl m4_ifndef([PKG_PREREQ],
59*132f818dSEnji Cooperdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
60*132f818dSEnji Cooperdnl
61*132f818dSEnji Cooperdnl See the "Since" comment for each macro you use to see what version
62*132f818dSEnji Cooperdnl of the macros you require.
63*132f818dSEnji Cooperm4_defun([PKG_PREREQ],
64*132f818dSEnji Cooper[m4_define([PKG_MACROS_VERSION], [0.29.2])
65*132f818dSEnji Cooperm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
66*132f818dSEnji Cooper    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
67*132f818dSEnji Cooper])dnl PKG_PREREQ
68*132f818dSEnji Cooper
69*132f818dSEnji Cooperdnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND])
70*132f818dSEnji Cooperdnl ---------------------------------------------------------
71*132f818dSEnji Cooperdnl Since: 0.16
72*132f818dSEnji Cooperdnl
73*132f818dSEnji Cooperdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
74*132f818dSEnji Cooperdnl first found in the path. Checks that the version of pkg-config found
75*132f818dSEnji Cooperdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
76*132f818dSEnji Cooperdnl used since that's the first version where most current features of
77*132f818dSEnji Cooperdnl pkg-config existed.
78*132f818dSEnji Cooperdnl
79*132f818dSEnji Cooperdnl If pkg-config is not found or older than specified, it will result
80*132f818dSEnji Cooperdnl in an empty PKG_CONFIG variable. To avoid widespread issues with
81*132f818dSEnji Cooperdnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
82*132f818dSEnji Cooperdnl You can specify [PKG_CONFIG=false] as an action instead, which would
83*132f818dSEnji Cooperdnl result in pkg-config tests failing, but no bogus error messages.
84*132f818dSEnji CooperAC_DEFUN([PKG_PROG_PKG_CONFIG],
85*132f818dSEnji Cooper[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
86*132f818dSEnji Cooperm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
87*132f818dSEnji Cooperm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
88*132f818dSEnji CooperAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
89*132f818dSEnji CooperAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
90*132f818dSEnji CooperAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
91*132f818dSEnji Cooper
92*132f818dSEnji Cooperif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
93*132f818dSEnji Cooper	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
94*132f818dSEnji Cooperfi
95*132f818dSEnji Cooperif test -n "$PKG_CONFIG"; then
96*132f818dSEnji Cooper	_pkg_min_version=m4_default([$1], [0.9.0])
97*132f818dSEnji Cooper	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
98*132f818dSEnji Cooper	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
99*132f818dSEnji Cooper		AC_MSG_RESULT([yes])
100*132f818dSEnji Cooper	else
101*132f818dSEnji Cooper		AC_MSG_RESULT([no])
102*132f818dSEnji Cooper		PKG_CONFIG=""
103*132f818dSEnji Cooper	fi
104*132f818dSEnji Cooperfi
105*132f818dSEnji Cooperif test -z "$PKG_CONFIG"; then
106*132f818dSEnji Cooper	m4_default([$2], [AC_MSG_ERROR([pkg-config not found])])
107*132f818dSEnji Cooperfi[]dnl
108*132f818dSEnji Cooper])dnl PKG_PROG_PKG_CONFIG
109*132f818dSEnji Cooper
110*132f818dSEnji Cooperdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
111*132f818dSEnji Cooperdnl -------------------------------------------------------------------
112*132f818dSEnji Cooperdnl Since: 0.18
113*132f818dSEnji Cooperdnl
114*132f818dSEnji Cooperdnl Check to see whether a particular set of modules exists. Similar to
115*132f818dSEnji Cooperdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
116*132f818dSEnji Cooperdnl
117*132f818dSEnji Cooperdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
118*132f818dSEnji Cooperdnl only at the first occurrence in configure.ac, so if the first place
119*132f818dSEnji Cooperdnl it's called might be skipped (such as if it is within an "if", you
120*132f818dSEnji Cooperdnl have to call PKG_CHECK_EXISTS manually
121*132f818dSEnji CooperAC_DEFUN([PKG_CHECK_EXISTS],
122*132f818dSEnji Cooper[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
123*132f818dSEnji Cooperif test -n "$PKG_CONFIG" && \
124*132f818dSEnji Cooper    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
125*132f818dSEnji Cooper  m4_default([$2], [:])
126*132f818dSEnji Cooperm4_ifvaln([$3], [else
127*132f818dSEnji Cooper  $3])dnl
128*132f818dSEnji Cooperfi])
129*132f818dSEnji Cooper
130*132f818dSEnji Cooperdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
131*132f818dSEnji Cooperdnl ---------------------------------------------
132*132f818dSEnji Cooperdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
133*132f818dSEnji Cooperdnl pkg_failed based on the result.
134*132f818dSEnji Cooperm4_define([_PKG_CONFIG],
135*132f818dSEnji Cooper[if test -n "$$1"; then
136*132f818dSEnji Cooper    pkg_cv_[]$1="$$1"
137*132f818dSEnji Cooper elif test -n "$PKG_CONFIG"; then
138*132f818dSEnji Cooper    PKG_CHECK_EXISTS([$3],
139*132f818dSEnji Cooper                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
140*132f818dSEnji Cooper		      test "x$?" != "x0" && pkg_failed=yes ],
141*132f818dSEnji Cooper		     [pkg_failed=yes])
142*132f818dSEnji Cooper else
143*132f818dSEnji Cooper    pkg_failed=untried
144*132f818dSEnji Cooperfi[]dnl
145*132f818dSEnji Cooper])dnl _PKG_CONFIG
146*132f818dSEnji Cooper
147*132f818dSEnji Cooperdnl _PKG_SHORT_ERRORS_SUPPORTED
148*132f818dSEnji Cooperdnl ---------------------------
149*132f818dSEnji Cooperdnl Internal check to see if pkg-config supports short errors.
150*132f818dSEnji CooperAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
151*132f818dSEnji Cooper[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
152*132f818dSEnji Cooperif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
153*132f818dSEnji Cooper        _pkg_short_errors_supported=yes
154*132f818dSEnji Cooperelse
155*132f818dSEnji Cooper        _pkg_short_errors_supported=no
156*132f818dSEnji Cooperfi[]dnl
157*132f818dSEnji Cooper])dnl _PKG_SHORT_ERRORS_SUPPORTED
158*132f818dSEnji Cooper
159*132f818dSEnji Cooper
160*132f818dSEnji Cooperdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
161*132f818dSEnji Cooperdnl   [ACTION-IF-NOT-FOUND])
162*132f818dSEnji Cooperdnl --------------------------------------------------------------
163*132f818dSEnji Cooperdnl Since: 0.4.0
164*132f818dSEnji Cooperdnl
165*132f818dSEnji Cooperdnl Note that if there is a possibility the first call to
166*132f818dSEnji Cooperdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
167*132f818dSEnji Cooperdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
168*132f818dSEnji CooperAC_DEFUN([PKG_CHECK_MODULES],
169*132f818dSEnji Cooper[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
170*132f818dSEnji CooperAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
171*132f818dSEnji CooperAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
172*132f818dSEnji Cooper
173*132f818dSEnji Cooperpkg_failed=no
174*132f818dSEnji CooperAC_MSG_CHECKING([for $2])
175*132f818dSEnji Cooper
176*132f818dSEnji Cooper_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
177*132f818dSEnji Cooper_PKG_CONFIG([$1][_LIBS], [libs], [$2])
178*132f818dSEnji Cooper
179*132f818dSEnji Cooperm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
180*132f818dSEnji Cooperand $1[]_LIBS to avoid the need to call pkg-config.
181*132f818dSEnji CooperSee the pkg-config man page for more details.])
182*132f818dSEnji Cooper
183*132f818dSEnji Cooperif test $pkg_failed = yes; then
184*132f818dSEnji Cooper        AC_MSG_RESULT([no])
185*132f818dSEnji Cooper        _PKG_SHORT_ERRORS_SUPPORTED
186*132f818dSEnji Cooper        if test $_pkg_short_errors_supported = yes; then
187*132f818dSEnji Cooper                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
188*132f818dSEnji Cooper        else
189*132f818dSEnji Cooper                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
190*132f818dSEnji Cooper        fi
191*132f818dSEnji Cooper        # Put the nasty error message in config.log where it belongs
192*132f818dSEnji Cooper        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
193*132f818dSEnji Cooper
194*132f818dSEnji Cooper        m4_default([$4], [AC_MSG_ERROR(
195*132f818dSEnji Cooper[Package requirements ($2) were not met:
196*132f818dSEnji Cooper
197*132f818dSEnji Cooper$$1_PKG_ERRORS
198*132f818dSEnji Cooper
199*132f818dSEnji CooperConsider adjusting the PKG_CONFIG_PATH environment variable if you
200*132f818dSEnji Cooperinstalled software in a non-standard prefix.
201*132f818dSEnji Cooper
202*132f818dSEnji Cooper_PKG_TEXT])[]dnl
203*132f818dSEnji Cooper        ])
204*132f818dSEnji Cooperelif test $pkg_failed = untried; then
205*132f818dSEnji Cooper        AC_MSG_RESULT([no])
206*132f818dSEnji Cooper        m4_default([$4], [AC_MSG_FAILURE(
207*132f818dSEnji Cooper[The pkg-config script could not be found or is too old.  Make sure it
208*132f818dSEnji Cooperis in your PATH or set the PKG_CONFIG environment variable to the full
209*132f818dSEnji Cooperpath to pkg-config.
210*132f818dSEnji Cooper
211*132f818dSEnji Cooper_PKG_TEXT
212*132f818dSEnji Cooper
213*132f818dSEnji CooperTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
214*132f818dSEnji Cooper        ])
215*132f818dSEnji Cooperelse
216*132f818dSEnji Cooper        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
217*132f818dSEnji Cooper        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
218*132f818dSEnji Cooper        AC_MSG_RESULT([yes])
219*132f818dSEnji Cooper        $3
220*132f818dSEnji Cooperfi[]dnl
221*132f818dSEnji Cooper])dnl PKG_CHECK_MODULES
222*132f818dSEnji Cooper
223*132f818dSEnji Cooper
224*132f818dSEnji Cooperdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
225*132f818dSEnji Cooperdnl   [ACTION-IF-NOT-FOUND])
226*132f818dSEnji Cooperdnl ---------------------------------------------------------------------
227*132f818dSEnji Cooperdnl Since: 0.29
228*132f818dSEnji Cooperdnl
229*132f818dSEnji Cooperdnl Checks for existence of MODULES and gathers its build flags with
230*132f818dSEnji Cooperdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
231*132f818dSEnji Cooperdnl and VARIABLE-PREFIX_LIBS from --libs.
232*132f818dSEnji Cooperdnl
233*132f818dSEnji Cooperdnl Note that if there is a possibility the first call to
234*132f818dSEnji Cooperdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
235*132f818dSEnji Cooperdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
236*132f818dSEnji Cooperdnl configure.ac.
237*132f818dSEnji CooperAC_DEFUN([PKG_CHECK_MODULES_STATIC],
238*132f818dSEnji Cooper[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
239*132f818dSEnji Cooper_save_PKG_CONFIG=$PKG_CONFIG
240*132f818dSEnji CooperPKG_CONFIG="$PKG_CONFIG --static"
241*132f818dSEnji CooperPKG_CHECK_MODULES($@)
242*132f818dSEnji CooperPKG_CONFIG=$_save_PKG_CONFIG[]dnl
243*132f818dSEnji Cooper])dnl PKG_CHECK_MODULES_STATIC
244*132f818dSEnji Cooper
245*132f818dSEnji Cooper
246*132f818dSEnji Cooperdnl PKG_INSTALLDIR([DIRECTORY])
247*132f818dSEnji Cooperdnl -------------------------
248*132f818dSEnji Cooperdnl Since: 0.27
249*132f818dSEnji Cooperdnl
250*132f818dSEnji Cooperdnl Substitutes the variable pkgconfigdir as the location where a module
251*132f818dSEnji Cooperdnl should install pkg-config .pc files. By default the directory is
252*132f818dSEnji Cooperdnl $libdir/pkgconfig, but the default can be changed by passing
253*132f818dSEnji Cooperdnl DIRECTORY. The user can override through the --with-pkgconfigdir
254*132f818dSEnji Cooperdnl parameter.
255*132f818dSEnji CooperAC_DEFUN([PKG_INSTALLDIR],
256*132f818dSEnji Cooper[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
257*132f818dSEnji Cooperm4_pushdef([pkg_description],
258*132f818dSEnji Cooper    [pkg-config installation directory @<:@]pkg_default[@:>@])
259*132f818dSEnji CooperAC_ARG_WITH([pkgconfigdir],
260*132f818dSEnji Cooper    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
261*132f818dSEnji Cooper    [with_pkgconfigdir=]pkg_default)
262*132f818dSEnji CooperAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
263*132f818dSEnji Cooperm4_popdef([pkg_default])
264*132f818dSEnji Cooperm4_popdef([pkg_description])
265*132f818dSEnji Cooper])dnl PKG_INSTALLDIR
266*132f818dSEnji Cooper
267*132f818dSEnji Cooper
268*132f818dSEnji Cooperdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
269*132f818dSEnji Cooperdnl --------------------------------
270*132f818dSEnji Cooperdnl Since: 0.27
271*132f818dSEnji Cooperdnl
272*132f818dSEnji Cooperdnl Substitutes the variable noarch_pkgconfigdir as the location where a
273*132f818dSEnji Cooperdnl module should install arch-independent pkg-config .pc files. By
274*132f818dSEnji Cooperdnl default the directory is $datadir/pkgconfig, but the default can be
275*132f818dSEnji Cooperdnl changed by passing DIRECTORY. The user can override through the
276*132f818dSEnji Cooperdnl --with-noarch-pkgconfigdir parameter.
277*132f818dSEnji CooperAC_DEFUN([PKG_NOARCH_INSTALLDIR],
278*132f818dSEnji Cooper[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
279*132f818dSEnji Cooperm4_pushdef([pkg_description],
280*132f818dSEnji Cooper    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
281*132f818dSEnji CooperAC_ARG_WITH([noarch-pkgconfigdir],
282*132f818dSEnji Cooper    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
283*132f818dSEnji Cooper    [with_noarch_pkgconfigdir=]pkg_default)
284*132f818dSEnji CooperAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
285*132f818dSEnji Cooperm4_popdef([pkg_default])
286*132f818dSEnji Cooperm4_popdef([pkg_description])
287*132f818dSEnji Cooper])dnl PKG_NOARCH_INSTALLDIR
288*132f818dSEnji Cooper
289*132f818dSEnji Cooper
290*132f818dSEnji Cooperdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
291*132f818dSEnji Cooperdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
292*132f818dSEnji Cooperdnl -------------------------------------------
293*132f818dSEnji Cooperdnl Since: 0.28
294*132f818dSEnji Cooperdnl
295*132f818dSEnji Cooperdnl Retrieves the value of the pkg-config variable for the given module.
296*132f818dSEnji CooperAC_DEFUN([PKG_CHECK_VAR],
297*132f818dSEnji Cooper[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
298*132f818dSEnji CooperAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
299*132f818dSEnji Cooper
300*132f818dSEnji Cooper_PKG_CONFIG([$1], [variable="][$3]["], [$2])
301*132f818dSEnji CooperAS_VAR_COPY([$1], [pkg_cv_][$1])
302*132f818dSEnji Cooper
303*132f818dSEnji CooperAS_VAR_IF([$1], [""], [$5], [$4])dnl
304*132f818dSEnji Cooper])dnl PKG_CHECK_VAR
305*132f818dSEnji Cooper
306*132f818dSEnji Cooperdnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
307*132f818dSEnji Cooperdnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
308*132f818dSEnji Cooperdnl   [DESCRIPTION], [DEFAULT])
309*132f818dSEnji Cooperdnl ------------------------------------------
310*132f818dSEnji Cooperdnl
311*132f818dSEnji Cooperdnl Prepare a "--with-" configure option using the lowercase
312*132f818dSEnji Cooperdnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
313*132f818dSEnji Cooperdnl PKG_CHECK_MODULES in a single macro.
314*132f818dSEnji CooperAC_DEFUN([PKG_WITH_MODULES],
315*132f818dSEnji Cooper[
316*132f818dSEnji Cooperm4_pushdef([with_arg], m4_tolower([$1]))
317*132f818dSEnji Cooper
318*132f818dSEnji Cooperm4_pushdef([description],
319*132f818dSEnji Cooper           [m4_default([$5], [build with ]with_arg[ support])])
320*132f818dSEnji Cooper
321*132f818dSEnji Cooperm4_pushdef([def_arg], [m4_default([$6], [auto])])
322*132f818dSEnji Cooperm4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
323*132f818dSEnji Cooperm4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
324*132f818dSEnji Cooper
325*132f818dSEnji Cooperm4_case(def_arg,
326*132f818dSEnji Cooper            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
327*132f818dSEnji Cooper            [m4_pushdef([with_without],[--with-]with_arg)])
328*132f818dSEnji Cooper
329*132f818dSEnji CooperAC_ARG_WITH(with_arg,
330*132f818dSEnji Cooper     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
331*132f818dSEnji Cooper    [AS_TR_SH([with_]with_arg)=def_arg])
332*132f818dSEnji Cooper
333*132f818dSEnji CooperAS_CASE([$AS_TR_SH([with_]with_arg)],
334*132f818dSEnji Cooper            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
335*132f818dSEnji Cooper            [auto],[PKG_CHECK_MODULES([$1],[$2],
336*132f818dSEnji Cooper                                        [m4_n([def_action_if_found]) $3],
337*132f818dSEnji Cooper                                        [m4_n([def_action_if_not_found]) $4])])
338*132f818dSEnji Cooper
339*132f818dSEnji Cooperm4_popdef([with_arg])
340*132f818dSEnji Cooperm4_popdef([description])
341*132f818dSEnji Cooperm4_popdef([def_arg])
342*132f818dSEnji Cooper
343*132f818dSEnji Cooper])dnl PKG_WITH_MODULES
344*132f818dSEnji Cooper
345*132f818dSEnji Cooperdnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
346*132f818dSEnji Cooperdnl   [DESCRIPTION], [DEFAULT])
347*132f818dSEnji Cooperdnl -----------------------------------------------
348*132f818dSEnji Cooperdnl
349*132f818dSEnji Cooperdnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
350*132f818dSEnji Cooperdnl check._[VARIABLE-PREFIX] is exported as make variable.
351*132f818dSEnji CooperAC_DEFUN([PKG_HAVE_WITH_MODULES],
352*132f818dSEnji Cooper[
353*132f818dSEnji CooperPKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
354*132f818dSEnji Cooper
355*132f818dSEnji CooperAM_CONDITIONAL([HAVE_][$1],
356*132f818dSEnji Cooper               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
357*132f818dSEnji Cooper])dnl PKG_HAVE_WITH_MODULES
358*132f818dSEnji Cooper
359*132f818dSEnji Cooperdnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
360*132f818dSEnji Cooperdnl   [DESCRIPTION], [DEFAULT])
361*132f818dSEnji Cooperdnl ------------------------------------------------------
362*132f818dSEnji Cooperdnl
363*132f818dSEnji Cooperdnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
364*132f818dSEnji Cooperdnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
365*132f818dSEnji Cooperdnl and preprocessor variable.
366*132f818dSEnji CooperAC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
367*132f818dSEnji Cooper[
368*132f818dSEnji CooperPKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
369*132f818dSEnji Cooper
370*132f818dSEnji CooperAS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
371*132f818dSEnji Cooper        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
372*132f818dSEnji Cooper])dnl PKG_HAVE_DEFINE_WITH_MODULES
373*132f818dSEnji Cooper
374*132f818dSEnji Cooper# Copyright (C) 2002-2024 Free Software Foundation, Inc.
375*132f818dSEnji Cooper#
376*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
377*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
378*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
379*132f818dSEnji Cooper
380*132f818dSEnji Cooper# AM_AUTOMAKE_VERSION(VERSION)
381*132f818dSEnji Cooper# ----------------------------
382*132f818dSEnji Cooper# Automake X.Y traces this macro to ensure aclocal.m4 has been
383*132f818dSEnji Cooper# generated from the m4 files accompanying Automake X.Y.
384*132f818dSEnji Cooper# (This private macro should not be called outside this file.)
385*132f818dSEnji CooperAC_DEFUN([AM_AUTOMAKE_VERSION],
386*132f818dSEnji Cooper[am__api_version='1.17'
387*132f818dSEnji Cooperdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
388*132f818dSEnji Cooperdnl require some minimum version.  Point them to the right macro.
389*132f818dSEnji Cooperm4_if([$1], [1.17], [],
390*132f818dSEnji Cooper      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
391*132f818dSEnji Cooper])
392*132f818dSEnji Cooper
393*132f818dSEnji Cooper# _AM_AUTOCONF_VERSION(VERSION)
394*132f818dSEnji Cooper# -----------------------------
395*132f818dSEnji Cooper# aclocal traces this macro to find the Autoconf version.
396*132f818dSEnji Cooper# This is a private macro too.  Using m4_define simplifies
397*132f818dSEnji Cooper# the logic in aclocal, which can simply ignore this definition.
398*132f818dSEnji Cooperm4_define([_AM_AUTOCONF_VERSION], [])
399*132f818dSEnji Cooper
400*132f818dSEnji Cooper# AM_SET_CURRENT_AUTOMAKE_VERSION
401*132f818dSEnji Cooper# -------------------------------
402*132f818dSEnji Cooper# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
403*132f818dSEnji Cooper# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
404*132f818dSEnji CooperAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
405*132f818dSEnji Cooper[AM_AUTOMAKE_VERSION([1.17])dnl
406*132f818dSEnji Cooperm4_ifndef([AC_AUTOCONF_VERSION],
407*132f818dSEnji Cooper  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
408*132f818dSEnji Cooper_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
409*132f818dSEnji Cooper
410*132f818dSEnji Cooper# Copyright (C) 2011-2024 Free Software Foundation, Inc.
411*132f818dSEnji Cooper#
412*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
413*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
414*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
415*132f818dSEnji Cooper
416*132f818dSEnji Cooper# AM_PROG_AR([ACT-IF-FAIL])
417*132f818dSEnji Cooper# -------------------------
418*132f818dSEnji Cooper# Try to determine the archiver interface, and trigger the ar-lib wrapper
419*132f818dSEnji Cooper# if it is needed.  If the detection of archiver interface fails, run
420*132f818dSEnji Cooper# ACT-IF-FAIL (default is to abort configure with a proper error message).
421*132f818dSEnji CooperAC_DEFUN([AM_PROG_AR],
422*132f818dSEnji Cooper[AC_BEFORE([$0], [LT_INIT])dnl
423*132f818dSEnji CooperAC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
424*132f818dSEnji CooperAC_BEFORE([$0], [AC_PROG_AR])dnl
425*132f818dSEnji CooperAC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
426*132f818dSEnji CooperAC_REQUIRE_AUX_FILE([ar-lib])dnl
427*132f818dSEnji CooperAC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
428*132f818dSEnji Cooper: ${AR=ar}
429*132f818dSEnji Cooper: ${ARFLAGS=cr}
430*132f818dSEnji Cooper
431*132f818dSEnji CooperAC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
432*132f818dSEnji Cooper  [AC_LANG_PUSH([C])
433*132f818dSEnji Cooper   am_cv_ar_interface=ar
434*132f818dSEnji Cooper   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
435*132f818dSEnji Cooper     [am_ar_try='$AR $ARFLAGS libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
436*132f818dSEnji Cooper      AC_TRY_EVAL([am_ar_try])
437*132f818dSEnji Cooper      if test "$ac_status" -eq 0; then
438*132f818dSEnji Cooper        am_cv_ar_interface=ar
439*132f818dSEnji Cooper      else
440*132f818dSEnji Cooper        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
441*132f818dSEnji Cooper        AC_TRY_EVAL([am_ar_try])
442*132f818dSEnji Cooper        if test "$ac_status" -eq 0; then
443*132f818dSEnji Cooper          am_cv_ar_interface=lib
444*132f818dSEnji Cooper        else
445*132f818dSEnji Cooper          am_cv_ar_interface=unknown
446*132f818dSEnji Cooper        fi
447*132f818dSEnji Cooper      fi
448*132f818dSEnji Cooper      rm -f conftest.lib libconftest.a
449*132f818dSEnji Cooper     ])
450*132f818dSEnji Cooper   AC_LANG_POP([C])])
451*132f818dSEnji Cooper
452*132f818dSEnji Coopercase $am_cv_ar_interface in
453*132f818dSEnji Cooperar)
454*132f818dSEnji Cooper  ;;
455*132f818dSEnji Cooperlib)
456*132f818dSEnji Cooper  # Microsoft lib, so override with the ar-lib wrapper script.
457*132f818dSEnji Cooper  # FIXME: It is wrong to rewrite AR.
458*132f818dSEnji Cooper  # But if we don't then we get into trouble of one sort or another.
459*132f818dSEnji Cooper  # A longer-term fix would be to have automake use am__AR in this case,
460*132f818dSEnji Cooper  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
461*132f818dSEnji Cooper  # similar.
462*132f818dSEnji Cooper  AR="$am_aux_dir/ar-lib $AR"
463*132f818dSEnji Cooper  ;;
464*132f818dSEnji Cooperunknown)
465*132f818dSEnji Cooper  m4_default([$1],
466*132f818dSEnji Cooper             [AC_MSG_ERROR([could not determine $AR interface])])
467*132f818dSEnji Cooper  ;;
468*132f818dSEnji Cooperesac
469*132f818dSEnji CooperAC_SUBST([AR])dnl
470*132f818dSEnji Cooper])
471*132f818dSEnji Cooper
472*132f818dSEnji Cooper# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
473*132f818dSEnji Cooper
474*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
475*132f818dSEnji Cooper#
476*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
477*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
478*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
479*132f818dSEnji Cooper
480*132f818dSEnji Cooper# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
481*132f818dSEnji Cooper# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
482*132f818dSEnji Cooper# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
483*132f818dSEnji Cooper#
484*132f818dSEnji Cooper# Of course, Automake must honor this variable whenever it calls a
485*132f818dSEnji Cooper# tool from the auxiliary directory.  The problem is that $srcdir (and
486*132f818dSEnji Cooper# therefore $ac_aux_dir as well) can be either absolute or relative,
487*132f818dSEnji Cooper# depending on how configure is run.  This is pretty annoying, since
488*132f818dSEnji Cooper# it makes $ac_aux_dir quite unusable in subdirectories: in the top
489*132f818dSEnji Cooper# source directory, any form will work fine, but in subdirectories a
490*132f818dSEnji Cooper# relative path needs to be adjusted first.
491*132f818dSEnji Cooper#
492*132f818dSEnji Cooper# $ac_aux_dir/missing
493*132f818dSEnji Cooper#    fails when called from a subdirectory if $ac_aux_dir is relative
494*132f818dSEnji Cooper# $top_srcdir/$ac_aux_dir/missing
495*132f818dSEnji Cooper#    fails if $ac_aux_dir is absolute,
496*132f818dSEnji Cooper#    fails when called from a subdirectory in a VPATH build with
497*132f818dSEnji Cooper#          a relative $ac_aux_dir
498*132f818dSEnji Cooper#
499*132f818dSEnji Cooper# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
500*132f818dSEnji Cooper# are both prefixed by $srcdir.  In an in-source build this is usually
501*132f818dSEnji Cooper# harmless because $srcdir is '.', but things will broke when you
502*132f818dSEnji Cooper# start a VPATH build or use an absolute $srcdir.
503*132f818dSEnji Cooper#
504*132f818dSEnji Cooper# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
505*132f818dSEnji Cooper# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
506*132f818dSEnji Cooper#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
507*132f818dSEnji Cooper# and then we would define $MISSING as
508*132f818dSEnji Cooper#   MISSING="\${SHELL} $am_aux_dir/missing"
509*132f818dSEnji Cooper# This will work as long as MISSING is not called from configure, because
510*132f818dSEnji Cooper# unfortunately $(top_srcdir) has no meaning in configure.
511*132f818dSEnji Cooper# However there are other variables, like CC, which are often used in
512*132f818dSEnji Cooper# configure, and could therefore not use this "fixed" $ac_aux_dir.
513*132f818dSEnji Cooper#
514*132f818dSEnji Cooper# Another solution, used here, is to always expand $ac_aux_dir to an
515*132f818dSEnji Cooper# absolute PATH.  The drawback is that using absolute paths prevent a
516*132f818dSEnji Cooper# configured tree to be moved without reconfiguration.
517*132f818dSEnji Cooper
518*132f818dSEnji CooperAC_DEFUN([AM_AUX_DIR_EXPAND],
519*132f818dSEnji Cooper[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
520*132f818dSEnji Cooper# Expand $ac_aux_dir to an absolute path.
521*132f818dSEnji Cooperam_aux_dir=`cd "$ac_aux_dir" && pwd`
522*132f818dSEnji Cooper])
523*132f818dSEnji Cooper
524*132f818dSEnji Cooper# AM_CONDITIONAL                                            -*- Autoconf -*-
525*132f818dSEnji Cooper
526*132f818dSEnji Cooper# Copyright (C) 1997-2024 Free Software Foundation, Inc.
527*132f818dSEnji Cooper#
528*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
529*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
530*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
531*132f818dSEnji Cooper
532*132f818dSEnji Cooper# AM_CONDITIONAL(NAME, SHELL-CONDITION)
533*132f818dSEnji Cooper# -------------------------------------
534*132f818dSEnji Cooper# Define a conditional.
535*132f818dSEnji CooperAC_DEFUN([AM_CONDITIONAL],
536*132f818dSEnji Cooper[AC_PREREQ([2.52])dnl
537*132f818dSEnji Cooper m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
538*132f818dSEnji Cooper       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
539*132f818dSEnji CooperAC_SUBST([$1_TRUE])dnl
540*132f818dSEnji CooperAC_SUBST([$1_FALSE])dnl
541*132f818dSEnji Cooper_AM_SUBST_NOTMAKE([$1_TRUE])dnl
542*132f818dSEnji Cooper_AM_SUBST_NOTMAKE([$1_FALSE])dnl
543*132f818dSEnji Cooperm4_define([_AM_COND_VALUE_$1], [$2])dnl
544*132f818dSEnji Cooperif $2; then
545*132f818dSEnji Cooper  $1_TRUE=
546*132f818dSEnji Cooper  $1_FALSE='#'
547*132f818dSEnji Cooperelse
548*132f818dSEnji Cooper  $1_TRUE='#'
549*132f818dSEnji Cooper  $1_FALSE=
550*132f818dSEnji Cooperfi
551*132f818dSEnji CooperAC_CONFIG_COMMANDS_PRE(
552*132f818dSEnji Cooper[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
553*132f818dSEnji Cooper  AC_MSG_ERROR([[conditional "$1" was never defined.
554*132f818dSEnji CooperUsually this means the macro was only invoked conditionally.]])
555*132f818dSEnji Cooperfi])])
556*132f818dSEnji Cooper
557*132f818dSEnji Cooper# Copyright (C) 1999-2024 Free Software Foundation, Inc.
558*132f818dSEnji Cooper#
559*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
560*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
561*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
562*132f818dSEnji Cooper
563*132f818dSEnji Cooper
564*132f818dSEnji Cooper# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
565*132f818dSEnji Cooper# written in clear, in which case automake, when reading aclocal.m4,
566*132f818dSEnji Cooper# will think it sees a *use*, and therefore will trigger all it's
567*132f818dSEnji Cooper# C support machinery.  Also note that it means that autoscan, seeing
568*132f818dSEnji Cooper# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
569*132f818dSEnji Cooper
570*132f818dSEnji Cooper
571*132f818dSEnji Cooper# _AM_DEPENDENCIES(NAME)
572*132f818dSEnji Cooper# ----------------------
573*132f818dSEnji Cooper# See how the compiler implements dependency checking.
574*132f818dSEnji Cooper# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
575*132f818dSEnji Cooper# We try a few techniques and use that to set a single cache variable.
576*132f818dSEnji Cooper#
577*132f818dSEnji Cooper# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
578*132f818dSEnji Cooper# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
579*132f818dSEnji Cooper# dependency, and given that the user is not expected to run this macro,
580*132f818dSEnji Cooper# just rely on AC_PROG_CC.
581*132f818dSEnji CooperAC_DEFUN([_AM_DEPENDENCIES],
582*132f818dSEnji Cooper[AC_REQUIRE([AM_SET_DEPDIR])dnl
583*132f818dSEnji CooperAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
584*132f818dSEnji CooperAC_REQUIRE([AM_MAKE_INCLUDE])dnl
585*132f818dSEnji CooperAC_REQUIRE([AM_DEP_TRACK])dnl
586*132f818dSEnji Cooper
587*132f818dSEnji Cooperm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
588*132f818dSEnji Cooper      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
589*132f818dSEnji Cooper      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
590*132f818dSEnji Cooper      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
591*132f818dSEnji Cooper      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
592*132f818dSEnji Cooper      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
593*132f818dSEnji Cooper                    [depcc="$$1"   am_compiler_list=])
594*132f818dSEnji Cooper
595*132f818dSEnji CooperAC_CACHE_CHECK([dependency style of $depcc],
596*132f818dSEnji Cooper               [am_cv_$1_dependencies_compiler_type],
597*132f818dSEnji Cooper[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
598*132f818dSEnji Cooper  # We make a subdir and do the tests there.  Otherwise we can end up
599*132f818dSEnji Cooper  # making bogus files that we don't know about and never remove.  For
600*132f818dSEnji Cooper  # instance it was reported that on HP-UX the gcc test will end up
601*132f818dSEnji Cooper  # making a dummy file named 'D' -- because '-MD' means "put the output
602*132f818dSEnji Cooper  # in D".
603*132f818dSEnji Cooper  rm -rf conftest.dir
604*132f818dSEnji Cooper  mkdir conftest.dir
605*132f818dSEnji Cooper  # Copy depcomp to subdir because otherwise we won't find it if we're
606*132f818dSEnji Cooper  # using a relative directory.
607*132f818dSEnji Cooper  cp "$am_depcomp" conftest.dir
608*132f818dSEnji Cooper  cd conftest.dir
609*132f818dSEnji Cooper  # We will build objects and dependencies in a subdirectory because
610*132f818dSEnji Cooper  # it helps to detect inapplicable dependency modes.  For instance
611*132f818dSEnji Cooper  # both Tru64's cc and ICC support -MD to output dependencies as a
612*132f818dSEnji Cooper  # side effect of compilation, but ICC will put the dependencies in
613*132f818dSEnji Cooper  # the current directory while Tru64 will put them in the object
614*132f818dSEnji Cooper  # directory.
615*132f818dSEnji Cooper  mkdir sub
616*132f818dSEnji Cooper
617*132f818dSEnji Cooper  am_cv_$1_dependencies_compiler_type=none
618*132f818dSEnji Cooper  if test "$am_compiler_list" = ""; then
619*132f818dSEnji Cooper     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
620*132f818dSEnji Cooper  fi
621*132f818dSEnji Cooper  am__universal=false
622*132f818dSEnji Cooper  m4_case([$1], [CC],
623*132f818dSEnji Cooper    [case " $depcc " in #(
624*132f818dSEnji Cooper     *\ -arch\ *\ -arch\ *) am__universal=true ;;
625*132f818dSEnji Cooper     esac],
626*132f818dSEnji Cooper    [CXX],
627*132f818dSEnji Cooper    [case " $depcc " in #(
628*132f818dSEnji Cooper     *\ -arch\ *\ -arch\ *) am__universal=true ;;
629*132f818dSEnji Cooper     esac])
630*132f818dSEnji Cooper
631*132f818dSEnji Cooper  for depmode in $am_compiler_list; do
632*132f818dSEnji Cooper    # Setup a source with many dependencies, because some compilers
633*132f818dSEnji Cooper    # like to wrap large dependency lists on column 80 (with \), and
634*132f818dSEnji Cooper    # we should not choose a depcomp mode which is confused by this.
635*132f818dSEnji Cooper    #
636*132f818dSEnji Cooper    # We need to recreate these files for each test, as the compiler may
637*132f818dSEnji Cooper    # overwrite some of them when testing with obscure command lines.
638*132f818dSEnji Cooper    # This happens at least with the AIX C compiler.
639*132f818dSEnji Cooper    : > sub/conftest.c
640*132f818dSEnji Cooper    for i in 1 2 3 4 5 6; do
641*132f818dSEnji Cooper      echo '#include "conftst'$i'.h"' >> sub/conftest.c
642*132f818dSEnji Cooper      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
643*132f818dSEnji Cooper      # Solaris 10 /bin/sh.
644*132f818dSEnji Cooper      echo '/* dummy */' > sub/conftst$i.h
645*132f818dSEnji Cooper    done
646*132f818dSEnji Cooper    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
647*132f818dSEnji Cooper
648*132f818dSEnji Cooper    # We check with '-c' and '-o' for the sake of the "dashmstdout"
649*132f818dSEnji Cooper    # mode.  It turns out that the SunPro C++ compiler does not properly
650*132f818dSEnji Cooper    # handle '-M -o', and we need to detect this.  Also, some Intel
651*132f818dSEnji Cooper    # versions had trouble with output in subdirs.
652*132f818dSEnji Cooper    am__obj=sub/conftest.${OBJEXT-o}
653*132f818dSEnji Cooper    am__minus_obj="-o $am__obj"
654*132f818dSEnji Cooper    case $depmode in
655*132f818dSEnji Cooper    gcc)
656*132f818dSEnji Cooper      # This depmode causes a compiler race in universal mode.
657*132f818dSEnji Cooper      test "$am__universal" = false || continue
658*132f818dSEnji Cooper      ;;
659*132f818dSEnji Cooper    nosideeffect)
660*132f818dSEnji Cooper      # After this tag, mechanisms are not by side-effect, so they'll
661*132f818dSEnji Cooper      # only be used when explicitly requested.
662*132f818dSEnji Cooper      if test "x$enable_dependency_tracking" = xyes; then
663*132f818dSEnji Cooper	continue
664*132f818dSEnji Cooper      else
665*132f818dSEnji Cooper	break
666*132f818dSEnji Cooper      fi
667*132f818dSEnji Cooper      ;;
668*132f818dSEnji Cooper    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
669*132f818dSEnji Cooper      # This compiler won't grok '-c -o', but also, the minuso test has
670*132f818dSEnji Cooper      # not run yet.  These depmodes are late enough in the game, and
671*132f818dSEnji Cooper      # so weak that their functioning should not be impacted.
672*132f818dSEnji Cooper      am__obj=conftest.${OBJEXT-o}
673*132f818dSEnji Cooper      am__minus_obj=
674*132f818dSEnji Cooper      ;;
675*132f818dSEnji Cooper    none) break ;;
676*132f818dSEnji Cooper    esac
677*132f818dSEnji Cooper    if depmode=$depmode \
678*132f818dSEnji Cooper       source=sub/conftest.c object=$am__obj \
679*132f818dSEnji Cooper       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
680*132f818dSEnji Cooper       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
681*132f818dSEnji Cooper         >/dev/null 2>conftest.err &&
682*132f818dSEnji Cooper       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
683*132f818dSEnji Cooper       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
684*132f818dSEnji Cooper       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
685*132f818dSEnji Cooper       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
686*132f818dSEnji Cooper      # icc doesn't choke on unknown options, it will just issue warnings
687*132f818dSEnji Cooper      # or remarks (even with -Werror).  So we grep stderr for any message
688*132f818dSEnji Cooper      # that says an option was ignored or not supported.
689*132f818dSEnji Cooper      # When given -MP, icc 7.0 and 7.1 complain thus:
690*132f818dSEnji Cooper      #   icc: Command line warning: ignoring option '-M'; no argument required
691*132f818dSEnji Cooper      # The diagnosis changed in icc 8.0:
692*132f818dSEnji Cooper      #   icc: Command line remark: option '-MP' not supported
693*132f818dSEnji Cooper      if (grep 'ignoring option' conftest.err ||
694*132f818dSEnji Cooper          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
695*132f818dSEnji Cooper        am_cv_$1_dependencies_compiler_type=$depmode
696*132f818dSEnji Cooper        break
697*132f818dSEnji Cooper      fi
698*132f818dSEnji Cooper    fi
699*132f818dSEnji Cooper  done
700*132f818dSEnji Cooper
701*132f818dSEnji Cooper  cd ..
702*132f818dSEnji Cooper  rm -rf conftest.dir
703*132f818dSEnji Cooperelse
704*132f818dSEnji Cooper  am_cv_$1_dependencies_compiler_type=none
705*132f818dSEnji Cooperfi
706*132f818dSEnji Cooper])
707*132f818dSEnji CooperAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
708*132f818dSEnji CooperAM_CONDITIONAL([am__fastdep$1], [
709*132f818dSEnji Cooper  test "x$enable_dependency_tracking" != xno \
710*132f818dSEnji Cooper  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
711*132f818dSEnji Cooper])
712*132f818dSEnji Cooper
713*132f818dSEnji Cooper
714*132f818dSEnji Cooper# AM_SET_DEPDIR
715*132f818dSEnji Cooper# -------------
716*132f818dSEnji Cooper# Choose a directory name for dependency files.
717*132f818dSEnji Cooper# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
718*132f818dSEnji CooperAC_DEFUN([AM_SET_DEPDIR],
719*132f818dSEnji Cooper[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
720*132f818dSEnji CooperAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
721*132f818dSEnji Cooper])
722*132f818dSEnji Cooper
723*132f818dSEnji Cooper
724*132f818dSEnji Cooper# AM_DEP_TRACK
725*132f818dSEnji Cooper# ------------
726*132f818dSEnji CooperAC_DEFUN([AM_DEP_TRACK],
727*132f818dSEnji Cooper[AC_ARG_ENABLE([dependency-tracking], [dnl
728*132f818dSEnji CooperAS_HELP_STRING(
729*132f818dSEnji Cooper  [--enable-dependency-tracking],
730*132f818dSEnji Cooper  [do not reject slow dependency extractors])
731*132f818dSEnji CooperAS_HELP_STRING(
732*132f818dSEnji Cooper  [--disable-dependency-tracking],
733*132f818dSEnji Cooper  [speeds up one-time build])])
734*132f818dSEnji Cooperif test "x$enable_dependency_tracking" != xno; then
735*132f818dSEnji Cooper  am_depcomp="$ac_aux_dir/depcomp"
736*132f818dSEnji Cooper  AMDEPBACKSLASH='\'
737*132f818dSEnji Cooper  am__nodep='_no'
738*132f818dSEnji Cooperfi
739*132f818dSEnji CooperAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
740*132f818dSEnji CooperAC_SUBST([AMDEPBACKSLASH])dnl
741*132f818dSEnji Cooper_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
742*132f818dSEnji CooperAC_SUBST([am__nodep])dnl
743*132f818dSEnji Cooper_AM_SUBST_NOTMAKE([am__nodep])dnl
744*132f818dSEnji Cooper])
745*132f818dSEnji Cooper
746*132f818dSEnji Cooper# Generate code to set up dependency tracking.              -*- Autoconf -*-
747*132f818dSEnji Cooper
748*132f818dSEnji Cooper# Copyright (C) 1999-2024 Free Software Foundation, Inc.
749*132f818dSEnji Cooper#
750*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
751*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
752*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
753*132f818dSEnji Cooper
754*132f818dSEnji Cooper# _AM_OUTPUT_DEPENDENCY_COMMANDS
755*132f818dSEnji Cooper# ------------------------------
756*132f818dSEnji CooperAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
757*132f818dSEnji Cooper[{
758*132f818dSEnji Cooper  # Older Autoconf quotes --file arguments for eval, but not when files
759*132f818dSEnji Cooper  # are listed without --file.  Let's play safe and only enable the eval
760*132f818dSEnji Cooper  # if we detect the quoting.
761*132f818dSEnji Cooper  # TODO: see whether this extra hack can be removed once we start
762*132f818dSEnji Cooper  # requiring Autoconf 2.70 or later.
763*132f818dSEnji Cooper  AS_CASE([$CONFIG_FILES],
764*132f818dSEnji Cooper          [*\'*], [eval set x "$CONFIG_FILES"],
765*132f818dSEnji Cooper          [*], [set x $CONFIG_FILES])
766*132f818dSEnji Cooper  shift
767*132f818dSEnji Cooper  # Used to flag and report bootstrapping failures.
768*132f818dSEnji Cooper  am_rc=0
769*132f818dSEnji Cooper  for am_mf
770*132f818dSEnji Cooper  do
771*132f818dSEnji Cooper    # Strip MF so we end up with the name of the file.
772*132f818dSEnji Cooper    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
773*132f818dSEnji Cooper    # Check whether this is an Automake generated Makefile which includes
774*132f818dSEnji Cooper    # dependency-tracking related rules and includes.
775*132f818dSEnji Cooper    # Grep'ing the whole file directly is not great: AIX grep has a line
776*132f818dSEnji Cooper    # limit of 2048, but all sed's we know have understand at least 4000.
777*132f818dSEnji Cooper    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
778*132f818dSEnji Cooper      || continue
779*132f818dSEnji Cooper    am_dirpart=`AS_DIRNAME(["$am_mf"])`
780*132f818dSEnji Cooper    am_filepart=`AS_BASENAME(["$am_mf"])`
781*132f818dSEnji Cooper    AM_RUN_LOG([cd "$am_dirpart" \
782*132f818dSEnji Cooper      && sed -e '/# am--include-marker/d' "$am_filepart" \
783*132f818dSEnji Cooper        | $MAKE -f - am--depfiles]) || am_rc=$?
784*132f818dSEnji Cooper  done
785*132f818dSEnji Cooper  if test $am_rc -ne 0; then
786*132f818dSEnji Cooper    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
787*132f818dSEnji Cooper    for automatic dependency tracking.  If GNU make was not used, consider
788*132f818dSEnji Cooper    re-running the configure script with MAKE="gmake" (or whatever is
789*132f818dSEnji Cooper    necessary).  You can also try re-running configure with the
790*132f818dSEnji Cooper    '--disable-dependency-tracking' option to at least be able to build
791*132f818dSEnji Cooper    the package (albeit without support for automatic dependency tracking).])
792*132f818dSEnji Cooper  fi
793*132f818dSEnji Cooper  AS_UNSET([am_dirpart])
794*132f818dSEnji Cooper  AS_UNSET([am_filepart])
795*132f818dSEnji Cooper  AS_UNSET([am_mf])
796*132f818dSEnji Cooper  AS_UNSET([am_rc])
797*132f818dSEnji Cooper  rm -f conftest-deps.mk
798*132f818dSEnji Cooper}
799*132f818dSEnji Cooper])# _AM_OUTPUT_DEPENDENCY_COMMANDS
800*132f818dSEnji Cooper
801*132f818dSEnji Cooper
802*132f818dSEnji Cooper# AM_OUTPUT_DEPENDENCY_COMMANDS
803*132f818dSEnji Cooper# -----------------------------
804*132f818dSEnji Cooper# This macro should only be invoked once -- use via AC_REQUIRE.
805*132f818dSEnji Cooper#
806*132f818dSEnji Cooper# This code is only required when automatic dependency tracking is enabled.
807*132f818dSEnji Cooper# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
808*132f818dSEnji Cooper# order to bootstrap the dependency handling code.
809*132f818dSEnji CooperAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
810*132f818dSEnji Cooper[AC_CONFIG_COMMANDS([depfiles],
811*132f818dSEnji Cooper     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
812*132f818dSEnji Cooper     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
813*132f818dSEnji Cooper
814*132f818dSEnji Cooper# Do all the work for Automake.                             -*- Autoconf -*-
815*132f818dSEnji Cooper
816*132f818dSEnji Cooper# Copyright (C) 1996-2024 Free Software Foundation, Inc.
817*132f818dSEnji Cooper#
818*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
819*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
820*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
821*132f818dSEnji Cooper
822*132f818dSEnji Cooper# This macro actually does too much.  Some checks are only needed if
823*132f818dSEnji Cooper# your package does certain things.  But this isn't really a big deal.
824*132f818dSEnji Cooper
825*132f818dSEnji Cooperdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
826*132f818dSEnji Cooperm4_define([AC_PROG_CC],
827*132f818dSEnji Cooperm4_defn([AC_PROG_CC])
828*132f818dSEnji Cooper[_AM_PROG_CC_C_O
829*132f818dSEnji Cooper])
830*132f818dSEnji Cooper
831*132f818dSEnji Cooper# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
832*132f818dSEnji Cooper# AM_INIT_AUTOMAKE([OPTIONS])
833*132f818dSEnji Cooper# -----------------------------------------------
834*132f818dSEnji Cooper# The call with PACKAGE and VERSION arguments is the old style
835*132f818dSEnji Cooper# call (pre autoconf-2.50), which is being phased out.  PACKAGE
836*132f818dSEnji Cooper# and VERSION should now be passed to AC_INIT and removed from
837*132f818dSEnji Cooper# the call to AM_INIT_AUTOMAKE.
838*132f818dSEnji Cooper# We support both call styles for the transition.  After
839*132f818dSEnji Cooper# the next Automake release, Autoconf can make the AC_INIT
840*132f818dSEnji Cooper# arguments mandatory, and then we can depend on a new Autoconf
841*132f818dSEnji Cooper# release and drop the old call support.
842*132f818dSEnji CooperAC_DEFUN([AM_INIT_AUTOMAKE],
843*132f818dSEnji Cooper[AC_PREREQ([2.65])dnl
844*132f818dSEnji Cooperm4_ifdef([_$0_ALREADY_INIT],
845*132f818dSEnji Cooper  [m4_fatal([$0 expanded multiple times
846*132f818dSEnji Cooper]m4_defn([_$0_ALREADY_INIT]))],
847*132f818dSEnji Cooper  [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
848*132f818dSEnji Cooperdnl Autoconf wants to disallow AM_ names.  We explicitly allow
849*132f818dSEnji Cooperdnl the ones we care about.
850*132f818dSEnji Cooperm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
851*132f818dSEnji CooperAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
852*132f818dSEnji CooperAC_REQUIRE([AC_PROG_INSTALL])dnl
853*132f818dSEnji Cooperif test "`cd $srcdir && pwd`" != "`pwd`"; then
854*132f818dSEnji Cooper  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
855*132f818dSEnji Cooper  # is not polluted with repeated "-I."
856*132f818dSEnji Cooper  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
857*132f818dSEnji Cooper  # test to see if srcdir already configured
858*132f818dSEnji Cooper  if test -f $srcdir/config.status; then
859*132f818dSEnji Cooper    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
860*132f818dSEnji Cooper  fi
861*132f818dSEnji Cooperfi
862*132f818dSEnji Cooper
863*132f818dSEnji Cooper# test whether we have cygpath
864*132f818dSEnji Cooperif test -z "$CYGPATH_W"; then
865*132f818dSEnji Cooper  if (cygpath --version) >/dev/null 2>/dev/null; then
866*132f818dSEnji Cooper    CYGPATH_W='cygpath -w'
867*132f818dSEnji Cooper  else
868*132f818dSEnji Cooper    CYGPATH_W=echo
869*132f818dSEnji Cooper  fi
870*132f818dSEnji Cooperfi
871*132f818dSEnji CooperAC_SUBST([CYGPATH_W])
872*132f818dSEnji Cooper
873*132f818dSEnji Cooper# Define the identity of the package.
874*132f818dSEnji Cooperdnl Distinguish between old-style and new-style calls.
875*132f818dSEnji Cooperm4_ifval([$2],
876*132f818dSEnji Cooper[AC_DIAGNOSE([obsolete],
877*132f818dSEnji Cooper             [$0: two- and three-arguments forms are deprecated.])
878*132f818dSEnji Cooperm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
879*132f818dSEnji Cooper AC_SUBST([PACKAGE], [$1])dnl
880*132f818dSEnji Cooper AC_SUBST([VERSION], [$2])],
881*132f818dSEnji Cooper[_AM_SET_OPTIONS([$1])dnl
882*132f818dSEnji Cooperdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
883*132f818dSEnji Cooperm4_if(
884*132f818dSEnji Cooper  m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
885*132f818dSEnji Cooper  [ok:ok],,
886*132f818dSEnji Cooper  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
887*132f818dSEnji Cooper AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
888*132f818dSEnji Cooper AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
889*132f818dSEnji Cooper
890*132f818dSEnji Cooper_AM_IF_OPTION([no-define],,
891*132f818dSEnji Cooper[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
892*132f818dSEnji Cooper AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
893*132f818dSEnji Cooper
894*132f818dSEnji Cooper# Some tools Automake needs.
895*132f818dSEnji CooperAC_REQUIRE([AM_SANITY_CHECK])dnl
896*132f818dSEnji CooperAC_REQUIRE([AC_ARG_PROGRAM])dnl
897*132f818dSEnji CooperAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
898*132f818dSEnji CooperAM_MISSING_PROG([AUTOCONF], [autoconf])
899*132f818dSEnji CooperAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
900*132f818dSEnji CooperAM_MISSING_PROG([AUTOHEADER], [autoheader])
901*132f818dSEnji CooperAM_MISSING_PROG([MAKEINFO], [makeinfo])
902*132f818dSEnji CooperAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
903*132f818dSEnji CooperAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
904*132f818dSEnji CooperAC_REQUIRE([AC_PROG_MKDIR_P])dnl
905*132f818dSEnji Cooper# For better backward compatibility.  To be removed once Automake 1.9.x
906*132f818dSEnji Cooper# dies out for good.  For more background, see:
907*132f818dSEnji Cooper# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
908*132f818dSEnji Cooper# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
909*132f818dSEnji CooperAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
910*132f818dSEnji Cooper# We need awk for the "check" target (and possibly the TAP driver).  The
911*132f818dSEnji Cooper# system "awk" is bad on some platforms.
912*132f818dSEnji CooperAC_REQUIRE([AC_PROG_AWK])dnl
913*132f818dSEnji CooperAC_REQUIRE([AC_PROG_MAKE_SET])dnl
914*132f818dSEnji CooperAC_REQUIRE([AM_SET_LEADING_DOT])dnl
915*132f818dSEnji Cooper_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
916*132f818dSEnji Cooper	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
917*132f818dSEnji Cooper			     [_AM_PROG_TAR([v7])])])
918*132f818dSEnji Cooper_AM_IF_OPTION([no-dependencies],,
919*132f818dSEnji Cooper[AC_PROVIDE_IFELSE([AC_PROG_CC],
920*132f818dSEnji Cooper		  [_AM_DEPENDENCIES([CC])],
921*132f818dSEnji Cooper		  [m4_define([AC_PROG_CC],
922*132f818dSEnji Cooper			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
923*132f818dSEnji CooperAC_PROVIDE_IFELSE([AC_PROG_CXX],
924*132f818dSEnji Cooper		  [_AM_DEPENDENCIES([CXX])],
925*132f818dSEnji Cooper		  [m4_define([AC_PROG_CXX],
926*132f818dSEnji Cooper			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
927*132f818dSEnji CooperAC_PROVIDE_IFELSE([AC_PROG_OBJC],
928*132f818dSEnji Cooper		  [_AM_DEPENDENCIES([OBJC])],
929*132f818dSEnji Cooper		  [m4_define([AC_PROG_OBJC],
930*132f818dSEnji Cooper			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
931*132f818dSEnji CooperAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
932*132f818dSEnji Cooper		  [_AM_DEPENDENCIES([OBJCXX])],
933*132f818dSEnji Cooper		  [m4_define([AC_PROG_OBJCXX],
934*132f818dSEnji Cooper			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
935*132f818dSEnji Cooper])
936*132f818dSEnji Cooper# Variables for tags utilities; see am/tags.am
937*132f818dSEnji Cooperif test -z "$CTAGS"; then
938*132f818dSEnji Cooper  CTAGS=ctags
939*132f818dSEnji Cooperfi
940*132f818dSEnji CooperAC_SUBST([CTAGS])
941*132f818dSEnji Cooperif test -z "$ETAGS"; then
942*132f818dSEnji Cooper  ETAGS=etags
943*132f818dSEnji Cooperfi
944*132f818dSEnji CooperAC_SUBST([ETAGS])
945*132f818dSEnji Cooperif test -z "$CSCOPE"; then
946*132f818dSEnji Cooper  CSCOPE=cscope
947*132f818dSEnji Cooperfi
948*132f818dSEnji CooperAC_SUBST([CSCOPE])
949*132f818dSEnji Cooper
950*132f818dSEnji CooperAC_REQUIRE([_AM_SILENT_RULES])dnl
951*132f818dSEnji Cooperdnl The testsuite driver may need to know about EXEEXT, so add the
952*132f818dSEnji Cooperdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
953*132f818dSEnji Cooperdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
954*132f818dSEnji CooperAC_CONFIG_COMMANDS_PRE(dnl
955*132f818dSEnji Cooper[m4_provide_if([_AM_COMPILER_EXEEXT],
956*132f818dSEnji Cooper  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
957*132f818dSEnji Cooper
958*132f818dSEnji CooperAC_REQUIRE([_AM_PROG_RM_F])
959*132f818dSEnji CooperAC_REQUIRE([_AM_PROG_XARGS_N])
960*132f818dSEnji Cooper
961*132f818dSEnji Cooperdnl The trailing newline in this macro's definition is deliberate, for
962*132f818dSEnji Cooperdnl backward compatibility and to allow trailing 'dnl'-style comments
963*132f818dSEnji Cooperdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
964*132f818dSEnji Cooper])
965*132f818dSEnji Cooper
966*132f818dSEnji Cooperdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
967*132f818dSEnji Cooperdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
968*132f818dSEnji Cooperdnl mangled by Autoconf and run in a shell conditional statement.
969*132f818dSEnji Cooperm4_define([_AC_COMPILER_EXEEXT],
970*132f818dSEnji Cooperm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
971*132f818dSEnji Cooper
972*132f818dSEnji Cooper# When config.status generates a header, we must update the stamp-h file.
973*132f818dSEnji Cooper# This file resides in the same directory as the config header
974*132f818dSEnji Cooper# that is generated.  The stamp files are numbered to have different names.
975*132f818dSEnji Cooper
976*132f818dSEnji Cooper# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
977*132f818dSEnji Cooper# loop where config.status creates the headers, so we can generate
978*132f818dSEnji Cooper# our stamp files there.
979*132f818dSEnji CooperAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
980*132f818dSEnji Cooper[# Compute $1's index in $config_headers.
981*132f818dSEnji Cooper_am_arg=$1
982*132f818dSEnji Cooper_am_stamp_count=1
983*132f818dSEnji Cooperfor _am_header in $config_headers :; do
984*132f818dSEnji Cooper  case $_am_header in
985*132f818dSEnji Cooper    $_am_arg | $_am_arg:* )
986*132f818dSEnji Cooper      break ;;
987*132f818dSEnji Cooper    * )
988*132f818dSEnji Cooper      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
989*132f818dSEnji Cooper  esac
990*132f818dSEnji Cooperdone
991*132f818dSEnji Cooperecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
992*132f818dSEnji Cooper
993*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
994*132f818dSEnji Cooper#
995*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
996*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
997*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
998*132f818dSEnji Cooper
999*132f818dSEnji Cooper# AM_PROG_INSTALL_SH
1000*132f818dSEnji Cooper# ------------------
1001*132f818dSEnji Cooper# Define $install_sh.
1002*132f818dSEnji CooperAC_DEFUN([AM_PROG_INSTALL_SH],
1003*132f818dSEnji Cooper[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1004*132f818dSEnji Cooperif test x"${install_sh+set}" != xset; then
1005*132f818dSEnji Cooper  case $am_aux_dir in
1006*132f818dSEnji Cooper  *\ * | *\	*)
1007*132f818dSEnji Cooper    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1008*132f818dSEnji Cooper  *)
1009*132f818dSEnji Cooper    install_sh="\${SHELL} $am_aux_dir/install-sh"
1010*132f818dSEnji Cooper  esac
1011*132f818dSEnji Cooperfi
1012*132f818dSEnji CooperAC_SUBST([install_sh])])
1013*132f818dSEnji Cooper
1014*132f818dSEnji Cooper# Copyright (C) 2003-2024 Free Software Foundation, Inc.
1015*132f818dSEnji Cooper#
1016*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1017*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1018*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1019*132f818dSEnji Cooper
1020*132f818dSEnji Cooper# Check whether the underlying file-system supports filenames
1021*132f818dSEnji Cooper# with a leading dot.  For instance MS-DOS doesn't.
1022*132f818dSEnji CooperAC_DEFUN([AM_SET_LEADING_DOT],
1023*132f818dSEnji Cooper[rm -rf .tst 2>/dev/null
1024*132f818dSEnji Coopermkdir .tst 2>/dev/null
1025*132f818dSEnji Cooperif test -d .tst; then
1026*132f818dSEnji Cooper  am__leading_dot=.
1027*132f818dSEnji Cooperelse
1028*132f818dSEnji Cooper  am__leading_dot=_
1029*132f818dSEnji Cooperfi
1030*132f818dSEnji Cooperrmdir .tst 2>/dev/null
1031*132f818dSEnji CooperAC_SUBST([am__leading_dot])])
1032*132f818dSEnji Cooper
1033*132f818dSEnji Cooper# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1034*132f818dSEnji Cooper
1035*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
1036*132f818dSEnji Cooper#
1037*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1038*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1039*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1040*132f818dSEnji Cooper
1041*132f818dSEnji Cooper# AM_MAKE_INCLUDE()
1042*132f818dSEnji Cooper# -----------------
1043*132f818dSEnji Cooper# Check whether make has an 'include' directive that can support all
1044*132f818dSEnji Cooper# the idioms we need for our automatic dependency tracking code.
1045*132f818dSEnji CooperAC_DEFUN([AM_MAKE_INCLUDE],
1046*132f818dSEnji Cooper[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
1047*132f818dSEnji Coopercat > confinc.mk << 'END'
1048*132f818dSEnji Cooperam__doit:
1049*132f818dSEnji Cooper	@echo this is the am__doit target >confinc.out
1050*132f818dSEnji Cooper.PHONY: am__doit
1051*132f818dSEnji CooperEND
1052*132f818dSEnji Cooperam__include="#"
1053*132f818dSEnji Cooperam__quote=
1054*132f818dSEnji Cooper# BSD make does it like this.
1055*132f818dSEnji Cooperecho '.include "confinc.mk" # ignored' > confmf.BSD
1056*132f818dSEnji Cooper# Other make implementations (GNU, Solaris 10, AIX) do it like this.
1057*132f818dSEnji Cooperecho 'include confinc.mk # ignored' > confmf.GNU
1058*132f818dSEnji Cooper_am_result=no
1059*132f818dSEnji Cooperfor s in GNU BSD; do
1060*132f818dSEnji Cooper  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
1061*132f818dSEnji Cooper  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
1062*132f818dSEnji Cooper      ['0:this is the am__doit target'],
1063*132f818dSEnji Cooper      [AS_CASE([$s],
1064*132f818dSEnji Cooper          [BSD], [am__include='.include' am__quote='"'],
1065*132f818dSEnji Cooper          [am__include='include' am__quote=''])])
1066*132f818dSEnji Cooper  if test "$am__include" != "#"; then
1067*132f818dSEnji Cooper    _am_result="yes ($s style)"
1068*132f818dSEnji Cooper    break
1069*132f818dSEnji Cooper  fi
1070*132f818dSEnji Cooperdone
1071*132f818dSEnji Cooperrm -f confinc.* confmf.*
1072*132f818dSEnji CooperAC_MSG_RESULT([${_am_result}])
1073*132f818dSEnji CooperAC_SUBST([am__include])])
1074*132f818dSEnji CooperAC_SUBST([am__quote])])
1075*132f818dSEnji Cooper
1076*132f818dSEnji Cooper# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1077*132f818dSEnji Cooper
1078*132f818dSEnji Cooper# Copyright (C) 1997-2024 Free Software Foundation, Inc.
1079*132f818dSEnji Cooper#
1080*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1081*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1082*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1083*132f818dSEnji Cooper
1084*132f818dSEnji Cooper# AM_MISSING_PROG(NAME, PROGRAM)
1085*132f818dSEnji Cooper# ------------------------------
1086*132f818dSEnji CooperAC_DEFUN([AM_MISSING_PROG],
1087*132f818dSEnji Cooper[AC_REQUIRE([AM_MISSING_HAS_RUN])
1088*132f818dSEnji Cooper$1=${$1-"${am_missing_run}$2"}
1089*132f818dSEnji CooperAC_SUBST($1)])
1090*132f818dSEnji Cooper
1091*132f818dSEnji Cooper# AM_MISSING_HAS_RUN
1092*132f818dSEnji Cooper# ------------------
1093*132f818dSEnji Cooper# Define MISSING if not defined so far and test if it is modern enough.
1094*132f818dSEnji Cooper# If it is, set am_missing_run to use it, otherwise, to nothing.
1095*132f818dSEnji CooperAC_DEFUN([AM_MISSING_HAS_RUN],
1096*132f818dSEnji Cooper[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1097*132f818dSEnji CooperAC_REQUIRE_AUX_FILE([missing])dnl
1098*132f818dSEnji Cooperif test x"${MISSING+set}" != xset; then
1099*132f818dSEnji Cooper  MISSING="\${SHELL} '$am_aux_dir/missing'"
1100*132f818dSEnji Cooperfi
1101*132f818dSEnji Cooper# Use eval to expand $SHELL
1102*132f818dSEnji Cooperif eval "$MISSING --is-lightweight"; then
1103*132f818dSEnji Cooper  am_missing_run="$MISSING "
1104*132f818dSEnji Cooperelse
1105*132f818dSEnji Cooper  am_missing_run=
1106*132f818dSEnji Cooper  AC_MSG_WARN(['missing' script is too old or missing])
1107*132f818dSEnji Cooperfi
1108*132f818dSEnji Cooper])
1109*132f818dSEnji Cooper
1110*132f818dSEnji Cooper# Helper functions for option handling.                     -*- Autoconf -*-
1111*132f818dSEnji Cooper
1112*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
1113*132f818dSEnji Cooper#
1114*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1115*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1116*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1117*132f818dSEnji Cooper
1118*132f818dSEnji Cooper# _AM_MANGLE_OPTION(NAME)
1119*132f818dSEnji Cooper# -----------------------
1120*132f818dSEnji CooperAC_DEFUN([_AM_MANGLE_OPTION],
1121*132f818dSEnji Cooper[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1122*132f818dSEnji Cooper
1123*132f818dSEnji Cooper# _AM_SET_OPTION(NAME)
1124*132f818dSEnji Cooper# --------------------
1125*132f818dSEnji Cooper# Set option NAME.  Presently that only means defining a flag for this option.
1126*132f818dSEnji CooperAC_DEFUN([_AM_SET_OPTION],
1127*132f818dSEnji Cooper[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1128*132f818dSEnji Cooper
1129*132f818dSEnji Cooper# _AM_SET_OPTIONS(OPTIONS)
1130*132f818dSEnji Cooper# ------------------------
1131*132f818dSEnji Cooper# OPTIONS is a space-separated list of Automake options.
1132*132f818dSEnji CooperAC_DEFUN([_AM_SET_OPTIONS],
1133*132f818dSEnji Cooper[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1134*132f818dSEnji Cooper
1135*132f818dSEnji Cooper# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1136*132f818dSEnji Cooper# -------------------------------------------
1137*132f818dSEnji Cooper# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1138*132f818dSEnji CooperAC_DEFUN([_AM_IF_OPTION],
1139*132f818dSEnji Cooper[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1140*132f818dSEnji Cooper
1141*132f818dSEnji Cooper# Copyright (C) 1999-2024 Free Software Foundation, Inc.
1142*132f818dSEnji Cooper#
1143*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1144*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1145*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1146*132f818dSEnji Cooper
1147*132f818dSEnji Cooper# _AM_PROG_CC_C_O
1148*132f818dSEnji Cooper# ---------------
1149*132f818dSEnji Cooper# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
1150*132f818dSEnji Cooper# to automatically call this.
1151*132f818dSEnji CooperAC_DEFUN([_AM_PROG_CC_C_O],
1152*132f818dSEnji Cooper[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1153*132f818dSEnji CooperAC_REQUIRE_AUX_FILE([compile])dnl
1154*132f818dSEnji CooperAC_LANG_PUSH([C])dnl
1155*132f818dSEnji CooperAC_CACHE_CHECK(
1156*132f818dSEnji Cooper  [whether $CC understands -c and -o together],
1157*132f818dSEnji Cooper  [am_cv_prog_cc_c_o],
1158*132f818dSEnji Cooper  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
1159*132f818dSEnji Cooper  # Make sure it works both with $CC and with simple cc.
1160*132f818dSEnji Cooper  # Following AC_PROG_CC_C_O, we do the test twice because some
1161*132f818dSEnji Cooper  # compilers refuse to overwrite an existing .o file with -o,
1162*132f818dSEnji Cooper  # though they will create one.
1163*132f818dSEnji Cooper  am_cv_prog_cc_c_o=yes
1164*132f818dSEnji Cooper  for am_i in 1 2; do
1165*132f818dSEnji Cooper    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
1166*132f818dSEnji Cooper         && test -f conftest2.$ac_objext; then
1167*132f818dSEnji Cooper      : OK
1168*132f818dSEnji Cooper    else
1169*132f818dSEnji Cooper      am_cv_prog_cc_c_o=no
1170*132f818dSEnji Cooper      break
1171*132f818dSEnji Cooper    fi
1172*132f818dSEnji Cooper  done
1173*132f818dSEnji Cooper  rm -f core conftest*
1174*132f818dSEnji Cooper  unset am_i])
1175*132f818dSEnji Cooperif test "$am_cv_prog_cc_c_o" != yes; then
1176*132f818dSEnji Cooper   # Losing compiler, so override with the script.
1177*132f818dSEnji Cooper   # FIXME: It is wrong to rewrite CC.
1178*132f818dSEnji Cooper   # But if we don't then we get into trouble of one sort or another.
1179*132f818dSEnji Cooper   # A longer-term fix would be to have automake use am__CC in this case,
1180*132f818dSEnji Cooper   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
1181*132f818dSEnji Cooper   CC="$am_aux_dir/compile $CC"
1182*132f818dSEnji Cooperfi
1183*132f818dSEnji CooperAC_LANG_POP([C])])
1184*132f818dSEnji Cooper
1185*132f818dSEnji Cooper# For backward compatibility.
1186*132f818dSEnji CooperAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1187*132f818dSEnji Cooper
1188*132f818dSEnji Cooper# Copyright (C) 2022-2024 Free Software Foundation, Inc.
1189*132f818dSEnji Cooper#
1190*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1191*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1192*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1193*132f818dSEnji Cooper
1194*132f818dSEnji Cooper# _AM_PROG_RM_F
1195*132f818dSEnji Cooper# ---------------
1196*132f818dSEnji Cooper# Check whether 'rm -f' without any arguments works.
1197*132f818dSEnji Cooper# https://bugs.gnu.org/10828
1198*132f818dSEnji CooperAC_DEFUN([_AM_PROG_RM_F],
1199*132f818dSEnji Cooper[am__rm_f_notfound=
1200*132f818dSEnji CooperAS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
1201*132f818dSEnji CooperAC_SUBST(am__rm_f_notfound)
1202*132f818dSEnji Cooper])
1203*132f818dSEnji Cooper
1204*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
1205*132f818dSEnji Cooper#
1206*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1207*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1208*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1209*132f818dSEnji Cooper
1210*132f818dSEnji Cooper# AM_RUN_LOG(COMMAND)
1211*132f818dSEnji Cooper# -------------------
1212*132f818dSEnji Cooper# Run COMMAND, save the exit status in ac_status, and log it.
1213*132f818dSEnji Cooper# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
1214*132f818dSEnji CooperAC_DEFUN([AM_RUN_LOG],
1215*132f818dSEnji Cooper[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
1216*132f818dSEnji Cooper   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
1217*132f818dSEnji Cooper   ac_status=$?
1218*132f818dSEnji Cooper   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1219*132f818dSEnji Cooper   (exit $ac_status); }])
1220*132f818dSEnji Cooper
1221*132f818dSEnji Cooper# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1222*132f818dSEnji Cooper
1223*132f818dSEnji Cooper# Copyright (C) 1996-2024 Free Software Foundation, Inc.
1224*132f818dSEnji Cooper#
1225*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1226*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1227*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1228*132f818dSEnji Cooper
1229*132f818dSEnji Cooper# _AM_SLEEP_FRACTIONAL_SECONDS
1230*132f818dSEnji Cooper# ----------------------------
1231*132f818dSEnji CooperAC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
1232*132f818dSEnji CooperAC_CACHE_CHECK([whether sleep supports fractional seconds],
1233*132f818dSEnji Cooper               am_cv_sleep_fractional_seconds, [dnl
1234*132f818dSEnji CooperAS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
1235*132f818dSEnji Cooper                                 [am_cv_sleep_fractional_seconds=no])
1236*132f818dSEnji Cooper])])
1237*132f818dSEnji Cooper
1238*132f818dSEnji Cooper# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
1239*132f818dSEnji Cooper# -----------------------------------
1240*132f818dSEnji Cooper# Determine the filesystem's resolution for file modification
1241*132f818dSEnji Cooper# timestamps.  The coarsest we know of is FAT, with a resolution
1242*132f818dSEnji Cooper# of only two seconds, even with the most recent "exFAT" extensions.
1243*132f818dSEnji Cooper# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
1244*132f818dSEnji Cooper# nanosecond, matching clock_gettime.  However, it is probably not
1245*132f818dSEnji Cooper# possible to delay execution of a shell script for less than one
1246*132f818dSEnji Cooper# millisecond, due to process creation overhead and scheduling
1247*132f818dSEnji Cooper# granularity, so we don't check for anything finer than that. (See below.)
1248*132f818dSEnji CooperAC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
1249*132f818dSEnji CooperAC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
1250*132f818dSEnji CooperAC_CACHE_CHECK([filesystem timestamp resolution],
1251*132f818dSEnji Cooper               am_cv_filesystem_timestamp_resolution, [dnl
1252*132f818dSEnji Cooper# Default to the worst case.
1253*132f818dSEnji Cooperam_cv_filesystem_timestamp_resolution=2
1254*132f818dSEnji Cooper
1255*132f818dSEnji Cooper# Only try to go finer than 1 sec if sleep can do it.
1256*132f818dSEnji Cooper# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
1257*132f818dSEnji Cooper# - 1 sec is not much of a win compared to 2 sec, and
1258*132f818dSEnji Cooper# - it takes 2 seconds to perform the test whether 1 sec works.
1259*132f818dSEnji Cooper#
1260*132f818dSEnji Cooper# Instead, just use the default 2s on platforms that have 1s resolution,
1261*132f818dSEnji Cooper# accept the extra 1s delay when using $sleep in the Automake tests, in
1262*132f818dSEnji Cooper# exchange for not incurring the 2s delay for running the test for all
1263*132f818dSEnji Cooper# packages.
1264*132f818dSEnji Cooper#
1265*132f818dSEnji Cooperam_try_resolutions=
1266*132f818dSEnji Cooperif test "$am_cv_sleep_fractional_seconds" = yes; then
1267*132f818dSEnji Cooper  # Even a millisecond often causes a bunch of false positives,
1268*132f818dSEnji Cooper  # so just try a hundredth of a second. The time saved between .001 and
1269*132f818dSEnji Cooper  # .01 is not terribly consequential.
1270*132f818dSEnji Cooper  am_try_resolutions="0.01 0.1 $am_try_resolutions"
1271*132f818dSEnji Cooperfi
1272*132f818dSEnji Cooper
1273*132f818dSEnji Cooper# In order to catch current-generation FAT out, we must *modify* files
1274*132f818dSEnji Cooper# that already exist; the *creation* timestamp is finer.  Use names
1275*132f818dSEnji Cooper# that make ls -t sort them differently when they have equal
1276*132f818dSEnji Cooper# timestamps than when they have distinct timestamps, keeping
1277*132f818dSEnji Cooper# in mind that ls -t prints the *newest* file first.
1278*132f818dSEnji Cooperrm -f conftest.ts?
1279*132f818dSEnji Cooper: > conftest.ts1
1280*132f818dSEnji Cooper: > conftest.ts2
1281*132f818dSEnji Cooper: > conftest.ts3
1282*132f818dSEnji Cooper
1283*132f818dSEnji Cooper# Make sure ls -t actually works.  Do 'set' in a subshell so we don't
1284*132f818dSEnji Cooper# clobber the current shell's arguments. (Outer-level square brackets
1285*132f818dSEnji Cooper# are removed by m4; they're present so that m4 does not expand
1286*132f818dSEnji Cooper# <dollar><star>; be careful, easy to get confused.)
1287*132f818dSEnji Cooperif (
1288*132f818dSEnji Cooper     set X `[ls -t conftest.ts[12]]` &&
1289*132f818dSEnji Cooper     {
1290*132f818dSEnji Cooper       test "$[]*" != "X conftest.ts1 conftest.ts2" ||
1291*132f818dSEnji Cooper       test "$[]*" != "X conftest.ts2 conftest.ts1";
1292*132f818dSEnji Cooper     }
1293*132f818dSEnji Cooper); then :; else
1294*132f818dSEnji Cooper  # If neither matched, then we have a broken ls.  This can happen
1295*132f818dSEnji Cooper  # if, for instance, CONFIG_SHELL is bash and it inherits a
1296*132f818dSEnji Cooper  # broken ls alias from the environment.  This has actually
1297*132f818dSEnji Cooper  # happened.  Such a system could not be considered "sane".
1298*132f818dSEnji Cooper  _AS_ECHO_UNQUOTED(
1299*132f818dSEnji Cooper    ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
1300*132f818dSEnji Cooper    [AS_MESSAGE_LOG_FD])
1301*132f818dSEnji Cooper  AC_MSG_FAILURE([ls -t produces unexpected output.
1302*132f818dSEnji CooperMake sure there is not a broken ls alias in your environment.])
1303*132f818dSEnji Cooperfi
1304*132f818dSEnji Cooper
1305*132f818dSEnji Cooperfor am_try_res in $am_try_resolutions; do
1306*132f818dSEnji Cooper  # Any one fine-grained sleep might happen to cross the boundary
1307*132f818dSEnji Cooper  # between two values of a coarser actual resolution, but if we do
1308*132f818dSEnji Cooper  # two fine-grained sleeps in a row, at least one of them will fall
1309*132f818dSEnji Cooper  # entirely within a coarse interval.
1310*132f818dSEnji Cooper  echo alpha > conftest.ts1
1311*132f818dSEnji Cooper  sleep $am_try_res
1312*132f818dSEnji Cooper  echo beta > conftest.ts2
1313*132f818dSEnji Cooper  sleep $am_try_res
1314*132f818dSEnji Cooper  echo gamma > conftest.ts3
1315*132f818dSEnji Cooper
1316*132f818dSEnji Cooper  # We assume that 'ls -t' will make use of high-resolution
1317*132f818dSEnji Cooper  # timestamps if the operating system supports them at all.
1318*132f818dSEnji Cooper  if (set X `ls -t conftest.ts?` &&
1319*132f818dSEnji Cooper      test "$[]2" = conftest.ts3 &&
1320*132f818dSEnji Cooper      test "$[]3" = conftest.ts2 &&
1321*132f818dSEnji Cooper      test "$[]4" = conftest.ts1); then
1322*132f818dSEnji Cooper    #
1323*132f818dSEnji Cooper    # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
1324*132f818dSEnji Cooper    # because we don't need to test make.
1325*132f818dSEnji Cooper    make_ok=true
1326*132f818dSEnji Cooper    if test $am_try_res != 1; then
1327*132f818dSEnji Cooper      # But if we've succeeded so far with a subsecond resolution, we
1328*132f818dSEnji Cooper      # have one more thing to check: make. It can happen that
1329*132f818dSEnji Cooper      # everything else supports the subsecond mtimes, but make doesn't;
1330*132f818dSEnji Cooper      # notably on macOS, which ships make 3.81 from 2006 (the last one
1331*132f818dSEnji Cooper      # released under GPLv2). https://bugs.gnu.org/68808
1332*132f818dSEnji Cooper      #
1333*132f818dSEnji Cooper      # We test $MAKE if it is defined in the environment, else "make".
1334*132f818dSEnji Cooper      # It might get overridden later, but our hope is that in practice
1335*132f818dSEnji Cooper      # it does not matter: it is the system "make" which is (by far)
1336*132f818dSEnji Cooper      # the most likely to be broken, whereas if the user overrides it,
1337*132f818dSEnji Cooper      # probably they did so with a better, or at least not worse, make.
1338*132f818dSEnji Cooper      # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
1339*132f818dSEnji Cooper      #
1340*132f818dSEnji Cooper      # Create a Makefile (real tab character here):
1341*132f818dSEnji Cooper      rm -f conftest.mk
1342*132f818dSEnji Cooper      echo 'conftest.ts1: conftest.ts2' >conftest.mk
1343*132f818dSEnji Cooper      echo '	touch conftest.ts2' >>conftest.mk
1344*132f818dSEnji Cooper      #
1345*132f818dSEnji Cooper      # Now, running
1346*132f818dSEnji Cooper      #   touch conftest.ts1; touch conftest.ts2; make
1347*132f818dSEnji Cooper      # should touch ts1 because ts2 is newer. This could happen by luck,
1348*132f818dSEnji Cooper      # but most often, it will fail if make's support is insufficient. So
1349*132f818dSEnji Cooper      # test for several consecutive successes.
1350*132f818dSEnji Cooper      #
1351*132f818dSEnji Cooper      # (We reuse conftest.ts[12] because we still want to modify existing
1352*132f818dSEnji Cooper      # files, not create new ones, per above.)
1353*132f818dSEnji Cooper      n=0
1354*132f818dSEnji Cooper      make=${MAKE-make}
1355*132f818dSEnji Cooper      until test $n -eq 3; do
1356*132f818dSEnji Cooper        echo one > conftest.ts1
1357*132f818dSEnji Cooper        sleep $am_try_res
1358*132f818dSEnji Cooper        echo two > conftest.ts2 # ts2 should now be newer than ts1
1359*132f818dSEnji Cooper        if $make -f conftest.mk | grep 'up to date' >/dev/null; then
1360*132f818dSEnji Cooper          make_ok=false
1361*132f818dSEnji Cooper          break # out of $n loop
1362*132f818dSEnji Cooper        fi
1363*132f818dSEnji Cooper        n=`expr $n + 1`
1364*132f818dSEnji Cooper      done
1365*132f818dSEnji Cooper    fi
1366*132f818dSEnji Cooper    #
1367*132f818dSEnji Cooper    if $make_ok; then
1368*132f818dSEnji Cooper      # Everything we know to check worked out, so call this resolution good.
1369*132f818dSEnji Cooper      am_cv_filesystem_timestamp_resolution=$am_try_res
1370*132f818dSEnji Cooper      break # out of $am_try_res loop
1371*132f818dSEnji Cooper    fi
1372*132f818dSEnji Cooper    # Otherwise, we'll go on to check the next resolution.
1373*132f818dSEnji Cooper  fi
1374*132f818dSEnji Cooperdone
1375*132f818dSEnji Cooperrm -f conftest.ts?
1376*132f818dSEnji Cooper# (end _am_filesystem_timestamp_resolution)
1377*132f818dSEnji Cooper])])
1378*132f818dSEnji Cooper
1379*132f818dSEnji Cooper# AM_SANITY_CHECK
1380*132f818dSEnji Cooper# ---------------
1381*132f818dSEnji CooperAC_DEFUN([AM_SANITY_CHECK],
1382*132f818dSEnji Cooper[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
1383*132f818dSEnji Cooper# This check should not be cached, as it may vary across builds of
1384*132f818dSEnji Cooper# different projects.
1385*132f818dSEnji CooperAC_MSG_CHECKING([whether build environment is sane])
1386*132f818dSEnji Cooper# Reject unsafe characters in $srcdir or the absolute working directory
1387*132f818dSEnji Cooper# name.  Accept space and tab only in the latter.
1388*132f818dSEnji Cooperam_lf='
1389*132f818dSEnji Cooper'
1390*132f818dSEnji Coopercase `pwd` in
1391*132f818dSEnji Cooper  *[[\\\"\#\$\&\'\`$am_lf]]*)
1392*132f818dSEnji Cooper    AC_MSG_ERROR([unsafe absolute working directory name]);;
1393*132f818dSEnji Cooperesac
1394*132f818dSEnji Coopercase $srcdir in
1395*132f818dSEnji Cooper  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
1396*132f818dSEnji Cooper    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
1397*132f818dSEnji Cooperesac
1398*132f818dSEnji Cooper
1399*132f818dSEnji Cooper# Do 'set' in a subshell so we don't clobber the current shell's
1400*132f818dSEnji Cooper# arguments.  Must try -L first in case configure is actually a
1401*132f818dSEnji Cooper# symlink; some systems play weird games with the mod time of symlinks
1402*132f818dSEnji Cooper# (eg FreeBSD returns the mod time of the symlink's containing
1403*132f818dSEnji Cooper# directory).
1404*132f818dSEnji Cooperam_build_env_is_sane=no
1405*132f818dSEnji Cooperam_has_slept=no
1406*132f818dSEnji Cooperrm -f conftest.file
1407*132f818dSEnji Cooperfor am_try in 1 2; do
1408*132f818dSEnji Cooper  echo "timestamp, slept: $am_has_slept" > conftest.file
1409*132f818dSEnji Cooper  if (
1410*132f818dSEnji Cooper    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1411*132f818dSEnji Cooper    if test "$[]*" = "X"; then
1412*132f818dSEnji Cooper      # -L didn't work.
1413*132f818dSEnji Cooper      set X `ls -t "$srcdir/configure" conftest.file`
1414*132f818dSEnji Cooper    fi
1415*132f818dSEnji Cooper    test "$[]2" = conftest.file
1416*132f818dSEnji Cooper  ); then
1417*132f818dSEnji Cooper    am_build_env_is_sane=yes
1418*132f818dSEnji Cooper    break
1419*132f818dSEnji Cooper  fi
1420*132f818dSEnji Cooper  # Just in case.
1421*132f818dSEnji Cooper  sleep "$am_cv_filesystem_timestamp_resolution"
1422*132f818dSEnji Cooper  am_has_slept=yes
1423*132f818dSEnji Cooperdone
1424*132f818dSEnji Cooper
1425*132f818dSEnji CooperAC_MSG_RESULT([$am_build_env_is_sane])
1426*132f818dSEnji Cooperif test "$am_build_env_is_sane" = no; then
1427*132f818dSEnji Cooper  AC_MSG_ERROR([newly created file is older than distributed files!
1428*132f818dSEnji CooperCheck your system clock])
1429*132f818dSEnji Cooperfi
1430*132f818dSEnji Cooper
1431*132f818dSEnji Cooper# If we didn't sleep, we still need to ensure time stamps of config.status and
1432*132f818dSEnji Cooper# generated files are strictly newer.
1433*132f818dSEnji Cooperam_sleep_pid=
1434*132f818dSEnji CooperAS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
1435*132f818dSEnji Cooper  ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
1436*132f818dSEnji Cooper  am_sleep_pid=$!
1437*132f818dSEnji Cooper])
1438*132f818dSEnji CooperAC_CONFIG_COMMANDS_PRE(
1439*132f818dSEnji Cooper  [AC_MSG_CHECKING([that generated files are newer than configure])
1440*132f818dSEnji Cooper   if test -n "$am_sleep_pid"; then
1441*132f818dSEnji Cooper     # Hide warnings about reused PIDs.
1442*132f818dSEnji Cooper     wait $am_sleep_pid 2>/dev/null
1443*132f818dSEnji Cooper   fi
1444*132f818dSEnji Cooper   AC_MSG_RESULT([done])])
1445*132f818dSEnji Cooperrm -f conftest.file
1446*132f818dSEnji Cooper])
1447*132f818dSEnji Cooper
1448*132f818dSEnji Cooper# Copyright (C) 2009-2024 Free Software Foundation, Inc.
1449*132f818dSEnji Cooper#
1450*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1451*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1452*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1453*132f818dSEnji Cooper
1454*132f818dSEnji Cooper# _AM_SILENT_RULES
1455*132f818dSEnji Cooper# ----------------
1456*132f818dSEnji Cooper# Enable less verbose build rules support.
1457*132f818dSEnji CooperAC_DEFUN([_AM_SILENT_RULES],
1458*132f818dSEnji Cooper[AM_DEFAULT_VERBOSITY=1
1459*132f818dSEnji CooperAC_ARG_ENABLE([silent-rules], [dnl
1460*132f818dSEnji CooperAS_HELP_STRING(
1461*132f818dSEnji Cooper  [--enable-silent-rules],
1462*132f818dSEnji Cooper  [less verbose build output (undo: "make V=1")])
1463*132f818dSEnji CooperAS_HELP_STRING(
1464*132f818dSEnji Cooper  [--disable-silent-rules],
1465*132f818dSEnji Cooper  [verbose build output (undo: "make V=0")])dnl
1466*132f818dSEnji Cooper])
1467*132f818dSEnji Cooperdnl
1468*132f818dSEnji Cooperdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1469*132f818dSEnji Cooperdnl do not support nested variable expansions.
1470*132f818dSEnji Cooperdnl See automake bug#9928 and bug#10237.
1471*132f818dSEnji Cooperam_make=${MAKE-make}
1472*132f818dSEnji CooperAC_CACHE_CHECK([whether $am_make supports nested variables],
1473*132f818dSEnji Cooper   [am_cv_make_support_nested_variables],
1474*132f818dSEnji Cooper   [if AS_ECHO([['TRUE=$(BAR$(V))
1475*132f818dSEnji CooperBAR0=false
1476*132f818dSEnji CooperBAR1=true
1477*132f818dSEnji CooperV=1
1478*132f818dSEnji Cooperam__doit:
1479*132f818dSEnji Cooper	@$(TRUE)
1480*132f818dSEnji Cooper.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1481*132f818dSEnji Cooper  am_cv_make_support_nested_variables=yes
1482*132f818dSEnji Cooperelse
1483*132f818dSEnji Cooper  am_cv_make_support_nested_variables=no
1484*132f818dSEnji Cooperfi])
1485*132f818dSEnji CooperAC_SUBST([AM_V])dnl
1486*132f818dSEnji CooperAM_SUBST_NOTMAKE([AM_V])dnl
1487*132f818dSEnji CooperAC_SUBST([AM_DEFAULT_V])dnl
1488*132f818dSEnji CooperAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1489*132f818dSEnji CooperAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1490*132f818dSEnji CooperAM_BACKSLASH='\'
1491*132f818dSEnji CooperAC_SUBST([AM_BACKSLASH])dnl
1492*132f818dSEnji Cooper_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1493*132f818dSEnji Cooperdnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
1494*132f818dSEnji Cooperdnl to AM_SILENT_RULES to change the default value.
1495*132f818dSEnji CooperAC_CONFIG_COMMANDS_PRE([dnl
1496*132f818dSEnji Coopercase $enable_silent_rules in @%:@ (((
1497*132f818dSEnji Cooper  yes) AM_DEFAULT_VERBOSITY=0;;
1498*132f818dSEnji Cooper   no) AM_DEFAULT_VERBOSITY=1;;
1499*132f818dSEnji Cooperesac
1500*132f818dSEnji Cooperif test $am_cv_make_support_nested_variables = yes; then
1501*132f818dSEnji Cooper  dnl Using '$V' instead of '$(V)' breaks IRIX make.
1502*132f818dSEnji Cooper  AM_V='$(V)'
1503*132f818dSEnji Cooper  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1504*132f818dSEnji Cooperelse
1505*132f818dSEnji Cooper  AM_V=$AM_DEFAULT_VERBOSITY
1506*132f818dSEnji Cooper  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1507*132f818dSEnji Cooperfi
1508*132f818dSEnji Cooper])dnl
1509*132f818dSEnji Cooper])
1510*132f818dSEnji Cooper
1511*132f818dSEnji Cooper# AM_SILENT_RULES([DEFAULT])
1512*132f818dSEnji Cooper# --------------------------
1513*132f818dSEnji Cooper# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
1514*132f818dSEnji Cooper# empty being verbose).
1515*132f818dSEnji CooperAC_DEFUN([AM_SILENT_RULES],
1516*132f818dSEnji Cooper[AC_REQUIRE([_AM_SILENT_RULES])
1517*132f818dSEnji CooperAM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
1518*132f818dSEnji Cooper
1519*132f818dSEnji Cooper# Copyright (C) 2001-2024 Free Software Foundation, Inc.
1520*132f818dSEnji Cooper#
1521*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1522*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1523*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1524*132f818dSEnji Cooper
1525*132f818dSEnji Cooper# AM_PROG_INSTALL_STRIP
1526*132f818dSEnji Cooper# ---------------------
1527*132f818dSEnji Cooper# One issue with vendor 'install' (even GNU) is that you can't
1528*132f818dSEnji Cooper# specify the program used to strip binaries.  This is especially
1529*132f818dSEnji Cooper# annoying in cross-compiling environments, where the build's strip
1530*132f818dSEnji Cooper# is unlikely to handle the host's binaries.
1531*132f818dSEnji Cooper# Fortunately install-sh will honor a STRIPPROG variable, so we
1532*132f818dSEnji Cooper# always use install-sh in "make install-strip", and initialize
1533*132f818dSEnji Cooper# STRIPPROG with the value of the STRIP variable (set by the user).
1534*132f818dSEnji CooperAC_DEFUN([AM_PROG_INSTALL_STRIP],
1535*132f818dSEnji Cooper[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1536*132f818dSEnji Cooper# Installed binaries are usually stripped using 'strip' when the user
1537*132f818dSEnji Cooper# run "make install-strip".  However 'strip' might not be the right
1538*132f818dSEnji Cooper# tool to use in cross-compilation environments, therefore Automake
1539*132f818dSEnji Cooper# will honor the 'STRIP' environment variable to overrule this program.
1540*132f818dSEnji Cooperdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1541*132f818dSEnji Cooperif test "$cross_compiling" != no; then
1542*132f818dSEnji Cooper  AC_CHECK_TOOL([STRIP], [strip], :)
1543*132f818dSEnji Cooperfi
1544*132f818dSEnji CooperINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1545*132f818dSEnji CooperAC_SUBST([INSTALL_STRIP_PROGRAM])])
1546*132f818dSEnji Cooper
1547*132f818dSEnji Cooper# Copyright (C) 2006-2024 Free Software Foundation, Inc.
1548*132f818dSEnji Cooper#
1549*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1550*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1551*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1552*132f818dSEnji Cooper
1553*132f818dSEnji Cooper# _AM_SUBST_NOTMAKE(VARIABLE)
1554*132f818dSEnji Cooper# ---------------------------
1555*132f818dSEnji Cooper# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1556*132f818dSEnji Cooper# This macro is traced by Automake.
1557*132f818dSEnji CooperAC_DEFUN([_AM_SUBST_NOTMAKE])
1558*132f818dSEnji Cooper
1559*132f818dSEnji Cooper# AM_SUBST_NOTMAKE(VARIABLE)
1560*132f818dSEnji Cooper# --------------------------
1561*132f818dSEnji Cooper# Public sister of _AM_SUBST_NOTMAKE.
1562*132f818dSEnji CooperAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1563*132f818dSEnji Cooper
1564*132f818dSEnji Cooper# Check how to create a tarball.                            -*- Autoconf -*-
1565*132f818dSEnji Cooper
1566*132f818dSEnji Cooper# Copyright (C) 2004-2024 Free Software Foundation, Inc.
1567*132f818dSEnji Cooper#
1568*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1569*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1570*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1571*132f818dSEnji Cooper
1572*132f818dSEnji Cooper# _AM_PROG_TAR(FORMAT)
1573*132f818dSEnji Cooper# --------------------
1574*132f818dSEnji Cooper# Check how to create a tarball in format FORMAT.
1575*132f818dSEnji Cooper# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1576*132f818dSEnji Cooper#
1577*132f818dSEnji Cooper# Substitute a variable $(am__tar) that is a command
1578*132f818dSEnji Cooper# writing to stdout a FORMAT-tarball containing the directory
1579*132f818dSEnji Cooper# $tardir.
1580*132f818dSEnji Cooper#     tardir=directory && $(am__tar) > result.tar
1581*132f818dSEnji Cooper#
1582*132f818dSEnji Cooper# Substitute a variable $(am__untar) that extract such
1583*132f818dSEnji Cooper# a tarball read from stdin.
1584*132f818dSEnji Cooper#     $(am__untar) < result.tar
1585*132f818dSEnji Cooper#
1586*132f818dSEnji CooperAC_DEFUN([_AM_PROG_TAR],
1587*132f818dSEnji Cooper[# Always define AMTAR for backward compatibility.  Yes, it's still used
1588*132f818dSEnji Cooper# in the wild :-(  We should find a proper way to deprecate it ...
1589*132f818dSEnji CooperAC_SUBST([AMTAR], ['$${TAR-tar}'])
1590*132f818dSEnji Cooper
1591*132f818dSEnji Cooper# We'll loop over all known methods to create a tar archive until one works.
1592*132f818dSEnji Cooper_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1593*132f818dSEnji Cooper
1594*132f818dSEnji Cooperm4_if([$1], [v7],
1595*132f818dSEnji Cooper  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1596*132f818dSEnji Cooper
1597*132f818dSEnji Cooper  [m4_case([$1],
1598*132f818dSEnji Cooper    [ustar],
1599*132f818dSEnji Cooper     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1600*132f818dSEnji Cooper      # There is notably a 21 bits limit for the UID and the GID.  In fact,
1601*132f818dSEnji Cooper      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1602*132f818dSEnji Cooper      # and bug#13588).
1603*132f818dSEnji Cooper      am_max_uid=2097151 # 2^21 - 1
1604*132f818dSEnji Cooper      am_max_gid=$am_max_uid
1605*132f818dSEnji Cooper      # The $UID and $GID variables are not portable, so we need to resort
1606*132f818dSEnji Cooper      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
1607*132f818dSEnji Cooper      # below are definitely unexpected, so allow the users to see them
1608*132f818dSEnji Cooper      # (that is, avoid stderr redirection).
1609*132f818dSEnji Cooper      am_uid=`id -u || echo unknown`
1610*132f818dSEnji Cooper      am_gid=`id -g || echo unknown`
1611*132f818dSEnji Cooper      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1612*132f818dSEnji Cooper      if test x$am_uid = xunknown; then
1613*132f818dSEnji Cooper        AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
1614*132f818dSEnji Cooper      elif test $am_uid -le $am_max_uid; then
1615*132f818dSEnji Cooper        AC_MSG_RESULT([yes])
1616*132f818dSEnji Cooper      else
1617*132f818dSEnji Cooper        AC_MSG_RESULT([no])
1618*132f818dSEnji Cooper        _am_tools=none
1619*132f818dSEnji Cooper      fi
1620*132f818dSEnji Cooper      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1621*132f818dSEnji Cooper      if test x$gm_gid = xunknown; then
1622*132f818dSEnji Cooper        AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
1623*132f818dSEnji Cooper      elif test $am_gid -le $am_max_gid; then
1624*132f818dSEnji Cooper        AC_MSG_RESULT([yes])
1625*132f818dSEnji Cooper      else
1626*132f818dSEnji Cooper        AC_MSG_RESULT([no])
1627*132f818dSEnji Cooper        _am_tools=none
1628*132f818dSEnji Cooper      fi],
1629*132f818dSEnji Cooper
1630*132f818dSEnji Cooper  [pax],
1631*132f818dSEnji Cooper    [],
1632*132f818dSEnji Cooper
1633*132f818dSEnji Cooper  [m4_fatal([Unknown tar format])])
1634*132f818dSEnji Cooper
1635*132f818dSEnji Cooper  AC_MSG_CHECKING([how to create a $1 tar archive])
1636*132f818dSEnji Cooper
1637*132f818dSEnji Cooper  # Go ahead even if we have the value already cached.  We do so because we
1638*132f818dSEnji Cooper  # need to set the values for the 'am__tar' and 'am__untar' variables.
1639*132f818dSEnji Cooper  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1640*132f818dSEnji Cooper
1641*132f818dSEnji Cooper  for _am_tool in $_am_tools; do
1642*132f818dSEnji Cooper    case $_am_tool in
1643*132f818dSEnji Cooper    gnutar)
1644*132f818dSEnji Cooper      for _am_tar in tar gnutar gtar; do
1645*132f818dSEnji Cooper        AM_RUN_LOG([$_am_tar --version]) && break
1646*132f818dSEnji Cooper      done
1647*132f818dSEnji Cooper      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1648*132f818dSEnji Cooper      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1649*132f818dSEnji Cooper      am__untar="$_am_tar -xf -"
1650*132f818dSEnji Cooper      ;;
1651*132f818dSEnji Cooper    plaintar)
1652*132f818dSEnji Cooper      # Must skip GNU tar: if it does not support --format= it doesn't create
1653*132f818dSEnji Cooper      # ustar tarball either.
1654*132f818dSEnji Cooper      (tar --version) >/dev/null 2>&1 && continue
1655*132f818dSEnji Cooper      am__tar='tar chf - "$$tardir"'
1656*132f818dSEnji Cooper      am__tar_='tar chf - "$tardir"'
1657*132f818dSEnji Cooper      am__untar='tar xf -'
1658*132f818dSEnji Cooper      ;;
1659*132f818dSEnji Cooper    pax)
1660*132f818dSEnji Cooper      am__tar='pax -L -x $1 -w "$$tardir"'
1661*132f818dSEnji Cooper      am__tar_='pax -L -x $1 -w "$tardir"'
1662*132f818dSEnji Cooper      am__untar='pax -r'
1663*132f818dSEnji Cooper      ;;
1664*132f818dSEnji Cooper    cpio)
1665*132f818dSEnji Cooper      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1666*132f818dSEnji Cooper      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1667*132f818dSEnji Cooper      am__untar='cpio -i -H $1 -d'
1668*132f818dSEnji Cooper      ;;
1669*132f818dSEnji Cooper    none)
1670*132f818dSEnji Cooper      am__tar=false
1671*132f818dSEnji Cooper      am__tar_=false
1672*132f818dSEnji Cooper      am__untar=false
1673*132f818dSEnji Cooper      ;;
1674*132f818dSEnji Cooper    esac
1675*132f818dSEnji Cooper
1676*132f818dSEnji Cooper    # If the value was cached, stop now.  We just wanted to have am__tar
1677*132f818dSEnji Cooper    # and am__untar set.
1678*132f818dSEnji Cooper    test -n "${am_cv_prog_tar_$1}" && break
1679*132f818dSEnji Cooper
1680*132f818dSEnji Cooper    # tar/untar a dummy directory, and stop if the command works.
1681*132f818dSEnji Cooper    rm -rf conftest.dir
1682*132f818dSEnji Cooper    mkdir conftest.dir
1683*132f818dSEnji Cooper    echo GrepMe > conftest.dir/file
1684*132f818dSEnji Cooper    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1685*132f818dSEnji Cooper    rm -rf conftest.dir
1686*132f818dSEnji Cooper    if test -s conftest.tar; then
1687*132f818dSEnji Cooper      AM_RUN_LOG([$am__untar <conftest.tar])
1688*132f818dSEnji Cooper      AM_RUN_LOG([cat conftest.dir/file])
1689*132f818dSEnji Cooper      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1690*132f818dSEnji Cooper    fi
1691*132f818dSEnji Cooper  done
1692*132f818dSEnji Cooper  rm -rf conftest.dir
1693*132f818dSEnji Cooper
1694*132f818dSEnji Cooper  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1695*132f818dSEnji Cooper  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1696*132f818dSEnji Cooper
1697*132f818dSEnji CooperAC_SUBST([am__tar])
1698*132f818dSEnji CooperAC_SUBST([am__untar])
1699*132f818dSEnji Cooper]) # _AM_PROG_TAR
1700*132f818dSEnji Cooper
1701*132f818dSEnji Cooper# Copyright (C) 2022-2024 Free Software Foundation, Inc.
1702*132f818dSEnji Cooper#
1703*132f818dSEnji Cooper# This file is free software; the Free Software Foundation
1704*132f818dSEnji Cooper# gives unlimited permission to copy and/or distribute it,
1705*132f818dSEnji Cooper# with or without modifications, as long as this notice is preserved.
1706*132f818dSEnji Cooper
1707*132f818dSEnji Cooper# _AM_PROG_XARGS_N
1708*132f818dSEnji Cooper# ----------------
1709*132f818dSEnji Cooper# Check whether 'xargs -n' works.  It should work everywhere, so the fallback
1710*132f818dSEnji Cooper# is not optimized at all as we never expect to use it.
1711*132f818dSEnji CooperAC_DEFUN([_AM_PROG_XARGS_N],
1712*132f818dSEnji Cooper[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
1713*132f818dSEnji CooperAS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
1714*132f818dSEnji Cooper3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
1715*132f818dSEnji CooperAS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
1716*132f818dSEnji Cooper  am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
1717*132f818dSEnji Cooper])dnl
1718*132f818dSEnji CooperAC_SUBST(am__xargs_n)
1719*132f818dSEnji Cooper])
1720*132f818dSEnji Cooper
1721*132f818dSEnji Cooperm4_include([m4/ac_cxx_compile_stdcxx.m4])
1722*132f818dSEnji Cooperm4_include([m4/atf-c++.m4])
1723*132f818dSEnji Cooperm4_include([m4/atf-common.m4])
1724*132f818dSEnji Cooperm4_include([m4/atf-sh.m4])
1725*132f818dSEnji Cooperm4_include([m4/compiler-flags.m4])
1726*132f818dSEnji Cooperm4_include([m4/developer-mode.m4])
1727*132f818dSEnji Cooperm4_include([m4/doxygen.m4])
1728*132f818dSEnji Cooperm4_include([m4/libtool.m4])
1729*132f818dSEnji Cooperm4_include([m4/ltoptions.m4])
1730*132f818dSEnji Cooperm4_include([m4/ltsugar.m4])
1731*132f818dSEnji Cooperm4_include([m4/ltversion.m4])
1732*132f818dSEnji Cooperm4_include([m4/lt~obsolete.m4])
1733*132f818dSEnji Cooperm4_include([m4/lua.m4])
1734