1# generated automatically by aclocal 1.16.2 -*- Autoconf -*- 2 3# Copyright (C) 1996-2020 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 14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15m4_ifndef([AC_AUTOCONF_VERSION], 16 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18[m4_warning([this file was generated for autoconf 2.69. 19You have another version of autoconf. It may work, but is not guaranteed to. 20If you have problems, you may need to regenerate the build system entirely. 21To do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22 23# host-cpu-c-abi.m4 serial 13 24dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. 25dnl This file is free software; the Free Software Foundation 26dnl gives unlimited permission to copy and/or distribute it, 27dnl with or without modifications, as long as this notice is preserved. 28 29dnl From Bruno Haible and Sam Steingold. 30 31dnl Sets the HOST_CPU variable to the canonical name of the CPU. 32dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its 33dnl C language ABI (application binary interface). 34dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in 35dnl config.h. 36dnl 37dnl This canonical name can be used to select a particular assembly language 38dnl source file that will interoperate with C code on the given host. 39dnl 40dnl For example: 41dnl * 'i386' and 'sparc' are different canonical names, because code for i386 42dnl will not run on SPARC CPUs and vice versa. They have different 43dnl instruction sets. 44dnl * 'sparc' and 'sparc64' are different canonical names, because code for 45dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code 46dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit 47dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit 48dnl mode, but not both. 49dnl * 'mips' and 'mipsn32' are different canonical names, because they use 50dnl different argument passing and return conventions for C functions, and 51dnl although the instruction set of 'mips' is a large subset of the 52dnl instruction set of 'mipsn32'. 53dnl * 'mipsn32' and 'mips64' are different canonical names, because they use 54dnl different sizes for the C types like 'int' and 'void *', and although 55dnl the instruction sets of 'mipsn32' and 'mips64' are the same. 56dnl * The same canonical name is used for different endiannesses. You can 57dnl determine the endianness through preprocessor symbols: 58dnl - 'arm': test __ARMEL__. 59dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. 60dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. 61dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 62dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because 63dnl - Instructions that do not exist on all of these CPUs (cmpxchg, 64dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your 65dnl assembly language source files use such instructions, you will 66dnl need to make the distinction. 67dnl - Speed of execution of the common instruction set is reasonable across 68dnl the entire family of CPUs. If you have assembly language source files 69dnl that are optimized for particular CPU types (like GNU gmp has), you 70dnl will need to make the distinction. 71dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>. 72AC_DEFUN([gl_HOST_CPU_C_ABI], 73[ 74 AC_REQUIRE([AC_CANONICAL_HOST]) 75 AC_REQUIRE([gl_C_ASM]) 76 AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], 77 [case "$host_cpu" in 78 79changequote(,)dnl 80 i[34567]86 ) 81changequote([,])dnl 82 gl_cv_host_cpu_c_abi=i386 83 ;; 84 85 x86_64 ) 86 # On x86_64 systems, the C compiler may be generating code in one of 87 # these ABIs: 88 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. 89 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 90 # with native Windows (mingw, MSVC). 91 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. 92 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. 93 AC_COMPILE_IFELSE( 94 [AC_LANG_SOURCE( 95 [[#if (defined __x86_64__ || defined __amd64__ \ 96 || defined _M_X64 || defined _M_AMD64) 97 int ok; 98 #else 99 error fail 100 #endif 101 ]])], 102 [AC_COMPILE_IFELSE( 103 [AC_LANG_SOURCE( 104 [[#if defined __ILP32__ || defined _ILP32 105 int ok; 106 #else 107 error fail 108 #endif 109 ]])], 110 [gl_cv_host_cpu_c_abi=x86_64-x32], 111 [gl_cv_host_cpu_c_abi=x86_64])], 112 [gl_cv_host_cpu_c_abi=i386]) 113 ;; 114 115changequote(,)dnl 116 alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) 117changequote([,])dnl 118 gl_cv_host_cpu_c_abi=alpha 119 ;; 120 121 arm* | aarch64 ) 122 # Assume arm with EABI. 123 # On arm64 systems, the C compiler may be generating code in one of 124 # these ABIs: 125 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. 126 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. 127 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. 128 AC_COMPILE_IFELSE( 129 [AC_LANG_SOURCE( 130 [[#ifdef __aarch64__ 131 int ok; 132 #else 133 error fail 134 #endif 135 ]])], 136 [AC_COMPILE_IFELSE( 137 [AC_LANG_SOURCE( 138 [[#if defined __ILP32__ || defined _ILP32 139 int ok; 140 #else 141 error fail 142 #endif 143 ]])], 144 [gl_cv_host_cpu_c_abi=arm64-ilp32], 145 [gl_cv_host_cpu_c_abi=arm64])], 146 [# Don't distinguish little-endian and big-endian arm, since they 147 # don't require different machine code for simple operations and 148 # since the user can distinguish them through the preprocessor 149 # defines __ARMEL__ vs. __ARMEB__. 150 # But distinguish arm which passes floating-point arguments and 151 # return values in integer registers (r0, r1, ...) - this is 152 # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which 153 # passes them in float registers (s0, s1, ...) and double registers 154 # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer 155 # sets the preprocessor defines __ARM_PCS (for the first case) and 156 # __ARM_PCS_VFP (for the second case), but older GCC does not. 157 echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c 158 # Look for a reference to the register d0 in the .s file. 159 AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 160 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then 161 gl_cv_host_cpu_c_abi=armhf 162 else 163 gl_cv_host_cpu_c_abi=arm 164 fi 165 rm -f conftest* 166 ]) 167 ;; 168 169 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) 170 # On hppa, the C compiler may be generating 32-bit code or 64-bit 171 # code. In the latter case, it defines _LP64 and __LP64__. 172 AC_COMPILE_IFELSE( 173 [AC_LANG_SOURCE( 174 [[#ifdef __LP64__ 175 int ok; 176 #else 177 error fail 178 #endif 179 ]])], 180 [gl_cv_host_cpu_c_abi=hppa64], 181 [gl_cv_host_cpu_c_abi=hppa]) 182 ;; 183 184 ia64* ) 185 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or 186 # 32-bit code. In the latter case, it defines _ILP32. 187 AC_COMPILE_IFELSE( 188 [AC_LANG_SOURCE( 189 [[#ifdef _ILP32 190 int ok; 191 #else 192 error fail 193 #endif 194 ]])], 195 [gl_cv_host_cpu_c_abi=ia64-ilp32], 196 [gl_cv_host_cpu_c_abi=ia64]) 197 ;; 198 199 mips* ) 200 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this 201 # at 32. 202 AC_COMPILE_IFELSE( 203 [AC_LANG_SOURCE( 204 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) 205 int ok; 206 #else 207 error fail 208 #endif 209 ]])], 210 [gl_cv_host_cpu_c_abi=mips64], 211 [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but 212 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32. 213 # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but 214 # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32. 215 AC_COMPILE_IFELSE( 216 [AC_LANG_SOURCE( 217 [[#if (_MIPS_SIM == _ABIN32) 218 int ok; 219 #else 220 error fail 221 #endif 222 ]])], 223 [gl_cv_host_cpu_c_abi=mipsn32], 224 [gl_cv_host_cpu_c_abi=mips])]) 225 ;; 226 227 powerpc* ) 228 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. 229 # No need to distinguish them here; the caller may distinguish 230 # them based on the OS. 231 # On powerpc64 systems, the C compiler may still be generating 232 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may 233 # be generating 64-bit code. 234 AC_COMPILE_IFELSE( 235 [AC_LANG_SOURCE( 236 [[#if defined __powerpc64__ || defined _ARCH_PPC64 237 int ok; 238 #else 239 error fail 240 #endif 241 ]])], 242 [# On powerpc64, there are two ABIs on Linux: The AIX compatible 243 # one and the ELFv2 one. The latter defines _CALL_ELF=2. 244 AC_COMPILE_IFELSE( 245 [AC_LANG_SOURCE( 246 [[#if defined _CALL_ELF && _CALL_ELF == 2 247 int ok; 248 #else 249 error fail 250 #endif 251 ]])], 252 [gl_cv_host_cpu_c_abi=powerpc64-elfv2], 253 [gl_cv_host_cpu_c_abi=powerpc64]) 254 ], 255 [gl_cv_host_cpu_c_abi=powerpc]) 256 ;; 257 258 rs6000 ) 259 gl_cv_host_cpu_c_abi=powerpc 260 ;; 261 262 riscv32 | riscv64 ) 263 # There are 2 architectures (with variants): rv32* and rv64*. 264 AC_COMPILE_IFELSE( 265 [AC_LANG_SOURCE( 266 [[#if __riscv_xlen == 64 267 int ok; 268 #else 269 error fail 270 #endif 271 ]])], 272 [cpu=riscv64], 273 [cpu=riscv32]) 274 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. 275 # Size of 'long' and 'void *': 276 AC_COMPILE_IFELSE( 277 [AC_LANG_SOURCE( 278 [[#if defined __LP64__ 279 int ok; 280 #else 281 error fail 282 #endif 283 ]])], 284 [main_abi=lp64], 285 [main_abi=ilp32]) 286 # Float ABIs: 287 # __riscv_float_abi_double: 288 # 'float' and 'double' are passed in floating-point registers. 289 # __riscv_float_abi_single: 290 # 'float' are passed in floating-point registers. 291 # __riscv_float_abi_soft: 292 # No values are passed in floating-point registers. 293 AC_COMPILE_IFELSE( 294 [AC_LANG_SOURCE( 295 [[#if defined __riscv_float_abi_double 296 int ok; 297 #else 298 error fail 299 #endif 300 ]])], 301 [float_abi=d], 302 [AC_COMPILE_IFELSE( 303 [AC_LANG_SOURCE( 304 [[#if defined __riscv_float_abi_single 305 int ok; 306 #else 307 error fail 308 #endif 309 ]])], 310 [float_abi=f], 311 [float_abi='']) 312 ]) 313 gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" 314 ;; 315 316 s390* ) 317 # On s390x, the C compiler may be generating 64-bit (= s390x) code 318 # or 31-bit (= s390) code. 319 AC_COMPILE_IFELSE( 320 [AC_LANG_SOURCE( 321 [[#if defined __LP64__ || defined __s390x__ 322 int ok; 323 #else 324 error fail 325 #endif 326 ]])], 327 [gl_cv_host_cpu_c_abi=s390x], 328 [gl_cv_host_cpu_c_abi=s390]) 329 ;; 330 331 sparc | sparc64 ) 332 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the 333 # C compiler still generates 32-bit code. 334 AC_COMPILE_IFELSE( 335 [AC_LANG_SOURCE( 336 [[#if defined __sparcv9 || defined __arch64__ 337 int ok; 338 #else 339 error fail 340 #endif 341 ]])], 342 [gl_cv_host_cpu_c_abi=sparc64], 343 [gl_cv_host_cpu_c_abi=sparc]) 344 ;; 345 346 *) 347 gl_cv_host_cpu_c_abi="$host_cpu" 348 ;; 349 esac 350 ]) 351 352 dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. 353 HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` 354 HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" 355 AC_SUBST([HOST_CPU]) 356 AC_SUBST([HOST_CPU_C_ABI]) 357 358 # This was 359 # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) 360 # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) 361 # earlier, but KAI C++ 3.2d doesn't like this. 362 sed -e 's/-/_/g' >> confdefs.h <<EOF 363#ifndef __${HOST_CPU}__ 364#define __${HOST_CPU}__ 1 365#endif 366#ifndef __${HOST_CPU_C_ABI}__ 367#define __${HOST_CPU_C_ABI}__ 1 368#endif 369EOF 370 AH_TOP([/* CPU and C ABI indicator */ 371#ifndef __i386__ 372#undef __i386__ 373#endif 374#ifndef __x86_64_x32__ 375#undef __x86_64_x32__ 376#endif 377#ifndef __x86_64__ 378#undef __x86_64__ 379#endif 380#ifndef __alpha__ 381#undef __alpha__ 382#endif 383#ifndef __arm__ 384#undef __arm__ 385#endif 386#ifndef __armhf__ 387#undef __armhf__ 388#endif 389#ifndef __arm64_ilp32__ 390#undef __arm64_ilp32__ 391#endif 392#ifndef __arm64__ 393#undef __arm64__ 394#endif 395#ifndef __hppa__ 396#undef __hppa__ 397#endif 398#ifndef __hppa64__ 399#undef __hppa64__ 400#endif 401#ifndef __ia64_ilp32__ 402#undef __ia64_ilp32__ 403#endif 404#ifndef __ia64__ 405#undef __ia64__ 406#endif 407#ifndef __m68k__ 408#undef __m68k__ 409#endif 410#ifndef __mips__ 411#undef __mips__ 412#endif 413#ifndef __mipsn32__ 414#undef __mipsn32__ 415#endif 416#ifndef __mips64__ 417#undef __mips64__ 418#endif 419#ifndef __powerpc__ 420#undef __powerpc__ 421#endif 422#ifndef __powerpc64__ 423#undef __powerpc64__ 424#endif 425#ifndef __powerpc64_elfv2__ 426#undef __powerpc64_elfv2__ 427#endif 428#ifndef __riscv32__ 429#undef __riscv32__ 430#endif 431#ifndef __riscv64__ 432#undef __riscv64__ 433#endif 434#ifndef __riscv32_ilp32__ 435#undef __riscv32_ilp32__ 436#endif 437#ifndef __riscv32_ilp32f__ 438#undef __riscv32_ilp32f__ 439#endif 440#ifndef __riscv32_ilp32d__ 441#undef __riscv32_ilp32d__ 442#endif 443#ifndef __riscv64_ilp32__ 444#undef __riscv64_ilp32__ 445#endif 446#ifndef __riscv64_ilp32f__ 447#undef __riscv64_ilp32f__ 448#endif 449#ifndef __riscv64_ilp32d__ 450#undef __riscv64_ilp32d__ 451#endif 452#ifndef __riscv64_lp64__ 453#undef __riscv64_lp64__ 454#endif 455#ifndef __riscv64_lp64f__ 456#undef __riscv64_lp64f__ 457#endif 458#ifndef __riscv64_lp64d__ 459#undef __riscv64_lp64d__ 460#endif 461#ifndef __s390__ 462#undef __s390__ 463#endif 464#ifndef __s390x__ 465#undef __s390x__ 466#endif 467#ifndef __sh__ 468#undef __sh__ 469#endif 470#ifndef __sparc__ 471#undef __sparc__ 472#endif 473#ifndef __sparc64__ 474#undef __sparc64__ 475#endif 476]) 477 478]) 479 480 481dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI 482dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit 483dnl one, or to 'unknown' if unknown. 484dnl This is a simplified variant of gl_HOST_CPU_C_ABI. 485AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT], 486[ 487 AC_REQUIRE([AC_CANONICAL_HOST]) 488 AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit], 489 [if test -n "$gl_cv_host_cpu_c_abi"; then 490 case "$gl_cv_host_cpu_c_abi" in 491 i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) 492 gl_cv_host_cpu_c_abi_32bit=yes ;; 493 x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) 494 gl_cv_host_cpu_c_abi_32bit=no ;; 495 *) 496 gl_cv_host_cpu_c_abi_32bit=unknown ;; 497 esac 498 else 499 case "$host_cpu" in 500 501 # CPUs that only support a 32-bit ABI. 502 arc \ 503 | bfin \ 504 | cris* \ 505 | csky \ 506 | epiphany \ 507 | ft32 \ 508 | h8300 \ 509 | m68k \ 510 | microblaze | microblazeel \ 511 | nds32 | nds32le | nds32be \ 512 | nios2 | nios2eb | nios2el \ 513 | or1k* \ 514 | or32 \ 515 | sh | sh[1234] | sh[1234]e[lb] \ 516 | tic6x \ 517 | xtensa* ) 518 gl_cv_host_cpu_c_abi_32bit=yes 519 ;; 520 521 # CPUs that only support a 64-bit ABI. 522changequote(,)dnl 523 alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ 524 | mmix ) 525changequote([,])dnl 526 gl_cv_host_cpu_c_abi_32bit=no 527 ;; 528 529changequote(,)dnl 530 i[34567]86 ) 531changequote([,])dnl 532 gl_cv_host_cpu_c_abi_32bit=yes 533 ;; 534 535 x86_64 ) 536 # On x86_64 systems, the C compiler may be generating code in one of 537 # these ABIs: 538 # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. 539 # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 540 # with native Windows (mingw, MSVC). 541 # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. 542 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. 543 AC_COMPILE_IFELSE( 544 [AC_LANG_SOURCE( 545 [[#if (defined __x86_64__ || defined __amd64__ \ 546 || defined _M_X64 || defined _M_AMD64) \ 547 && !(defined __ILP32__ || defined _ILP32) 548 int ok; 549 #else 550 error fail 551 #endif 552 ]])], 553 [gl_cv_host_cpu_c_abi_32bit=no], 554 [gl_cv_host_cpu_c_abi_32bit=yes]) 555 ;; 556 557 arm* | aarch64 ) 558 # Assume arm with EABI. 559 # On arm64 systems, the C compiler may be generating code in one of 560 # these ABIs: 561 # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. 562 # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. 563 # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. 564 AC_COMPILE_IFELSE( 565 [AC_LANG_SOURCE( 566 [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) 567 int ok; 568 #else 569 error fail 570 #endif 571 ]])], 572 [gl_cv_host_cpu_c_abi_32bit=no], 573 [gl_cv_host_cpu_c_abi_32bit=yes]) 574 ;; 575 576 hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) 577 # On hppa, the C compiler may be generating 32-bit code or 64-bit 578 # code. In the latter case, it defines _LP64 and __LP64__. 579 AC_COMPILE_IFELSE( 580 [AC_LANG_SOURCE( 581 [[#ifdef __LP64__ 582 int ok; 583 #else 584 error fail 585 #endif 586 ]])], 587 [gl_cv_host_cpu_c_abi_32bit=no], 588 [gl_cv_host_cpu_c_abi_32bit=yes]) 589 ;; 590 591 ia64* ) 592 # On ia64 on HP-UX, the C compiler may be generating 64-bit code or 593 # 32-bit code. In the latter case, it defines _ILP32. 594 AC_COMPILE_IFELSE( 595 [AC_LANG_SOURCE( 596 [[#ifdef _ILP32 597 int ok; 598 #else 599 error fail 600 #endif 601 ]])], 602 [gl_cv_host_cpu_c_abi_32bit=yes], 603 [gl_cv_host_cpu_c_abi_32bit=no]) 604 ;; 605 606 mips* ) 607 # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this 608 # at 32. 609 AC_COMPILE_IFELSE( 610 [AC_LANG_SOURCE( 611 [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) 612 int ok; 613 #else 614 error fail 615 #endif 616 ]])], 617 [gl_cv_host_cpu_c_abi_32bit=no], 618 [gl_cv_host_cpu_c_abi_32bit=yes]) 619 ;; 620 621 powerpc* ) 622 # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. 623 # No need to distinguish them here; the caller may distinguish 624 # them based on the OS. 625 # On powerpc64 systems, the C compiler may still be generating 626 # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may 627 # be generating 64-bit code. 628 AC_COMPILE_IFELSE( 629 [AC_LANG_SOURCE( 630 [[#if defined __powerpc64__ || defined _ARCH_PPC64 631 int ok; 632 #else 633 error fail 634 #endif 635 ]])], 636 [gl_cv_host_cpu_c_abi_32bit=no], 637 [gl_cv_host_cpu_c_abi_32bit=yes]) 638 ;; 639 640 rs6000 ) 641 gl_cv_host_cpu_c_abi_32bit=yes 642 ;; 643 644 riscv32 | riscv64 ) 645 # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. 646 # Size of 'long' and 'void *': 647 AC_COMPILE_IFELSE( 648 [AC_LANG_SOURCE( 649 [[#if defined __LP64__ 650 int ok; 651 #else 652 error fail 653 #endif 654 ]])], 655 [gl_cv_host_cpu_c_abi_32bit=no], 656 [gl_cv_host_cpu_c_abi_32bit=yes]) 657 ;; 658 659 s390* ) 660 # On s390x, the C compiler may be generating 64-bit (= s390x) code 661 # or 31-bit (= s390) code. 662 AC_COMPILE_IFELSE( 663 [AC_LANG_SOURCE( 664 [[#if defined __LP64__ || defined __s390x__ 665 int ok; 666 #else 667 error fail 668 #endif 669 ]])], 670 [gl_cv_host_cpu_c_abi_32bit=no], 671 [gl_cv_host_cpu_c_abi_32bit=yes]) 672 ;; 673 674 sparc | sparc64 ) 675 # UltraSPARCs running Linux have `uname -m` = "sparc64", but the 676 # C compiler still generates 32-bit code. 677 AC_COMPILE_IFELSE( 678 [AC_LANG_SOURCE( 679 [[#if defined __sparcv9 || defined __arch64__ 680 int ok; 681 #else 682 error fail 683 #endif 684 ]])], 685 [gl_cv_host_cpu_c_abi_32bit=no], 686 [gl_cv_host_cpu_c_abi_32bit=yes]) 687 ;; 688 689 *) 690 gl_cv_host_cpu_c_abi_32bit=unknown 691 ;; 692 esac 693 fi 694 ]) 695 696 HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" 697]) 698 699# lib-ld.m4 serial 9 700dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc. 701dnl This file is free software; the Free Software Foundation 702dnl gives unlimited permission to copy and/or distribute it, 703dnl with or without modifications, as long as this notice is preserved. 704 705dnl Subroutines of libtool.m4, 706dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid 707dnl collision with libtool.m4. 708 709dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. 710AC_DEFUN([AC_LIB_PROG_LD_GNU], 711[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], 712[# I'd rather use --version here, but apparently some GNU lds only accept -v. 713case `$LD -v 2>&1 </dev/null` in 714*GNU* | *'with BFD'*) 715 acl_cv_prog_gnu_ld=yes 716 ;; 717*) 718 acl_cv_prog_gnu_ld=no 719 ;; 720esac]) 721with_gnu_ld=$acl_cv_prog_gnu_ld 722]) 723 724dnl From libtool-2.4. Sets the variable LD. 725AC_DEFUN([AC_LIB_PROG_LD], 726[AC_REQUIRE([AC_PROG_CC])dnl 727AC_REQUIRE([AC_CANONICAL_HOST])dnl 728 729AC_ARG_WITH([gnu-ld], 730 [AS_HELP_STRING([--with-gnu-ld], 731 [assume the C compiler uses GNU ld [default=no]])], 732 [test "$withval" = no || with_gnu_ld=yes], 733 [with_gnu_ld=no])dnl 734 735# Prepare PATH_SEPARATOR. 736# The user is always right. 737if test "${PATH_SEPARATOR+set}" != set; then 738 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which 739 # contains only /bin. Note that ksh looks also at the FPATH variable, 740 # so we have to set that as well for the test. 741 PATH_SEPARATOR=: 742 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ 743 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ 744 || PATH_SEPARATOR=';' 745 } 746fi 747 748if test -n "$LD"; then 749 AC_MSG_CHECKING([for ld]) 750elif test "$GCC" = yes; then 751 AC_MSG_CHECKING([for ld used by $CC]) 752elif test "$with_gnu_ld" = yes; then 753 AC_MSG_CHECKING([for GNU ld]) 754else 755 AC_MSG_CHECKING([for non-GNU ld]) 756fi 757if test -n "$LD"; then 758 # Let the user override the test with a path. 759 : 760else 761 AC_CACHE_VAL([acl_cv_path_LD], 762 [ 763 acl_cv_path_LD= # Final result of this test 764 ac_prog=ld # Program to search in $PATH 765 if test "$GCC" = yes; then 766 # Check if gcc -print-prog-name=ld gives a path. 767 case $host in 768 *-*-mingw*) 769 # gcc leaves a trailing carriage return which upsets mingw 770 acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 771 *) 772 acl_output=`($CC -print-prog-name=ld) 2>&5` ;; 773 esac 774 case $acl_output in 775 # Accept absolute paths. 776 [[\\/]]* | ?:[[\\/]]*) 777 re_direlt='/[[^/]][[^/]]*/\.\./' 778 # Canonicalize the pathname of ld 779 acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` 780 while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do 781 acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` 782 done 783 # Got the pathname. No search in PATH is needed. 784 acl_cv_path_LD="$acl_output" 785 ac_prog= 786 ;; 787 "") 788 # If it fails, then pretend we aren't using GCC. 789 ;; 790 *) 791 # If it is relative, then search for the first ld in PATH. 792 with_gnu_ld=unknown 793 ;; 794 esac 795 fi 796 if test -n "$ac_prog"; then 797 # Search for $ac_prog in $PATH. 798 acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 799 for ac_dir in $PATH; do 800 IFS="$acl_save_ifs" 801 test -z "$ac_dir" && ac_dir=. 802 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 803 acl_cv_path_LD="$ac_dir/$ac_prog" 804 # Check to see if the program is GNU ld. I'd rather use --version, 805 # but apparently some variants of GNU ld only accept -v. 806 # Break only if it was the GNU/non-GNU ld that we prefer. 807 case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in 808 *GNU* | *'with BFD'*) 809 test "$with_gnu_ld" != no && break 810 ;; 811 *) 812 test "$with_gnu_ld" != yes && break 813 ;; 814 esac 815 fi 816 done 817 IFS="$acl_save_ifs" 818 fi 819 case $host in 820 *-*-aix*) 821 AC_COMPILE_IFELSE( 822 [AC_LANG_SOURCE( 823 [[#if defined __powerpc64__ || defined _ARCH_PPC64 824 int ok; 825 #else 826 error fail 827 #endif 828 ]])], 829 [# The compiler produces 64-bit code. Add option '-b64' so that the 830 # linker groks 64-bit object files. 831 case "$acl_cv_path_LD " in 832 *" -b64 "*) ;; 833 *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; 834 esac 835 ], []) 836 ;; 837 sparc64-*-netbsd*) 838 AC_COMPILE_IFELSE( 839 [AC_LANG_SOURCE( 840 [[#if defined __sparcv9 || defined __arch64__ 841 int ok; 842 #else 843 error fail 844 #endif 845 ]])], 846 [], 847 [# The compiler produces 32-bit code. Add option '-m elf32_sparc' 848 # so that the linker groks 32-bit object files. 849 case "$acl_cv_path_LD " in 850 *" -m elf32_sparc "*) ;; 851 *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; 852 esac 853 ]) 854 ;; 855 esac 856 ]) 857 LD="$acl_cv_path_LD" 858fi 859if test -n "$LD"; then 860 AC_MSG_RESULT([$LD]) 861else 862 AC_MSG_RESULT([no]) 863 AC_MSG_ERROR([no acceptable ld found in \$PATH]) 864fi 865AC_LIB_PROG_LD_GNU 866]) 867 868# lib-link.m4 serial 31 869dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. 870dnl This file is free software; the Free Software Foundation 871dnl gives unlimited permission to copy and/or distribute it, 872dnl with or without modifications, as long as this notice is preserved. 873 874dnl From Bruno Haible. 875 876AC_PREREQ([2.61]) 877 878dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and 879dnl the libraries corresponding to explicit and implicit dependencies. 880dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and 881dnl augments the CPPFLAGS variable. 882dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 883dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 884AC_DEFUN([AC_LIB_LINKFLAGS], 885[ 886 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 887 AC_REQUIRE([AC_LIB_RPATH]) 888 pushdef([Name],[m4_translit([$1],[./+-], [____])]) 889 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], 890 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 891 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ 892 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 893 ac_cv_lib[]Name[]_libs="$LIB[]NAME" 894 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" 895 ac_cv_lib[]Name[]_cppflags="$INC[]NAME" 896 ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" 897 ]) 898 LIB[]NAME="$ac_cv_lib[]Name[]_libs" 899 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" 900 INC[]NAME="$ac_cv_lib[]Name[]_cppflags" 901 LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" 902 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) 903 AC_SUBST([LIB]NAME) 904 AC_SUBST([LTLIB]NAME) 905 AC_SUBST([LIB]NAME[_PREFIX]) 906 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the 907 dnl results of this search when this library appears as a dependency. 908 HAVE_LIB[]NAME=yes 909 popdef([NAME]) 910 popdef([Name]) 911]) 912 913dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) 914dnl searches for libname and the libraries corresponding to explicit and 915dnl implicit dependencies, together with the specified include files and 916dnl the ability to compile and link the specified testcode. The missing-message 917dnl defaults to 'no' and may contain additional hints for the user. 918dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} 919dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and 920dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs 921dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. 922dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname 923dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 924AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], 925[ 926 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 927 AC_REQUIRE([AC_LIB_RPATH]) 928 pushdef([Name],[m4_translit([$1],[./+-], [____])]) 929 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], 930 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 931 932 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME 933 dnl accordingly. 934 AC_LIB_LINKFLAGS_BODY([$1], [$2]) 935 936 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, 937 dnl because if the user has installed lib[]Name and not disabled its use 938 dnl via --without-lib[]Name-prefix, he wants to use it. 939 ac_save_CPPFLAGS="$CPPFLAGS" 940 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) 941 942 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ 943 ac_save_LIBS="$LIBS" 944 dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, 945 dnl because these -l options might require -L options that are present in 946 dnl LIBS. -l options benefit only from the -L options listed before it. 947 dnl Otherwise, add it to the front of LIBS, because it may be a static 948 dnl library that depends on another static library that is present in LIBS. 949 dnl Static libraries benefit only from the static libraries listed after 950 dnl it. 951 case " $LIB[]NAME" in 952 *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; 953 *) LIBS="$LIB[]NAME $LIBS" ;; 954 esac 955 AC_LINK_IFELSE( 956 [AC_LANG_PROGRAM([[$3]], [[$4]])], 957 [ac_cv_lib[]Name=yes], 958 [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) 959 LIBS="$ac_save_LIBS" 960 ]) 961 if test "$ac_cv_lib[]Name" = yes; then 962 HAVE_LIB[]NAME=yes 963 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) 964 AC_MSG_CHECKING([how to link with lib[]$1]) 965 AC_MSG_RESULT([$LIB[]NAME]) 966 else 967 HAVE_LIB[]NAME=no 968 dnl If $LIB[]NAME didn't lead to a usable library, we don't need 969 dnl $INC[]NAME either. 970 CPPFLAGS="$ac_save_CPPFLAGS" 971 LIB[]NAME= 972 LTLIB[]NAME= 973 LIB[]NAME[]_PREFIX= 974 fi 975 AC_SUBST([HAVE_LIB]NAME) 976 AC_SUBST([LIB]NAME) 977 AC_SUBST([LTLIB]NAME) 978 AC_SUBST([LIB]NAME[_PREFIX]) 979 popdef([NAME]) 980 popdef([Name]) 981]) 982 983dnl Determine the platform dependent parameters needed to use rpath: 984dnl acl_libext, 985dnl acl_shlibext, 986dnl acl_libname_spec, 987dnl acl_library_names_spec, 988dnl acl_hardcode_libdir_flag_spec, 989dnl acl_hardcode_libdir_separator, 990dnl acl_hardcode_direct, 991dnl acl_hardcode_minus_L. 992AC_DEFUN([AC_LIB_RPATH], 993[ 994 dnl Complain if config.rpath is missing. 995 AC_REQUIRE_AUX_FILE([config.rpath]) 996 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS 997 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld 998 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host 999 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir 1000 AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ 1001 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ 1002 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh 1003 . ./conftest.sh 1004 rm -f ./conftest.sh 1005 acl_cv_rpath=done 1006 ]) 1007 wl="$acl_cv_wl" 1008 acl_libext="$acl_cv_libext" 1009 acl_shlibext="$acl_cv_shlibext" 1010 acl_libname_spec="$acl_cv_libname_spec" 1011 acl_library_names_spec="$acl_cv_library_names_spec" 1012 acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" 1013 acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" 1014 acl_hardcode_direct="$acl_cv_hardcode_direct" 1015 acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" 1016 dnl Determine whether the user wants rpath handling at all. 1017 AC_ARG_ENABLE([rpath], 1018 [ --disable-rpath do not hardcode runtime library paths], 1019 :, enable_rpath=yes) 1020]) 1021 1022dnl AC_LIB_FROMPACKAGE(name, package) 1023dnl declares that libname comes from the given package. The configure file 1024dnl will then not have a --with-libname-prefix option but a 1025dnl --with-package-prefix option. Several libraries can come from the same 1026dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar 1027dnl macro call that searches for libname. 1028AC_DEFUN([AC_LIB_FROMPACKAGE], 1029[ 1030 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], 1031 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 1032 define([acl_frompackage_]NAME, [$2]) 1033 popdef([NAME]) 1034 pushdef([PACK],[$2]) 1035 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], 1036 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 1037 define([acl_libsinpackage_]PACKUP, 1038 m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) 1039 popdef([PACKUP]) 1040 popdef([PACK]) 1041]) 1042 1043dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and 1044dnl the libraries corresponding to explicit and implicit dependencies. 1045dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. 1046dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found 1047dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. 1048AC_DEFUN([AC_LIB_LINKFLAGS_BODY], 1049[ 1050 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1051 pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], 1052 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 1053 pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) 1054 pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], 1055 [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) 1056 pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) 1057 dnl By default, look in $includedir and $libdir. 1058 use_additional=yes 1059 AC_LIB_WITH_FINAL_PREFIX([ 1060 eval additional_includedir=\"$includedir\" 1061 eval additional_libdir=\"$libdir\" 1062 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" 1063 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" 1064 ]) 1065 AC_ARG_WITH(PACK[-prefix], 1066[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib 1067 --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], 1068[ 1069 if test "X$withval" = "Xno"; then 1070 use_additional=no 1071 else 1072 if test "X$withval" = "X"; then 1073 AC_LIB_WITH_FINAL_PREFIX([ 1074 eval additional_includedir=\"$includedir\" 1075 eval additional_libdir=\"$libdir\" 1076 eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" 1077 eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" 1078 ]) 1079 else 1080 additional_includedir="$withval/include" 1081 additional_libdir="$withval/$acl_libdirstem" 1082 additional_libdir2="$withval/$acl_libdirstem2" 1083 additional_libdir3="$withval/$acl_libdirstem3" 1084 fi 1085 fi 1086]) 1087 if test "X$additional_libdir2" = "X$additional_libdir"; then 1088 additional_libdir2= 1089 fi 1090 if test "X$additional_libdir3" = "X$additional_libdir"; then 1091 additional_libdir3= 1092 fi 1093 dnl Search the library and its dependencies in $additional_libdir and 1094 dnl $LDFLAGS. Using breadth-first-seach. 1095 LIB[]NAME= 1096 LTLIB[]NAME= 1097 INC[]NAME= 1098 LIB[]NAME[]_PREFIX= 1099 dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been 1100 dnl computed. So it has to be reset here. 1101 HAVE_LIB[]NAME= 1102 rpathdirs= 1103 ltrpathdirs= 1104 names_already_handled= 1105 names_next_round='$1 $2' 1106 while test -n "$names_next_round"; do 1107 names_this_round="$names_next_round" 1108 names_next_round= 1109 for name in $names_this_round; do 1110 already_handled= 1111 for n in $names_already_handled; do 1112 if test "$n" = "$name"; then 1113 already_handled=yes 1114 break 1115 fi 1116 done 1117 if test -z "$already_handled"; then 1118 names_already_handled="$names_already_handled $name" 1119 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS 1120 dnl or AC_LIB_HAVE_LINKFLAGS call. 1121 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` 1122 eval value=\"\$HAVE_LIB$uppername\" 1123 if test -n "$value"; then 1124 if test "$value" = yes; then 1125 eval value=\"\$LIB$uppername\" 1126 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" 1127 eval value=\"\$LTLIB$uppername\" 1128 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" 1129 else 1130 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined 1131 dnl that this library doesn't exist. So just drop it. 1132 : 1133 fi 1134 else 1135 dnl Search the library lib$name in $additional_libdir and $LDFLAGS 1136 dnl and the already constructed $LIBNAME/$LTLIBNAME. 1137 found_dir= 1138 found_la= 1139 found_so= 1140 found_a= 1141 eval libname=\"$acl_libname_spec\" # typically: libname=lib$name 1142 if test -n "$acl_shlibext"; then 1143 shrext=".$acl_shlibext" # typically: shrext=.so 1144 else 1145 shrext= 1146 fi 1147 if test $use_additional = yes; then 1148 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do 1149 if test "X$found_dir" = "X"; then 1150 eval dir=\$$additional_libdir_variable 1151 if test -n "$dir"; then 1152 dnl The same code as in the loop below: 1153 dnl First look for a shared library. 1154 if test -n "$acl_shlibext"; then 1155 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then 1156 found_dir="$dir" 1157 found_so="$dir/$libname$shrext" 1158 else 1159 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 1160 ver=`(cd "$dir" && \ 1161 for f in "$libname$shrext".*; do echo "$f"; done \ 1162 | sed -e "s,^$libname$shrext\\\\.,," \ 1163 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ 1164 | sed 1q ) 2>/dev/null` 1165 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then 1166 found_dir="$dir" 1167 found_so="$dir/$libname$shrext.$ver" 1168 fi 1169 else 1170 eval library_names=\"$acl_library_names_spec\" 1171 for f in $library_names; do 1172 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then 1173 found_dir="$dir" 1174 found_so="$dir/$f" 1175 break 1176 fi 1177 done 1178 fi 1179 fi 1180 fi 1181 dnl Then look for a static library. 1182 if test "X$found_dir" = "X"; then 1183 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then 1184 found_dir="$dir" 1185 found_a="$dir/$libname.$acl_libext" 1186 fi 1187 fi 1188 if test "X$found_dir" != "X"; then 1189 if test -f "$dir/$libname.la"; then 1190 found_la="$dir/$libname.la" 1191 fi 1192 fi 1193 fi 1194 fi 1195 done 1196 fi 1197 if test "X$found_dir" = "X"; then 1198 for x in $LDFLAGS $LTLIB[]NAME; do 1199 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1200 case "$x" in 1201 -L*) 1202 dir=`echo "X$x" | sed -e 's/^X-L//'` 1203 dnl First look for a shared library. 1204 if test -n "$acl_shlibext"; then 1205 if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then 1206 found_dir="$dir" 1207 found_so="$dir/$libname$shrext" 1208 else 1209 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then 1210 ver=`(cd "$dir" && \ 1211 for f in "$libname$shrext".*; do echo "$f"; done \ 1212 | sed -e "s,^$libname$shrext\\\\.,," \ 1213 | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ 1214 | sed 1q ) 2>/dev/null` 1215 if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then 1216 found_dir="$dir" 1217 found_so="$dir/$libname$shrext.$ver" 1218 fi 1219 else 1220 eval library_names=\"$acl_library_names_spec\" 1221 for f in $library_names; do 1222 if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then 1223 found_dir="$dir" 1224 found_so="$dir/$f" 1225 break 1226 fi 1227 done 1228 fi 1229 fi 1230 fi 1231 dnl Then look for a static library. 1232 if test "X$found_dir" = "X"; then 1233 if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then 1234 found_dir="$dir" 1235 found_a="$dir/$libname.$acl_libext" 1236 fi 1237 fi 1238 if test "X$found_dir" != "X"; then 1239 if test -f "$dir/$libname.la"; then 1240 found_la="$dir/$libname.la" 1241 fi 1242 fi 1243 ;; 1244 esac 1245 if test "X$found_dir" != "X"; then 1246 break 1247 fi 1248 done 1249 fi 1250 if test "X$found_dir" != "X"; then 1251 dnl Found the library. 1252 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" 1253 if test "X$found_so" != "X"; then 1254 dnl Linking with a shared library. We attempt to hardcode its 1255 dnl directory into the executable's runpath, unless it's the 1256 dnl standard /usr/lib. 1257 if test "$enable_rpath" = no \ 1258 || test "X$found_dir" = "X/usr/$acl_libdirstem" \ 1259 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ 1260 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then 1261 dnl No hardcoding is needed. 1262 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1263 else 1264 dnl Use an explicit option to hardcode DIR into the resulting 1265 dnl binary. 1266 dnl Potentially add DIR to ltrpathdirs. 1267 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 1268 haveit= 1269 for x in $ltrpathdirs; do 1270 if test "X$x" = "X$found_dir"; then 1271 haveit=yes 1272 break 1273 fi 1274 done 1275 if test -z "$haveit"; then 1276 ltrpathdirs="$ltrpathdirs $found_dir" 1277 fi 1278 dnl The hardcoding into $LIBNAME is system dependent. 1279 if test "$acl_hardcode_direct" = yes; then 1280 dnl Using DIR/libNAME.so during linking hardcodes DIR into the 1281 dnl resulting binary. 1282 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1283 else 1284 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then 1285 dnl Use an explicit option to hardcode DIR into the resulting 1286 dnl binary. 1287 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1288 dnl Potentially add DIR to rpathdirs. 1289 dnl The rpathdirs will be appended to $LIBNAME at the end. 1290 haveit= 1291 for x in $rpathdirs; do 1292 if test "X$x" = "X$found_dir"; then 1293 haveit=yes 1294 break 1295 fi 1296 done 1297 if test -z "$haveit"; then 1298 rpathdirs="$rpathdirs $found_dir" 1299 fi 1300 else 1301 dnl Rely on "-L$found_dir". 1302 dnl But don't add it if it's already contained in the LDFLAGS 1303 dnl or the already constructed $LIBNAME 1304 haveit= 1305 for x in $LDFLAGS $LIB[]NAME; do 1306 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1307 if test "X$x" = "X-L$found_dir"; then 1308 haveit=yes 1309 break 1310 fi 1311 done 1312 if test -z "$haveit"; then 1313 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" 1314 fi 1315 if test "$acl_hardcode_minus_L" != no; then 1316 dnl FIXME: Not sure whether we should use 1317 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" 1318 dnl here. 1319 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" 1320 else 1321 dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH 1322 dnl here, because this doesn't fit in flags passed to the 1323 dnl compiler. So give up. No hardcoding. This affects only 1324 dnl very old systems. 1325 dnl FIXME: Not sure whether we should use 1326 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" 1327 dnl here. 1328 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" 1329 fi 1330 fi 1331 fi 1332 fi 1333 else 1334 if test "X$found_a" != "X"; then 1335 dnl Linking with a static library. 1336 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" 1337 else 1338 dnl We shouldn't come here, but anyway it's good to have a 1339 dnl fallback. 1340 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" 1341 fi 1342 fi 1343 dnl Assume the include files are nearby. 1344 additional_includedir= 1345 case "$found_dir" in 1346 */$acl_libdirstem | */$acl_libdirstem/) 1347 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` 1348 if test "$name" = '$1'; then 1349 LIB[]NAME[]_PREFIX="$basedir" 1350 fi 1351 additional_includedir="$basedir/include" 1352 ;; 1353 */$acl_libdirstem2 | */$acl_libdirstem2/) 1354 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` 1355 if test "$name" = '$1'; then 1356 LIB[]NAME[]_PREFIX="$basedir" 1357 fi 1358 additional_includedir="$basedir/include" 1359 ;; 1360 */$acl_libdirstem3 | */$acl_libdirstem3/) 1361 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` 1362 if test "$name" = '$1'; then 1363 LIB[]NAME[]_PREFIX="$basedir" 1364 fi 1365 additional_includedir="$basedir/include" 1366 ;; 1367 esac 1368 if test "X$additional_includedir" != "X"; then 1369 dnl Potentially add $additional_includedir to $INCNAME. 1370 dnl But don't add it 1371 dnl 1. if it's the standard /usr/include, 1372 dnl 2. if it's /usr/local/include and we are using GCC on Linux, 1373 dnl 3. if it's already present in $CPPFLAGS or the already 1374 dnl constructed $INCNAME, 1375 dnl 4. if it doesn't exist as a directory. 1376 if test "X$additional_includedir" != "X/usr/include"; then 1377 haveit= 1378 if test "X$additional_includedir" = "X/usr/local/include"; then 1379 if test -n "$GCC"; then 1380 case $host_os in 1381 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1382 esac 1383 fi 1384 fi 1385 if test -z "$haveit"; then 1386 for x in $CPPFLAGS $INC[]NAME; do 1387 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1388 if test "X$x" = "X-I$additional_includedir"; then 1389 haveit=yes 1390 break 1391 fi 1392 done 1393 if test -z "$haveit"; then 1394 if test -d "$additional_includedir"; then 1395 dnl Really add $additional_includedir to $INCNAME. 1396 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" 1397 fi 1398 fi 1399 fi 1400 fi 1401 fi 1402 dnl Look for dependencies. 1403 if test -n "$found_la"; then 1404 dnl Read the .la file. It defines the variables 1405 dnl dlname, library_names, old_library, dependency_libs, current, 1406 dnl age, revision, installed, dlopen, dlpreopen, libdir. 1407 save_libdir="$libdir" 1408 case "$found_la" in 1409 */* | *\\*) . "$found_la" ;; 1410 *) . "./$found_la" ;; 1411 esac 1412 libdir="$save_libdir" 1413 dnl We use only dependency_libs. 1414 for dep in $dependency_libs; do 1415 case "$dep" in 1416 -L*) 1417 dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` 1418 dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. 1419 dnl But don't add it 1420 dnl 1. if it's the standard /usr/lib, 1421 dnl 2. if it's /usr/local/lib and we are using GCC on Linux, 1422 dnl 3. if it's already present in $LDFLAGS or the already 1423 dnl constructed $LIBNAME, 1424 dnl 4. if it doesn't exist as a directory. 1425 if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ 1426 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ 1427 && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then 1428 haveit= 1429 if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ 1430 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ 1431 || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then 1432 if test -n "$GCC"; then 1433 case $host_os in 1434 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1435 esac 1436 fi 1437 fi 1438 if test -z "$haveit"; then 1439 haveit= 1440 for x in $LDFLAGS $LIB[]NAME; do 1441 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1442 if test "X$x" = "X-L$dependency_libdir"; then 1443 haveit=yes 1444 break 1445 fi 1446 done 1447 if test -z "$haveit"; then 1448 if test -d "$dependency_libdir"; then 1449 dnl Really add $dependency_libdir to $LIBNAME. 1450 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" 1451 fi 1452 fi 1453 haveit= 1454 for x in $LDFLAGS $LTLIB[]NAME; do 1455 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1456 if test "X$x" = "X-L$dependency_libdir"; then 1457 haveit=yes 1458 break 1459 fi 1460 done 1461 if test -z "$haveit"; then 1462 if test -d "$dependency_libdir"; then 1463 dnl Really add $dependency_libdir to $LTLIBNAME. 1464 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" 1465 fi 1466 fi 1467 fi 1468 fi 1469 ;; 1470 -R*) 1471 dir=`echo "X$dep" | sed -e 's/^X-R//'` 1472 if test "$enable_rpath" != no; then 1473 dnl Potentially add DIR to rpathdirs. 1474 dnl The rpathdirs will be appended to $LIBNAME at the end. 1475 haveit= 1476 for x in $rpathdirs; do 1477 if test "X$x" = "X$dir"; then 1478 haveit=yes 1479 break 1480 fi 1481 done 1482 if test -z "$haveit"; then 1483 rpathdirs="$rpathdirs $dir" 1484 fi 1485 dnl Potentially add DIR to ltrpathdirs. 1486 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. 1487 haveit= 1488 for x in $ltrpathdirs; do 1489 if test "X$x" = "X$dir"; then 1490 haveit=yes 1491 break 1492 fi 1493 done 1494 if test -z "$haveit"; then 1495 ltrpathdirs="$ltrpathdirs $dir" 1496 fi 1497 fi 1498 ;; 1499 -l*) 1500 dnl Handle this in the next round. 1501 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` 1502 ;; 1503 *.la) 1504 dnl Handle this in the next round. Throw away the .la's 1505 dnl directory; it is already contained in a preceding -L 1506 dnl option. 1507 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` 1508 ;; 1509 *) 1510 dnl Most likely an immediate library name. 1511 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" 1512 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" 1513 ;; 1514 esac 1515 done 1516 fi 1517 else 1518 dnl Didn't find the library; assume it is in the system directories 1519 dnl known to the linker and runtime loader. (All the system 1520 dnl directories known to the linker should also be known to the 1521 dnl runtime loader, otherwise the system is severely misconfigured.) 1522 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" 1523 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" 1524 fi 1525 fi 1526 fi 1527 done 1528 done 1529 if test "X$rpathdirs" != "X"; then 1530 if test -n "$acl_hardcode_libdir_separator"; then 1531 dnl Weird platform: only the last -rpath option counts, the user must 1532 dnl pass all path elements in one option. We can arrange that for a 1533 dnl single library, but not when more than one $LIBNAMEs are used. 1534 alldirs= 1535 for found_dir in $rpathdirs; do 1536 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" 1537 done 1538 dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. 1539 acl_save_libdir="$libdir" 1540 libdir="$alldirs" 1541 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1542 libdir="$acl_save_libdir" 1543 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1544 else 1545 dnl The -rpath options are cumulative. 1546 for found_dir in $rpathdirs; do 1547 acl_save_libdir="$libdir" 1548 libdir="$found_dir" 1549 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1550 libdir="$acl_save_libdir" 1551 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" 1552 done 1553 fi 1554 fi 1555 if test "X$ltrpathdirs" != "X"; then 1556 dnl When using libtool, the option that works for both libraries and 1557 dnl executables is -R. The -R options are cumulative. 1558 for found_dir in $ltrpathdirs; do 1559 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" 1560 done 1561 fi 1562 popdef([PACKLIBS]) 1563 popdef([PACKUP]) 1564 popdef([PACK]) 1565 popdef([NAME]) 1566]) 1567 1568dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, 1569dnl unless already present in VAR. 1570dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes 1571dnl contains two or three consecutive elements that belong together. 1572AC_DEFUN([AC_LIB_APPENDTOVAR], 1573[ 1574 for element in [$2]; do 1575 haveit= 1576 for x in $[$1]; do 1577 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1578 if test "X$x" = "X$element"; then 1579 haveit=yes 1580 break 1581 fi 1582 done 1583 if test -z "$haveit"; then 1584 [$1]="${[$1]}${[$1]:+ }$element" 1585 fi 1586 done 1587]) 1588 1589dnl For those cases where a variable contains several -L and -l options 1590dnl referring to unknown libraries and directories, this macro determines the 1591dnl necessary additional linker options for the runtime path. 1592dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) 1593dnl sets LDADDVAR to linker options needed together with LIBSVALUE. 1594dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, 1595dnl otherwise linking without libtool is assumed. 1596AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], 1597[ 1598 AC_REQUIRE([AC_LIB_RPATH]) 1599 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1600 $1= 1601 if test "$enable_rpath" != no; then 1602 if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then 1603 dnl Use an explicit option to hardcode directories into the resulting 1604 dnl binary. 1605 rpathdirs= 1606 next= 1607 for opt in $2; do 1608 if test -n "$next"; then 1609 dir="$next" 1610 dnl No need to hardcode the standard /usr/lib. 1611 if test "X$dir" != "X/usr/$acl_libdirstem" \ 1612 && test "X$dir" != "X/usr/$acl_libdirstem2" \ 1613 && test "X$dir" != "X/usr/$acl_libdirstem3"; then 1614 rpathdirs="$rpathdirs $dir" 1615 fi 1616 next= 1617 else 1618 case $opt in 1619 -L) next=yes ;; 1620 -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` 1621 dnl No need to hardcode the standard /usr/lib. 1622 if test "X$dir" != "X/usr/$acl_libdirstem" \ 1623 && test "X$dir" != "X/usr/$acl_libdirstem2" \ 1624 && test "X$dir" != "X/usr/$acl_libdirstem3"; then 1625 rpathdirs="$rpathdirs $dir" 1626 fi 1627 next= ;; 1628 *) next= ;; 1629 esac 1630 fi 1631 done 1632 if test "X$rpathdirs" != "X"; then 1633 if test -n ""$3""; then 1634 dnl libtool is used for linking. Use -R options. 1635 for dir in $rpathdirs; do 1636 $1="${$1}${$1:+ }-R$dir" 1637 done 1638 else 1639 dnl The linker is used for linking directly. 1640 if test -n "$acl_hardcode_libdir_separator"; then 1641 dnl Weird platform: only the last -rpath option counts, the user 1642 dnl must pass all path elements in one option. 1643 alldirs= 1644 for dir in $rpathdirs; do 1645 alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" 1646 done 1647 acl_save_libdir="$libdir" 1648 libdir="$alldirs" 1649 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1650 libdir="$acl_save_libdir" 1651 $1="$flag" 1652 else 1653 dnl The -rpath options are cumulative. 1654 for dir in $rpathdirs; do 1655 acl_save_libdir="$libdir" 1656 libdir="$dir" 1657 eval flag=\"$acl_hardcode_libdir_flag_spec\" 1658 libdir="$acl_save_libdir" 1659 $1="${$1}${$1:+ }$flag" 1660 done 1661 fi 1662 fi 1663 fi 1664 fi 1665 fi 1666 AC_SUBST([$1]) 1667]) 1668 1669# lib-prefix.m4 serial 17 1670dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc. 1671dnl This file is free software; the Free Software Foundation 1672dnl gives unlimited permission to copy and/or distribute it, 1673dnl with or without modifications, as long as this notice is preserved. 1674 1675dnl From Bruno Haible. 1676 1677dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed 1678dnl to access previously installed libraries. The basic assumption is that 1679dnl a user will want packages to use other packages he previously installed 1680dnl with the same --prefix option. 1681dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate 1682dnl libraries, but is otherwise very convenient. 1683AC_DEFUN([AC_LIB_PREFIX], 1684[ 1685 AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) 1686 AC_REQUIRE([AC_PROG_CC]) 1687 AC_REQUIRE([AC_CANONICAL_HOST]) 1688 AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) 1689 AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) 1690 dnl By default, look in $includedir and $libdir. 1691 use_additional=yes 1692 AC_LIB_WITH_FINAL_PREFIX([ 1693 eval additional_includedir=\"$includedir\" 1694 eval additional_libdir=\"$libdir\" 1695 ]) 1696 AC_ARG_WITH([lib-prefix], 1697[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib 1698 --without-lib-prefix don't search for libraries in includedir and libdir]], 1699[ 1700 if test "X$withval" = "Xno"; then 1701 use_additional=no 1702 else 1703 if test "X$withval" = "X"; then 1704 AC_LIB_WITH_FINAL_PREFIX([ 1705 eval additional_includedir=\"$includedir\" 1706 eval additional_libdir=\"$libdir\" 1707 ]) 1708 else 1709 additional_includedir="$withval/include" 1710 additional_libdir="$withval/$acl_libdirstem" 1711 fi 1712 fi 1713]) 1714 if test $use_additional = yes; then 1715 dnl Potentially add $additional_includedir to $CPPFLAGS. 1716 dnl But don't add it 1717 dnl 1. if it's the standard /usr/include, 1718 dnl 2. if it's already present in $CPPFLAGS, 1719 dnl 3. if it's /usr/local/include and we are using GCC on Linux, 1720 dnl 4. if it doesn't exist as a directory. 1721 if test "X$additional_includedir" != "X/usr/include"; then 1722 haveit= 1723 for x in $CPPFLAGS; do 1724 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1725 if test "X$x" = "X-I$additional_includedir"; then 1726 haveit=yes 1727 break 1728 fi 1729 done 1730 if test -z "$haveit"; then 1731 if test "X$additional_includedir" = "X/usr/local/include"; then 1732 if test -n "$GCC"; then 1733 case $host_os in 1734 linux* | gnu* | k*bsd*-gnu) haveit=yes;; 1735 esac 1736 fi 1737 fi 1738 if test -z "$haveit"; then 1739 if test -d "$additional_includedir"; then 1740 dnl Really add $additional_includedir to $CPPFLAGS. 1741 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" 1742 fi 1743 fi 1744 fi 1745 fi 1746 dnl Potentially add $additional_libdir to $LDFLAGS. 1747 dnl But don't add it 1748 dnl 1. if it's the standard /usr/lib, 1749 dnl 2. if it's already present in $LDFLAGS, 1750 dnl 3. if it's /usr/local/lib and we are using GCC on Linux, 1751 dnl 4. if it doesn't exist as a directory. 1752 if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then 1753 haveit= 1754 for x in $LDFLAGS; do 1755 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) 1756 if test "X$x" = "X-L$additional_libdir"; then 1757 haveit=yes 1758 break 1759 fi 1760 done 1761 if test -z "$haveit"; then 1762 if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then 1763 if test -n "$GCC"; then 1764 case $host_os in 1765 linux*) haveit=yes;; 1766 esac 1767 fi 1768 fi 1769 if test -z "$haveit"; then 1770 if test -d "$additional_libdir"; then 1771 dnl Really add $additional_libdir to $LDFLAGS. 1772 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" 1773 fi 1774 fi 1775 fi 1776 fi 1777 fi 1778]) 1779 1780dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, 1781dnl acl_final_exec_prefix, containing the values to which $prefix and 1782dnl $exec_prefix will expand at the end of the configure script. 1783AC_DEFUN([AC_LIB_PREPARE_PREFIX], 1784[ 1785 dnl Unfortunately, prefix and exec_prefix get only finally determined 1786 dnl at the end of configure. 1787 if test "X$prefix" = "XNONE"; then 1788 acl_final_prefix="$ac_default_prefix" 1789 else 1790 acl_final_prefix="$prefix" 1791 fi 1792 if test "X$exec_prefix" = "XNONE"; then 1793 acl_final_exec_prefix='${prefix}' 1794 else 1795 acl_final_exec_prefix="$exec_prefix" 1796 fi 1797 acl_save_prefix="$prefix" 1798 prefix="$acl_final_prefix" 1799 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" 1800 prefix="$acl_save_prefix" 1801]) 1802 1803dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the 1804dnl variables prefix and exec_prefix bound to the values they will have 1805dnl at the end of the configure script. 1806AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], 1807[ 1808 acl_save_prefix="$prefix" 1809 prefix="$acl_final_prefix" 1810 acl_save_exec_prefix="$exec_prefix" 1811 exec_prefix="$acl_final_exec_prefix" 1812 $1 1813 exec_prefix="$acl_save_exec_prefix" 1814 prefix="$acl_save_prefix" 1815]) 1816 1817dnl AC_LIB_PREPARE_MULTILIB creates 1818dnl - a function acl_is_expected_elfclass, that tests whether standard input 1819dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, 1820dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing 1821dnl the basename of the libdir to try in turn, either "lib" or "lib64" or 1822dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. 1823AC_DEFUN([AC_LIB_PREPARE_MULTILIB], 1824[ 1825 dnl There is no formal standard regarding lib, lib32, and lib64. 1826 dnl On most glibc systems, the current practice is that on a system supporting 1827 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under 1828 dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on 1829 dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go 1830 dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. 1831 dnl We determine the compiler's default mode by looking at the compiler's 1832 dnl library search path. If at least one of its elements ends in /lib64 or 1833 dnl points to a directory whose absolute pathname ends in /lib64, we use that 1834 dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, 1835 dnl namely "lib". 1836 dnl On Solaris systems, the current practice is that on a system supporting 1837 dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under 1838 dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or 1839 dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. 1840 AC_REQUIRE([AC_CANONICAL_HOST]) 1841 AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) 1842 1843 AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], 1844 [AC_EGREP_CPP([Extensible Linking Format], 1845 [#ifdef __ELF__ 1846 Extensible Linking Format 1847 #endif 1848 ], 1849 [gl_cv_elf=yes], 1850 [gl_cv_elf=no]) 1851 ]) 1852 if test $gl_cv_elf; then 1853 # Extract the ELF class of a file (5th byte) in decimal. 1854 # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header 1855 if od -A x < /dev/null >/dev/null 2>/dev/null; then 1856 # Use POSIX od. 1857 func_elfclass () 1858 { 1859 od -A n -t d1 -j 4 -N 1 1860 } 1861 else 1862 # Use BSD hexdump. 1863 func_elfclass () 1864 { 1865 dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' 1866 echo 1867 } 1868 fi 1869changequote(,)dnl 1870 case $HOST_CPU_C_ABI_32BIT in 1871 yes) 1872 # 32-bit ABI. 1873 acl_is_expected_elfclass () 1874 { 1875 test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 1876 } 1877 ;; 1878 no) 1879 # 64-bit ABI. 1880 acl_is_expected_elfclass () 1881 { 1882 test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 1883 } 1884 ;; 1885 *) 1886 # Unknown. 1887 acl_is_expected_elfclass () 1888 { 1889 : 1890 } 1891 ;; 1892 esac 1893changequote([,])dnl 1894 else 1895 acl_is_expected_elfclass () 1896 { 1897 : 1898 } 1899 fi 1900 1901 dnl Allow the user to override the result by setting acl_cv_libdirstems. 1902 AC_CACHE_CHECK([for the common suffixes of directories in the library search path], 1903 [acl_cv_libdirstems], 1904 [dnl Try 'lib' first, because that's the default for libdir in GNU, see 1905 dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>. 1906 acl_libdirstem=lib 1907 acl_libdirstem2= 1908 acl_libdirstem3= 1909 case "$host_os" in 1910 solaris*) 1911 dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment 1912 dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>. 1913 dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." 1914 dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the 1915 dnl symlink is missing, so we set acl_libdirstem2 too. 1916 if test $HOST_CPU_C_ABI_32BIT = no; then 1917 acl_libdirstem2=lib/64 1918 case "$host_cpu" in 1919 sparc*) acl_libdirstem3=lib/sparcv9 ;; 1920 i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; 1921 esac 1922 fi 1923 ;; 1924 *) 1925 dnl If $CC generates code for a 32-bit ABI, the libraries are 1926 dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. 1927 dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries 1928 dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. 1929 dnl Find the compiler's search path. However, non-system compilers 1930 dnl sometimes have odd library search paths. But we can't simply invoke 1931 dnl '/usr/bin/gcc -print-search-dirs' because that would not take into 1932 dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. 1933 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ 1934 | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` 1935 if test $HOST_CPU_C_ABI_32BIT != no; then 1936 # 32-bit or unknown ABI. 1937 if test -d /usr/lib32; then 1938 acl_libdirstem2=lib32 1939 fi 1940 fi 1941 if test $HOST_CPU_C_ABI_32BIT != yes; then 1942 # 64-bit or unknown ABI. 1943 if test -d /usr/lib64; then 1944 acl_libdirstem3=lib64 1945 fi 1946 fi 1947 if test -n "$searchpath"; then 1948 acl_save_IFS="${IFS= }"; IFS=":" 1949 for searchdir in $searchpath; do 1950 if test -d "$searchdir"; then 1951 case "$searchdir" in 1952 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; 1953 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; 1954 */../ | */.. ) 1955 # Better ignore directories of this form. They are misleading. 1956 ;; 1957 *) searchdir=`cd "$searchdir" && pwd` 1958 case "$searchdir" in 1959 */lib32 ) acl_libdirstem2=lib32 ;; 1960 */lib64 ) acl_libdirstem3=lib64 ;; 1961 esac ;; 1962 esac 1963 fi 1964 done 1965 IFS="$acl_save_IFS" 1966 if test $HOST_CPU_C_ABI_32BIT = yes; then 1967 # 32-bit ABI. 1968 acl_libdirstem3= 1969 fi 1970 if test $HOST_CPU_C_ABI_32BIT = no; then 1971 # 64-bit ABI. 1972 acl_libdirstem2= 1973 fi 1974 fi 1975 ;; 1976 esac 1977 test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" 1978 test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" 1979 acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" 1980 ]) 1981 dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and 1982 dnl acl_libdirstem3. 1983changequote(,)dnl 1984 acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` 1985 acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` 1986 acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` 1987changequote([,])dnl 1988]) 1989 1990# Copyright (C) 2002-2020 Free Software Foundation, Inc. 1991# 1992# This file is free software; the Free Software Foundation 1993# gives unlimited permission to copy and/or distribute it, 1994# with or without modifications, as long as this notice is preserved. 1995 1996# AM_AUTOMAKE_VERSION(VERSION) 1997# ---------------------------- 1998# Automake X.Y traces this macro to ensure aclocal.m4 has been 1999# generated from the m4 files accompanying Automake X.Y. 2000# (This private macro should not be called outside this file.) 2001AC_DEFUN([AM_AUTOMAKE_VERSION], 2002[am__api_version='1.16' 2003dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 2004dnl require some minimum version. Point them to the right macro. 2005m4_if([$1], [1.16.2], [], 2006 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 2007]) 2008 2009# _AM_AUTOCONF_VERSION(VERSION) 2010# ----------------------------- 2011# aclocal traces this macro to find the Autoconf version. 2012# This is a private macro too. Using m4_define simplifies 2013# the logic in aclocal, which can simply ignore this definition. 2014m4_define([_AM_AUTOCONF_VERSION], []) 2015 2016# AM_SET_CURRENT_AUTOMAKE_VERSION 2017# ------------------------------- 2018# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 2019# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 2020AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 2021[AM_AUTOMAKE_VERSION([1.16.2])dnl 2022m4_ifndef([AC_AUTOCONF_VERSION], 2023 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 2024_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 2025 2026# AM_AUX_DIR_EXPAND -*- Autoconf -*- 2027 2028# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2029# 2030# This file is free software; the Free Software Foundation 2031# gives unlimited permission to copy and/or distribute it, 2032# with or without modifications, as long as this notice is preserved. 2033 2034# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 2035# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 2036# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 2037# 2038# Of course, Automake must honor this variable whenever it calls a 2039# tool from the auxiliary directory. The problem is that $srcdir (and 2040# therefore $ac_aux_dir as well) can be either absolute or relative, 2041# depending on how configure is run. This is pretty annoying, since 2042# it makes $ac_aux_dir quite unusable in subdirectories: in the top 2043# source directory, any form will work fine, but in subdirectories a 2044# relative path needs to be adjusted first. 2045# 2046# $ac_aux_dir/missing 2047# fails when called from a subdirectory if $ac_aux_dir is relative 2048# $top_srcdir/$ac_aux_dir/missing 2049# fails if $ac_aux_dir is absolute, 2050# fails when called from a subdirectory in a VPATH build with 2051# a relative $ac_aux_dir 2052# 2053# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 2054# are both prefixed by $srcdir. In an in-source build this is usually 2055# harmless because $srcdir is '.', but things will broke when you 2056# start a VPATH build or use an absolute $srcdir. 2057# 2058# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 2059# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 2060# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 2061# and then we would define $MISSING as 2062# MISSING="\${SHELL} $am_aux_dir/missing" 2063# This will work as long as MISSING is not called from configure, because 2064# unfortunately $(top_srcdir) has no meaning in configure. 2065# However there are other variables, like CC, which are often used in 2066# configure, and could therefore not use this "fixed" $ac_aux_dir. 2067# 2068# Another solution, used here, is to always expand $ac_aux_dir to an 2069# absolute PATH. The drawback is that using absolute paths prevent a 2070# configured tree to be moved without reconfiguration. 2071 2072AC_DEFUN([AM_AUX_DIR_EXPAND], 2073[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 2074# Expand $ac_aux_dir to an absolute path. 2075am_aux_dir=`cd "$ac_aux_dir" && pwd` 2076]) 2077 2078# AM_CONDITIONAL -*- Autoconf -*- 2079 2080# Copyright (C) 1997-2020 Free Software Foundation, Inc. 2081# 2082# This file is free software; the Free Software Foundation 2083# gives unlimited permission to copy and/or distribute it, 2084# with or without modifications, as long as this notice is preserved. 2085 2086# AM_CONDITIONAL(NAME, SHELL-CONDITION) 2087# ------------------------------------- 2088# Define a conditional. 2089AC_DEFUN([AM_CONDITIONAL], 2090[AC_PREREQ([2.52])dnl 2091 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 2092 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 2093AC_SUBST([$1_TRUE])dnl 2094AC_SUBST([$1_FALSE])dnl 2095_AM_SUBST_NOTMAKE([$1_TRUE])dnl 2096_AM_SUBST_NOTMAKE([$1_FALSE])dnl 2097m4_define([_AM_COND_VALUE_$1], [$2])dnl 2098if $2; then 2099 $1_TRUE= 2100 $1_FALSE='#' 2101else 2102 $1_TRUE='#' 2103 $1_FALSE= 2104fi 2105AC_CONFIG_COMMANDS_PRE( 2106[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 2107 AC_MSG_ERROR([[conditional "$1" was never defined. 2108Usually this means the macro was only invoked conditionally.]]) 2109fi])]) 2110 2111# Copyright (C) 1999-2020 Free Software Foundation, Inc. 2112# 2113# This file is free software; the Free Software Foundation 2114# gives unlimited permission to copy and/or distribute it, 2115# with or without modifications, as long as this notice is preserved. 2116 2117 2118# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 2119# written in clear, in which case automake, when reading aclocal.m4, 2120# will think it sees a *use*, and therefore will trigger all it's 2121# C support machinery. Also note that it means that autoscan, seeing 2122# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 2123 2124 2125# _AM_DEPENDENCIES(NAME) 2126# ---------------------- 2127# See how the compiler implements dependency checking. 2128# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 2129# We try a few techniques and use that to set a single cache variable. 2130# 2131# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 2132# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 2133# dependency, and given that the user is not expected to run this macro, 2134# just rely on AC_PROG_CC. 2135AC_DEFUN([_AM_DEPENDENCIES], 2136[AC_REQUIRE([AM_SET_DEPDIR])dnl 2137AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 2138AC_REQUIRE([AM_MAKE_INCLUDE])dnl 2139AC_REQUIRE([AM_DEP_TRACK])dnl 2140 2141m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 2142 [$1], [CXX], [depcc="$CXX" am_compiler_list=], 2143 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 2144 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 2145 [$1], [UPC], [depcc="$UPC" am_compiler_list=], 2146 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 2147 [depcc="$$1" am_compiler_list=]) 2148 2149AC_CACHE_CHECK([dependency style of $depcc], 2150 [am_cv_$1_dependencies_compiler_type], 2151[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 2152 # We make a subdir and do the tests there. Otherwise we can end up 2153 # making bogus files that we don't know about and never remove. For 2154 # instance it was reported that on HP-UX the gcc test will end up 2155 # making a dummy file named 'D' -- because '-MD' means "put the output 2156 # in D". 2157 rm -rf conftest.dir 2158 mkdir conftest.dir 2159 # Copy depcomp to subdir because otherwise we won't find it if we're 2160 # using a relative directory. 2161 cp "$am_depcomp" conftest.dir 2162 cd conftest.dir 2163 # We will build objects and dependencies in a subdirectory because 2164 # it helps to detect inapplicable dependency modes. For instance 2165 # both Tru64's cc and ICC support -MD to output dependencies as a 2166 # side effect of compilation, but ICC will put the dependencies in 2167 # the current directory while Tru64 will put them in the object 2168 # directory. 2169 mkdir sub 2170 2171 am_cv_$1_dependencies_compiler_type=none 2172 if test "$am_compiler_list" = ""; then 2173 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 2174 fi 2175 am__universal=false 2176 m4_case([$1], [CC], 2177 [case " $depcc " in #( 2178 *\ -arch\ *\ -arch\ *) am__universal=true ;; 2179 esac], 2180 [CXX], 2181 [case " $depcc " in #( 2182 *\ -arch\ *\ -arch\ *) am__universal=true ;; 2183 esac]) 2184 2185 for depmode in $am_compiler_list; do 2186 # Setup a source with many dependencies, because some compilers 2187 # like to wrap large dependency lists on column 80 (with \), and 2188 # we should not choose a depcomp mode which is confused by this. 2189 # 2190 # We need to recreate these files for each test, as the compiler may 2191 # overwrite some of them when testing with obscure command lines. 2192 # This happens at least with the AIX C compiler. 2193 : > sub/conftest.c 2194 for i in 1 2 3 4 5 6; do 2195 echo '#include "conftst'$i'.h"' >> sub/conftest.c 2196 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 2197 # Solaris 10 /bin/sh. 2198 echo '/* dummy */' > sub/conftst$i.h 2199 done 2200 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2201 2202 # We check with '-c' and '-o' for the sake of the "dashmstdout" 2203 # mode. It turns out that the SunPro C++ compiler does not properly 2204 # handle '-M -o', and we need to detect this. Also, some Intel 2205 # versions had trouble with output in subdirs. 2206 am__obj=sub/conftest.${OBJEXT-o} 2207 am__minus_obj="-o $am__obj" 2208 case $depmode in 2209 gcc) 2210 # This depmode causes a compiler race in universal mode. 2211 test "$am__universal" = false || continue 2212 ;; 2213 nosideeffect) 2214 # After this tag, mechanisms are not by side-effect, so they'll 2215 # only be used when explicitly requested. 2216 if test "x$enable_dependency_tracking" = xyes; then 2217 continue 2218 else 2219 break 2220 fi 2221 ;; 2222 msvc7 | msvc7msys | msvisualcpp | msvcmsys) 2223 # This compiler won't grok '-c -o', but also, the minuso test has 2224 # not run yet. These depmodes are late enough in the game, and 2225 # so weak that their functioning should not be impacted. 2226 am__obj=conftest.${OBJEXT-o} 2227 am__minus_obj= 2228 ;; 2229 none) break ;; 2230 esac 2231 if depmode=$depmode \ 2232 source=sub/conftest.c object=$am__obj \ 2233 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 2234 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 2235 >/dev/null 2>conftest.err && 2236 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2237 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2238 grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2239 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2240 # icc doesn't choke on unknown options, it will just issue warnings 2241 # or remarks (even with -Werror). So we grep stderr for any message 2242 # that says an option was ignored or not supported. 2243 # When given -MP, icc 7.0 and 7.1 complain thusly: 2244 # icc: Command line warning: ignoring option '-M'; no argument required 2245 # The diagnosis changed in icc 8.0: 2246 # icc: Command line remark: option '-MP' not supported 2247 if (grep 'ignoring option' conftest.err || 2248 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2249 am_cv_$1_dependencies_compiler_type=$depmode 2250 break 2251 fi 2252 fi 2253 done 2254 2255 cd .. 2256 rm -rf conftest.dir 2257else 2258 am_cv_$1_dependencies_compiler_type=none 2259fi 2260]) 2261AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2262AM_CONDITIONAL([am__fastdep$1], [ 2263 test "x$enable_dependency_tracking" != xno \ 2264 && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 2265]) 2266 2267 2268# AM_SET_DEPDIR 2269# ------------- 2270# Choose a directory name for dependency files. 2271# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 2272AC_DEFUN([AM_SET_DEPDIR], 2273[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 2274AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 2275]) 2276 2277 2278# AM_DEP_TRACK 2279# ------------ 2280AC_DEFUN([AM_DEP_TRACK], 2281[AC_ARG_ENABLE([dependency-tracking], [dnl 2282AS_HELP_STRING( 2283 [--enable-dependency-tracking], 2284 [do not reject slow dependency extractors]) 2285AS_HELP_STRING( 2286 [--disable-dependency-tracking], 2287 [speeds up one-time build])]) 2288if test "x$enable_dependency_tracking" != xno; then 2289 am_depcomp="$ac_aux_dir/depcomp" 2290 AMDEPBACKSLASH='\' 2291 am__nodep='_no' 2292fi 2293AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 2294AC_SUBST([AMDEPBACKSLASH])dnl 2295_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 2296AC_SUBST([am__nodep])dnl 2297_AM_SUBST_NOTMAKE([am__nodep])dnl 2298]) 2299 2300# Generate code to set up dependency tracking. -*- Autoconf -*- 2301 2302# Copyright (C) 1999-2020 Free Software Foundation, Inc. 2303# 2304# This file is free software; the Free Software Foundation 2305# gives unlimited permission to copy and/or distribute it, 2306# with or without modifications, as long as this notice is preserved. 2307 2308# _AM_OUTPUT_DEPENDENCY_COMMANDS 2309# ------------------------------ 2310AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 2311[{ 2312 # Older Autoconf quotes --file arguments for eval, but not when files 2313 # are listed without --file. Let's play safe and only enable the eval 2314 # if we detect the quoting. 2315 # TODO: see whether this extra hack can be removed once we start 2316 # requiring Autoconf 2.70 or later. 2317 AS_CASE([$CONFIG_FILES], 2318 [*\'*], [eval set x "$CONFIG_FILES"], 2319 [*], [set x $CONFIG_FILES]) 2320 shift 2321 # Used to flag and report bootstrapping failures. 2322 am_rc=0 2323 for am_mf 2324 do 2325 # Strip MF so we end up with the name of the file. 2326 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` 2327 # Check whether this is an Automake generated Makefile which includes 2328 # dependency-tracking related rules and includes. 2329 # Grep'ing the whole file directly is not great: AIX grep has a line 2330 # limit of 2048, but all sed's we know have understand at least 4000. 2331 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ 2332 || continue 2333 am_dirpart=`AS_DIRNAME(["$am_mf"])` 2334 am_filepart=`AS_BASENAME(["$am_mf"])` 2335 AM_RUN_LOG([cd "$am_dirpart" \ 2336 && sed -e '/# am--include-marker/d' "$am_filepart" \ 2337 | $MAKE -f - am--depfiles]) || am_rc=$? 2338 done 2339 if test $am_rc -ne 0; then 2340 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments 2341 for automatic dependency tracking. If GNU make was not used, consider 2342 re-running the configure script with MAKE="gmake" (or whatever is 2343 necessary). You can also try re-running configure with the 2344 '--disable-dependency-tracking' option to at least be able to build 2345 the package (albeit without support for automatic dependency tracking).]) 2346 fi 2347 AS_UNSET([am_dirpart]) 2348 AS_UNSET([am_filepart]) 2349 AS_UNSET([am_mf]) 2350 AS_UNSET([am_rc]) 2351 rm -f conftest-deps.mk 2352} 2353])# _AM_OUTPUT_DEPENDENCY_COMMANDS 2354 2355 2356# AM_OUTPUT_DEPENDENCY_COMMANDS 2357# ----------------------------- 2358# This macro should only be invoked once -- use via AC_REQUIRE. 2359# 2360# This code is only required when automatic dependency tracking is enabled. 2361# This creates each '.Po' and '.Plo' makefile fragment that we'll need in 2362# order to bootstrap the dependency handling code. 2363AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 2364[AC_CONFIG_COMMANDS([depfiles], 2365 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 2366 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) 2367 2368# Do all the work for Automake. -*- Autoconf -*- 2369 2370# Copyright (C) 1996-2020 Free Software Foundation, Inc. 2371# 2372# This file is free software; the Free Software Foundation 2373# gives unlimited permission to copy and/or distribute it, 2374# with or without modifications, as long as this notice is preserved. 2375 2376# This macro actually does too much. Some checks are only needed if 2377# your package does certain things. But this isn't really a big deal. 2378 2379dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 2380m4_define([AC_PROG_CC], 2381m4_defn([AC_PROG_CC]) 2382[_AM_PROG_CC_C_O 2383]) 2384 2385# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 2386# AM_INIT_AUTOMAKE([OPTIONS]) 2387# ----------------------------------------------- 2388# The call with PACKAGE and VERSION arguments is the old style 2389# call (pre autoconf-2.50), which is being phased out. PACKAGE 2390# and VERSION should now be passed to AC_INIT and removed from 2391# the call to AM_INIT_AUTOMAKE. 2392# We support both call styles for the transition. After 2393# the next Automake release, Autoconf can make the AC_INIT 2394# arguments mandatory, and then we can depend on a new Autoconf 2395# release and drop the old call support. 2396AC_DEFUN([AM_INIT_AUTOMAKE], 2397[AC_PREREQ([2.65])dnl 2398dnl Autoconf wants to disallow AM_ names. We explicitly allow 2399dnl the ones we care about. 2400m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 2401AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 2402AC_REQUIRE([AC_PROG_INSTALL])dnl 2403if test "`cd $srcdir && pwd`" != "`pwd`"; then 2404 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 2405 # is not polluted with repeated "-I." 2406 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 2407 # test to see if srcdir already configured 2408 if test -f $srcdir/config.status; then 2409 AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 2410 fi 2411fi 2412 2413# test whether we have cygpath 2414if test -z "$CYGPATH_W"; then 2415 if (cygpath --version) >/dev/null 2>/dev/null; then 2416 CYGPATH_W='cygpath -w' 2417 else 2418 CYGPATH_W=echo 2419 fi 2420fi 2421AC_SUBST([CYGPATH_W]) 2422 2423# Define the identity of the package. 2424dnl Distinguish between old-style and new-style calls. 2425m4_ifval([$2], 2426[AC_DIAGNOSE([obsolete], 2427 [$0: two- and three-arguments forms are deprecated.]) 2428m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 2429 AC_SUBST([PACKAGE], [$1])dnl 2430 AC_SUBST([VERSION], [$2])], 2431[_AM_SET_OPTIONS([$1])dnl 2432dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 2433m4_if( 2434 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), 2435 [ok:ok],, 2436 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 2437 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 2438 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 2439 2440_AM_IF_OPTION([no-define],, 2441[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 2442 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 2443 2444# Some tools Automake needs. 2445AC_REQUIRE([AM_SANITY_CHECK])dnl 2446AC_REQUIRE([AC_ARG_PROGRAM])dnl 2447AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 2448AM_MISSING_PROG([AUTOCONF], [autoconf]) 2449AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 2450AM_MISSING_PROG([AUTOHEADER], [autoheader]) 2451AM_MISSING_PROG([MAKEINFO], [makeinfo]) 2452AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 2453AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 2454AC_REQUIRE([AC_PROG_MKDIR_P])dnl 2455# For better backward compatibility. To be removed once Automake 1.9.x 2456# dies out for good. For more background, see: 2457# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 2458# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 2459AC_SUBST([mkdir_p], ['$(MKDIR_P)']) 2460# We need awk for the "check" target (and possibly the TAP driver). The 2461# system "awk" is bad on some platforms. 2462AC_REQUIRE([AC_PROG_AWK])dnl 2463AC_REQUIRE([AC_PROG_MAKE_SET])dnl 2464AC_REQUIRE([AM_SET_LEADING_DOT])dnl 2465_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 2466 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 2467 [_AM_PROG_TAR([v7])])]) 2468_AM_IF_OPTION([no-dependencies],, 2469[AC_PROVIDE_IFELSE([AC_PROG_CC], 2470 [_AM_DEPENDENCIES([CC])], 2471 [m4_define([AC_PROG_CC], 2472 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 2473AC_PROVIDE_IFELSE([AC_PROG_CXX], 2474 [_AM_DEPENDENCIES([CXX])], 2475 [m4_define([AC_PROG_CXX], 2476 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 2477AC_PROVIDE_IFELSE([AC_PROG_OBJC], 2478 [_AM_DEPENDENCIES([OBJC])], 2479 [m4_define([AC_PROG_OBJC], 2480 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 2481AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 2482 [_AM_DEPENDENCIES([OBJCXX])], 2483 [m4_define([AC_PROG_OBJCXX], 2484 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 2485]) 2486AC_REQUIRE([AM_SILENT_RULES])dnl 2487dnl The testsuite driver may need to know about EXEEXT, so add the 2488dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 2489dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 2490AC_CONFIG_COMMANDS_PRE(dnl 2491[m4_provide_if([_AM_COMPILER_EXEEXT], 2492 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 2493 2494# POSIX will say in a future version that running "rm -f" with no argument 2495# is OK; and we want to be able to make that assumption in our Makefile 2496# recipes. So use an aggressive probe to check that the usage we want is 2497# actually supported "in the wild" to an acceptable degree. 2498# See automake bug#10828. 2499# To make any issue more visible, cause the running configure to be aborted 2500# by default if the 'rm' program in use doesn't match our expectations; the 2501# user can still override this though. 2502if rm -f && rm -fr && rm -rf; then : OK; else 2503 cat >&2 <<'END' 2504Oops! 2505 2506Your 'rm' program seems unable to run without file operands specified 2507on the command line, even when the '-f' option is present. This is contrary 2508to the behaviour of most rm programs out there, and not conforming with 2509the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 2510 2511Please tell bug-automake@gnu.org about your system, including the value 2512of your $PATH and any error possibly output before this message. This 2513can help us improve future automake versions. 2514 2515END 2516 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 2517 echo 'Configuration will proceed anyway, since you have set the' >&2 2518 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 2519 echo >&2 2520 else 2521 cat >&2 <<'END' 2522Aborting the configuration process, to ensure you take notice of the issue. 2523 2524You can download and install GNU coreutils to get an 'rm' implementation 2525that behaves properly: <https://www.gnu.org/software/coreutils/>. 2526 2527If you want to complete the configuration process using your problematic 2528'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 2529to "yes", and re-run configure. 2530 2531END 2532 AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 2533 fi 2534fi 2535dnl The trailing newline in this macro's definition is deliberate, for 2536dnl backward compatibility and to allow trailing 'dnl'-style comments 2537dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 2538]) 2539 2540dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 2541dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 2542dnl mangled by Autoconf and run in a shell conditional statement. 2543m4_define([_AC_COMPILER_EXEEXT], 2544m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 2545 2546# When config.status generates a header, we must update the stamp-h file. 2547# This file resides in the same directory as the config header 2548# that is generated. The stamp files are numbered to have different names. 2549 2550# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 2551# loop where config.status creates the headers, so we can generate 2552# our stamp files there. 2553AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 2554[# Compute $1's index in $config_headers. 2555_am_arg=$1 2556_am_stamp_count=1 2557for _am_header in $config_headers :; do 2558 case $_am_header in 2559 $_am_arg | $_am_arg:* ) 2560 break ;; 2561 * ) 2562 _am_stamp_count=`expr $_am_stamp_count + 1` ;; 2563 esac 2564done 2565echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 2566 2567# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2568# 2569# This file is free software; the Free Software Foundation 2570# gives unlimited permission to copy and/or distribute it, 2571# with or without modifications, as long as this notice is preserved. 2572 2573# AM_PROG_INSTALL_SH 2574# ------------------ 2575# Define $install_sh. 2576AC_DEFUN([AM_PROG_INSTALL_SH], 2577[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2578if test x"${install_sh+set}" != xset; then 2579 case $am_aux_dir in 2580 *\ * | *\ *) 2581 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 2582 *) 2583 install_sh="\${SHELL} $am_aux_dir/install-sh" 2584 esac 2585fi 2586AC_SUBST([install_sh])]) 2587 2588# Copyright (C) 2003-2020 Free Software Foundation, Inc. 2589# 2590# This file is free software; the Free Software Foundation 2591# gives unlimited permission to copy and/or distribute it, 2592# with or without modifications, as long as this notice is preserved. 2593 2594# Check whether the underlying file-system supports filenames 2595# with a leading dot. For instance MS-DOS doesn't. 2596AC_DEFUN([AM_SET_LEADING_DOT], 2597[rm -rf .tst 2>/dev/null 2598mkdir .tst 2>/dev/null 2599if test -d .tst; then 2600 am__leading_dot=. 2601else 2602 am__leading_dot=_ 2603fi 2604rmdir .tst 2>/dev/null 2605AC_SUBST([am__leading_dot])]) 2606 2607# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 2608# From Jim Meyering 2609 2610# Copyright (C) 1996-2020 Free Software Foundation, Inc. 2611# 2612# This file is free software; the Free Software Foundation 2613# gives unlimited permission to copy and/or distribute it, 2614# with or without modifications, as long as this notice is preserved. 2615 2616# AM_MAINTAINER_MODE([DEFAULT-MODE]) 2617# ---------------------------------- 2618# Control maintainer-specific portions of Makefiles. 2619# Default is to disable them, unless 'enable' is passed literally. 2620# For symmetry, 'disable' may be passed as well. Anyway, the user 2621# can override the default with the --enable/--disable switch. 2622AC_DEFUN([AM_MAINTAINER_MODE], 2623[m4_case(m4_default([$1], [disable]), 2624 [enable], [m4_define([am_maintainer_other], [disable])], 2625 [disable], [m4_define([am_maintainer_other], [enable])], 2626 [m4_define([am_maintainer_other], [enable]) 2627 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 2628AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 2629 dnl maintainer-mode's default is 'disable' unless 'enable' is passed 2630 AC_ARG_ENABLE([maintainer-mode], 2631 [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], 2632 am_maintainer_other[ make rules and dependencies not useful 2633 (and sometimes confusing) to the casual installer])], 2634 [USE_MAINTAINER_MODE=$enableval], 2635 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 2636 AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 2637 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 2638 MAINT=$MAINTAINER_MODE_TRUE 2639 AC_SUBST([MAINT])dnl 2640] 2641) 2642 2643# Check to see how 'make' treats includes. -*- Autoconf -*- 2644 2645# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2646# 2647# This file is free software; the Free Software Foundation 2648# gives unlimited permission to copy and/or distribute it, 2649# with or without modifications, as long as this notice is preserved. 2650 2651# AM_MAKE_INCLUDE() 2652# ----------------- 2653# Check whether make has an 'include' directive that can support all 2654# the idioms we need for our automatic dependency tracking code. 2655AC_DEFUN([AM_MAKE_INCLUDE], 2656[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) 2657cat > confinc.mk << 'END' 2658am__doit: 2659 @echo this is the am__doit target >confinc.out 2660.PHONY: am__doit 2661END 2662am__include="#" 2663am__quote= 2664# BSD make does it like this. 2665echo '.include "confinc.mk" # ignored' > confmf.BSD 2666# Other make implementations (GNU, Solaris 10, AIX) do it like this. 2667echo 'include confinc.mk # ignored' > confmf.GNU 2668_am_result=no 2669for s in GNU BSD; do 2670 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) 2671 AS_CASE([$?:`cat confinc.out 2>/dev/null`], 2672 ['0:this is the am__doit target'], 2673 [AS_CASE([$s], 2674 [BSD], [am__include='.include' am__quote='"'], 2675 [am__include='include' am__quote=''])]) 2676 if test "$am__include" != "#"; then 2677 _am_result="yes ($s style)" 2678 break 2679 fi 2680done 2681rm -f confinc.* confmf.* 2682AC_MSG_RESULT([${_am_result}]) 2683AC_SUBST([am__include])]) 2684AC_SUBST([am__quote])]) 2685 2686# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 2687 2688# Copyright (C) 1997-2020 Free Software Foundation, Inc. 2689# 2690# This file is free software; the Free Software Foundation 2691# gives unlimited permission to copy and/or distribute it, 2692# with or without modifications, as long as this notice is preserved. 2693 2694# AM_MISSING_PROG(NAME, PROGRAM) 2695# ------------------------------ 2696AC_DEFUN([AM_MISSING_PROG], 2697[AC_REQUIRE([AM_MISSING_HAS_RUN]) 2698$1=${$1-"${am_missing_run}$2"} 2699AC_SUBST($1)]) 2700 2701# AM_MISSING_HAS_RUN 2702# ------------------ 2703# Define MISSING if not defined so far and test if it is modern enough. 2704# If it is, set am_missing_run to use it, otherwise, to nothing. 2705AC_DEFUN([AM_MISSING_HAS_RUN], 2706[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2707AC_REQUIRE_AUX_FILE([missing])dnl 2708if test x"${MISSING+set}" != xset; then 2709 case $am_aux_dir in 2710 *\ * | *\ *) 2711 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 2712 *) 2713 MISSING="\${SHELL} $am_aux_dir/missing" ;; 2714 esac 2715fi 2716# Use eval to expand $SHELL 2717if eval "$MISSING --is-lightweight"; then 2718 am_missing_run="$MISSING " 2719else 2720 am_missing_run= 2721 AC_MSG_WARN(['missing' script is too old or missing]) 2722fi 2723]) 2724 2725# -*- Autoconf -*- 2726# Obsolete and "removed" macros, that must however still report explicit 2727# error messages when used, to smooth transition. 2728# 2729# Copyright (C) 1996-2020 Free Software Foundation, Inc. 2730# 2731# This file is free software; the Free Software Foundation 2732# gives unlimited permission to copy and/or distribute it, 2733# with or without modifications, as long as this notice is preserved. 2734 2735AC_DEFUN([AM_CONFIG_HEADER], 2736[AC_DIAGNOSE([obsolete], 2737['$0': this macro is obsolete. 2738You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl 2739AC_CONFIG_HEADERS($@)]) 2740 2741AC_DEFUN([AM_PROG_CC_STDC], 2742[AC_PROG_CC 2743am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc 2744AC_DIAGNOSE([obsolete], 2745['$0': this macro is obsolete. 2746You should simply use the 'AC][_PROG_CC' macro instead. 2747Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', 2748but upon 'ac_cv_prog_cc_stdc'.])]) 2749 2750AC_DEFUN([AM_C_PROTOTYPES], 2751 [AC_FATAL([automatic de-ANSI-fication support has been removed])]) 2752AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) 2753 2754# Helper functions for option handling. -*- Autoconf -*- 2755 2756# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2757# 2758# This file is free software; the Free Software Foundation 2759# gives unlimited permission to copy and/or distribute it, 2760# with or without modifications, as long as this notice is preserved. 2761 2762# _AM_MANGLE_OPTION(NAME) 2763# ----------------------- 2764AC_DEFUN([_AM_MANGLE_OPTION], 2765[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 2766 2767# _AM_SET_OPTION(NAME) 2768# -------------------- 2769# Set option NAME. Presently that only means defining a flag for this option. 2770AC_DEFUN([_AM_SET_OPTION], 2771[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 2772 2773# _AM_SET_OPTIONS(OPTIONS) 2774# ------------------------ 2775# OPTIONS is a space-separated list of Automake options. 2776AC_DEFUN([_AM_SET_OPTIONS], 2777[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 2778 2779# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 2780# ------------------------------------------- 2781# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 2782AC_DEFUN([_AM_IF_OPTION], 2783[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 2784 2785# Copyright (C) 1999-2020 Free Software Foundation, Inc. 2786# 2787# This file is free software; the Free Software Foundation 2788# gives unlimited permission to copy and/or distribute it, 2789# with or without modifications, as long as this notice is preserved. 2790 2791# _AM_PROG_CC_C_O 2792# --------------- 2793# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 2794# to automatically call this. 2795AC_DEFUN([_AM_PROG_CC_C_O], 2796[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 2797AC_REQUIRE_AUX_FILE([compile])dnl 2798AC_LANG_PUSH([C])dnl 2799AC_CACHE_CHECK( 2800 [whether $CC understands -c and -o together], 2801 [am_cv_prog_cc_c_o], 2802 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 2803 # Make sure it works both with $CC and with simple cc. 2804 # Following AC_PROG_CC_C_O, we do the test twice because some 2805 # compilers refuse to overwrite an existing .o file with -o, 2806 # though they will create one. 2807 am_cv_prog_cc_c_o=yes 2808 for am_i in 1 2; do 2809 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 2810 && test -f conftest2.$ac_objext; then 2811 : OK 2812 else 2813 am_cv_prog_cc_c_o=no 2814 break 2815 fi 2816 done 2817 rm -f core conftest* 2818 unset am_i]) 2819if test "$am_cv_prog_cc_c_o" != yes; then 2820 # Losing compiler, so override with the script. 2821 # FIXME: It is wrong to rewrite CC. 2822 # But if we don't then we get into trouble of one sort or another. 2823 # A longer-term fix would be to have automake use am__CC in this case, 2824 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 2825 CC="$am_aux_dir/compile $CC" 2826fi 2827AC_LANG_POP([C])]) 2828 2829# For backward compatibility. 2830AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 2831 2832# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2833# 2834# This file is free software; the Free Software Foundation 2835# gives unlimited permission to copy and/or distribute it, 2836# with or without modifications, as long as this notice is preserved. 2837 2838# AM_RUN_LOG(COMMAND) 2839# ------------------- 2840# Run COMMAND, save the exit status in ac_status, and log it. 2841# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 2842AC_DEFUN([AM_RUN_LOG], 2843[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 2844 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 2845 ac_status=$? 2846 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 2847 (exit $ac_status); }]) 2848 2849# Check to make sure that the build environment is sane. -*- Autoconf -*- 2850 2851# Copyright (C) 1996-2020 Free Software Foundation, Inc. 2852# 2853# This file is free software; the Free Software Foundation 2854# gives unlimited permission to copy and/or distribute it, 2855# with or without modifications, as long as this notice is preserved. 2856 2857# AM_SANITY_CHECK 2858# --------------- 2859AC_DEFUN([AM_SANITY_CHECK], 2860[AC_MSG_CHECKING([whether build environment is sane]) 2861# Reject unsafe characters in $srcdir or the absolute working directory 2862# name. Accept space and tab only in the latter. 2863am_lf=' 2864' 2865case `pwd` in 2866 *[[\\\"\#\$\&\'\`$am_lf]]*) 2867 AC_MSG_ERROR([unsafe absolute working directory name]);; 2868esac 2869case $srcdir in 2870 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 2871 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 2872esac 2873 2874# Do 'set' in a subshell so we don't clobber the current shell's 2875# arguments. Must try -L first in case configure is actually a 2876# symlink; some systems play weird games with the mod time of symlinks 2877# (eg FreeBSD returns the mod time of the symlink's containing 2878# directory). 2879if ( 2880 am_has_slept=no 2881 for am_try in 1 2; do 2882 echo "timestamp, slept: $am_has_slept" > conftest.file 2883 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 2884 if test "$[*]" = "X"; then 2885 # -L didn't work. 2886 set X `ls -t "$srcdir/configure" conftest.file` 2887 fi 2888 if test "$[*]" != "X $srcdir/configure conftest.file" \ 2889 && test "$[*]" != "X conftest.file $srcdir/configure"; then 2890 2891 # If neither matched, then we have a broken ls. This can happen 2892 # if, for instance, CONFIG_SHELL is bash and it inherits a 2893 # broken ls alias from the environment. This has actually 2894 # happened. Such a system could not be considered "sane". 2895 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 2896 alias in your environment]) 2897 fi 2898 if test "$[2]" = conftest.file || test $am_try -eq 2; then 2899 break 2900 fi 2901 # Just in case. 2902 sleep 1 2903 am_has_slept=yes 2904 done 2905 test "$[2]" = conftest.file 2906 ) 2907then 2908 # Ok. 2909 : 2910else 2911 AC_MSG_ERROR([newly created file is older than distributed files! 2912Check your system clock]) 2913fi 2914AC_MSG_RESULT([yes]) 2915# If we didn't sleep, we still need to ensure time stamps of config.status and 2916# generated files are strictly newer. 2917am_sleep_pid= 2918if grep 'slept: no' conftest.file >/dev/null 2>&1; then 2919 ( sleep 1 ) & 2920 am_sleep_pid=$! 2921fi 2922AC_CONFIG_COMMANDS_PRE( 2923 [AC_MSG_CHECKING([that generated files are newer than configure]) 2924 if test -n "$am_sleep_pid"; then 2925 # Hide warnings about reused PIDs. 2926 wait $am_sleep_pid 2>/dev/null 2927 fi 2928 AC_MSG_RESULT([done])]) 2929rm -f conftest.file 2930]) 2931 2932# Copyright (C) 2009-2020 Free Software Foundation, Inc. 2933# 2934# This file is free software; the Free Software Foundation 2935# gives unlimited permission to copy and/or distribute it, 2936# with or without modifications, as long as this notice is preserved. 2937 2938# AM_SILENT_RULES([DEFAULT]) 2939# -------------------------- 2940# Enable less verbose build rules; with the default set to DEFAULT 2941# ("yes" being less verbose, "no" or empty being verbose). 2942AC_DEFUN([AM_SILENT_RULES], 2943[AC_ARG_ENABLE([silent-rules], [dnl 2944AS_HELP_STRING( 2945 [--enable-silent-rules], 2946 [less verbose build output (undo: "make V=1")]) 2947AS_HELP_STRING( 2948 [--disable-silent-rules], 2949 [verbose build output (undo: "make V=0")])dnl 2950]) 2951case $enable_silent_rules in @%:@ ((( 2952 yes) AM_DEFAULT_VERBOSITY=0;; 2953 no) AM_DEFAULT_VERBOSITY=1;; 2954 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 2955esac 2956dnl 2957dnl A few 'make' implementations (e.g., NonStop OS and NextStep) 2958dnl do not support nested variable expansions. 2959dnl See automake bug#9928 and bug#10237. 2960am_make=${MAKE-make} 2961AC_CACHE_CHECK([whether $am_make supports nested variables], 2962 [am_cv_make_support_nested_variables], 2963 [if AS_ECHO([['TRUE=$(BAR$(V)) 2964BAR0=false 2965BAR1=true 2966V=1 2967am__doit: 2968 @$(TRUE) 2969.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 2970 am_cv_make_support_nested_variables=yes 2971else 2972 am_cv_make_support_nested_variables=no 2973fi]) 2974if test $am_cv_make_support_nested_variables = yes; then 2975 dnl Using '$V' instead of '$(V)' breaks IRIX make. 2976 AM_V='$(V)' 2977 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 2978else 2979 AM_V=$AM_DEFAULT_VERBOSITY 2980 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 2981fi 2982AC_SUBST([AM_V])dnl 2983AM_SUBST_NOTMAKE([AM_V])dnl 2984AC_SUBST([AM_DEFAULT_V])dnl 2985AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 2986AC_SUBST([AM_DEFAULT_VERBOSITY])dnl 2987AM_BACKSLASH='\' 2988AC_SUBST([AM_BACKSLASH])dnl 2989_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 2990]) 2991 2992# Copyright (C) 2001-2020 Free Software Foundation, Inc. 2993# 2994# This file is free software; the Free Software Foundation 2995# gives unlimited permission to copy and/or distribute it, 2996# with or without modifications, as long as this notice is preserved. 2997 2998# AM_PROG_INSTALL_STRIP 2999# --------------------- 3000# One issue with vendor 'install' (even GNU) is that you can't 3001# specify the program used to strip binaries. This is especially 3002# annoying in cross-compiling environments, where the build's strip 3003# is unlikely to handle the host's binaries. 3004# Fortunately install-sh will honor a STRIPPROG variable, so we 3005# always use install-sh in "make install-strip", and initialize 3006# STRIPPROG with the value of the STRIP variable (set by the user). 3007AC_DEFUN([AM_PROG_INSTALL_STRIP], 3008[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 3009# Installed binaries are usually stripped using 'strip' when the user 3010# run "make install-strip". However 'strip' might not be the right 3011# tool to use in cross-compilation environments, therefore Automake 3012# will honor the 'STRIP' environment variable to overrule this program. 3013dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 3014if test "$cross_compiling" != no; then 3015 AC_CHECK_TOOL([STRIP], [strip], :) 3016fi 3017INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 3018AC_SUBST([INSTALL_STRIP_PROGRAM])]) 3019 3020# Copyright (C) 2006-2020 Free Software Foundation, Inc. 3021# 3022# This file is free software; the Free Software Foundation 3023# gives unlimited permission to copy and/or distribute it, 3024# with or without modifications, as long as this notice is preserved. 3025 3026# _AM_SUBST_NOTMAKE(VARIABLE) 3027# --------------------------- 3028# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 3029# This macro is traced by Automake. 3030AC_DEFUN([_AM_SUBST_NOTMAKE]) 3031 3032# AM_SUBST_NOTMAKE(VARIABLE) 3033# -------------------------- 3034# Public sister of _AM_SUBST_NOTMAKE. 3035AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 3036 3037# Check how to create a tarball. -*- Autoconf -*- 3038 3039# Copyright (C) 2004-2020 Free Software Foundation, Inc. 3040# 3041# This file is free software; the Free Software Foundation 3042# gives unlimited permission to copy and/or distribute it, 3043# with or without modifications, as long as this notice is preserved. 3044 3045# _AM_PROG_TAR(FORMAT) 3046# -------------------- 3047# Check how to create a tarball in format FORMAT. 3048# FORMAT should be one of 'v7', 'ustar', or 'pax'. 3049# 3050# Substitute a variable $(am__tar) that is a command 3051# writing to stdout a FORMAT-tarball containing the directory 3052# $tardir. 3053# tardir=directory && $(am__tar) > result.tar 3054# 3055# Substitute a variable $(am__untar) that extract such 3056# a tarball read from stdin. 3057# $(am__untar) < result.tar 3058# 3059AC_DEFUN([_AM_PROG_TAR], 3060[# Always define AMTAR for backward compatibility. Yes, it's still used 3061# in the wild :-( We should find a proper way to deprecate it ... 3062AC_SUBST([AMTAR], ['$${TAR-tar}']) 3063 3064# We'll loop over all known methods to create a tar archive until one works. 3065_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 3066 3067m4_if([$1], [v7], 3068 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 3069 3070 [m4_case([$1], 3071 [ustar], 3072 [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 3073 # There is notably a 21 bits limit for the UID and the GID. In fact, 3074 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 3075 # and bug#13588). 3076 am_max_uid=2097151 # 2^21 - 1 3077 am_max_gid=$am_max_uid 3078 # The $UID and $GID variables are not portable, so we need to resort 3079 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 3080 # below are definitely unexpected, so allow the users to see them 3081 # (that is, avoid stderr redirection). 3082 am_uid=`id -u || echo unknown` 3083 am_gid=`id -g || echo unknown` 3084 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 3085 if test $am_uid -le $am_max_uid; then 3086 AC_MSG_RESULT([yes]) 3087 else 3088 AC_MSG_RESULT([no]) 3089 _am_tools=none 3090 fi 3091 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 3092 if test $am_gid -le $am_max_gid; then 3093 AC_MSG_RESULT([yes]) 3094 else 3095 AC_MSG_RESULT([no]) 3096 _am_tools=none 3097 fi], 3098 3099 [pax], 3100 [], 3101 3102 [m4_fatal([Unknown tar format])]) 3103 3104 AC_MSG_CHECKING([how to create a $1 tar archive]) 3105 3106 # Go ahead even if we have the value already cached. We do so because we 3107 # need to set the values for the 'am__tar' and 'am__untar' variables. 3108 _am_tools=${am_cv_prog_tar_$1-$_am_tools} 3109 3110 for _am_tool in $_am_tools; do 3111 case $_am_tool in 3112 gnutar) 3113 for _am_tar in tar gnutar gtar; do 3114 AM_RUN_LOG([$_am_tar --version]) && break 3115 done 3116 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 3117 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 3118 am__untar="$_am_tar -xf -" 3119 ;; 3120 plaintar) 3121 # Must skip GNU tar: if it does not support --format= it doesn't create 3122 # ustar tarball either. 3123 (tar --version) >/dev/null 2>&1 && continue 3124 am__tar='tar chf - "$$tardir"' 3125 am__tar_='tar chf - "$tardir"' 3126 am__untar='tar xf -' 3127 ;; 3128 pax) 3129 am__tar='pax -L -x $1 -w "$$tardir"' 3130 am__tar_='pax -L -x $1 -w "$tardir"' 3131 am__untar='pax -r' 3132 ;; 3133 cpio) 3134 am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 3135 am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 3136 am__untar='cpio -i -H $1 -d' 3137 ;; 3138 none) 3139 am__tar=false 3140 am__tar_=false 3141 am__untar=false 3142 ;; 3143 esac 3144 3145 # If the value was cached, stop now. We just wanted to have am__tar 3146 # and am__untar set. 3147 test -n "${am_cv_prog_tar_$1}" && break 3148 3149 # tar/untar a dummy directory, and stop if the command works. 3150 rm -rf conftest.dir 3151 mkdir conftest.dir 3152 echo GrepMe > conftest.dir/file 3153 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 3154 rm -rf conftest.dir 3155 if test -s conftest.tar; then 3156 AM_RUN_LOG([$am__untar <conftest.tar]) 3157 AM_RUN_LOG([cat conftest.dir/file]) 3158 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 3159 fi 3160 done 3161 rm -rf conftest.dir 3162 3163 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 3164 AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 3165 3166AC_SUBST([am__tar]) 3167AC_SUBST([am__untar]) 3168]) # _AM_PROG_TAR 3169 3170m4_include([m4/curses.m4]) 3171m4_include([m4/gpg-error.m4]) 3172m4_include([m4/iconv.m4]) 3173m4_include([m4/libassuan.m4]) 3174m4_include([m4/pkg.m4]) 3175m4_include([m4/qt.m4]) 3176m4_include([acinclude.m4]) 3177