Martin Storsjö | d6c07d9 | 2023-10-27 21:02:54 +0300 | [diff] [blame] | 1 | # generated automatically by aclocal 1.16.5 -*- Autoconf -*- |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 2 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 3 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 4 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 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 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 15 | m4_ifndef([AC_AUTOCONF_VERSION], |
| 16 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
LIU Hao | b4515a6 | 2024-01-09 22:24:06 +0800 | [diff] [blame] | 17 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, |
| 18 | [m4_warning([this file was generated for autoconf 2.72. |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 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. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 21 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 22 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 23 | # Copyright (C) 2002-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 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], |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 35 | [am__api_version='1.16' |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 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. |
Martin Storsjö | d6c07d9 | 2023-10-27 21:02:54 +0300 | [diff] [blame] | 38 | m4_if([$1], [1.16.5], [], |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 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. |
Ozkan Sezer | 5ca9591 | 2009-04-11 08:01:05 +0000 | [diff] [blame] | 52 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 53 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
Martin Storsjö | d6c07d9 | 2023-10-27 21:02:54 +0300 | [diff] [blame] | 54 | [AM_AUTOMAKE_VERSION([1.16.5])dnl |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 55 | m4_ifndef([AC_AUTOCONF_VERSION], |
| 56 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
Ozkan Sezer | 5ca9591 | 2009-04-11 08:01:05 +0000 | [diff] [blame] | 57 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 58 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 59 | # Copyright (C) 2011-2021 Free Software Foundation, Inc. |
NightStrike | 989e3f9 | 2012-07-09 19:43:01 +0000 | [diff] [blame] | 60 | # |
| 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 | |
NightStrike | 989e3f9 | 2012-07-09 19:43:01 +0000 | [diff] [blame] | 65 | # 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). |
| 70 | AC_DEFUN([AM_PROG_AR], |
| 71 | [AC_BEFORE([$0], [LT_INIT])dnl |
| 72 | AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl |
| 73 | AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 74 | AC_REQUIRE_AUX_FILE([ar-lib])dnl |
| 75 | AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) |
| 76 | : ${AR=ar} |
| 77 | |
| 78 | AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 79 | [AC_LANG_PUSH([C]) |
| 80 | am_cv_ar_interface=ar |
NightStrike | 989e3f9 | 2012-07-09 19:43:01 +0000 | [diff] [blame] | 81 | 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 | ]) |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 97 | AC_LANG_POP([C])]) |
NightStrike | 989e3f9 | 2012-07-09 19:43:01 +0000 | [diff] [blame] | 98 | |
| 99 | case $am_cv_ar_interface in |
| 100 | ar) |
| 101 | ;; |
| 102 | lib) |
| 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 | ;; |
| 111 | unknown) |
| 112 | m4_default([$1], |
| 113 | [AC_MSG_ERROR([could not determine $AR interface])]) |
| 114 | ;; |
| 115 | esac |
| 116 | AC_SUBST([AR])dnl |
| 117 | ]) |
| 118 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 119 | # Figure out how to run the assembler. -*- Autoconf -*- |
| 120 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 121 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 122 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 127 | # AM_PROG_AS |
| 128 | # ---------- |
| 129 | AC_DEFUN([AM_PROG_AS], |
| 130 | [# By default we simply use the C compiler to build assembly code. |
| 131 | AC_REQUIRE([AC_PROG_CC]) |
| 132 | test "${CCAS+set}" = set || CCAS=$CC |
| 133 | test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS |
| 134 | AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) |
| 135 | AC_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 Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 141 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 142 | # |
| 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 |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 148 | # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to |
| 149 | # '$srcdir', '$srcdir/..', or '$srcdir/../..'. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 150 | # |
| 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 |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 168 | # harmless because $srcdir is '.', but things will broke when you |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 169 | # 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 | |
| 185 | AC_DEFUN([AM_AUX_DIR_EXPAND], |
David Wohlferd | 2bb2214 | 2016-08-10 21:06:50 -0700 | [diff] [blame] | 186 | [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl |
| 187 | # Expand $ac_aux_dir to an absolute path. |
| 188 | am_aux_dir=`cd "$ac_aux_dir" && pwd` |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 189 | ]) |
| 190 | |
Jonathan Yong | 321b7a4 | 2014-01-24 13:47:55 +0000 | [diff] [blame] | 191 | # AM_COND_IF -*- Autoconf -*- |
| 192 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 193 | # Copyright (C) 2008-2021 Free Software Foundation, Inc. |
Jonathan Yong | 321b7a4 | 2014-01-24 13:47:55 +0000 | [diff] [blame] | 194 | # |
| 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. |
| 204 | m4_define([_AM_COND_IF]) |
| 205 | m4_define([_AM_COND_ELSE]) |
| 206 | m4_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). |
| 213 | AC_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 |
| 217 | if test -z "$$1_TRUE"; then : |
| 218 | m4_n([$2])[]dnl |
| 219 | m4_ifval([$3], |
| 220 | [_AM_COND_ELSE([$1])dnl |
| 221 | else |
| 222 | $3 |
| 223 | ])dnl |
| 224 | _AM_COND_ENDIF([$1])dnl |
| 225 | fi[]dnl |
| 226 | ]) |
| 227 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 228 | # AM_CONDITIONAL -*- Autoconf -*- |
| 229 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 230 | # Copyright (C) 1997-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 231 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 236 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) |
| 237 | # ------------------------------------- |
| 238 | # Define a conditional. |
| 239 | AC_DEFUN([AM_CONDITIONAL], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 240 | [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 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 243 | AC_SUBST([$1_TRUE])dnl |
| 244 | AC_SUBST([$1_FALSE])dnl |
| 245 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl |
| 246 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 247 | m4_define([_AM_COND_VALUE_$1], [$2])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 248 | if $2; then |
| 249 | $1_TRUE= |
| 250 | $1_FALSE='#' |
| 251 | else |
| 252 | $1_TRUE='#' |
| 253 | $1_FALSE= |
| 254 | fi |
| 255 | AC_CONFIG_COMMANDS_PRE( |
| 256 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
| 257 | AC_MSG_ERROR([[conditional "$1" was never defined. |
| 258 | Usually this means the macro was only invoked conditionally.]]) |
| 259 | fi])]) |
| 260 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 261 | # Copyright (C) 1999-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 262 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 267 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 268 | # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 269 | # 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. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 278 | # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 279 | # 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. |
| 285 | AC_DEFUN([_AM_DEPENDENCIES], |
| 286 | [AC_REQUIRE([AM_SET_DEPDIR])dnl |
| 287 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl |
| 288 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
| 289 | AC_REQUIRE([AM_DEP_TRACK])dnl |
| 290 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 291 | m4_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=]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 298 | |
| 299 | AC_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 |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 305 | # making a dummy file named 'D' -- because '-MD' means "put the output |
| 306 | # in D". |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 307 | rm -rf conftest.dir |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 308 | 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 |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 325 | 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 335 | 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 |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 346 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
| 347 | # Solaris 10 /bin/sh. |
| 348 | echo '/* dummy */' > sub/conftst$i.h |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 349 | done |
| 350 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
| 351 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 352 | # We check with '-c' and '-o' for the sake of the "dashmstdout" |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 353 | # mode. It turns out that the SunPro C++ compiler does not properly |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 354 | # handle '-M -o', and we need to detect this. Also, some Intel |
| 355 | # versions had trouble with output in subdirs. |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 356 | am__obj=sub/conftest.${OBJEXT-o} |
| 357 | am__minus_obj="-o $am__obj" |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 358 | case $depmode in |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 359 | gcc) |
| 360 | # This depmode causes a compiler race in universal mode. |
| 361 | test "$am__universal" = false || continue |
| 362 | ;; |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 363 | nosideeffect) |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 364 | # After this tag, mechanisms are not by side-effect, so they'll |
| 365 | # only be used when explicitly requested. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 366 | if test "x$enable_dependency_tracking" = xyes; then |
| 367 | continue |
| 368 | else |
| 369 | break |
| 370 | fi |
| 371 | ;; |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 372 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 373 | # This compiler won't grok '-c -o', but also, the minuso test has |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 374 | # 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 | ;; |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 379 | none) break ;; |
| 380 | esac |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 381 | if depmode=$depmode \ |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 382 | source=sub/conftest.c object=$am__obj \ |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 383 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 384 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 385 | >/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 && |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 388 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 389 | ${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 |
| 407 | else |
| 408 | am_cv_$1_dependencies_compiler_type=none |
| 409 | fi |
| 410 | ]) |
| 411 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
| 412 | AM_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. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 421 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 422 | AC_DEFUN([AM_SET_DEPDIR], |
| 423 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 424 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
| 425 | ]) |
| 426 | |
| 427 | |
| 428 | # AM_DEP_TRACK |
| 429 | # ------------ |
| 430 | AC_DEFUN([AM_DEP_TRACK], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 431 | [AC_ARG_ENABLE([dependency-tracking], [dnl |
| 432 | AS_HELP_STRING( |
| 433 | [--enable-dependency-tracking], |
| 434 | [do not reject slow dependency extractors]) |
| 435 | AS_HELP_STRING( |
| 436 | [--disable-dependency-tracking], |
| 437 | [speeds up one-time build])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 438 | if test "x$enable_dependency_tracking" != xno; then |
| 439 | am_depcomp="$ac_aux_dir/depcomp" |
| 440 | AMDEPBACKSLASH='\' |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 441 | am__nodep='_no' |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 442 | fi |
| 443 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
| 444 | AC_SUBST([AMDEPBACKSLASH])dnl |
| 445 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 446 | AC_SUBST([am__nodep])dnl |
| 447 | _AM_SUBST_NOTMAKE([am__nodep])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 448 | ]) |
| 449 | |
| 450 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
| 451 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 452 | # Copyright (C) 1999-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 453 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 458 | # _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 459 | # ------------------------------ |
| 460 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 461 | [{ |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 462 | # Older Autoconf quotes --file arguments for eval, but not when files |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 463 | # are listed without --file. Let's play safe and only enable the eval |
| 464 | # if we detect the quoting. |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 465 | # 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]) |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 470 | shift |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 471 | # Used to flag and report bootstrapping failures. |
| 472 | am_rc=0 |
| 473 | for am_mf |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 474 | do |
| 475 | # Strip MF so we end up with the name of the file. |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 476 | 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 |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 480 | # limit of 2048, but all sed's we know have understand at least 4000. |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 481 | 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=$? |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 488 | done |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 489 | if test $am_rc -ne 0; then |
| 490 | AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
Liu Hao | e8d7c1b | 2020-06-03 21:54:55 +0800 | [diff] [blame] | 491 | 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 Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 494 | '--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 |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 502 | } |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 503 | ])# _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 Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 510 | # 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. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 513 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 514 | [AC_CONFIG_COMMANDS([depfiles], |
| 515 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 516 | [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 517 | |
| 518 | # Do all the work for Automake. -*- Autoconf -*- |
| 519 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 520 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 521 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 526 | # 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 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 529 | dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. |
| 530 | m4_define([AC_PROG_CC], |
| 531 | m4_defn([AC_PROG_CC]) |
| 532 | [_AM_PROG_CC_C_O |
| 533 | ]) |
| 534 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 535 | # 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. |
| 546 | AC_DEFUN([AM_INIT_AUTOMAKE], |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 547 | [AC_PREREQ([2.65])dnl |
Martin Storsjö | d6c07d9 | 2023-10-27 21:02:54 +0300 | [diff] [blame] | 548 | m4_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 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 552 | dnl Autoconf wants to disallow AM_ names. We explicitly allow |
| 553 | dnl the ones we care about. |
| 554 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
| 555 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
| 556 | AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 557 | if 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 |
| 565 | fi |
| 566 | |
| 567 | # test whether we have cygpath |
| 568 | if 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 |
| 574 | fi |
| 575 | AC_SUBST([CYGPATH_W]) |
| 576 | |
| 577 | # Define the identity of the package. |
| 578 | dnl Distinguish between old-style and new-style calls. |
| 579 | m4_ifval([$2], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 580 | [AC_DIAGNOSE([obsolete], |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 581 | [$0: two- and three-arguments forms are deprecated.]) |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 582 | m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 583 | AC_SUBST([PACKAGE], [$1])dnl |
| 584 | AC_SUBST([VERSION], [$2])], |
| 585 | [_AM_SET_OPTIONS([$1])dnl |
| 586 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 587 | m4_if( |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 588 | m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 589 | [ok:ok],, |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 590 | [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],, |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 595 | [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) |
| 596 | AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 597 | |
| 598 | # Some tools Automake needs. |
| 599 | AC_REQUIRE([AM_SANITY_CHECK])dnl |
| 600 | AC_REQUIRE([AC_ARG_PROGRAM])dnl |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 601 | AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) |
| 602 | AM_MISSING_PROG([AUTOCONF], [autoconf]) |
| 603 | AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) |
| 604 | AM_MISSING_PROG([AUTOHEADER], [autoheader]) |
| 605 | AM_MISSING_PROG([MAKEINFO], [makeinfo]) |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 606 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 607 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 608 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
Jonathan Yong | e41828a | 2012-07-17 14:18:54 +0000 | [diff] [blame] | 609 | # For better backward compatibility. To be removed once Automake 1.9.x |
| 610 | # dies out for good. For more background, see: |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 611 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
| 612 | # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
Jonathan Yong | e41828a | 2012-07-17 14:18:54 +0000 | [diff] [blame] | 613 | AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
David Wohlferd | 2bb2214 | 2016-08-10 21:06:50 -0700 | [diff] [blame] | 614 | # We need awk for the "check" target (and possibly the TAP driver). The |
| 615 | # system "awk" is bad on some platforms. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 616 | AC_REQUIRE([AC_PROG_AWK])dnl |
| 617 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
| 618 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 619 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 620 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
| 621 | [_AM_PROG_TAR([v7])])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 622 | _AM_IF_OPTION([no-dependencies],, |
| 623 | [AC_PROVIDE_IFELSE([AC_PROG_CC], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 624 | [_AM_DEPENDENCIES([CC])], |
| 625 | [m4_define([AC_PROG_CC], |
| 626 | m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 627 | AC_PROVIDE_IFELSE([AC_PROG_CXX], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 628 | [_AM_DEPENDENCIES([CXX])], |
| 629 | [m4_define([AC_PROG_CXX], |
| 630 | m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 631 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 632 | [_AM_DEPENDENCIES([OBJC])], |
| 633 | [m4_define([AC_PROG_OBJC], |
| 634 | m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 635 | AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 636 | [_AM_DEPENDENCIES([OBJCXX])], |
| 637 | [m4_define([AC_PROG_OBJCXX], |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 638 | m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 639 | ]) |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 640 | # Variables for tags utilities; see am/tags.am |
| 641 | if test -z "$CTAGS"; then |
| 642 | CTAGS=ctags |
| 643 | fi |
| 644 | AC_SUBST([CTAGS]) |
| 645 | if test -z "$ETAGS"; then |
| 646 | ETAGS=etags |
| 647 | fi |
| 648 | AC_SUBST([ETAGS]) |
| 649 | if test -z "$CSCOPE"; then |
| 650 | CSCOPE=cscope |
| 651 | fi |
| 652 | AC_SUBST([CSCOPE]) |
| 653 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 654 | AC_REQUIRE([AM_SILENT_RULES])dnl |
| 655 | dnl The testsuite driver may need to know about EXEEXT, so add the |
| 656 | dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This |
| 657 | dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 658 | AC_CONFIG_COMMANDS_PRE(dnl |
| 659 | [m4_provide_if([_AM_COMPILER_EXEEXT], |
| 660 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 661 | |
| 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. |
| 670 | if rm -f && rm -fr && rm -rf; then : OK; else |
| 671 | cat >&2 <<'END' |
| 672 | Oops! |
| 673 | |
| 674 | Your 'rm' program seems unable to run without file operands specified |
| 675 | on the command line, even when the '-f' option is present. This is contrary |
| 676 | to the behaviour of most rm programs out there, and not conforming with |
| 677 | the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> |
| 678 | |
| 679 | Please tell bug-automake@gnu.org about your system, including the value |
| 680 | of your $PATH and any error possibly output before this message. This |
| 681 | can help us improve future automake versions. |
| 682 | |
| 683 | END |
| 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' |
| 690 | Aborting the configuration process, to ensure you take notice of the issue. |
| 691 | |
| 692 | You can download and install GNU coreutils to get an 'rm' implementation |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 693 | that behaves properly: <https://www.gnu.org/software/coreutils/>. |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 694 | |
| 695 | If you want to complete the configuration process using your problematic |
| 696 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM |
| 697 | to "yes", and re-run configure. |
| 698 | |
| 699 | END |
| 700 | AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) |
| 701 | fi |
David Wohlferd | 2bb2214 | 2016-08-10 21:06:50 -0700 | [diff] [blame] | 702 | fi |
| 703 | dnl The trailing newline in this macro's definition is deliberate, for |
| 704 | dnl backward compatibility and to allow trailing 'dnl'-style comments |
| 705 | dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. |
| 706 | ]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 707 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 708 | dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 709 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
| 710 | dnl mangled by Autoconf and run in a shell conditional statement. |
| 711 | m4_define([_AC_COMPILER_EXEEXT], |
| 712 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) |
| 713 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 714 | # 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. |
| 721 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
| 722 | [# Compute $1's index in $config_headers. |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 723 | _am_arg=$1 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 724 | _am_stamp_count=1 |
| 725 | for _am_header in $config_headers :; do |
| 726 | case $_am_header in |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 727 | $_am_arg | $_am_arg:* ) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 728 | break ;; |
| 729 | * ) |
| 730 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; |
| 731 | esac |
| 732 | done |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 733 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 734 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 735 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 736 | # |
| 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. |
| 744 | AC_DEFUN([AM_PROG_INSTALL_SH], |
| 745 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
David Wohlferd | 2bb2214 | 2016-08-10 21:06:50 -0700 | [diff] [blame] | 746 | if test x"${install_sh+set}" != xset; then |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 747 | 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 |
| 753 | fi |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 754 | AC_SUBST([install_sh])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 755 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 756 | # Copyright (C) 2003-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 757 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 762 | # Check whether the underlying file-system supports filenames |
| 763 | # with a leading dot. For instance MS-DOS doesn't. |
| 764 | AC_DEFUN([AM_SET_LEADING_DOT], |
| 765 | [rm -rf .tst 2>/dev/null |
| 766 | mkdir .tst 2>/dev/null |
| 767 | if test -d .tst; then |
| 768 | am__leading_dot=. |
| 769 | else |
| 770 | am__leading_dot=_ |
| 771 | fi |
| 772 | rmdir .tst 2>/dev/null |
| 773 | AC_SUBST([am__leading_dot])]) |
| 774 | |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 775 | # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- |
| 776 | # From Jim Meyering |
| 777 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 778 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 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 | |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 784 | # AM_MAINTAINER_MODE([DEFAULT-MODE]) |
| 785 | # ---------------------------------- |
| 786 | # Control maintainer-specific portions of Makefiles. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 787 | # Default is to disable them, unless 'enable' is passed literally. |
| 788 | # For symmetry, 'disable' may be passed as well. Anyway, the user |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 789 | # can override the default with the --enable/--disable switch. |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 790 | AC_DEFUN([AM_MAINTAINER_MODE], |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 791 | [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 Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 796 | AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 797 | dnl maintainer-mode's default is 'disable' unless 'enable' is passed |
| 798 | AC_ARG_ENABLE([maintainer-mode], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 799 | [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])) |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 804 | AC_MSG_RESULT([$USE_MAINTAINER_MODE]) |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 805 | AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 806 | MAINT=$MAINTAINER_MODE_TRUE |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 807 | AC_SUBST([MAINT])dnl |
NightStrike | 8a91b0e | 2009-05-15 06:20:46 +0000 | [diff] [blame] | 808 | ] |
| 809 | ) |
| 810 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 811 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
| 812 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 813 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 814 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 819 | # AM_MAKE_INCLUDE() |
| 820 | # ----------------- |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 821 | # Check whether make has an 'include' directive that can support all |
| 822 | # the idioms we need for our automatic dependency tracking code. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 823 | AC_DEFUN([AM_MAKE_INCLUDE], |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 824 | [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) |
| 825 | cat > confinc.mk << 'END' |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 826 | am__doit: |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 827 | @echo this is the am__doit target >confinc.out |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 828 | .PHONY: am__doit |
| 829 | END |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 830 | am__include="#" |
| 831 | am__quote= |
Jacek Caban | 7eff69b | 2020-02-01 10:50:07 +0100 | [diff] [blame] | 832 | # BSD make does it like this. |
| 833 | echo '.include "confinc.mk" # ignored' > confmf.BSD |
| 834 | # Other make implementations (GNU, Solaris 10, AIX) do it like this. |
| 835 | echo 'include confinc.mk # ignored' > confmf.GNU |
| 836 | _am_result=no |
| 837 | for 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 |
| 848 | done |
| 849 | rm -f confinc.* confmf.* |
| 850 | AC_MSG_RESULT([${_am_result}]) |
| 851 | AC_SUBST([am__include])]) |
| 852 | AC_SUBST([am__quote])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 853 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 854 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
| 855 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 856 | # Copyright (C) 1997-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 857 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 862 | # AM_MISSING_PROG(NAME, PROGRAM) |
| 863 | # ------------------------------ |
| 864 | AC_DEFUN([AM_MISSING_PROG], |
| 865 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) |
| 866 | $1=${$1-"${am_missing_run}$2"} |
| 867 | AC_SUBST($1)]) |
| 868 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 869 | # AM_MISSING_HAS_RUN |
| 870 | # ------------------ |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 871 | # 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. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 873 | AC_DEFUN([AM_MISSING_HAS_RUN], |
| 874 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 875 | AC_REQUIRE_AUX_FILE([missing])dnl |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 876 | if test x"${MISSING+set}" != xset; then |
Liu Hao | 2afb89e | 2021-04-03 17:47:55 +0800 | [diff] [blame] | 877 | MISSING="\${SHELL} '$am_aux_dir/missing'" |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 878 | fi |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 879 | # Use eval to expand $SHELL |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 880 | if eval "$MISSING --is-lightweight"; then |
| 881 | am_missing_run="$MISSING " |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 882 | else |
| 883 | am_missing_run= |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 884 | AC_MSG_WARN(['missing' script is too old or missing]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 885 | fi |
| 886 | ]) |
| 887 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 888 | # Helper functions for option handling. -*- Autoconf -*- |
| 889 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 890 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 891 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 896 | # _AM_MANGLE_OPTION(NAME) |
| 897 | # ----------------------- |
| 898 | AC_DEFUN([_AM_MANGLE_OPTION], |
| 899 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) |
| 900 | |
| 901 | # _AM_SET_OPTION(NAME) |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 902 | # -------------------- |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 903 | # Set option NAME. Presently that only means defining a flag for this option. |
| 904 | AC_DEFUN([_AM_SET_OPTION], |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 905 | [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 906 | |
| 907 | # _AM_SET_OPTIONS(OPTIONS) |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 908 | # ------------------------ |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 909 | # OPTIONS is a space-separated list of Automake options. |
| 910 | AC_DEFUN([_AM_SET_OPTIONS], |
Ozkan Sezer | 5ca9591 | 2009-04-11 08:01:05 +0000 | [diff] [blame] | 911 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 912 | |
| 913 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) |
| 914 | # ------------------------------------------- |
| 915 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. |
| 916 | AC_DEFUN([_AM_IF_OPTION], |
| 917 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
| 918 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 919 | # Copyright (C) 1999-2021 Free Software Foundation, Inc. |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 920 | # |
| 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. |
| 929 | AC_DEFUN([_AM_PROG_CC_C_O], |
| 930 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 931 | AC_REQUIRE_AUX_FILE([compile])dnl |
| 932 | AC_LANG_PUSH([C])dnl |
| 933 | AC_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]) |
| 953 | if 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" |
| 960 | fi |
| 961 | AC_LANG_POP([C])]) |
| 962 | |
| 963 | # For backward compatibility. |
| 964 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
| 965 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 966 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 967 | # |
| 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.) |
| 976 | AC_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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 983 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
| 984 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 985 | # Copyright (C) 1996-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 986 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 991 | # AM_SANITY_CHECK |
| 992 | # --------------- |
| 993 | AC_DEFUN([AM_SANITY_CHECK], |
| 994 | [AC_MSG_CHECKING([whether build environment is sane]) |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 995 | # Reject unsafe characters in $srcdir or the absolute working directory |
| 996 | # name. Accept space and tab only in the latter. |
| 997 | am_lf=' |
| 998 | ' |
| 999 | case `pwd` in |
| 1000 | *[[\\\"\#\$\&\'\`$am_lf]]*) |
| 1001 | AC_MSG_ERROR([unsafe absolute working directory name]);; |
| 1002 | esac |
| 1003 | case $srcdir in |
| 1004 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1005 | AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 1006 | esac |
| 1007 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1008 | # Do 'set' in a subshell so we don't clobber the current shell's |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1009 | # 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). |
| 1013 | if ( |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1014 | 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 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1024 | |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1025 | # 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 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1039 | test "$[2]" = conftest.file |
| 1040 | ) |
| 1041 | then |
| 1042 | # Ok. |
| 1043 | : |
| 1044 | else |
| 1045 | AC_MSG_ERROR([newly created file is older than distributed files! |
| 1046 | Check your system clock]) |
| 1047 | fi |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1048 | AC_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. |
| 1051 | am_sleep_pid= |
| 1052 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then |
| 1053 | ( sleep 1 ) & |
| 1054 | am_sleep_pid=$! |
| 1055 | fi |
| 1056 | AC_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])]) |
| 1063 | rm -f conftest.file |
| 1064 | ]) |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1065 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 1066 | # Copyright (C) 2009-2021 Free Software Foundation, Inc. |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1067 | # |
| 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). |
| 1076 | AC_DEFUN([AM_SILENT_RULES], |
| 1077 | [AC_ARG_ENABLE([silent-rules], [dnl |
| 1078 | AS_HELP_STRING( |
| 1079 | [--enable-silent-rules], |
| 1080 | [less verbose build output (undo: "make V=1")]) |
| 1081 | AS_HELP_STRING( |
| 1082 | [--disable-silent-rules], |
| 1083 | [verbose build output (undo: "make V=0")])dnl |
| 1084 | ]) |
| 1085 | case $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]);; |
| 1089 | esac |
| 1090 | dnl |
| 1091 | dnl A few 'make' implementations (e.g., NonStop OS and NextStep) |
| 1092 | dnl do not support nested variable expansions. |
| 1093 | dnl See automake bug#9928 and bug#10237. |
| 1094 | am_make=${MAKE-make} |
| 1095 | AC_CACHE_CHECK([whether $am_make supports nested variables], |
| 1096 | [am_cv_make_support_nested_variables], |
| 1097 | [if AS_ECHO([['TRUE=$(BAR$(V)) |
| 1098 | BAR0=false |
| 1099 | BAR1=true |
| 1100 | V=1 |
| 1101 | am__doit: |
| 1102 | @$(TRUE) |
| 1103 | .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then |
| 1104 | am_cv_make_support_nested_variables=yes |
| 1105 | else |
| 1106 | am_cv_make_support_nested_variables=no |
| 1107 | fi]) |
| 1108 | if 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)' |
| 1112 | else |
| 1113 | AM_V=$AM_DEFAULT_VERBOSITY |
| 1114 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY |
| 1115 | fi |
| 1116 | AC_SUBST([AM_V])dnl |
| 1117 | AM_SUBST_NOTMAKE([AM_V])dnl |
| 1118 | AC_SUBST([AM_DEFAULT_V])dnl |
| 1119 | AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl |
| 1120 | AC_SUBST([AM_DEFAULT_VERBOSITY])dnl |
| 1121 | AM_BACKSLASH='\' |
| 1122 | AC_SUBST([AM_BACKSLASH])dnl |
| 1123 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
| 1124 | ]) |
| 1125 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 1126 | # Copyright (C) 2001-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1127 | # |
| 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 | # --------------------- |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1134 | # One issue with vendor 'install' (even GNU) is that you can't |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1135 | # 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 |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1139 | # always use install-sh in "make install-strip", and initialize |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1140 | # STRIPPROG with the value of the STRIP variable (set by the user). |
| 1141 | AC_DEFUN([AM_PROG_INSTALL_STRIP], |
| 1142 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1143 | # Installed binaries are usually stripped using 'strip' when the user |
| 1144 | # run "make install-strip". However 'strip' might not be the right |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1145 | # tool to use in cross-compilation environments, therefore Automake |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1146 | # will honor the 'STRIP' environment variable to overrule this program. |
| 1147 | dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1148 | if test "$cross_compiling" != no; then |
| 1149 | AC_CHECK_TOOL([STRIP], [strip], :) |
| 1150 | fi |
| 1151 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
| 1152 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
| 1153 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 1154 | # Copyright (C) 2006-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1155 | # |
| 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 | # --------------------------- |
NightStrike | 5c46437 | 2008-09-17 18:06:46 +0000 | [diff] [blame] | 1162 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1163 | # This macro is traced by Automake. |
| 1164 | AC_DEFUN([_AM_SUBST_NOTMAKE]) |
| 1165 | |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 1166 | # AM_SUBST_NOTMAKE(VARIABLE) |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 1167 | # -------------------------- |
NightStrike | e38230c | 2009-06-09 18:50:24 +0000 | [diff] [blame] | 1168 | # Public sister of _AM_SUBST_NOTMAKE. |
| 1169 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) |
| 1170 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1171 | # Check how to create a tarball. -*- Autoconf -*- |
| 1172 | |
LIU Hao | 6eb5714 | 2022-08-16 14:36:34 +0800 | [diff] [blame] | 1173 | # Copyright (C) 2004-2021 Free Software Foundation, Inc. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1174 | # |
| 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1179 | # _AM_PROG_TAR(FORMAT) |
| 1180 | # -------------------- |
| 1181 | # Check how to create a tarball in format FORMAT. |
NightStrike | 0e8caf3 | 2012-07-09 14:25:07 +0000 | [diff] [blame] | 1182 | # FORMAT should be one of 'v7', 'ustar', or 'pax'. |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1183 | # |
| 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 |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1192 | # |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1193 | AC_DEFUN([_AM_PROG_TAR], |
Jonathan Yong | c499288 | 2012-05-26 10:00:46 +0000 | [diff] [blame] | 1194 | [# Always define AMTAR for backward compatibility. Yes, it's still used |
| 1195 | # in the wild :-( We should find a proper way to deprecate it ... |
| 1196 | AC_SUBST([AMTAR], ['$${TAR-tar}']) |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1197 | |
| 1198 | # We'll loop over all known methods to create a tar archive until one works. |
Kai Tietz | c3c1609 | 2013-06-14 20:43:42 +0000 | [diff] [blame] | 1199 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1200 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1201 | m4_if([$1], [v7], |
| 1202 | [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], |
Jacek Caban | 002a25d | 2013-06-13 13:55:33 +0000 | [diff] [blame] | 1203 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1204 | [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 |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1295 | rm -rf conftest.dir |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1296 | |
NightStrike | 326ad9f | 2013-09-06 13:27:17 +0000 | [diff] [blame] | 1297 | 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 | |
NightStrike | f5efb61 | 2007-11-07 16:01:13 +0000 | [diff] [blame] | 1300 | AC_SUBST([am__tar]) |
| 1301 | AC_SUBST([am__untar]) |
| 1302 | ]) # _AM_PROG_TAR |
| 1303 | |