| 1 |
# generated automatically by aclocal 1.16.5 -*- Autoconf -*- |
| 2 |
|
| 3 |
# Copyright (C) 1996-2021 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
# This file is free software; the Free Software Foundation |
| 6 |
# gives unlimited permission to copy and/or distribute it, |
| 7 |
# with or without modifications, as long as this notice is preserved. |
| 8 |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
| 11 |
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 12 |
# PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) |
| 15 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 16 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 17 |
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, |
| 18 |
[m4_warning([this file was generated for autoconf 2.71. |
| 19 |
You have another version of autoconf. It may work, but is not guaranteed to. |
| 20 |
If you have problems, you may need to regenerate the build system entirely. |
| 21 |
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
| 22 |
|
| 23 |
# =========================================================================== |
| 24 |
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html |
| 25 |
# =========================================================================== |
| 26 |
# |
| 27 |
# SYNOPSIS |
| 28 |
# |
| 29 |
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) |
| 30 |
# |
| 31 |
# DESCRIPTION |
| 32 |
# |
| 33 |
# Check for baseline language coverage in the compiler for the specified |
| 34 |
# version of the C++ standard. If necessary, add switches to CXX and |
| 35 |
# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for |
| 36 |
# the respective C++ standard version. |
| 37 |
# |
| 38 |
# The second argument, if specified, indicates whether you insist on an |
| 39 |
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. |
| 40 |
# -std=c++11). If neither is specified, you get whatever works, with |
| 41 |
# preference for no added switch, and then for an extended mode. |
| 42 |
# |
| 43 |
# The third argument, if specified 'mandatory' or if left unspecified, |
| 44 |
# indicates that baseline support for the specified C++ standard is |
| 45 |
# required and that the macro should error out if no mode with that |
| 46 |
# support is found. If specified 'optional', then configuration proceeds |
| 47 |
# regardless, after defining HAVE_CXX${VERSION} if and only if a |
| 48 |
# supporting mode is found. |
| 49 |
# |
| 50 |
# LICENSE |
| 51 |
# |
| 52 |
# Copyright (c) 2008 Benjamin Kosnik <[email protected]> |
| 53 |
# Copyright (c) 2012 Zack Weinberg <[email protected]> |
| 54 |
# Copyright (c) 2013 Roy Stogner <[email protected]> |
| 55 |
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <[email protected]> |
| 56 |
# Copyright (c) 2015 Paul Norman <[email protected]> |
| 57 |
# Copyright (c) 2015 Moritz Klammler <[email protected]> |
| 58 |
# Copyright (c) 2016, 2018 Krzesimir Nowak <[email protected]> |
| 59 |
# Copyright (c) 2019 Enji Cooper <[email protected]> |
| 60 |
# Copyright (c) 2020 Jason Merrill <[email protected]> |
| 61 |
# Copyright (c) 2021 Jörn Heusipp <[email protected]> |
| 62 |
# |
| 63 |
# Copying and distribution of this file, with or without modification, are |
| 64 |
# permitted in any medium without royalty provided the copyright notice |
| 65 |
# and this notice are preserved. This file is offered as-is, without any |
| 66 |
# warranty. |
| 67 |
|
| 68 |
#serial 15 |
| 69 |
|
| 70 |
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro |
| 71 |
dnl (serial version number 13). |
| 72 |
|
| 73 |
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl |
| 74 |
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], |
| 75 |
[$1], [14], [ax_cxx_compile_alternatives="14 1y"], |
| 76 |
[$1], [17], [ax_cxx_compile_alternatives="17 1z"], |
| 77 |
[$1], [20], [ax_cxx_compile_alternatives="20"], |
| 78 |
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl |
| 79 |
m4_if([$2], [], [], |
| 80 |
[$2], [ext], [], |
| 81 |
[$2], [noext], [], |
| 82 |
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl |
| 83 |
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], |
| 84 |
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], |
| 85 |
[$3], [optional], [ax_cxx_compile_cxx$1_required=false], |
| 86 |
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) |
| 87 |
AC_LANG_PUSH([C++])dnl |
| 88 |
ac_success=no |
| 89 |
|
| 90 |
m4_if([$2], [], [dnl |
| 91 |
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, |
| 92 |
ax_cv_cxx_compile_cxx$1, |
| 93 |
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], |
| 94 |
[ax_cv_cxx_compile_cxx$1=yes], |
| 95 |
[ax_cv_cxx_compile_cxx$1=no])]) |
| 96 |
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then |
| 97 |
ac_success=yes |
| 98 |
fi]) |
| 99 |
|
| 100 |
m4_if([$2], [noext], [], [dnl |
| 101 |
if test x$ac_success = xno; then |
| 102 |
for alternative in ${ax_cxx_compile_alternatives}; do |
| 103 |
switch="-std=gnu++${alternative}" |
| 104 |
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) |
| 105 |
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, |
| 106 |
$cachevar, |
| 107 |
[ac_save_CXX="$CXX" |
| 108 |
CXX="$CXX $switch" |
| 109 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], |
| 110 |
[eval $cachevar=yes], |
| 111 |
[eval $cachevar=no]) |
| 112 |
CXX="$ac_save_CXX"]) |
| 113 |
if eval test x\$$cachevar = xyes; then |
| 114 |
CXX="$CXX $switch" |
| 115 |
if test -n "$CXXCPP" ; then |
| 116 |
CXXCPP="$CXXCPP $switch" |
| 117 |
fi |
| 118 |
ac_success=yes |
| 119 |
break |
| 120 |
fi |
| 121 |
done |
| 122 |
fi]) |
| 123 |
|
| 124 |
m4_if([$2], [ext], [], [dnl |
| 125 |
if test x$ac_success = xno; then |
| 126 |
dnl HP's aCC needs +std=c++11 according to: |
| 127 |
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf |
| 128 |
dnl Cray's crayCC needs "-h std=c++11" |
| 129 |
for alternative in ${ax_cxx_compile_alternatives}; do |
| 130 |
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do |
| 131 |
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) |
| 132 |
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, |
| 133 |
$cachevar, |
| 134 |
[ac_save_CXX="$CXX" |
| 135 |
CXX="$CXX $switch" |
| 136 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], |
| 137 |
[eval $cachevar=yes], |
| 138 |
[eval $cachevar=no]) |
| 139 |
CXX="$ac_save_CXX"]) |
| 140 |
if eval test x\$$cachevar = xyes; then |
| 141 |
CXX="$CXX $switch" |
| 142 |
if test -n "$CXXCPP" ; then |
| 143 |
CXXCPP="$CXXCPP $switch" |
| 144 |
fi |
| 145 |
ac_success=yes |
| 146 |
break |
| 147 |
fi |
| 148 |
done |
| 149 |
if test x$ac_success = xyes; then |
| 150 |
break |
| 151 |
fi |
| 152 |
done |
| 153 |
fi]) |
| 154 |
AC_LANG_POP([C++]) |
| 155 |
if test x$ax_cxx_compile_cxx$1_required = xtrue; then |
| 156 |
if test x$ac_success = xno; then |
| 157 |
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) |
| 158 |
fi |
| 159 |
fi |
| 160 |
if test x$ac_success = xno; then |
| 161 |
HAVE_CXX$1=0 |
| 162 |
AC_MSG_NOTICE([No compiler with C++$1 support was found]) |
| 163 |
else |
| 164 |
HAVE_CXX$1=1 |
| 165 |
AC_DEFINE(HAVE_CXX$1,1, |
| 166 |
[define if the compiler supports basic C++$1 syntax]) |
| 167 |
fi |
| 168 |
AC_SUBST(HAVE_CXX$1) |
| 169 |
]) |
| 170 |
|
| 171 |
|
| 172 |
dnl Test body for checking C++11 support |
| 173 |
|
| 174 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], |
| 175 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 |
| 176 |
) |
| 177 |
|
| 178 |
dnl Test body for checking C++14 support |
| 179 |
|
| 180 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], |
| 181 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 |
| 182 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14 |
| 183 |
) |
| 184 |
|
| 185 |
dnl Test body for checking C++17 support |
| 186 |
|
| 187 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], |
| 188 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 |
| 189 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14 |
| 190 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17 |
| 191 |
) |
| 192 |
|
| 193 |
dnl Test body for checking C++20 support |
| 194 |
|
| 195 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], |
| 196 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11 |
| 197 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14 |
| 198 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17 |
| 199 |
_AX_CXX_COMPILE_STDCXX_testbody_new_in_20 |
| 200 |
) |
| 201 |
|
| 202 |
|
| 203 |
dnl Tests for new features in C++11 |
| 204 |
|
| 205 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ |
| 206 |
|
| 207 |
// If the compiler admits that it is not ready for C++11, why torture it? |
| 208 |
// Hopefully, this will speed up the test. |
| 209 |
|
| 210 |
#ifndef __cplusplus |
| 211 |
|
| 212 |
#error "This is not a C++ compiler" |
| 213 |
|
| 214 |
// MSVC always sets __cplusplus to 199711L in older versions; newer versions |
| 215 |
// only set it correctly if /Zc:__cplusplus is specified as well as a |
| 216 |
// /std:c++NN switch: |
| 217 |
// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ |
| 218 |
#elif __cplusplus < 201103L && !defined _MSC_VER |
| 219 |
|
| 220 |
#error "This is not a C++11 compiler" |
| 221 |
|
| 222 |
#else |
| 223 |
|
| 224 |
namespace cxx11 |
| 225 |
{ |
| 226 |
|
| 227 |
namespace test_static_assert |
| 228 |
{ |
| 229 |
|
| 230 |
template <typename T> |
| 231 |
struct check |
| 232 |
{ |
| 233 |
static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
| 234 |
}; |
| 235 |
|
| 236 |
} |
| 237 |
|
| 238 |
namespace test_final_override |
| 239 |
{ |
| 240 |
|
| 241 |
struct Base |
| 242 |
{ |
| 243 |
virtual ~Base() {} |
| 244 |
virtual void f() {} |
| 245 |
}; |
| 246 |
|
| 247 |
struct Derived : public Base |
| 248 |
{ |
| 249 |
virtual ~Derived() override {} |
| 250 |
virtual void f() override {} |
| 251 |
}; |
| 252 |
|
| 253 |
} |
| 254 |
|
| 255 |
namespace test_double_right_angle_brackets |
| 256 |
{ |
| 257 |
|
| 258 |
template < typename T > |
| 259 |
struct check {}; |
| 260 |
|
| 261 |
typedef check<void> single_type; |
| 262 |
typedef check<check<void>> double_type; |
| 263 |
typedef check<check<check<void>>> triple_type; |
| 264 |
typedef check<check<check<check<void>>>> quadruple_type; |
| 265 |
|
| 266 |
} |
| 267 |
|
| 268 |
namespace test_decltype |
| 269 |
{ |
| 270 |
|
| 271 |
int |
| 272 |
f() |
| 273 |
{ |
| 274 |
int a = 1; |
| 275 |
decltype(a) b = 2; |
| 276 |
return a + b; |
| 277 |
} |
| 278 |
|
| 279 |
} |
| 280 |
|
| 281 |
namespace test_type_deduction |
| 282 |
{ |
| 283 |
|
| 284 |
template < typename T1, typename T2 > |
| 285 |
struct is_same |
| 286 |
{ |
| 287 |
static const bool value = false; |
| 288 |
}; |
| 289 |
|
| 290 |
template < typename T > |
| 291 |
struct is_same<T, T> |
| 292 |
{ |
| 293 |
static const bool value = true; |
| 294 |
}; |
| 295 |
|
| 296 |
template < typename T1, typename T2 > |
| 297 |
auto |
| 298 |
add(T1 a1, T2 a2) -> decltype(a1 + a2) |
| 299 |
{ |
| 300 |
return a1 + a2; |
| 301 |
} |
| 302 |
|
| 303 |
int |
| 304 |
test(const int c, volatile int v) |
| 305 |
{ |
| 306 |
static_assert(is_same<int, decltype(0)>::value == true, ""); |
| 307 |
static_assert(is_same<int, decltype(c)>::value == false, ""); |
| 308 |
static_assert(is_same<int, decltype(v)>::value == false, ""); |
| 309 |
auto ac = c; |
| 310 |
auto av = v; |
| 311 |
auto sumi = ac + av + 'x'; |
| 312 |
auto sumf = ac + av + 1.0; |
| 313 |
static_assert(is_same<int, decltype(ac)>::value == true, ""); |
| 314 |
static_assert(is_same<int, decltype(av)>::value == true, ""); |
| 315 |
static_assert(is_same<int, decltype(sumi)>::value == true, ""); |
| 316 |
static_assert(is_same<int, decltype(sumf)>::value == false, ""); |
| 317 |
static_assert(is_same<int, decltype(add(c, v))>::value == true, ""); |
| 318 |
return (sumf > 0.0) ? sumi : add(c, v); |
| 319 |
} |
| 320 |
|
| 321 |
} |
| 322 |
|
| 323 |
namespace test_noexcept |
| 324 |
{ |
| 325 |
|
| 326 |
int f() { return 0; } |
| 327 |
int g() noexcept { return 0; } |
| 328 |
|
| 329 |
static_assert(noexcept(f()) == false, ""); |
| 330 |
static_assert(noexcept(g()) == true, ""); |
| 331 |
|
| 332 |
} |
| 333 |
|
| 334 |
namespace test_constexpr |
| 335 |
{ |
| 336 |
|
| 337 |
template < typename CharT > |
| 338 |
unsigned long constexpr |
| 339 |
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept |
| 340 |
{ |
| 341 |
return *s ? strlen_c_r(s + 1, acc + 1) : acc; |
| 342 |
} |
| 343 |
|
| 344 |
template < typename CharT > |
| 345 |
unsigned long constexpr |
| 346 |
strlen_c(const CharT *const s) noexcept |
| 347 |
{ |
| 348 |
return strlen_c_r(s, 0UL); |
| 349 |
} |
| 350 |
|
| 351 |
static_assert(strlen_c("") == 0UL, ""); |
| 352 |
static_assert(strlen_c("1") == 1UL, ""); |
| 353 |
static_assert(strlen_c("example") == 7UL, ""); |
| 354 |
static_assert(strlen_c("another\0example") == 7UL, ""); |
| 355 |
|
| 356 |
} |
| 357 |
|
| 358 |
namespace test_rvalue_references |
| 359 |
{ |
| 360 |
|
| 361 |
template < int N > |
| 362 |
struct answer |
| 363 |
{ |
| 364 |
static constexpr int value = N; |
| 365 |
}; |
| 366 |
|
| 367 |
answer<1> f(int&) { return answer<1>(); } |
| 368 |
answer<2> f(const int&) { return answer<2>(); } |
| 369 |
answer<3> f(int&&) { return answer<3>(); } |
| 370 |
|
| 371 |
void |
| 372 |
test() |
| 373 |
{ |
| 374 |
int i = 0; |
| 375 |
const int c = 0; |
| 376 |
static_assert(decltype(f(i))::value == 1, ""); |
| 377 |
static_assert(decltype(f(c))::value == 2, ""); |
| 378 |
static_assert(decltype(f(0))::value == 3, ""); |
| 379 |
} |
| 380 |
|
| 381 |
} |
| 382 |
|
| 383 |
namespace test_uniform_initialization |
| 384 |
{ |
| 385 |
|
| 386 |
struct test |
| 387 |
{ |
| 388 |
static const int zero {}; |
| 389 |
static const int one {1}; |
| 390 |
}; |
| 391 |
|
| 392 |
static_assert(test::zero == 0, ""); |
| 393 |
static_assert(test::one == 1, ""); |
| 394 |
|
| 395 |
} |
| 396 |
|
| 397 |
namespace test_lambdas |
| 398 |
{ |
| 399 |
|
| 400 |
void |
| 401 |
test1() |
| 402 |
{ |
| 403 |
auto lambda1 = [](){}; |
| 404 |
auto lambda2 = lambda1; |
| 405 |
lambda1(); |
| 406 |
lambda2(); |
| 407 |
} |
| 408 |
|
| 409 |
int |
| 410 |
test2() |
| 411 |
{ |
| 412 |
auto a = [](int i, int j){ return i + j; }(1, 2); |
| 413 |
auto b = []() -> int { return '0'; }(); |
| 414 |
auto c = [=](){ return a + b; }(); |
| 415 |
auto d = [&](){ return c; }(); |
| 416 |
auto e = [a, &b](int x) mutable { |
| 417 |
const auto identity = [](int y){ return y; }; |
| 418 |
for (auto i = 0; i < a; ++i) |
| 419 |
a += b--; |
| 420 |
return x + identity(a + b); |
| 421 |
}(0); |
| 422 |
return a + b + c + d + e; |
| 423 |
} |
| 424 |
|
| 425 |
int |
| 426 |
test3() |
| 427 |
{ |
| 428 |
const auto nullary = [](){ return 0; }; |
| 429 |
const auto unary = [](int x){ return x; }; |
| 430 |
using nullary_t = decltype(nullary); |
| 431 |
using unary_t = decltype(unary); |
| 432 |
const auto higher1st = [](nullary_t f){ return f(); }; |
| 433 |
const auto higher2nd = [unary](nullary_t f1){ |
| 434 |
return [unary, f1](unary_t f2){ return f2(unary(f1())); }; |
| 435 |
}; |
| 436 |
return higher1st(nullary) + higher2nd(nullary)(unary); |
| 437 |
} |
| 438 |
|
| 439 |
} |
| 440 |
|
| 441 |
namespace test_variadic_templates |
| 442 |
{ |
| 443 |
|
| 444 |
template <int...> |
| 445 |
struct sum; |
| 446 |
|
| 447 |
template <int N0, int... N1toN> |
| 448 |
struct sum<N0, N1toN...> |
| 449 |
{ |
| 450 |
static constexpr auto value = N0 + sum<N1toN...>::value; |
| 451 |
}; |
| 452 |
|
| 453 |
template <> |
| 454 |
struct sum<> |
| 455 |
{ |
| 456 |
static constexpr auto value = 0; |
| 457 |
}; |
| 458 |
|
| 459 |
static_assert(sum<>::value == 0, ""); |
| 460 |
static_assert(sum<1>::value == 1, ""); |
| 461 |
static_assert(sum<23>::value == 23, ""); |
| 462 |
static_assert(sum<1, 2>::value == 3, ""); |
| 463 |
static_assert(sum<5, 5, 11>::value == 21, ""); |
| 464 |
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); |
| 465 |
|
| 466 |
} |
| 467 |
|
| 468 |
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae |
| 469 |
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function |
| 470 |
// because of this. |
| 471 |
namespace test_template_alias_sfinae |
| 472 |
{ |
| 473 |
|
| 474 |
struct foo {}; |
| 475 |
|
| 476 |
template<typename T> |
| 477 |
using member = typename T::member_type; |
| 478 |
|
| 479 |
template<typename T> |
| 480 |
void func(...) {} |
| 481 |
|
| 482 |
template<typename T> |
| 483 |
void func(member<T>*) {} |
| 484 |
|
| 485 |
void test(); |
| 486 |
|
| 487 |
void test() { func<foo>(0); } |
| 488 |
|
| 489 |
} |
| 490 |
|
| 491 |
} // namespace cxx11 |
| 492 |
|
| 493 |
#endif // __cplusplus >= 201103L |
| 494 |
|
| 495 |
]]) |
| 496 |
|
| 497 |
|
| 498 |
dnl Tests for new features in C++14 |
| 499 |
|
| 500 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ |
| 501 |
|
| 502 |
// If the compiler admits that it is not ready for C++14, why torture it? |
| 503 |
// Hopefully, this will speed up the test. |
| 504 |
|
| 505 |
#ifndef __cplusplus |
| 506 |
|
| 507 |
#error "This is not a C++ compiler" |
| 508 |
|
| 509 |
#elif __cplusplus < 201402L && !defined _MSC_VER |
| 510 |
|
| 511 |
#error "This is not a C++14 compiler" |
| 512 |
|
| 513 |
#else |
| 514 |
|
| 515 |
namespace cxx14 |
| 516 |
{ |
| 517 |
|
| 518 |
namespace test_polymorphic_lambdas |
| 519 |
{ |
| 520 |
|
| 521 |
int |
| 522 |
test() |
| 523 |
{ |
| 524 |
const auto lambda = [](auto&&... args){ |
| 525 |
const auto istiny = [](auto x){ |
| 526 |
return (sizeof(x) == 1UL) ? 1 : 0; |
| 527 |
}; |
| 528 |
const int aretiny[] = { istiny(args)... }; |
| 529 |
return aretiny[0]; |
| 530 |
}; |
| 531 |
return lambda(1, 1L, 1.0f, '1'); |
| 532 |
} |
| 533 |
|
| 534 |
} |
| 535 |
|
| 536 |
namespace test_binary_literals |
| 537 |
{ |
| 538 |
|
| 539 |
constexpr auto ivii = 0b0000000000101010; |
| 540 |
static_assert(ivii == 42, "wrong value"); |
| 541 |
|
| 542 |
} |
| 543 |
|
| 544 |
namespace test_generalized_constexpr |
| 545 |
{ |
| 546 |
|
| 547 |
template < typename CharT > |
| 548 |
constexpr unsigned long |
| 549 |
strlen_c(const CharT *const s) noexcept |
| 550 |
{ |
| 551 |
auto length = 0UL; |
| 552 |
for (auto p = s; *p; ++p) |
| 553 |
++length; |
| 554 |
return length; |
| 555 |
} |
| 556 |
|
| 557 |
static_assert(strlen_c("") == 0UL, ""); |
| 558 |
static_assert(strlen_c("x") == 1UL, ""); |
| 559 |
static_assert(strlen_c("test") == 4UL, ""); |
| 560 |
static_assert(strlen_c("another\0test") == 7UL, ""); |
| 561 |
|
| 562 |
} |
| 563 |
|
| 564 |
namespace test_lambda_init_capture |
| 565 |
{ |
| 566 |
|
| 567 |
int |
| 568 |
test() |
| 569 |
{ |
| 570 |
auto x = 0; |
| 571 |
const auto lambda1 = [a = x](int b){ return a + b; }; |
| 572 |
const auto lambda2 = [a = lambda1(x)](){ return a; }; |
| 573 |
return lambda2(); |
| 574 |
} |
| 575 |
|
| 576 |
} |
| 577 |
|
| 578 |
namespace test_digit_separators |
| 579 |
{ |
| 580 |
|
| 581 |
constexpr auto ten_million = 100'000'000; |
| 582 |
static_assert(ten_million == 100000000, ""); |
| 583 |
|
| 584 |
} |
| 585 |
|
| 586 |
namespace test_return_type_deduction |
| 587 |
{ |
| 588 |
|
| 589 |
auto f(int& x) { return x; } |
| 590 |
decltype(auto) g(int& x) { return x; } |
| 591 |
|
| 592 |
template < typename T1, typename T2 > |
| 593 |
struct is_same |
| 594 |
{ |
| 595 |
static constexpr auto value = false; |
| 596 |
}; |
| 597 |
|
| 598 |
template < typename T > |
| 599 |
struct is_same<T, T> |
| 600 |
{ |
| 601 |
static constexpr auto value = true; |
| 602 |
}; |
| 603 |
|
| 604 |
int |
| 605 |
test() |
| 606 |
{ |
| 607 |
auto x = 0; |
| 608 |
static_assert(is_same<int, decltype(f(x))>::value, ""); |
| 609 |
static_assert(is_same<int&, decltype(g(x))>::value, ""); |
| 610 |
return x; |
| 611 |
} |
| 612 |
|
| 613 |
} |
| 614 |
|
| 615 |
} // namespace cxx14 |
| 616 |
|
| 617 |
#endif // __cplusplus >= 201402L |
| 618 |
|
| 619 |
]]) |
| 620 |
|
| 621 |
|
| 622 |
dnl Tests for new features in C++17 |
| 623 |
|
| 624 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ |
| 625 |
|
| 626 |
// If the compiler admits that it is not ready for C++17, why torture it? |
| 627 |
// Hopefully, this will speed up the test. |
| 628 |
|
| 629 |
#ifndef __cplusplus |
| 630 |
|
| 631 |
#error "This is not a C++ compiler" |
| 632 |
|
| 633 |
#elif __cplusplus < 201703L && !defined _MSC_VER |
| 634 |
|
| 635 |
#error "This is not a C++17 compiler" |
| 636 |
|
| 637 |
#else |
| 638 |
|
| 639 |
#include <initializer_list> |
| 640 |
#include <utility> |
| 641 |
#include <type_traits> |
| 642 |
|
| 643 |
namespace cxx17 |
| 644 |
{ |
| 645 |
|
| 646 |
namespace test_constexpr_lambdas |
| 647 |
{ |
| 648 |
|
| 649 |
constexpr int foo = [](){return 42;}(); |
| 650 |
|
| 651 |
} |
| 652 |
|
| 653 |
namespace test::nested_namespace::definitions |
| 654 |
{ |
| 655 |
|
| 656 |
} |
| 657 |
|
| 658 |
namespace test_fold_expression |
| 659 |
{ |
| 660 |
|
| 661 |
template<typename... Args> |
| 662 |
int multiply(Args... args) |
| 663 |
{ |
| 664 |
return (args * ... * 1); |
| 665 |
} |
| 666 |
|
| 667 |
template<typename... Args> |
| 668 |
bool all(Args... args) |
| 669 |
{ |
| 670 |
return (args && ...); |
| 671 |
} |
| 672 |
|
| 673 |
} |
| 674 |
|
| 675 |
namespace test_extended_static_assert |
| 676 |
{ |
| 677 |
|
| 678 |
static_assert (true); |
| 679 |
|
| 680 |
} |
| 681 |
|
| 682 |
namespace test_auto_brace_init_list |
| 683 |
{ |
| 684 |
|
| 685 |
auto foo = {5}; |
| 686 |
auto bar {5}; |
| 687 |
|
| 688 |
static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); |
| 689 |
static_assert(std::is_same<int, decltype(bar)>::value); |
| 690 |
} |
| 691 |
|
| 692 |
namespace test_typename_in_template_template_parameter |
| 693 |
{ |
| 694 |
|
| 695 |
template<template<typename> typename X> struct D; |
| 696 |
|
| 697 |
} |
| 698 |
|
| 699 |
namespace test_fallthrough_nodiscard_maybe_unused_attributes |
| 700 |
{ |
| 701 |
|
| 702 |
int f1() |
| 703 |
{ |
| 704 |
return 42; |
| 705 |
} |
| 706 |
|
| 707 |
[[nodiscard]] int f2() |
| 708 |
{ |
| 709 |
[[maybe_unused]] auto unused = f1(); |
| 710 |
|
| 711 |
switch (f1()) |
| 712 |
{ |
| 713 |
case 17: |
| 714 |
f1(); |
| 715 |
[[fallthrough]]; |
| 716 |
case 42: |
| 717 |
f1(); |
| 718 |
} |
| 719 |
return f1(); |
| 720 |
} |
| 721 |
|
| 722 |
} |
| 723 |
|
| 724 |
namespace test_extended_aggregate_initialization |
| 725 |
{ |
| 726 |
|
| 727 |
struct base1 |
| 728 |
{ |
| 729 |
int b1, b2 = 42; |
| 730 |
}; |
| 731 |
|
| 732 |
struct base2 |
| 733 |
{ |
| 734 |
base2() { |
| 735 |
b3 = 42; |
| 736 |
} |
| 737 |
int b3; |
| 738 |
}; |
| 739 |
|
| 740 |
struct derived : base1, base2 |
| 741 |
{ |
| 742 |
int d; |
| 743 |
}; |
| 744 |
|
| 745 |
derived d1 {{1, 2}, {}, 4}; // full initialization |
| 746 |
derived d2 {{}, {}, 4}; // value-initialized bases |
| 747 |
|
| 748 |
} |
| 749 |
|
| 750 |
namespace test_general_range_based_for_loop |
| 751 |
{ |
| 752 |
|
| 753 |
struct iter |
| 754 |
{ |
| 755 |
int i; |
| 756 |
|
| 757 |
int& operator* () |
| 758 |
{ |
| 759 |
return i; |
| 760 |
} |
| 761 |
|
| 762 |
const int& operator* () const |
| 763 |
{ |
| 764 |
return i; |
| 765 |
} |
| 766 |
|
| 767 |
iter& operator++() |
| 768 |
{ |
| 769 |
++i; |
| 770 |
return *this; |
| 771 |
} |
| 772 |
}; |
| 773 |
|
| 774 |
struct sentinel |
| 775 |
{ |
| 776 |
int i; |
| 777 |
}; |
| 778 |
|
| 779 |
bool operator== (const iter& i, const sentinel& s) |
| 780 |
{ |
| 781 |
return i.i == s.i; |
| 782 |
} |
| 783 |
|
| 784 |
bool operator!= (const iter& i, const sentinel& s) |
| 785 |
{ |
| 786 |
return !(i == s); |
| 787 |
} |
| 788 |
|
| 789 |
struct range |
| 790 |
{ |
| 791 |
iter begin() const |
| 792 |
{ |
| 793 |
return {0}; |
| 794 |
} |
| 795 |
|
| 796 |
sentinel end() const |
| 797 |
{ |
| 798 |
return {5}; |
| 799 |
} |
| 800 |
}; |
| 801 |
|
| 802 |
void f() |
| 803 |
{ |
| 804 |
range r {}; |
| 805 |
|
| 806 |
for (auto i : r) |
| 807 |
{ |
| 808 |
[[maybe_unused]] auto v = i; |
| 809 |
} |
| 810 |
} |
| 811 |
|
| 812 |
} |
| 813 |
|
| 814 |
namespace test_lambda_capture_asterisk_this_by_value |
| 815 |
{ |
| 816 |
|
| 817 |
struct t |
| 818 |
{ |
| 819 |
int i; |
| 820 |
int foo() |
| 821 |
{ |
| 822 |
return [*this]() |
| 823 |
{ |
| 824 |
return i; |
| 825 |
}(); |
| 826 |
} |
| 827 |
}; |
| 828 |
|
| 829 |
} |
| 830 |
|
| 831 |
namespace test_enum_class_construction |
| 832 |
{ |
| 833 |
|
| 834 |
enum class byte : unsigned char |
| 835 |
{}; |
| 836 |
|
| 837 |
byte foo {42}; |
| 838 |
|
| 839 |
} |
| 840 |
|
| 841 |
namespace test_constexpr_if |
| 842 |
{ |
| 843 |
|
| 844 |
template <bool cond> |
| 845 |
int f () |
| 846 |
{ |
| 847 |
if constexpr(cond) |
| 848 |
{ |
| 849 |
return 13; |
| 850 |
} |
| 851 |
else |
| 852 |
{ |
| 853 |
return 42; |
| 854 |
} |
| 855 |
} |
| 856 |
|
| 857 |
} |
| 858 |
|
| 859 |
namespace test_selection_statement_with_initializer |
| 860 |
{ |
| 861 |
|
| 862 |
int f() |
| 863 |
{ |
| 864 |
return 13; |
| 865 |
} |
| 866 |
|
| 867 |
int f2() |
| 868 |
{ |
| 869 |
if (auto i = f(); i > 0) |
| 870 |
{ |
| 871 |
return 3; |
| 872 |
} |
| 873 |
|
| 874 |
switch (auto i = f(); i + 4) |
| 875 |
{ |
| 876 |
case 17: |
| 877 |
return 2; |
| 878 |
|
| 879 |
default: |
| 880 |
return 1; |
| 881 |
} |
| 882 |
} |
| 883 |
|
| 884 |
} |
| 885 |
|
| 886 |
namespace test_template_argument_deduction_for_class_templates |
| 887 |
{ |
| 888 |
|
| 889 |
template <typename T1, typename T2> |
| 890 |
struct pair |
| 891 |
{ |
| 892 |
pair (T1 p1, T2 p2) |
| 893 |
: m1 {p1}, |
| 894 |
m2 {p2} |
| 895 |
{} |
| 896 |
|
| 897 |
T1 m1; |
| 898 |
T2 m2; |
| 899 |
}; |
| 900 |
|
| 901 |
void f() |
| 902 |
{ |
| 903 |
[[maybe_unused]] auto p = pair{13, 42u}; |
| 904 |
} |
| 905 |
|
| 906 |
} |
| 907 |
|
| 908 |
namespace test_non_type_auto_template_parameters |
| 909 |
{ |
| 910 |
|
| 911 |
template <auto n> |
| 912 |
struct B |
| 913 |
{}; |
| 914 |
|
| 915 |
B<5> b1; |
| 916 |
B<'a'> b2; |
| 917 |
|
| 918 |
} |
| 919 |
|
| 920 |
namespace test_structured_bindings |
| 921 |
{ |
| 922 |
|
| 923 |
int arr[2] = { 1, 2 }; |
| 924 |
std::pair<int, int> pr = { 1, 2 }; |
| 925 |
|
| 926 |
auto f1() -> int(&)[2] |
| 927 |
{ |
| 928 |
return arr; |
| 929 |
} |
| 930 |
|
| 931 |
auto f2() -> std::pair<int, int>& |
| 932 |
{ |
| 933 |
return pr; |
| 934 |
} |
| 935 |
|
| 936 |
struct S |
| 937 |
{ |
| 938 |
int x1 : 2; |
| 939 |
volatile double y1; |
| 940 |
}; |
| 941 |
|
| 942 |
S f3() |
| 943 |
{ |
| 944 |
return {}; |
| 945 |
} |
| 946 |
|
| 947 |
auto [ x1, y1 ] = f1(); |
| 948 |
auto& [ xr1, yr1 ] = f1(); |
| 949 |
auto [ x2, y2 ] = f2(); |
| 950 |
auto& [ xr2, yr2 ] = f2(); |
| 951 |
const auto [ x3, y3 ] = f3(); |
| 952 |
|
| 953 |
} |
| 954 |
|
| 955 |
namespace test_exception_spec_type_system |
| 956 |
{ |
| 957 |
|
| 958 |
struct Good {}; |
| 959 |
struct Bad {}; |
| 960 |
|
| 961 |
void g1() noexcept; |
| 962 |
void g2(); |
| 963 |
|
| 964 |
template<typename T> |
| 965 |
Bad |
| 966 |
f(T*, T*); |
| 967 |
|
| 968 |
template<typename T1, typename T2> |
| 969 |
Good |
| 970 |
f(T1*, T2*); |
| 971 |
|
| 972 |
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); |
| 973 |
|
| 974 |
} |
| 975 |
|
| 976 |
namespace test_inline_variables |
| 977 |
{ |
| 978 |
|
| 979 |
template<class T> void f(T) |
| 980 |
{} |
| 981 |
|
| 982 |
template<class T> inline T g(T) |
| 983 |
{ |
| 984 |
return T{}; |
| 985 |
} |
| 986 |
|
| 987 |
template<> inline void f<>(int) |
| 988 |
{} |
| 989 |
|
| 990 |
template<> int g<>(int) |
| 991 |
{ |
| 992 |
return 5; |
| 993 |
} |
| 994 |
|
| 995 |
} |
| 996 |
|
| 997 |
} // namespace cxx17 |
| 998 |
|
| 999 |
#endif // __cplusplus < 201703L && !defined _MSC_VER |
| 1000 |
|
| 1001 |
]]) |
| 1002 |
|
| 1003 |
|
| 1004 |
dnl Tests for new features in C++20 |
| 1005 |
|
| 1006 |
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ |
| 1007 |
|
| 1008 |
#ifndef __cplusplus |
| 1009 |
|
| 1010 |
#error "This is not a C++ compiler" |
| 1011 |
|
| 1012 |
#elif __cplusplus < 202002L && !defined _MSC_VER |
| 1013 |
|
| 1014 |
#error "This is not a C++20 compiler" |
| 1015 |
|
| 1016 |
#else |
| 1017 |
|
| 1018 |
#include <version> |
| 1019 |
|
| 1020 |
namespace cxx20 |
| 1021 |
{ |
| 1022 |
|
| 1023 |
// As C++20 supports feature test macros in the standard, there is no |
| 1024 |
// immediate need to actually test for feature availability on the |
| 1025 |
// Autoconf side. |
| 1026 |
|
| 1027 |
} // namespace cxx20 |
| 1028 |
|
| 1029 |
#endif // __cplusplus < 202002L && !defined _MSC_VER |
| 1030 |
|
| 1031 |
]]) |
| 1032 |
|
| 1033 |
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- |
| 1034 |
# serial 12 (pkg-config-0.29.2) |
| 1035 |
|
| 1036 |
dnl Copyright © 2004 Scott James Remnant <[email protected]>. |
| 1037 |
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> |
| 1038 |
dnl |
| 1039 |
dnl This program is free software; you can redistribute it and/or modify |
| 1040 |
dnl it under the terms of the GNU General Public License as published by |
| 1041 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 1042 |
dnl (at your option) any later version. |
| 1043 |
dnl |
| 1044 |
dnl This program is distributed in the hope that it will be useful, but |
| 1045 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1046 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 1047 |
dnl General Public License for more details. |
| 1048 |
dnl |
| 1049 |
dnl You should have received a copy of the GNU General Public License |
| 1050 |
dnl along with this program; if not, write to the Free Software |
| 1051 |
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 1052 |
dnl 02111-1307, USA. |
| 1053 |
dnl |
| 1054 |
dnl As a special exception to the GNU General Public License, if you |
| 1055 |
dnl distribute this file as part of a program that contains a |
| 1056 |
dnl configuration script generated by Autoconf, you may include it under |
| 1057 |
dnl the same distribution terms that you use for the rest of that |
| 1058 |
dnl program. |
| 1059 |
|
| 1060 |
dnl PKG_PREREQ(MIN-VERSION) |
| 1061 |
dnl ----------------------- |
| 1062 |
dnl Since: 0.29 |
| 1063 |
dnl |
| 1064 |
dnl Verify that the version of the pkg-config macros are at least |
| 1065 |
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's |
| 1066 |
dnl installed version of pkg-config, this checks the developer's version |
| 1067 |
dnl of pkg.m4 when generating configure. |
| 1068 |
dnl |
| 1069 |
dnl To ensure that this macro is defined, also add: |
| 1070 |
dnl m4_ifndef([PKG_PREREQ], |
| 1071 |
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) |
| 1072 |
dnl |
| 1073 |
dnl See the "Since" comment for each macro you use to see what version |
| 1074 |
dnl of the macros you require. |
| 1075 |
m4_defun([PKG_PREREQ], |
| 1076 |
[m4_define([PKG_MACROS_VERSION], [0.29.2]) |
| 1077 |
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, |
| 1078 |
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) |
| 1079 |
])dnl PKG_PREREQ |
| 1080 |
|
| 1081 |
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
| 1082 |
dnl ---------------------------------- |
| 1083 |
dnl Since: 0.16 |
| 1084 |
dnl |
| 1085 |
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to |
| 1086 |
dnl first found in the path. Checks that the version of pkg-config found |
| 1087 |
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is |
| 1088 |
dnl used since that's the first version where most current features of |
| 1089 |
dnl pkg-config existed. |
| 1090 |
AC_DEFUN([PKG_PROG_PKG_CONFIG], |
| 1091 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
| 1092 |
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) |
| 1093 |
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) |
| 1094 |
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
| 1095 |
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) |
| 1096 |
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) |
| 1097 |
|
| 1098 |
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
| 1099 |
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
| 1100 |
fi |
| 1101 |
if test -n "$PKG_CONFIG"; then |
| 1102 |
_pkg_min_version=m4_default([$1], [0.9.0]) |
| 1103 |
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
| 1104 |
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
| 1105 |
AC_MSG_RESULT([yes]) |
| 1106 |
else |
| 1107 |
AC_MSG_RESULT([no]) |
| 1108 |
PKG_CONFIG="" |
| 1109 |
fi |
| 1110 |
fi[]dnl |
| 1111 |
])dnl PKG_PROG_PKG_CONFIG |
| 1112 |
|
| 1113 |
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 1114 |
dnl ------------------------------------------------------------------- |
| 1115 |
dnl Since: 0.18 |
| 1116 |
dnl |
| 1117 |
dnl Check to see whether a particular set of modules exists. Similar to |
| 1118 |
dnl PKG_CHECK_MODULES(), but does not set variables or print errors. |
| 1119 |
dnl |
| 1120 |
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 1121 |
dnl only at the first occurrence in configure.ac, so if the first place |
| 1122 |
dnl it's called might be skipped (such as if it is within an "if", you |
| 1123 |
dnl have to call PKG_CHECK_EXISTS manually |
| 1124 |
AC_DEFUN([PKG_CHECK_EXISTS], |
| 1125 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1126 |
if test -n "$PKG_CONFIG" && \ |
| 1127 |
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
| 1128 |
m4_default([$2], [:]) |
| 1129 |
m4_ifvaln([$3], [else |
| 1130 |
$3])dnl |
| 1131 |
fi]) |
| 1132 |
|
| 1133 |
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
| 1134 |
dnl --------------------------------------------- |
| 1135 |
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting |
| 1136 |
dnl pkg_failed based on the result. |
| 1137 |
m4_define([_PKG_CONFIG], |
| 1138 |
[if test -n "$$1"; then |
| 1139 |
pkg_cv_[]$1="$$1" |
| 1140 |
elif test -n "$PKG_CONFIG"; then |
| 1141 |
PKG_CHECK_EXISTS([$3], |
| 1142 |
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` |
| 1143 |
test "x$?" != "x0" && pkg_failed=yes ], |
| 1144 |
[pkg_failed=yes]) |
| 1145 |
else |
| 1146 |
pkg_failed=untried |
| 1147 |
fi[]dnl |
| 1148 |
])dnl _PKG_CONFIG |
| 1149 |
|
| 1150 |
dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 1151 |
dnl --------------------------- |
| 1152 |
dnl Internal check to see if pkg-config supports short errors. |
| 1153 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
| 1154 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 1155 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
| 1156 |
_pkg_short_errors_supported=yes |
| 1157 |
else |
| 1158 |
_pkg_short_errors_supported=no |
| 1159 |
fi[]dnl |
| 1160 |
])dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 1161 |
|
| 1162 |
|
| 1163 |
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 1164 |
dnl [ACTION-IF-NOT-FOUND]) |
| 1165 |
dnl -------------------------------------------------------------- |
| 1166 |
dnl Since: 0.4.0 |
| 1167 |
dnl |
| 1168 |
dnl Note that if there is a possibility the first call to |
| 1169 |
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an |
| 1170 |
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
| 1171 |
AC_DEFUN([PKG_CHECK_MODULES], |
| 1172 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1173 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
| 1174 |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
| 1175 |
|
| 1176 |
pkg_failed=no |
| 1177 |
AC_MSG_CHECKING([for $2]) |
| 1178 |
|
| 1179 |
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
| 1180 |
_PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
| 1181 |
|
| 1182 |
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
| 1183 |
and $1[]_LIBS to avoid the need to call pkg-config. |
| 1184 |
See the pkg-config man page for more details.]) |
| 1185 |
|
| 1186 |
if test $pkg_failed = yes; then |
| 1187 |
AC_MSG_RESULT([no]) |
| 1188 |
_PKG_SHORT_ERRORS_SUPPORTED |
| 1189 |
if test $_pkg_short_errors_supported = yes; then |
| 1190 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` |
| 1191 |
else |
| 1192 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` |
| 1193 |
fi |
| 1194 |
# Put the nasty error message in config.log where it belongs |
| 1195 |
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
| 1196 |
|
| 1197 |
m4_default([$4], [AC_MSG_ERROR( |
| 1198 |
[Package requirements ($2) were not met: |
| 1199 |
|
| 1200 |
$$1_PKG_ERRORS |
| 1201 |
|
| 1202 |
Consider adjusting the PKG_CONFIG_PATH environment variable if you |
| 1203 |
installed software in a non-standard prefix. |
| 1204 |
|
| 1205 |
_PKG_TEXT])[]dnl |
| 1206 |
]) |
| 1207 |
elif test $pkg_failed = untried; then |
| 1208 |
AC_MSG_RESULT([no]) |
| 1209 |
m4_default([$4], [AC_MSG_FAILURE( |
| 1210 |
[The pkg-config script could not be found or is too old. Make sure it |
| 1211 |
is in your PATH or set the PKG_CONFIG environment variable to the full |
| 1212 |
path to pkg-config. |
| 1213 |
|
| 1214 |
_PKG_TEXT |
| 1215 |
|
| 1216 |
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl |
| 1217 |
]) |
| 1218 |
else |
| 1219 |
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
| 1220 |
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
| 1221 |
AC_MSG_RESULT([yes]) |
| 1222 |
$3 |
| 1223 |
fi[]dnl |
| 1224 |
])dnl PKG_CHECK_MODULES |
| 1225 |
|
| 1226 |
|
| 1227 |
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 1228 |
dnl [ACTION-IF-NOT-FOUND]) |
| 1229 |
dnl --------------------------------------------------------------------- |
| 1230 |
dnl Since: 0.29 |
| 1231 |
dnl |
| 1232 |
dnl Checks for existence of MODULES and gathers its build flags with |
| 1233 |
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags |
| 1234 |
dnl and VARIABLE-PREFIX_LIBS from --libs. |
| 1235 |
dnl |
| 1236 |
dnl Note that if there is a possibility the first call to |
| 1237 |
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to |
| 1238 |
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your |
| 1239 |
dnl configure.ac. |
| 1240 |
AC_DEFUN([PKG_CHECK_MODULES_STATIC], |
| 1241 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1242 |
_save_PKG_CONFIG=$PKG_CONFIG |
| 1243 |
PKG_CONFIG="$PKG_CONFIG --static" |
| 1244 |
PKG_CHECK_MODULES($@) |
| 1245 |
PKG_CONFIG=$_save_PKG_CONFIG[]dnl |
| 1246 |
])dnl PKG_CHECK_MODULES_STATIC |
| 1247 |
|
| 1248 |
|
| 1249 |
dnl PKG_INSTALLDIR([DIRECTORY]) |
| 1250 |
dnl ------------------------- |
| 1251 |
dnl Since: 0.27 |
| 1252 |
dnl |
| 1253 |
dnl Substitutes the variable pkgconfigdir as the location where a module |
| 1254 |
dnl should install pkg-config .pc files. By default the directory is |
| 1255 |
dnl $libdir/pkgconfig, but the default can be changed by passing |
| 1256 |
dnl DIRECTORY. The user can override through the --with-pkgconfigdir |
| 1257 |
dnl parameter. |
| 1258 |
AC_DEFUN([PKG_INSTALLDIR], |
| 1259 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) |
| 1260 |
m4_pushdef([pkg_description], |
| 1261 |
[pkg-config installation directory @<:@]pkg_default[@:>@]) |
| 1262 |
AC_ARG_WITH([pkgconfigdir], |
| 1263 |
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, |
| 1264 |
[with_pkgconfigdir=]pkg_default) |
| 1265 |
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) |
| 1266 |
m4_popdef([pkg_default]) |
| 1267 |
m4_popdef([pkg_description]) |
| 1268 |
])dnl PKG_INSTALLDIR |
| 1269 |
|
| 1270 |
|
| 1271 |
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) |
| 1272 |
dnl -------------------------------- |
| 1273 |
dnl Since: 0.27 |
| 1274 |
dnl |
| 1275 |
dnl Substitutes the variable noarch_pkgconfigdir as the location where a |
| 1276 |
dnl module should install arch-independent pkg-config .pc files. By |
| 1277 |
dnl default the directory is $datadir/pkgconfig, but the default can be |
| 1278 |
dnl changed by passing DIRECTORY. The user can override through the |
| 1279 |
dnl --with-noarch-pkgconfigdir parameter. |
| 1280 |
AC_DEFUN([PKG_NOARCH_INSTALLDIR], |
| 1281 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) |
| 1282 |
m4_pushdef([pkg_description], |
| 1283 |
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) |
| 1284 |
AC_ARG_WITH([noarch-pkgconfigdir], |
| 1285 |
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, |
| 1286 |
[with_noarch_pkgconfigdir=]pkg_default) |
| 1287 |
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) |
| 1288 |
m4_popdef([pkg_default]) |
| 1289 |
m4_popdef([pkg_description]) |
| 1290 |
])dnl PKG_NOARCH_INSTALLDIR |
| 1291 |
|
| 1292 |
|
| 1293 |
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, |
| 1294 |
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 1295 |
dnl ------------------------------------------- |
| 1296 |
dnl Since: 0.28 |
| 1297 |
dnl |
| 1298 |
dnl Retrieves the value of the pkg-config variable for the given module. |
| 1299 |
AC_DEFUN([PKG_CHECK_VAR], |
| 1300 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1301 |
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl |
| 1302 |
|
| 1303 |
_PKG_CONFIG([$1], [variable="][$3]["], [$2]) |
| 1304 |
AS_VAR_COPY([$1], [pkg_cv_][$1]) |
| 1305 |
|
| 1306 |
AS_VAR_IF([$1], [""], [$5], [$4])dnl |
| 1307 |
])dnl PKG_CHECK_VAR |
| 1308 |
|
| 1309 |
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1310 |
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], |
| 1311 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1312 |
dnl ------------------------------------------ |
| 1313 |
dnl |
| 1314 |
dnl Prepare a "--with-" configure option using the lowercase |
| 1315 |
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and |
| 1316 |
dnl PKG_CHECK_MODULES in a single macro. |
| 1317 |
AC_DEFUN([PKG_WITH_MODULES], |
| 1318 |
[ |
| 1319 |
m4_pushdef([with_arg], m4_tolower([$1])) |
| 1320 |
|
| 1321 |
m4_pushdef([description], |
| 1322 |
[m4_default([$5], [build with ]with_arg[ support])]) |
| 1323 |
|
| 1324 |
m4_pushdef([def_arg], [m4_default([$6], [auto])]) |
| 1325 |
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) |
| 1326 |
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) |
| 1327 |
|
| 1328 |
m4_case(def_arg, |
| 1329 |
[yes],[m4_pushdef([with_without], [--without-]with_arg)], |
| 1330 |
[m4_pushdef([with_without],[--with-]with_arg)]) |
| 1331 |
|
| 1332 |
AC_ARG_WITH(with_arg, |
| 1333 |
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, |
| 1334 |
[AS_TR_SH([with_]with_arg)=def_arg]) |
| 1335 |
|
| 1336 |
AS_CASE([$AS_TR_SH([with_]with_arg)], |
| 1337 |
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], |
| 1338 |
[auto],[PKG_CHECK_MODULES([$1],[$2], |
| 1339 |
[m4_n([def_action_if_found]) $3], |
| 1340 |
[m4_n([def_action_if_not_found]) $4])]) |
| 1341 |
|
| 1342 |
m4_popdef([with_arg]) |
| 1343 |
m4_popdef([description]) |
| 1344 |
m4_popdef([def_arg]) |
| 1345 |
|
| 1346 |
])dnl PKG_WITH_MODULES |
| 1347 |
|
| 1348 |
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1349 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1350 |
dnl ----------------------------------------------- |
| 1351 |
dnl |
| 1352 |
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES |
| 1353 |
dnl check._[VARIABLE-PREFIX] is exported as make variable. |
| 1354 |
AC_DEFUN([PKG_HAVE_WITH_MODULES], |
| 1355 |
[ |
| 1356 |
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) |
| 1357 |
|
| 1358 |
AM_CONDITIONAL([HAVE_][$1], |
| 1359 |
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) |
| 1360 |
])dnl PKG_HAVE_WITH_MODULES |
| 1361 |
|
| 1362 |
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1363 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1364 |
dnl ------------------------------------------------------ |
| 1365 |
dnl |
| 1366 |
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after |
| 1367 |
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make |
| 1368 |
dnl and preprocessor variable. |
| 1369 |
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], |
| 1370 |
[ |
| 1371 |
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) |
| 1372 |
|
| 1373 |
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], |
| 1374 |
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) |
| 1375 |
])dnl PKG_HAVE_DEFINE_WITH_MODULES |
| 1376 |
|
| 1377 |
# Copyright (C) 2002-2021 Free Software Foundation, Inc. |
| 1378 |
# |
| 1379 |
# This file is free software; the Free Software Foundation |
| 1380 |
# gives unlimited permission to copy and/or distribute it, |
| 1381 |
# with or without modifications, as long as this notice is preserved. |
| 1382 |
|
| 1383 |
# AM_AUTOMAKE_VERSION(VERSION) |
| 1384 |
# ---------------------------- |
| 1385 |
# Automake X.Y traces this macro to ensure aclocal.m4 has been |
| 1386 |
# generated from the m4 files accompanying Automake X.Y. |
| 1387 |
# (This private macro should not be called outside this file.) |
| 1388 |
AC_DEFUN([AM_AUTOMAKE_VERSION], |
| 1389 |
[am__api_version='1.16' |
| 1390 |
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
| 1391 |
dnl require some minimum version. Point them to the right macro. |
| 1392 |
m4_if([$1], [1.16.5], [], |
| 1393 |
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
| 1394 |
]) |
| 1395 |
|
| 1396 |
# _AM_AUTOCONF_VERSION(VERSION) |
| 1397 |
# ----------------------------- |
| 1398 |
# aclocal traces this macro to find the Autoconf version. |
| 1399 |
# This is a private macro too. Using m4_define simplifies |
| 1400 |
# the logic in aclocal, which can simply ignore this definition. |
| 1401 |
m4_define([_AM_AUTOCONF_VERSION], []) |
| 1402 |
|
| 1403 |
# AM_SET_CURRENT_AUTOMAKE_VERSION |
| 1404 |
# ------------------------------- |
| 1405 |
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
| 1406 |
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
| 1407 |
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
| 1408 |
[AM_AUTOMAKE_VERSION([1.16.5])dnl |
| 1409 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 1410 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 1411 |
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
| 1412 |
|
| 1413 |
# AM_AUX_DIR_EXPAND -*- Autoconf -*- |
| 1414 |
|
| 1415 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 1416 |
# |
| 1417 |
# This file is free software; the Free Software Foundation |
| 1418 |
# gives unlimited permission to copy and/or distribute it, |
| 1419 |
# with or without modifications, as long as this notice is preserved. |
| 1420 |
|
| 1421 |
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets |
| 1422 |
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to |
| 1423 |
# '$srcdir', '$srcdir/..', or '$srcdir/../..'. |
| 1424 |
# |
| 1425 |
# Of course, Automake must honor this variable whenever it calls a |
| 1426 |
# tool from the auxiliary directory. The problem is that $srcdir (and |
| 1427 |
# therefore $ac_aux_dir as well) can be either absolute or relative, |
| 1428 |
# depending on how configure is run. This is pretty annoying, since |
| 1429 |
# it makes $ac_aux_dir quite unusable in subdirectories: in the top |
| 1430 |
# source directory, any form will work fine, but in subdirectories a |
| 1431 |
# relative path needs to be adjusted first. |
| 1432 |
# |
| 1433 |
# $ac_aux_dir/missing |
| 1434 |
# fails when called from a subdirectory if $ac_aux_dir is relative |
| 1435 |
# $top_srcdir/$ac_aux_dir/missing |
| 1436 |
# fails if $ac_aux_dir is absolute, |
| 1437 |
# fails when called from a subdirectory in a VPATH build with |
| 1438 |
# a relative $ac_aux_dir |
| 1439 |
# |
| 1440 |
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir |
| 1441 |
# are both prefixed by $srcdir. In an in-source build this is usually |
| 1442 |
# harmless because $srcdir is '.', but things will broke when you |
| 1443 |
# start a VPATH build or use an absolute $srcdir. |
| 1444 |
# |
| 1445 |
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
| 1446 |
# iff we strip the leading $srcdir from $ac_aux_dir. That would be: |
| 1447 |
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` |
| 1448 |
# and then we would define $MISSING as |
| 1449 |
# MISSING="\${SHELL} $am_aux_dir/missing" |
| 1450 |
# This will work as long as MISSING is not called from configure, because |
| 1451 |
# unfortunately $(top_srcdir) has no meaning in configure. |
| 1452 |
# However there are other variables, like CC, which are often used in |
| 1453 |
# configure, and could therefore not use this "fixed" $ac_aux_dir. |
| 1454 |
# |
| 1455 |
# Another solution, used here, is to always expand $ac_aux_dir to an |
| 1456 |
# absolute PATH. The drawback is that using absolute paths prevent a |
| 1457 |
# configured tree to be moved without reconfiguration. |
| 1458 |
|
| 1459 |
AC_DEFUN([AM_AUX_DIR_EXPAND], |
| 1460 |
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl |
| 1461 |
# Expand $ac_aux_dir to an absolute path. |
| 1462 |
am_aux_dir=`cd "$ac_aux_dir" && pwd` |
| 1463 |
]) |
| 1464 |
|
| 1465 |
# AM_CONDITIONAL -*- Autoconf -*- |
| 1466 |
|
| 1467 |
# Copyright (C) 1997-2021 Free Software Foundation, Inc. |
| 1468 |
# |
| 1469 |
# This file is free software; the Free Software Foundation |
| 1470 |
# gives unlimited permission to copy and/or distribute it, |
| 1471 |
# with or without modifications, as long as this notice is preserved. |
| 1472 |
|
| 1473 |
# AM_CONDITIONAL(NAME, SHELL-CONDITION) |
| 1474 |
# ------------------------------------- |
| 1475 |
# Define a conditional. |
| 1476 |
AC_DEFUN([AM_CONDITIONAL], |
| 1477 |
[AC_PREREQ([2.52])dnl |
| 1478 |
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], |
| 1479 |
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl |
| 1480 |
AC_SUBST([$1_TRUE])dnl |
| 1481 |
AC_SUBST([$1_FALSE])dnl |
| 1482 |
_AM_SUBST_NOTMAKE([$1_TRUE])dnl |
| 1483 |
_AM_SUBST_NOTMAKE([$1_FALSE])dnl |
| 1484 |
m4_define([_AM_COND_VALUE_$1], [$2])dnl |
| 1485 |
if $2; then |
| 1486 |
$1_TRUE= |
| 1487 |
$1_FALSE='#' |
| 1488 |
else |
| 1489 |
$1_TRUE='#' |
| 1490 |
$1_FALSE= |
| 1491 |
fi |
| 1492 |
AC_CONFIG_COMMANDS_PRE( |
| 1493 |
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
| 1494 |
AC_MSG_ERROR([[conditional "$1" was never defined. |
| 1495 |
Usually this means the macro was only invoked conditionally.]]) |
| 1496 |
fi])]) |
| 1497 |
|
| 1498 |
# Copyright (C) 1999-2021 Free Software Foundation, Inc. |
| 1499 |
# |
| 1500 |
# This file is free software; the Free Software Foundation |
| 1501 |
# gives unlimited permission to copy and/or distribute it, |
| 1502 |
# with or without modifications, as long as this notice is preserved. |
| 1503 |
|
| 1504 |
|
| 1505 |
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be |
| 1506 |
# written in clear, in which case automake, when reading aclocal.m4, |
| 1507 |
# will think it sees a *use*, and therefore will trigger all it's |
| 1508 |
# C support machinery. Also note that it means that autoscan, seeing |
| 1509 |
# CC etc. in the Makefile, will ask for an AC_PROG_CC use... |
| 1510 |
|
| 1511 |
|
| 1512 |
# _AM_DEPENDENCIES(NAME) |
| 1513 |
# ---------------------- |
| 1514 |
# See how the compiler implements dependency checking. |
| 1515 |
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". |
| 1516 |
# We try a few techniques and use that to set a single cache variable. |
| 1517 |
# |
| 1518 |
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
| 1519 |
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular |
| 1520 |
# dependency, and given that the user is not expected to run this macro, |
| 1521 |
# just rely on AC_PROG_CC. |
| 1522 |
AC_DEFUN([_AM_DEPENDENCIES], |
| 1523 |
[AC_REQUIRE([AM_SET_DEPDIR])dnl |
| 1524 |
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl |
| 1525 |
AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
| 1526 |
AC_REQUIRE([AM_DEP_TRACK])dnl |
| 1527 |
|
| 1528 |
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], |
| 1529 |
[$1], [CXX], [depcc="$CXX" am_compiler_list=], |
| 1530 |
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], |
| 1531 |
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], |
| 1532 |
[$1], [UPC], [depcc="$UPC" am_compiler_list=], |
| 1533 |
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], |
| 1534 |
[depcc="$$1" am_compiler_list=]) |
| 1535 |
|
| 1536 |
AC_CACHE_CHECK([dependency style of $depcc], |
| 1537 |
[am_cv_$1_dependencies_compiler_type], |
| 1538 |
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then |
| 1539 |
# We make a subdir and do the tests there. Otherwise we can end up |
| 1540 |
# making bogus files that we don't know about and never remove. For |
| 1541 |
# instance it was reported that on HP-UX the gcc test will end up |
| 1542 |
# making a dummy file named 'D' -- because '-MD' means "put the output |
| 1543 |
# in D". |
| 1544 |
rm -rf conftest.dir |
| 1545 |
mkdir conftest.dir |
| 1546 |
# Copy depcomp to subdir because otherwise we won't find it if we're |
| 1547 |
# using a relative directory. |
| 1548 |
cp "$am_depcomp" conftest.dir |
| 1549 |
cd conftest.dir |
| 1550 |
# We will build objects and dependencies in a subdirectory because |
| 1551 |
# it helps to detect inapplicable dependency modes. For instance |
| 1552 |
# both Tru64's cc and ICC support -MD to output dependencies as a |
| 1553 |
# side effect of compilation, but ICC will put the dependencies in |
| 1554 |
# the current directory while Tru64 will put them in the object |
| 1555 |
# directory. |
| 1556 |
mkdir sub |
| 1557 |
|
| 1558 |
am_cv_$1_dependencies_compiler_type=none |
| 1559 |
if test "$am_compiler_list" = ""; then |
| 1560 |
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` |
| 1561 |
fi |
| 1562 |
am__universal=false |
| 1563 |
m4_case([$1], [CC], |
| 1564 |
[case " $depcc " in #( |
| 1565 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1566 |
esac], |
| 1567 |
[CXX], |
| 1568 |
[case " $depcc " in #( |
| 1569 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1570 |
esac]) |
| 1571 |
|
| 1572 |
for depmode in $am_compiler_list; do |
| 1573 |
# Setup a source with many dependencies, because some compilers |
| 1574 |
# like to wrap large dependency lists on column 80 (with \), and |
| 1575 |
# we should not choose a depcomp mode which is confused by this. |
| 1576 |
# |
| 1577 |
# We need to recreate these files for each test, as the compiler may |
| 1578 |
# overwrite some of them when testing with obscure command lines. |
| 1579 |
# This happens at least with the AIX C compiler. |
| 1580 |
: > sub/conftest.c |
| 1581 |
for i in 1 2 3 4 5 6; do |
| 1582 |
echo '#include "conftst'$i'.h"' >> sub/conftest.c |
| 1583 |
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
| 1584 |
# Solaris 10 /bin/sh. |
| 1585 |
echo '/* dummy */' > sub/conftst$i.h |
| 1586 |
done |
| 1587 |
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
| 1588 |
|
| 1589 |
# We check with '-c' and '-o' for the sake of the "dashmstdout" |
| 1590 |
# mode. It turns out that the SunPro C++ compiler does not properly |
| 1591 |
# handle '-M -o', and we need to detect this. Also, some Intel |
| 1592 |
# versions had trouble with output in subdirs. |
| 1593 |
am__obj=sub/conftest.${OBJEXT-o} |
| 1594 |
am__minus_obj="-o $am__obj" |
| 1595 |
case $depmode in |
| 1596 |
gcc) |
| 1597 |
# This depmode causes a compiler race in universal mode. |
| 1598 |
test "$am__universal" = false || continue |
| 1599 |
;; |
| 1600 |
nosideeffect) |
| 1601 |
# After this tag, mechanisms are not by side-effect, so they'll |
| 1602 |
# only be used when explicitly requested. |
| 1603 |
if test "x$enable_dependency_tracking" = xyes; then |
| 1604 |
continue |
| 1605 |
else |
| 1606 |
break |
| 1607 |
fi |
| 1608 |
;; |
| 1609 |
msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
| 1610 |
# This compiler won't grok '-c -o', but also, the minuso test has |
| 1611 |
# not run yet. These depmodes are late enough in the game, and |
| 1612 |
# so weak that their functioning should not be impacted. |
| 1613 |
am__obj=conftest.${OBJEXT-o} |
| 1614 |
am__minus_obj= |
| 1615 |
;; |
| 1616 |
none) break ;; |
| 1617 |
esac |
| 1618 |
if depmode=$depmode \ |
| 1619 |
source=sub/conftest.c object=$am__obj \ |
| 1620 |
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ |
| 1621 |
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ |
| 1622 |
>/dev/null 2>conftest.err && |
| 1623 |
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && |
| 1624 |
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && |
| 1625 |
grep $am__obj sub/conftest.Po > /dev/null 2>&1 && |
| 1626 |
${MAKE-make} -s -f confmf > /dev/null 2>&1; then |
| 1627 |
# icc doesn't choke on unknown options, it will just issue warnings |
| 1628 |
# or remarks (even with -Werror). So we grep stderr for any message |
| 1629 |
# that says an option was ignored or not supported. |
| 1630 |
# When given -MP, icc 7.0 and 7.1 complain thusly: |
| 1631 |
# icc: Command line warning: ignoring option '-M'; no argument required |
| 1632 |
# The diagnosis changed in icc 8.0: |
| 1633 |
# icc: Command line remark: option '-MP' not supported |
| 1634 |
if (grep 'ignoring option' conftest.err || |
| 1635 |
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else |
| 1636 |
am_cv_$1_dependencies_compiler_type=$depmode |
| 1637 |
break |
| 1638 |
fi |
| 1639 |
fi |
| 1640 |
done |
| 1641 |
|
| 1642 |
cd .. |
| 1643 |
rm -rf conftest.dir |
| 1644 |
else |
| 1645 |
am_cv_$1_dependencies_compiler_type=none |
| 1646 |
fi |
| 1647 |
]) |
| 1648 |
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
| 1649 |
AM_CONDITIONAL([am__fastdep$1], [ |
| 1650 |
test "x$enable_dependency_tracking" != xno \ |
| 1651 |
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3]) |
| 1652 |
]) |
| 1653 |
|
| 1654 |
|
| 1655 |
# AM_SET_DEPDIR |
| 1656 |
# ------------- |
| 1657 |
# Choose a directory name for dependency files. |
| 1658 |
# This macro is AC_REQUIREd in _AM_DEPENDENCIES. |
| 1659 |
AC_DEFUN([AM_SET_DEPDIR], |
| 1660 |
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 1661 |
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
| 1662 |
]) |
| 1663 |
|
| 1664 |
|
| 1665 |
# AM_DEP_TRACK |
| 1666 |
# ------------ |
| 1667 |
AC_DEFUN([AM_DEP_TRACK], |
| 1668 |
[AC_ARG_ENABLE([dependency-tracking], [dnl |
| 1669 |
AS_HELP_STRING( |
| 1670 |
[--enable-dependency-tracking], |
| 1671 |
[do not reject slow dependency extractors]) |
| 1672 |
AS_HELP_STRING( |
| 1673 |
[--disable-dependency-tracking], |
| 1674 |
[speeds up one-time build])]) |
| 1675 |
if test "x$enable_dependency_tracking" != xno; then |
| 1676 |
am_depcomp="$ac_aux_dir/depcomp" |
| 1677 |
AMDEPBACKSLASH='\' |
| 1678 |
am__nodep='_no' |
| 1679 |
fi |
| 1680 |
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
| 1681 |
AC_SUBST([AMDEPBACKSLASH])dnl |
| 1682 |
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl |
| 1683 |
AC_SUBST([am__nodep])dnl |
| 1684 |
_AM_SUBST_NOTMAKE([am__nodep])dnl |
| 1685 |
]) |
| 1686 |
|
| 1687 |
# Generate code to set up dependency tracking. -*- Autoconf -*- |
| 1688 |
|
| 1689 |
# Copyright (C) 1999-2021 Free Software Foundation, Inc. |
| 1690 |
# |
| 1691 |
# This file is free software; the Free Software Foundation |
| 1692 |
# gives unlimited permission to copy and/or distribute it, |
| 1693 |
# with or without modifications, as long as this notice is preserved. |
| 1694 |
|
| 1695 |
# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1696 |
# ------------------------------ |
| 1697 |
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1698 |
[{ |
| 1699 |
# Older Autoconf quotes --file arguments for eval, but not when files |
| 1700 |
# are listed without --file. Let's play safe and only enable the eval |
| 1701 |
# if we detect the quoting. |
| 1702 |
# TODO: see whether this extra hack can be removed once we start |
| 1703 |
# requiring Autoconf 2.70 or later. |
| 1704 |
AS_CASE([$CONFIG_FILES], |
| 1705 |
[*\'*], [eval set x "$CONFIG_FILES"], |
| 1706 |
[*], [set x $CONFIG_FILES]) |
| 1707 |
shift |
| 1708 |
# Used to flag and report bootstrapping failures. |
| 1709 |
am_rc=0 |
| 1710 |
for am_mf |
| 1711 |
do |
| 1712 |
# Strip MF so we end up with the name of the file. |
| 1713 |
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` |
| 1714 |
# Check whether this is an Automake generated Makefile which includes |
| 1715 |
# dependency-tracking related rules and includes. |
| 1716 |
# Grep'ing the whole file directly is not great: AIX grep has a line |
| 1717 |
# limit of 2048, but all sed's we know have understand at least 4000. |
| 1718 |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ |
| 1719 |
|| continue |
| 1720 |
am_dirpart=`AS_DIRNAME(["$am_mf"])` |
| 1721 |
am_filepart=`AS_BASENAME(["$am_mf"])` |
| 1722 |
AM_RUN_LOG([cd "$am_dirpart" \ |
| 1723 |
&& sed -e '/# am--include-marker/d' "$am_filepart" \ |
| 1724 |
| $MAKE -f - am--depfiles]) || am_rc=$? |
| 1725 |
done |
| 1726 |
if test $am_rc -ne 0; then |
| 1727 |
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
| 1728 |
for automatic dependency tracking. If GNU make was not used, consider |
| 1729 |
re-running the configure script with MAKE="gmake" (or whatever is |
| 1730 |
necessary). You can also try re-running configure with the |
| 1731 |
'--disable-dependency-tracking' option to at least be able to build |
| 1732 |
the package (albeit without support for automatic dependency tracking).]) |
| 1733 |
fi |
| 1734 |
AS_UNSET([am_dirpart]) |
| 1735 |
AS_UNSET([am_filepart]) |
| 1736 |
AS_UNSET([am_mf]) |
| 1737 |
AS_UNSET([am_rc]) |
| 1738 |
rm -f conftest-deps.mk |
| 1739 |
} |
| 1740 |
])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1741 |
|
| 1742 |
|
| 1743 |
# AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1744 |
# ----------------------------- |
| 1745 |
# This macro should only be invoked once -- use via AC_REQUIRE. |
| 1746 |
# |
| 1747 |
# This code is only required when automatic dependency tracking is enabled. |
| 1748 |
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in |
| 1749 |
# order to bootstrap the dependency handling code. |
| 1750 |
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1751 |
[AC_CONFIG_COMMANDS([depfiles], |
| 1752 |
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1753 |
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) |
| 1754 |
|
| 1755 |
# AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*- |
| 1756 |
|
| 1757 |
# Copyright (C) 2012-2021 Free Software Foundation, Inc. |
| 1758 |
# |
| 1759 |
# This file is free software; the Free Software Foundation |
| 1760 |
# gives unlimited permission to copy and/or distribute it, |
| 1761 |
# with or without modifications, as long as this notice is preserved. |
| 1762 |
|
| 1763 |
# AM_EXTRA_RECURSIVE_TARGETS |
| 1764 |
# -------------------------- |
| 1765 |
# Define the list of user recursive targets. This macro exists only to |
| 1766 |
# be traced by Automake, which will ensure that a proper definition of |
| 1767 |
# user-defined recursive targets (and associated rules) is propagated |
| 1768 |
# into all the generated Makefiles. |
| 1769 |
# TODO: We should really reject non-literal arguments here... |
| 1770 |
AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], []) |
| 1771 |
|
| 1772 |
# Do all the work for Automake. -*- Autoconf -*- |
| 1773 |
|
| 1774 |
# Copyright (C) 1996-2021 Free Software Foundation, Inc. |
| 1775 |
# |
| 1776 |
# This file is free software; the Free Software Foundation |
| 1777 |
# gives unlimited permission to copy and/or distribute it, |
| 1778 |
# with or without modifications, as long as this notice is preserved. |
| 1779 |
|
| 1780 |
# This macro actually does too much. Some checks are only needed if |
| 1781 |
# your package does certain things. But this isn't really a big deal. |
| 1782 |
|
| 1783 |
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. |
| 1784 |
m4_define([AC_PROG_CC], |
| 1785 |
m4_defn([AC_PROG_CC]) |
| 1786 |
[_AM_PROG_CC_C_O |
| 1787 |
]) |
| 1788 |
|
| 1789 |
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) |
| 1790 |
# AM_INIT_AUTOMAKE([OPTIONS]) |
| 1791 |
# ----------------------------------------------- |
| 1792 |
# The call with PACKAGE and VERSION arguments is the old style |
| 1793 |
# call (pre autoconf-2.50), which is being phased out. PACKAGE |
| 1794 |
# and VERSION should now be passed to AC_INIT and removed from |
| 1795 |
# the call to AM_INIT_AUTOMAKE. |
| 1796 |
# We support both call styles for the transition. After |
| 1797 |
# the next Automake release, Autoconf can make the AC_INIT |
| 1798 |
# arguments mandatory, and then we can depend on a new Autoconf |
| 1799 |
# release and drop the old call support. |
| 1800 |
AC_DEFUN([AM_INIT_AUTOMAKE], |
| 1801 |
[AC_PREREQ([2.65])dnl |
| 1802 |
m4_ifdef([_$0_ALREADY_INIT], |
| 1803 |
[m4_fatal([$0 expanded multiple times |
| 1804 |
]m4_defn([_$0_ALREADY_INIT]))], |
| 1805 |
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl |
| 1806 |
dnl Autoconf wants to disallow AM_ names. We explicitly allow |
| 1807 |
dnl the ones we care about. |
| 1808 |
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
| 1809 |
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
| 1810 |
AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 1811 |
if test "`cd $srcdir && pwd`" != "`pwd`"; then |
| 1812 |
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output |
| 1813 |
# is not polluted with repeated "-I." |
| 1814 |
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl |
| 1815 |
# test to see if srcdir already configured |
| 1816 |
if test -f $srcdir/config.status; then |
| 1817 |
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
| 1818 |
fi |
| 1819 |
fi |
| 1820 |
|
| 1821 |
# test whether we have cygpath |
| 1822 |
if test -z "$CYGPATH_W"; then |
| 1823 |
if (cygpath --version) >/dev/null 2>/dev/null; then |
| 1824 |
CYGPATH_W='cygpath -w' |
| 1825 |
else |
| 1826 |
CYGPATH_W=echo |
| 1827 |
fi |
| 1828 |
fi |
| 1829 |
AC_SUBST([CYGPATH_W]) |
| 1830 |
|
| 1831 |
# Define the identity of the package. |
| 1832 |
dnl Distinguish between old-style and new-style calls. |
| 1833 |
m4_ifval([$2], |
| 1834 |
[AC_DIAGNOSE([obsolete], |
| 1835 |
[$0: two- and three-arguments forms are deprecated.]) |
| 1836 |
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
| 1837 |
AC_SUBST([PACKAGE], [$1])dnl |
| 1838 |
AC_SUBST([VERSION], [$2])], |
| 1839 |
[_AM_SET_OPTIONS([$1])dnl |
| 1840 |
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
| 1841 |
m4_if( |
| 1842 |
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), |
| 1843 |
[ok:ok],, |
| 1844 |
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl |
| 1845 |
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
| 1846 |
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
| 1847 |
|
| 1848 |
_AM_IF_OPTION([no-define],, |
| 1849 |
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) |
| 1850 |
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl |
| 1851 |
|
| 1852 |
# Some tools Automake needs. |
| 1853 |
AC_REQUIRE([AM_SANITY_CHECK])dnl |
| 1854 |
AC_REQUIRE([AC_ARG_PROGRAM])dnl |
| 1855 |
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) |
| 1856 |
AM_MISSING_PROG([AUTOCONF], [autoconf]) |
| 1857 |
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) |
| 1858 |
AM_MISSING_PROG([AUTOHEADER], [autoheader]) |
| 1859 |
AM_MISSING_PROG([MAKEINFO], [makeinfo]) |
| 1860 |
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 1861 |
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
| 1862 |
AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
| 1863 |
# For better backward compatibility. To be removed once Automake 1.9.x |
| 1864 |
# dies out for good. For more background, see: |
| 1865 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
| 1866 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
| 1867 |
AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
| 1868 |
# We need awk for the "check" target (and possibly the TAP driver). The |
| 1869 |
# system "awk" is bad on some platforms. |
| 1870 |
AC_REQUIRE([AC_PROG_AWK])dnl |
| 1871 |
AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
| 1872 |
AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 1873 |
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
| 1874 |
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
| 1875 |
[_AM_PROG_TAR([v7])])]) |
| 1876 |
_AM_IF_OPTION([no-dependencies],, |
| 1877 |
[AC_PROVIDE_IFELSE([AC_PROG_CC], |
| 1878 |
[_AM_DEPENDENCIES([CC])], |
| 1879 |
[m4_define([AC_PROG_CC], |
| 1880 |
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl |
| 1881 |
AC_PROVIDE_IFELSE([AC_PROG_CXX], |
| 1882 |
[_AM_DEPENDENCIES([CXX])], |
| 1883 |
[m4_define([AC_PROG_CXX], |
| 1884 |
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl |
| 1885 |
AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
| 1886 |
[_AM_DEPENDENCIES([OBJC])], |
| 1887 |
[m4_define([AC_PROG_OBJC], |
| 1888 |
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl |
| 1889 |
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], |
| 1890 |
[_AM_DEPENDENCIES([OBJCXX])], |
| 1891 |
[m4_define([AC_PROG_OBJCXX], |
| 1892 |
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl |
| 1893 |
]) |
| 1894 |
# Variables for tags utilities; see am/tags.am |
| 1895 |
if test -z "$CTAGS"; then |
| 1896 |
CTAGS=ctags |
| 1897 |
fi |
| 1898 |
AC_SUBST([CTAGS]) |
| 1899 |
if test -z "$ETAGS"; then |
| 1900 |
ETAGS=etags |
| 1901 |
fi |
| 1902 |
AC_SUBST([ETAGS]) |
| 1903 |
if test -z "$CSCOPE"; then |
| 1904 |
CSCOPE=cscope |
| 1905 |
fi |
| 1906 |
AC_SUBST([CSCOPE]) |
| 1907 |
|
| 1908 |
AC_REQUIRE([AM_SILENT_RULES])dnl |
| 1909 |
dnl The testsuite driver may need to know about EXEEXT, so add the |
| 1910 |
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This |
| 1911 |
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. |
| 1912 |
AC_CONFIG_COMMANDS_PRE(dnl |
| 1913 |
[m4_provide_if([_AM_COMPILER_EXEEXT], |
| 1914 |
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
| 1915 |
|
| 1916 |
# POSIX will say in a future version that running "rm -f" with no argument |
| 1917 |
# is OK; and we want to be able to make that assumption in our Makefile |
| 1918 |
# recipes. So use an aggressive probe to check that the usage we want is |
| 1919 |
# actually supported "in the wild" to an acceptable degree. |
| 1920 |
# See automake bug#10828. |
| 1921 |
# To make any issue more visible, cause the running configure to be aborted |
| 1922 |
# by default if the 'rm' program in use doesn't match our expectations; the |
| 1923 |
# user can still override this though. |
| 1924 |
if rm -f && rm -fr && rm -rf; then : OK; else |
| 1925 |
cat >&2 <<'END' |
| 1926 |
Oops! |
| 1927 |
|
| 1928 |
Your 'rm' program seems unable to run without file operands specified |
| 1929 |
on the command line, even when the '-f' option is present. This is contrary |
| 1930 |
to the behaviour of most rm programs out there, and not conforming with |
| 1931 |
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> |
| 1932 |
|
| 1933 |
Please tell [email protected] about your system, including the value |
| 1934 |
of your $PATH and any error possibly output before this message. This |
| 1935 |
can help us improve future automake versions. |
| 1936 |
|
| 1937 |
END |
| 1938 |
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then |
| 1939 |
echo 'Configuration will proceed anyway, since you have set the' >&2 |
| 1940 |
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 |
| 1941 |
echo >&2 |
| 1942 |
else |
| 1943 |
cat >&2 <<'END' |
| 1944 |
Aborting the configuration process, to ensure you take notice of the issue. |
| 1945 |
|
| 1946 |
You can download and install GNU coreutils to get an 'rm' implementation |
| 1947 |
that behaves properly: <https://www.gnu.org/software/coreutils/>. |
| 1948 |
|
| 1949 |
If you want to complete the configuration process using your problematic |
| 1950 |
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM |
| 1951 |
to "yes", and re-run configure. |
| 1952 |
|
| 1953 |
END |
| 1954 |
AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) |
| 1955 |
fi |
| 1956 |
fi |
| 1957 |
dnl The trailing newline in this macro's definition is deliberate, for |
| 1958 |
dnl backward compatibility and to allow trailing 'dnl'-style comments |
| 1959 |
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. |
| 1960 |
]) |
| 1961 |
|
| 1962 |
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
| 1963 |
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
| 1964 |
dnl mangled by Autoconf and run in a shell conditional statement. |
| 1965 |
m4_define([_AC_COMPILER_EXEEXT], |
| 1966 |
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) |
| 1967 |
|
| 1968 |
# When config.status generates a header, we must update the stamp-h file. |
| 1969 |
# This file resides in the same directory as the config header |
| 1970 |
# that is generated. The stamp files are numbered to have different names. |
| 1971 |
|
| 1972 |
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the |
| 1973 |
# loop where config.status creates the headers, so we can generate |
| 1974 |
# our stamp files there. |
| 1975 |
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
| 1976 |
[# Compute $1's index in $config_headers. |
| 1977 |
_am_arg=$1 |
| 1978 |
_am_stamp_count=1 |
| 1979 |
for _am_header in $config_headers :; do |
| 1980 |
case $_am_header in |
| 1981 |
$_am_arg | $_am_arg:* ) |
| 1982 |
break ;; |
| 1983 |
* ) |
| 1984 |
_am_stamp_count=`expr $_am_stamp_count + 1` ;; |
| 1985 |
esac |
| 1986 |
done |
| 1987 |
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
| 1988 |
|
| 1989 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 1990 |
# |
| 1991 |
# This file is free software; the Free Software Foundation |
| 1992 |
# gives unlimited permission to copy and/or distribute it, |
| 1993 |
# with or without modifications, as long as this notice is preserved. |
| 1994 |
|
| 1995 |
# AM_PROG_INSTALL_SH |
| 1996 |
# ------------------ |
| 1997 |
# Define $install_sh. |
| 1998 |
AC_DEFUN([AM_PROG_INSTALL_SH], |
| 1999 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2000 |
if test x"${install_sh+set}" != xset; then |
| 2001 |
case $am_aux_dir in |
| 2002 |
*\ * | *\ *) |
| 2003 |
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
| 2004 |
*) |
| 2005 |
install_sh="\${SHELL} $am_aux_dir/install-sh" |
| 2006 |
esac |
| 2007 |
fi |
| 2008 |
AC_SUBST([install_sh])]) |
| 2009 |
|
| 2010 |
# Copyright (C) 2003-2021 Free Software Foundation, Inc. |
| 2011 |
# |
| 2012 |
# This file is free software; the Free Software Foundation |
| 2013 |
# gives unlimited permission to copy and/or distribute it, |
| 2014 |
# with or without modifications, as long as this notice is preserved. |
| 2015 |
|
| 2016 |
# Check whether the underlying file-system supports filenames |
| 2017 |
# with a leading dot. For instance MS-DOS doesn't. |
| 2018 |
AC_DEFUN([AM_SET_LEADING_DOT], |
| 2019 |
[rm -rf .tst 2>/dev/null |
| 2020 |
mkdir .tst 2>/dev/null |
| 2021 |
if test -d .tst; then |
| 2022 |
am__leading_dot=. |
| 2023 |
else |
| 2024 |
am__leading_dot=_ |
| 2025 |
fi |
| 2026 |
rmdir .tst 2>/dev/null |
| 2027 |
AC_SUBST([am__leading_dot])]) |
| 2028 |
|
| 2029 |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
| 2030 |
|
| 2031 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 2032 |
# |
| 2033 |
# This file is free software; the Free Software Foundation |
| 2034 |
# gives unlimited permission to copy and/or distribute it, |
| 2035 |
# with or without modifications, as long as this notice is preserved. |
| 2036 |
|
| 2037 |
# AM_MAKE_INCLUDE() |
| 2038 |
# ----------------- |
| 2039 |
# Check whether make has an 'include' directive that can support all |
| 2040 |
# the idioms we need for our automatic dependency tracking code. |
| 2041 |
AC_DEFUN([AM_MAKE_INCLUDE], |
| 2042 |
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) |
| 2043 |
cat > confinc.mk << 'END' |
| 2044 |
am__doit: |
| 2045 |
@echo this is the am__doit target >confinc.out |
| 2046 |
.PHONY: am__doit |
| 2047 |
END |
| 2048 |
am__include="#" |
| 2049 |
am__quote= |
| 2050 |
# BSD make does it like this. |
| 2051 |
echo '.include "confinc.mk" # ignored' > confmf.BSD |
| 2052 |
# Other make implementations (GNU, Solaris 10, AIX) do it like this. |
| 2053 |
echo 'include confinc.mk # ignored' > confmf.GNU |
| 2054 |
_am_result=no |
| 2055 |
for s in GNU BSD; do |
| 2056 |
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) |
| 2057 |
AS_CASE([$?:`cat confinc.out 2>/dev/null`], |
| 2058 |
['0:this is the am__doit target'], |
| 2059 |
[AS_CASE([$s], |
| 2060 |
[BSD], [am__include='.include' am__quote='"'], |
| 2061 |
[am__include='include' am__quote=''])]) |
| 2062 |
if test "$am__include" != "#"; then |
| 2063 |
_am_result="yes ($s style)" |
| 2064 |
break |
| 2065 |
fi |
| 2066 |
done |
| 2067 |
rm -f confinc.* confmf.* |
| 2068 |
AC_MSG_RESULT([${_am_result}]) |
| 2069 |
AC_SUBST([am__include])]) |
| 2070 |
AC_SUBST([am__quote])]) |
| 2071 |
|
| 2072 |
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
| 2073 |
|
| 2074 |
# Copyright (C) 1997-2021 Free Software Foundation, Inc. |
| 2075 |
# |
| 2076 |
# This file is free software; the Free Software Foundation |
| 2077 |
# gives unlimited permission to copy and/or distribute it, |
| 2078 |
# with or without modifications, as long as this notice is preserved. |
| 2079 |
|
| 2080 |
# AM_MISSING_PROG(NAME, PROGRAM) |
| 2081 |
# ------------------------------ |
| 2082 |
AC_DEFUN([AM_MISSING_PROG], |
| 2083 |
[AC_REQUIRE([AM_MISSING_HAS_RUN]) |
| 2084 |
$1=${$1-"${am_missing_run}$2"} |
| 2085 |
AC_SUBST($1)]) |
| 2086 |
|
| 2087 |
# AM_MISSING_HAS_RUN |
| 2088 |
# ------------------ |
| 2089 |
# Define MISSING if not defined so far and test if it is modern enough. |
| 2090 |
# If it is, set am_missing_run to use it, otherwise, to nothing. |
| 2091 |
AC_DEFUN([AM_MISSING_HAS_RUN], |
| 2092 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2093 |
AC_REQUIRE_AUX_FILE([missing])dnl |
| 2094 |
if test x"${MISSING+set}" != xset; then |
| 2095 |
MISSING="\${SHELL} '$am_aux_dir/missing'" |
| 2096 |
fi |
| 2097 |
# Use eval to expand $SHELL |
| 2098 |
if eval "$MISSING --is-lightweight"; then |
| 2099 |
am_missing_run="$MISSING " |
| 2100 |
else |
| 2101 |
am_missing_run= |
| 2102 |
AC_MSG_WARN(['missing' script is too old or missing]) |
| 2103 |
fi |
| 2104 |
]) |
| 2105 |
|
| 2106 |
# -*- Autoconf -*- |
| 2107 |
# Obsolete and "removed" macros, that must however still report explicit |
| 2108 |
# error messages when used, to smooth transition. |
| 2109 |
# |
| 2110 |
# Copyright (C) 1996-2021 Free Software Foundation, Inc. |
| 2111 |
# |
| 2112 |
# This file is free software; the Free Software Foundation |
| 2113 |
# gives unlimited permission to copy and/or distribute it, |
| 2114 |
# with or without modifications, as long as this notice is preserved. |
| 2115 |
|
| 2116 |
AC_DEFUN([AM_CONFIG_HEADER], |
| 2117 |
[AC_DIAGNOSE([obsolete], |
| 2118 |
['$0': this macro is obsolete. |
| 2119 |
You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl |
| 2120 |
AC_CONFIG_HEADERS($@)]) |
| 2121 |
|
| 2122 |
AC_DEFUN([AM_PROG_CC_STDC], |
| 2123 |
[AC_PROG_CC |
| 2124 |
am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc |
| 2125 |
AC_DIAGNOSE([obsolete], |
| 2126 |
['$0': this macro is obsolete. |
| 2127 |
You should simply use the 'AC][_PROG_CC' macro instead. |
| 2128 |
Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', |
| 2129 |
but upon 'ac_cv_prog_cc_stdc'.])]) |
| 2130 |
|
| 2131 |
AC_DEFUN([AM_C_PROTOTYPES], |
| 2132 |
[AC_FATAL([automatic de-ANSI-fication support has been removed])]) |
| 2133 |
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) |
| 2134 |
|
| 2135 |
# Helper functions for option handling. -*- Autoconf -*- |
| 2136 |
|
| 2137 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 2138 |
# |
| 2139 |
# This file is free software; the Free Software Foundation |
| 2140 |
# gives unlimited permission to copy and/or distribute it, |
| 2141 |
# with or without modifications, as long as this notice is preserved. |
| 2142 |
|
| 2143 |
# _AM_MANGLE_OPTION(NAME) |
| 2144 |
# ----------------------- |
| 2145 |
AC_DEFUN([_AM_MANGLE_OPTION], |
| 2146 |
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) |
| 2147 |
|
| 2148 |
# _AM_SET_OPTION(NAME) |
| 2149 |
# -------------------- |
| 2150 |
# Set option NAME. Presently that only means defining a flag for this option. |
| 2151 |
AC_DEFUN([_AM_SET_OPTION], |
| 2152 |
[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) |
| 2153 |
|
| 2154 |
# _AM_SET_OPTIONS(OPTIONS) |
| 2155 |
# ------------------------ |
| 2156 |
# OPTIONS is a space-separated list of Automake options. |
| 2157 |
AC_DEFUN([_AM_SET_OPTIONS], |
| 2158 |
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) |
| 2159 |
|
| 2160 |
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) |
| 2161 |
# ------------------------------------------- |
| 2162 |
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. |
| 2163 |
AC_DEFUN([_AM_IF_OPTION], |
| 2164 |
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
| 2165 |
|
| 2166 |
# Copyright (C) 1999-2021 Free Software Foundation, Inc. |
| 2167 |
# |
| 2168 |
# This file is free software; the Free Software Foundation |
| 2169 |
# gives unlimited permission to copy and/or distribute it, |
| 2170 |
# with or without modifications, as long as this notice is preserved. |
| 2171 |
|
| 2172 |
# _AM_PROG_CC_C_O |
| 2173 |
# --------------- |
| 2174 |
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC |
| 2175 |
# to automatically call this. |
| 2176 |
AC_DEFUN([_AM_PROG_CC_C_O], |
| 2177 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2178 |
AC_REQUIRE_AUX_FILE([compile])dnl |
| 2179 |
AC_LANG_PUSH([C])dnl |
| 2180 |
AC_CACHE_CHECK( |
| 2181 |
[whether $CC understands -c and -o together], |
| 2182 |
[am_cv_prog_cc_c_o], |
| 2183 |
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) |
| 2184 |
# Make sure it works both with $CC and with simple cc. |
| 2185 |
# Following AC_PROG_CC_C_O, we do the test twice because some |
| 2186 |
# compilers refuse to overwrite an existing .o file with -o, |
| 2187 |
# though they will create one. |
| 2188 |
am_cv_prog_cc_c_o=yes |
| 2189 |
for am_i in 1 2; do |
| 2190 |
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ |
| 2191 |
&& test -f conftest2.$ac_objext; then |
| 2192 |
: OK |
| 2193 |
else |
| 2194 |
am_cv_prog_cc_c_o=no |
| 2195 |
break |
| 2196 |
fi |
| 2197 |
done |
| 2198 |
rm -f core conftest* |
| 2199 |
unset am_i]) |
| 2200 |
if test "$am_cv_prog_cc_c_o" != yes; then |
| 2201 |
# Losing compiler, so override with the script. |
| 2202 |
# FIXME: It is wrong to rewrite CC. |
| 2203 |
# But if we don't then we get into trouble of one sort or another. |
| 2204 |
# A longer-term fix would be to have automake use am__CC in this case, |
| 2205 |
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" |
| 2206 |
CC="$am_aux_dir/compile $CC" |
| 2207 |
fi |
| 2208 |
AC_LANG_POP([C])]) |
| 2209 |
|
| 2210 |
# For backward compatibility. |
| 2211 |
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
| 2212 |
|
| 2213 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 2214 |
# |
| 2215 |
# This file is free software; the Free Software Foundation |
| 2216 |
# gives unlimited permission to copy and/or distribute it, |
| 2217 |
# with or without modifications, as long as this notice is preserved. |
| 2218 |
|
| 2219 |
# AM_RUN_LOG(COMMAND) |
| 2220 |
# ------------------- |
| 2221 |
# Run COMMAND, save the exit status in ac_status, and log it. |
| 2222 |
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) |
| 2223 |
AC_DEFUN([AM_RUN_LOG], |
| 2224 |
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD |
| 2225 |
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD |
| 2226 |
ac_status=$? |
| 2227 |
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD |
| 2228 |
(exit $ac_status); }]) |
| 2229 |
|
| 2230 |
# Check to make sure that the build environment is sane. -*- Autoconf -*- |
| 2231 |
|
| 2232 |
# Copyright (C) 1996-2021 Free Software Foundation, Inc. |
| 2233 |
# |
| 2234 |
# This file is free software; the Free Software Foundation |
| 2235 |
# gives unlimited permission to copy and/or distribute it, |
| 2236 |
# with or without modifications, as long as this notice is preserved. |
| 2237 |
|
| 2238 |
# AM_SANITY_CHECK |
| 2239 |
# --------------- |
| 2240 |
AC_DEFUN([AM_SANITY_CHECK], |
| 2241 |
[AC_MSG_CHECKING([whether build environment is sane]) |
| 2242 |
# Reject unsafe characters in $srcdir or the absolute working directory |
| 2243 |
# name. Accept space and tab only in the latter. |
| 2244 |
am_lf=' |
| 2245 |
' |
| 2246 |
case `pwd` in |
| 2247 |
*[[\\\"\#\$\&\'\`$am_lf]]*) |
| 2248 |
AC_MSG_ERROR([unsafe absolute working directory name]);; |
| 2249 |
esac |
| 2250 |
case $srcdir in |
| 2251 |
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
| 2252 |
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; |
| 2253 |
esac |
| 2254 |
|
| 2255 |
# Do 'set' in a subshell so we don't clobber the current shell's |
| 2256 |
# arguments. Must try -L first in case configure is actually a |
| 2257 |
# symlink; some systems play weird games with the mod time of symlinks |
| 2258 |
# (eg FreeBSD returns the mod time of the symlink's containing |
| 2259 |
# directory). |
| 2260 |
if ( |
| 2261 |
am_has_slept=no |
| 2262 |
for am_try in 1 2; do |
| 2263 |
echo "timestamp, slept: $am_has_slept" > conftest.file |
| 2264 |
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` |
| 2265 |
if test "$[*]" = "X"; then |
| 2266 |
# -L didn't work. |
| 2267 |
set X `ls -t "$srcdir/configure" conftest.file` |
| 2268 |
fi |
| 2269 |
if test "$[*]" != "X $srcdir/configure conftest.file" \ |
| 2270 |
&& test "$[*]" != "X conftest.file $srcdir/configure"; then |
| 2271 |
|
| 2272 |
# If neither matched, then we have a broken ls. This can happen |
| 2273 |
# if, for instance, CONFIG_SHELL is bash and it inherits a |
| 2274 |
# broken ls alias from the environment. This has actually |
| 2275 |
# happened. Such a system could not be considered "sane". |
| 2276 |
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken |
| 2277 |
alias in your environment]) |
| 2278 |
fi |
| 2279 |
if test "$[2]" = conftest.file || test $am_try -eq 2; then |
| 2280 |
break |
| 2281 |
fi |
| 2282 |
# Just in case. |
| 2283 |
sleep 1 |
| 2284 |
am_has_slept=yes |
| 2285 |
done |
| 2286 |
test "$[2]" = conftest.file |
| 2287 |
) |
| 2288 |
then |
| 2289 |
# Ok. |
| 2290 |
: |
| 2291 |
else |
| 2292 |
AC_MSG_ERROR([newly created file is older than distributed files! |
| 2293 |
Check your system clock]) |
| 2294 |
fi |
| 2295 |
AC_MSG_RESULT([yes]) |
| 2296 |
# If we didn't sleep, we still need to ensure time stamps of config.status and |
| 2297 |
# generated files are strictly newer. |
| 2298 |
am_sleep_pid= |
| 2299 |
if grep 'slept: no' conftest.file >/dev/null 2>&1; then |
| 2300 |
( sleep 1 ) & |
| 2301 |
am_sleep_pid=$! |
| 2302 |
fi |
| 2303 |
AC_CONFIG_COMMANDS_PRE( |
| 2304 |
[AC_MSG_CHECKING([that generated files are newer than configure]) |
| 2305 |
if test -n "$am_sleep_pid"; then |
| 2306 |
# Hide warnings about reused PIDs. |
| 2307 |
wait $am_sleep_pid 2>/dev/null |
| 2308 |
fi |
| 2309 |
AC_MSG_RESULT([done])]) |
| 2310 |
rm -f conftest.file |
| 2311 |
]) |
| 2312 |
|
| 2313 |
# Copyright (C) 2009-2021 Free Software Foundation, Inc. |
| 2314 |
# |
| 2315 |
# This file is free software; the Free Software Foundation |
| 2316 |
# gives unlimited permission to copy and/or distribute it, |
| 2317 |
# with or without modifications, as long as this notice is preserved. |
| 2318 |
|
| 2319 |
# AM_SILENT_RULES([DEFAULT]) |
| 2320 |
# -------------------------- |
| 2321 |
# Enable less verbose build rules; with the default set to DEFAULT |
| 2322 |
# ("yes" being less verbose, "no" or empty being verbose). |
| 2323 |
AC_DEFUN([AM_SILENT_RULES], |
| 2324 |
[AC_ARG_ENABLE([silent-rules], [dnl |
| 2325 |
AS_HELP_STRING( |
| 2326 |
[--enable-silent-rules], |
| 2327 |
[less verbose build output (undo: "make V=1")]) |
| 2328 |
AS_HELP_STRING( |
| 2329 |
[--disable-silent-rules], |
| 2330 |
[verbose build output (undo: "make V=0")])dnl |
| 2331 |
]) |
| 2332 |
case $enable_silent_rules in @%:@ ((( |
| 2333 |
yes) AM_DEFAULT_VERBOSITY=0;; |
| 2334 |
no) AM_DEFAULT_VERBOSITY=1;; |
| 2335 |
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; |
| 2336 |
esac |
| 2337 |
dnl |
| 2338 |
dnl A few 'make' implementations (e.g., NonStop OS and NextStep) |
| 2339 |
dnl do not support nested variable expansions. |
| 2340 |
dnl See automake bug#9928 and bug#10237. |
| 2341 |
am_make=${MAKE-make} |
| 2342 |
AC_CACHE_CHECK([whether $am_make supports nested variables], |
| 2343 |
[am_cv_make_support_nested_variables], |
| 2344 |
[if AS_ECHO([['TRUE=$(BAR$(V)) |
| 2345 |
BAR0=false |
| 2346 |
BAR1=true |
| 2347 |
V=1 |
| 2348 |
am__doit: |
| 2349 |
@$(TRUE) |
| 2350 |
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then |
| 2351 |
am_cv_make_support_nested_variables=yes |
| 2352 |
else |
| 2353 |
am_cv_make_support_nested_variables=no |
| 2354 |
fi]) |
| 2355 |
if test $am_cv_make_support_nested_variables = yes; then |
| 2356 |
dnl Using '$V' instead of '$(V)' breaks IRIX make. |
| 2357 |
AM_V='$(V)' |
| 2358 |
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' |
| 2359 |
else |
| 2360 |
AM_V=$AM_DEFAULT_VERBOSITY |
| 2361 |
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY |
| 2362 |
fi |
| 2363 |
AC_SUBST([AM_V])dnl |
| 2364 |
AM_SUBST_NOTMAKE([AM_V])dnl |
| 2365 |
AC_SUBST([AM_DEFAULT_V])dnl |
| 2366 |
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl |
| 2367 |
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl |
| 2368 |
AM_BACKSLASH='\' |
| 2369 |
AC_SUBST([AM_BACKSLASH])dnl |
| 2370 |
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
| 2371 |
]) |
| 2372 |
|
| 2373 |
# Copyright (C) 2001-2021 Free Software Foundation, Inc. |
| 2374 |
# |
| 2375 |
# This file is free software; the Free Software Foundation |
| 2376 |
# gives unlimited permission to copy and/or distribute it, |
| 2377 |
# with or without modifications, as long as this notice is preserved. |
| 2378 |
|
| 2379 |
# AM_PROG_INSTALL_STRIP |
| 2380 |
# --------------------- |
| 2381 |
# One issue with vendor 'install' (even GNU) is that you can't |
| 2382 |
# specify the program used to strip binaries. This is especially |
| 2383 |
# annoying in cross-compiling environments, where the build's strip |
| 2384 |
# is unlikely to handle the host's binaries. |
| 2385 |
# Fortunately install-sh will honor a STRIPPROG variable, so we |
| 2386 |
# always use install-sh in "make install-strip", and initialize |
| 2387 |
# STRIPPROG with the value of the STRIP variable (set by the user). |
| 2388 |
AC_DEFUN([AM_PROG_INSTALL_STRIP], |
| 2389 |
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 2390 |
# Installed binaries are usually stripped using 'strip' when the user |
| 2391 |
# run "make install-strip". However 'strip' might not be the right |
| 2392 |
# tool to use in cross-compilation environments, therefore Automake |
| 2393 |
# will honor the 'STRIP' environment variable to overrule this program. |
| 2394 |
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. |
| 2395 |
if test "$cross_compiling" != no; then |
| 2396 |
AC_CHECK_TOOL([STRIP], [strip], :) |
| 2397 |
fi |
| 2398 |
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
| 2399 |
AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
| 2400 |
|
| 2401 |
# Copyright (C) 2006-2021 Free Software Foundation, Inc. |
| 2402 |
# |
| 2403 |
# This file is free software; the Free Software Foundation |
| 2404 |
# gives unlimited permission to copy and/or distribute it, |
| 2405 |
# with or without modifications, as long as this notice is preserved. |
| 2406 |
|
| 2407 |
# _AM_SUBST_NOTMAKE(VARIABLE) |
| 2408 |
# --------------------------- |
| 2409 |
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. |
| 2410 |
# This macro is traced by Automake. |
| 2411 |
AC_DEFUN([_AM_SUBST_NOTMAKE]) |
| 2412 |
|
| 2413 |
# AM_SUBST_NOTMAKE(VARIABLE) |
| 2414 |
# -------------------------- |
| 2415 |
# Public sister of _AM_SUBST_NOTMAKE. |
| 2416 |
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) |
| 2417 |
|
| 2418 |
# Check how to create a tarball. -*- Autoconf -*- |
| 2419 |
|
| 2420 |
# Copyright (C) 2004-2021 Free Software Foundation, Inc. |
| 2421 |
# |
| 2422 |
# This file is free software; the Free Software Foundation |
| 2423 |
# gives unlimited permission to copy and/or distribute it, |
| 2424 |
# with or without modifications, as long as this notice is preserved. |
| 2425 |
|
| 2426 |
# _AM_PROG_TAR(FORMAT) |
| 2427 |
# -------------------- |
| 2428 |
# Check how to create a tarball in format FORMAT. |
| 2429 |
# FORMAT should be one of 'v7', 'ustar', or 'pax'. |
| 2430 |
# |
| 2431 |
# Substitute a variable $(am__tar) that is a command |
| 2432 |
# writing to stdout a FORMAT-tarball containing the directory |
| 2433 |
# $tardir. |
| 2434 |
# tardir=directory && $(am__tar) > result.tar |
| 2435 |
# |
| 2436 |
# Substitute a variable $(am__untar) that extract such |
| 2437 |
# a tarball read from stdin. |
| 2438 |
# $(am__untar) < result.tar |
| 2439 |
# |
| 2440 |
AC_DEFUN([_AM_PROG_TAR], |
| 2441 |
[# Always define AMTAR for backward compatibility. Yes, it's still used |
| 2442 |
# in the wild :-( We should find a proper way to deprecate it ... |
| 2443 |
AC_SUBST([AMTAR], ['$${TAR-tar}']) |
| 2444 |
|
| 2445 |
# We'll loop over all known methods to create a tar archive until one works. |
| 2446 |
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
| 2447 |
|
| 2448 |
m4_if([$1], [v7], |
| 2449 |
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], |
| 2450 |
|
| 2451 |
[m4_case([$1], |
| 2452 |
[ustar], |
| 2453 |
[# The POSIX 1988 'ustar' format is defined with fixed-size fields. |
| 2454 |
# There is notably a 21 bits limit for the UID and the GID. In fact, |
| 2455 |
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 |
| 2456 |
# and bug#13588). |
| 2457 |
am_max_uid=2097151 # 2^21 - 1 |
| 2458 |
am_max_gid=$am_max_uid |
| 2459 |
# The $UID and $GID variables are not portable, so we need to resort |
| 2460 |
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls |
| 2461 |
# below are definitely unexpected, so allow the users to see them |
| 2462 |
# (that is, avoid stderr redirection). |
| 2463 |
am_uid=`id -u || echo unknown` |
| 2464 |
am_gid=`id -g || echo unknown` |
| 2465 |
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) |
| 2466 |
if test $am_uid -le $am_max_uid; then |
| 2467 |
AC_MSG_RESULT([yes]) |
| 2468 |
else |
| 2469 |
AC_MSG_RESULT([no]) |
| 2470 |
_am_tools=none |
| 2471 |
fi |
| 2472 |
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) |
| 2473 |
if test $am_gid -le $am_max_gid; then |
| 2474 |
AC_MSG_RESULT([yes]) |
| 2475 |
else |
| 2476 |
AC_MSG_RESULT([no]) |
| 2477 |
_am_tools=none |
| 2478 |
fi], |
| 2479 |
|
| 2480 |
[pax], |
| 2481 |
[], |
| 2482 |
|
| 2483 |
[m4_fatal([Unknown tar format])]) |
| 2484 |
|
| 2485 |
AC_MSG_CHECKING([how to create a $1 tar archive]) |
| 2486 |
|
| 2487 |
# Go ahead even if we have the value already cached. We do so because we |
| 2488 |
# need to set the values for the 'am__tar' and 'am__untar' variables. |
| 2489 |
_am_tools=${am_cv_prog_tar_$1-$_am_tools} |
| 2490 |
|
| 2491 |
for _am_tool in $_am_tools; do |
| 2492 |
case $_am_tool in |
| 2493 |
gnutar) |
| 2494 |
for _am_tar in tar gnutar gtar; do |
| 2495 |
AM_RUN_LOG([$_am_tar --version]) && break |
| 2496 |
done |
| 2497 |
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' |
| 2498 |
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' |
| 2499 |
am__untar="$_am_tar -xf -" |
| 2500 |
;; |
| 2501 |
plaintar) |
| 2502 |
# Must skip GNU tar: if it does not support --format= it doesn't create |
| 2503 |
# ustar tarball either. |
| 2504 |
(tar --version) >/dev/null 2>&1 && continue |
| 2505 |
am__tar='tar chf - "$$tardir"' |
| 2506 |
am__tar_='tar chf - "$tardir"' |
| 2507 |
am__untar='tar xf -' |
| 2508 |
;; |
| 2509 |
pax) |
| 2510 |
am__tar='pax -L -x $1 -w "$$tardir"' |
| 2511 |
am__tar_='pax -L -x $1 -w "$tardir"' |
| 2512 |
am__untar='pax -r' |
| 2513 |
;; |
| 2514 |
cpio) |
| 2515 |
am__tar='find "$$tardir" -print | cpio -o -H $1 -L' |
| 2516 |
am__tar_='find "$tardir" -print | cpio -o -H $1 -L' |
| 2517 |
am__untar='cpio -i -H $1 -d' |
| 2518 |
;; |
| 2519 |
none) |
| 2520 |
am__tar=false |
| 2521 |
am__tar_=false |
| 2522 |
am__untar=false |
| 2523 |
;; |
| 2524 |
esac |
| 2525 |
|
| 2526 |
# If the value was cached, stop now. We just wanted to have am__tar |
| 2527 |
# and am__untar set. |
| 2528 |
test -n "${am_cv_prog_tar_$1}" && break |
| 2529 |
|
| 2530 |
# tar/untar a dummy directory, and stop if the command works. |
| 2531 |
rm -rf conftest.dir |
| 2532 |
mkdir conftest.dir |
| 2533 |
echo GrepMe > conftest.dir/file |
| 2534 |
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) |
| 2535 |
rm -rf conftest.dir |
| 2536 |
if test -s conftest.tar; then |
| 2537 |
AM_RUN_LOG([$am__untar <conftest.tar]) |
| 2538 |
AM_RUN_LOG([cat conftest.dir/file]) |
| 2539 |
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break |
| 2540 |
fi |
| 2541 |
done |
| 2542 |
rm -rf conftest.dir |
| 2543 |
|
| 2544 |
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) |
| 2545 |
AC_MSG_RESULT([$am_cv_prog_tar_$1])]) |
| 2546 |
|
| 2547 |
AC_SUBST([am__tar]) |
| 2548 |
AC_SUBST([am__untar]) |
| 2549 |
]) # _AM_PROG_TAR |
| 2550 |
|
| 2551 |
m4_include([m4/libtool.m4]) |
| 2552 |
m4_include([m4/ltoptions.m4]) |
| 2553 |
m4_include([m4/ltsugar.m4]) |
| 2554 |
m4_include([m4/ltversion.m4]) |
| 2555 |
m4_include([m4/lt~obsolete.m4]) |