| 1 |
# generated automatically by aclocal 1.17 -*- Autoconf -*- |
| 2 |
|
| 3 |
# Copyright (C) 1996-2024 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
# This file is free software; the Free Software Foundation |
| 6 |
# gives unlimited permission to copy and/or distribute it, |
| 7 |
# with or without modifications, as long as this notice is preserved. |
| 8 |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
| 11 |
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 12 |
# PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) |
| 15 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 16 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 17 |
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, |
| 18 |
[m4_warning([this file was generated for autoconf 2.72. |
| 19 |
You have another version of autoconf. It may work, but is not guaranteed to. |
| 20 |
If you have problems, you may need to regenerate the build system entirely. |
| 21 |
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
| 22 |
|
| 23 |
# =========================================================================== |
| 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 |
# ============================================================================= |
| 1034 |
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html |
| 1035 |
# ============================================================================= |
| 1036 |
# |
| 1037 |
# SYNOPSIS |
| 1038 |
# |
| 1039 |
# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional]) |
| 1040 |
# |
| 1041 |
# DESCRIPTION |
| 1042 |
# |
| 1043 |
# Check for baseline language coverage in the compiler for the C++17 |
| 1044 |
# standard; if necessary, add switches to CXX and CXXCPP to enable |
| 1045 |
# support. |
| 1046 |
# |
| 1047 |
# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX |
| 1048 |
# macro with the version set to C++17. The two optional arguments are |
| 1049 |
# forwarded literally as the second and third argument respectively. |
| 1050 |
# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for |
| 1051 |
# more information. If you want to use this macro, you also need to |
| 1052 |
# download the ax_cxx_compile_stdcxx.m4 file. |
| 1053 |
# |
| 1054 |
# LICENSE |
| 1055 |
# |
| 1056 |
# Copyright (c) 2015 Moritz Klammler <[email protected]> |
| 1057 |
# Copyright (c) 2016 Krzesimir Nowak <[email protected]> |
| 1058 |
# |
| 1059 |
# Copying and distribution of this file, with or without modification, are |
| 1060 |
# permitted in any medium without royalty provided the copyright notice |
| 1061 |
# and this notice are preserved. This file is offered as-is, without any |
| 1062 |
# warranty. |
| 1063 |
|
| 1064 |
#serial 2 |
| 1065 |
|
| 1066 |
AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) |
| 1067 |
AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])]) |
| 1068 |
|
| 1069 |
dnl -*- mode: autoconf -*- |
| 1070 |
dnl Copyright 2009 Johan Dahlin |
| 1071 |
dnl |
| 1072 |
dnl This file is free software; the author(s) gives unlimited |
| 1073 |
dnl permission to copy and/or distribute it, with or without |
| 1074 |
dnl modifications, as long as this notice is preserved. |
| 1075 |
dnl |
| 1076 |
|
| 1077 |
# serial 1 |
| 1078 |
|
| 1079 |
dnl This is a copy of AS_AC_EXPAND |
| 1080 |
dnl |
| 1081 |
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org> |
| 1082 |
dnl Copying and distribution of this file, with or without modification, |
| 1083 |
dnl are permitted in any medium without royalty provided the copyright |
| 1084 |
dnl notice and this notice are preserved. |
| 1085 |
m4_define([_GOBJECT_INTROSPECTION_AS_AC_EXPAND], |
| 1086 |
[ |
| 1087 |
EXP_VAR=[$1] |
| 1088 |
FROM_VAR=[$2] |
| 1089 |
|
| 1090 |
dnl first expand prefix and exec_prefix if necessary |
| 1091 |
prefix_save=$prefix |
| 1092 |
exec_prefix_save=$exec_prefix |
| 1093 |
|
| 1094 |
dnl if no prefix given, then use /usr/local, the default prefix |
| 1095 |
if test "x$prefix" = "xNONE"; then |
| 1096 |
prefix="$ac_default_prefix" |
| 1097 |
fi |
| 1098 |
dnl if no exec_prefix given, then use prefix |
| 1099 |
if test "x$exec_prefix" = "xNONE"; then |
| 1100 |
exec_prefix=$prefix |
| 1101 |
fi |
| 1102 |
|
| 1103 |
full_var="$FROM_VAR" |
| 1104 |
dnl loop until it doesn't change anymore |
| 1105 |
while true; do |
| 1106 |
new_full_var="`eval echo $full_var`" |
| 1107 |
if test "x$new_full_var" = "x$full_var"; then break; fi |
| 1108 |
full_var=$new_full_var |
| 1109 |
done |
| 1110 |
|
| 1111 |
dnl clean up |
| 1112 |
full_var=$new_full_var |
| 1113 |
AC_SUBST([$1], "$full_var") |
| 1114 |
|
| 1115 |
dnl restore prefix and exec_prefix |
| 1116 |
prefix=$prefix_save |
| 1117 |
exec_prefix=$exec_prefix_save |
| 1118 |
]) |
| 1119 |
|
| 1120 |
m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], |
| 1121 |
[ |
| 1122 |
AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first |
| 1123 |
AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first |
| 1124 |
AC_BEFORE([LT_INIT],[$0])dnl setup libtool first |
| 1125 |
|
| 1126 |
dnl enable/disable introspection |
| 1127 |
m4_if([$2], [require], |
| 1128 |
[dnl |
| 1129 |
enable_introspection=yes |
| 1130 |
],[dnl |
| 1131 |
AC_ARG_ENABLE(introspection, |
| 1132 |
AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], |
| 1133 |
[Enable introspection for this build]),, |
| 1134 |
[enable_introspection=auto]) |
| 1135 |
])dnl |
| 1136 |
|
| 1137 |
AC_MSG_CHECKING([for gobject-introspection]) |
| 1138 |
|
| 1139 |
dnl presence/version checking |
| 1140 |
AS_CASE([$enable_introspection], |
| 1141 |
[no], [dnl |
| 1142 |
found_introspection="no (disabled, use --enable-introspection to enable)" |
| 1143 |
],dnl |
| 1144 |
[yes],[dnl |
| 1145 |
PKG_CHECK_EXISTS([gobject-introspection-1.0],, |
| 1146 |
AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) |
| 1147 |
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], |
| 1148 |
found_introspection=yes, |
| 1149 |
AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) |
| 1150 |
],dnl |
| 1151 |
[auto],[dnl |
| 1152 |
PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) |
| 1153 |
dnl Canonicalize enable_introspection |
| 1154 |
enable_introspection=$found_introspection |
| 1155 |
],dnl |
| 1156 |
[dnl |
| 1157 |
AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) |
| 1158 |
])dnl |
| 1159 |
|
| 1160 |
AC_MSG_RESULT([$found_introspection]) |
| 1161 |
|
| 1162 |
dnl expand datadir/libdir so we can pass them to pkg-config |
| 1163 |
dnl and get paths relative to our target directories |
| 1164 |
_GOBJECT_INTROSPECTION_AS_AC_EXPAND(_GI_EXP_DATADIR, "$datadir") |
| 1165 |
_GOBJECT_INTROSPECTION_AS_AC_EXPAND(_GI_EXP_LIBDIR, "$libdir") |
| 1166 |
|
| 1167 |
INTROSPECTION_SCANNER= |
| 1168 |
INTROSPECTION_COMPILER= |
| 1169 |
INTROSPECTION_GENERATE= |
| 1170 |
INTROSPECTION_GIRDIR= |
| 1171 |
INTROSPECTION_TYPELIBDIR= |
| 1172 |
if test "x$found_introspection" = "xyes"; then |
| 1173 |
INTROSPECTION_SCANNER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` |
| 1174 |
INTROSPECTION_COMPILER=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` |
| 1175 |
INTROSPECTION_GENERATE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` |
| 1176 |
INTROSPECTION_GIRDIR=`$PKG_CONFIG --define-variable=datadir="${_GI_EXP_DATADIR}" --variable=girdir gobject-introspection-1.0` |
| 1177 |
INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --define-variable=libdir="${_GI_EXP_LIBDIR}" --variable=typelibdir gobject-introspection-1.0)" |
| 1178 |
INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` |
| 1179 |
INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` |
| 1180 |
INTROSPECTION_MAKEFILE=$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection |
| 1181 |
fi |
| 1182 |
AC_SUBST(INTROSPECTION_SCANNER) |
| 1183 |
AC_SUBST(INTROSPECTION_COMPILER) |
| 1184 |
AC_SUBST(INTROSPECTION_GENERATE) |
| 1185 |
AC_SUBST(INTROSPECTION_GIRDIR) |
| 1186 |
AC_SUBST(INTROSPECTION_TYPELIBDIR) |
| 1187 |
AC_SUBST(INTROSPECTION_CFLAGS) |
| 1188 |
AC_SUBST(INTROSPECTION_LIBS) |
| 1189 |
AC_SUBST(INTROSPECTION_MAKEFILE) |
| 1190 |
|
| 1191 |
AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") |
| 1192 |
]) |
| 1193 |
|
| 1194 |
|
| 1195 |
dnl Usage: |
| 1196 |
dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) |
| 1197 |
|
| 1198 |
AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], |
| 1199 |
[ |
| 1200 |
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) |
| 1201 |
]) |
| 1202 |
|
| 1203 |
dnl Usage: |
| 1204 |
dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) |
| 1205 |
|
| 1206 |
|
| 1207 |
AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], |
| 1208 |
[ |
| 1209 |
_GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) |
| 1210 |
]) |
| 1211 |
|
| 1212 |
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- |
| 1213 |
# serial 12 (pkg-config-0.29.2) |
| 1214 |
|
| 1215 |
dnl Copyright © 2004 Scott James Remnant <[email protected]>. |
| 1216 |
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> |
| 1217 |
dnl |
| 1218 |
dnl This program is free software; you can redistribute it and/or modify |
| 1219 |
dnl it under the terms of the GNU General Public License as published by |
| 1220 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 1221 |
dnl (at your option) any later version. |
| 1222 |
dnl |
| 1223 |
dnl This program is distributed in the hope that it will be useful, but |
| 1224 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1225 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 1226 |
dnl General Public License for more details. |
| 1227 |
dnl |
| 1228 |
dnl You should have received a copy of the GNU General Public License |
| 1229 |
dnl along with this program; if not, write to the Free Software |
| 1230 |
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 1231 |
dnl 02111-1307, USA. |
| 1232 |
dnl |
| 1233 |
dnl As a special exception to the GNU General Public License, if you |
| 1234 |
dnl distribute this file as part of a program that contains a |
| 1235 |
dnl configuration script generated by Autoconf, you may include it under |
| 1236 |
dnl the same distribution terms that you use for the rest of that |
| 1237 |
dnl program. |
| 1238 |
|
| 1239 |
dnl PKG_PREREQ(MIN-VERSION) |
| 1240 |
dnl ----------------------- |
| 1241 |
dnl Since: 0.29 |
| 1242 |
dnl |
| 1243 |
dnl Verify that the version of the pkg-config macros are at least |
| 1244 |
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's |
| 1245 |
dnl installed version of pkg-config, this checks the developer's version |
| 1246 |
dnl of pkg.m4 when generating configure. |
| 1247 |
dnl |
| 1248 |
dnl To ensure that this macro is defined, also add: |
| 1249 |
dnl m4_ifndef([PKG_PREREQ], |
| 1250 |
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) |
| 1251 |
dnl |
| 1252 |
dnl See the "Since" comment for each macro you use to see what version |
| 1253 |
dnl of the macros you require. |
| 1254 |
m4_defun([PKG_PREREQ], |
| 1255 |
[m4_define([PKG_MACROS_VERSION], [0.29.2]) |
| 1256 |
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, |
| 1257 |
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) |
| 1258 |
])dnl PKG_PREREQ |
| 1259 |
|
| 1260 |
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
| 1261 |
dnl ---------------------------------- |
| 1262 |
dnl Since: 0.16 |
| 1263 |
dnl |
| 1264 |
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to |
| 1265 |
dnl first found in the path. Checks that the version of pkg-config found |
| 1266 |
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is |
| 1267 |
dnl used since that's the first version where most current features of |
| 1268 |
dnl pkg-config existed. |
| 1269 |
AC_DEFUN([PKG_PROG_PKG_CONFIG], |
| 1270 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
| 1271 |
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) |
| 1272 |
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) |
| 1273 |
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
| 1274 |
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) |
| 1275 |
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) |
| 1276 |
|
| 1277 |
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
| 1278 |
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
| 1279 |
fi |
| 1280 |
if test -n "$PKG_CONFIG"; then |
| 1281 |
_pkg_min_version=m4_default([$1], [0.9.0]) |
| 1282 |
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
| 1283 |
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
| 1284 |
AC_MSG_RESULT([yes]) |
| 1285 |
else |
| 1286 |
AC_MSG_RESULT([no]) |
| 1287 |
PKG_CONFIG="" |
| 1288 |
fi |
| 1289 |
fi[]dnl |
| 1290 |
])dnl PKG_PROG_PKG_CONFIG |
| 1291 |
|
| 1292 |
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 1293 |
dnl ------------------------------------------------------------------- |
| 1294 |
dnl Since: 0.18 |
| 1295 |
dnl |
| 1296 |
dnl Check to see whether a particular set of modules exists. Similar to |
| 1297 |
dnl PKG_CHECK_MODULES(), but does not set variables or print errors. |
| 1298 |
dnl |
| 1299 |
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 1300 |
dnl only at the first occurrence in configure.ac, so if the first place |
| 1301 |
dnl it's called might be skipped (such as if it is within an "if", you |
| 1302 |
dnl have to call PKG_CHECK_EXISTS manually |
| 1303 |
AC_DEFUN([PKG_CHECK_EXISTS], |
| 1304 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1305 |
if test -n "$PKG_CONFIG" && \ |
| 1306 |
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
| 1307 |
m4_default([$2], [:]) |
| 1308 |
m4_ifvaln([$3], [else |
| 1309 |
$3])dnl |
| 1310 |
fi]) |
| 1311 |
|
| 1312 |
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
| 1313 |
dnl --------------------------------------------- |
| 1314 |
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting |
| 1315 |
dnl pkg_failed based on the result. |
| 1316 |
m4_define([_PKG_CONFIG], |
| 1317 |
[if test -n "$$1"; then |
| 1318 |
pkg_cv_[]$1="$$1" |
| 1319 |
elif test -n "$PKG_CONFIG"; then |
| 1320 |
PKG_CHECK_EXISTS([$3], |
| 1321 |
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` |
| 1322 |
test "x$?" != "x0" && pkg_failed=yes ], |
| 1323 |
[pkg_failed=yes]) |
| 1324 |
else |
| 1325 |
pkg_failed=untried |
| 1326 |
fi[]dnl |
| 1327 |
])dnl _PKG_CONFIG |
| 1328 |
|
| 1329 |
dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 1330 |
dnl --------------------------- |
| 1331 |
dnl Internal check to see if pkg-config supports short errors. |
| 1332 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
| 1333 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 1334 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
| 1335 |
_pkg_short_errors_supported=yes |
| 1336 |
else |
| 1337 |
_pkg_short_errors_supported=no |
| 1338 |
fi[]dnl |
| 1339 |
])dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 1340 |
|
| 1341 |
|
| 1342 |
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 1343 |
dnl [ACTION-IF-NOT-FOUND]) |
| 1344 |
dnl -------------------------------------------------------------- |
| 1345 |
dnl Since: 0.4.0 |
| 1346 |
dnl |
| 1347 |
dnl Note that if there is a possibility the first call to |
| 1348 |
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an |
| 1349 |
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
| 1350 |
AC_DEFUN([PKG_CHECK_MODULES], |
| 1351 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1352 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
| 1353 |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
| 1354 |
|
| 1355 |
pkg_failed=no |
| 1356 |
AC_MSG_CHECKING([for $2]) |
| 1357 |
|
| 1358 |
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
| 1359 |
_PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
| 1360 |
|
| 1361 |
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
| 1362 |
and $1[]_LIBS to avoid the need to call pkg-config. |
| 1363 |
See the pkg-config man page for more details.]) |
| 1364 |
|
| 1365 |
if test $pkg_failed = yes; then |
| 1366 |
AC_MSG_RESULT([no]) |
| 1367 |
_PKG_SHORT_ERRORS_SUPPORTED |
| 1368 |
if test $_pkg_short_errors_supported = yes; then |
| 1369 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` |
| 1370 |
else |
| 1371 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` |
| 1372 |
fi |
| 1373 |
# Put the nasty error message in config.log where it belongs |
| 1374 |
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
| 1375 |
|
| 1376 |
m4_default([$4], [AC_MSG_ERROR( |
| 1377 |
[Package requirements ($2) were not met: |
| 1378 |
|
| 1379 |
$$1_PKG_ERRORS |
| 1380 |
|
| 1381 |
Consider adjusting the PKG_CONFIG_PATH environment variable if you |
| 1382 |
installed software in a non-standard prefix. |
| 1383 |
|
| 1384 |
_PKG_TEXT])[]dnl |
| 1385 |
]) |
| 1386 |
elif test $pkg_failed = untried; then |
| 1387 |
AC_MSG_RESULT([no]) |
| 1388 |
m4_default([$4], [AC_MSG_FAILURE( |
| 1389 |
[The pkg-config script could not be found or is too old. Make sure it |
| 1390 |
is in your PATH or set the PKG_CONFIG environment variable to the full |
| 1391 |
path to pkg-config. |
| 1392 |
|
| 1393 |
_PKG_TEXT |
| 1394 |
|
| 1395 |
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl |
| 1396 |
]) |
| 1397 |
else |
| 1398 |
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
| 1399 |
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
| 1400 |
AC_MSG_RESULT([yes]) |
| 1401 |
$3 |
| 1402 |
fi[]dnl |
| 1403 |
])dnl PKG_CHECK_MODULES |
| 1404 |
|
| 1405 |
|
| 1406 |
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 1407 |
dnl [ACTION-IF-NOT-FOUND]) |
| 1408 |
dnl --------------------------------------------------------------------- |
| 1409 |
dnl Since: 0.29 |
| 1410 |
dnl |
| 1411 |
dnl Checks for existence of MODULES and gathers its build flags with |
| 1412 |
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags |
| 1413 |
dnl and VARIABLE-PREFIX_LIBS from --libs. |
| 1414 |
dnl |
| 1415 |
dnl Note that if there is a possibility the first call to |
| 1416 |
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to |
| 1417 |
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your |
| 1418 |
dnl configure.ac. |
| 1419 |
AC_DEFUN([PKG_CHECK_MODULES_STATIC], |
| 1420 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1421 |
_save_PKG_CONFIG=$PKG_CONFIG |
| 1422 |
PKG_CONFIG="$PKG_CONFIG --static" |
| 1423 |
PKG_CHECK_MODULES($@) |
| 1424 |
PKG_CONFIG=$_save_PKG_CONFIG[]dnl |
| 1425 |
])dnl PKG_CHECK_MODULES_STATIC |
| 1426 |
|
| 1427 |
|
| 1428 |
dnl PKG_INSTALLDIR([DIRECTORY]) |
| 1429 |
dnl ------------------------- |
| 1430 |
dnl Since: 0.27 |
| 1431 |
dnl |
| 1432 |
dnl Substitutes the variable pkgconfigdir as the location where a module |
| 1433 |
dnl should install pkg-config .pc files. By default the directory is |
| 1434 |
dnl $libdir/pkgconfig, but the default can be changed by passing |
| 1435 |
dnl DIRECTORY. The user can override through the --with-pkgconfigdir |
| 1436 |
dnl parameter. |
| 1437 |
AC_DEFUN([PKG_INSTALLDIR], |
| 1438 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) |
| 1439 |
m4_pushdef([pkg_description], |
| 1440 |
[pkg-config installation directory @<:@]pkg_default[@:>@]) |
| 1441 |
AC_ARG_WITH([pkgconfigdir], |
| 1442 |
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, |
| 1443 |
[with_pkgconfigdir=]pkg_default) |
| 1444 |
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) |
| 1445 |
m4_popdef([pkg_default]) |
| 1446 |
m4_popdef([pkg_description]) |
| 1447 |
])dnl PKG_INSTALLDIR |
| 1448 |
|
| 1449 |
|
| 1450 |
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) |
| 1451 |
dnl -------------------------------- |
| 1452 |
dnl Since: 0.27 |
| 1453 |
dnl |
| 1454 |
dnl Substitutes the variable noarch_pkgconfigdir as the location where a |
| 1455 |
dnl module should install arch-independent pkg-config .pc files. By |
| 1456 |
dnl default the directory is $datadir/pkgconfig, but the default can be |
| 1457 |
dnl changed by passing DIRECTORY. The user can override through the |
| 1458 |
dnl --with-noarch-pkgconfigdir parameter. |
| 1459 |
AC_DEFUN([PKG_NOARCH_INSTALLDIR], |
| 1460 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) |
| 1461 |
m4_pushdef([pkg_description], |
| 1462 |
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) |
| 1463 |
AC_ARG_WITH([noarch-pkgconfigdir], |
| 1464 |
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, |
| 1465 |
[with_noarch_pkgconfigdir=]pkg_default) |
| 1466 |
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) |
| 1467 |
m4_popdef([pkg_default]) |
| 1468 |
m4_popdef([pkg_description]) |
| 1469 |
])dnl PKG_NOARCH_INSTALLDIR |
| 1470 |
|
| 1471 |
|
| 1472 |
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, |
| 1473 |
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 1474 |
dnl ------------------------------------------- |
| 1475 |
dnl Since: 0.28 |
| 1476 |
dnl |
| 1477 |
dnl Retrieves the value of the pkg-config variable for the given module. |
| 1478 |
AC_DEFUN([PKG_CHECK_VAR], |
| 1479 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 1480 |
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl |
| 1481 |
|
| 1482 |
_PKG_CONFIG([$1], [variable="][$3]["], [$2]) |
| 1483 |
AS_VAR_COPY([$1], [pkg_cv_][$1]) |
| 1484 |
|
| 1485 |
AS_VAR_IF([$1], [""], [$5], [$4])dnl |
| 1486 |
])dnl PKG_CHECK_VAR |
| 1487 |
|
| 1488 |
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1489 |
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], |
| 1490 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1491 |
dnl ------------------------------------------ |
| 1492 |
dnl |
| 1493 |
dnl Prepare a "--with-" configure option using the lowercase |
| 1494 |
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and |
| 1495 |
dnl PKG_CHECK_MODULES in a single macro. |
| 1496 |
AC_DEFUN([PKG_WITH_MODULES], |
| 1497 |
[ |
| 1498 |
m4_pushdef([with_arg], m4_tolower([$1])) |
| 1499 |
|
| 1500 |
m4_pushdef([description], |
| 1501 |
[m4_default([$5], [build with ]with_arg[ support])]) |
| 1502 |
|
| 1503 |
m4_pushdef([def_arg], [m4_default([$6], [auto])]) |
| 1504 |
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) |
| 1505 |
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) |
| 1506 |
|
| 1507 |
m4_case(def_arg, |
| 1508 |
[yes],[m4_pushdef([with_without], [--without-]with_arg)], |
| 1509 |
[m4_pushdef([with_without],[--with-]with_arg)]) |
| 1510 |
|
| 1511 |
AC_ARG_WITH(with_arg, |
| 1512 |
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, |
| 1513 |
[AS_TR_SH([with_]with_arg)=def_arg]) |
| 1514 |
|
| 1515 |
AS_CASE([$AS_TR_SH([with_]with_arg)], |
| 1516 |
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], |
| 1517 |
[auto],[PKG_CHECK_MODULES([$1],[$2], |
| 1518 |
[m4_n([def_action_if_found]) $3], |
| 1519 |
[m4_n([def_action_if_not_found]) $4])]) |
| 1520 |
|
| 1521 |
m4_popdef([with_arg]) |
| 1522 |
m4_popdef([description]) |
| 1523 |
m4_popdef([def_arg]) |
| 1524 |
|
| 1525 |
])dnl PKG_WITH_MODULES |
| 1526 |
|
| 1527 |
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1528 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1529 |
dnl ----------------------------------------------- |
| 1530 |
dnl |
| 1531 |
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES |
| 1532 |
dnl check._[VARIABLE-PREFIX] is exported as make variable. |
| 1533 |
AC_DEFUN([PKG_HAVE_WITH_MODULES], |
| 1534 |
[ |
| 1535 |
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) |
| 1536 |
|
| 1537 |
AM_CONDITIONAL([HAVE_][$1], |
| 1538 |
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) |
| 1539 |
])dnl PKG_HAVE_WITH_MODULES |
| 1540 |
|
| 1541 |
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 1542 |
dnl [DESCRIPTION], [DEFAULT]) |
| 1543 |
dnl ------------------------------------------------------ |
| 1544 |
dnl |
| 1545 |
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after |
| 1546 |
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make |
| 1547 |
dnl and preprocessor variable. |
| 1548 |
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], |
| 1549 |
[ |
| 1550 |
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) |
| 1551 |
|
| 1552 |
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], |
| 1553 |
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) |
| 1554 |
])dnl PKG_HAVE_DEFINE_WITH_MODULES |
| 1555 |
|
| 1556 |
# Copyright (C) 2002-2024 Free Software Foundation, Inc. |
| 1557 |
# |
| 1558 |
# This file is free software; the Free Software Foundation |
| 1559 |
# gives unlimited permission to copy and/or distribute it, |
| 1560 |
# with or without modifications, as long as this notice is preserved. |
| 1561 |
|
| 1562 |
# AM_AUTOMAKE_VERSION(VERSION) |
| 1563 |
# ---------------------------- |
| 1564 |
# Automake X.Y traces this macro to ensure aclocal.m4 has been |
| 1565 |
# generated from the m4 files accompanying Automake X.Y. |
| 1566 |
# (This private macro should not be called outside this file.) |
| 1567 |
AC_DEFUN([AM_AUTOMAKE_VERSION], |
| 1568 |
[am__api_version='1.17' |
| 1569 |
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
| 1570 |
dnl require some minimum version. Point them to the right macro. |
| 1571 |
m4_if([$1], [1.17], [], |
| 1572 |
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
| 1573 |
]) |
| 1574 |
|
| 1575 |
# _AM_AUTOCONF_VERSION(VERSION) |
| 1576 |
# ----------------------------- |
| 1577 |
# aclocal traces this macro to find the Autoconf version. |
| 1578 |
# This is a private macro too. Using m4_define simplifies |
| 1579 |
# the logic in aclocal, which can simply ignore this definition. |
| 1580 |
m4_define([_AM_AUTOCONF_VERSION], []) |
| 1581 |
|
| 1582 |
# AM_SET_CURRENT_AUTOMAKE_VERSION |
| 1583 |
# ------------------------------- |
| 1584 |
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
| 1585 |
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
| 1586 |
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
| 1587 |
[AM_AUTOMAKE_VERSION([1.17])dnl |
| 1588 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 1589 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 1590 |
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
| 1591 |
|
| 1592 |
# Copyright (C) 2011-2024 Free Software Foundation, Inc. |
| 1593 |
# |
| 1594 |
# This file is free software; the Free Software Foundation |
| 1595 |
# gives unlimited permission to copy and/or distribute it, |
| 1596 |
# with or without modifications, as long as this notice is preserved. |
| 1597 |
|
| 1598 |
# AM_PROG_AR([ACT-IF-FAIL]) |
| 1599 |
# ------------------------- |
| 1600 |
# Try to determine the archiver interface, and trigger the ar-lib wrapper |
| 1601 |
# if it is needed. If the detection of archiver interface fails, run |
| 1602 |
# ACT-IF-FAIL (default is to abort configure with a proper error message). |
| 1603 |
AC_DEFUN([AM_PROG_AR], |
| 1604 |
[AC_BEFORE([$0], [LT_INIT])dnl |
| 1605 |
AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl |
| 1606 |
AC_BEFORE([$0], [AC_PROG_AR])dnl |
| 1607 |
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 1608 |
AC_REQUIRE_AUX_FILE([ar-lib])dnl |
| 1609 |
AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) |
| 1610 |
: ${AR=ar} |
| 1611 |
: ${ARFLAGS=cr} |
| 1612 |
|
| 1613 |
AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], |
| 1614 |
[AC_LANG_PUSH([C]) |
| 1615 |
am_cv_ar_interface=ar |
| 1616 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], |
| 1617 |
[am_ar_try='$AR $ARFLAGS libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' |
| 1618 |
AC_TRY_EVAL([am_ar_try]) |
| 1619 |
if test "$ac_status" -eq 0; then |
| 1620 |
am_cv_ar_interface=ar |
| 1621 |
else |
| 1622 |
am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' |
| 1623 |
AC_TRY_EVAL([am_ar_try]) |
| 1624 |
if test "$ac_status" -eq 0; then |
| 1625 |
am_cv_ar_interface=lib |
| 1626 |
else |
| 1627 |
am_cv_ar_interface=unknown |
| 1628 |
fi |
| 1629 |
fi |
| 1630 |
rm -f conftest.lib libconftest.a |
| 1631 |
]) |
| 1632 |
AC_LANG_POP([C])]) |
| 1633 |
|
| 1634 |
case $am_cv_ar_interface in |
| 1635 |
ar) |
| 1636 |
;; |
| 1637 |
lib) |
| 1638 |
# Microsoft lib, so override with the ar-lib wrapper script. |
| 1639 |
# FIXME: It is wrong to rewrite AR. |
| 1640 |
# But if we don't then we get into trouble of one sort or another. |
| 1641 |
# A longer-term fix would be to have automake use am__AR in this case, |
| 1642 |
# and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something |
| 1643 |
# similar. |
| 1644 |
AR="$am_aux_dir/ar-lib $AR" |
| 1645 |
;; |
| 1646 |
unknown) |
| 1647 |
m4_default([$1], |
| 1648 |
[AC_MSG_ERROR([could not determine $AR interface])]) |
| 1649 |
;; |
| 1650 |
esac |
| 1651 |
AC_SUBST([AR])dnl |
| 1652 |
]) |
| 1653 |
|
| 1654 |
# AM_AUX_DIR_EXPAND -*- Autoconf -*- |
| 1655 |
|
| 1656 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 1657 |
# |
| 1658 |
# This file is free software; the Free Software Foundation |
| 1659 |
# gives unlimited permission to copy and/or distribute it, |
| 1660 |
# with or without modifications, as long as this notice is preserved. |
| 1661 |
|
| 1662 |
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets |
| 1663 |
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to |
| 1664 |
# '$srcdir', '$srcdir/..', or '$srcdir/../..'. |
| 1665 |
# |
| 1666 |
# Of course, Automake must honor this variable whenever it calls a |
| 1667 |
# tool from the auxiliary directory. The problem is that $srcdir (and |
| 1668 |
# therefore $ac_aux_dir as well) can be either absolute or relative, |
| 1669 |
# depending on how configure is run. This is pretty annoying, since |
| 1670 |
# it makes $ac_aux_dir quite unusable in subdirectories: in the top |
| 1671 |
# source directory, any form will work fine, but in subdirectories a |
| 1672 |
# relative path needs to be adjusted first. |
| 1673 |
# |
| 1674 |
# $ac_aux_dir/missing |
| 1675 |
# fails when called from a subdirectory if $ac_aux_dir is relative |
| 1676 |
# $top_srcdir/$ac_aux_dir/missing |
| 1677 |
# fails if $ac_aux_dir is absolute, |
| 1678 |
# fails when called from a subdirectory in a VPATH build with |
| 1679 |
# a relative $ac_aux_dir |
| 1680 |
# |
| 1681 |
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir |
| 1682 |
# are both prefixed by $srcdir. In an in-source build this is usually |
| 1683 |
# harmless because $srcdir is '.', but things will broke when you |
| 1684 |
# start a VPATH build or use an absolute $srcdir. |
| 1685 |
# |
| 1686 |
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
| 1687 |
# iff we strip the leading $srcdir from $ac_aux_dir. That would be: |
| 1688 |
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` |
| 1689 |
# and then we would define $MISSING as |
| 1690 |
# MISSING="\${SHELL} $am_aux_dir/missing" |
| 1691 |
# This will work as long as MISSING is not called from configure, because |
| 1692 |
# unfortunately $(top_srcdir) has no meaning in configure. |
| 1693 |
# However there are other variables, like CC, which are often used in |
| 1694 |
# configure, and could therefore not use this "fixed" $ac_aux_dir. |
| 1695 |
# |
| 1696 |
# Another solution, used here, is to always expand $ac_aux_dir to an |
| 1697 |
# absolute PATH. The drawback is that using absolute paths prevent a |
| 1698 |
# configured tree to be moved without reconfiguration. |
| 1699 |
|
| 1700 |
AC_DEFUN([AM_AUX_DIR_EXPAND], |
| 1701 |
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl |
| 1702 |
# Expand $ac_aux_dir to an absolute path. |
| 1703 |
am_aux_dir=`cd "$ac_aux_dir" && pwd` |
| 1704 |
]) |
| 1705 |
|
| 1706 |
# AM_COND_IF -*- Autoconf -*- |
| 1707 |
|
| 1708 |
# Copyright (C) 2008-2024 Free Software Foundation, Inc. |
| 1709 |
# |
| 1710 |
# This file is free software; the Free Software Foundation |
| 1711 |
# gives unlimited permission to copy and/or distribute it, |
| 1712 |
# with or without modifications, as long as this notice is preserved. |
| 1713 |
|
| 1714 |
# _AM_COND_IF |
| 1715 |
# _AM_COND_ELSE |
| 1716 |
# _AM_COND_ENDIF |
| 1717 |
# -------------- |
| 1718 |
# These macros are only used for tracing. |
| 1719 |
m4_define([_AM_COND_IF]) |
| 1720 |
m4_define([_AM_COND_ELSE]) |
| 1721 |
m4_define([_AM_COND_ENDIF]) |
| 1722 |
|
| 1723 |
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) |
| 1724 |
# --------------------------------------- |
| 1725 |
# If the shell condition COND is true, execute IF-TRUE, otherwise execute |
| 1726 |
# IF-FALSE. Allow automake to learn about conditional instantiating macros |
| 1727 |
# (the AC_CONFIG_FOOS). |
| 1728 |
AC_DEFUN([AM_COND_IF], |
| 1729 |
[m4_ifndef([_AM_COND_VALUE_$1], |
| 1730 |
[m4_fatal([$0: no such condition "$1"])])dnl |
| 1731 |
_AM_COND_IF([$1])dnl |
| 1732 |
if test -z "$$1_TRUE"; then : |
| 1733 |
m4_n([$2])[]dnl |
| 1734 |
m4_ifval([$3], |
| 1735 |
[_AM_COND_ELSE([$1])dnl |
| 1736 |
else |
| 1737 |
$3 |
| 1738 |
])dnl |
| 1739 |
_AM_COND_ENDIF([$1])dnl |
| 1740 |
fi[]dnl |
| 1741 |
]) |
| 1742 |
|
| 1743 |
# AM_CONDITIONAL -*- Autoconf -*- |
| 1744 |
|
| 1745 |
# Copyright (C) 1997-2024 Free Software Foundation, Inc. |
| 1746 |
# |
| 1747 |
# This file is free software; the Free Software Foundation |
| 1748 |
# gives unlimited permission to copy and/or distribute it, |
| 1749 |
# with or without modifications, as long as this notice is preserved. |
| 1750 |
|
| 1751 |
# AM_CONDITIONAL(NAME, SHELL-CONDITION) |
| 1752 |
# ------------------------------------- |
| 1753 |
# Define a conditional. |
| 1754 |
AC_DEFUN([AM_CONDITIONAL], |
| 1755 |
[AC_PREREQ([2.52])dnl |
| 1756 |
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], |
| 1757 |
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl |
| 1758 |
AC_SUBST([$1_TRUE])dnl |
| 1759 |
AC_SUBST([$1_FALSE])dnl |
| 1760 |
_AM_SUBST_NOTMAKE([$1_TRUE])dnl |
| 1761 |
_AM_SUBST_NOTMAKE([$1_FALSE])dnl |
| 1762 |
m4_define([_AM_COND_VALUE_$1], [$2])dnl |
| 1763 |
if $2; then |
| 1764 |
$1_TRUE= |
| 1765 |
$1_FALSE='#' |
| 1766 |
else |
| 1767 |
$1_TRUE='#' |
| 1768 |
$1_FALSE= |
| 1769 |
fi |
| 1770 |
AC_CONFIG_COMMANDS_PRE( |
| 1771 |
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
| 1772 |
AC_MSG_ERROR([[conditional "$1" was never defined. |
| 1773 |
Usually this means the macro was only invoked conditionally.]]) |
| 1774 |
fi])]) |
| 1775 |
|
| 1776 |
# Copyright (C) 1999-2024 Free Software Foundation, Inc. |
| 1777 |
# |
| 1778 |
# This file is free software; the Free Software Foundation |
| 1779 |
# gives unlimited permission to copy and/or distribute it, |
| 1780 |
# with or without modifications, as long as this notice is preserved. |
| 1781 |
|
| 1782 |
|
| 1783 |
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be |
| 1784 |
# written in clear, in which case automake, when reading aclocal.m4, |
| 1785 |
# will think it sees a *use*, and therefore will trigger all it's |
| 1786 |
# C support machinery. Also note that it means that autoscan, seeing |
| 1787 |
# CC etc. in the Makefile, will ask for an AC_PROG_CC use... |
| 1788 |
|
| 1789 |
|
| 1790 |
# _AM_DEPENDENCIES(NAME) |
| 1791 |
# ---------------------- |
| 1792 |
# See how the compiler implements dependency checking. |
| 1793 |
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". |
| 1794 |
# We try a few techniques and use that to set a single cache variable. |
| 1795 |
# |
| 1796 |
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
| 1797 |
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular |
| 1798 |
# dependency, and given that the user is not expected to run this macro, |
| 1799 |
# just rely on AC_PROG_CC. |
| 1800 |
AC_DEFUN([_AM_DEPENDENCIES], |
| 1801 |
[AC_REQUIRE([AM_SET_DEPDIR])dnl |
| 1802 |
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl |
| 1803 |
AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
| 1804 |
AC_REQUIRE([AM_DEP_TRACK])dnl |
| 1805 |
|
| 1806 |
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], |
| 1807 |
[$1], [CXX], [depcc="$CXX" am_compiler_list=], |
| 1808 |
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], |
| 1809 |
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], |
| 1810 |
[$1], [UPC], [depcc="$UPC" am_compiler_list=], |
| 1811 |
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], |
| 1812 |
[depcc="$$1" am_compiler_list=]) |
| 1813 |
|
| 1814 |
AC_CACHE_CHECK([dependency style of $depcc], |
| 1815 |
[am_cv_$1_dependencies_compiler_type], |
| 1816 |
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then |
| 1817 |
# We make a subdir and do the tests there. Otherwise we can end up |
| 1818 |
# making bogus files that we don't know about and never remove. For |
| 1819 |
# instance it was reported that on HP-UX the gcc test will end up |
| 1820 |
# making a dummy file named 'D' -- because '-MD' means "put the output |
| 1821 |
# in D". |
| 1822 |
rm -rf conftest.dir |
| 1823 |
mkdir conftest.dir |
| 1824 |
# Copy depcomp to subdir because otherwise we won't find it if we're |
| 1825 |
# using a relative directory. |
| 1826 |
cp "$am_depcomp" conftest.dir |
| 1827 |
cd conftest.dir |
| 1828 |
# We will build objects and dependencies in a subdirectory because |
| 1829 |
# it helps to detect inapplicable dependency modes. For instance |
| 1830 |
# both Tru64's cc and ICC support -MD to output dependencies as a |
| 1831 |
# side effect of compilation, but ICC will put the dependencies in |
| 1832 |
# the current directory while Tru64 will put them in the object |
| 1833 |
# directory. |
| 1834 |
mkdir sub |
| 1835 |
|
| 1836 |
am_cv_$1_dependencies_compiler_type=none |
| 1837 |
if test "$am_compiler_list" = ""; then |
| 1838 |
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` |
| 1839 |
fi |
| 1840 |
am__universal=false |
| 1841 |
m4_case([$1], [CC], |
| 1842 |
[case " $depcc " in #( |
| 1843 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1844 |
esac], |
| 1845 |
[CXX], |
| 1846 |
[case " $depcc " in #( |
| 1847 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1848 |
esac]) |
| 1849 |
|
| 1850 |
for depmode in $am_compiler_list; do |
| 1851 |
# Setup a source with many dependencies, because some compilers |
| 1852 |
# like to wrap large dependency lists on column 80 (with \), and |
| 1853 |
# we should not choose a depcomp mode which is confused by this. |
| 1854 |
# |
| 1855 |
# We need to recreate these files for each test, as the compiler may |
| 1856 |
# overwrite some of them when testing with obscure command lines. |
| 1857 |
# This happens at least with the AIX C compiler. |
| 1858 |
: > sub/conftest.c |
| 1859 |
for i in 1 2 3 4 5 6; do |
| 1860 |
echo '#include "conftst'$i'.h"' >> sub/conftest.c |
| 1861 |
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
| 1862 |
# Solaris 10 /bin/sh. |
| 1863 |
echo '/* dummy */' > sub/conftst$i.h |
| 1864 |
done |
| 1865 |
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
| 1866 |
|
| 1867 |
# We check with '-c' and '-o' for the sake of the "dashmstdout" |
| 1868 |
# mode. It turns out that the SunPro C++ compiler does not properly |
| 1869 |
# handle '-M -o', and we need to detect this. Also, some Intel |
| 1870 |
# versions had trouble with output in subdirs. |
| 1871 |
am__obj=sub/conftest.${OBJEXT-o} |
| 1872 |
am__minus_obj="-o $am__obj" |
| 1873 |
case $depmode in |
| 1874 |
gcc) |
| 1875 |
# This depmode causes a compiler race in universal mode. |
| 1876 |
test "$am__universal" = false || continue |
| 1877 |
;; |
| 1878 |
nosideeffect) |
| 1879 |
# After this tag, mechanisms are not by side-effect, so they'll |
| 1880 |
# only be used when explicitly requested. |
| 1881 |
if test "x$enable_dependency_tracking" = xyes; then |
| 1882 |
continue |
| 1883 |
else |
| 1884 |
break |
| 1885 |
fi |
| 1886 |
;; |
| 1887 |
msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
| 1888 |
# This compiler won't grok '-c -o', but also, the minuso test has |
| 1889 |
# not run yet. These depmodes are late enough in the game, and |
| 1890 |
# so weak that their functioning should not be impacted. |
| 1891 |
am__obj=conftest.${OBJEXT-o} |
| 1892 |
am__minus_obj= |
| 1893 |
;; |
| 1894 |
none) break ;; |
| 1895 |
esac |
| 1896 |
if depmode=$depmode \ |
| 1897 |
source=sub/conftest.c object=$am__obj \ |
| 1898 |
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ |
| 1899 |
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ |
| 1900 |
>/dev/null 2>conftest.err && |
| 1901 |
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && |
| 1902 |
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && |
| 1903 |
grep $am__obj sub/conftest.Po > /dev/null 2>&1 && |
| 1904 |
${MAKE-make} -s -f confmf > /dev/null 2>&1; then |
| 1905 |
# icc doesn't choke on unknown options, it will just issue warnings |
| 1906 |
# or remarks (even with -Werror). So we grep stderr for any message |
| 1907 |
# that says an option was ignored or not supported. |
| 1908 |
# When given -MP, icc 7.0 and 7.1 complain thus: |
| 1909 |
# icc: Command line warning: ignoring option '-M'; no argument required |
| 1910 |
# The diagnosis changed in icc 8.0: |
| 1911 |
# icc: Command line remark: option '-MP' not supported |
| 1912 |
if (grep 'ignoring option' conftest.err || |
| 1913 |
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else |
| 1914 |
am_cv_$1_dependencies_compiler_type=$depmode |
| 1915 |
break |
| 1916 |
fi |
| 1917 |
fi |
| 1918 |
done |
| 1919 |
|
| 1920 |
cd .. |
| 1921 |
rm -rf conftest.dir |
| 1922 |
else |
| 1923 |
am_cv_$1_dependencies_compiler_type=none |
| 1924 |
fi |
| 1925 |
]) |
| 1926 |
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
| 1927 |
AM_CONDITIONAL([am__fastdep$1], [ |
| 1928 |
test "x$enable_dependency_tracking" != xno \ |
| 1929 |
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3]) |
| 1930 |
]) |
| 1931 |
|
| 1932 |
|
| 1933 |
# AM_SET_DEPDIR |
| 1934 |
# ------------- |
| 1935 |
# Choose a directory name for dependency files. |
| 1936 |
# This macro is AC_REQUIREd in _AM_DEPENDENCIES. |
| 1937 |
AC_DEFUN([AM_SET_DEPDIR], |
| 1938 |
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 1939 |
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
| 1940 |
]) |
| 1941 |
|
| 1942 |
|
| 1943 |
# AM_DEP_TRACK |
| 1944 |
# ------------ |
| 1945 |
AC_DEFUN([AM_DEP_TRACK], |
| 1946 |
[AC_ARG_ENABLE([dependency-tracking], [dnl |
| 1947 |
AS_HELP_STRING( |
| 1948 |
[--enable-dependency-tracking], |
| 1949 |
[do not reject slow dependency extractors]) |
| 1950 |
AS_HELP_STRING( |
| 1951 |
[--disable-dependency-tracking], |
| 1952 |
[speeds up one-time build])]) |
| 1953 |
if test "x$enable_dependency_tracking" != xno; then |
| 1954 |
am_depcomp="$ac_aux_dir/depcomp" |
| 1955 |
AMDEPBACKSLASH='\' |
| 1956 |
am__nodep='_no' |
| 1957 |
fi |
| 1958 |
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
| 1959 |
AC_SUBST([AMDEPBACKSLASH])dnl |
| 1960 |
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl |
| 1961 |
AC_SUBST([am__nodep])dnl |
| 1962 |
_AM_SUBST_NOTMAKE([am__nodep])dnl |
| 1963 |
]) |
| 1964 |
|
| 1965 |
# Generate code to set up dependency tracking. -*- Autoconf -*- |
| 1966 |
|
| 1967 |
# Copyright (C) 1999-2024 Free Software Foundation, Inc. |
| 1968 |
# |
| 1969 |
# This file is free software; the Free Software Foundation |
| 1970 |
# gives unlimited permission to copy and/or distribute it, |
| 1971 |
# with or without modifications, as long as this notice is preserved. |
| 1972 |
|
| 1973 |
# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1974 |
# ------------------------------ |
| 1975 |
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1976 |
[{ |
| 1977 |
# Older Autoconf quotes --file arguments for eval, but not when files |
| 1978 |
# are listed without --file. Let's play safe and only enable the eval |
| 1979 |
# if we detect the quoting. |
| 1980 |
# TODO: see whether this extra hack can be removed once we start |
| 1981 |
# requiring Autoconf 2.70 or later. |
| 1982 |
AS_CASE([$CONFIG_FILES], |
| 1983 |
[*\'*], [eval set x "$CONFIG_FILES"], |
| 1984 |
[*], [set x $CONFIG_FILES]) |
| 1985 |
shift |
| 1986 |
# Used to flag and report bootstrapping failures. |
| 1987 |
am_rc=0 |
| 1988 |
for am_mf |
| 1989 |
do |
| 1990 |
# Strip MF so we end up with the name of the file. |
| 1991 |
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` |
| 1992 |
# Check whether this is an Automake generated Makefile which includes |
| 1993 |
# dependency-tracking related rules and includes. |
| 1994 |
# Grep'ing the whole file directly is not great: AIX grep has a line |
| 1995 |
# limit of 2048, but all sed's we know have understand at least 4000. |
| 1996 |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ |
| 1997 |
|| continue |
| 1998 |
am_dirpart=`AS_DIRNAME(["$am_mf"])` |
| 1999 |
am_filepart=`AS_BASENAME(["$am_mf"])` |
| 2000 |
AM_RUN_LOG([cd "$am_dirpart" \ |
| 2001 |
&& sed -e '/# am--include-marker/d' "$am_filepart" \ |
| 2002 |
| $MAKE -f - am--depfiles]) || am_rc=$? |
| 2003 |
done |
| 2004 |
if test $am_rc -ne 0; then |
| 2005 |
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
| 2006 |
for automatic dependency tracking. If GNU make was not used, consider |
| 2007 |
re-running the configure script with MAKE="gmake" (or whatever is |
| 2008 |
necessary). You can also try re-running configure with the |
| 2009 |
'--disable-dependency-tracking' option to at least be able to build |
| 2010 |
the package (albeit without support for automatic dependency tracking).]) |
| 2011 |
fi |
| 2012 |
AS_UNSET([am_dirpart]) |
| 2013 |
AS_UNSET([am_filepart]) |
| 2014 |
AS_UNSET([am_mf]) |
| 2015 |
AS_UNSET([am_rc]) |
| 2016 |
rm -f conftest-deps.mk |
| 2017 |
} |
| 2018 |
])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 2019 |
|
| 2020 |
|
| 2021 |
# AM_OUTPUT_DEPENDENCY_COMMANDS |
| 2022 |
# ----------------------------- |
| 2023 |
# This macro should only be invoked once -- use via AC_REQUIRE. |
| 2024 |
# |
| 2025 |
# This code is only required when automatic dependency tracking is enabled. |
| 2026 |
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in |
| 2027 |
# order to bootstrap the dependency handling code. |
| 2028 |
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 2029 |
[AC_CONFIG_COMMANDS([depfiles], |
| 2030 |
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 2031 |
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) |
| 2032 |
|
| 2033 |
# Do all the work for Automake. -*- Autoconf -*- |
| 2034 |
|
| 2035 |
# Copyright (C) 1996-2024 Free Software Foundation, Inc. |
| 2036 |
# |
| 2037 |
# This file is free software; the Free Software Foundation |
| 2038 |
# gives unlimited permission to copy and/or distribute it, |
| 2039 |
# with or without modifications, as long as this notice is preserved. |
| 2040 |
|
| 2041 |
# This macro actually does too much. Some checks are only needed if |
| 2042 |
# your package does certain things. But this isn't really a big deal. |
| 2043 |
|
| 2044 |
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. |
| 2045 |
m4_define([AC_PROG_CC], |
| 2046 |
m4_defn([AC_PROG_CC]) |
| 2047 |
[_AM_PROG_CC_C_O |
| 2048 |
]) |
| 2049 |
|
| 2050 |
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) |
| 2051 |
# AM_INIT_AUTOMAKE([OPTIONS]) |
| 2052 |
# ----------------------------------------------- |
| 2053 |
# The call with PACKAGE and VERSION arguments is the old style |
| 2054 |
# call (pre autoconf-2.50), which is being phased out. PACKAGE |
| 2055 |
# and VERSION should now be passed to AC_INIT and removed from |
| 2056 |
# the call to AM_INIT_AUTOMAKE. |
| 2057 |
# We support both call styles for the transition. After |
| 2058 |
# the next Automake release, Autoconf can make the AC_INIT |
| 2059 |
# arguments mandatory, and then we can depend on a new Autoconf |
| 2060 |
# release and drop the old call support. |
| 2061 |
AC_DEFUN([AM_INIT_AUTOMAKE], |
| 2062 |
[AC_PREREQ([2.65])dnl |
| 2063 |
m4_ifdef([_$0_ALREADY_INIT], |
| 2064 |
[m4_fatal([$0 expanded multiple times |
| 2065 |
]m4_defn([_$0_ALREADY_INIT]))], |
| 2066 |
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl |
| 2067 |
dnl Autoconf wants to disallow AM_ names. We explicitly allow |
| 2068 |
dnl the ones we care about. |
| 2069 |
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
| 2070 |
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
| 2071 |
AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 2072 |
if test "`cd $srcdir && pwd`" != "`pwd`"; then |
| 2073 |
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output |
| 2074 |
# is not polluted with repeated "-I." |
| 2075 |
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl |
| 2076 |
# test to see if srcdir already configured |
| 2077 |
if test -f $srcdir/config.status; then |
| 2078 |
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
| 2079 |
fi |
| 2080 |
fi |
| 2081 |
|
| 2082 |
# test whether we have cygpath |
| 2083 |
if test -z "$CYGPATH_W"; then |
| 2084 |
if (cygpath --version) >/dev/null 2>/dev/null; then |
| 2085 |
CYGPATH_W='cygpath -w' |
| 2086 |
else |
| 2087 |
CYGPATH_W=echo |
| 2088 |
fi |
| 2089 |
fi |
| 2090 |
AC_SUBST([CYGPATH_W]) |
| 2091 |
|
| 2092 |
# Define the identity of the package. |
| 2093 |
dnl Distinguish between old-style and new-style calls. |
| 2094 |
m4_ifval([$2], |
| 2095 |
[AC_DIAGNOSE([obsolete], |
| 2096 |
[$0: two- and three-arguments forms are deprecated.]) |
| 2097 |
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
| 2098 |
AC_SUBST([PACKAGE], [$1])dnl |
| 2099 |
AC_SUBST([VERSION], [$2])], |
| 2100 |
[_AM_SET_OPTIONS([$1])dnl |
| 2101 |
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
| 2102 |
m4_if( |
| 2103 |
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), |
| 2104 |
[ok:ok],, |
| 2105 |
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl |
| 2106 |
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
| 2107 |
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
| 2108 |
|
| 2109 |
_AM_IF_OPTION([no-define],, |
| 2110 |
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) |
| 2111 |
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl |
| 2112 |
|
| 2113 |
# Some tools Automake needs. |
| 2114 |
AC_REQUIRE([AM_SANITY_CHECK])dnl |
| 2115 |
AC_REQUIRE([AC_ARG_PROGRAM])dnl |
| 2116 |
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) |
| 2117 |
AM_MISSING_PROG([AUTOCONF], [autoconf]) |
| 2118 |
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) |
| 2119 |
AM_MISSING_PROG([AUTOHEADER], [autoheader]) |
| 2120 |
AM_MISSING_PROG([MAKEINFO], [makeinfo]) |
| 2121 |
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 2122 |
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
| 2123 |
AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
| 2124 |
# For better backward compatibility. To be removed once Automake 1.9.x |
| 2125 |
# dies out for good. For more background, see: |
| 2126 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
| 2127 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
| 2128 |
AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
| 2129 |
# We need awk for the "check" target (and possibly the TAP driver). The |
| 2130 |
# system "awk" is bad on some platforms. |
| 2131 |
AC_REQUIRE([AC_PROG_AWK])dnl |
| 2132 |
AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
| 2133 |
AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 2134 |
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
| 2135 |
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
| 2136 |
[_AM_PROG_TAR([v7])])]) |
| 2137 |
_AM_IF_OPTION([no-dependencies],, |
| 2138 |
[AC_PROVIDE_IFELSE([AC_PROG_CC], |
| 2139 |
[_AM_DEPENDENCIES([CC])], |
| 2140 |
[m4_define([AC_PROG_CC], |
| 2141 |
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl |
| 2142 |
AC_PROVIDE_IFELSE([AC_PROG_CXX], |
| 2143 |
[_AM_DEPENDENCIES([CXX])], |
| 2144 |
[m4_define([AC_PROG_CXX], |
| 2145 |
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl |
| 2146 |
AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
| 2147 |
[_AM_DEPENDENCIES([OBJC])], |
| 2148 |
[m4_define([AC_PROG_OBJC], |
| 2149 |
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl |
| 2150 |
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], |
| 2151 |
[_AM_DEPENDENCIES([OBJCXX])], |
| 2152 |
[m4_define([AC_PROG_OBJCXX], |
| 2153 |
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl |
| 2154 |
]) |
| 2155 |
# Variables for tags utilities; see am/tags.am |
| 2156 |
if test -z "$CTAGS"; then |
| 2157 |
CTAGS=ctags |
| 2158 |
fi |
| 2159 |
AC_SUBST([CTAGS]) |
| 2160 |
if test -z "$ETAGS"; then |
| 2161 |
ETAGS=etags |
| 2162 |
fi |
| 2163 |
AC_SUBST([ETAGS]) |
| 2164 |
if test -z "$CSCOPE"; then |
| 2165 |
CSCOPE=cscope |
| 2166 |
fi |
| 2167 |
AC_SUBST([CSCOPE]) |
| 2168 |
|
| 2169 |
AC_REQUIRE([_AM_SILENT_RULES])dnl |
| 2170 |
dnl The testsuite driver may need to know about EXEEXT, so add the |
| 2171 |
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This |
| 2172 |
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. |
| 2173 |
AC_CONFIG_COMMANDS_PRE(dnl |
| 2174 |
[m4_provide_if([_AM_COMPILER_EXEEXT], |
| 2175 |
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
| 2176 |
|
| 2177 |
AC_REQUIRE([_AM_PROG_RM_F]) |
| 2178 |
AC_REQUIRE([_AM_PROG_XARGS_N]) |
| 2179 |
|
| 2180 |
dnl The trailing newline in this macro's definition is deliberate, for |
| 2181 |
dnl backward compatibility and to allow trailing 'dnl'-style comments |
| 2182 |
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. |
| 2183 |
]) |
| 2184 |
|
| 2185 |
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
| 2186 |
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
| 2187 |
dnl mangled by Autoconf and run in a shell conditional statement. |
| 2188 |
m4_define([_AC_COMPILER_EXEEXT], |
| 2189 |
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) |
| 2190 |
|
| 2191 |
# When config.status generates a header, we must update the stamp-h file. |
| 2192 |
# This file resides in the same directory as the config header |
| 2193 |
# that is generated. The stamp files are numbered to have different names. |
| 2194 |
|
| 2195 |
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the |
| 2196 |
# loop where config.status creates the headers, so we can generate |
| 2197 |
# our stamp files there. |
| 2198 |
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
| 2199 |
[# Compute $1's index in $config_headers. |
| 2200 |
_am_arg=$1 |
| 2201 |
_am_stamp_count=1 |
| 2202 |
for _am_header in $config_headers :; do |
| 2203 |
case $_am_header in |
| 2204 |
$_am_arg | $_am_arg:* ) |
| 2205 |
break ;; |
| 2206 |
* ) |
| 2207 |
_am_stamp_count=`expr $_am_stamp_count + 1` ;; |
| 2208 |
esac |
| 2209 |
done |
| 2210 |
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
| 2211 |
|
| 2212 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 2213 |
# |
| 2214 |
# This file is free software; the Free Software Foundation |
| 2215 |
# gives unlimited permission to copy and/or distribute it, |
| 2216 |
# with or without modifications, as long as this notice is preserved. |
| 2217 |
|
| 2218 |
# AM_PROG_INSTALL_SH |
| 2219 |
# ------------------ |
| 2220 |
# Define $install_sh. |
| 2221 |
AC_DEFUN([AM_PROG_INSTALL_SH], |
| 2222 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2223 |
if test x"${install_sh+set}" != xset; then |
| 2224 |
case $am_aux_dir in |
| 2225 |
*\ * | *\ *) |
| 2226 |
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
| 2227 |
*) |
| 2228 |
install_sh="\${SHELL} $am_aux_dir/install-sh" |
| 2229 |
esac |
| 2230 |
fi |
| 2231 |
AC_SUBST([install_sh])]) |
| 2232 |
|
| 2233 |
# Copyright (C) 2003-2024 Free Software Foundation, Inc. |
| 2234 |
# |
| 2235 |
# This file is free software; the Free Software Foundation |
| 2236 |
# gives unlimited permission to copy and/or distribute it, |
| 2237 |
# with or without modifications, as long as this notice is preserved. |
| 2238 |
|
| 2239 |
# Check whether the underlying file-system supports filenames |
| 2240 |
# with a leading dot. For instance MS-DOS doesn't. |
| 2241 |
AC_DEFUN([AM_SET_LEADING_DOT], |
| 2242 |
[rm -rf .tst 2>/dev/null |
| 2243 |
mkdir .tst 2>/dev/null |
| 2244 |
if test -d .tst; then |
| 2245 |
am__leading_dot=. |
| 2246 |
else |
| 2247 |
am__leading_dot=_ |
| 2248 |
fi |
| 2249 |
rmdir .tst 2>/dev/null |
| 2250 |
AC_SUBST([am__leading_dot])]) |
| 2251 |
|
| 2252 |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
| 2253 |
|
| 2254 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 2255 |
# |
| 2256 |
# This file is free software; the Free Software Foundation |
| 2257 |
# gives unlimited permission to copy and/or distribute it, |
| 2258 |
# with or without modifications, as long as this notice is preserved. |
| 2259 |
|
| 2260 |
# AM_MAKE_INCLUDE() |
| 2261 |
# ----------------- |
| 2262 |
# Check whether make has an 'include' directive that can support all |
| 2263 |
# the idioms we need for our automatic dependency tracking code. |
| 2264 |
AC_DEFUN([AM_MAKE_INCLUDE], |
| 2265 |
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) |
| 2266 |
cat > confinc.mk << 'END' |
| 2267 |
am__doit: |
| 2268 |
@echo this is the am__doit target >confinc.out |
| 2269 |
.PHONY: am__doit |
| 2270 |
END |
| 2271 |
am__include="#" |
| 2272 |
am__quote= |
| 2273 |
# BSD make does it like this. |
| 2274 |
echo '.include "confinc.mk" # ignored' > confmf.BSD |
| 2275 |
# Other make implementations (GNU, Solaris 10, AIX) do it like this. |
| 2276 |
echo 'include confinc.mk # ignored' > confmf.GNU |
| 2277 |
_am_result=no |
| 2278 |
for s in GNU BSD; do |
| 2279 |
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) |
| 2280 |
AS_CASE([$?:`cat confinc.out 2>/dev/null`], |
| 2281 |
['0:this is the am__doit target'], |
| 2282 |
[AS_CASE([$s], |
| 2283 |
[BSD], [am__include='.include' am__quote='"'], |
| 2284 |
[am__include='include' am__quote=''])]) |
| 2285 |
if test "$am__include" != "#"; then |
| 2286 |
_am_result="yes ($s style)" |
| 2287 |
break |
| 2288 |
fi |
| 2289 |
done |
| 2290 |
rm -f confinc.* confmf.* |
| 2291 |
AC_MSG_RESULT([${_am_result}]) |
| 2292 |
AC_SUBST([am__include])]) |
| 2293 |
AC_SUBST([am__quote])]) |
| 2294 |
|
| 2295 |
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
| 2296 |
|
| 2297 |
# Copyright (C) 1997-2024 Free Software Foundation, Inc. |
| 2298 |
# |
| 2299 |
# This file is free software; the Free Software Foundation |
| 2300 |
# gives unlimited permission to copy and/or distribute it, |
| 2301 |
# with or without modifications, as long as this notice is preserved. |
| 2302 |
|
| 2303 |
# AM_MISSING_PROG(NAME, PROGRAM) |
| 2304 |
# ------------------------------ |
| 2305 |
AC_DEFUN([AM_MISSING_PROG], |
| 2306 |
[AC_REQUIRE([AM_MISSING_HAS_RUN]) |
| 2307 |
$1=${$1-"${am_missing_run}$2"} |
| 2308 |
AC_SUBST($1)]) |
| 2309 |
|
| 2310 |
# AM_MISSING_HAS_RUN |
| 2311 |
# ------------------ |
| 2312 |
# Define MISSING if not defined so far and test if it is modern enough. |
| 2313 |
# If it is, set am_missing_run to use it, otherwise, to nothing. |
| 2314 |
AC_DEFUN([AM_MISSING_HAS_RUN], |
| 2315 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2316 |
AC_REQUIRE_AUX_FILE([missing])dnl |
| 2317 |
if test x"${MISSING+set}" != xset; then |
| 2318 |
MISSING="\${SHELL} '$am_aux_dir/missing'" |
| 2319 |
fi |
| 2320 |
# Use eval to expand $SHELL |
| 2321 |
if eval "$MISSING --is-lightweight"; then |
| 2322 |
am_missing_run="$MISSING " |
| 2323 |
else |
| 2324 |
am_missing_run= |
| 2325 |
AC_MSG_WARN(['missing' script is too old or missing]) |
| 2326 |
fi |
| 2327 |
]) |
| 2328 |
|
| 2329 |
# Helper functions for option handling. -*- Autoconf -*- |
| 2330 |
|
| 2331 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 2332 |
# |
| 2333 |
# This file is free software; the Free Software Foundation |
| 2334 |
# gives unlimited permission to copy and/or distribute it, |
| 2335 |
# with or without modifications, as long as this notice is preserved. |
| 2336 |
|
| 2337 |
# _AM_MANGLE_OPTION(NAME) |
| 2338 |
# ----------------------- |
| 2339 |
AC_DEFUN([_AM_MANGLE_OPTION], |
| 2340 |
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) |
| 2341 |
|
| 2342 |
# _AM_SET_OPTION(NAME) |
| 2343 |
# -------------------- |
| 2344 |
# Set option NAME. Presently that only means defining a flag for this option. |
| 2345 |
AC_DEFUN([_AM_SET_OPTION], |
| 2346 |
[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) |
| 2347 |
|
| 2348 |
# _AM_SET_OPTIONS(OPTIONS) |
| 2349 |
# ------------------------ |
| 2350 |
# OPTIONS is a space-separated list of Automake options. |
| 2351 |
AC_DEFUN([_AM_SET_OPTIONS], |
| 2352 |
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) |
| 2353 |
|
| 2354 |
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) |
| 2355 |
# ------------------------------------------- |
| 2356 |
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. |
| 2357 |
AC_DEFUN([_AM_IF_OPTION], |
| 2358 |
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
| 2359 |
|
| 2360 |
# Copyright (C) 1999-2024 Free Software Foundation, Inc. |
| 2361 |
# |
| 2362 |
# This file is free software; the Free Software Foundation |
| 2363 |
# gives unlimited permission to copy and/or distribute it, |
| 2364 |
# with or without modifications, as long as this notice is preserved. |
| 2365 |
|
| 2366 |
# _AM_PROG_CC_C_O |
| 2367 |
# --------------- |
| 2368 |
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC |
| 2369 |
# to automatically call this. |
| 2370 |
AC_DEFUN([_AM_PROG_CC_C_O], |
| 2371 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 2372 |
AC_REQUIRE_AUX_FILE([compile])dnl |
| 2373 |
AC_LANG_PUSH([C])dnl |
| 2374 |
AC_CACHE_CHECK( |
| 2375 |
[whether $CC understands -c and -o together], |
| 2376 |
[am_cv_prog_cc_c_o], |
| 2377 |
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) |
| 2378 |
# Make sure it works both with $CC and with simple cc. |
| 2379 |
# Following AC_PROG_CC_C_O, we do the test twice because some |
| 2380 |
# compilers refuse to overwrite an existing .o file with -o, |
| 2381 |
# though they will create one. |
| 2382 |
am_cv_prog_cc_c_o=yes |
| 2383 |
for am_i in 1 2; do |
| 2384 |
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ |
| 2385 |
&& test -f conftest2.$ac_objext; then |
| 2386 |
: OK |
| 2387 |
else |
| 2388 |
am_cv_prog_cc_c_o=no |
| 2389 |
break |
| 2390 |
fi |
| 2391 |
done |
| 2392 |
rm -f core conftest* |
| 2393 |
unset am_i]) |
| 2394 |
if test "$am_cv_prog_cc_c_o" != yes; then |
| 2395 |
# Losing compiler, so override with the script. |
| 2396 |
# FIXME: It is wrong to rewrite CC. |
| 2397 |
# But if we don't then we get into trouble of one sort or another. |
| 2398 |
# A longer-term fix would be to have automake use am__CC in this case, |
| 2399 |
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" |
| 2400 |
CC="$am_aux_dir/compile $CC" |
| 2401 |
fi |
| 2402 |
AC_LANG_POP([C])]) |
| 2403 |
|
| 2404 |
# For backward compatibility. |
| 2405 |
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
| 2406 |
|
| 2407 |
# Copyright (C) 1999-2024 Free Software Foundation, Inc. |
| 2408 |
# |
| 2409 |
# This file is free software; the Free Software Foundation |
| 2410 |
# gives unlimited permission to copy and/or distribute it, |
| 2411 |
# with or without modifications, as long as this notice is preserved. |
| 2412 |
|
| 2413 |
|
| 2414 |
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 2415 |
# --------------------------------------------------------------------------- |
| 2416 |
# Adds support for distributing Python modules and packages. To |
| 2417 |
# install modules, copy them to $(pythondir), using the python_PYTHON |
| 2418 |
# automake variable. To install a package with the same name as the |
| 2419 |
# automake package, install to $(pkgpythondir), or use the |
| 2420 |
# pkgpython_PYTHON automake variable. |
| 2421 |
# |
| 2422 |
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as |
| 2423 |
# locations to install python extension modules (shared libraries). |
| 2424 |
# Another macro is required to find the appropriate flags to compile |
| 2425 |
# extension modules. |
| 2426 |
# |
| 2427 |
# If your package is configured with a different prefix to python, |
| 2428 |
# users will have to add the install directory to the PYTHONPATH |
| 2429 |
# environment variable, or create a .pth file (see the python |
| 2430 |
# documentation for details). |
| 2431 |
# |
| 2432 |
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will |
| 2433 |
# cause an error if the version of python installed on the system |
| 2434 |
# doesn't meet the requirement. MINIMUM-VERSION should consist of |
| 2435 |
# numbers and dots only. |
| 2436 |
AC_DEFUN([AM_PATH_PYTHON], |
| 2437 |
[ |
| 2438 |
dnl Find a Python interpreter. Python versions prior to 2.0 are not |
| 2439 |
dnl supported. (2.0 was released on October 16, 2000). |
| 2440 |
m4_define_default([_AM_PYTHON_INTERPRETER_LIST], |
| 2441 |
[python python3 dnl |
| 2442 |
python3.20 python3.19 python3.18 python3.17 python3.16 dnl |
| 2443 |
python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 dnl |
| 2444 |
python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl |
| 2445 |
python3.2 python3.1 python3.0 dnl |
| 2446 |
python2 dnl |
| 2447 |
python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl |
| 2448 |
python2.0]) |
| 2449 |
|
| 2450 |
AC_ARG_VAR([PYTHON], [the Python interpreter]) |
| 2451 |
|
| 2452 |
m4_if([$1],[],[ |
| 2453 |
dnl No version check is needed. |
| 2454 |
# Find any Python interpreter. |
| 2455 |
if test -z "$PYTHON"; then |
| 2456 |
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) |
| 2457 |
fi |
| 2458 |
am_display_PYTHON=python |
| 2459 |
], [ |
| 2460 |
dnl A version check is needed. |
| 2461 |
if test -n "$PYTHON"; then |
| 2462 |
# If the user set $PYTHON, use it and don't search something else. |
| 2463 |
AC_MSG_CHECKING([whether $PYTHON version is >= $1]) |
| 2464 |
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], |
| 2465 |
[AC_MSG_RESULT([yes])], |
| 2466 |
[AC_MSG_RESULT([no]) |
| 2467 |
AC_MSG_ERROR([Python interpreter is too old])]) |
| 2468 |
am_display_PYTHON=$PYTHON |
| 2469 |
else |
| 2470 |
# Otherwise, try each interpreter until we find one that satisfies |
| 2471 |
# VERSION. |
| 2472 |
AC_CACHE_CHECK([for a Python interpreter with version >= $1], |
| 2473 |
[am_cv_pathless_PYTHON],[ |
| 2474 |
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do |
| 2475 |
test "$am_cv_pathless_PYTHON" = none && break |
| 2476 |
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) |
| 2477 |
done]) |
| 2478 |
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. |
| 2479 |
if test "$am_cv_pathless_PYTHON" = none; then |
| 2480 |
PYTHON=: |
| 2481 |
else |
| 2482 |
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) |
| 2483 |
fi |
| 2484 |
am_display_PYTHON=$am_cv_pathless_PYTHON |
| 2485 |
fi |
| 2486 |
]) |
| 2487 |
|
| 2488 |
if test "$PYTHON" = :; then |
| 2489 |
dnl Run any user-specified action, or abort. |
| 2490 |
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) |
| 2491 |
else |
| 2492 |
|
| 2493 |
dnl Query Python for its version number. Although site.py simply uses |
| 2494 |
dnl sys.version[:3], printing that failed with Python 3.10, since the |
| 2495 |
dnl trailing zero was eliminated. So now we output just the major |
| 2496 |
dnl and minor version numbers, as numbers. Apparently the tertiary |
| 2497 |
dnl version is not of interest. |
| 2498 |
dnl |
| 2499 |
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], |
| 2500 |
[am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[[:2]])"`]) |
| 2501 |
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) |
| 2502 |
|
| 2503 |
dnl At times, e.g., when building shared libraries, you may want |
| 2504 |
dnl to know which OS platform Python thinks this is. |
| 2505 |
dnl |
| 2506 |
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], |
| 2507 |
[am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) |
| 2508 |
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) |
| 2509 |
|
| 2510 |
dnl emacs-page |
| 2511 |
dnl If --with-python-sys-prefix is given, use the values of sys.prefix |
| 2512 |
dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX |
| 2513 |
dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and |
| 2514 |
dnl ${exec_prefix} variables. |
| 2515 |
dnl |
| 2516 |
dnl The two are made distinct variables so they can be overridden if |
| 2517 |
dnl need be, although general consensus is that you shouldn't need |
| 2518 |
dnl this separation. |
| 2519 |
dnl |
| 2520 |
dnl Also allow directly setting the prefixes via configure options, |
| 2521 |
dnl overriding any default. |
| 2522 |
dnl |
| 2523 |
if test "x$prefix" = xNONE; then |
| 2524 |
am__usable_prefix=$ac_default_prefix |
| 2525 |
else |
| 2526 |
am__usable_prefix=$prefix |
| 2527 |
fi |
| 2528 |
|
| 2529 |
# Allow user to request using sys.* values from Python, |
| 2530 |
# instead of the GNU $prefix values. |
| 2531 |
AC_ARG_WITH([python-sys-prefix], |
| 2532 |
[AS_HELP_STRING([--with-python-sys-prefix], |
| 2533 |
[use Python's sys.prefix and sys.exec_prefix values])], |
| 2534 |
[am_use_python_sys=:], |
| 2535 |
[am_use_python_sys=false]) |
| 2536 |
|
| 2537 |
# Allow user to override whatever the default Python prefix is. |
| 2538 |
AC_ARG_WITH([python_prefix], |
| 2539 |
[AS_HELP_STRING([--with-python_prefix], |
| 2540 |
[override the default PYTHON_PREFIX])], |
| 2541 |
[am_python_prefix_subst=$withval |
| 2542 |
am_cv_python_prefix=$withval |
| 2543 |
AC_MSG_CHECKING([for explicit $am_display_PYTHON prefix]) |
| 2544 |
AC_MSG_RESULT([$am_cv_python_prefix])], |
| 2545 |
[ |
| 2546 |
if $am_use_python_sys; then |
| 2547 |
# using python sys.prefix value, not GNU |
| 2548 |
AC_CACHE_CHECK([for python default $am_display_PYTHON prefix], |
| 2549 |
[am_cv_python_prefix], |
| 2550 |
[am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`]) |
| 2551 |
|
| 2552 |
dnl If sys.prefix is a subdir of $prefix, replace the literal value of |
| 2553 |
dnl $prefix with a variable reference so it can be overridden. |
| 2554 |
case $am_cv_python_prefix in |
| 2555 |
$am__usable_prefix*) |
| 2556 |
am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` |
| 2557 |
am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` |
| 2558 |
;; |
| 2559 |
*) |
| 2560 |
am_python_prefix_subst=$am_cv_python_prefix |
| 2561 |
;; |
| 2562 |
esac |
| 2563 |
else # using GNU prefix value, not python sys.prefix |
| 2564 |
am_python_prefix_subst='${prefix}' |
| 2565 |
am_python_prefix=$am_python_prefix_subst |
| 2566 |
AC_MSG_CHECKING([for GNU default $am_display_PYTHON prefix]) |
| 2567 |
AC_MSG_RESULT([$am_python_prefix]) |
| 2568 |
fi]) |
| 2569 |
# Substituting python_prefix_subst value. |
| 2570 |
AC_SUBST([PYTHON_PREFIX], [$am_python_prefix_subst]) |
| 2571 |
|
| 2572 |
# emacs-page Now do it all over again for Python exec_prefix, but with yet |
| 2573 |
# another conditional: fall back to regular prefix if that was specified. |
| 2574 |
AC_ARG_WITH([python_exec_prefix], |
| 2575 |
[AS_HELP_STRING([--with-python_exec_prefix], |
| 2576 |
[override the default PYTHON_EXEC_PREFIX])], |
| 2577 |
[am_python_exec_prefix_subst=$withval |
| 2578 |
am_cv_python_exec_prefix=$withval |
| 2579 |
AC_MSG_CHECKING([for explicit $am_display_PYTHON exec_prefix]) |
| 2580 |
AC_MSG_RESULT([$am_cv_python_exec_prefix])], |
| 2581 |
[ |
| 2582 |
# no explicit --with-python_exec_prefix, but if |
| 2583 |
# --with-python_prefix was given, use its value for python_exec_prefix too. |
| 2584 |
AS_IF([test -n "$with_python_prefix"], |
| 2585 |
[am_python_exec_prefix_subst=$with_python_prefix |
| 2586 |
am_cv_python_exec_prefix=$with_python_prefix |
| 2587 |
AC_MSG_CHECKING([for python_prefix-given $am_display_PYTHON exec_prefix]) |
| 2588 |
AC_MSG_RESULT([$am_cv_python_exec_prefix])], |
| 2589 |
[ |
| 2590 |
# Set am__usable_exec_prefix whether using GNU or Python values, |
| 2591 |
# since we use that variable for pyexecdir. |
| 2592 |
if test "x$exec_prefix" = xNONE; then |
| 2593 |
am__usable_exec_prefix=$am__usable_prefix |
| 2594 |
else |
| 2595 |
am__usable_exec_prefix=$exec_prefix |
| 2596 |
fi |
| 2597 |
# |
| 2598 |
if $am_use_python_sys; then # using python sys.exec_prefix, not GNU |
| 2599 |
AC_CACHE_CHECK([for python default $am_display_PYTHON exec_prefix], |
| 2600 |
[am_cv_python_exec_prefix], |
| 2601 |
[am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`]) |
| 2602 |
dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the |
| 2603 |
dnl literal value of $exec_prefix with a variable reference so it can |
| 2604 |
dnl be overridden. |
| 2605 |
case $am_cv_python_exec_prefix in |
| 2606 |
$am__usable_exec_prefix*) |
| 2607 |
am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` |
| 2608 |
am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` |
| 2609 |
;; |
| 2610 |
*) |
| 2611 |
am_python_exec_prefix_subst=$am_cv_python_exec_prefix |
| 2612 |
;; |
| 2613 |
esac |
| 2614 |
else # using GNU $exec_prefix, not python sys.exec_prefix |
| 2615 |
am_python_exec_prefix_subst='${exec_prefix}' |
| 2616 |
am_python_exec_prefix=$am_python_exec_prefix_subst |
| 2617 |
AC_MSG_CHECKING([for GNU default $am_display_PYTHON exec_prefix]) |
| 2618 |
AC_MSG_RESULT([$am_python_exec_prefix]) |
| 2619 |
fi])]) |
| 2620 |
# Substituting python_exec_prefix_subst. |
| 2621 |
AC_SUBST([PYTHON_EXEC_PREFIX], [$am_python_exec_prefix_subst]) |
| 2622 |
|
| 2623 |
# Factor out some code duplication into this shell variable. |
| 2624 |
am_python_setup_sysconfig="\ |
| 2625 |
import sys |
| 2626 |
# Prefer sysconfig over distutils.sysconfig, for better compatibility |
| 2627 |
# with python 3.x. See automake bug#10227. |
| 2628 |
try: |
| 2629 |
import sysconfig |
| 2630 |
except ImportError: |
| 2631 |
can_use_sysconfig = 0 |
| 2632 |
else: |
| 2633 |
can_use_sysconfig = 1 |
| 2634 |
# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: |
| 2635 |
# <https://github.com/pypa/virtualenv/issues/118> |
| 2636 |
try: |
| 2637 |
from platform import python_implementation |
| 2638 |
if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': |
| 2639 |
can_use_sysconfig = 0 |
| 2640 |
except ImportError: |
| 2641 |
pass" # end of am_python_setup_sysconfig |
| 2642 |
|
| 2643 |
# More repeated code, for figuring out the installation scheme to use. |
| 2644 |
am_python_setup_scheme="if hasattr(sysconfig, 'get_default_scheme'): |
| 2645 |
scheme = sysconfig.get_default_scheme() |
| 2646 |
else: |
| 2647 |
scheme = sysconfig._get_default_scheme() |
| 2648 |
if scheme == 'posix_local': |
| 2649 |
if '$am_py_prefix' == '/usr': |
| 2650 |
scheme = 'deb_system' # should only happen during Debian package builds |
| 2651 |
else: |
| 2652 |
# Debian's default scheme installs to /usr/local/ but we want to |
| 2653 |
# follow the prefix, as we always have. |
| 2654 |
# See bugs#54412, #64837, et al. |
| 2655 |
scheme = 'posix_prefix'" # end of am_python_setup_scheme |
| 2656 |
|
| 2657 |
dnl emacs-page Set up 4 directories: |
| 2658 |
|
| 2659 |
dnl 1. pythondir: where to install python scripts. This is the |
| 2660 |
dnl site-packages directory, not the python standard library |
| 2661 |
dnl directory as in early automake betas. This behavior |
| 2662 |
dnl is more consistent with lispdir.m4 for example. |
| 2663 |
dnl Query sysconfig or distutils (per above) for this directory. |
| 2664 |
dnl |
| 2665 |
AC_CACHE_CHECK([for $am_display_PYTHON script directory (pythondir)], |
| 2666 |
[am_cv_python_pythondir], |
| 2667 |
[if test "x$am_cv_python_prefix" = x; then |
| 2668 |
am_py_prefix=$am__usable_prefix |
| 2669 |
else |
| 2670 |
am_py_prefix=$am_cv_python_prefix |
| 2671 |
fi |
| 2672 |
am_cv_python_pythondir=`$PYTHON -c " |
| 2673 |
$am_python_setup_sysconfig |
| 2674 |
if can_use_sysconfig: |
| 2675 |
try: |
| 2676 |
$am_python_setup_scheme |
| 2677 |
sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'}) |
| 2678 |
except: |
| 2679 |
sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) |
| 2680 |
else: |
| 2681 |
from distutils import sysconfig |
| 2682 |
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') |
| 2683 |
sys.stdout.write(sitedir)"` |
| 2684 |
# |
| 2685 |
case $am_cv_python_pythondir in |
| 2686 |
$am_py_prefix*) |
| 2687 |
am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` |
| 2688 |
am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` |
| 2689 |
;; |
| 2690 |
*) |
| 2691 |
case $am_py_prefix in |
| 2692 |
/usr|/System*) ;; |
| 2693 |
*) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" |
| 2694 |
;; |
| 2695 |
esac |
| 2696 |
;; |
| 2697 |
esac |
| 2698 |
]) |
| 2699 |
AC_SUBST([pythondir], [$am_cv_python_pythondir]) |
| 2700 |
|
| 2701 |
dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was |
| 2702 |
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is |
| 2703 |
dnl more consistent with the rest of automake. |
| 2704 |
dnl |
| 2705 |
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) |
| 2706 |
|
| 2707 |
dnl 3. pyexecdir: directory for installing python extension modules |
| 2708 |
dnl (shared libraries). |
| 2709 |
dnl Query sysconfig or distutils for this directory. |
| 2710 |
dnl Much of this is the same as for prefix setup above. |
| 2711 |
dnl |
| 2712 |
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory (pyexecdir)], |
| 2713 |
[am_cv_python_pyexecdir], |
| 2714 |
[if test "x$am_cv_python_exec_prefix" = x; then |
| 2715 |
am_py_exec_prefix=$am__usable_exec_prefix |
| 2716 |
else |
| 2717 |
am_py_exec_prefix=$am_cv_python_exec_prefix |
| 2718 |
fi |
| 2719 |
am_cv_python_pyexecdir=`$PYTHON -c " |
| 2720 |
$am_python_setup_sysconfig |
| 2721 |
if can_use_sysconfig: |
| 2722 |
try: |
| 2723 |
$am_python_setup_scheme |
| 2724 |
sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'}) |
| 2725 |
except: |
| 2726 |
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) |
| 2727 |
else: |
| 2728 |
from distutils import sysconfig |
| 2729 |
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') |
| 2730 |
sys.stdout.write(sitedir)"` |
| 2731 |
# |
| 2732 |
case $am_cv_python_pyexecdir in |
| 2733 |
$am_py_exec_prefix*) |
| 2734 |
am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` |
| 2735 |
am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` |
| 2736 |
;; |
| 2737 |
*) |
| 2738 |
case $am_py_exec_prefix in |
| 2739 |
/usr|/System*) ;; |
| 2740 |
*) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" |
| 2741 |
;; |
| 2742 |
esac |
| 2743 |
;; |
| 2744 |
esac |
| 2745 |
]) |
| 2746 |
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) |
| 2747 |
|
| 2748 |
dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE) |
| 2749 |
dnl |
| 2750 |
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) |
| 2751 |
|
| 2752 |
dnl Run any user-specified action. |
| 2753 |
$2 |
| 2754 |
fi |
| 2755 |
]) |
| 2756 |
|
| 2757 |
|
| 2758 |
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) |
| 2759 |
# --------------------------------------------------------------------------- |
| 2760 |
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. |
| 2761 |
# Run ACTION-IF-FALSE otherwise. |
| 2762 |
# This test uses sys.hexversion instead of the string equivalent (first |
| 2763 |
# word of sys.version), in order to cope with versions such as 2.2c1. |
| 2764 |
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). |
| 2765 |
AC_DEFUN([AM_PYTHON_CHECK_VERSION], |
| 2766 |
[prog="import sys |
| 2767 |
# split strings by '.' and convert to numeric. Append some zeros |
| 2768 |
# because we need at least 4 digits for the hex conversion. |
| 2769 |
# map returns an iterator in Python 3.0 and a list in 2.x |
| 2770 |
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] |
| 2771 |
minverhex = 0 |
| 2772 |
# xrange is not present in Python 3.0 and range returns an iterator |
| 2773 |
for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] |
| 2774 |
sys.exit(sys.hexversion < minverhex)" |
| 2775 |
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) |
| 2776 |
|
| 2777 |
# Copyright (C) 2022-2024 Free Software Foundation, Inc. |
| 2778 |
# |
| 2779 |
# This file is free software; the Free Software Foundation |
| 2780 |
# gives unlimited permission to copy and/or distribute it, |
| 2781 |
# with or without modifications, as long as this notice is preserved. |
| 2782 |
|
| 2783 |
# _AM_PROG_RM_F |
| 2784 |
# --------------- |
| 2785 |
# Check whether 'rm -f' without any arguments works. |
| 2786 |
# https://bugs.gnu.org/10828 |
| 2787 |
AC_DEFUN([_AM_PROG_RM_F], |
| 2788 |
[am__rm_f_notfound= |
| 2789 |
AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) |
| 2790 |
AC_SUBST(am__rm_f_notfound) |
| 2791 |
]) |
| 2792 |
|
| 2793 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 2794 |
# |
| 2795 |
# This file is free software; the Free Software Foundation |
| 2796 |
# gives unlimited permission to copy and/or distribute it, |
| 2797 |
# with or without modifications, as long as this notice is preserved. |
| 2798 |
|
| 2799 |
# AM_RUN_LOG(COMMAND) |
| 2800 |
# ------------------- |
| 2801 |
# Run COMMAND, save the exit status in ac_status, and log it. |
| 2802 |
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) |
| 2803 |
AC_DEFUN([AM_RUN_LOG], |
| 2804 |
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD |
| 2805 |
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD |
| 2806 |
ac_status=$? |
| 2807 |
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD |
| 2808 |
(exit $ac_status); }]) |
| 2809 |
|
| 2810 |
# Check to make sure that the build environment is sane. -*- Autoconf -*- |
| 2811 |
|
| 2812 |
# Copyright (C) 1996-2024 Free Software Foundation, Inc. |
| 2813 |
# |
| 2814 |
# This file is free software; the Free Software Foundation |
| 2815 |
# gives unlimited permission to copy and/or distribute it, |
| 2816 |
# with or without modifications, as long as this notice is preserved. |
| 2817 |
|
| 2818 |
# _AM_SLEEP_FRACTIONAL_SECONDS |
| 2819 |
# ---------------------------- |
| 2820 |
AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl |
| 2821 |
AC_CACHE_CHECK([whether sleep supports fractional seconds], |
| 2822 |
am_cv_sleep_fractional_seconds, [dnl |
| 2823 |
AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], |
| 2824 |
[am_cv_sleep_fractional_seconds=no]) |
| 2825 |
])]) |
| 2826 |
|
| 2827 |
# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION |
| 2828 |
# ----------------------------------- |
| 2829 |
# Determine the filesystem's resolution for file modification |
| 2830 |
# timestamps. The coarsest we know of is FAT, with a resolution |
| 2831 |
# of only two seconds, even with the most recent "exFAT" extensions. |
| 2832 |
# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one |
| 2833 |
# nanosecond, matching clock_gettime. However, it is probably not |
| 2834 |
# possible to delay execution of a shell script for less than one |
| 2835 |
# millisecond, due to process creation overhead and scheduling |
| 2836 |
# granularity, so we don't check for anything finer than that. (See below.) |
| 2837 |
AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl |
| 2838 |
AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) |
| 2839 |
AC_CACHE_CHECK([filesystem timestamp resolution], |
| 2840 |
am_cv_filesystem_timestamp_resolution, [dnl |
| 2841 |
# Default to the worst case. |
| 2842 |
am_cv_filesystem_timestamp_resolution=2 |
| 2843 |
|
| 2844 |
# Only try to go finer than 1 sec if sleep can do it. |
| 2845 |
# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, |
| 2846 |
# - 1 sec is not much of a win compared to 2 sec, and |
| 2847 |
# - it takes 2 seconds to perform the test whether 1 sec works. |
| 2848 |
# |
| 2849 |
# Instead, just use the default 2s on platforms that have 1s resolution, |
| 2850 |
# accept the extra 1s delay when using $sleep in the Automake tests, in |
| 2851 |
# exchange for not incurring the 2s delay for running the test for all |
| 2852 |
# packages. |
| 2853 |
# |
| 2854 |
am_try_resolutions= |
| 2855 |
if test "$am_cv_sleep_fractional_seconds" = yes; then |
| 2856 |
# Even a millisecond often causes a bunch of false positives, |
| 2857 |
# so just try a hundredth of a second. The time saved between .001 and |
| 2858 |
# .01 is not terribly consequential. |
| 2859 |
am_try_resolutions="0.01 0.1 $am_try_resolutions" |
| 2860 |
fi |
| 2861 |
|
| 2862 |
# In order to catch current-generation FAT out, we must *modify* files |
| 2863 |
# that already exist; the *creation* timestamp is finer. Use names |
| 2864 |
# that make ls -t sort them differently when they have equal |
| 2865 |
# timestamps than when they have distinct timestamps, keeping |
| 2866 |
# in mind that ls -t prints the *newest* file first. |
| 2867 |
rm -f conftest.ts? |
| 2868 |
: > conftest.ts1 |
| 2869 |
: > conftest.ts2 |
| 2870 |
: > conftest.ts3 |
| 2871 |
|
| 2872 |
# Make sure ls -t actually works. Do 'set' in a subshell so we don't |
| 2873 |
# clobber the current shell's arguments. (Outer-level square brackets |
| 2874 |
# are removed by m4; they're present so that m4 does not expand |
| 2875 |
# <dollar><star>; be careful, easy to get confused.) |
| 2876 |
if ( |
| 2877 |
set X `[ls -t conftest.ts[12]]` && |
| 2878 |
{ |
| 2879 |
test "$[]*" != "X conftest.ts1 conftest.ts2" || |
| 2880 |
test "$[]*" != "X conftest.ts2 conftest.ts1"; |
| 2881 |
} |
| 2882 |
); then :; else |
| 2883 |
# If neither matched, then we have a broken ls. This can happen |
| 2884 |
# if, for instance, CONFIG_SHELL is bash and it inherits a |
| 2885 |
# broken ls alias from the environment. This has actually |
| 2886 |
# happened. Such a system could not be considered "sane". |
| 2887 |
_AS_ECHO_UNQUOTED( |
| 2888 |
["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], |
| 2889 |
[AS_MESSAGE_LOG_FD]) |
| 2890 |
AC_MSG_FAILURE([ls -t produces unexpected output. |
| 2891 |
Make sure there is not a broken ls alias in your environment.]) |
| 2892 |
fi |
| 2893 |
|
| 2894 |
for am_try_res in $am_try_resolutions; do |
| 2895 |
# Any one fine-grained sleep might happen to cross the boundary |
| 2896 |
# between two values of a coarser actual resolution, but if we do |
| 2897 |
# two fine-grained sleeps in a row, at least one of them will fall |
| 2898 |
# entirely within a coarse interval. |
| 2899 |
echo alpha > conftest.ts1 |
| 2900 |
sleep $am_try_res |
| 2901 |
echo beta > conftest.ts2 |
| 2902 |
sleep $am_try_res |
| 2903 |
echo gamma > conftest.ts3 |
| 2904 |
|
| 2905 |
# We assume that 'ls -t' will make use of high-resolution |
| 2906 |
# timestamps if the operating system supports them at all. |
| 2907 |
if (set X `ls -t conftest.ts?` && |
| 2908 |
test "$[]2" = conftest.ts3 && |
| 2909 |
test "$[]3" = conftest.ts2 && |
| 2910 |
test "$[]4" = conftest.ts1); then |
| 2911 |
# |
| 2912 |
# Ok, ls -t worked. If we're at a resolution of 1 second, we're done, |
| 2913 |
# because we don't need to test make. |
| 2914 |
make_ok=true |
| 2915 |
if test $am_try_res != 1; then |
| 2916 |
# But if we've succeeded so far with a subsecond resolution, we |
| 2917 |
# have one more thing to check: make. It can happen that |
| 2918 |
# everything else supports the subsecond mtimes, but make doesn't; |
| 2919 |
# notably on macOS, which ships make 3.81 from 2006 (the last one |
| 2920 |
# released under GPLv2). https://bugs.gnu.org/68808 |
| 2921 |
# |
| 2922 |
# We test $MAKE if it is defined in the environment, else "make". |
| 2923 |
# It might get overridden later, but our hope is that in practice |
| 2924 |
# it does not matter: it is the system "make" which is (by far) |
| 2925 |
# the most likely to be broken, whereas if the user overrides it, |
| 2926 |
# probably they did so with a better, or at least not worse, make. |
| 2927 |
# https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html |
| 2928 |
# |
| 2929 |
# Create a Makefile (real tab character here): |
| 2930 |
rm -f conftest.mk |
| 2931 |
echo 'conftest.ts1: conftest.ts2' >conftest.mk |
| 2932 |
echo ' touch conftest.ts2' >>conftest.mk |
| 2933 |
# |
| 2934 |
# Now, running |
| 2935 |
# touch conftest.ts1; touch conftest.ts2; make |
| 2936 |
# should touch ts1 because ts2 is newer. This could happen by luck, |
| 2937 |
# but most often, it will fail if make's support is insufficient. So |
| 2938 |
# test for several consecutive successes. |
| 2939 |
# |
| 2940 |
# (We reuse conftest.ts[12] because we still want to modify existing |
| 2941 |
# files, not create new ones, per above.) |
| 2942 |
n=0 |
| 2943 |
make=${MAKE-make} |
| 2944 |
until test $n -eq 3; do |
| 2945 |
echo one > conftest.ts1 |
| 2946 |
sleep $am_try_res |
| 2947 |
echo two > conftest.ts2 # ts2 should now be newer than ts1 |
| 2948 |
if $make -f conftest.mk | grep 'up to date' >/dev/null; then |
| 2949 |
make_ok=false |
| 2950 |
break # out of $n loop |
| 2951 |
fi |
| 2952 |
n=`expr $n + 1` |
| 2953 |
done |
| 2954 |
fi |
| 2955 |
# |
| 2956 |
if $make_ok; then |
| 2957 |
# Everything we know to check worked out, so call this resolution good. |
| 2958 |
am_cv_filesystem_timestamp_resolution=$am_try_res |
| 2959 |
break # out of $am_try_res loop |
| 2960 |
fi |
| 2961 |
# Otherwise, we'll go on to check the next resolution. |
| 2962 |
fi |
| 2963 |
done |
| 2964 |
rm -f conftest.ts? |
| 2965 |
# (end _am_filesystem_timestamp_resolution) |
| 2966 |
])]) |
| 2967 |
|
| 2968 |
# AM_SANITY_CHECK |
| 2969 |
# --------------- |
| 2970 |
AC_DEFUN([AM_SANITY_CHECK], |
| 2971 |
[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) |
| 2972 |
# This check should not be cached, as it may vary across builds of |
| 2973 |
# different projects. |
| 2974 |
AC_MSG_CHECKING([whether build environment is sane]) |
| 2975 |
# Reject unsafe characters in $srcdir or the absolute working directory |
| 2976 |
# name. Accept space and tab only in the latter. |
| 2977 |
am_lf=' |
| 2978 |
' |
| 2979 |
case `pwd` in |
| 2980 |
*[[\\\"\#\$\&\'\`$am_lf]]*) |
| 2981 |
AC_MSG_ERROR([unsafe absolute working directory name]);; |
| 2982 |
esac |
| 2983 |
case $srcdir in |
| 2984 |
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
| 2985 |
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; |
| 2986 |
esac |
| 2987 |
|
| 2988 |
# Do 'set' in a subshell so we don't clobber the current shell's |
| 2989 |
# arguments. Must try -L first in case configure is actually a |
| 2990 |
# symlink; some systems play weird games with the mod time of symlinks |
| 2991 |
# (eg FreeBSD returns the mod time of the symlink's containing |
| 2992 |
# directory). |
| 2993 |
am_build_env_is_sane=no |
| 2994 |
am_has_slept=no |
| 2995 |
rm -f conftest.file |
| 2996 |
for am_try in 1 2; do |
| 2997 |
echo "timestamp, slept: $am_has_slept" > conftest.file |
| 2998 |
if ( |
| 2999 |
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` |
| 3000 |
if test "$[]*" = "X"; then |
| 3001 |
# -L didn't work. |
| 3002 |
set X `ls -t "$srcdir/configure" conftest.file` |
| 3003 |
fi |
| 3004 |
test "$[]2" = conftest.file |
| 3005 |
); then |
| 3006 |
am_build_env_is_sane=yes |
| 3007 |
break |
| 3008 |
fi |
| 3009 |
# Just in case. |
| 3010 |
sleep "$am_cv_filesystem_timestamp_resolution" |
| 3011 |
am_has_slept=yes |
| 3012 |
done |
| 3013 |
|
| 3014 |
AC_MSG_RESULT([$am_build_env_is_sane]) |
| 3015 |
if test "$am_build_env_is_sane" = no; then |
| 3016 |
AC_MSG_ERROR([newly created file is older than distributed files! |
| 3017 |
Check your system clock]) |
| 3018 |
fi |
| 3019 |
|
| 3020 |
# If we didn't sleep, we still need to ensure time stamps of config.status and |
| 3021 |
# generated files are strictly newer. |
| 3022 |
am_sleep_pid= |
| 3023 |
AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl |
| 3024 |
( sleep "$am_cv_filesystem_timestamp_resolution" ) & |
| 3025 |
am_sleep_pid=$! |
| 3026 |
]) |
| 3027 |
AC_CONFIG_COMMANDS_PRE( |
| 3028 |
[AC_MSG_CHECKING([that generated files are newer than configure]) |
| 3029 |
if test -n "$am_sleep_pid"; then |
| 3030 |
# Hide warnings about reused PIDs. |
| 3031 |
wait $am_sleep_pid 2>/dev/null |
| 3032 |
fi |
| 3033 |
AC_MSG_RESULT([done])]) |
| 3034 |
rm -f conftest.file |
| 3035 |
]) |
| 3036 |
|
| 3037 |
# Copyright (C) 2009-2024 Free Software Foundation, Inc. |
| 3038 |
# |
| 3039 |
# This file is free software; the Free Software Foundation |
| 3040 |
# gives unlimited permission to copy and/or distribute it, |
| 3041 |
# with or without modifications, as long as this notice is preserved. |
| 3042 |
|
| 3043 |
# _AM_SILENT_RULES |
| 3044 |
# ---------------- |
| 3045 |
# Enable less verbose build rules support. |
| 3046 |
AC_DEFUN([_AM_SILENT_RULES], |
| 3047 |
[AM_DEFAULT_VERBOSITY=1 |
| 3048 |
AC_ARG_ENABLE([silent-rules], [dnl |
| 3049 |
AS_HELP_STRING( |
| 3050 |
[--enable-silent-rules], |
| 3051 |
[less verbose build output (undo: "make V=1")]) |
| 3052 |
AS_HELP_STRING( |
| 3053 |
[--disable-silent-rules], |
| 3054 |
[verbose build output (undo: "make V=0")])dnl |
| 3055 |
]) |
| 3056 |
dnl |
| 3057 |
dnl A few 'make' implementations (e.g., NonStop OS and NextStep) |
| 3058 |
dnl do not support nested variable expansions. |
| 3059 |
dnl See automake bug#9928 and bug#10237. |
| 3060 |
am_make=${MAKE-make} |
| 3061 |
AC_CACHE_CHECK([whether $am_make supports nested variables], |
| 3062 |
[am_cv_make_support_nested_variables], |
| 3063 |
[if AS_ECHO([['TRUE=$(BAR$(V)) |
| 3064 |
BAR0=false |
| 3065 |
BAR1=true |
| 3066 |
V=1 |
| 3067 |
am__doit: |
| 3068 |
@$(TRUE) |
| 3069 |
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then |
| 3070 |
am_cv_make_support_nested_variables=yes |
| 3071 |
else |
| 3072 |
am_cv_make_support_nested_variables=no |
| 3073 |
fi]) |
| 3074 |
AC_SUBST([AM_V])dnl |
| 3075 |
AM_SUBST_NOTMAKE([AM_V])dnl |
| 3076 |
AC_SUBST([AM_DEFAULT_V])dnl |
| 3077 |
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl |
| 3078 |
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl |
| 3079 |
AM_BACKSLASH='\' |
| 3080 |
AC_SUBST([AM_BACKSLASH])dnl |
| 3081 |
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
| 3082 |
dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls |
| 3083 |
dnl to AM_SILENT_RULES to change the default value. |
| 3084 |
AC_CONFIG_COMMANDS_PRE([dnl |
| 3085 |
case $enable_silent_rules in @%:@ ((( |
| 3086 |
yes) AM_DEFAULT_VERBOSITY=0;; |
| 3087 |
no) AM_DEFAULT_VERBOSITY=1;; |
| 3088 |
esac |
| 3089 |
if test $am_cv_make_support_nested_variables = yes; then |
| 3090 |
dnl Using '$V' instead of '$(V)' breaks IRIX make. |
| 3091 |
AM_V='$(V)' |
| 3092 |
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' |
| 3093 |
else |
| 3094 |
AM_V=$AM_DEFAULT_VERBOSITY |
| 3095 |
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY |
| 3096 |
fi |
| 3097 |
])dnl |
| 3098 |
]) |
| 3099 |
|
| 3100 |
# AM_SILENT_RULES([DEFAULT]) |
| 3101 |
# -------------------------- |
| 3102 |
# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or |
| 3103 |
# empty being verbose). |
| 3104 |
AC_DEFUN([AM_SILENT_RULES], |
| 3105 |
[AC_REQUIRE([_AM_SILENT_RULES]) |
| 3106 |
AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])]) |
| 3107 |
|
| 3108 |
# Copyright (C) 2001-2024 Free Software Foundation, Inc. |
| 3109 |
# |
| 3110 |
# This file is free software; the Free Software Foundation |
| 3111 |
# gives unlimited permission to copy and/or distribute it, |
| 3112 |
# with or without modifications, as long as this notice is preserved. |
| 3113 |
|
| 3114 |
# AM_PROG_INSTALL_STRIP |
| 3115 |
# --------------------- |
| 3116 |
# One issue with vendor 'install' (even GNU) is that you can't |
| 3117 |
# specify the program used to strip binaries. This is especially |
| 3118 |
# annoying in cross-compiling environments, where the build's strip |
| 3119 |
# is unlikely to handle the host's binaries. |
| 3120 |
# Fortunately install-sh will honor a STRIPPROG variable, so we |
| 3121 |
# always use install-sh in "make install-strip", and initialize |
| 3122 |
# STRIPPROG with the value of the STRIP variable (set by the user). |
| 3123 |
AC_DEFUN([AM_PROG_INSTALL_STRIP], |
| 3124 |
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 3125 |
# Installed binaries are usually stripped using 'strip' when the user |
| 3126 |
# run "make install-strip". However 'strip' might not be the right |
| 3127 |
# tool to use in cross-compilation environments, therefore Automake |
| 3128 |
# will honor the 'STRIP' environment variable to overrule this program. |
| 3129 |
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. |
| 3130 |
if test "$cross_compiling" != no; then |
| 3131 |
AC_CHECK_TOOL([STRIP], [strip], :) |
| 3132 |
fi |
| 3133 |
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
| 3134 |
AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
| 3135 |
|
| 3136 |
# Copyright (C) 2006-2024 Free Software Foundation, Inc. |
| 3137 |
# |
| 3138 |
# This file is free software; the Free Software Foundation |
| 3139 |
# gives unlimited permission to copy and/or distribute it, |
| 3140 |
# with or without modifications, as long as this notice is preserved. |
| 3141 |
|
| 3142 |
# _AM_SUBST_NOTMAKE(VARIABLE) |
| 3143 |
# --------------------------- |
| 3144 |
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. |
| 3145 |
# This macro is traced by Automake. |
| 3146 |
AC_DEFUN([_AM_SUBST_NOTMAKE]) |
| 3147 |
|
| 3148 |
# AM_SUBST_NOTMAKE(VARIABLE) |
| 3149 |
# -------------------------- |
| 3150 |
# Public sister of _AM_SUBST_NOTMAKE. |
| 3151 |
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) |
| 3152 |
|
| 3153 |
# Check how to create a tarball. -*- Autoconf -*- |
| 3154 |
|
| 3155 |
# Copyright (C) 2004-2024 Free Software Foundation, Inc. |
| 3156 |
# |
| 3157 |
# This file is free software; the Free Software Foundation |
| 3158 |
# gives unlimited permission to copy and/or distribute it, |
| 3159 |
# with or without modifications, as long as this notice is preserved. |
| 3160 |
|
| 3161 |
# _AM_PROG_TAR(FORMAT) |
| 3162 |
# -------------------- |
| 3163 |
# Check how to create a tarball in format FORMAT. |
| 3164 |
# FORMAT should be one of 'v7', 'ustar', or 'pax'. |
| 3165 |
# |
| 3166 |
# Substitute a variable $(am__tar) that is a command |
| 3167 |
# writing to stdout a FORMAT-tarball containing the directory |
| 3168 |
# $tardir. |
| 3169 |
# tardir=directory && $(am__tar) > result.tar |
| 3170 |
# |
| 3171 |
# Substitute a variable $(am__untar) that extract such |
| 3172 |
# a tarball read from stdin. |
| 3173 |
# $(am__untar) < result.tar |
| 3174 |
# |
| 3175 |
AC_DEFUN([_AM_PROG_TAR], |
| 3176 |
[# Always define AMTAR for backward compatibility. Yes, it's still used |
| 3177 |
# in the wild :-( We should find a proper way to deprecate it ... |
| 3178 |
AC_SUBST([AMTAR], ['$${TAR-tar}']) |
| 3179 |
|
| 3180 |
# We'll loop over all known methods to create a tar archive until one works. |
| 3181 |
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
| 3182 |
|
| 3183 |
m4_if([$1], [v7], |
| 3184 |
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], |
| 3185 |
|
| 3186 |
[m4_case([$1], |
| 3187 |
[ustar], |
| 3188 |
[# The POSIX 1988 'ustar' format is defined with fixed-size fields. |
| 3189 |
# There is notably a 21 bits limit for the UID and the GID. In fact, |
| 3190 |
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 |
| 3191 |
# and bug#13588). |
| 3192 |
am_max_uid=2097151 # 2^21 - 1 |
| 3193 |
am_max_gid=$am_max_uid |
| 3194 |
# The $UID and $GID variables are not portable, so we need to resort |
| 3195 |
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls |
| 3196 |
# below are definitely unexpected, so allow the users to see them |
| 3197 |
# (that is, avoid stderr redirection). |
| 3198 |
am_uid=`id -u || echo unknown` |
| 3199 |
am_gid=`id -g || echo unknown` |
| 3200 |
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) |
| 3201 |
if test x$am_uid = xunknown; then |
| 3202 |
AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) |
| 3203 |
elif test $am_uid -le $am_max_uid; then |
| 3204 |
AC_MSG_RESULT([yes]) |
| 3205 |
else |
| 3206 |
AC_MSG_RESULT([no]) |
| 3207 |
_am_tools=none |
| 3208 |
fi |
| 3209 |
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) |
| 3210 |
if test x$gm_gid = xunknown; then |
| 3211 |
AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) |
| 3212 |
elif test $am_gid -le $am_max_gid; then |
| 3213 |
AC_MSG_RESULT([yes]) |
| 3214 |
else |
| 3215 |
AC_MSG_RESULT([no]) |
| 3216 |
_am_tools=none |
| 3217 |
fi], |
| 3218 |
|
| 3219 |
[pax], |
| 3220 |
[], |
| 3221 |
|
| 3222 |
[m4_fatal([Unknown tar format])]) |
| 3223 |
|
| 3224 |
AC_MSG_CHECKING([how to create a $1 tar archive]) |
| 3225 |
|
| 3226 |
# Go ahead even if we have the value already cached. We do so because we |
| 3227 |
# need to set the values for the 'am__tar' and 'am__untar' variables. |
| 3228 |
_am_tools=${am_cv_prog_tar_$1-$_am_tools} |
| 3229 |
|
| 3230 |
for _am_tool in $_am_tools; do |
| 3231 |
case $_am_tool in |
| 3232 |
gnutar) |
| 3233 |
for _am_tar in tar gnutar gtar; do |
| 3234 |
AM_RUN_LOG([$_am_tar --version]) && break |
| 3235 |
done |
| 3236 |
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' |
| 3237 |
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' |
| 3238 |
am__untar="$_am_tar -xf -" |
| 3239 |
;; |
| 3240 |
plaintar) |
| 3241 |
# Must skip GNU tar: if it does not support --format= it doesn't create |
| 3242 |
# ustar tarball either. |
| 3243 |
(tar --version) >/dev/null 2>&1 && continue |
| 3244 |
am__tar='tar chf - "$$tardir"' |
| 3245 |
am__tar_='tar chf - "$tardir"' |
| 3246 |
am__untar='tar xf -' |
| 3247 |
;; |
| 3248 |
pax) |
| 3249 |
am__tar='pax -L -x $1 -w "$$tardir"' |
| 3250 |
am__tar_='pax -L -x $1 -w "$tardir"' |
| 3251 |
am__untar='pax -r' |
| 3252 |
;; |
| 3253 |
cpio) |
| 3254 |
am__tar='find "$$tardir" -print | cpio -o -H $1 -L' |
| 3255 |
am__tar_='find "$tardir" -print | cpio -o -H $1 -L' |
| 3256 |
am__untar='cpio -i -H $1 -d' |
| 3257 |
;; |
| 3258 |
none) |
| 3259 |
am__tar=false |
| 3260 |
am__tar_=false |
| 3261 |
am__untar=false |
| 3262 |
;; |
| 3263 |
esac |
| 3264 |
|
| 3265 |
# If the value was cached, stop now. We just wanted to have am__tar |
| 3266 |
# and am__untar set. |
| 3267 |
test -n "${am_cv_prog_tar_$1}" && break |
| 3268 |
|
| 3269 |
# tar/untar a dummy directory, and stop if the command works. |
| 3270 |
rm -rf conftest.dir |
| 3271 |
mkdir conftest.dir |
| 3272 |
echo GrepMe > conftest.dir/file |
| 3273 |
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) |
| 3274 |
rm -rf conftest.dir |
| 3275 |
if test -s conftest.tar; then |
| 3276 |
AM_RUN_LOG([$am__untar <conftest.tar]) |
| 3277 |
AM_RUN_LOG([cat conftest.dir/file]) |
| 3278 |
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break |
| 3279 |
fi |
| 3280 |
done |
| 3281 |
rm -rf conftest.dir |
| 3282 |
|
| 3283 |
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) |
| 3284 |
AC_MSG_RESULT([$am_cv_prog_tar_$1])]) |
| 3285 |
|
| 3286 |
AC_SUBST([am__tar]) |
| 3287 |
AC_SUBST([am__untar]) |
| 3288 |
]) # _AM_PROG_TAR |
| 3289 |
|
| 3290 |
# Copyright (C) 2022-2024 Free Software Foundation, Inc. |
| 3291 |
# |
| 3292 |
# This file is free software; the Free Software Foundation |
| 3293 |
# gives unlimited permission to copy and/or distribute it, |
| 3294 |
# with or without modifications, as long as this notice is preserved. |
| 3295 |
|
| 3296 |
# _AM_PROG_XARGS_N |
| 3297 |
# ---------------- |
| 3298 |
# Check whether 'xargs -n' works. It should work everywhere, so the fallback |
| 3299 |
# is not optimized at all as we never expect to use it. |
| 3300 |
AC_DEFUN([_AM_PROG_XARGS_N], |
| 3301 |
[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl |
| 3302 |
AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 |
| 3303 |
3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) |
| 3304 |
AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl |
| 3305 |
am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' |
| 3306 |
])dnl |
| 3307 |
AC_SUBST(am__xargs_n) |
| 3308 |
]) |
| 3309 |
|
| 3310 |
m4_include([m4/libtool.m4]) |
| 3311 |
m4_include([m4/ltoptions.m4]) |
| 3312 |
m4_include([m4/ltsugar.m4]) |
| 3313 |
m4_include([m4/ltversion.m4]) |
| 3314 |
m4_include([m4/lt~obsolete.m4]) |