| 1 |
# generated automatically by aclocal 1.18.1 -*- Autoconf -*- |
| 2 |
|
| 3 |
# Copyright (C) 1996-2025 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
# This file is free software; the Free Software Foundation |
| 6 |
# gives unlimited permission to copy and/or distribute it, |
| 7 |
# with or without modifications, as long as this notice is preserved. |
| 8 |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
| 11 |
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
| 12 |
# PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) |
| 15 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 16 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 17 |
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.73],, |
| 18 |
[m4_warning([this file was generated for autoconf 2.73. |
| 19 |
You have another version of autoconf. It may work, but is not guaranteed to. |
| 20 |
If you have problems, you may need to regenerate the build system entirely. |
| 21 |
To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
| 22 |
|
| 23 |
# =========================================================================== |
| 24 |
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html |
| 25 |
# =========================================================================== |
| 26 |
# |
| 27 |
# SYNOPSIS |
| 28 |
# |
| 29 |
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) |
| 30 |
# |
| 31 |
# DESCRIPTION |
| 32 |
# |
| 33 |
# This macro figures out how to build C programs using POSIX threads. It |
| 34 |
# sets the PTHREAD_LIBS output variable to the threads library and linker |
| 35 |
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler |
| 36 |
# flags that are needed. (The user can also force certain compiler |
| 37 |
# flags/libs to be tested by setting these environment variables.) |
| 38 |
# |
| 39 |
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is |
| 40 |
# needed for multi-threaded programs (defaults to the value of CC |
| 41 |
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the |
| 42 |
# special cc_r/CC_r compiler alias.) |
| 43 |
# |
| 44 |
# NOTE: You are assumed to not only compile your program with these flags, |
| 45 |
# but also to link with them as well. For example, you might link with |
| 46 |
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS |
| 47 |
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS |
| 48 |
# |
| 49 |
# If you are only building threaded programs, you may wish to use these |
| 50 |
# variables in your default LIBS, CFLAGS, and CC: |
| 51 |
# |
| 52 |
# LIBS="$PTHREAD_LIBS $LIBS" |
| 53 |
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
| 54 |
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" |
| 55 |
# CC="$PTHREAD_CC" |
| 56 |
# CXX="$PTHREAD_CXX" |
| 57 |
# |
| 58 |
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant |
| 59 |
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to |
| 60 |
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). |
| 61 |
# |
| 62 |
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the |
| 63 |
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with |
| 64 |
# PTHREAD_CFLAGS. |
| 65 |
# |
| 66 |
# ACTION-IF-FOUND is a list of shell commands to run if a threads library |
| 67 |
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it |
| 68 |
# is not found. If ACTION-IF-FOUND is not specified, the default action |
| 69 |
# will define HAVE_PTHREAD. |
| 70 |
# |
| 71 |
# Please let the authors know if this macro fails on any platform, or if |
| 72 |
# you have any other suggestions or comments. This macro was based on work |
| 73 |
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help |
| 74 |
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by |
| 75 |
# Alejandro Forero Cuervo to the autoconf macro repository. We are also |
| 76 |
# grateful for the helpful feedback of numerous users. |
| 77 |
# |
| 78 |
# Updated for Autoconf 2.68 by Daniel Richard G. |
| 79 |
# |
| 80 |
# LICENSE |
| 81 |
# |
| 82 |
# Copyright (c) 2008 Steven G. Johnson <[email protected]> |
| 83 |
# Copyright (c) 2011 Daniel Richard G. <[email protected]> |
| 84 |
# Copyright (c) 2019 Marc Stevens <[email protected]> |
| 85 |
# |
| 86 |
# This program is free software: you can redistribute it and/or modify it |
| 87 |
# under the terms of the GNU General Public License as published by the |
| 88 |
# Free Software Foundation, either version 3 of the License, or (at your |
| 89 |
# option) any later version. |
| 90 |
# |
| 91 |
# This program is distributed in the hope that it will be useful, but |
| 92 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 93 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
| 94 |
# Public License for more details. |
| 95 |
# |
| 96 |
# You should have received a copy of the GNU General Public License along |
| 97 |
# with this program. If not, see <https://www.gnu.org/licenses/>. |
| 98 |
# |
| 99 |
# As a special exception, the respective Autoconf Macro's copyright owner |
| 100 |
# gives unlimited permission to copy, distribute and modify the configure |
| 101 |
# scripts that are the output of Autoconf when processing the Macro. You |
| 102 |
# need not follow the terms of the GNU General Public License when using |
| 103 |
# or distributing such scripts, even though portions of the text of the |
| 104 |
# Macro appear in them. The GNU General Public License (GPL) does govern |
| 105 |
# all other use of the material that constitutes the Autoconf Macro. |
| 106 |
# |
| 107 |
# This special exception to the GPL applies to versions of the Autoconf |
| 108 |
# Macro released by the Autoconf Archive. When you make and distribute a |
| 109 |
# modified version of the Autoconf Macro, you may extend this special |
| 110 |
# exception to the GPL to apply to your modified version as well. |
| 111 |
|
| 112 |
#serial 31 |
| 113 |
|
| 114 |
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) |
| 115 |
AC_DEFUN([AX_PTHREAD], [ |
| 116 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 117 |
AC_REQUIRE([AC_PROG_CC]) |
| 118 |
AC_REQUIRE([AC_PROG_SED]) |
| 119 |
AC_LANG_PUSH([C]) |
| 120 |
ax_pthread_ok=no |
| 121 |
|
| 122 |
# We used to check for pthread.h first, but this fails if pthread.h |
| 123 |
# requires special compiler flags (e.g. on Tru64 or Sequent). |
| 124 |
# It gets checked for in the link test anyway. |
| 125 |
|
| 126 |
# First of all, check if the user has set any of the PTHREAD_LIBS, |
| 127 |
# etcetera environment variables, and if threads linking works using |
| 128 |
# them: |
| 129 |
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then |
| 130 |
ax_pthread_save_CC="$CC" |
| 131 |
ax_pthread_save_CFLAGS="$CFLAGS" |
| 132 |
ax_pthread_save_LIBS="$LIBS" |
| 133 |
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) |
| 134 |
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) |
| 135 |
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
| 136 |
LIBS="$PTHREAD_LIBS $LIBS" |
| 137 |
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) |
| 138 |
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) |
| 139 |
AC_MSG_RESULT([$ax_pthread_ok]) |
| 140 |
if test "x$ax_pthread_ok" = "xno"; then |
| 141 |
PTHREAD_LIBS="" |
| 142 |
PTHREAD_CFLAGS="" |
| 143 |
fi |
| 144 |
CC="$ax_pthread_save_CC" |
| 145 |
CFLAGS="$ax_pthread_save_CFLAGS" |
| 146 |
LIBS="$ax_pthread_save_LIBS" |
| 147 |
fi |
| 148 |
|
| 149 |
# We must check for the threads library under a number of different |
| 150 |
# names; the ordering is very important because some systems |
| 151 |
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the |
| 152 |
# libraries is broken (non-POSIX). |
| 153 |
|
| 154 |
# Create a list of thread flags to try. Items with a "," contain both |
| 155 |
# C compiler flags (before ",") and linker flags (after ","). Other items |
| 156 |
# starting with a "-" are C compiler flags, and remaining items are |
| 157 |
# library names, except for "none" which indicates that we try without |
| 158 |
# any flags at all, and "pthread-config" which is a program returning |
| 159 |
# the flags for the Pth emulation library. |
| 160 |
|
| 161 |
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" |
| 162 |
|
| 163 |
# The ordering *is* (sometimes) important. Some notes on the |
| 164 |
# individual items follow: |
| 165 |
|
| 166 |
# pthreads: AIX (must check this before -lpthread) |
| 167 |
# none: in case threads are in libc; should be tried before -Kthread and |
| 168 |
# other compiler flags to prevent continual compiler warnings |
| 169 |
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) |
| 170 |
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 |
| 171 |
# (Note: HP C rejects this with "bad form for `-t' option") |
| 172 |
# -pthreads: Solaris/gcc (Note: HP C also rejects) |
| 173 |
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it |
| 174 |
# doesn't hurt to check since this sometimes defines pthreads and |
| 175 |
# -D_REENTRANT too), HP C (must be checked before -lpthread, which |
| 176 |
# is present but should not be used directly; and before -mthreads, |
| 177 |
# because the compiler interprets this as "-mt" + "-hreads") |
| 178 |
# -mthreads: Mingw32/gcc, Lynx/gcc |
| 179 |
# pthread: Linux, etcetera |
| 180 |
# --thread-safe: KAI C++ |
| 181 |
# pthread-config: use pthread-config program (for GNU Pth library) |
| 182 |
|
| 183 |
case $host_os in |
| 184 |
|
| 185 |
freebsd*) |
| 186 |
|
| 187 |
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) |
| 188 |
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) |
| 189 |
|
| 190 |
ax_pthread_flags="-kthread lthread $ax_pthread_flags" |
| 191 |
;; |
| 192 |
|
| 193 |
hpux*) |
| 194 |
|
| 195 |
# From the cc(1) man page: "[-mt] Sets various -D flags to enable |
| 196 |
# multi-threading and also sets -lpthread." |
| 197 |
|
| 198 |
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" |
| 199 |
;; |
| 200 |
|
| 201 |
openedition*) |
| 202 |
|
| 203 |
# IBM z/OS requires a feature-test macro to be defined in order to |
| 204 |
# enable POSIX threads at all, so give the user a hint if this is |
| 205 |
# not set. (We don't define these ourselves, as they can affect |
| 206 |
# other portions of the system API in unpredictable ways.) |
| 207 |
|
| 208 |
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], |
| 209 |
[ |
| 210 |
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) |
| 211 |
AX_PTHREAD_ZOS_MISSING |
| 212 |
# endif |
| 213 |
], |
| 214 |
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) |
| 215 |
;; |
| 216 |
|
| 217 |
solaris*) |
| 218 |
|
| 219 |
# On Solaris (at least, for some versions), libc contains stubbed |
| 220 |
# (non-functional) versions of the pthreads routines, so link-based |
| 221 |
# tests will erroneously succeed. (N.B.: The stubs are missing |
| 222 |
# pthread_cleanup_push, or rather a function called by this macro, |
| 223 |
# so we could check for that, but who knows whether they'll stub |
| 224 |
# that too in a future libc.) So we'll check first for the |
| 225 |
# standard Solaris way of linking pthreads (-mt -lpthread). |
| 226 |
|
| 227 |
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" |
| 228 |
;; |
| 229 |
esac |
| 230 |
|
| 231 |
# Are we compiling with Clang? |
| 232 |
|
| 233 |
AC_CACHE_CHECK([whether $CC is Clang], |
| 234 |
[ax_cv_PTHREAD_CLANG], |
| 235 |
[ax_cv_PTHREAD_CLANG=no |
| 236 |
# Note that Autoconf sets GCC=yes for Clang as well as GCC |
| 237 |
if test "x$GCC" = "xyes"; then |
| 238 |
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], |
| 239 |
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ |
| 240 |
# if defined(__clang__) && defined(__llvm__) |
| 241 |
AX_PTHREAD_CC_IS_CLANG |
| 242 |
# endif |
| 243 |
], |
| 244 |
[ax_cv_PTHREAD_CLANG=yes]) |
| 245 |
fi |
| 246 |
]) |
| 247 |
ax_pthread_clang="$ax_cv_PTHREAD_CLANG" |
| 248 |
|
| 249 |
|
| 250 |
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) |
| 251 |
|
| 252 |
# Note that for GCC and Clang -pthread generally implies -lpthread, |
| 253 |
# except when -nostdlib is passed. |
| 254 |
# This is problematic using libtool to build C++ shared libraries with pthread: |
| 255 |
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 |
| 256 |
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 |
| 257 |
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 |
| 258 |
# To solve this, first try -pthread together with -lpthread for GCC |
| 259 |
|
| 260 |
AS_IF([test "x$GCC" = "xyes"], |
| 261 |
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) |
| 262 |
|
| 263 |
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first |
| 264 |
|
| 265 |
AS_IF([test "x$ax_pthread_clang" = "xyes"], |
| 266 |
[ax_pthread_flags="-pthread,-lpthread -pthread"]) |
| 267 |
|
| 268 |
|
| 269 |
# The presence of a feature test macro requesting re-entrant function |
| 270 |
# definitions is, on some systems, a strong hint that pthreads support is |
| 271 |
# correctly enabled |
| 272 |
|
| 273 |
case $host_os in |
| 274 |
darwin* | hpux* | linux* | osf* | solaris*) |
| 275 |
ax_pthread_check_macro="_REENTRANT" |
| 276 |
;; |
| 277 |
|
| 278 |
aix*) |
| 279 |
ax_pthread_check_macro="_THREAD_SAFE" |
| 280 |
;; |
| 281 |
|
| 282 |
*) |
| 283 |
ax_pthread_check_macro="--" |
| 284 |
;; |
| 285 |
esac |
| 286 |
AS_IF([test "x$ax_pthread_check_macro" = "x--"], |
| 287 |
[ax_pthread_check_cond=0], |
| 288 |
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) |
| 289 |
|
| 290 |
|
| 291 |
if test "x$ax_pthread_ok" = "xno"; then |
| 292 |
for ax_pthread_try_flag in $ax_pthread_flags; do |
| 293 |
|
| 294 |
case $ax_pthread_try_flag in |
| 295 |
none) |
| 296 |
AC_MSG_CHECKING([whether pthreads work without any flags]) |
| 297 |
;; |
| 298 |
|
| 299 |
*,*) |
| 300 |
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` |
| 301 |
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` |
| 302 |
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) |
| 303 |
;; |
| 304 |
|
| 305 |
-*) |
| 306 |
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) |
| 307 |
PTHREAD_CFLAGS="$ax_pthread_try_flag" |
| 308 |
;; |
| 309 |
|
| 310 |
pthread-config) |
| 311 |
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) |
| 312 |
AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) |
| 313 |
PTHREAD_CFLAGS="`pthread-config --cflags`" |
| 314 |
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" |
| 315 |
;; |
| 316 |
|
| 317 |
*) |
| 318 |
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) |
| 319 |
PTHREAD_LIBS="-l$ax_pthread_try_flag" |
| 320 |
;; |
| 321 |
esac |
| 322 |
|
| 323 |
ax_pthread_save_CFLAGS="$CFLAGS" |
| 324 |
ax_pthread_save_LIBS="$LIBS" |
| 325 |
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
| 326 |
LIBS="$PTHREAD_LIBS $LIBS" |
| 327 |
|
| 328 |
# Check for various functions. We must include pthread.h, |
| 329 |
# since some functions may be macros. (On the Sequent, we |
| 330 |
# need a special flag -Kthread to make this header compile.) |
| 331 |
# We check for pthread_join because it is in -lpthread on IRIX |
| 332 |
# while pthread_create is in libc. We check for pthread_attr_init |
| 333 |
# due to DEC craziness with -lpthreads. We check for |
| 334 |
# pthread_cleanup_push because it is one of the few pthread |
| 335 |
# functions on Solaris that doesn't have a non-functional libc stub. |
| 336 |
# We try pthread_create on general principles. |
| 337 |
|
| 338 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> |
| 339 |
# if $ax_pthread_check_cond |
| 340 |
# error "$ax_pthread_check_macro must be defined" |
| 341 |
# endif |
| 342 |
static void *some_global = NULL; |
| 343 |
static void routine(void *a) |
| 344 |
{ |
| 345 |
/* To avoid any unused-parameter or |
| 346 |
unused-but-set-parameter warning. */ |
| 347 |
some_global = a; |
| 348 |
} |
| 349 |
static void *start_routine(void *a) { return a; }], |
| 350 |
[pthread_t th; pthread_attr_t attr; |
| 351 |
pthread_create(&th, 0, start_routine, 0); |
| 352 |
pthread_join(th, 0); |
| 353 |
pthread_attr_init(&attr); |
| 354 |
pthread_cleanup_push(routine, 0); |
| 355 |
pthread_cleanup_pop(0) /* ; */])], |
| 356 |
[ax_pthread_ok=yes], |
| 357 |
[]) |
| 358 |
|
| 359 |
CFLAGS="$ax_pthread_save_CFLAGS" |
| 360 |
LIBS="$ax_pthread_save_LIBS" |
| 361 |
|
| 362 |
AC_MSG_RESULT([$ax_pthread_ok]) |
| 363 |
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) |
| 364 |
|
| 365 |
PTHREAD_LIBS="" |
| 366 |
PTHREAD_CFLAGS="" |
| 367 |
done |
| 368 |
fi |
| 369 |
|
| 370 |
|
| 371 |
# Clang needs special handling, because older versions handle the -pthread |
| 372 |
# option in a rather... idiosyncratic way |
| 373 |
|
| 374 |
if test "x$ax_pthread_clang" = "xyes"; then |
| 375 |
|
| 376 |
# Clang takes -pthread; it has never supported any other flag |
| 377 |
|
| 378 |
# (Note 1: This will need to be revisited if a system that Clang |
| 379 |
# supports has POSIX threads in a separate library. This tends not |
| 380 |
# to be the way of modern systems, but it's conceivable.) |
| 381 |
|
| 382 |
# (Note 2: On some systems, notably Darwin, -pthread is not needed |
| 383 |
# to get POSIX threads support; the API is always present and |
| 384 |
# active. We could reasonably leave PTHREAD_CFLAGS empty. But |
| 385 |
# -pthread does define _REENTRANT, and while the Darwin headers |
| 386 |
# ignore this macro, third-party headers might not.) |
| 387 |
|
| 388 |
# However, older versions of Clang make a point of warning the user |
| 389 |
# that, in an invocation where only linking and no compilation is |
| 390 |
# taking place, the -pthread option has no effect ("argument unused |
| 391 |
# during compilation"). They expect -pthread to be passed in only |
| 392 |
# when source code is being compiled. |
| 393 |
# |
| 394 |
# Problem is, this is at odds with the way Automake and most other |
| 395 |
# C build frameworks function, which is that the same flags used in |
| 396 |
# compilation (CFLAGS) are also used in linking. Many systems |
| 397 |
# supported by AX_PTHREAD require exactly this for POSIX threads |
| 398 |
# support, and in fact it is often not straightforward to specify a |
| 399 |
# flag that is used only in the compilation phase and not in |
| 400 |
# linking. Such a scenario is extremely rare in practice. |
| 401 |
# |
| 402 |
# Even though use of the -pthread flag in linking would only print |
| 403 |
# a warning, this can be a nuisance for well-run software projects |
| 404 |
# that build with -Werror. So if the active version of Clang has |
| 405 |
# this misfeature, we search for an option to squash it. |
| 406 |
|
| 407 |
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], |
| 408 |
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], |
| 409 |
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown |
| 410 |
# Create an alternate version of $ac_link that compiles and |
| 411 |
# links in two steps (.c -> .o, .o -> exe) instead of one |
| 412 |
# (.c -> exe), because the warning occurs only in the second |
| 413 |
# step |
| 414 |
ax_pthread_save_ac_link="$ac_link" |
| 415 |
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' |
| 416 |
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` |
| 417 |
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" |
| 418 |
ax_pthread_save_CFLAGS="$CFLAGS" |
| 419 |
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do |
| 420 |
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) |
| 421 |
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" |
| 422 |
ac_link="$ax_pthread_save_ac_link" |
| 423 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], |
| 424 |
[ac_link="$ax_pthread_2step_ac_link" |
| 425 |
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], |
| 426 |
[break]) |
| 427 |
]) |
| 428 |
done |
| 429 |
ac_link="$ax_pthread_save_ac_link" |
| 430 |
CFLAGS="$ax_pthread_save_CFLAGS" |
| 431 |
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) |
| 432 |
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" |
| 433 |
]) |
| 434 |
|
| 435 |
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in |
| 436 |
no | unknown) ;; |
| 437 |
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; |
| 438 |
esac |
| 439 |
|
| 440 |
fi # $ax_pthread_clang = yes |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
# Various other checks: |
| 445 |
if test "x$ax_pthread_ok" = "xyes"; then |
| 446 |
ax_pthread_save_CFLAGS="$CFLAGS" |
| 447 |
ax_pthread_save_LIBS="$LIBS" |
| 448 |
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
| 449 |
LIBS="$PTHREAD_LIBS $LIBS" |
| 450 |
|
| 451 |
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED. |
| 452 |
AC_CACHE_CHECK([for joinable pthread attribute], |
| 453 |
[ax_cv_PTHREAD_JOINABLE_ATTR], |
| 454 |
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown |
| 455 |
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do |
| 456 |
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], |
| 457 |
[int attr = $ax_pthread_attr; return attr /* ; */])], |
| 458 |
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], |
| 459 |
[]) |
| 460 |
done |
| 461 |
]) |
| 462 |
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ |
| 463 |
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ |
| 464 |
test "x$ax_pthread_joinable_attr_defined" != "xyes"], |
| 465 |
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], |
| 466 |
[$ax_cv_PTHREAD_JOINABLE_ATTR], |
| 467 |
[Define to necessary symbol if this constant |
| 468 |
uses a non-standard name on your system.]) |
| 469 |
ax_pthread_joinable_attr_defined=yes |
| 470 |
]) |
| 471 |
|
| 472 |
AC_CACHE_CHECK([whether more special flags are required for pthreads], |
| 473 |
[ax_cv_PTHREAD_SPECIAL_FLAGS], |
| 474 |
[ax_cv_PTHREAD_SPECIAL_FLAGS=no |
| 475 |
case $host_os in |
| 476 |
solaris*) |
| 477 |
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" |
| 478 |
;; |
| 479 |
esac |
| 480 |
]) |
| 481 |
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ |
| 482 |
test "x$ax_pthread_special_flags_added" != "xyes"], |
| 483 |
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" |
| 484 |
ax_pthread_special_flags_added=yes]) |
| 485 |
|
| 486 |
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], |
| 487 |
[ax_cv_PTHREAD_PRIO_INHERIT], |
| 488 |
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], |
| 489 |
[[int i = PTHREAD_PRIO_INHERIT; |
| 490 |
return i;]])], |
| 491 |
[ax_cv_PTHREAD_PRIO_INHERIT=yes], |
| 492 |
[ax_cv_PTHREAD_PRIO_INHERIT=no]) |
| 493 |
]) |
| 494 |
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ |
| 495 |
test "x$ax_pthread_prio_inherit_defined" != "xyes"], |
| 496 |
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) |
| 497 |
ax_pthread_prio_inherit_defined=yes |
| 498 |
]) |
| 499 |
|
| 500 |
CFLAGS="$ax_pthread_save_CFLAGS" |
| 501 |
LIBS="$ax_pthread_save_LIBS" |
| 502 |
|
| 503 |
# More AIX lossage: compile with *_r variant |
| 504 |
if test "x$GCC" != "xyes"; then |
| 505 |
case $host_os in |
| 506 |
aix*) |
| 507 |
AS_CASE(["x/$CC"], |
| 508 |
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], |
| 509 |
[#handle absolute path differently from PATH based program lookup |
| 510 |
AS_CASE(["x$CC"], |
| 511 |
[x/*], |
| 512 |
[ |
| 513 |
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) |
| 514 |
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) |
| 515 |
], |
| 516 |
[ |
| 517 |
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) |
| 518 |
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) |
| 519 |
] |
| 520 |
) |
| 521 |
]) |
| 522 |
;; |
| 523 |
esac |
| 524 |
fi |
| 525 |
fi |
| 526 |
|
| 527 |
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" |
| 528 |
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" |
| 529 |
|
| 530 |
AC_SUBST([PTHREAD_LIBS]) |
| 531 |
AC_SUBST([PTHREAD_CFLAGS]) |
| 532 |
AC_SUBST([PTHREAD_CC]) |
| 533 |
AC_SUBST([PTHREAD_CXX]) |
| 534 |
|
| 535 |
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: |
| 536 |
if test "x$ax_pthread_ok" = "xyes"; then |
| 537 |
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) |
| 538 |
: |
| 539 |
else |
| 540 |
ax_pthread_ok=no |
| 541 |
$2 |
| 542 |
fi |
| 543 |
AC_LANG_POP |
| 544 |
])dnl AX_PTHREAD |
| 545 |
|
| 546 |
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- |
| 547 |
# serial 13 (pkgconf) |
| 548 |
|
| 549 |
dnl Copyright © 2004 Scott James Remnant <[email protected]>. |
| 550 |
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]> |
| 551 |
dnl |
| 552 |
dnl This program is free software; you can redistribute it and/or modify |
| 553 |
dnl it under the terms of the GNU General Public License as published by |
| 554 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 555 |
dnl (at your option) any later version. |
| 556 |
dnl |
| 557 |
dnl This program is distributed in the hope that it will be useful, but |
| 558 |
dnl WITHOUT ANY WARRANTY; without even the implied warranty of |
| 559 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 560 |
dnl General Public License for more details. |
| 561 |
dnl |
| 562 |
dnl You should have received a copy of the GNU General Public License |
| 563 |
dnl along with this program; if not, see <https://www.gnu.org/licenses/>. |
| 564 |
dnl |
| 565 |
dnl As a special exception to the GNU General Public License, if you |
| 566 |
dnl distribute this file as part of a program that contains a |
| 567 |
dnl configuration script generated by Autoconf, you may include it under |
| 568 |
dnl the same distribution terms that you use for the rest of that |
| 569 |
dnl program. |
| 570 |
|
| 571 |
dnl PKG_PREREQ(MIN-VERSION) |
| 572 |
dnl ----------------------- |
| 573 |
dnl Since: 0.29 |
| 574 |
dnl |
| 575 |
dnl Verify that the version of the pkg-config macros are at least |
| 576 |
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's |
| 577 |
dnl installed version of pkg-config, this checks the developer's version |
| 578 |
dnl of pkg.m4 when generating configure. |
| 579 |
dnl |
| 580 |
dnl To ensure that this macro is defined, also add: |
| 581 |
dnl m4_ifndef([PKG_PREREQ], |
| 582 |
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) |
| 583 |
dnl |
| 584 |
dnl See the "Since" comment for each macro you use to see what version |
| 585 |
dnl of the macros you require. |
| 586 |
m4_defun([PKG_PREREQ], |
| 587 |
[m4_define([PKG_MACROS_VERSION], [0.29.2]) |
| 588 |
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, |
| 589 |
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) |
| 590 |
])dnl PKG_PREREQ |
| 591 |
|
| 592 |
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND]) |
| 593 |
dnl --------------------------------------------------------- |
| 594 |
dnl Since: 0.16 |
| 595 |
dnl |
| 596 |
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to |
| 597 |
dnl first found in the path. Checks that the version of pkg-config found |
| 598 |
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is |
| 599 |
dnl used since that's the first version where most current features of |
| 600 |
dnl pkg-config existed. |
| 601 |
dnl |
| 602 |
dnl If pkg-config is not found or older than specified, it will result |
| 603 |
dnl in an empty PKG_CONFIG variable. To avoid widespread issues with |
| 604 |
dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting. |
| 605 |
dnl You can specify [PKG_CONFIG=false] as an action instead, which would |
| 606 |
dnl result in pkg-config tests failing, but no bogus error messages. |
| 607 |
AC_DEFUN([PKG_PROG_PKG_CONFIG], |
| 608 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
| 609 |
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) |
| 610 |
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) |
| 611 |
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
| 612 |
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) |
| 613 |
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) |
| 614 |
|
| 615 |
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
| 616 |
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
| 617 |
fi |
| 618 |
if test -n "$PKG_CONFIG"; then |
| 619 |
_pkg_min_version=m4_default([$1], [0.9.0]) |
| 620 |
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
| 621 |
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
| 622 |
AC_MSG_RESULT([yes]) |
| 623 |
else |
| 624 |
AC_MSG_RESULT([no]) |
| 625 |
PKG_CONFIG="" |
| 626 |
fi |
| 627 |
fi |
| 628 |
if test -z "$PKG_CONFIG"; then |
| 629 |
m4_default([$2], [AC_MSG_ERROR([pkg-config not found])]) |
| 630 |
fi[]dnl |
| 631 |
])dnl PKG_PROG_PKG_CONFIG |
| 632 |
|
| 633 |
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 634 |
dnl ------------------------------------------------------------------- |
| 635 |
dnl Since: 0.18 |
| 636 |
dnl |
| 637 |
dnl Check to see whether a particular set of modules exists. Similar to |
| 638 |
dnl PKG_CHECK_MODULES(), but does not set variables or print errors. |
| 639 |
dnl |
| 640 |
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 641 |
dnl only at the first occurrence in configure.ac, so if the first place |
| 642 |
dnl it's called might be skipped (such as if it is within an "if", you |
| 643 |
dnl have to call PKG_CHECK_EXISTS manually |
| 644 |
AC_DEFUN([PKG_CHECK_EXISTS], |
| 645 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 646 |
if test -n "$PKG_CONFIG" && \ |
| 647 |
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
| 648 |
m4_default([$2], [:]) |
| 649 |
m4_ifvaln([$3], [else |
| 650 |
$3])dnl |
| 651 |
fi]) |
| 652 |
|
| 653 |
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
| 654 |
dnl --------------------------------------------- |
| 655 |
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting |
| 656 |
dnl pkg_failed based on the result. |
| 657 |
m4_define([_PKG_CONFIG], |
| 658 |
[if test -n "$$1"; then |
| 659 |
pkg_cv_[]$1="$$1" |
| 660 |
elif test -n "$PKG_CONFIG"; then |
| 661 |
PKG_CHECK_EXISTS([$3], |
| 662 |
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` |
| 663 |
test "x$?" != "x0" && pkg_failed=yes ], |
| 664 |
[pkg_failed=yes]) |
| 665 |
else |
| 666 |
pkg_failed=untried |
| 667 |
fi[]dnl |
| 668 |
])dnl _PKG_CONFIG |
| 669 |
|
| 670 |
dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 671 |
dnl --------------------------- |
| 672 |
dnl Internal check to see if pkg-config supports short errors. |
| 673 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
| 674 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 675 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
| 676 |
_pkg_short_errors_supported=yes |
| 677 |
else |
| 678 |
_pkg_short_errors_supported=no |
| 679 |
fi[]dnl |
| 680 |
])dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 681 |
|
| 682 |
|
| 683 |
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 684 |
dnl [ACTION-IF-NOT-FOUND]) |
| 685 |
dnl -------------------------------------------------------------- |
| 686 |
dnl Since: 0.4.0 |
| 687 |
dnl |
| 688 |
dnl Note that if there is a possibility the first call to |
| 689 |
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an |
| 690 |
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
| 691 |
AC_DEFUN([PKG_CHECK_MODULES], |
| 692 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 693 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
| 694 |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
| 695 |
|
| 696 |
pkg_failed=no |
| 697 |
AC_MSG_CHECKING([for $2]) |
| 698 |
|
| 699 |
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
| 700 |
_PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
| 701 |
|
| 702 |
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
| 703 |
and $1[]_LIBS to avoid the need to call pkg-config. |
| 704 |
See the pkg-config man page for more details.]) |
| 705 |
|
| 706 |
if test $pkg_failed = yes; then |
| 707 |
AC_MSG_RESULT([no]) |
| 708 |
_PKG_SHORT_ERRORS_SUPPORTED |
| 709 |
if test $_pkg_short_errors_supported = yes; then |
| 710 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` |
| 711 |
else |
| 712 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` |
| 713 |
fi |
| 714 |
# Put the nasty error message in config.log where it belongs |
| 715 |
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
| 716 |
|
| 717 |
m4_default([$4], [AC_MSG_ERROR( |
| 718 |
[Package requirements ($2) were not met: |
| 719 |
|
| 720 |
$$1_PKG_ERRORS |
| 721 |
|
| 722 |
Consider adjusting the PKG_CONFIG_PATH environment variable if you |
| 723 |
installed software in a non-standard prefix. |
| 724 |
|
| 725 |
_PKG_TEXT])[]dnl |
| 726 |
]) |
| 727 |
elif test $pkg_failed = untried; then |
| 728 |
AC_MSG_RESULT([no]) |
| 729 |
m4_default([$4], [AC_MSG_FAILURE( |
| 730 |
[The pkg-config script could not be found or is too old. Make sure it |
| 731 |
is in your PATH or set the PKG_CONFIG environment variable to the full |
| 732 |
path to pkg-config. |
| 733 |
|
| 734 |
_PKG_TEXT |
| 735 |
|
| 736 |
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl |
| 737 |
]) |
| 738 |
else |
| 739 |
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
| 740 |
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
| 741 |
AC_MSG_RESULT([yes]) |
| 742 |
$3 |
| 743 |
fi[]dnl |
| 744 |
])dnl PKG_CHECK_MODULES |
| 745 |
|
| 746 |
|
| 747 |
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 748 |
dnl [ACTION-IF-NOT-FOUND]) |
| 749 |
dnl --------------------------------------------------------------------- |
| 750 |
dnl Since: 0.29 |
| 751 |
dnl |
| 752 |
dnl Checks for existence of MODULES and gathers its build flags with |
| 753 |
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags |
| 754 |
dnl and VARIABLE-PREFIX_LIBS from --libs. |
| 755 |
dnl |
| 756 |
dnl Note that if there is a possibility the first call to |
| 757 |
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to |
| 758 |
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your |
| 759 |
dnl configure.ac. |
| 760 |
AC_DEFUN([PKG_CHECK_MODULES_STATIC], |
| 761 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 762 |
_save_PKG_CONFIG=$PKG_CONFIG |
| 763 |
PKG_CONFIG="$PKG_CONFIG --static" |
| 764 |
PKG_CHECK_MODULES($@) |
| 765 |
PKG_CONFIG=$_save_PKG_CONFIG[]dnl |
| 766 |
])dnl PKG_CHECK_MODULES_STATIC |
| 767 |
|
| 768 |
|
| 769 |
dnl PKG_INSTALLDIR([DIRECTORY]) |
| 770 |
dnl ------------------------- |
| 771 |
dnl Since: 0.27 |
| 772 |
dnl |
| 773 |
dnl Substitutes the variable pkgconfigdir as the location where a module |
| 774 |
dnl should install pkg-config .pc files. By default the directory is |
| 775 |
dnl $libdir/pkgconfig, but the default can be changed by passing |
| 776 |
dnl DIRECTORY. The user can override through the --with-pkgconfigdir |
| 777 |
dnl parameter. |
| 778 |
AC_DEFUN([PKG_INSTALLDIR], |
| 779 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) |
| 780 |
m4_pushdef([pkg_description], |
| 781 |
[pkg-config installation directory @<:@]pkg_default[@:>@]) |
| 782 |
AC_ARG_WITH([pkgconfigdir], |
| 783 |
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, |
| 784 |
[with_pkgconfigdir=]pkg_default) |
| 785 |
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) |
| 786 |
m4_popdef([pkg_default]) |
| 787 |
m4_popdef([pkg_description]) |
| 788 |
])dnl PKG_INSTALLDIR |
| 789 |
|
| 790 |
|
| 791 |
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) |
| 792 |
dnl -------------------------------- |
| 793 |
dnl Since: 0.27 |
| 794 |
dnl |
| 795 |
dnl Substitutes the variable noarch_pkgconfigdir as the location where a |
| 796 |
dnl module should install arch-independent pkg-config .pc files. By |
| 797 |
dnl default the directory is $datadir/pkgconfig, but the default can be |
| 798 |
dnl changed by passing DIRECTORY. The user can override through the |
| 799 |
dnl --with-noarch-pkgconfigdir parameter. |
| 800 |
AC_DEFUN([PKG_NOARCH_INSTALLDIR], |
| 801 |
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) |
| 802 |
m4_pushdef([pkg_description], |
| 803 |
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) |
| 804 |
AC_ARG_WITH([noarch-pkgconfigdir], |
| 805 |
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, |
| 806 |
[with_noarch_pkgconfigdir=]pkg_default) |
| 807 |
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) |
| 808 |
m4_popdef([pkg_default]) |
| 809 |
m4_popdef([pkg_description]) |
| 810 |
])dnl PKG_NOARCH_INSTALLDIR |
| 811 |
|
| 812 |
|
| 813 |
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, |
| 814 |
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 815 |
dnl ------------------------------------------- |
| 816 |
dnl Since: 0.28 |
| 817 |
dnl |
| 818 |
dnl Retrieves the value of the pkg-config variable for the given module. |
| 819 |
AC_DEFUN([PKG_CHECK_VAR], |
| 820 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
| 821 |
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl |
| 822 |
|
| 823 |
_PKG_CONFIG([$1], [variable="][$3]["], [$2]) |
| 824 |
AS_VAR_COPY([$1], [pkg_cv_][$1]) |
| 825 |
|
| 826 |
AS_VAR_IF([$1], [""], [$5], [$4])dnl |
| 827 |
])dnl PKG_CHECK_VAR |
| 828 |
|
| 829 |
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 830 |
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], |
| 831 |
dnl [DESCRIPTION], [DEFAULT]) |
| 832 |
dnl ------------------------------------------ |
| 833 |
dnl |
| 834 |
dnl Prepare a "--with-" configure option using the lowercase |
| 835 |
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and |
| 836 |
dnl PKG_CHECK_MODULES in a single macro. |
| 837 |
AC_DEFUN([PKG_WITH_MODULES], |
| 838 |
[ |
| 839 |
m4_pushdef([with_arg], m4_tolower([$1])) |
| 840 |
|
| 841 |
m4_pushdef([description], |
| 842 |
[m4_default([$5], [build with ]with_arg[ support])]) |
| 843 |
|
| 844 |
m4_pushdef([def_arg], [m4_default([$6], [auto])]) |
| 845 |
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) |
| 846 |
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) |
| 847 |
|
| 848 |
m4_case(def_arg, |
| 849 |
[yes],[m4_pushdef([with_without], [--without-]with_arg)], |
| 850 |
[m4_pushdef([with_without],[--with-]with_arg)]) |
| 851 |
|
| 852 |
AC_ARG_WITH(with_arg, |
| 853 |
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, |
| 854 |
[AS_TR_SH([with_]with_arg)=def_arg]) |
| 855 |
|
| 856 |
AS_CASE([$AS_TR_SH([with_]with_arg)], |
| 857 |
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], |
| 858 |
[auto],[PKG_CHECK_MODULES([$1],[$2], |
| 859 |
[m4_n([def_action_if_found]) $3], |
| 860 |
[m4_n([def_action_if_not_found]) $4])]) |
| 861 |
|
| 862 |
m4_popdef([with_arg]) |
| 863 |
m4_popdef([description]) |
| 864 |
m4_popdef([def_arg]) |
| 865 |
|
| 866 |
])dnl PKG_WITH_MODULES |
| 867 |
|
| 868 |
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 869 |
dnl [DESCRIPTION], [DEFAULT]) |
| 870 |
dnl ----------------------------------------------- |
| 871 |
dnl |
| 872 |
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES |
| 873 |
dnl check._[VARIABLE-PREFIX] is exported as make variable. |
| 874 |
AC_DEFUN([PKG_HAVE_WITH_MODULES], |
| 875 |
[ |
| 876 |
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) |
| 877 |
|
| 878 |
AM_CONDITIONAL([HAVE_][$1], |
| 879 |
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) |
| 880 |
])dnl PKG_HAVE_WITH_MODULES |
| 881 |
|
| 882 |
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 883 |
dnl [DESCRIPTION], [DEFAULT]) |
| 884 |
dnl ------------------------------------------------------ |
| 885 |
dnl |
| 886 |
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after |
| 887 |
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make |
| 888 |
dnl and preprocessor variable. |
| 889 |
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], |
| 890 |
[ |
| 891 |
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) |
| 892 |
|
| 893 |
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], |
| 894 |
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) |
| 895 |
])dnl PKG_HAVE_DEFINE_WITH_MODULES |
| 896 |
|
| 897 |
# Copyright (C) 2002-2025 Free Software Foundation, Inc. |
| 898 |
# |
| 899 |
# This file is free software; the Free Software Foundation |
| 900 |
# gives unlimited permission to copy and/or distribute it, |
| 901 |
# with or without modifications, as long as this notice is preserved. |
| 902 |
|
| 903 |
# AM_AUTOMAKE_VERSION(VERSION) |
| 904 |
# ---------------------------- |
| 905 |
# Automake X.Y traces this macro to ensure aclocal.m4 has been |
| 906 |
# generated from the m4 files accompanying Automake X.Y. |
| 907 |
# (This private macro should not be called outside this file.) |
| 908 |
AC_DEFUN([AM_AUTOMAKE_VERSION], |
| 909 |
[am__api_version='1.18' |
| 910 |
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
| 911 |
dnl require some minimum version. Point them to the right macro. |
| 912 |
m4_if([$1], [1.18.1], [], |
| 913 |
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
| 914 |
]) |
| 915 |
|
| 916 |
# _AM_AUTOCONF_VERSION(VERSION) |
| 917 |
# ----------------------------- |
| 918 |
# aclocal traces this macro to find the Autoconf version. |
| 919 |
# This is a private macro too. Using m4_define simplifies |
| 920 |
# the logic in aclocal, which can simply ignore this definition. |
| 921 |
m4_define([_AM_AUTOCONF_VERSION], []) |
| 922 |
|
| 923 |
# AM_SET_CURRENT_AUTOMAKE_VERSION |
| 924 |
# ------------------------------- |
| 925 |
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
| 926 |
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
| 927 |
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
| 928 |
[AM_AUTOMAKE_VERSION([1.18.1])dnl |
| 929 |
m4_ifndef([AC_AUTOCONF_VERSION], |
| 930 |
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
| 931 |
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
| 932 |
|
| 933 |
# AM_AUX_DIR_EXPAND -*- Autoconf -*- |
| 934 |
|
| 935 |
# Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 936 |
# |
| 937 |
# This file is free software; the Free Software Foundation |
| 938 |
# gives unlimited permission to copy and/or distribute it, |
| 939 |
# with or without modifications, as long as this notice is preserved. |
| 940 |
|
| 941 |
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets |
| 942 |
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to |
| 943 |
# '$srcdir', '$srcdir/..', or '$srcdir/../..'. |
| 944 |
# |
| 945 |
# Of course, Automake must honor this variable whenever it calls a |
| 946 |
# tool from the auxiliary directory. The problem is that $srcdir (and |
| 947 |
# therefore $ac_aux_dir as well) can be either absolute or relative, |
| 948 |
# depending on how configure is run. This is pretty annoying, since |
| 949 |
# it makes $ac_aux_dir quite unusable in subdirectories: in the top |
| 950 |
# source directory, any form will work fine, but in subdirectories a |
| 951 |
# relative path needs to be adjusted first. |
| 952 |
# |
| 953 |
# $ac_aux_dir/missing |
| 954 |
# fails when called from a subdirectory if $ac_aux_dir is relative |
| 955 |
# $top_srcdir/$ac_aux_dir/missing |
| 956 |
# fails if $ac_aux_dir is absolute, |
| 957 |
# fails when called from a subdirectory in a VPATH build with |
| 958 |
# a relative $ac_aux_dir |
| 959 |
# |
| 960 |
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir |
| 961 |
# are both prefixed by $srcdir. In an in-source build this is usually |
| 962 |
# harmless because $srcdir is '.', but things will broke when you |
| 963 |
# start a VPATH build or use an absolute $srcdir. |
| 964 |
# |
| 965 |
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, |
| 966 |
# iff we strip the leading $srcdir from $ac_aux_dir. That would be: |
| 967 |
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` |
| 968 |
# and then we would define $MISSING as |
| 969 |
# MISSING="\${SHELL} $am_aux_dir/missing" |
| 970 |
# This will work as long as MISSING is not called from configure, because |
| 971 |
# unfortunately $(top_srcdir) has no meaning in configure. |
| 972 |
# However there are other variables, like CC, which are often used in |
| 973 |
# configure, and could therefore not use this "fixed" $ac_aux_dir. |
| 974 |
# |
| 975 |
# Another solution, used here, is to always expand $ac_aux_dir to an |
| 976 |
# absolute PATH. The drawback is that using absolute paths prevent a |
| 977 |
# configured tree to be moved without reconfiguration. |
| 978 |
|
| 979 |
AC_DEFUN([AM_AUX_DIR_EXPAND], |
| 980 |
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl |
| 981 |
# Expand $ac_aux_dir to an absolute path. |
| 982 |
am_aux_dir=`cd "$ac_aux_dir" && pwd` |
| 983 |
]) |
| 984 |
|
| 985 |
# AM_CONDITIONAL -*- Autoconf -*- |
| 986 |
|
| 987 |
# Copyright (C) 1997-2025 Free Software Foundation, Inc. |
| 988 |
# |
| 989 |
# This file is free software; the Free Software Foundation |
| 990 |
# gives unlimited permission to copy and/or distribute it, |
| 991 |
# with or without modifications, as long as this notice is preserved. |
| 992 |
|
| 993 |
# AM_CONDITIONAL(NAME, SHELL-CONDITION) |
| 994 |
# ------------------------------------- |
| 995 |
# Define a conditional. |
| 996 |
AC_DEFUN([AM_CONDITIONAL], |
| 997 |
[AC_PREREQ([2.52])dnl |
| 998 |
m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], |
| 999 |
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl |
| 1000 |
AC_SUBST([$1_TRUE])dnl |
| 1001 |
AC_SUBST([$1_FALSE])dnl |
| 1002 |
_AM_SUBST_NOTMAKE([$1_TRUE])dnl |
| 1003 |
_AM_SUBST_NOTMAKE([$1_FALSE])dnl |
| 1004 |
m4_define([_AM_COND_VALUE_$1], [$2])dnl |
| 1005 |
if $2; then |
| 1006 |
$1_TRUE= |
| 1007 |
$1_FALSE='#' |
| 1008 |
else |
| 1009 |
$1_TRUE='#' |
| 1010 |
$1_FALSE= |
| 1011 |
fi |
| 1012 |
AC_CONFIG_COMMANDS_PRE( |
| 1013 |
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then |
| 1014 |
AC_MSG_ERROR([[conditional "$1" was never defined. |
| 1015 |
Usually this means the macro was only invoked conditionally.]]) |
| 1016 |
fi])]) |
| 1017 |
|
| 1018 |
# Copyright (C) 1999-2025 Free Software Foundation, Inc. |
| 1019 |
# |
| 1020 |
# This file is free software; the Free Software Foundation |
| 1021 |
# gives unlimited permission to copy and/or distribute it, |
| 1022 |
# with or without modifications, as long as this notice is preserved. |
| 1023 |
|
| 1024 |
|
| 1025 |
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be |
| 1026 |
# written in clear, in which case automake, when reading aclocal.m4, |
| 1027 |
# will think it sees a *use*, and therefore will trigger all it's |
| 1028 |
# C support machinery. Also note that it means that autoscan, seeing |
| 1029 |
# CC etc. in the Makefile, will ask for an AC_PROG_CC use... |
| 1030 |
|
| 1031 |
|
| 1032 |
# _AM_DEPENDENCIES(NAME) |
| 1033 |
# ---------------------- |
| 1034 |
# See how the compiler implements dependency checking. |
| 1035 |
# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". |
| 1036 |
# We try a few techniques and use that to set a single cache variable. |
| 1037 |
# |
| 1038 |
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was |
| 1039 |
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular |
| 1040 |
# dependency, and given that the user is not expected to run this macro, |
| 1041 |
# just rely on AC_PROG_CC. |
| 1042 |
AC_DEFUN([_AM_DEPENDENCIES], |
| 1043 |
[AC_REQUIRE([AM_SET_DEPDIR])dnl |
| 1044 |
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl |
| 1045 |
AC_REQUIRE([AM_MAKE_INCLUDE])dnl |
| 1046 |
AC_REQUIRE([AM_DEP_TRACK])dnl |
| 1047 |
|
| 1048 |
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], |
| 1049 |
[$1], [CXX], [depcc="$CXX" am_compiler_list=], |
| 1050 |
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], |
| 1051 |
[$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], |
| 1052 |
[$1], [UPC], [depcc="$UPC" am_compiler_list=], |
| 1053 |
[$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], |
| 1054 |
[depcc="$$1" am_compiler_list=]) |
| 1055 |
|
| 1056 |
AC_CACHE_CHECK([dependency style of $depcc], |
| 1057 |
[am_cv_$1_dependencies_compiler_type], |
| 1058 |
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then |
| 1059 |
# We make a subdir and do the tests there. Otherwise we can end up |
| 1060 |
# making bogus files that we don't know about and never remove. For |
| 1061 |
# instance it was reported that on HP-UX the gcc test will end up |
| 1062 |
# making a dummy file named 'D' -- because '-MD' means "put the output |
| 1063 |
# in D". |
| 1064 |
rm -rf conftest.dir |
| 1065 |
mkdir conftest.dir |
| 1066 |
# Copy depcomp to subdir because otherwise we won't find it if we're |
| 1067 |
# using a relative directory. |
| 1068 |
cp "$am_depcomp" conftest.dir |
| 1069 |
cd conftest.dir |
| 1070 |
# We will build objects and dependencies in a subdirectory because |
| 1071 |
# it helps to detect inapplicable dependency modes. For instance |
| 1072 |
# both Tru64's cc and ICC support -MD to output dependencies as a |
| 1073 |
# side effect of compilation, but ICC will put the dependencies in |
| 1074 |
# the current directory while Tru64 will put them in the object |
| 1075 |
# directory. |
| 1076 |
mkdir sub |
| 1077 |
|
| 1078 |
am_cv_$1_dependencies_compiler_type=none |
| 1079 |
if test "$am_compiler_list" = ""; then |
| 1080 |
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` |
| 1081 |
fi |
| 1082 |
am__universal=false |
| 1083 |
m4_case([$1], [CC], |
| 1084 |
[case " $depcc " in #( |
| 1085 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1086 |
esac], |
| 1087 |
[CXX], |
| 1088 |
[case " $depcc " in #( |
| 1089 |
*\ -arch\ *\ -arch\ *) am__universal=true ;; |
| 1090 |
esac]) |
| 1091 |
|
| 1092 |
for depmode in $am_compiler_list; do |
| 1093 |
# Setup a source with many dependencies, because some compilers |
| 1094 |
# like to wrap large dependency lists on column 80 (with \), and |
| 1095 |
# we should not choose a depcomp mode which is confused by this. |
| 1096 |
# |
| 1097 |
# We need to recreate these files for each test, as the compiler may |
| 1098 |
# overwrite some of them when testing with obscure command lines. |
| 1099 |
# This happens at least with the AIX C compiler. |
| 1100 |
: > sub/conftest.c |
| 1101 |
for i in 1 2 3 4 5 6; do |
| 1102 |
echo '#include "conftst'$i'.h"' >> sub/conftest.c |
| 1103 |
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with |
| 1104 |
# Solaris 10 /bin/sh. |
| 1105 |
echo '/* dummy */' > sub/conftst$i.h |
| 1106 |
done |
| 1107 |
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf |
| 1108 |
|
| 1109 |
# We check with '-c' and '-o' for the sake of the "dashmstdout" |
| 1110 |
# mode. It turns out that the SunPro C++ compiler does not properly |
| 1111 |
# handle '-M -o', and we need to detect this. Also, some Intel |
| 1112 |
# versions had trouble with output in subdirs. |
| 1113 |
am__obj=sub/conftest.${OBJEXT-o} |
| 1114 |
am__minus_obj="-o $am__obj" |
| 1115 |
case $depmode in |
| 1116 |
gcc) |
| 1117 |
# This depmode causes a compiler race in universal mode. |
| 1118 |
test "$am__universal" = false || continue |
| 1119 |
;; |
| 1120 |
nosideeffect) |
| 1121 |
# After this tag, mechanisms are not by side-effect, so they'll |
| 1122 |
# only be used when explicitly requested. |
| 1123 |
if test "x$enable_dependency_tracking" = xyes; then |
| 1124 |
continue |
| 1125 |
else |
| 1126 |
break |
| 1127 |
fi |
| 1128 |
;; |
| 1129 |
msvc7 | msvc7msys | msvisualcpp | msvcmsys) |
| 1130 |
# This compiler won't grok '-c -o', but also, the minuso test has |
| 1131 |
# not run yet. These depmodes are late enough in the game, and |
| 1132 |
# so weak that their functioning should not be impacted. |
| 1133 |
am__obj=conftest.${OBJEXT-o} |
| 1134 |
am__minus_obj= |
| 1135 |
;; |
| 1136 |
none) break ;; |
| 1137 |
esac |
| 1138 |
if depmode=$depmode \ |
| 1139 |
source=sub/conftest.c object=$am__obj \ |
| 1140 |
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ |
| 1141 |
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ |
| 1142 |
>/dev/null 2>conftest.err && |
| 1143 |
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && |
| 1144 |
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && |
| 1145 |
grep $am__obj sub/conftest.Po > /dev/null 2>&1 && |
| 1146 |
${MAKE-make} -s -f confmf > /dev/null 2>&1; then |
| 1147 |
# icc doesn't choke on unknown options, it will just issue warnings |
| 1148 |
# or remarks (even with -Werror). So we grep stderr for any message |
| 1149 |
# that says an option was ignored or not supported. |
| 1150 |
# When given -MP, icc 7.0 and 7.1 complain thus: |
| 1151 |
# icc: Command line warning: ignoring option '-M'; no argument required |
| 1152 |
# The diagnosis changed in icc 8.0: |
| 1153 |
# icc: Command line remark: option '-MP' not supported |
| 1154 |
if (grep 'ignoring option' conftest.err || |
| 1155 |
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else |
| 1156 |
am_cv_$1_dependencies_compiler_type=$depmode |
| 1157 |
break |
| 1158 |
fi |
| 1159 |
fi |
| 1160 |
done |
| 1161 |
|
| 1162 |
cd .. |
| 1163 |
rm -rf conftest.dir |
| 1164 |
else |
| 1165 |
am_cv_$1_dependencies_compiler_type=none |
| 1166 |
fi |
| 1167 |
]) |
| 1168 |
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) |
| 1169 |
AM_CONDITIONAL([am__fastdep$1], [ |
| 1170 |
test "x$enable_dependency_tracking" != xno \ |
| 1171 |
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3]) |
| 1172 |
]) |
| 1173 |
|
| 1174 |
|
| 1175 |
# AM_SET_DEPDIR |
| 1176 |
# ------------- |
| 1177 |
# Choose a directory name for dependency files. |
| 1178 |
# This macro is AC_REQUIREd in _AM_DEPENDENCIES. |
| 1179 |
AC_DEFUN([AM_SET_DEPDIR], |
| 1180 |
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 1181 |
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl |
| 1182 |
]) |
| 1183 |
|
| 1184 |
|
| 1185 |
# AM_DEP_TRACK |
| 1186 |
# ------------ |
| 1187 |
AC_DEFUN([AM_DEP_TRACK], |
| 1188 |
[AC_ARG_ENABLE([dependency-tracking], [dnl |
| 1189 |
AS_HELP_STRING( |
| 1190 |
[--enable-dependency-tracking], |
| 1191 |
[do not reject slow dependency extractors]) |
| 1192 |
AS_HELP_STRING( |
| 1193 |
[--disable-dependency-tracking], |
| 1194 |
[speeds up one-time build])]) |
| 1195 |
if test "x$enable_dependency_tracking" != xno; then |
| 1196 |
am_depcomp="$ac_aux_dir/depcomp" |
| 1197 |
AMDEPBACKSLASH='\' |
| 1198 |
am__nodep='_no' |
| 1199 |
fi |
| 1200 |
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) |
| 1201 |
AC_SUBST([AMDEPBACKSLASH])dnl |
| 1202 |
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl |
| 1203 |
AC_SUBST([am__nodep])dnl |
| 1204 |
_AM_SUBST_NOTMAKE([am__nodep])dnl |
| 1205 |
]) |
| 1206 |
|
| 1207 |
# Generate code to set up dependency tracking. -*- Autoconf -*- |
| 1208 |
|
| 1209 |
# Copyright (C) 1999-2025 Free Software Foundation, Inc. |
| 1210 |
# |
| 1211 |
# This file is free software; the Free Software Foundation |
| 1212 |
# gives unlimited permission to copy and/or distribute it, |
| 1213 |
# with or without modifications, as long as this notice is preserved. |
| 1214 |
|
| 1215 |
# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1216 |
# ------------------------------ |
| 1217 |
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1218 |
[{ |
| 1219 |
# Older Autoconf quotes --file arguments for eval, but not when files |
| 1220 |
# are listed without --file. Let's play safe and only enable the eval |
| 1221 |
# if we detect the quoting. |
| 1222 |
# TODO: see whether this extra hack can be removed once we start |
| 1223 |
# requiring Autoconf 2.70 or later. |
| 1224 |
AS_CASE([$CONFIG_FILES], |
| 1225 |
[*\'*], [eval set x "$CONFIG_FILES"], |
| 1226 |
[*], [set x $CONFIG_FILES]) |
| 1227 |
shift |
| 1228 |
# Used to flag and report bootstrapping failures. |
| 1229 |
am_rc=0 |
| 1230 |
for am_mf |
| 1231 |
do |
| 1232 |
# Strip MF so we end up with the name of the file. |
| 1233 |
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` |
| 1234 |
# Check whether this is an Automake generated Makefile which includes |
| 1235 |
# dependency-tracking related rules and includes. |
| 1236 |
# Grep'ing the whole file directly is not great: AIX grep has a line |
| 1237 |
# limit of 2048, but all sed's we know have understand at least 4000. |
| 1238 |
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ |
| 1239 |
|| continue |
| 1240 |
am_dirpart=`AS_DIRNAME(["$am_mf"])` |
| 1241 |
am_filepart=`AS_BASENAME(["$am_mf"])` |
| 1242 |
AM_RUN_LOG([cd "$am_dirpart" \ |
| 1243 |
&& sed -e '/# am--include-marker/d' "$am_filepart" \ |
| 1244 |
| $MAKE -f - am--depfiles]) || am_rc=$? |
| 1245 |
done |
| 1246 |
if test $am_rc -ne 0; then |
| 1247 |
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
| 1248 |
for automatic dependency tracking. If GNU make was not used, consider |
| 1249 |
re-running the configure script with MAKE="gmake" (or whatever is |
| 1250 |
necessary). You can also try re-running configure with the |
| 1251 |
'--disable-dependency-tracking' option to at least be able to build |
| 1252 |
the package (albeit without support for automatic dependency tracking).]) |
| 1253 |
fi |
| 1254 |
AS_UNSET([am_dirpart]) |
| 1255 |
AS_UNSET([am_filepart]) |
| 1256 |
AS_UNSET([am_mf]) |
| 1257 |
AS_UNSET([am_rc]) |
| 1258 |
rm -f conftest-deps.mk |
| 1259 |
} |
| 1260 |
])# _AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1261 |
|
| 1262 |
|
| 1263 |
# AM_OUTPUT_DEPENDENCY_COMMANDS |
| 1264 |
# ----------------------------- |
| 1265 |
# This macro should only be invoked once -- use via AC_REQUIRE. |
| 1266 |
# |
| 1267 |
# This code is only required when automatic dependency tracking is enabled. |
| 1268 |
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in |
| 1269 |
# order to bootstrap the dependency handling code. |
| 1270 |
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1271 |
[AC_CONFIG_COMMANDS([depfiles], |
| 1272 |
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], |
| 1273 |
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) |
| 1274 |
|
| 1275 |
# Do all the work for Automake. -*- Autoconf -*- |
| 1276 |
|
| 1277 |
# Copyright (C) 1996-2025 Free Software Foundation, Inc. |
| 1278 |
# |
| 1279 |
# This file is free software; the Free Software Foundation |
| 1280 |
# gives unlimited permission to copy and/or distribute it, |
| 1281 |
# with or without modifications, as long as this notice is preserved. |
| 1282 |
|
| 1283 |
# This macro actually does too much. Some checks are only needed if |
| 1284 |
# your package does certain things. But this isn't really a big deal. |
| 1285 |
|
| 1286 |
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. |
| 1287 |
m4_define([AC_PROG_CC], |
| 1288 |
m4_defn([AC_PROG_CC]) |
| 1289 |
[_AM_PROG_CC_C_O |
| 1290 |
]) |
| 1291 |
|
| 1292 |
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) |
| 1293 |
# AM_INIT_AUTOMAKE([OPTIONS]) |
| 1294 |
# ----------------------------------------------- |
| 1295 |
# The call with PACKAGE and VERSION arguments is the old style |
| 1296 |
# call (pre autoconf-2.50), which is being phased out. PACKAGE |
| 1297 |
# and VERSION should now be passed to AC_INIT and removed from |
| 1298 |
# the call to AM_INIT_AUTOMAKE. |
| 1299 |
# We support both call styles for the transition. After |
| 1300 |
# the next Automake release, Autoconf can make the AC_INIT |
| 1301 |
# arguments mandatory, and then we can depend on a new Autoconf |
| 1302 |
# release and drop the old call support. |
| 1303 |
AC_DEFUN([AM_INIT_AUTOMAKE], |
| 1304 |
[AC_PREREQ([2.65])dnl |
| 1305 |
m4_ifdef([_$0_ALREADY_INIT], |
| 1306 |
[m4_fatal([$0 expanded multiple times |
| 1307 |
]m4_defn([_$0_ALREADY_INIT]))], |
| 1308 |
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl |
| 1309 |
dnl Autoconf wants to disallow AM_ names. We explicitly allow |
| 1310 |
dnl the ones we care about. |
| 1311 |
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl |
| 1312 |
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl |
| 1313 |
AC_REQUIRE([AC_PROG_INSTALL])dnl |
| 1314 |
if test "`cd $srcdir && pwd`" != "`pwd`"; then |
| 1315 |
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output |
| 1316 |
# is not polluted with repeated "-I." |
| 1317 |
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl |
| 1318 |
# test to see if srcdir already configured |
| 1319 |
if test -f $srcdir/config.status; then |
| 1320 |
AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) |
| 1321 |
fi |
| 1322 |
fi |
| 1323 |
|
| 1324 |
# test whether we have cygpath |
| 1325 |
if test -z "$CYGPATH_W"; then |
| 1326 |
if (cygpath --version) >/dev/null 2>/dev/null; then |
| 1327 |
CYGPATH_W='cygpath -w' |
| 1328 |
else |
| 1329 |
CYGPATH_W=echo |
| 1330 |
fi |
| 1331 |
fi |
| 1332 |
AC_SUBST([CYGPATH_W]) |
| 1333 |
|
| 1334 |
# Define the identity of the package. |
| 1335 |
dnl Distinguish between old-style and new-style calls. |
| 1336 |
m4_ifval([$2], |
| 1337 |
[AC_DIAGNOSE([obsolete], |
| 1338 |
[$0: two- and three-arguments forms are deprecated.]) |
| 1339 |
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl |
| 1340 |
AC_SUBST([PACKAGE], [$1])dnl |
| 1341 |
AC_SUBST([VERSION], [$2])], |
| 1342 |
[_AM_SET_OPTIONS([$1])dnl |
| 1343 |
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. |
| 1344 |
m4_if( |
| 1345 |
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), |
| 1346 |
[ok:ok],, |
| 1347 |
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl |
| 1348 |
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl |
| 1349 |
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl |
| 1350 |
|
| 1351 |
_AM_IF_OPTION([no-define],, |
| 1352 |
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) |
| 1353 |
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl |
| 1354 |
|
| 1355 |
# Some tools Automake needs. |
| 1356 |
AC_REQUIRE([AM_SANITY_CHECK])dnl |
| 1357 |
AC_REQUIRE([AC_ARG_PROGRAM])dnl |
| 1358 |
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) |
| 1359 |
AM_MISSING_PROG([AUTOCONF], [autoconf]) |
| 1360 |
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) |
| 1361 |
AM_MISSING_PROG([AUTOHEADER], [autoheader]) |
| 1362 |
AM_MISSING_PROG([MAKEINFO], [makeinfo]) |
| 1363 |
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 1364 |
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl |
| 1365 |
AC_REQUIRE([AC_PROG_MKDIR_P])dnl |
| 1366 |
# For better backward compatibility. To be removed once Automake 1.9.x |
| 1367 |
# dies out for good. For more background, see: |
| 1368 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> |
| 1369 |
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> |
| 1370 |
AC_SUBST([mkdir_p], ['$(MKDIR_P)']) |
| 1371 |
# We need awk for the "check" target (and possibly the TAP driver). The |
| 1372 |
# system "awk" is bad on some platforms. |
| 1373 |
AC_REQUIRE([AC_PROG_AWK])dnl |
| 1374 |
AC_REQUIRE([AC_PROG_MAKE_SET])dnl |
| 1375 |
AC_REQUIRE([AM_SET_LEADING_DOT])dnl |
| 1376 |
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], |
| 1377 |
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], |
| 1378 |
[_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], |
| 1379 |
[_AM_PROG_TAR([ustar])])])]) |
| 1380 |
_AM_IF_OPTION([no-dependencies],, |
| 1381 |
[AC_PROVIDE_IFELSE([AC_PROG_CC], |
| 1382 |
[_AM_DEPENDENCIES([CC])], |
| 1383 |
[m4_define([AC_PROG_CC], |
| 1384 |
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl |
| 1385 |
AC_PROVIDE_IFELSE([AC_PROG_CXX], |
| 1386 |
[_AM_DEPENDENCIES([CXX])], |
| 1387 |
[m4_define([AC_PROG_CXX], |
| 1388 |
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl |
| 1389 |
AC_PROVIDE_IFELSE([AC_PROG_OBJC], |
| 1390 |
[_AM_DEPENDENCIES([OBJC])], |
| 1391 |
[m4_define([AC_PROG_OBJC], |
| 1392 |
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl |
| 1393 |
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], |
| 1394 |
[_AM_DEPENDENCIES([OBJCXX])], |
| 1395 |
[m4_define([AC_PROG_OBJCXX], |
| 1396 |
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl |
| 1397 |
]) |
| 1398 |
# Variables for tags utilities; see am/tags.am |
| 1399 |
if test -z "$CTAGS"; then |
| 1400 |
CTAGS=ctags |
| 1401 |
fi |
| 1402 |
AC_SUBST([CTAGS]) |
| 1403 |
if test -z "$ETAGS"; then |
| 1404 |
ETAGS=etags |
| 1405 |
fi |
| 1406 |
AC_SUBST([ETAGS]) |
| 1407 |
if test -z "$CSCOPE"; then |
| 1408 |
CSCOPE=cscope |
| 1409 |
fi |
| 1410 |
AC_SUBST([CSCOPE]) |
| 1411 |
|
| 1412 |
AC_REQUIRE([_AM_SILENT_RULES])dnl |
| 1413 |
dnl The testsuite driver may need to know about EXEEXT, so add the |
| 1414 |
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This |
| 1415 |
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. |
| 1416 |
AC_CONFIG_COMMANDS_PRE(dnl |
| 1417 |
[m4_provide_if([_AM_COMPILER_EXEEXT], |
| 1418 |
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl |
| 1419 |
|
| 1420 |
AC_REQUIRE([_AM_PROG_RM_F]) |
| 1421 |
AC_REQUIRE([_AM_PROG_XARGS_N]) |
| 1422 |
|
| 1423 |
dnl The trailing newline in this macro's definition is deliberate, for |
| 1424 |
dnl backward compatibility and to allow trailing 'dnl'-style comments |
| 1425 |
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. |
| 1426 |
]) |
| 1427 |
|
| 1428 |
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not |
| 1429 |
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further |
| 1430 |
dnl mangled by Autoconf and run in a shell conditional statement. |
| 1431 |
m4_define([_AC_COMPILER_EXEEXT], |
| 1432 |
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) |
| 1433 |
|
| 1434 |
# When config.status generates a header, we must update the stamp-h file. |
| 1435 |
# This file resides in the same directory as the config header |
| 1436 |
# that is generated. The stamp files are numbered to have different names. |
| 1437 |
|
| 1438 |
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the |
| 1439 |
# loop where config.status creates the headers, so we can generate |
| 1440 |
# our stamp files there. |
| 1441 |
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], |
| 1442 |
[# Compute $1's index in $config_headers. |
| 1443 |
_am_arg=$1 |
| 1444 |
_am_stamp_count=1 |
| 1445 |
for _am_header in $config_headers :; do |
| 1446 |
case $_am_header in |
| 1447 |
$_am_arg | $_am_arg:* ) |
| 1448 |
break ;; |
| 1449 |
* ) |
| 1450 |
_am_stamp_count=`expr $_am_stamp_count + 1` ;; |
| 1451 |
esac |
| 1452 |
done |
| 1453 |
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
| 1454 |
|
| 1455 |
# Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 1456 |
# |
| 1457 |
# This file is free software; the Free Software Foundation |
| 1458 |
# gives unlimited permission to copy and/or distribute it, |
| 1459 |
# with or without modifications, as long as this notice is preserved. |
| 1460 |
|
| 1461 |
# AM_PROG_INSTALL_SH |
| 1462 |
# ------------------ |
| 1463 |
# Define $install_sh. |
| 1464 |
AC_DEFUN([AM_PROG_INSTALL_SH], |
| 1465 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 1466 |
if test x"${install_sh+set}" != xset; then |
| 1467 |
case $am_aux_dir in |
| 1468 |
*\ * | *\ *) |
| 1469 |
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; |
| 1470 |
*) |
| 1471 |
install_sh="\${SHELL} $am_aux_dir/install-sh" |
| 1472 |
esac |
| 1473 |
fi |
| 1474 |
AC_SUBST([install_sh])]) |
| 1475 |
|
| 1476 |
# Copyright (C) 2003-2025 Free Software Foundation, Inc. |
| 1477 |
# |
| 1478 |
# This file is free software; the Free Software Foundation |
| 1479 |
# gives unlimited permission to copy and/or distribute it, |
| 1480 |
# with or without modifications, as long as this notice is preserved. |
| 1481 |
|
| 1482 |
# Check whether the underlying file-system supports filenames |
| 1483 |
# with a leading dot. For instance MS-DOS doesn't. |
| 1484 |
AC_DEFUN([AM_SET_LEADING_DOT], |
| 1485 |
[rm -rf .tst 2>/dev/null |
| 1486 |
mkdir .tst 2>/dev/null |
| 1487 |
if test -d .tst; then |
| 1488 |
am__leading_dot=. |
| 1489 |
else |
| 1490 |
am__leading_dot=_ |
| 1491 |
fi |
| 1492 |
rmdir .tst 2>/dev/null |
| 1493 |
AC_SUBST([am__leading_dot])]) |
| 1494 |
|
| 1495 |
# Check to see how 'make' treats includes. -*- Autoconf -*- |
| 1496 |
|
| 1497 |
# Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 1498 |
# |
| 1499 |
# This file is free software; the Free Software Foundation |
| 1500 |
# gives unlimited permission to copy and/or distribute it, |
| 1501 |
# with or without modifications, as long as this notice is preserved. |
| 1502 |
|
| 1503 |
# AM_MAKE_INCLUDE() |
| 1504 |
# ----------------- |
| 1505 |
# Check whether make has an 'include' directive that can support all |
| 1506 |
# the idioms we need for our automatic dependency tracking code. |
| 1507 |
AC_DEFUN([AM_MAKE_INCLUDE], |
| 1508 |
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) |
| 1509 |
cat > confinc.mk << 'END' |
| 1510 |
am__doit: |
| 1511 |
@echo this is the am__doit target >confinc.out |
| 1512 |
.PHONY: am__doit |
| 1513 |
END |
| 1514 |
am__include="#" |
| 1515 |
am__quote= |
| 1516 |
# BSD make does it like this. |
| 1517 |
echo '.include "confinc.mk" # ignored' > confmf.BSD |
| 1518 |
# Other make implementations (GNU, Solaris 10, AIX) do it like this. |
| 1519 |
echo 'include confinc.mk # ignored' > confmf.GNU |
| 1520 |
_am_result=no |
| 1521 |
for s in GNU BSD; do |
| 1522 |
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) |
| 1523 |
AS_CASE([$?:`cat confinc.out 2>/dev/null`], |
| 1524 |
['0:this is the am__doit target'], |
| 1525 |
[AS_CASE([$s], |
| 1526 |
[BSD], [am__include='.include' am__quote='"'], |
| 1527 |
[am__include='include' am__quote=''])]) |
| 1528 |
if test "$am__include" != "#"; then |
| 1529 |
_am_result="yes ($s style)" |
| 1530 |
break |
| 1531 |
fi |
| 1532 |
done |
| 1533 |
rm -f confinc.* confmf.* |
| 1534 |
AC_MSG_RESULT([${_am_result}]) |
| 1535 |
AC_SUBST([am__include])]) |
| 1536 |
AC_SUBST([am__quote])]) |
| 1537 |
|
| 1538 |
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
| 1539 |
|
| 1540 |
# Copyright (C) 1997-2025 Free Software Foundation, Inc. |
| 1541 |
# |
| 1542 |
# This file is free software; the Free Software Foundation |
| 1543 |
# gives unlimited permission to copy and/or distribute it, |
| 1544 |
# with or without modifications, as long as this notice is preserved. |
| 1545 |
|
| 1546 |
# AM_MISSING_PROG(NAME, PROGRAM) |
| 1547 |
# ------------------------------ |
| 1548 |
AC_DEFUN([AM_MISSING_PROG], |
| 1549 |
[AC_REQUIRE([AM_MISSING_HAS_RUN]) |
| 1550 |
$1=${$1-"${am_missing_run}$2"} |
| 1551 |
AC_SUBST($1)]) |
| 1552 |
|
| 1553 |
# AM_MISSING_HAS_RUN |
| 1554 |
# ------------------ |
| 1555 |
# Define MISSING if not defined so far and test if it is modern enough. |
| 1556 |
# If it is, set am_missing_run to use it, otherwise, to nothing. |
| 1557 |
AC_DEFUN([AM_MISSING_HAS_RUN], |
| 1558 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 1559 |
AC_REQUIRE_AUX_FILE([missing])dnl |
| 1560 |
if test x"${MISSING+set}" != xset; then |
| 1561 |
MISSING="\${SHELL} '$am_aux_dir/missing'" |
| 1562 |
fi |
| 1563 |
# Use eval to expand $SHELL |
| 1564 |
if eval "$MISSING --is-lightweight"; then |
| 1565 |
am_missing_run="$MISSING " |
| 1566 |
else |
| 1567 |
am_missing_run= |
| 1568 |
AC_MSG_WARN(['missing' script is too old or missing]) |
| 1569 |
fi |
| 1570 |
]) |
| 1571 |
|
| 1572 |
# Helper functions for option handling. -*- Autoconf -*- |
| 1573 |
|
| 1574 |
# Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 1575 |
# |
| 1576 |
# This file is free software; the Free Software Foundation |
| 1577 |
# gives unlimited permission to copy and/or distribute it, |
| 1578 |
# with or without modifications, as long as this notice is preserved. |
| 1579 |
|
| 1580 |
# _AM_MANGLE_OPTION(NAME) |
| 1581 |
# ----------------------- |
| 1582 |
AC_DEFUN([_AM_MANGLE_OPTION], |
| 1583 |
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) |
| 1584 |
|
| 1585 |
# _AM_SET_OPTION(NAME) |
| 1586 |
# -------------------- |
| 1587 |
# Set option NAME. Presently that only means defining a flag for this option. |
| 1588 |
AC_DEFUN([_AM_SET_OPTION], |
| 1589 |
[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) |
| 1590 |
|
| 1591 |
# _AM_SET_OPTIONS(OPTIONS) |
| 1592 |
# ------------------------ |
| 1593 |
# OPTIONS is a space-separated list of Automake options. |
| 1594 |
AC_DEFUN([_AM_SET_OPTIONS], |
| 1595 |
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) |
| 1596 |
|
| 1597 |
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) |
| 1598 |
# ------------------------------------------- |
| 1599 |
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. |
| 1600 |
AC_DEFUN([_AM_IF_OPTION], |
| 1601 |
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
| 1602 |
|
| 1603 |
# Copyright (C) 1999-2025 Free Software Foundation, Inc. |
| 1604 |
# |
| 1605 |
# This file is free software; the Free Software Foundation |
| 1606 |
# gives unlimited permission to copy and/or distribute it, |
| 1607 |
# with or without modifications, as long as this notice is preserved. |
| 1608 |
|
| 1609 |
# _AM_PROG_CC_C_O |
| 1610 |
# --------------- |
| 1611 |
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC |
| 1612 |
# to automatically call this. |
| 1613 |
AC_DEFUN([_AM_PROG_CC_C_O], |
| 1614 |
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
| 1615 |
AC_REQUIRE_AUX_FILE([compile])dnl |
| 1616 |
AC_LANG_PUSH([C])dnl |
| 1617 |
AC_CACHE_CHECK( |
| 1618 |
[whether $CC understands -c and -o together], |
| 1619 |
[am_cv_prog_cc_c_o], |
| 1620 |
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) |
| 1621 |
# Make sure it works both with $CC and with simple cc. |
| 1622 |
# Following AC_PROG_CC_C_O, we do the test twice because some |
| 1623 |
# compilers refuse to overwrite an existing .o file with -o, |
| 1624 |
# though they will create one. |
| 1625 |
am_cv_prog_cc_c_o=yes |
| 1626 |
for am_i in 1 2; do |
| 1627 |
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ |
| 1628 |
&& test -f conftest2.$ac_objext; then |
| 1629 |
: OK |
| 1630 |
else |
| 1631 |
am_cv_prog_cc_c_o=no |
| 1632 |
break |
| 1633 |
fi |
| 1634 |
done |
| 1635 |
# aligned with autoconf, so not including core; see bug#72225. |
| 1636 |
rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ |
| 1637 |
conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ |
| 1638 |
conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM |
| 1639 |
unset am_i]) |
| 1640 |
if test "$am_cv_prog_cc_c_o" != yes; then |
| 1641 |
# Losing compiler, so override with the script. |
| 1642 |
# FIXME: It is wrong to rewrite CC. |
| 1643 |
# But if we don't then we get into trouble of one sort or another. |
| 1644 |
# A longer-term fix would be to have automake use am__CC in this case, |
| 1645 |
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" |
| 1646 |
CC="$am_aux_dir/compile $CC" |
| 1647 |
fi |
| 1648 |
AC_LANG_POP([C])]) |
| 1649 |
|
| 1650 |
# For backward compatibility. |
| 1651 |
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
| 1652 |
|
| 1653 |
# Copyright (C) 2022-2025 Free Software Foundation, Inc. |
| 1654 |
# |
| 1655 |
# This file is free software; the Free Software Foundation |
| 1656 |
# gives unlimited permission to copy and/or distribute it, |
| 1657 |
# with or without modifications, as long as this notice is preserved. |
| 1658 |
|
| 1659 |
# _AM_PROG_RM_F |
| 1660 |
# --------------- |
| 1661 |
# Check whether 'rm -f' without any arguments works. |
| 1662 |
# https://bugs.gnu.org/10828 |
| 1663 |
AC_DEFUN([_AM_PROG_RM_F], |
| 1664 |
[am__rm_f_notfound= |
| 1665 |
AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) |
| 1666 |
AC_SUBST(am__rm_f_notfound) |
| 1667 |
]) |
| 1668 |
|
| 1669 |
# Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 1670 |
# |
| 1671 |
# This file is free software; the Free Software Foundation |
| 1672 |
# gives unlimited permission to copy and/or distribute it, |
| 1673 |
# with or without modifications, as long as this notice is preserved. |
| 1674 |
|
| 1675 |
# AM_RUN_LOG(COMMAND) |
| 1676 |
# ------------------- |
| 1677 |
# Run COMMAND, save the exit status in ac_status, and log it. |
| 1678 |
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) |
| 1679 |
AC_DEFUN([AM_RUN_LOG], |
| 1680 |
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD |
| 1681 |
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD |
| 1682 |
ac_status=$? |
| 1683 |
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD |
| 1684 |
(exit $ac_status); }]) |
| 1685 |
|
| 1686 |
# Check to make sure that the build environment is sane. -*- Autoconf -*- |
| 1687 |
|
| 1688 |
# Copyright (C) 1996-2025 Free Software Foundation, Inc. |
| 1689 |
# |
| 1690 |
# This file is free software; the Free Software Foundation |
| 1691 |
# gives unlimited permission to copy and/or distribute it, |
| 1692 |
# with or without modifications, as long as this notice is preserved. |
| 1693 |
|
| 1694 |
# _AM_SLEEP_FRACTIONAL_SECONDS |
| 1695 |
# ---------------------------- |
| 1696 |
AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl |
| 1697 |
AC_CACHE_CHECK([whether sleep supports fractional seconds], |
| 1698 |
am_cv_sleep_fractional_seconds, [dnl |
| 1699 |
AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], |
| 1700 |
[am_cv_sleep_fractional_seconds=no]) |
| 1701 |
])]) |
| 1702 |
|
| 1703 |
# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION |
| 1704 |
# ----------------------------------- |
| 1705 |
# Determine the filesystem's resolution for file modification |
| 1706 |
# timestamps. The coarsest we know of is FAT, with a resolution |
| 1707 |
# of only two seconds, even with the most recent "exFAT" extensions. |
| 1708 |
# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one |
| 1709 |
# nanosecond, matching clock_gettime. However, it is probably not |
| 1710 |
# possible to delay execution of a shell script for less than one |
| 1711 |
# millisecond, due to process creation overhead and scheduling |
| 1712 |
# granularity, so we don't check for anything finer than that. (See below.) |
| 1713 |
AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl |
| 1714 |
AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) |
| 1715 |
AC_CACHE_CHECK([filesystem timestamp resolution], |
| 1716 |
am_cv_filesystem_timestamp_resolution, [dnl |
| 1717 |
# Default to the worst case. |
| 1718 |
am_cv_filesystem_timestamp_resolution=2 |
| 1719 |
|
| 1720 |
# Only try to go finer than 1 sec if sleep can do it. |
| 1721 |
# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, |
| 1722 |
# - 1 sec is not much of a win compared to 2 sec, and |
| 1723 |
# - it takes 2 seconds to perform the test whether 1 sec works. |
| 1724 |
# |
| 1725 |
# Instead, just use the default 2s on platforms that have 1s resolution, |
| 1726 |
# accept the extra 1s delay when using $sleep in the Automake tests, in |
| 1727 |
# exchange for not incurring the 2s delay for running the test for all |
| 1728 |
# packages. |
| 1729 |
# |
| 1730 |
am_try_resolutions= |
| 1731 |
if test "$am_cv_sleep_fractional_seconds" = yes; then |
| 1732 |
# Even a millisecond often causes a bunch of false positives, |
| 1733 |
# so just try a hundredth of a second. The time saved between .001 and |
| 1734 |
# .01 is not terribly consequential. |
| 1735 |
am_try_resolutions="0.01 0.1 $am_try_resolutions" |
| 1736 |
fi |
| 1737 |
|
| 1738 |
# In order to catch current-generation FAT out, we must *modify* files |
| 1739 |
# that already exist; the *creation* timestamp is finer. Use names |
| 1740 |
# that make ls -t sort them differently when they have equal |
| 1741 |
# timestamps than when they have distinct timestamps, keeping |
| 1742 |
# in mind that ls -t prints the *newest* file first. |
| 1743 |
rm -f conftest.ts? |
| 1744 |
: > conftest.ts1 |
| 1745 |
: > conftest.ts2 |
| 1746 |
: > conftest.ts3 |
| 1747 |
|
| 1748 |
# Make sure ls -t actually works. Do 'set' in a subshell so we don't |
| 1749 |
# clobber the current shell's arguments. (Outer-level square brackets |
| 1750 |
# are removed by m4; they're present so that m4 does not expand |
| 1751 |
# <dollar><star>; be careful, easy to get confused.) |
| 1752 |
if ( |
| 1753 |
set X `[ls -t conftest.ts[12]]` && |
| 1754 |
{ |
| 1755 |
test "$[]*" != "X conftest.ts1 conftest.ts2" || |
| 1756 |
test "$[]*" != "X conftest.ts2 conftest.ts1"; |
| 1757 |
} |
| 1758 |
); then :; else |
| 1759 |
# If neither matched, then we have a broken ls. This can happen |
| 1760 |
# if, for instance, CONFIG_SHELL is bash and it inherits a |
| 1761 |
# broken ls alias from the environment. This has actually |
| 1762 |
# happened. Such a system could not be considered "sane". |
| 1763 |
_AS_ECHO_UNQUOTED( |
| 1764 |
["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], |
| 1765 |
[AS_MESSAGE_LOG_FD]) |
| 1766 |
AC_MSG_FAILURE([ls -t produces unexpected output. |
| 1767 |
Make sure there is not a broken ls alias in your environment.]) |
| 1768 |
fi |
| 1769 |
|
| 1770 |
for am_try_res in $am_try_resolutions; do |
| 1771 |
# Any one fine-grained sleep might happen to cross the boundary |
| 1772 |
# between two values of a coarser actual resolution, but if we do |
| 1773 |
# two fine-grained sleeps in a row, at least one of them will fall |
| 1774 |
# entirely within a coarse interval. |
| 1775 |
echo alpha > conftest.ts1 |
| 1776 |
sleep $am_try_res |
| 1777 |
echo beta > conftest.ts2 |
| 1778 |
sleep $am_try_res |
| 1779 |
echo gamma > conftest.ts3 |
| 1780 |
|
| 1781 |
# We assume that 'ls -t' will make use of high-resolution |
| 1782 |
# timestamps if the operating system supports them at all. |
| 1783 |
if (set X `ls -t conftest.ts?` && |
| 1784 |
test "$[]2" = conftest.ts3 && |
| 1785 |
test "$[]3" = conftest.ts2 && |
| 1786 |
test "$[]4" = conftest.ts1); then |
| 1787 |
# |
| 1788 |
# Ok, ls -t worked. If we're at a resolution of 1 second, we're done, |
| 1789 |
# because we don't need to test make. |
| 1790 |
make_ok=true |
| 1791 |
if test $am_try_res != 1; then |
| 1792 |
# But if we've succeeded so far with a subsecond resolution, we |
| 1793 |
# have one more thing to check: make. It can happen that |
| 1794 |
# everything else supports the subsecond mtimes, but make doesn't; |
| 1795 |
# notably on macOS, which ships make 3.81 from 2006 (the last one |
| 1796 |
# released under GPLv2). https://bugs.gnu.org/68808 |
| 1797 |
# |
| 1798 |
# We test $MAKE if it is defined in the environment, else "make". |
| 1799 |
# It might get overridden later, but our hope is that in practice |
| 1800 |
# it does not matter: it is the system "make" which is (by far) |
| 1801 |
# the most likely to be broken, whereas if the user overrides it, |
| 1802 |
# probably they did so with a better, or at least not worse, make. |
| 1803 |
# https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html |
| 1804 |
# |
| 1805 |
# Create a Makefile (real tab character here): |
| 1806 |
rm -f conftest.mk |
| 1807 |
echo 'conftest.ts1: conftest.ts2' >conftest.mk |
| 1808 |
echo ' touch conftest.ts2' >>conftest.mk |
| 1809 |
# |
| 1810 |
# Now, running |
| 1811 |
# touch conftest.ts1; touch conftest.ts2; make |
| 1812 |
# should touch ts1 because ts2 is newer. This could happen by luck, |
| 1813 |
# but most often, it will fail if make's support is insufficient. So |
| 1814 |
# test for several consecutive successes. |
| 1815 |
# |
| 1816 |
# (We reuse conftest.ts[12] because we still want to modify existing |
| 1817 |
# files, not create new ones, per above.) |
| 1818 |
n=0 |
| 1819 |
make=${MAKE-make} |
| 1820 |
until test $n -eq 3; do |
| 1821 |
echo one > conftest.ts1 |
| 1822 |
sleep $am_try_res |
| 1823 |
echo two > conftest.ts2 # ts2 should now be newer than ts1 |
| 1824 |
if $make -f conftest.mk | grep 'up to date' >/dev/null; then |
| 1825 |
make_ok=false |
| 1826 |
break # out of $n loop |
| 1827 |
fi |
| 1828 |
n=`expr $n + 1` |
| 1829 |
done |
| 1830 |
fi |
| 1831 |
# |
| 1832 |
if $make_ok; then |
| 1833 |
# Everything we know to check worked out, so call this resolution good. |
| 1834 |
am_cv_filesystem_timestamp_resolution=$am_try_res |
| 1835 |
break # out of $am_try_res loop |
| 1836 |
fi |
| 1837 |
# Otherwise, we'll go on to check the next resolution. |
| 1838 |
fi |
| 1839 |
done |
| 1840 |
rm -f conftest.ts? |
| 1841 |
# (end _am_filesystem_timestamp_resolution) |
| 1842 |
])]) |
| 1843 |
|
| 1844 |
# AM_SANITY_CHECK |
| 1845 |
# --------------- |
| 1846 |
AC_DEFUN([AM_SANITY_CHECK], |
| 1847 |
[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) |
| 1848 |
# This check should not be cached, as it may vary across builds of |
| 1849 |
# different projects. |
| 1850 |
AC_MSG_CHECKING([whether build environment is sane]) |
| 1851 |
# Reject unsafe characters in $srcdir or the absolute working directory |
| 1852 |
# name. Accept space and tab only in the latter. |
| 1853 |
am_lf=' |
| 1854 |
' |
| 1855 |
case `pwd` in |
| 1856 |
*[[\\\"\#\$\&\'\`$am_lf]]*) |
| 1857 |
AC_MSG_RESULT([no]) |
| 1858 |
AC_MSG_ERROR([unsafe absolute working directory name]);; |
| 1859 |
esac |
| 1860 |
case $srcdir in |
| 1861 |
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) |
| 1862 |
AC_MSG_RESULT([no]) |
| 1863 |
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; |
| 1864 |
esac |
| 1865 |
|
| 1866 |
# Do 'set' in a subshell so we don't clobber the current shell's |
| 1867 |
# arguments. Must try -L first in case configure is actually a |
| 1868 |
# symlink; some systems play weird games with the mod time of symlinks |
| 1869 |
# (eg FreeBSD returns the mod time of the symlink's containing |
| 1870 |
# directory). |
| 1871 |
am_build_env_is_sane=no |
| 1872 |
am_has_slept=no |
| 1873 |
rm -f conftest.file |
| 1874 |
for am_try in 1 2; do |
| 1875 |
echo "timestamp, slept: $am_has_slept" > conftest.file |
| 1876 |
if ( |
| 1877 |
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` |
| 1878 |
if test "$[]*" = "X"; then |
| 1879 |
# -L didn't work. |
| 1880 |
set X `ls -t "$srcdir/configure" conftest.file` |
| 1881 |
fi |
| 1882 |
test "$[]2" = conftest.file |
| 1883 |
); then |
| 1884 |
am_build_env_is_sane=yes |
| 1885 |
break |
| 1886 |
fi |
| 1887 |
# Just in case. |
| 1888 |
sleep "$am_cv_filesystem_timestamp_resolution" |
| 1889 |
am_has_slept=yes |
| 1890 |
done |
| 1891 |
|
| 1892 |
AC_MSG_RESULT([$am_build_env_is_sane]) |
| 1893 |
if test "$am_build_env_is_sane" = no; then |
| 1894 |
AC_MSG_ERROR([newly created file is older than distributed files! |
| 1895 |
Check your system clock]) |
| 1896 |
fi |
| 1897 |
|
| 1898 |
# If we didn't sleep, we still need to ensure time stamps of config.status and |
| 1899 |
# generated files are strictly newer. |
| 1900 |
am_sleep_pid= |
| 1901 |
AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl |
| 1902 |
( sleep "$am_cv_filesystem_timestamp_resolution" ) & |
| 1903 |
am_sleep_pid=$! |
| 1904 |
]) |
| 1905 |
AC_CONFIG_COMMANDS_PRE( |
| 1906 |
[AC_MSG_CHECKING([that generated files are newer than configure]) |
| 1907 |
if test -n "$am_sleep_pid"; then |
| 1908 |
# Hide warnings about reused PIDs. |
| 1909 |
wait $am_sleep_pid 2>/dev/null |
| 1910 |
fi |
| 1911 |
AC_MSG_RESULT([done])]) |
| 1912 |
rm -f conftest.file |
| 1913 |
]) |
| 1914 |
|
| 1915 |
# Copyright (C) 2009-2025 Free Software Foundation, Inc. |
| 1916 |
# |
| 1917 |
# This file is free software; the Free Software Foundation |
| 1918 |
# gives unlimited permission to copy and/or distribute it, |
| 1919 |
# with or without modifications, as long as this notice is preserved. |
| 1920 |
|
| 1921 |
# _AM_SILENT_RULES |
| 1922 |
# ---------------- |
| 1923 |
# Enable less verbose build rules support. |
| 1924 |
AC_DEFUN([_AM_SILENT_RULES], |
| 1925 |
[AM_DEFAULT_VERBOSITY=1 |
| 1926 |
AC_ARG_ENABLE([silent-rules], [dnl |
| 1927 |
AS_HELP_STRING( |
| 1928 |
[--enable-silent-rules], |
| 1929 |
[less verbose build output (undo: "make V=1")]) |
| 1930 |
AS_HELP_STRING( |
| 1931 |
[--disable-silent-rules], |
| 1932 |
[verbose build output (undo: "make V=0")])dnl |
| 1933 |
]) |
| 1934 |
dnl |
| 1935 |
dnl A few 'make' implementations (e.g., NonStop OS and NextStep) |
| 1936 |
dnl do not support nested variable expansions. |
| 1937 |
dnl See automake bug#9928 and bug#10237. |
| 1938 |
am_make=${MAKE-make} |
| 1939 |
AC_CACHE_CHECK([whether $am_make supports nested variables], |
| 1940 |
[am_cv_make_support_nested_variables], |
| 1941 |
[if AS_ECHO([['TRUE=$(BAR$(V)) |
| 1942 |
BAR0=false |
| 1943 |
BAR1=true |
| 1944 |
V=1 |
| 1945 |
am__doit: |
| 1946 |
@$(TRUE) |
| 1947 |
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then |
| 1948 |
am_cv_make_support_nested_variables=yes |
| 1949 |
else |
| 1950 |
am_cv_make_support_nested_variables=no |
| 1951 |
fi]) |
| 1952 |
AC_SUBST([AM_V])dnl |
| 1953 |
AM_SUBST_NOTMAKE([AM_V])dnl |
| 1954 |
AC_SUBST([AM_DEFAULT_V])dnl |
| 1955 |
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl |
| 1956 |
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl |
| 1957 |
AM_BACKSLASH='\' |
| 1958 |
AC_SUBST([AM_BACKSLASH])dnl |
| 1959 |
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
| 1960 |
dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls |
| 1961 |
dnl to AM_SILENT_RULES to change the default value. |
| 1962 |
AC_CONFIG_COMMANDS_PRE([dnl |
| 1963 |
case $enable_silent_rules in @%:@ ((( |
| 1964 |
yes) AM_DEFAULT_VERBOSITY=0;; |
| 1965 |
no) AM_DEFAULT_VERBOSITY=1;; |
| 1966 |
esac |
| 1967 |
if test $am_cv_make_support_nested_variables = yes; then |
| 1968 |
dnl Using '$V' instead of '$(V)' breaks IRIX make. |
| 1969 |
AM_V='$(V)' |
| 1970 |
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' |
| 1971 |
else |
| 1972 |
AM_V=$AM_DEFAULT_VERBOSITY |
| 1973 |
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY |
| 1974 |
fi |
| 1975 |
])dnl |
| 1976 |
]) |
| 1977 |
|
| 1978 |
# AM_SILENT_RULES([DEFAULT]) |
| 1979 |
# -------------------------- |
| 1980 |
# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or |
| 1981 |
# empty being verbose). |
| 1982 |
AC_DEFUN([AM_SILENT_RULES], |
| 1983 |
[AC_REQUIRE([_AM_SILENT_RULES]) |
| 1984 |
AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline |
| 1985 |
dnl We intentionally force a newline after the assignment, since a) nothing |
| 1986 |
dnl good can come of more text following, and b) that was the behavior |
| 1987 |
dnl before 1.17. See https://bugs.gnu.org/72267. |
| 1988 |
]) |
| 1989 |
|
| 1990 |
# Copyright (C) 2001-2025 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_PROG_INSTALL_STRIP |
| 1997 |
# --------------------- |
| 1998 |
# One issue with vendor 'install' (even GNU) is that you can't |
| 1999 |
# specify the program used to strip binaries. This is especially |
| 2000 |
# annoying in cross-compiling environments, where the build's strip |
| 2001 |
# is unlikely to handle the host's binaries. |
| 2002 |
# Fortunately install-sh will honor a STRIPPROG variable, so we |
| 2003 |
# always use install-sh in "make install-strip", and initialize |
| 2004 |
# STRIPPROG with the value of the STRIP variable (set by the user). |
| 2005 |
AC_DEFUN([AM_PROG_INSTALL_STRIP], |
| 2006 |
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl |
| 2007 |
# Installed binaries are usually stripped using 'strip' when the user |
| 2008 |
# run "make install-strip". However 'strip' might not be the right |
| 2009 |
# tool to use in cross-compilation environments, therefore Automake |
| 2010 |
# will honor the 'STRIP' environment variable to overrule this program. |
| 2011 |
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. |
| 2012 |
if test "$cross_compiling" != no; then |
| 2013 |
AC_CHECK_TOOL([STRIP], [strip], :) |
| 2014 |
fi |
| 2015 |
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
| 2016 |
AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
| 2017 |
|
| 2018 |
# Copyright (C) 2006-2025 Free Software Foundation, Inc. |
| 2019 |
# |
| 2020 |
# This file is free software; the Free Software Foundation |
| 2021 |
# gives unlimited permission to copy and/or distribute it, |
| 2022 |
# with or without modifications, as long as this notice is preserved. |
| 2023 |
|
| 2024 |
# _AM_SUBST_NOTMAKE(VARIABLE) |
| 2025 |
# --------------------------- |
| 2026 |
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. |
| 2027 |
# This macro is traced by Automake. |
| 2028 |
AC_DEFUN([_AM_SUBST_NOTMAKE]) |
| 2029 |
|
| 2030 |
# AM_SUBST_NOTMAKE(VARIABLE) |
| 2031 |
# -------------------------- |
| 2032 |
# Public sister of _AM_SUBST_NOTMAKE. |
| 2033 |
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) |
| 2034 |
|
| 2035 |
# Check how to create a tarball. -*- Autoconf -*- |
| 2036 |
|
| 2037 |
# Copyright (C) 2004-2025 Free Software Foundation, Inc. |
| 2038 |
# |
| 2039 |
# This file is free software; the Free Software Foundation |
| 2040 |
# gives unlimited permission to copy and/or distribute it, |
| 2041 |
# with or without modifications, as long as this notice is preserved. |
| 2042 |
|
| 2043 |
# _AM_PROG_TAR(FORMAT) |
| 2044 |
# -------------------- |
| 2045 |
# Check how to create a tarball in format FORMAT. |
| 2046 |
# FORMAT should be one of 'v7', 'ustar', or 'pax'. |
| 2047 |
# |
| 2048 |
# Substitute a variable $(am__tar) that is a command |
| 2049 |
# writing to stdout a FORMAT-tarball containing the directory |
| 2050 |
# $tardir. |
| 2051 |
# tardir=directory && $(am__tar) > result.tar |
| 2052 |
# |
| 2053 |
# Substitute a variable $(am__untar) that extract such |
| 2054 |
# a tarball read from stdin. |
| 2055 |
# $(am__untar) < result.tar |
| 2056 |
# |
| 2057 |
AC_DEFUN([_AM_PROG_TAR], |
| 2058 |
[# Always define AMTAR for backward compatibility. Yes, it's still used |
| 2059 |
# in the wild :-( We should find a proper way to deprecate it ... |
| 2060 |
AC_SUBST([AMTAR], ['$${TAR-tar}']) |
| 2061 |
|
| 2062 |
# We'll loop over all known methods to create a tar archive until one works. |
| 2063 |
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' |
| 2064 |
|
| 2065 |
m4_if([$1], [v7], |
| 2066 |
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], |
| 2067 |
|
| 2068 |
[m4_case([$1], |
| 2069 |
[ustar], |
| 2070 |
[# The POSIX 1988 'ustar' format is defined with fixed-size fields. |
| 2071 |
# There is notably a 21 bits limit for the UID and the GID. In fact, |
| 2072 |
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 |
| 2073 |
# and bug#13588). |
| 2074 |
am_max_uid=2097151 # 2^21 - 1 |
| 2075 |
am_max_gid=$am_max_uid |
| 2076 |
# The $UID and $GID variables are not portable, so we need to resort |
| 2077 |
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls |
| 2078 |
# below are definitely unexpected, so allow the users to see them |
| 2079 |
# (that is, avoid stderr redirection). |
| 2080 |
am_uid=`id -u || echo unknown` |
| 2081 |
am_gid=`id -g || echo unknown` |
| 2082 |
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) |
| 2083 |
if test x$am_uid = xunknown; then |
| 2084 |
AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) |
| 2085 |
elif test $am_uid -le $am_max_uid; then |
| 2086 |
AC_MSG_RESULT([yes]) |
| 2087 |
else |
| 2088 |
AC_MSG_RESULT([no]) |
| 2089 |
_am_tools=none |
| 2090 |
fi |
| 2091 |
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) |
| 2092 |
if test x$gm_gid = xunknown; then |
| 2093 |
AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) |
| 2094 |
elif test $am_gid -le $am_max_gid; then |
| 2095 |
AC_MSG_RESULT([yes]) |
| 2096 |
else |
| 2097 |
AC_MSG_RESULT([no]) |
| 2098 |
_am_tools=none |
| 2099 |
fi], |
| 2100 |
|
| 2101 |
[pax], |
| 2102 |
[], |
| 2103 |
|
| 2104 |
[m4_fatal([Unknown tar format])]) |
| 2105 |
|
| 2106 |
AC_MSG_CHECKING([how to create a $1 tar archive]) |
| 2107 |
|
| 2108 |
# Go ahead even if we have the value already cached. We do so because we |
| 2109 |
# need to set the values for the 'am__tar' and 'am__untar' variables. |
| 2110 |
_am_tools=${am_cv_prog_tar_$1-$_am_tools} |
| 2111 |
|
| 2112 |
for _am_tool in $_am_tools; do |
| 2113 |
case $_am_tool in |
| 2114 |
gnutar) |
| 2115 |
for _am_tar in tar gnutar gtar; do |
| 2116 |
AM_RUN_LOG([$_am_tar --version]) && break |
| 2117 |
done |
| 2118 |
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' |
| 2119 |
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' |
| 2120 |
am__untar="$_am_tar -xf -" |
| 2121 |
;; |
| 2122 |
plaintar) |
| 2123 |
# Must skip GNU tar: if it does not support --format= it doesn't create |
| 2124 |
# ustar tarball either. |
| 2125 |
(tar --version) >/dev/null 2>&1 && continue |
| 2126 |
am__tar='tar chf - "$$tardir"' |
| 2127 |
am__tar_='tar chf - "$tardir"' |
| 2128 |
am__untar='tar xf -' |
| 2129 |
;; |
| 2130 |
pax) |
| 2131 |
am__tar='pax -L -x $1 -w "$$tardir"' |
| 2132 |
am__tar_='pax -L -x $1 -w "$tardir"' |
| 2133 |
am__untar='pax -r' |
| 2134 |
;; |
| 2135 |
cpio) |
| 2136 |
am__tar='find "$$tardir" -print | cpio -o -H $1 -L' |
| 2137 |
am__tar_='find "$tardir" -print | cpio -o -H $1 -L' |
| 2138 |
am__untar='cpio -i -H $1 -d' |
| 2139 |
;; |
| 2140 |
none) |
| 2141 |
am__tar=false |
| 2142 |
am__tar_=false |
| 2143 |
am__untar=false |
| 2144 |
;; |
| 2145 |
esac |
| 2146 |
|
| 2147 |
# If the value was cached, stop now. We just wanted to have am__tar |
| 2148 |
# and am__untar set. |
| 2149 |
test -n "${am_cv_prog_tar_$1}" && break |
| 2150 |
|
| 2151 |
# tar/untar a dummy directory, and stop if the command works. |
| 2152 |
rm -rf conftest.dir |
| 2153 |
mkdir conftest.dir |
| 2154 |
echo GrepMe > conftest.dir/file |
| 2155 |
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) |
| 2156 |
rm -rf conftest.dir |
| 2157 |
if test -s conftest.tar; then |
| 2158 |
AM_RUN_LOG([$am__untar <conftest.tar]) |
| 2159 |
AM_RUN_LOG([cat conftest.dir/file]) |
| 2160 |
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break |
| 2161 |
fi |
| 2162 |
done |
| 2163 |
rm -rf conftest.dir |
| 2164 |
|
| 2165 |
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) |
| 2166 |
AC_MSG_RESULT([$am_cv_prog_tar_$1])]) |
| 2167 |
|
| 2168 |
AC_SUBST([am__tar]) |
| 2169 |
AC_SUBST([am__untar]) |
| 2170 |
]) # _AM_PROG_TAR |
| 2171 |
|
| 2172 |
# Copyright (C) 2022-2025 Free Software Foundation, Inc. |
| 2173 |
# |
| 2174 |
# This file is free software; the Free Software Foundation |
| 2175 |
# gives unlimited permission to copy and/or distribute it, |
| 2176 |
# with or without modifications, as long as this notice is preserved. |
| 2177 |
|
| 2178 |
# _AM_PROG_XARGS_N |
| 2179 |
# ---------------- |
| 2180 |
# Check whether 'xargs -n' works. It should work everywhere, so the fallback |
| 2181 |
# is not optimized at all as we never expect to use it. |
| 2182 |
AC_DEFUN([_AM_PROG_XARGS_N], |
| 2183 |
[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl |
| 2184 |
AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 |
| 2185 |
3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) |
| 2186 |
AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl |
| 2187 |
am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' |
| 2188 |
])dnl |
| 2189 |
AC_SUBST(am__xargs_n) |
| 2190 |
]) |
| 2191 |
|
| 2192 |
m4_include([acinclude.m4]) |