blob: 2e907f06d73714185585b8e1524f49e69b888d7e [file] [log] [blame]
Martin Storsjöd6c07d92023-10-27 21:02:54 +03001# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
NightStrikef5efb612007-11-07 16:01:13 +00002
LIU Hao6eb57142022-08-16 14:36:34 +08003# Copyright (C) 1996-2021 Free Software Foundation, Inc.
NightStrike0e8caf32012-07-09 14:25:07 +00004
NightStrikef5efb612007-11-07 16:01:13 +00005# 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
NightStrike326ad9f2013-09-06 13:27:17 +000014m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
NightStrike5c464372008-09-17 18:06:46 +000015m4_ifndef([AC_AUTOCONF_VERSION],
16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
LIU Haob4515a62024-01-09 22:24:06 +080017m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],,
18[m4_warning([this file was generated for autoconf 2.72.
NightStrike5c464372008-09-17 18:06:46 +000019You have another version of autoconf. It may work, but is not guaranteed to.
20If you have problems, you may need to regenerate the build system entirely.
NightStrike0e8caf32012-07-09 14:25:07 +000021To do so, use the procedure documented by the package, typically 'autoreconf'.])])
NightStrikef5efb612007-11-07 16:01:13 +000022
LIU Hao6eb57142022-08-16 14:36:34 +080023# Copyright (C) 2002-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +000024#
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.)
34AC_DEFUN([AM_AUTOMAKE_VERSION],
Jacek Caban7eff69b2020-02-01 10:50:07 +010035[am__api_version='1.16'
NightStrikef5efb612007-11-07 16:01:13 +000036dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37dnl require some minimum version. Point them to the right macro.
Martin Storsjöd6c07d92023-10-27 21:02:54 +030038m4_if([$1], [1.16.5], [],
NightStrikef5efb612007-11-07 16:01:13 +000039 [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.
47m4_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.
Ozkan Sezer5ca95912009-04-11 08:01:05 +000052# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
NightStrikef5efb612007-11-07 16:01:13 +000053AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
Martin Storsjöd6c07d92023-10-27 21:02:54 +030054[AM_AUTOMAKE_VERSION([1.16.5])dnl
NightStrike5c464372008-09-17 18:06:46 +000055m4_ifndef([AC_AUTOCONF_VERSION],
56 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
Ozkan Sezer5ca95912009-04-11 08:01:05 +000057_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
NightStrikef5efb612007-11-07 16:01:13 +000058
LIU Hao6eb57142022-08-16 14:36:34 +080059# Copyright (C) 2011-2021 Free Software Foundation, Inc.
NightStrike989e3f92012-07-09 19:43:01 +000060#
61# This file is free software; the Free Software Foundation
62# gives unlimited permission to copy and/or distribute it,
63# with or without modifications, as long as this notice is preserved.
64
NightStrike989e3f92012-07-09 19:43:01 +000065# AM_PROG_AR([ACT-IF-FAIL])
66# -------------------------
67# Try to determine the archiver interface, and trigger the ar-lib wrapper
68# if it is needed. If the detection of archiver interface fails, run
69# ACT-IF-FAIL (default is to abort configure with a proper error message).
70AC_DEFUN([AM_PROG_AR],
71[AC_BEFORE([$0], [LT_INIT])dnl
72AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
73AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
74AC_REQUIRE_AUX_FILE([ar-lib])dnl
75AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
76: ${AR=ar}
77
78AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
NightStrike326ad9f2013-09-06 13:27:17 +000079 [AC_LANG_PUSH([C])
80 am_cv_ar_interface=ar
NightStrike989e3f92012-07-09 19:43:01 +000081 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
82 [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
83 AC_TRY_EVAL([am_ar_try])
84 if test "$ac_status" -eq 0; then
85 am_cv_ar_interface=ar
86 else
87 am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
88 AC_TRY_EVAL([am_ar_try])
89 if test "$ac_status" -eq 0; then
90 am_cv_ar_interface=lib
91 else
92 am_cv_ar_interface=unknown
93 fi
94 fi
95 rm -f conftest.lib libconftest.a
96 ])
NightStrike326ad9f2013-09-06 13:27:17 +000097 AC_LANG_POP([C])])
NightStrike989e3f92012-07-09 19:43:01 +000098
99case $am_cv_ar_interface in
100ar)
101 ;;
102lib)
103 # Microsoft lib, so override with the ar-lib wrapper script.
104 # FIXME: It is wrong to rewrite AR.
105 # But if we don't then we get into trouble of one sort or another.
106 # A longer-term fix would be to have automake use am__AR in this case,
107 # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
108 # similar.
109 AR="$am_aux_dir/ar-lib $AR"
110 ;;
111unknown)
112 m4_default([$1],
113 [AC_MSG_ERROR([could not determine $AR interface])])
114 ;;
115esac
116AC_SUBST([AR])dnl
117])
118
NightStrikef5efb612007-11-07 16:01:13 +0000119# Figure out how to run the assembler. -*- Autoconf -*-
120
LIU Hao6eb57142022-08-16 14:36:34 +0800121# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000122#
123# This file is free software; the Free Software Foundation
124# gives unlimited permission to copy and/or distribute it,
125# with or without modifications, as long as this notice is preserved.
126
NightStrikef5efb612007-11-07 16:01:13 +0000127# AM_PROG_AS
128# ----------
129AC_DEFUN([AM_PROG_AS],
130[# By default we simply use the C compiler to build assembly code.
131AC_REQUIRE([AC_PROG_CC])
132test "${CCAS+set}" = set || CCAS=$CC
133test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
134AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
135AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
136_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
137])
138
139# AM_AUX_DIR_EXPAND -*- Autoconf -*-
140
LIU Hao6eb57142022-08-16 14:36:34 +0800141# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000142#
143# This file is free software; the Free Software Foundation
144# gives unlimited permission to copy and/or distribute it,
145# with or without modifications, as long as this notice is preserved.
146
147# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
NightStrike0e8caf32012-07-09 14:25:07 +0000148# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
149# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
NightStrikef5efb612007-11-07 16:01:13 +0000150#
151# Of course, Automake must honor this variable whenever it calls a
152# tool from the auxiliary directory. The problem is that $srcdir (and
153# therefore $ac_aux_dir as well) can be either absolute or relative,
154# depending on how configure is run. This is pretty annoying, since
155# it makes $ac_aux_dir quite unusable in subdirectories: in the top
156# source directory, any form will work fine, but in subdirectories a
157# relative path needs to be adjusted first.
158#
159# $ac_aux_dir/missing
160# fails when called from a subdirectory if $ac_aux_dir is relative
161# $top_srcdir/$ac_aux_dir/missing
162# fails if $ac_aux_dir is absolute,
163# fails when called from a subdirectory in a VPATH build with
164# a relative $ac_aux_dir
165#
166# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
167# are both prefixed by $srcdir. In an in-source build this is usually
NightStrike0e8caf32012-07-09 14:25:07 +0000168# harmless because $srcdir is '.', but things will broke when you
NightStrikef5efb612007-11-07 16:01:13 +0000169# start a VPATH build or use an absolute $srcdir.
170#
171# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
172# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
173# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
174# and then we would define $MISSING as
175# MISSING="\${SHELL} $am_aux_dir/missing"
176# This will work as long as MISSING is not called from configure, because
177# unfortunately $(top_srcdir) has no meaning in configure.
178# However there are other variables, like CC, which are often used in
179# configure, and could therefore not use this "fixed" $ac_aux_dir.
180#
181# Another solution, used here, is to always expand $ac_aux_dir to an
182# absolute PATH. The drawback is that using absolute paths prevent a
183# configured tree to be moved without reconfiguration.
184
185AC_DEFUN([AM_AUX_DIR_EXPAND],
David Wohlferd2bb22142016-08-10 21:06:50 -0700186[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
187# Expand $ac_aux_dir to an absolute path.
188am_aux_dir=`cd "$ac_aux_dir" && pwd`
NightStrikef5efb612007-11-07 16:01:13 +0000189])
190
Jonathan Yong321b7a42014-01-24 13:47:55 +0000191# AM_COND_IF -*- Autoconf -*-
192
LIU Hao6eb57142022-08-16 14:36:34 +0800193# Copyright (C) 2008-2021 Free Software Foundation, Inc.
Jonathan Yong321b7a42014-01-24 13:47:55 +0000194#
195# This file is free software; the Free Software Foundation
196# gives unlimited permission to copy and/or distribute it,
197# with or without modifications, as long as this notice is preserved.
198
199# _AM_COND_IF
200# _AM_COND_ELSE
201# _AM_COND_ENDIF
202# --------------
203# These macros are only used for tracing.
204m4_define([_AM_COND_IF])
205m4_define([_AM_COND_ELSE])
206m4_define([_AM_COND_ENDIF])
207
208# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
209# ---------------------------------------
210# If the shell condition COND is true, execute IF-TRUE, otherwise execute
211# IF-FALSE. Allow automake to learn about conditional instantiating macros
212# (the AC_CONFIG_FOOS).
213AC_DEFUN([AM_COND_IF],
214[m4_ifndef([_AM_COND_VALUE_$1],
215 [m4_fatal([$0: no such condition "$1"])])dnl
216_AM_COND_IF([$1])dnl
217if test -z "$$1_TRUE"; then :
218 m4_n([$2])[]dnl
219m4_ifval([$3],
220[_AM_COND_ELSE([$1])dnl
221else
222 $3
223])dnl
224_AM_COND_ENDIF([$1])dnl
225fi[]dnl
226])
227
NightStrikef5efb612007-11-07 16:01:13 +0000228# AM_CONDITIONAL -*- Autoconf -*-
229
LIU Hao6eb57142022-08-16 14:36:34 +0800230# Copyright (C) 1997-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000231#
232# This file is free software; the Free Software Foundation
233# gives unlimited permission to copy and/or distribute it,
234# with or without modifications, as long as this notice is preserved.
235
NightStrikef5efb612007-11-07 16:01:13 +0000236# AM_CONDITIONAL(NAME, SHELL-CONDITION)
237# -------------------------------------
238# Define a conditional.
239AC_DEFUN([AM_CONDITIONAL],
NightStrike0e8caf32012-07-09 14:25:07 +0000240[AC_PREREQ([2.52])dnl
241 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
242 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000243AC_SUBST([$1_TRUE])dnl
244AC_SUBST([$1_FALSE])dnl
245_AM_SUBST_NOTMAKE([$1_TRUE])dnl
246_AM_SUBST_NOTMAKE([$1_FALSE])dnl
NightStrikee38230c2009-06-09 18:50:24 +0000247m4_define([_AM_COND_VALUE_$1], [$2])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000248if $2; then
249 $1_TRUE=
250 $1_FALSE='#'
251else
252 $1_TRUE='#'
253 $1_FALSE=
254fi
255AC_CONFIG_COMMANDS_PRE(
256[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
257 AC_MSG_ERROR([[conditional "$1" was never defined.
258Usually this means the macro was only invoked conditionally.]])
259fi])])
260
LIU Hao6eb57142022-08-16 14:36:34 +0800261# Copyright (C) 1999-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000262#
263# This file is free software; the Free Software Foundation
264# gives unlimited permission to copy and/or distribute it,
265# with or without modifications, as long as this notice is preserved.
266
NightStrikef5efb612007-11-07 16:01:13 +0000267
NightStrike0e8caf32012-07-09 14:25:07 +0000268# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
NightStrikef5efb612007-11-07 16:01:13 +0000269# written in clear, in which case automake, when reading aclocal.m4,
270# will think it sees a *use*, and therefore will trigger all it's
271# C support machinery. Also note that it means that autoscan, seeing
272# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
273
274
275# _AM_DEPENDENCIES(NAME)
276# ----------------------
277# See how the compiler implements dependency checking.
NightStrike0e8caf32012-07-09 14:25:07 +0000278# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
NightStrikef5efb612007-11-07 16:01:13 +0000279# We try a few techniques and use that to set a single cache variable.
280#
281# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
282# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
283# dependency, and given that the user is not expected to run this macro,
284# just rely on AC_PROG_CC.
285AC_DEFUN([_AM_DEPENDENCIES],
286[AC_REQUIRE([AM_SET_DEPDIR])dnl
287AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
288AC_REQUIRE([AM_MAKE_INCLUDE])dnl
289AC_REQUIRE([AM_DEP_TRACK])dnl
290
NightStrike0e8caf32012-07-09 14:25:07 +0000291m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
292 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
293 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
294 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
295 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
296 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
297 [depcc="$$1" am_compiler_list=])
NightStrikef5efb612007-11-07 16:01:13 +0000298
299AC_CACHE_CHECK([dependency style of $depcc],
300 [am_cv_$1_dependencies_compiler_type],
301[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
302 # We make a subdir and do the tests there. Otherwise we can end up
303 # making bogus files that we don't know about and never remove. For
304 # instance it was reported that on HP-UX the gcc test will end up
NightStrike0e8caf32012-07-09 14:25:07 +0000305 # making a dummy file named 'D' -- because '-MD' means "put the output
306 # in D".
Jonathan Yongc4992882012-05-26 10:00:46 +0000307 rm -rf conftest.dir
NightStrikef5efb612007-11-07 16:01:13 +0000308 mkdir conftest.dir
309 # Copy depcomp to subdir because otherwise we won't find it if we're
310 # using a relative directory.
311 cp "$am_depcomp" conftest.dir
312 cd conftest.dir
313 # We will build objects and dependencies in a subdirectory because
314 # it helps to detect inapplicable dependency modes. For instance
315 # both Tru64's cc and ICC support -MD to output dependencies as a
316 # side effect of compilation, but ICC will put the dependencies in
317 # the current directory while Tru64 will put them in the object
318 # directory.
319 mkdir sub
320
321 am_cv_$1_dependencies_compiler_type=none
322 if test "$am_compiler_list" = ""; then
323 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
324 fi
NightStrikee38230c2009-06-09 18:50:24 +0000325 am__universal=false
326 m4_case([$1], [CC],
327 [case " $depcc " in #(
328 *\ -arch\ *\ -arch\ *) am__universal=true ;;
329 esac],
330 [CXX],
331 [case " $depcc " in #(
332 *\ -arch\ *\ -arch\ *) am__universal=true ;;
333 esac])
334
NightStrikef5efb612007-11-07 16:01:13 +0000335 for depmode in $am_compiler_list; do
336 # Setup a source with many dependencies, because some compilers
337 # like to wrap large dependency lists on column 80 (with \), and
338 # we should not choose a depcomp mode which is confused by this.
339 #
340 # We need to recreate these files for each test, as the compiler may
341 # overwrite some of them when testing with obscure command lines.
342 # This happens at least with the AIX C compiler.
343 : > sub/conftest.c
344 for i in 1 2 3 4 5 6; do
345 echo '#include "conftst'$i'.h"' >> sub/conftest.c
NightStrike0e8caf32012-07-09 14:25:07 +0000346 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
347 # Solaris 10 /bin/sh.
348 echo '/* dummy */' > sub/conftst$i.h
NightStrikef5efb612007-11-07 16:01:13 +0000349 done
350 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
351
NightStrike0e8caf32012-07-09 14:25:07 +0000352 # We check with '-c' and '-o' for the sake of the "dashmstdout"
NightStrikee38230c2009-06-09 18:50:24 +0000353 # mode. It turns out that the SunPro C++ compiler does not properly
NightStrike0e8caf32012-07-09 14:25:07 +0000354 # handle '-M -o', and we need to detect this. Also, some Intel
355 # versions had trouble with output in subdirs.
NightStrikee38230c2009-06-09 18:50:24 +0000356 am__obj=sub/conftest.${OBJEXT-o}
357 am__minus_obj="-o $am__obj"
NightStrikef5efb612007-11-07 16:01:13 +0000358 case $depmode in
NightStrikee38230c2009-06-09 18:50:24 +0000359 gcc)
360 # This depmode causes a compiler race in universal mode.
361 test "$am__universal" = false || continue
362 ;;
NightStrikef5efb612007-11-07 16:01:13 +0000363 nosideeffect)
NightStrike0e8caf32012-07-09 14:25:07 +0000364 # After this tag, mechanisms are not by side-effect, so they'll
365 # only be used when explicitly requested.
NightStrikef5efb612007-11-07 16:01:13 +0000366 if test "x$enable_dependency_tracking" = xyes; then
367 continue
368 else
369 break
370 fi
371 ;;
Jonathan Yongc4992882012-05-26 10:00:46 +0000372 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
NightStrike0e8caf32012-07-09 14:25:07 +0000373 # This compiler won't grok '-c -o', but also, the minuso test has
NightStrikee38230c2009-06-09 18:50:24 +0000374 # not run yet. These depmodes are late enough in the game, and
375 # so weak that their functioning should not be impacted.
376 am__obj=conftest.${OBJEXT-o}
377 am__minus_obj=
378 ;;
NightStrikef5efb612007-11-07 16:01:13 +0000379 none) break ;;
380 esac
NightStrikef5efb612007-11-07 16:01:13 +0000381 if depmode=$depmode \
NightStrikee38230c2009-06-09 18:50:24 +0000382 source=sub/conftest.c object=$am__obj \
NightStrikef5efb612007-11-07 16:01:13 +0000383 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
NightStrikee38230c2009-06-09 18:50:24 +0000384 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
NightStrikef5efb612007-11-07 16:01:13 +0000385 >/dev/null 2>conftest.err &&
386 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
387 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
NightStrikee38230c2009-06-09 18:50:24 +0000388 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
NightStrikef5efb612007-11-07 16:01:13 +0000389 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
390 # icc doesn't choke on unknown options, it will just issue warnings
391 # or remarks (even with -Werror). So we grep stderr for any message
392 # that says an option was ignored or not supported.
393 # When given -MP, icc 7.0 and 7.1 complain thusly:
394 # icc: Command line warning: ignoring option '-M'; no argument required
395 # The diagnosis changed in icc 8.0:
396 # icc: Command line remark: option '-MP' not supported
397 if (grep 'ignoring option' conftest.err ||
398 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
399 am_cv_$1_dependencies_compiler_type=$depmode
400 break
401 fi
402 fi
403 done
404
405 cd ..
406 rm -rf conftest.dir
407else
408 am_cv_$1_dependencies_compiler_type=none
409fi
410])
411AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
412AM_CONDITIONAL([am__fastdep$1], [
413 test "x$enable_dependency_tracking" != xno \
414 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
415])
416
417
418# AM_SET_DEPDIR
419# -------------
420# Choose a directory name for dependency files.
NightStrike0e8caf32012-07-09 14:25:07 +0000421# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
NightStrikef5efb612007-11-07 16:01:13 +0000422AC_DEFUN([AM_SET_DEPDIR],
423[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
424AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
425])
426
427
428# AM_DEP_TRACK
429# ------------
430AC_DEFUN([AM_DEP_TRACK],
NightStrike0e8caf32012-07-09 14:25:07 +0000431[AC_ARG_ENABLE([dependency-tracking], [dnl
432AS_HELP_STRING(
433 [--enable-dependency-tracking],
434 [do not reject slow dependency extractors])
435AS_HELP_STRING(
436 [--disable-dependency-tracking],
437 [speeds up one-time build])])
NightStrikef5efb612007-11-07 16:01:13 +0000438if test "x$enable_dependency_tracking" != xno; then
439 am_depcomp="$ac_aux_dir/depcomp"
440 AMDEPBACKSLASH='\'
Jonathan Yongc4992882012-05-26 10:00:46 +0000441 am__nodep='_no'
NightStrikef5efb612007-11-07 16:01:13 +0000442fi
443AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
444AC_SUBST([AMDEPBACKSLASH])dnl
445_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
Jonathan Yongc4992882012-05-26 10:00:46 +0000446AC_SUBST([am__nodep])dnl
447_AM_SUBST_NOTMAKE([am__nodep])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000448])
449
450# Generate code to set up dependency tracking. -*- Autoconf -*-
451
LIU Hao6eb57142022-08-16 14:36:34 +0800452# Copyright (C) 1999-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000453#
454# This file is free software; the Free Software Foundation
455# gives unlimited permission to copy and/or distribute it,
456# with or without modifications, as long as this notice is preserved.
457
NightStrikef5efb612007-11-07 16:01:13 +0000458# _AM_OUTPUT_DEPENDENCY_COMMANDS
459# ------------------------------
460AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
NightStrikee38230c2009-06-09 18:50:24 +0000461[{
NightStrike326ad9f2013-09-06 13:27:17 +0000462 # Older Autoconf quotes --file arguments for eval, but not when files
NightStrikee38230c2009-06-09 18:50:24 +0000463 # are listed without --file. Let's play safe and only enable the eval
464 # if we detect the quoting.
Jacek Caban7eff69b2020-02-01 10:50:07 +0100465 # TODO: see whether this extra hack can be removed once we start
466 # requiring Autoconf 2.70 or later.
467 AS_CASE([$CONFIG_FILES],
468 [*\'*], [eval set x "$CONFIG_FILES"],
469 [*], [set x $CONFIG_FILES])
NightStrikee38230c2009-06-09 18:50:24 +0000470 shift
Jacek Caban7eff69b2020-02-01 10:50:07 +0100471 # Used to flag and report bootstrapping failures.
472 am_rc=0
473 for am_mf
NightStrikee38230c2009-06-09 18:50:24 +0000474 do
475 # Strip MF so we end up with the name of the file.
Jacek Caban7eff69b2020-02-01 10:50:07 +0100476 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
477 # Check whether this is an Automake generated Makefile which includes
478 # dependency-tracking related rules and includes.
479 # Grep'ing the whole file directly is not great: AIX grep has a line
NightStrikee38230c2009-06-09 18:50:24 +0000480 # limit of 2048, but all sed's we know have understand at least 4000.
Jacek Caban7eff69b2020-02-01 10:50:07 +0100481 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
482 || continue
483 am_dirpart=`AS_DIRNAME(["$am_mf"])`
484 am_filepart=`AS_BASENAME(["$am_mf"])`
485 AM_RUN_LOG([cd "$am_dirpart" \
486 && sed -e '/# am--include-marker/d' "$am_filepart" \
487 | $MAKE -f - am--depfiles]) || am_rc=$?
NightStrikef5efb612007-11-07 16:01:13 +0000488 done
Jacek Caban7eff69b2020-02-01 10:50:07 +0100489 if test $am_rc -ne 0; then
490 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
Liu Haoe8d7c1b2020-06-03 21:54:55 +0800491 for automatic dependency tracking. If GNU make was not used, consider
492 re-running the configure script with MAKE="gmake" (or whatever is
493 necessary). You can also try re-running configure with the
Jacek Caban7eff69b2020-02-01 10:50:07 +0100494 '--disable-dependency-tracking' option to at least be able to build
495 the package (albeit without support for automatic dependency tracking).])
496 fi
497 AS_UNSET([am_dirpart])
498 AS_UNSET([am_filepart])
499 AS_UNSET([am_mf])
500 AS_UNSET([am_rc])
501 rm -f conftest-deps.mk
NightStrikee38230c2009-06-09 18:50:24 +0000502}
NightStrikef5efb612007-11-07 16:01:13 +0000503])# _AM_OUTPUT_DEPENDENCY_COMMANDS
504
505
506# AM_OUTPUT_DEPENDENCY_COMMANDS
507# -----------------------------
508# This macro should only be invoked once -- use via AC_REQUIRE.
509#
Jacek Caban7eff69b2020-02-01 10:50:07 +0100510# This code is only required when automatic dependency tracking is enabled.
511# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
512# order to bootstrap the dependency handling code.
NightStrikef5efb612007-11-07 16:01:13 +0000513AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
514[AC_CONFIG_COMMANDS([depfiles],
515 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
Jacek Caban7eff69b2020-02-01 10:50:07 +0100516 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
NightStrikef5efb612007-11-07 16:01:13 +0000517
518# Do all the work for Automake. -*- Autoconf -*-
519
LIU Hao6eb57142022-08-16 14:36:34 +0800520# Copyright (C) 1996-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000521#
522# This file is free software; the Free Software Foundation
523# gives unlimited permission to copy and/or distribute it,
524# with or without modifications, as long as this notice is preserved.
525
NightStrikef5efb612007-11-07 16:01:13 +0000526# This macro actually does too much. Some checks are only needed if
527# your package does certain things. But this isn't really a big deal.
528
NightStrike326ad9f2013-09-06 13:27:17 +0000529dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
530m4_define([AC_PROG_CC],
531m4_defn([AC_PROG_CC])
532[_AM_PROG_CC_C_O
533])
534
NightStrikef5efb612007-11-07 16:01:13 +0000535# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
536# AM_INIT_AUTOMAKE([OPTIONS])
537# -----------------------------------------------
538# The call with PACKAGE and VERSION arguments is the old style
539# call (pre autoconf-2.50), which is being phased out. PACKAGE
540# and VERSION should now be passed to AC_INIT and removed from
541# the call to AM_INIT_AUTOMAKE.
542# We support both call styles for the transition. After
543# the next Automake release, Autoconf can make the AC_INIT
544# arguments mandatory, and then we can depend on a new Autoconf
545# release and drop the old call support.
546AC_DEFUN([AM_INIT_AUTOMAKE],
NightStrike326ad9f2013-09-06 13:27:17 +0000547[AC_PREREQ([2.65])dnl
Martin Storsjöd6c07d92023-10-27 21:02:54 +0300548m4_ifdef([_$0_ALREADY_INIT],
549 [m4_fatal([$0 expanded multiple times
550]m4_defn([_$0_ALREADY_INIT]))],
551 [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000552dnl Autoconf wants to disallow AM_ names. We explicitly allow
553dnl the ones we care about.
554m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
555AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
556AC_REQUIRE([AC_PROG_INSTALL])dnl
557if test "`cd $srcdir && pwd`" != "`pwd`"; then
558 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
559 # is not polluted with repeated "-I."
560 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
561 # test to see if srcdir already configured
562 if test -f $srcdir/config.status; then
563 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
564 fi
565fi
566
567# test whether we have cygpath
568if test -z "$CYGPATH_W"; then
569 if (cygpath --version) >/dev/null 2>/dev/null; then
570 CYGPATH_W='cygpath -w'
571 else
572 CYGPATH_W=echo
573 fi
574fi
575AC_SUBST([CYGPATH_W])
576
577# Define the identity of the package.
578dnl Distinguish between old-style and new-style calls.
579m4_ifval([$2],
NightStrike0e8caf32012-07-09 14:25:07 +0000580[AC_DIAGNOSE([obsolete],
NightStrike326ad9f2013-09-06 13:27:17 +0000581 [$0: two- and three-arguments forms are deprecated.])
NightStrike0e8caf32012-07-09 14:25:07 +0000582m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000583 AC_SUBST([PACKAGE], [$1])dnl
584 AC_SUBST([VERSION], [$2])],
585[_AM_SET_OPTIONS([$1])dnl
586dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
NightStrike0e8caf32012-07-09 14:25:07 +0000587m4_if(
LIU Hao6eb57142022-08-16 14:36:34 +0800588 m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
NightStrike0e8caf32012-07-09 14:25:07 +0000589 [ok:ok],,
NightStrikef5efb612007-11-07 16:01:13 +0000590 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
591 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
592 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
593
594_AM_IF_OPTION([no-define],,
NightStrike0e8caf32012-07-09 14:25:07 +0000595[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
596 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000597
598# Some tools Automake needs.
599AC_REQUIRE([AM_SANITY_CHECK])dnl
600AC_REQUIRE([AC_ARG_PROGRAM])dnl
NightStrike0e8caf32012-07-09 14:25:07 +0000601AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
602AM_MISSING_PROG([AUTOCONF], [autoconf])
603AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
604AM_MISSING_PROG([AUTOHEADER], [autoheader])
605AM_MISSING_PROG([MAKEINFO], [makeinfo])
NightStrikee38230c2009-06-09 18:50:24 +0000606AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
607AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
NightStrike0e8caf32012-07-09 14:25:07 +0000608AC_REQUIRE([AC_PROG_MKDIR_P])dnl
Jonathan Yonge41828a2012-07-17 14:18:54 +0000609# For better backward compatibility. To be removed once Automake 1.9.x
610# dies out for good. For more background, see:
Jacek Caban7eff69b2020-02-01 10:50:07 +0100611# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
612# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
Jonathan Yonge41828a2012-07-17 14:18:54 +0000613AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
David Wohlferd2bb22142016-08-10 21:06:50 -0700614# We need awk for the "check" target (and possibly the TAP driver). The
615# system "awk" is bad on some platforms.
NightStrikef5efb612007-11-07 16:01:13 +0000616AC_REQUIRE([AC_PROG_AWK])dnl
617AC_REQUIRE([AC_PROG_MAKE_SET])dnl
618AC_REQUIRE([AM_SET_LEADING_DOT])dnl
619_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
NightStrikee38230c2009-06-09 18:50:24 +0000620 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
621 [_AM_PROG_TAR([v7])])])
NightStrikef5efb612007-11-07 16:01:13 +0000622_AM_IF_OPTION([no-dependencies],,
623[AC_PROVIDE_IFELSE([AC_PROG_CC],
NightStrike0e8caf32012-07-09 14:25:07 +0000624 [_AM_DEPENDENCIES([CC])],
625 [m4_define([AC_PROG_CC],
626 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000627AC_PROVIDE_IFELSE([AC_PROG_CXX],
NightStrike0e8caf32012-07-09 14:25:07 +0000628 [_AM_DEPENDENCIES([CXX])],
629 [m4_define([AC_PROG_CXX],
630 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000631AC_PROVIDE_IFELSE([AC_PROG_OBJC],
NightStrike0e8caf32012-07-09 14:25:07 +0000632 [_AM_DEPENDENCIES([OBJC])],
633 [m4_define([AC_PROG_OBJC],
634 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
NightStrike326ad9f2013-09-06 13:27:17 +0000635AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
NightStrike0e8caf32012-07-09 14:25:07 +0000636 [_AM_DEPENDENCIES([OBJCXX])],
637 [m4_define([AC_PROG_OBJCXX],
NightStrike326ad9f2013-09-06 13:27:17 +0000638 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
NightStrikef5efb612007-11-07 16:01:13 +0000639])
LIU Hao6eb57142022-08-16 14:36:34 +0800640# Variables for tags utilities; see am/tags.am
641if test -z "$CTAGS"; then
642 CTAGS=ctags
643fi
644AC_SUBST([CTAGS])
645if test -z "$ETAGS"; then
646 ETAGS=etags
647fi
648AC_SUBST([ETAGS])
649if test -z "$CSCOPE"; then
650 CSCOPE=cscope
651fi
652AC_SUBST([CSCOPE])
653
NightStrike326ad9f2013-09-06 13:27:17 +0000654AC_REQUIRE([AM_SILENT_RULES])dnl
655dnl The testsuite driver may need to know about EXEEXT, so add the
656dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
657dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
NightStrikee38230c2009-06-09 18:50:24 +0000658AC_CONFIG_COMMANDS_PRE(dnl
659[m4_provide_if([_AM_COMPILER_EXEEXT],
660 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
NightStrike326ad9f2013-09-06 13:27:17 +0000661
662# POSIX will say in a future version that running "rm -f" with no argument
663# is OK; and we want to be able to make that assumption in our Makefile
664# recipes. So use an aggressive probe to check that the usage we want is
665# actually supported "in the wild" to an acceptable degree.
666# See automake bug#10828.
667# To make any issue more visible, cause the running configure to be aborted
668# by default if the 'rm' program in use doesn't match our expectations; the
669# user can still override this though.
670if rm -f && rm -fr && rm -rf; then : OK; else
671 cat >&2 <<'END'
672Oops!
673
674Your 'rm' program seems unable to run without file operands specified
675on the command line, even when the '-f' option is present. This is contrary
676to the behaviour of most rm programs out there, and not conforming with
677the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
678
679Please tell bug-automake@gnu.org about your system, including the value
680of your $PATH and any error possibly output before this message. This
681can help us improve future automake versions.
682
683END
684 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
685 echo 'Configuration will proceed anyway, since you have set the' >&2
686 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
687 echo >&2
688 else
689 cat >&2 <<'END'
690Aborting the configuration process, to ensure you take notice of the issue.
691
692You can download and install GNU coreutils to get an 'rm' implementation
Jacek Caban7eff69b2020-02-01 10:50:07 +0100693that behaves properly: <https://www.gnu.org/software/coreutils/>.
NightStrike326ad9f2013-09-06 13:27:17 +0000694
695If you want to complete the configuration process using your problematic
696'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
697to "yes", and re-run configure.
698
699END
700 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
701 fi
David Wohlferd2bb22142016-08-10 21:06:50 -0700702fi
703dnl The trailing newline in this macro's definition is deliberate, for
704dnl backward compatibility and to allow trailing 'dnl'-style comments
705dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
706])
NightStrikef5efb612007-11-07 16:01:13 +0000707
NightStrike0e8caf32012-07-09 14:25:07 +0000708dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
NightStrikee38230c2009-06-09 18:50:24 +0000709dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
710dnl mangled by Autoconf and run in a shell conditional statement.
711m4_define([_AC_COMPILER_EXEEXT],
712m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
713
NightStrikef5efb612007-11-07 16:01:13 +0000714# When config.status generates a header, we must update the stamp-h file.
715# This file resides in the same directory as the config header
716# that is generated. The stamp files are numbered to have different names.
717
718# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
719# loop where config.status creates the headers, so we can generate
720# our stamp files there.
721AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
722[# Compute $1's index in $config_headers.
NightStrike5c464372008-09-17 18:06:46 +0000723_am_arg=$1
NightStrikef5efb612007-11-07 16:01:13 +0000724_am_stamp_count=1
725for _am_header in $config_headers :; do
726 case $_am_header in
NightStrike5c464372008-09-17 18:06:46 +0000727 $_am_arg | $_am_arg:* )
NightStrikef5efb612007-11-07 16:01:13 +0000728 break ;;
729 * )
730 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
731 esac
732done
NightStrike5c464372008-09-17 18:06:46 +0000733echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
NightStrikef5efb612007-11-07 16:01:13 +0000734
LIU Hao6eb57142022-08-16 14:36:34 +0800735# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000736#
737# This file is free software; the Free Software Foundation
738# gives unlimited permission to copy and/or distribute it,
739# with or without modifications, as long as this notice is preserved.
740
741# AM_PROG_INSTALL_SH
742# ------------------
743# Define $install_sh.
744AC_DEFUN([AM_PROG_INSTALL_SH],
745[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
David Wohlferd2bb22142016-08-10 21:06:50 -0700746if test x"${install_sh+set}" != xset; then
NightStrikee38230c2009-06-09 18:50:24 +0000747 case $am_aux_dir in
748 *\ * | *\ *)
749 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
750 *)
751 install_sh="\${SHELL} $am_aux_dir/install-sh"
752 esac
753fi
NightStrike0e8caf32012-07-09 14:25:07 +0000754AC_SUBST([install_sh])])
NightStrikef5efb612007-11-07 16:01:13 +0000755
LIU Hao6eb57142022-08-16 14:36:34 +0800756# Copyright (C) 2003-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000757#
758# This file is free software; the Free Software Foundation
759# gives unlimited permission to copy and/or distribute it,
760# with or without modifications, as long as this notice is preserved.
761
NightStrikef5efb612007-11-07 16:01:13 +0000762# Check whether the underlying file-system supports filenames
763# with a leading dot. For instance MS-DOS doesn't.
764AC_DEFUN([AM_SET_LEADING_DOT],
765[rm -rf .tst 2>/dev/null
766mkdir .tst 2>/dev/null
767if test -d .tst; then
768 am__leading_dot=.
769else
770 am__leading_dot=_
771fi
772rmdir .tst 2>/dev/null
773AC_SUBST([am__leading_dot])])
774
NightStrike8a91b0e2009-05-15 06:20:46 +0000775# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
776# From Jim Meyering
777
LIU Hao6eb57142022-08-16 14:36:34 +0800778# Copyright (C) 1996-2021 Free Software Foundation, Inc.
NightStrike8a91b0e2009-05-15 06:20:46 +0000779#
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
NightStrikee38230c2009-06-09 18:50:24 +0000784# AM_MAINTAINER_MODE([DEFAULT-MODE])
785# ----------------------------------
786# Control maintainer-specific portions of Makefiles.
NightStrike0e8caf32012-07-09 14:25:07 +0000787# Default is to disable them, unless 'enable' is passed literally.
788# For symmetry, 'disable' may be passed as well. Anyway, the user
NightStrikee38230c2009-06-09 18:50:24 +0000789# can override the default with the --enable/--disable switch.
NightStrike8a91b0e2009-05-15 06:20:46 +0000790AC_DEFUN([AM_MAINTAINER_MODE],
NightStrikee38230c2009-06-09 18:50:24 +0000791[m4_case(m4_default([$1], [disable]),
792 [enable], [m4_define([am_maintainer_other], [disable])],
793 [disable], [m4_define([am_maintainer_other], [enable])],
794 [m4_define([am_maintainer_other], [enable])
795 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
Jonathan Yongc4992882012-05-26 10:00:46 +0000796AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
NightStrikee38230c2009-06-09 18:50:24 +0000797 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
798 AC_ARG_ENABLE([maintainer-mode],
NightStrike0e8caf32012-07-09 14:25:07 +0000799 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
800 am_maintainer_other[ make rules and dependencies not useful
801 (and sometimes confusing) to the casual installer])],
802 [USE_MAINTAINER_MODE=$enableval],
803 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
NightStrike8a91b0e2009-05-15 06:20:46 +0000804 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
NightStrikee38230c2009-06-09 18:50:24 +0000805 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
NightStrike8a91b0e2009-05-15 06:20:46 +0000806 MAINT=$MAINTAINER_MODE_TRUE
NightStrikee38230c2009-06-09 18:50:24 +0000807 AC_SUBST([MAINT])dnl
NightStrike8a91b0e2009-05-15 06:20:46 +0000808]
809)
810
NightStrikef5efb612007-11-07 16:01:13 +0000811# Check to see how 'make' treats includes. -*- Autoconf -*-
812
LIU Hao6eb57142022-08-16 14:36:34 +0800813# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000814#
815# This file is free software; the Free Software Foundation
816# gives unlimited permission to copy and/or distribute it,
817# with or without modifications, as long as this notice is preserved.
818
NightStrikef5efb612007-11-07 16:01:13 +0000819# AM_MAKE_INCLUDE()
820# -----------------
Jacek Caban7eff69b2020-02-01 10:50:07 +0100821# Check whether make has an 'include' directive that can support all
822# the idioms we need for our automatic dependency tracking code.
NightStrikef5efb612007-11-07 16:01:13 +0000823AC_DEFUN([AM_MAKE_INCLUDE],
Jacek Caban7eff69b2020-02-01 10:50:07 +0100824[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
825cat > confinc.mk << 'END'
NightStrikef5efb612007-11-07 16:01:13 +0000826am__doit:
Jacek Caban7eff69b2020-02-01 10:50:07 +0100827 @echo this is the am__doit target >confinc.out
NightStrikef5efb612007-11-07 16:01:13 +0000828.PHONY: am__doit
829END
NightStrikef5efb612007-11-07 16:01:13 +0000830am__include="#"
831am__quote=
Jacek Caban7eff69b2020-02-01 10:50:07 +0100832# BSD make does it like this.
833echo '.include "confinc.mk" # ignored' > confmf.BSD
834# Other make implementations (GNU, Solaris 10, AIX) do it like this.
835echo 'include confinc.mk # ignored' > confmf.GNU
836_am_result=no
837for s in GNU BSD; do
838 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
839 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
840 ['0:this is the am__doit target'],
841 [AS_CASE([$s],
842 [BSD], [am__include='.include' am__quote='"'],
843 [am__include='include' am__quote=''])])
844 if test "$am__include" != "#"; then
845 _am_result="yes ($s style)"
846 break
847 fi
848done
849rm -f confinc.* confmf.*
850AC_MSG_RESULT([${_am_result}])
851AC_SUBST([am__include])])
852AC_SUBST([am__quote])])
NightStrikef5efb612007-11-07 16:01:13 +0000853
NightStrikef5efb612007-11-07 16:01:13 +0000854# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
855
LIU Hao6eb57142022-08-16 14:36:34 +0800856# Copyright (C) 1997-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000857#
858# This file is free software; the Free Software Foundation
859# gives unlimited permission to copy and/or distribute it,
860# with or without modifications, as long as this notice is preserved.
861
NightStrikef5efb612007-11-07 16:01:13 +0000862# AM_MISSING_PROG(NAME, PROGRAM)
863# ------------------------------
864AC_DEFUN([AM_MISSING_PROG],
865[AC_REQUIRE([AM_MISSING_HAS_RUN])
866$1=${$1-"${am_missing_run}$2"}
867AC_SUBST($1)])
868
NightStrikef5efb612007-11-07 16:01:13 +0000869# AM_MISSING_HAS_RUN
870# ------------------
NightStrike326ad9f2013-09-06 13:27:17 +0000871# Define MISSING if not defined so far and test if it is modern enough.
872# If it is, set am_missing_run to use it, otherwise, to nothing.
NightStrikef5efb612007-11-07 16:01:13 +0000873AC_DEFUN([AM_MISSING_HAS_RUN],
874[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
875AC_REQUIRE_AUX_FILE([missing])dnl
NightStrikee38230c2009-06-09 18:50:24 +0000876if test x"${MISSING+set}" != xset; then
Liu Hao2afb89e2021-04-03 17:47:55 +0800877 MISSING="\${SHELL} '$am_aux_dir/missing'"
NightStrikee38230c2009-06-09 18:50:24 +0000878fi
NightStrikef5efb612007-11-07 16:01:13 +0000879# Use eval to expand $SHELL
NightStrike326ad9f2013-09-06 13:27:17 +0000880if eval "$MISSING --is-lightweight"; then
881 am_missing_run="$MISSING "
NightStrikef5efb612007-11-07 16:01:13 +0000882else
883 am_missing_run=
NightStrike0e8caf32012-07-09 14:25:07 +0000884 AC_MSG_WARN(['missing' script is too old or missing])
NightStrikef5efb612007-11-07 16:01:13 +0000885fi
886])
887
NightStrikef5efb612007-11-07 16:01:13 +0000888# Helper functions for option handling. -*- Autoconf -*-
889
LIU Hao6eb57142022-08-16 14:36:34 +0800890# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000891#
892# This file is free software; the Free Software Foundation
893# gives unlimited permission to copy and/or distribute it,
894# with or without modifications, as long as this notice is preserved.
895
NightStrikef5efb612007-11-07 16:01:13 +0000896# _AM_MANGLE_OPTION(NAME)
897# -----------------------
898AC_DEFUN([_AM_MANGLE_OPTION],
899[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
900
901# _AM_SET_OPTION(NAME)
Jonathan Yongc4992882012-05-26 10:00:46 +0000902# --------------------
NightStrikef5efb612007-11-07 16:01:13 +0000903# Set option NAME. Presently that only means defining a flag for this option.
904AC_DEFUN([_AM_SET_OPTION],
NightStrike0e8caf32012-07-09 14:25:07 +0000905[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
NightStrikef5efb612007-11-07 16:01:13 +0000906
907# _AM_SET_OPTIONS(OPTIONS)
Jonathan Yongc4992882012-05-26 10:00:46 +0000908# ------------------------
NightStrikef5efb612007-11-07 16:01:13 +0000909# OPTIONS is a space-separated list of Automake options.
910AC_DEFUN([_AM_SET_OPTIONS],
Ozkan Sezer5ca95912009-04-11 08:01:05 +0000911[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
NightStrikef5efb612007-11-07 16:01:13 +0000912
913# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
914# -------------------------------------------
915# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
916AC_DEFUN([_AM_IF_OPTION],
917[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
918
LIU Hao6eb57142022-08-16 14:36:34 +0800919# Copyright (C) 1999-2021 Free Software Foundation, Inc.
NightStrike326ad9f2013-09-06 13:27:17 +0000920#
921# This file is free software; the Free Software Foundation
922# gives unlimited permission to copy and/or distribute it,
923# with or without modifications, as long as this notice is preserved.
924
925# _AM_PROG_CC_C_O
926# ---------------
927# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
928# to automatically call this.
929AC_DEFUN([_AM_PROG_CC_C_O],
930[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
931AC_REQUIRE_AUX_FILE([compile])dnl
932AC_LANG_PUSH([C])dnl
933AC_CACHE_CHECK(
934 [whether $CC understands -c and -o together],
935 [am_cv_prog_cc_c_o],
936 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
937 # Make sure it works both with $CC and with simple cc.
938 # Following AC_PROG_CC_C_O, we do the test twice because some
939 # compilers refuse to overwrite an existing .o file with -o,
940 # though they will create one.
941 am_cv_prog_cc_c_o=yes
942 for am_i in 1 2; do
943 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
944 && test -f conftest2.$ac_objext; then
945 : OK
946 else
947 am_cv_prog_cc_c_o=no
948 break
949 fi
950 done
951 rm -f core conftest*
952 unset am_i])
953if test "$am_cv_prog_cc_c_o" != yes; then
954 # Losing compiler, so override with the script.
955 # FIXME: It is wrong to rewrite CC.
956 # But if we don't then we get into trouble of one sort or another.
957 # A longer-term fix would be to have automake use am__CC in this case,
958 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
959 CC="$am_aux_dir/compile $CC"
960fi
961AC_LANG_POP([C])])
962
963# For backward compatibility.
964AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
965
LIU Hao6eb57142022-08-16 14:36:34 +0800966# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrike326ad9f2013-09-06 13:27:17 +0000967#
968# This file is free software; the Free Software Foundation
969# gives unlimited permission to copy and/or distribute it,
970# with or without modifications, as long as this notice is preserved.
971
972# AM_RUN_LOG(COMMAND)
973# -------------------
974# Run COMMAND, save the exit status in ac_status, and log it.
975# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
976AC_DEFUN([AM_RUN_LOG],
977[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
978 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
979 ac_status=$?
980 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
981 (exit $ac_status); }])
982
NightStrikef5efb612007-11-07 16:01:13 +0000983# Check to make sure that the build environment is sane. -*- Autoconf -*-
984
LIU Hao6eb57142022-08-16 14:36:34 +0800985# Copyright (C) 1996-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +0000986#
987# This file is free software; the Free Software Foundation
988# gives unlimited permission to copy and/or distribute it,
989# with or without modifications, as long as this notice is preserved.
990
NightStrikef5efb612007-11-07 16:01:13 +0000991# AM_SANITY_CHECK
992# ---------------
993AC_DEFUN([AM_SANITY_CHECK],
994[AC_MSG_CHECKING([whether build environment is sane])
NightStrikee38230c2009-06-09 18:50:24 +0000995# Reject unsafe characters in $srcdir or the absolute working directory
996# name. Accept space and tab only in the latter.
997am_lf='
998'
999case `pwd` in
1000 *[[\\\"\#\$\&\'\`$am_lf]]*)
1001 AC_MSG_ERROR([unsafe absolute working directory name]);;
1002esac
1003case $srcdir in
1004 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
NightStrike0e8caf32012-07-09 14:25:07 +00001005 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
NightStrikee38230c2009-06-09 18:50:24 +00001006esac
1007
NightStrike0e8caf32012-07-09 14:25:07 +00001008# Do 'set' in a subshell so we don't clobber the current shell's
NightStrikef5efb612007-11-07 16:01:13 +00001009# arguments. Must try -L first in case configure is actually a
1010# symlink; some systems play weird games with the mod time of symlinks
1011# (eg FreeBSD returns the mod time of the symlink's containing
1012# directory).
1013if (
NightStrike0e8caf32012-07-09 14:25:07 +00001014 am_has_slept=no
1015 for am_try in 1 2; do
1016 echo "timestamp, slept: $am_has_slept" > conftest.file
1017 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1018 if test "$[*]" = "X"; then
1019 # -L didn't work.
1020 set X `ls -t "$srcdir/configure" conftest.file`
1021 fi
1022 if test "$[*]" != "X $srcdir/configure conftest.file" \
1023 && test "$[*]" != "X conftest.file $srcdir/configure"; then
NightStrikef5efb612007-11-07 16:01:13 +00001024
NightStrike0e8caf32012-07-09 14:25:07 +00001025 # If neither matched, then we have a broken ls. This can happen
1026 # if, for instance, CONFIG_SHELL is bash and it inherits a
1027 # broken ls alias from the environment. This has actually
1028 # happened. Such a system could not be considered "sane".
1029 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
1030 alias in your environment])
1031 fi
1032 if test "$[2]" = conftest.file || test $am_try -eq 2; then
1033 break
1034 fi
1035 # Just in case.
1036 sleep 1
1037 am_has_slept=yes
1038 done
NightStrikef5efb612007-11-07 16:01:13 +00001039 test "$[2]" = conftest.file
1040 )
1041then
1042 # Ok.
1043 :
1044else
1045 AC_MSG_ERROR([newly created file is older than distributed files!
1046Check your system clock])
1047fi
NightStrike0e8caf32012-07-09 14:25:07 +00001048AC_MSG_RESULT([yes])
1049# If we didn't sleep, we still need to ensure time stamps of config.status and
1050# generated files are strictly newer.
1051am_sleep_pid=
1052if grep 'slept: no' conftest.file >/dev/null 2>&1; then
1053 ( sleep 1 ) &
1054 am_sleep_pid=$!
1055fi
1056AC_CONFIG_COMMANDS_PRE(
1057 [AC_MSG_CHECKING([that generated files are newer than configure])
1058 if test -n "$am_sleep_pid"; then
1059 # Hide warnings about reused PIDs.
1060 wait $am_sleep_pid 2>/dev/null
1061 fi
1062 AC_MSG_RESULT([done])])
1063rm -f conftest.file
1064])
NightStrikef5efb612007-11-07 16:01:13 +00001065
LIU Hao6eb57142022-08-16 14:36:34 +08001066# Copyright (C) 2009-2021 Free Software Foundation, Inc.
NightStrike326ad9f2013-09-06 13:27:17 +00001067#
1068# This file is free software; the Free Software Foundation
1069# gives unlimited permission to copy and/or distribute it,
1070# with or without modifications, as long as this notice is preserved.
1071
1072# AM_SILENT_RULES([DEFAULT])
1073# --------------------------
1074# Enable less verbose build rules; with the default set to DEFAULT
1075# ("yes" being less verbose, "no" or empty being verbose).
1076AC_DEFUN([AM_SILENT_RULES],
1077[AC_ARG_ENABLE([silent-rules], [dnl
1078AS_HELP_STRING(
1079 [--enable-silent-rules],
1080 [less verbose build output (undo: "make V=1")])
1081AS_HELP_STRING(
1082 [--disable-silent-rules],
1083 [verbose build output (undo: "make V=0")])dnl
1084])
1085case $enable_silent_rules in @%:@ (((
1086 yes) AM_DEFAULT_VERBOSITY=0;;
1087 no) AM_DEFAULT_VERBOSITY=1;;
1088 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
1089esac
1090dnl
1091dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
1092dnl do not support nested variable expansions.
1093dnl See automake bug#9928 and bug#10237.
1094am_make=${MAKE-make}
1095AC_CACHE_CHECK([whether $am_make supports nested variables],
1096 [am_cv_make_support_nested_variables],
1097 [if AS_ECHO([['TRUE=$(BAR$(V))
1098BAR0=false
1099BAR1=true
1100V=1
1101am__doit:
1102 @$(TRUE)
1103.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1104 am_cv_make_support_nested_variables=yes
1105else
1106 am_cv_make_support_nested_variables=no
1107fi])
1108if test $am_cv_make_support_nested_variables = yes; then
1109 dnl Using '$V' instead of '$(V)' breaks IRIX make.
1110 AM_V='$(V)'
1111 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1112else
1113 AM_V=$AM_DEFAULT_VERBOSITY
1114 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1115fi
1116AC_SUBST([AM_V])dnl
1117AM_SUBST_NOTMAKE([AM_V])dnl
1118AC_SUBST([AM_DEFAULT_V])dnl
1119AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1120AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1121AM_BACKSLASH='\'
1122AC_SUBST([AM_BACKSLASH])dnl
1123_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1124])
1125
LIU Hao6eb57142022-08-16 14:36:34 +08001126# Copyright (C) 2001-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +00001127#
1128# This file is free software; the Free Software Foundation
1129# gives unlimited permission to copy and/or distribute it,
1130# with or without modifications, as long as this notice is preserved.
1131
1132# AM_PROG_INSTALL_STRIP
1133# ---------------------
NightStrike0e8caf32012-07-09 14:25:07 +00001134# One issue with vendor 'install' (even GNU) is that you can't
NightStrikef5efb612007-11-07 16:01:13 +00001135# specify the program used to strip binaries. This is especially
1136# annoying in cross-compiling environments, where the build's strip
1137# is unlikely to handle the host's binaries.
1138# Fortunately install-sh will honor a STRIPPROG variable, so we
NightStrike0e8caf32012-07-09 14:25:07 +00001139# always use install-sh in "make install-strip", and initialize
NightStrikef5efb612007-11-07 16:01:13 +00001140# STRIPPROG with the value of the STRIP variable (set by the user).
1141AC_DEFUN([AM_PROG_INSTALL_STRIP],
1142[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
NightStrike0e8caf32012-07-09 14:25:07 +00001143# Installed binaries are usually stripped using 'strip' when the user
1144# run "make install-strip". However 'strip' might not be the right
NightStrikef5efb612007-11-07 16:01:13 +00001145# tool to use in cross-compilation environments, therefore Automake
NightStrike0e8caf32012-07-09 14:25:07 +00001146# will honor the 'STRIP' environment variable to overrule this program.
1147dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
NightStrikef5efb612007-11-07 16:01:13 +00001148if test "$cross_compiling" != no; then
1149 AC_CHECK_TOOL([STRIP], [strip], :)
1150fi
1151INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1152AC_SUBST([INSTALL_STRIP_PROGRAM])])
1153
LIU Hao6eb57142022-08-16 14:36:34 +08001154# Copyright (C) 2006-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +00001155#
1156# This file is free software; the Free Software Foundation
1157# gives unlimited permission to copy and/or distribute it,
1158# with or without modifications, as long as this notice is preserved.
1159
1160# _AM_SUBST_NOTMAKE(VARIABLE)
1161# ---------------------------
NightStrike5c464372008-09-17 18:06:46 +00001162# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
NightStrikef5efb612007-11-07 16:01:13 +00001163# This macro is traced by Automake.
1164AC_DEFUN([_AM_SUBST_NOTMAKE])
1165
NightStrikee38230c2009-06-09 18:50:24 +00001166# AM_SUBST_NOTMAKE(VARIABLE)
Jonathan Yongc4992882012-05-26 10:00:46 +00001167# --------------------------
NightStrikee38230c2009-06-09 18:50:24 +00001168# Public sister of _AM_SUBST_NOTMAKE.
1169AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1170
NightStrikef5efb612007-11-07 16:01:13 +00001171# Check how to create a tarball. -*- Autoconf -*-
1172
LIU Hao6eb57142022-08-16 14:36:34 +08001173# Copyright (C) 2004-2021 Free Software Foundation, Inc.
NightStrikef5efb612007-11-07 16:01:13 +00001174#
1175# This file is free software; the Free Software Foundation
1176# gives unlimited permission to copy and/or distribute it,
1177# with or without modifications, as long as this notice is preserved.
1178
NightStrikef5efb612007-11-07 16:01:13 +00001179# _AM_PROG_TAR(FORMAT)
1180# --------------------
1181# Check how to create a tarball in format FORMAT.
NightStrike0e8caf32012-07-09 14:25:07 +00001182# FORMAT should be one of 'v7', 'ustar', or 'pax'.
NightStrikef5efb612007-11-07 16:01:13 +00001183#
1184# Substitute a variable $(am__tar) that is a command
1185# writing to stdout a FORMAT-tarball containing the directory
1186# $tardir.
1187# tardir=directory && $(am__tar) > result.tar
1188#
1189# Substitute a variable $(am__untar) that extract such
1190# a tarball read from stdin.
1191# $(am__untar) < result.tar
NightStrike326ad9f2013-09-06 13:27:17 +00001192#
NightStrikef5efb612007-11-07 16:01:13 +00001193AC_DEFUN([_AM_PROG_TAR],
Jonathan Yongc4992882012-05-26 10:00:46 +00001194[# Always define AMTAR for backward compatibility. Yes, it's still used
1195# in the wild :-( We should find a proper way to deprecate it ...
1196AC_SUBST([AMTAR], ['$${TAR-tar}'])
NightStrike326ad9f2013-09-06 13:27:17 +00001197
1198# We'll loop over all known methods to create a tar archive until one works.
Kai Tietzc3c16092013-06-14 20:43:42 +00001199_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
NightStrikef5efb612007-11-07 16:01:13 +00001200
NightStrike326ad9f2013-09-06 13:27:17 +00001201m4_if([$1], [v7],
1202 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
Jacek Caban002a25d2013-06-13 13:55:33 +00001203
NightStrike326ad9f2013-09-06 13:27:17 +00001204 [m4_case([$1],
1205 [ustar],
1206 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1207 # There is notably a 21 bits limit for the UID and the GID. In fact,
1208 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1209 # and bug#13588).
1210 am_max_uid=2097151 # 2^21 - 1
1211 am_max_gid=$am_max_uid
1212 # The $UID and $GID variables are not portable, so we need to resort
1213 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
1214 # below are definitely unexpected, so allow the users to see them
1215 # (that is, avoid stderr redirection).
1216 am_uid=`id -u || echo unknown`
1217 am_gid=`id -g || echo unknown`
1218 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1219 if test $am_uid -le $am_max_uid; then
1220 AC_MSG_RESULT([yes])
1221 else
1222 AC_MSG_RESULT([no])
1223 _am_tools=none
1224 fi
1225 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1226 if test $am_gid -le $am_max_gid; then
1227 AC_MSG_RESULT([yes])
1228 else
1229 AC_MSG_RESULT([no])
1230 _am_tools=none
1231 fi],
1232
1233 [pax],
1234 [],
1235
1236 [m4_fatal([Unknown tar format])])
1237
1238 AC_MSG_CHECKING([how to create a $1 tar archive])
1239
1240 # Go ahead even if we have the value already cached. We do so because we
1241 # need to set the values for the 'am__tar' and 'am__untar' variables.
1242 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1243
1244 for _am_tool in $_am_tools; do
1245 case $_am_tool in
1246 gnutar)
1247 for _am_tar in tar gnutar gtar; do
1248 AM_RUN_LOG([$_am_tar --version]) && break
1249 done
1250 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1251 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1252 am__untar="$_am_tar -xf -"
1253 ;;
1254 plaintar)
1255 # Must skip GNU tar: if it does not support --format= it doesn't create
1256 # ustar tarball either.
1257 (tar --version) >/dev/null 2>&1 && continue
1258 am__tar='tar chf - "$$tardir"'
1259 am__tar_='tar chf - "$tardir"'
1260 am__untar='tar xf -'
1261 ;;
1262 pax)
1263 am__tar='pax -L -x $1 -w "$$tardir"'
1264 am__tar_='pax -L -x $1 -w "$tardir"'
1265 am__untar='pax -r'
1266 ;;
1267 cpio)
1268 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1269 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1270 am__untar='cpio -i -H $1 -d'
1271 ;;
1272 none)
1273 am__tar=false
1274 am__tar_=false
1275 am__untar=false
1276 ;;
1277 esac
1278
1279 # If the value was cached, stop now. We just wanted to have am__tar
1280 # and am__untar set.
1281 test -n "${am_cv_prog_tar_$1}" && break
1282
1283 # tar/untar a dummy directory, and stop if the command works.
1284 rm -rf conftest.dir
1285 mkdir conftest.dir
1286 echo GrepMe > conftest.dir/file
1287 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1288 rm -rf conftest.dir
1289 if test -s conftest.tar; then
1290 AM_RUN_LOG([$am__untar <conftest.tar])
1291 AM_RUN_LOG([cat conftest.dir/file])
1292 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1293 fi
1294 done
NightStrikef5efb612007-11-07 16:01:13 +00001295 rm -rf conftest.dir
NightStrikef5efb612007-11-07 16:01:13 +00001296
NightStrike326ad9f2013-09-06 13:27:17 +00001297 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1298 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1299
NightStrikef5efb612007-11-07 16:01:13 +00001300AC_SUBST([am__tar])
1301AC_SUBST([am__untar])
1302]) # _AM_PROG_TAR
1303