Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/aclocal.m4

raw
1 # generated automatically by aclocal 1.17 -*- Autoconf -*-
2
3 # Copyright (C) 1996-2024 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 # Copyright (C) 2002-2024 Free Software Foundation, Inc.
24 #
25 # This file is free software; the Free Software Foundation
26 # gives unlimited permission to copy and/or distribute it,
27 # with or without modifications, as long as this notice is preserved.
28
29 # AM_AUTOMAKE_VERSION(VERSION)
30 # ----------------------------
31 # Automake X.Y traces this macro to ensure aclocal.m4 has been
32 # generated from the m4 files accompanying Automake X.Y.
33 # (This private macro should not be called outside this file.)
34 AC_DEFUN([AM_AUTOMAKE_VERSION],
35 [am__api_version='1.17'
36 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37 dnl require some minimum version. Point them to the right macro.
38 m4_if([$1], [1.17], [],
39 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40 ])
41
42 # _AM_AUTOCONF_VERSION(VERSION)
43 # -----------------------------
44 # aclocal traces this macro to find the Autoconf version.
45 # This is a private macro too. Using m4_define simplifies
46 # the logic in aclocal, which can simply ignore this definition.
47 m4_define([_AM_AUTOCONF_VERSION], [])
48
49 # AM_SET_CURRENT_AUTOMAKE_VERSION
50 # -------------------------------
51 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54 [AM_AUTOMAKE_VERSION([1.17])dnl
55 m4_ifndef([AC_AUTOCONF_VERSION],
56 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58
59 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
60
61 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
62 #
63 # This file is free software; the Free Software Foundation
64 # gives unlimited permission to copy and/or distribute it,
65 # with or without modifications, as long as this notice is preserved.
66
67 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
68 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
69 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
70 #
71 # Of course, Automake must honor this variable whenever it calls a
72 # tool from the auxiliary directory. The problem is that $srcdir (and
73 # therefore $ac_aux_dir as well) can be either absolute or relative,
74 # depending on how configure is run. This is pretty annoying, since
75 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
76 # source directory, any form will work fine, but in subdirectories a
77 # relative path needs to be adjusted first.
78 #
79 # $ac_aux_dir/missing
80 # fails when called from a subdirectory if $ac_aux_dir is relative
81 # $top_srcdir/$ac_aux_dir/missing
82 # fails if $ac_aux_dir is absolute,
83 # fails when called from a subdirectory in a VPATH build with
84 # a relative $ac_aux_dir
85 #
86 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
87 # are both prefixed by $srcdir. In an in-source build this is usually
88 # harmless because $srcdir is '.', but things will broke when you
89 # start a VPATH build or use an absolute $srcdir.
90 #
91 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
92 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
93 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
94 # and then we would define $MISSING as
95 # MISSING="\${SHELL} $am_aux_dir/missing"
96 # This will work as long as MISSING is not called from configure, because
97 # unfortunately $(top_srcdir) has no meaning in configure.
98 # However there are other variables, like CC, which are often used in
99 # configure, and could therefore not use this "fixed" $ac_aux_dir.
100 #
101 # Another solution, used here, is to always expand $ac_aux_dir to an
102 # absolute PATH. The drawback is that using absolute paths prevent a
103 # configured tree to be moved without reconfiguration.
104
105 AC_DEFUN([AM_AUX_DIR_EXPAND],
106 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107 # Expand $ac_aux_dir to an absolute path.
108 am_aux_dir=`cd "$ac_aux_dir" && pwd`
109 ])
110
111 # AM_CONDITIONAL -*- Autoconf -*-
112
113 # Copyright (C) 1997-2024 Free Software Foundation, Inc.
114 #
115 # This file is free software; the Free Software Foundation
116 # gives unlimited permission to copy and/or distribute it,
117 # with or without modifications, as long as this notice is preserved.
118
119 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
120 # -------------------------------------
121 # Define a conditional.
122 AC_DEFUN([AM_CONDITIONAL],
123 [AC_PREREQ([2.52])dnl
124 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
125 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
126 AC_SUBST([$1_TRUE])dnl
127 AC_SUBST([$1_FALSE])dnl
128 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
129 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
130 m4_define([_AM_COND_VALUE_$1], [$2])dnl
131 if $2; then
132 $1_TRUE=
133 $1_FALSE='#'
134 else
135 $1_TRUE='#'
136 $1_FALSE=
137 fi
138 AC_CONFIG_COMMANDS_PRE(
139 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
140 AC_MSG_ERROR([[conditional "$1" was never defined.
141 Usually this means the macro was only invoked conditionally.]])
142 fi])])
143
144 # Do all the work for Automake. -*- Autoconf -*-
145
146 # Copyright (C) 1996-2024 Free Software Foundation, Inc.
147 #
148 # This file is free software; the Free Software Foundation
149 # gives unlimited permission to copy and/or distribute it,
150 # with or without modifications, as long as this notice is preserved.
151
152 # This macro actually does too much. Some checks are only needed if
153 # your package does certain things. But this isn't really a big deal.
154
155 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
156 m4_define([AC_PROG_CC],
157 m4_defn([AC_PROG_CC])
158 [_AM_PROG_CC_C_O
159 ])
160
161 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
162 # AM_INIT_AUTOMAKE([OPTIONS])
163 # -----------------------------------------------
164 # The call with PACKAGE and VERSION arguments is the old style
165 # call (pre autoconf-2.50), which is being phased out. PACKAGE
166 # and VERSION should now be passed to AC_INIT and removed from
167 # the call to AM_INIT_AUTOMAKE.
168 # We support both call styles for the transition. After
169 # the next Automake release, Autoconf can make the AC_INIT
170 # arguments mandatory, and then we can depend on a new Autoconf
171 # release and drop the old call support.
172 AC_DEFUN([AM_INIT_AUTOMAKE],
173 [AC_PREREQ([2.65])dnl
174 m4_ifdef([_$0_ALREADY_INIT],
175 [m4_fatal([$0 expanded multiple times
176 ]m4_defn([_$0_ALREADY_INIT]))],
177 [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
178 dnl Autoconf wants to disallow AM_ names. We explicitly allow
179 dnl the ones we care about.
180 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
181 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
182 AC_REQUIRE([AC_PROG_INSTALL])dnl
183 if test "`cd $srcdir && pwd`" != "`pwd`"; then
184 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
185 # is not polluted with repeated "-I."
186 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
187 # test to see if srcdir already configured
188 if test -f $srcdir/config.status; then
189 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
190 fi
191 fi
192
193 # test whether we have cygpath
194 if test -z "$CYGPATH_W"; then
195 if (cygpath --version) >/dev/null 2>/dev/null; then
196 CYGPATH_W='cygpath -w'
197 else
198 CYGPATH_W=echo
199 fi
200 fi
201 AC_SUBST([CYGPATH_W])
202
203 # Define the identity of the package.
204 dnl Distinguish between old-style and new-style calls.
205 m4_ifval([$2],
206 [AC_DIAGNOSE([obsolete],
207 [$0: two- and three-arguments forms are deprecated.])
208 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
209 AC_SUBST([PACKAGE], [$1])dnl
210 AC_SUBST([VERSION], [$2])],
211 [_AM_SET_OPTIONS([$1])dnl
212 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
213 m4_if(
214 m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
215 [ok:ok],,
216 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
217 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
218 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
219
220 _AM_IF_OPTION([no-define],,
221 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
222 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
223
224 # Some tools Automake needs.
225 AC_REQUIRE([AM_SANITY_CHECK])dnl
226 AC_REQUIRE([AC_ARG_PROGRAM])dnl
227 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
228 AM_MISSING_PROG([AUTOCONF], [autoconf])
229 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
230 AM_MISSING_PROG([AUTOHEADER], [autoheader])
231 AM_MISSING_PROG([MAKEINFO], [makeinfo])
232 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
233 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
234 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
235 # For better backward compatibility. To be removed once Automake 1.9.x
236 # dies out for good. For more background, see:
237 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
238 # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
239 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
240 # We need awk for the "check" target (and possibly the TAP driver). The
241 # system "awk" is bad on some platforms.
242 AC_REQUIRE([AC_PROG_AWK])dnl
243 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
244 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
245 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
246 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
247 [_AM_PROG_TAR([v7])])])
248 _AM_IF_OPTION([no-dependencies],,
249 [AC_PROVIDE_IFELSE([AC_PROG_CC],
250 [_AM_DEPENDENCIES([CC])],
251 [m4_define([AC_PROG_CC],
252 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
253 AC_PROVIDE_IFELSE([AC_PROG_CXX],
254 [_AM_DEPENDENCIES([CXX])],
255 [m4_define([AC_PROG_CXX],
256 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
257 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
258 [_AM_DEPENDENCIES([OBJC])],
259 [m4_define([AC_PROG_OBJC],
260 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
261 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
262 [_AM_DEPENDENCIES([OBJCXX])],
263 [m4_define([AC_PROG_OBJCXX],
264 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
265 ])
266 # Variables for tags utilities; see am/tags.am
267 if test -z "$CTAGS"; then
268 CTAGS=ctags
269 fi
270 AC_SUBST([CTAGS])
271 if test -z "$ETAGS"; then
272 ETAGS=etags
273 fi
274 AC_SUBST([ETAGS])
275 if test -z "$CSCOPE"; then
276 CSCOPE=cscope
277 fi
278 AC_SUBST([CSCOPE])
279
280 AC_REQUIRE([_AM_SILENT_RULES])dnl
281 dnl The testsuite driver may need to know about EXEEXT, so add the
282 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
283 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
284 AC_CONFIG_COMMANDS_PRE(dnl
285 [m4_provide_if([_AM_COMPILER_EXEEXT],
286 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
287
288 AC_REQUIRE([_AM_PROG_RM_F])
289 AC_REQUIRE([_AM_PROG_XARGS_N])
290
291 dnl The trailing newline in this macro's definition is deliberate, for
292 dnl backward compatibility and to allow trailing 'dnl'-style comments
293 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
294 ])
295
296 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
297 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
298 dnl mangled by Autoconf and run in a shell conditional statement.
299 m4_define([_AC_COMPILER_EXEEXT],
300 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
301
302 # When config.status generates a header, we must update the stamp-h file.
303 # This file resides in the same directory as the config header
304 # that is generated. The stamp files are numbered to have different names.
305
306 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
307 # loop where config.status creates the headers, so we can generate
308 # our stamp files there.
309 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
310 [# Compute $1's index in $config_headers.
311 _am_arg=$1
312 _am_stamp_count=1
313 for _am_header in $config_headers :; do
314 case $_am_header in
315 $_am_arg | $_am_arg:* )
316 break ;;
317 * )
318 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
319 esac
320 done
321 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
322
323 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
324 #
325 # This file is free software; the Free Software Foundation
326 # gives unlimited permission to copy and/or distribute it,
327 # with or without modifications, as long as this notice is preserved.
328
329 # AM_PROG_INSTALL_SH
330 # ------------------
331 # Define $install_sh.
332 AC_DEFUN([AM_PROG_INSTALL_SH],
333 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
334 if test x"${install_sh+set}" != xset; then
335 case $am_aux_dir in
336 *\ * | *\ *)
337 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
338 *)
339 install_sh="\${SHELL} $am_aux_dir/install-sh"
340 esac
341 fi
342 AC_SUBST([install_sh])])
343
344 # Copyright (C) 2003-2024 Free Software Foundation, Inc.
345 #
346 # This file is free software; the Free Software Foundation
347 # gives unlimited permission to copy and/or distribute it,
348 # with or without modifications, as long as this notice is preserved.
349
350 # Check whether the underlying file-system supports filenames
351 # with a leading dot. For instance MS-DOS doesn't.
352 AC_DEFUN([AM_SET_LEADING_DOT],
353 [rm -rf .tst 2>/dev/null
354 mkdir .tst 2>/dev/null
355 if test -d .tst; then
356 am__leading_dot=.
357 else
358 am__leading_dot=_
359 fi
360 rmdir .tst 2>/dev/null
361 AC_SUBST([am__leading_dot])])
362
363 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
364 # From Jim Meyering
365
366 # Copyright (C) 1996-2024 Free Software Foundation, Inc.
367 #
368 # This file is free software; the Free Software Foundation
369 # gives unlimited permission to copy and/or distribute it,
370 # with or without modifications, as long as this notice is preserved.
371
372 # AM_MAINTAINER_MODE([DEFAULT-MODE])
373 # ----------------------------------
374 # Control maintainer-specific portions of Makefiles.
375 # Default is to disable them, unless 'enable' is passed literally.
376 # For symmetry, 'disable' may be passed as well. Anyway, the user
377 # can override the default with the --enable/--disable switch.
378 AC_DEFUN([AM_MAINTAINER_MODE],
379 [m4_case(m4_default([$1], [disable]),
380 [enable], [m4_define([am_maintainer_other], [disable])],
381 [disable], [m4_define([am_maintainer_other], [enable])],
382 [m4_define([am_maintainer_other], [enable])
383 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
384 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
385 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
386 AC_ARG_ENABLE([maintainer-mode],
387 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
388 am_maintainer_other[ make rules and dependencies not useful
389 (and sometimes confusing) to the casual installer])],
390 [USE_MAINTAINER_MODE=$enableval],
391 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
392 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
393 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
394 MAINT=$MAINTAINER_MODE_TRUE
395 AC_SUBST([MAINT])dnl
396 ]
397 )
398
399 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
400
401 # Copyright (C) 1997-2024 Free Software Foundation, Inc.
402 #
403 # This file is free software; the Free Software Foundation
404 # gives unlimited permission to copy and/or distribute it,
405 # with or without modifications, as long as this notice is preserved.
406
407 # AM_MISSING_PROG(NAME, PROGRAM)
408 # ------------------------------
409 AC_DEFUN([AM_MISSING_PROG],
410 [AC_REQUIRE([AM_MISSING_HAS_RUN])
411 $1=${$1-"${am_missing_run}$2"}
412 AC_SUBST($1)])
413
414 # AM_MISSING_HAS_RUN
415 # ------------------
416 # Define MISSING if not defined so far and test if it is modern enough.
417 # If it is, set am_missing_run to use it, otherwise, to nothing.
418 AC_DEFUN([AM_MISSING_HAS_RUN],
419 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
420 AC_REQUIRE_AUX_FILE([missing])dnl
421 if test x"${MISSING+set}" != xset; then
422 MISSING="\${SHELL} '$am_aux_dir/missing'"
423 fi
424 # Use eval to expand $SHELL
425 if eval "$MISSING --is-lightweight"; then
426 am_missing_run="$MISSING "
427 else
428 am_missing_run=
429 AC_MSG_WARN(['missing' script is too old or missing])
430 fi
431 ])
432
433 # Helper functions for option handling. -*- Autoconf -*-
434
435 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
436 #
437 # This file is free software; the Free Software Foundation
438 # gives unlimited permission to copy and/or distribute it,
439 # with or without modifications, as long as this notice is preserved.
440
441 # _AM_MANGLE_OPTION(NAME)
442 # -----------------------
443 AC_DEFUN([_AM_MANGLE_OPTION],
444 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
445
446 # _AM_SET_OPTION(NAME)
447 # --------------------
448 # Set option NAME. Presently that only means defining a flag for this option.
449 AC_DEFUN([_AM_SET_OPTION],
450 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
451
452 # _AM_SET_OPTIONS(OPTIONS)
453 # ------------------------
454 # OPTIONS is a space-separated list of Automake options.
455 AC_DEFUN([_AM_SET_OPTIONS],
456 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
457
458 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
459 # -------------------------------------------
460 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
461 AC_DEFUN([_AM_IF_OPTION],
462 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
463
464 # Copyright (C) 2022-2024 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_PROG_RM_F
471 # ---------------
472 # Check whether 'rm -f' without any arguments works.
473 # https://bugs.gnu.org/10828
474 AC_DEFUN([_AM_PROG_RM_F],
475 [am__rm_f_notfound=
476 AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""'])
477 AC_SUBST(am__rm_f_notfound)
478 ])
479
480 # Check to make sure that the build environment is sane. -*- Autoconf -*-
481
482 # Copyright (C) 1996-2024 Free Software Foundation, Inc.
483 #
484 # This file is free software; the Free Software Foundation
485 # gives unlimited permission to copy and/or distribute it,
486 # with or without modifications, as long as this notice is preserved.
487
488 # _AM_SLEEP_FRACTIONAL_SECONDS
489 # ----------------------------
490 AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl
491 AC_CACHE_CHECK([whether sleep supports fractional seconds],
492 am_cv_sleep_fractional_seconds, [dnl
493 AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes],
494 [am_cv_sleep_fractional_seconds=no])
495 ])])
496
497 # _AM_FILESYSTEM_TIMESTAMP_RESOLUTION
498 # -----------------------------------
499 # Determine the filesystem's resolution for file modification
500 # timestamps. The coarsest we know of is FAT, with a resolution
501 # of only two seconds, even with the most recent "exFAT" extensions.
502 # The finest (e.g. ext4 with large inodes, XFS, ZFS) is one
503 # nanosecond, matching clock_gettime. However, it is probably not
504 # possible to delay execution of a shell script for less than one
505 # millisecond, due to process creation overhead and scheduling
506 # granularity, so we don't check for anything finer than that. (See below.)
507 AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl
508 AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS])
509 AC_CACHE_CHECK([filesystem timestamp resolution],
510 am_cv_filesystem_timestamp_resolution, [dnl
511 # Default to the worst case.
512 am_cv_filesystem_timestamp_resolution=2
513
514 # Only try to go finer than 1 sec if sleep can do it.
515 # Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work,
516 # - 1 sec is not much of a win compared to 2 sec, and
517 # - it takes 2 seconds to perform the test whether 1 sec works.
518 #
519 # Instead, just use the default 2s on platforms that have 1s resolution,
520 # accept the extra 1s delay when using $sleep in the Automake tests, in
521 # exchange for not incurring the 2s delay for running the test for all
522 # packages.
523 #
524 am_try_resolutions=
525 if test "$am_cv_sleep_fractional_seconds" = yes; then
526 # Even a millisecond often causes a bunch of false positives,
527 # so just try a hundredth of a second. The time saved between .001 and
528 # .01 is not terribly consequential.
529 am_try_resolutions="0.01 0.1 $am_try_resolutions"
530 fi
531
532 # In order to catch current-generation FAT out, we must *modify* files
533 # that already exist; the *creation* timestamp is finer. Use names
534 # that make ls -t sort them differently when they have equal
535 # timestamps than when they have distinct timestamps, keeping
536 # in mind that ls -t prints the *newest* file first.
537 rm -f conftest.ts?
538 : > conftest.ts1
539 : > conftest.ts2
540 : > conftest.ts3
541
542 # Make sure ls -t actually works. Do 'set' in a subshell so we don't
543 # clobber the current shell's arguments. (Outer-level square brackets
544 # are removed by m4; they're present so that m4 does not expand
545 # <dollar><star>; be careful, easy to get confused.)
546 if (
547 set X `[ls -t conftest.ts[12]]` &&
548 {
549 test "$[]*" != "X conftest.ts1 conftest.ts2" ||
550 test "$[]*" != "X conftest.ts2 conftest.ts1";
551 }
552 ); then :; else
553 # If neither matched, then we have a broken ls. This can happen
554 # if, for instance, CONFIG_SHELL is bash and it inherits a
555 # broken ls alias from the environment. This has actually
556 # happened. Such a system could not be considered "sane".
557 _AS_ECHO_UNQUOTED(
558 ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""],
559 [AS_MESSAGE_LOG_FD])
560 AC_MSG_FAILURE([ls -t produces unexpected output.
561 Make sure there is not a broken ls alias in your environment.])
562 fi
563
564 for am_try_res in $am_try_resolutions; do
565 # Any one fine-grained sleep might happen to cross the boundary
566 # between two values of a coarser actual resolution, but if we do
567 # two fine-grained sleeps in a row, at least one of them will fall
568 # entirely within a coarse interval.
569 echo alpha > conftest.ts1
570 sleep $am_try_res
571 echo beta > conftest.ts2
572 sleep $am_try_res
573 echo gamma > conftest.ts3
574
575 # We assume that 'ls -t' will make use of high-resolution
576 # timestamps if the operating system supports them at all.
577 if (set X `ls -t conftest.ts?` &&
578 test "$[]2" = conftest.ts3 &&
579 test "$[]3" = conftest.ts2 &&
580 test "$[]4" = conftest.ts1); then
581 #
582 # Ok, ls -t worked. If we're at a resolution of 1 second, we're done,
583 # because we don't need to test make.
584 make_ok=true
585 if test $am_try_res != 1; then
586 # But if we've succeeded so far with a subsecond resolution, we
587 # have one more thing to check: make. It can happen that
588 # everything else supports the subsecond mtimes, but make doesn't;
589 # notably on macOS, which ships make 3.81 from 2006 (the last one
590 # released under GPLv2). https://bugs.gnu.org/68808
591 #
592 # We test $MAKE if it is defined in the environment, else "make".
593 # It might get overridden later, but our hope is that in practice
594 # it does not matter: it is the system "make" which is (by far)
595 # the most likely to be broken, whereas if the user overrides it,
596 # probably they did so with a better, or at least not worse, make.
597 # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html
598 #
599 # Create a Makefile (real tab character here):
600 rm -f conftest.mk
601 echo 'conftest.ts1: conftest.ts2' >conftest.mk
602 echo ' touch conftest.ts2' >>conftest.mk
603 #
604 # Now, running
605 # touch conftest.ts1; touch conftest.ts2; make
606 # should touch ts1 because ts2 is newer. This could happen by luck,
607 # but most often, it will fail if make's support is insufficient. So
608 # test for several consecutive successes.
609 #
610 # (We reuse conftest.ts[12] because we still want to modify existing
611 # files, not create new ones, per above.)
612 n=0
613 make=${MAKE-make}
614 until test $n -eq 3; do
615 echo one > conftest.ts1
616 sleep $am_try_res
617 echo two > conftest.ts2 # ts2 should now be newer than ts1
618 if $make -f conftest.mk | grep 'up to date' >/dev/null; then
619 make_ok=false
620 break # out of $n loop
621 fi
622 n=`expr $n + 1`
623 done
624 fi
625 #
626 if $make_ok; then
627 # Everything we know to check worked out, so call this resolution good.
628 am_cv_filesystem_timestamp_resolution=$am_try_res
629 break # out of $am_try_res loop
630 fi
631 # Otherwise, we'll go on to check the next resolution.
632 fi
633 done
634 rm -f conftest.ts?
635 # (end _am_filesystem_timestamp_resolution)
636 ])])
637
638 # AM_SANITY_CHECK
639 # ---------------
640 AC_DEFUN([AM_SANITY_CHECK],
641 [AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION])
642 # This check should not be cached, as it may vary across builds of
643 # different projects.
644 AC_MSG_CHECKING([whether build environment is sane])
645 # Reject unsafe characters in $srcdir or the absolute working directory
646 # name. Accept space and tab only in the latter.
647 am_lf='
648 '
649 case `pwd` in
650 *[[\\\"\#\$\&\'\`$am_lf]]*)
651 AC_MSG_ERROR([unsafe absolute working directory name]);;
652 esac
653 case $srcdir in
654 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
655 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
656 esac
657
658 # Do 'set' in a subshell so we don't clobber the current shell's
659 # arguments. Must try -L first in case configure is actually a
660 # symlink; some systems play weird games with the mod time of symlinks
661 # (eg FreeBSD returns the mod time of the symlink's containing
662 # directory).
663 am_build_env_is_sane=no
664 am_has_slept=no
665 rm -f conftest.file
666 for am_try in 1 2; do
667 echo "timestamp, slept: $am_has_slept" > conftest.file
668 if (
669 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
670 if test "$[]*" = "X"; then
671 # -L didn't work.
672 set X `ls -t "$srcdir/configure" conftest.file`
673 fi
674 test "$[]2" = conftest.file
675 ); then
676 am_build_env_is_sane=yes
677 break
678 fi
679 # Just in case.
680 sleep "$am_cv_filesystem_timestamp_resolution"
681 am_has_slept=yes
682 done
683
684 AC_MSG_RESULT([$am_build_env_is_sane])
685 if test "$am_build_env_is_sane" = no; then
686 AC_MSG_ERROR([newly created file is older than distributed files!
687 Check your system clock])
688 fi
689
690 # If we didn't sleep, we still need to ensure time stamps of config.status and
691 # generated files are strictly newer.
692 am_sleep_pid=
693 AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl
694 ( sleep "$am_cv_filesystem_timestamp_resolution" ) &
695 am_sleep_pid=$!
696 ])
697 AC_CONFIG_COMMANDS_PRE(
698 [AC_MSG_CHECKING([that generated files are newer than configure])
699 if test -n "$am_sleep_pid"; then
700 # Hide warnings about reused PIDs.
701 wait $am_sleep_pid 2>/dev/null
702 fi
703 AC_MSG_RESULT([done])])
704 rm -f conftest.file
705 ])
706
707 # Copyright (C) 2009-2024 Free Software Foundation, Inc.
708 #
709 # This file is free software; the Free Software Foundation
710 # gives unlimited permission to copy and/or distribute it,
711 # with or without modifications, as long as this notice is preserved.
712
713 # _AM_SILENT_RULES
714 # ----------------
715 # Enable less verbose build rules support.
716 AC_DEFUN([_AM_SILENT_RULES],
717 [AM_DEFAULT_VERBOSITY=1
718 AC_ARG_ENABLE([silent-rules], [dnl
719 AS_HELP_STRING(
720 [--enable-silent-rules],
721 [less verbose build output (undo: "make V=1")])
722 AS_HELP_STRING(
723 [--disable-silent-rules],
724 [verbose build output (undo: "make V=0")])dnl
725 ])
726 dnl
727 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
728 dnl do not support nested variable expansions.
729 dnl See automake bug#9928 and bug#10237.
730 am_make=${MAKE-make}
731 AC_CACHE_CHECK([whether $am_make supports nested variables],
732 [am_cv_make_support_nested_variables],
733 [if AS_ECHO([['TRUE=$(BAR$(V))
734 BAR0=false
735 BAR1=true
736 V=1
737 am__doit:
738 @$(TRUE)
739 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
740 am_cv_make_support_nested_variables=yes
741 else
742 am_cv_make_support_nested_variables=no
743 fi])
744 AC_SUBST([AM_V])dnl
745 AM_SUBST_NOTMAKE([AM_V])dnl
746 AC_SUBST([AM_DEFAULT_V])dnl
747 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
748 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
749 AM_BACKSLASH='\'
750 AC_SUBST([AM_BACKSLASH])dnl
751 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
752 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
753 dnl to AM_SILENT_RULES to change the default value.
754 AC_CONFIG_COMMANDS_PRE([dnl
755 case $enable_silent_rules in @%:@ (((
756 yes) AM_DEFAULT_VERBOSITY=0;;
757 no) AM_DEFAULT_VERBOSITY=1;;
758 esac
759 if test $am_cv_make_support_nested_variables = yes; then
760 dnl Using '$V' instead of '$(V)' breaks IRIX make.
761 AM_V='$(V)'
762 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
763 else
764 AM_V=$AM_DEFAULT_VERBOSITY
765 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
766 fi
767 ])dnl
768 ])
769
770 # AM_SILENT_RULES([DEFAULT])
771 # --------------------------
772 # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
773 # empty being verbose).
774 AC_DEFUN([AM_SILENT_RULES],
775 [AC_REQUIRE([_AM_SILENT_RULES])
776 AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])
777
778 # Copyright (C) 2001-2024 Free Software Foundation, Inc.
779 #
780 # This file is free software; the Free Software Foundation
781 # gives unlimited permission to copy and/or distribute it,
782 # with or without modifications, as long as this notice is preserved.
783
784 # AM_PROG_INSTALL_STRIP
785 # ---------------------
786 # One issue with vendor 'install' (even GNU) is that you can't
787 # specify the program used to strip binaries. This is especially
788 # annoying in cross-compiling environments, where the build's strip
789 # is unlikely to handle the host's binaries.
790 # Fortunately install-sh will honor a STRIPPROG variable, so we
791 # always use install-sh in "make install-strip", and initialize
792 # STRIPPROG with the value of the STRIP variable (set by the user).
793 AC_DEFUN([AM_PROG_INSTALL_STRIP],
794 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
795 # Installed binaries are usually stripped using 'strip' when the user
796 # run "make install-strip". However 'strip' might not be the right
797 # tool to use in cross-compilation environments, therefore Automake
798 # will honor the 'STRIP' environment variable to overrule this program.
799 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
800 if test "$cross_compiling" != no; then
801 AC_CHECK_TOOL([STRIP], [strip], :)
802 fi
803 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
804 AC_SUBST([INSTALL_STRIP_PROGRAM])])
805
806 # Copyright (C) 2006-2024 Free Software Foundation, Inc.
807 #
808 # This file is free software; the Free Software Foundation
809 # gives unlimited permission to copy and/or distribute it,
810 # with or without modifications, as long as this notice is preserved.
811
812 # _AM_SUBST_NOTMAKE(VARIABLE)
813 # ---------------------------
814 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
815 # This macro is traced by Automake.
816 AC_DEFUN([_AM_SUBST_NOTMAKE])
817
818 # AM_SUBST_NOTMAKE(VARIABLE)
819 # --------------------------
820 # Public sister of _AM_SUBST_NOTMAKE.
821 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
822
823 # Check how to create a tarball. -*- Autoconf -*-
824
825 # Copyright (C) 2004-2024 Free Software Foundation, Inc.
826 #
827 # This file is free software; the Free Software Foundation
828 # gives unlimited permission to copy and/or distribute it,
829 # with or without modifications, as long as this notice is preserved.
830
831 # _AM_PROG_TAR(FORMAT)
832 # --------------------
833 # Check how to create a tarball in format FORMAT.
834 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
835 #
836 # Substitute a variable $(am__tar) that is a command
837 # writing to stdout a FORMAT-tarball containing the directory
838 # $tardir.
839 # tardir=directory && $(am__tar) > result.tar
840 #
841 # Substitute a variable $(am__untar) that extract such
842 # a tarball read from stdin.
843 # $(am__untar) < result.tar
844 #
845 AC_DEFUN([_AM_PROG_TAR],
846 [# Always define AMTAR for backward compatibility. Yes, it's still used
847 # in the wild :-( We should find a proper way to deprecate it ...
848 AC_SUBST([AMTAR], ['$${TAR-tar}'])
849
850 # We'll loop over all known methods to create a tar archive until one works.
851 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
852
853 m4_if([$1], [v7],
854 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
855
856 [m4_case([$1],
857 [ustar],
858 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
859 # There is notably a 21 bits limit for the UID and the GID. In fact,
860 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
861 # and bug#13588).
862 am_max_uid=2097151 # 2^21 - 1
863 am_max_gid=$am_max_uid
864 # The $UID and $GID variables are not portable, so we need to resort
865 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
866 # below are definitely unexpected, so allow the users to see them
867 # (that is, avoid stderr redirection).
868 am_uid=`id -u || echo unknown`
869 am_gid=`id -g || echo unknown`
870 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
871 if test x$am_uid = xunknown; then
872 AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work])
873 elif test $am_uid -le $am_max_uid; then
874 AC_MSG_RESULT([yes])
875 else
876 AC_MSG_RESULT([no])
877 _am_tools=none
878 fi
879 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
880 if test x$gm_gid = xunknown; then
881 AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work])
882 elif test $am_gid -le $am_max_gid; then
883 AC_MSG_RESULT([yes])
884 else
885 AC_MSG_RESULT([no])
886 _am_tools=none
887 fi],
888
889 [pax],
890 [],
891
892 [m4_fatal([Unknown tar format])])
893
894 AC_MSG_CHECKING([how to create a $1 tar archive])
895
896 # Go ahead even if we have the value already cached. We do so because we
897 # need to set the values for the 'am__tar' and 'am__untar' variables.
898 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
899
900 for _am_tool in $_am_tools; do
901 case $_am_tool in
902 gnutar)
903 for _am_tar in tar gnutar gtar; do
904 AM_RUN_LOG([$_am_tar --version]) && break
905 done
906 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
907 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
908 am__untar="$_am_tar -xf -"
909 ;;
910 plaintar)
911 # Must skip GNU tar: if it does not support --format= it doesn't create
912 # ustar tarball either.
913 (tar --version) >/dev/null 2>&1 && continue
914 am__tar='tar chf - "$$tardir"'
915 am__tar_='tar chf - "$tardir"'
916 am__untar='tar xf -'
917 ;;
918 pax)
919 am__tar='pax -L -x $1 -w "$$tardir"'
920 am__tar_='pax -L -x $1 -w "$tardir"'
921 am__untar='pax -r'
922 ;;
923 cpio)
924 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
925 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
926 am__untar='cpio -i -H $1 -d'
927 ;;
928 none)
929 am__tar=false
930 am__tar_=false
931 am__untar=false
932 ;;
933 esac
934
935 # If the value was cached, stop now. We just wanted to have am__tar
936 # and am__untar set.
937 test -n "${am_cv_prog_tar_$1}" && break
938
939 # tar/untar a dummy directory, and stop if the command works.
940 rm -rf conftest.dir
941 mkdir conftest.dir
942 echo GrepMe > conftest.dir/file
943 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
944 rm -rf conftest.dir
945 if test -s conftest.tar; then
946 AM_RUN_LOG([$am__untar <conftest.tar])
947 AM_RUN_LOG([cat conftest.dir/file])
948 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
949 fi
950 done
951 rm -rf conftest.dir
952
953 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
954 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
955
956 AC_SUBST([am__tar])
957 AC_SUBST([am__untar])
958 ]) # _AM_PROG_TAR
959
960 # Copyright (C) 2022-2024 Free Software Foundation, Inc.
961 #
962 # This file is free software; the Free Software Foundation
963 # gives unlimited permission to copy and/or distribute it,
964 # with or without modifications, as long as this notice is preserved.
965
966 # _AM_PROG_XARGS_N
967 # ----------------
968 # Check whether 'xargs -n' works. It should work everywhere, so the fallback
969 # is not optimized at all as we never expect to use it.
970 AC_DEFUN([_AM_PROG_XARGS_N],
971 [AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl
972 AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2
973 3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])])
974 AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl
975 am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }'
976 ])dnl
977 AC_SUBST(am__xargs_n)
978 ])
979