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