1# This file is part of Autoconf. -*- Autoconf -*- 2# Parameterized macros. 3m4_define([_AC_COPYRIGHT_YEARS], [ 4Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. 5]) 6 7# This file is part of Autoconf. This program is free 8# software; you can redistribute it and/or modify it under the 9# terms of the GNU General Public License as published by the 10# Free Software Foundation, either version 3 of the License, or 11# (at your option) any later version. 12# 13# This program is distributed in the hope that it will be useful, 14# but WITHOUT ANY WARRANTY; without even the implied warranty of 15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16# GNU General Public License for more details. 17# 18# Under Section 7 of GPL version 3, you are granted additional 19# permissions described in the Autoconf Configure Script Exception, 20# version 3.0, as published by the Free Software Foundation. 21# 22# You should have received a copy of the GNU General Public License 23# and a copy of the Autoconf Configure Script Exception along with 24# this program; see the files COPYINGv3 and COPYING.EXCEPTION 25# respectively. If not, see <http://www.gnu.org/licenses/>. 26 27# Written by David MacKenzie, with help from 28# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, 29# Roland McGrath, Noah Friedman, david d zuhn, and many others. 30 31 32## ---------------- ## 33## The diversions. ## 34## ---------------- ## 35 36 37# We heavily use m4's diversions both for the initializations and for 38# required macros (see AC_REQUIRE), because in both cases we have to 39# issue high in `configure' something which is discovered late. 40# 41# KILL is only used to suppress output. 42# 43# The layers of `configure'. We let m4 undivert them by itself, when 44# it reaches the end of `configure.ac'. 45# 46# - BINSH 47# #! /bin/sh 48# - HEADER-REVISION 49# Sent by AC_REVISION 50# - HEADER-COMMENT 51# Purpose of the script. 52# - HEADER-COPYRIGHT 53# Copyright notice(s) 54# - M4SH-INIT 55# Initialization of bottom layers. 56# 57# - DEFAULTS 58# early initializations (defaults) 59# - PARSE_ARGS 60# initialization code, option handling loop. 61# 62# - HELP_BEGIN 63# Handling `configure --help'. 64# - HELP_CANON 65# Help msg for AC_CANONICAL_* 66# - HELP_ENABLE 67# Help msg from AC_ARG_ENABLE. 68# - HELP_WITH 69# Help msg from AC_ARG_WITH. 70# - HELP_VAR 71# Help msg from AC_ARG_VAR. 72# - HELP_VAR_END 73# A small paragraph on the use of the variables. 74# - HELP_END 75# Tail of the handling of --help. 76# 77# - VERSION_BEGIN 78# Head of the handling of --version. 79# - VERSION_FSF 80# FSF copyright notice for --version. 81# - VERSION_USER 82# User copyright notice for --version. 83# - VERSION_END 84# Tail of the handling of --version. 85# 86# - SHELL_FN 87# Shell functions. 88# 89# - INIT_PREPARE 90# Tail of initialization code. 91# 92# - BODY 93# the tests and output code 94# 95 96 97# _m4_divert(DIVERSION-NAME) 98# -------------------------- 99# Convert a diversion name into its number. Otherwise, return 100# DIVERSION-NAME which is supposed to be an actual diversion number. 101# Of course it would be nicer to use m4_case here, instead of zillions 102# of little macros, but it then takes twice longer to run `autoconf'! 103# 104# From M4sugar: 105# -1. KILL 106# 10000. GROW 107# 108# From M4sh: 109# 0. BINSH 110# 1. HEADER-REVISION 111# 2. HEADER-COMMENT 112# 3. HEADER-COPYRIGHT 113# 4. M4SH-INIT 114# 1000. BODY 115m4_define([_m4_divert(DEFAULTS)], 10) 116m4_define([_m4_divert(PARSE_ARGS)], 20) 117 118m4_define([_m4_divert(HELP_BEGIN)], 100) 119m4_define([_m4_divert(HELP_CANON)], 101) 120m4_define([_m4_divert(HELP_ENABLE)], 102) 121m4_define([_m4_divert(HELP_WITH)], 103) 122m4_define([_m4_divert(HELP_VAR)], 104) 123m4_define([_m4_divert(HELP_VAR_END)], 105) 124m4_define([_m4_divert(HELP_END)], 106) 125 126m4_define([_m4_divert(VERSION_BEGIN)], 200) 127m4_define([_m4_divert(VERSION_FSF)], 201) 128m4_define([_m4_divert(VERSION_USER)], 202) 129m4_define([_m4_divert(VERSION_END)], 203) 130 131m4_define([_m4_divert(SHELL_FN)], 250) 132 133m4_define([_m4_divert(INIT_PREPARE)], 300) 134 135 136 137# AC_DIVERT_PUSH(DIVERSION-NAME) 138# AC_DIVERT_POP 139# ------------------------------ 140m4_copy([m4_divert_push],[AC_DIVERT_PUSH]) 141m4_copy([m4_divert_pop], [AC_DIVERT_POP]) 142 143 144 145## ------------------------------------ ## 146## Defining/requiring Autoconf macros. ## 147## ------------------------------------ ## 148 149 150# AC_DEFUN(NAME, EXPANSION) 151# AC_DEFUN_ONCE(NAME, EXPANSION) 152# AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) 153# AC_REQUIRE(STRING) 154# AC_PROVIDE(MACRO-NAME) 155# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) 156# ----------------------------------------------------------- 157m4_copy([m4_defun], [AC_DEFUN]) 158m4_copy([m4_defun_once], [AC_DEFUN_ONCE]) 159m4_copy([m4_before], [AC_BEFORE]) 160m4_copy([m4_require], [AC_REQUIRE]) 161m4_copy([m4_provide], [AC_PROVIDE]) 162m4_copy([m4_provide_if], [AC_PROVIDE_IFELSE]) 163 164 165# AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION]) 166# ------------------------------------------ 167m4_define([AC_OBSOLETE], 168[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])]) 169 170 171 172## ----------------------------- ## 173## Implementing shell functions. ## 174## ----------------------------- ## 175 176 177# AC_REQUIRE_SHELL_FN(NAME-TO-CHECK, COMMENT, BODY, [DIVERSION = SHELL_FN] 178# ------------------------------------------------------------------------ 179# Same as AS_REQUIRE_SHELL_FN except that the default diversion comes 180# later in the script (speeding up configure --help and --version). 181AC_DEFUN([AC_REQUIRE_SHELL_FN], 182[AS_REQUIRE_SHELL_FN([$1], [$2], [$3], m4_default_quoted([$4], [SHELL_FN]))]) 183 184 185 186## ----------------------------- ## 187## Implementing Autoconf loops. ## 188## ----------------------------- ## 189 190 191# AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION) 192# ------------------------------------------ 193AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]]) 194AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnl 195AC_DIAGNOSE([obsolete], [The macro `AC_FOREACH' is obsolete. 196You should run autoupdate.])]) 197 198 199 200## ----------------------------------- ## 201## Helping macros to display strings. ## 202## ----------------------------------- ## 203 204 205# AU::AC_HELP_STRING(LHS, RHS, [COLUMN]) 206# -------------------------------------- 207AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING]) 208 209 210 211## ---------------------------------------------- ## 212## Information on the package being Autoconf'ed. ## 213## ---------------------------------------------- ## 214 215 216# It is suggested that the macros in this section appear before 217# AC_INIT in `configure.ac'. Nevertheless, this is just stylistic, 218# and from the implementation point of view, AC_INIT *must* be expanded 219# beforehand: it puts data in diversions which must appear before the 220# data provided by the macros of this section. 221 222# The solution is to require AC_INIT in each of these macros. AC_INIT 223# has the needed magic so that it can't be expanded twice. 224 225# _AC_INIT_LITERAL(STRING) 226# ------------------------ 227# Reject STRING if it contains newline, or if it cannot be used as-is 228# in single-quoted strings, double-quoted strings, and quoted and 229# unquoted here-docs. 230m4_define([_AC_INIT_LITERAL], 231[m4_if(m4_index(m4_translit([[$1]], [ 232""], ['']), ['])AS_LITERAL_HEREDOC_IF([$1], [-]), [-1-], [], 233 [m4_warn([syntax], [AC_INIT: not a literal: $1])])]) 234 235# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME], [URL]) 236# --------------------------------------------------------------------- 237m4_define([_AC_INIT_PACKAGE], 238[_AC_INIT_LITERAL([$1]) 239_AC_INIT_LITERAL([$2]) 240_AC_INIT_LITERAL([$3]) 241m4_ifndef([AC_PACKAGE_NAME], 242 [m4_define([AC_PACKAGE_NAME], [$1])]) 243m4_ifndef([AC_PACKAGE_TARNAME], 244 [m4_define([AC_PACKAGE_TARNAME], 245 m4_default([$4], 246 [m4_bpatsubst(m4_tolower(m4_bpatsubst([[$1]], 247 [GNU ])), 248 [[^_abcdefghijklmnopqrstuvwxyz0123456789]], 249 [-])]))]) 250m4_ifndef([AC_PACKAGE_VERSION], 251 [m4_define([AC_PACKAGE_VERSION], [$2])]) 252m4_ifndef([AC_PACKAGE_STRING], 253 [m4_define([AC_PACKAGE_STRING], [$1 $2])]) 254m4_ifndef([AC_PACKAGE_BUGREPORT], 255 [m4_define([AC_PACKAGE_BUGREPORT], [$3])]) 256m4_ifndef([AC_PACKAGE_URL], 257 [m4_define([AC_PACKAGE_URL], 258 m4_if([$5], [], [m4_if(m4_index([$1], [GNU ]), [0], 259 [[http://www.gnu.org/software/]m4_defn([AC_PACKAGE_TARNAME])[/]])], 260 [[$5]]))]) 261]) 262 263 264# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER], 265# [FILTER = m4_newline]) 266# ------------------------------------------------------ 267# Emit TEXT, a copyright notice, in the top of `configure' and in 268# --version output. Macros in TEXT are evaluated once. Process 269# the --version output through FILTER (m4_newline, m4_do, and 270# m4_copyright_condense are common filters). 271m4_define([AC_COPYRIGHT], 272[AS_COPYRIGHT([$1])[]]dnl 273[m4_divert_text(m4_default_quoted([$2], [VERSION_USER]), 274[m4_default([$3], [m4_newline])([$1])])])# AC_COPYRIGHT 275 276 277# AC_REVISION(REVISION-INFO) 278# -------------------------- 279# The second quote in the translit is just to cope with font-lock-mode 280# which sees the opening of a string. 281m4_define([AC_REVISION], 282[m4_divert_text([HEADER-REVISION], 283 [@%:@ From __file__ m4_translit([$1], [$""]).])dnl 284]) 285 286 287 288 289## ---------------------------------------- ## 290## Requirements over the Autoconf version. ## 291## ---------------------------------------- ## 292 293 294# AU::AC_PREREQ(VERSION) 295# ---------------------- 296# Update this `AC_PREREQ' statement to require the current version of 297# Autoconf. But fail if ever this autoupdate is too old. 298# 299# Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before 300# calling `AU_DEFUN', i.e., it is hard coded. Otherwise it would be 301# quite complex for autoupdate to import the value of 302# `m4_PACKAGE_VERSION'. We could `AU_DEFUN' `m4_PACKAGE_VERSION', but 303# this would replace all its occurrences with the current version of 304# Autoconf, which is certainly not what the user intended. 305AU_DEFUN([AC_PREREQ], 306[m4_version_prereq([$1])[]dnl 307[AC_PREREQ(]]m4_dquote(m4_dquote(m4_defn([m4_PACKAGE_VERSION])))[[)]]) 308 309 310# AC_PREREQ(VERSION) 311# ------------------ 312# Complain and exit if the Autoconf version is less than VERSION. 313m4_undefine([AC_PREREQ]) 314m4_copy([m4_version_prereq], [AC_PREREQ]) 315 316 317# AC_AUTOCONF_VERSION 318# ------------------- 319# The current version of Autoconf parsing this file. 320m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION]) 321 322 323 324 325 326## ---------------- ## 327## Initialization. ## 328## ---------------- ## 329 330 331# All the following macros are used by AC_INIT. Ideally, they should 332# be presented in the order in which they are output. Please, help us 333# sorting it, or at least, don't augment the entropy. 334 335 336# _AC_INIT_NOTICE 337# --------------- 338# Provide useful headers; override the HEADER-COMMENT created by M4sh. 339m4_define([_AC_INIT_NOTICE], 340[m4_cleardivert([HEADER-COMMENT])]dnl 341[m4_divert_text([HEADER-COMMENT], 342[@%:@ Guess values for system-dependent variables and create Makefiles. 343@%:@ Generated by m4_PACKAGE_STRING[]dnl 344m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).]) 345 346m4_ifset([AC_PACKAGE_BUGREPORT], 347 [m4_divert_text([HEADER-COMMENT], 348 [@%:@ 349@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])]) 350]) 351 352 353# _AC_INIT_COPYRIGHT 354# ------------------ 355# We dump to VERSION_FSF to make sure we are inserted before the 356# user copyrights, and after the setup of the --version handling. 357m4_define([_AC_INIT_COPYRIGHT], 358[AC_COPYRIGHT(m4_defn([_AC_COPYRIGHT_YEARS]), [VERSION_FSF], [ 359m4_copyright_condense])dnl 360AC_COPYRIGHT( 361[This configure script is free software; the Free Software Foundation 362gives unlimited permission to copy, distribute and modify it.], 363 [VERSION_FSF], [m4_echo])]) 364 365 366# File Descriptors 367# ---------------- 368# Set up the file descriptors used by `configure'. 369# File descriptor usage: 370# 0 standard input (/dev/null) 371# 1 file creation 372# 2 errors and warnings 373# AS_MESSAGE_LOG_FD compiler messages saved in config.log 374# AS_MESSAGE_FD checking for... messages and results 375# AS_ORIGINAL_STDIN_FD original standard input (still open) 376# 377# stdin is /dev/null because checks that run programs may 378# inadvertently run interactive ones, which would stop configuration 379# until someone typed an EOF. 380m4_define([AS_MESSAGE_FD], 6) 381m4_define([AS_ORIGINAL_STDIN_FD], 7) 382# That's how they used to be named. 383AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD]) 384AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD]) 385 386 387# _AC_INIT_DEFAULTS 388# ----------------- 389# Values which defaults can be set from `configure.ac'. 390# `/bin/machine' is used in `glibcbug'. The others are used in config.* 391m4_define([_AC_INIT_DEFAULTS], 392[m4_divert_push([DEFAULTS])dnl 393 394test -n "$DJDIR" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null 395exec AS_MESSAGE_FD>&1 396 397# Name of the host. 398# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, 399# so uname gets run too. 400ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` 401 402# 403# Initializations. 404# 405ac_default_prefix=/usr/local 406ac_clean_files= 407ac_config_libobj_dir=. 408LIB@&t@OBJS= 409cross_compiling=no 410subdirs= 411MFLAGS= 412MAKEFLAGS= 413AC_SUBST([SHELL])dnl 414AC_SUBST([PATH_SEPARATOR])dnl 415 416# Identity of this package. 417AC_SUBST([PACKAGE_NAME], 418 [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnl 419AC_SUBST([PACKAGE_TARNAME], 420 [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl 421AC_SUBST([PACKAGE_VERSION], 422 [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])dnl 423AC_SUBST([PACKAGE_STRING], 424 [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl 425AC_SUBST([PACKAGE_BUGREPORT], 426 [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl 427AC_SUBST([PACKAGE_URL], 428 [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])dnl 429 430m4_divert_pop([DEFAULTS])dnl 431m4_wrap_lifo([m4_divert_text([DEFAULTS], 432[ac_subst_vars='m4_set_dump([_AC_SUBST_VARS], m4_newline)' 433ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])' 434ac_user_opts=' 435enable_option_checking 436m4_ifdef([_AC_USER_OPTS], [m4_defn([_AC_USER_OPTS]) 437])' 438m4_ifdef([_AC_PRECIOUS_VARS], 439 [_AC_ARG_VAR_STORE[]dnl 440 _AC_ARG_VAR_VALIDATE[]dnl 441 ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])']) 442m4_ifdef([_AC_LIST_SUBDIRS], 443 [ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl 444])])dnl 445])# _AC_INIT_DEFAULTS 446 447 448# AC_PREFIX_DEFAULT(PREFIX) 449# ------------------------- 450AC_DEFUN([AC_PREFIX_DEFAULT], 451[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])]) 452 453 454# AC_PREFIX_PROGRAM(PROGRAM) 455# -------------------------- 456# Guess the value for the `prefix' variable by looking for 457# the argument program along PATH and taking its parent. 458# Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, 459# set `prefix' to /usr/local/gnu. 460# This comes too late to find a site file based on the prefix, 461# and it might use a cached value for the path. 462# No big loss, I think, since most configures don't use this macro anyway. 463AC_DEFUN([AC_PREFIX_PROGRAM], 464[if test "x$prefix" = xNONE; then 465dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. 466 _AS_ECHO_N([checking for prefix by ]) 467 AC_PATH_PROG(ac_prefix_program, [$1]) 468 if test -n "$ac_prefix_program"; then 469 prefix=`AS_DIRNAME(["$ac_prefix_program"])` 470 prefix=`AS_DIRNAME(["$prefix"])` 471 fi 472fi 473])# AC_PREFIX_PROGRAM 474 475 476# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR]) 477# --------------------------------------------- 478# UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package, 479# relative to the directory that configure is in, which we can look 480# for to find out if srcdir is correct. 481AC_DEFUN([AC_CONFIG_SRCDIR], 482[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])]) 483 484 485# _AC_INIT_DIRCHECK 486# ----------------- 487# Set ac_pwd, and sanity-check it and the source and installation directories. 488# 489# (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.) 490# 491AC_DEFUN([_AC_INIT_DIRCHECK], 492[m4_divert_push([PARSE_ARGS])dnl 493 494ac_pwd=`pwd` && test -n "$ac_pwd" && 495ac_ls_di=`ls -di .` && 496ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || 497 AC_MSG_ERROR([working directory cannot be determined]) 498test "X$ac_ls_di" = "X$ac_pwd_ls_di" || 499 AC_MSG_ERROR([pwd does not report name of working directory]) 500 501m4_divert_pop([PARSE_ARGS])dnl 502])# _AC_INIT_DIRCHECK 503 504# _AC_INIT_SRCDIR 505# --------------- 506# Compute `srcdir' based on `$ac_unique_file'. 507# 508# (We have to AC_DEFUN it, since we use AC_REQUIRE.) 509# 510AC_DEFUN([_AC_INIT_SRCDIR], 511[AC_REQUIRE([_AC_INIT_DIRCHECK])dnl 512m4_divert_push([PARSE_ARGS])dnl 513 514# Find the source files, if location was not specified. 515if test -z "$srcdir"; then 516 ac_srcdir_defaulted=yes 517 # Try the directory containing this script, then the parent directory. 518 ac_confdir=`AS_DIRNAME(["$as_myself"])` 519 srcdir=$ac_confdir 520 if test ! -r "$srcdir/$ac_unique_file"; then 521 srcdir=.. 522 fi 523else 524 ac_srcdir_defaulted=no 525fi 526if test ! -r "$srcdir/$ac_unique_file"; then 527 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." 528 AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir]) 529fi 530ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" 531ac_abs_confdir=`( 532 cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg]) 533 pwd)` 534# When building in place, set srcdir=. 535if test "$ac_abs_confdir" = "$ac_pwd"; then 536 srcdir=. 537fi 538# Remove unnecessary trailing slashes from srcdir. 539# Double slashes in file names in object file debugging info 540# mess up M-x gdb in Emacs. 541case $srcdir in 542*/) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;; 543esac 544m4_divert_pop([PARSE_ARGS])dnl 545])# _AC_INIT_SRCDIR 546 547 548# _AC_INIT_PARSE_ARGS 549# ------------------- 550m4_define([_AC_INIT_PARSE_ARGS], 551[m4_divert_push([PARSE_ARGS])dnl 552 553# Initialize some variables set by options. 554ac_init_help= 555ac_init_version=false 556ac_unrecognized_opts= 557ac_unrecognized_sep= 558# The variables have the same names as the options, with 559# dashes changed to underlines. 560cache_file=/dev/null 561AC_SUBST(exec_prefix, NONE)dnl 562no_create= 563no_recursion= 564AC_SUBST(prefix, NONE)dnl 565program_prefix=NONE 566program_suffix=NONE 567AC_SUBST(program_transform_name, [s,x,x,])dnl 568silent= 569site= 570srcdir= 571verbose= 572x_includes=NONE 573x_libraries=NONE 574 575# Installation directory options. 576# These are left unexpanded so users can "make install exec_prefix=/foo" 577# and all the variables that are supposed to be based on exec_prefix 578# by default will actually change. 579# Use braces instead of parens because sh, perl, etc. also accept them. 580# (The list follows the same order as the GNU Coding Standards.) 581AC_SUBST([bindir], ['${exec_prefix}/bin'])dnl 582AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl 583AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])dnl 584AC_SUBST([datarootdir], ['${prefix}/share'])dnl 585AC_SUBST([datadir], ['${datarootdir}'])dnl 586AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl 587AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl 588AC_SUBST([localstatedir], ['${prefix}/var'])dnl 589AC_SUBST([includedir], ['${prefix}/include'])dnl 590AC_SUBST([oldincludedir], ['/usr/include'])dnl 591AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], 592 ['${datarootdir}/doc/${PACKAGE_TARNAME}'], 593 ['${datarootdir}/doc/${PACKAGE}'])])dnl 594AC_SUBST([infodir], ['${datarootdir}/info'])dnl 595AC_SUBST([htmldir], ['${docdir}'])dnl 596AC_SUBST([dvidir], ['${docdir}'])dnl 597AC_SUBST([pdfdir], ['${docdir}'])dnl 598AC_SUBST([psdir], ['${docdir}'])dnl 599AC_SUBST([libdir], ['${exec_prefix}/lib'])dnl 600AC_SUBST([localedir], ['${datarootdir}/locale'])dnl 601AC_SUBST([mandir], ['${datarootdir}/man'])dnl 602 603ac_prev= 604ac_dashdash= 605for ac_option 606do 607 # If the previous option needs an argument, assign it. 608 if test -n "$ac_prev"; then 609 eval $ac_prev=\$ac_option 610 ac_prev= 611 continue 612 fi 613 614 case $ac_option in 615 *=?*) ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;; 616 *=) ac_optarg= ;; 617 *) ac_optarg=yes ;; 618 esac 619 620 # Accept the important Cygnus configure options, so we can diagnose typos. 621 622 case $ac_dashdash$ac_option in 623 --) 624 ac_dashdash=yes ;; 625 626 -bindir | --bindir | --bindi | --bind | --bin | --bi) 627 ac_prev=bindir ;; 628 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) 629 bindir=$ac_optarg ;; 630 631 -build | --build | --buil | --bui | --bu) 632 ac_prev=build_alias ;; 633 -build=* | --build=* | --buil=* | --bui=* | --bu=*) 634 build_alias=$ac_optarg ;; 635 636 -cache-file | --cache-file | --cache-fil | --cache-fi \ 637 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) 638 ac_prev=cache_file ;; 639 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ 640 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) 641 cache_file=$ac_optarg ;; 642 643 --config-cache | -C) 644 cache_file=config.cache ;; 645 646 -datadir | --datadir | --datadi | --datad) 647 ac_prev=datadir ;; 648 -datadir=* | --datadir=* | --datadi=* | --datad=*) 649 datadir=$ac_optarg ;; 650 651 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ 652 | --dataroo | --dataro | --datar) 653 ac_prev=datarootdir ;; 654 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ 655 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) 656 datarootdir=$ac_optarg ;; 657 658 _AC_INIT_PARSE_ENABLE([disable]) 659 660 -docdir | --docdir | --docdi | --doc | --do) 661 ac_prev=docdir ;; 662 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) 663 docdir=$ac_optarg ;; 664 665 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) 666 ac_prev=dvidir ;; 667 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) 668 dvidir=$ac_optarg ;; 669 670 _AC_INIT_PARSE_ENABLE([enable]) 671 672 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ 673 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ 674 | --exec | --exe | --ex) 675 ac_prev=exec_prefix ;; 676 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ 677 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ 678 | --exec=* | --exe=* | --ex=*) 679 exec_prefix=$ac_optarg ;; 680 681 -gas | --gas | --ga | --g) 682 # Obsolete; use --with-gas. 683 with_gas=yes ;; 684 685 -help | --help | --hel | --he | -h) 686 ac_init_help=long ;; 687 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) 688 ac_init_help=recursive ;; 689 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) 690 ac_init_help=short ;; 691 692 -host | --host | --hos | --ho) 693 ac_prev=host_alias ;; 694 -host=* | --host=* | --hos=* | --ho=*) 695 host_alias=$ac_optarg ;; 696 697 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) 698 ac_prev=htmldir ;; 699 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ 700 | --ht=*) 701 htmldir=$ac_optarg ;; 702 703 -includedir | --includedir | --includedi | --included | --include \ 704 | --includ | --inclu | --incl | --inc) 705 ac_prev=includedir ;; 706 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ 707 | --includ=* | --inclu=* | --incl=* | --inc=*) 708 includedir=$ac_optarg ;; 709 710 -infodir | --infodir | --infodi | --infod | --info | --inf) 711 ac_prev=infodir ;; 712 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) 713 infodir=$ac_optarg ;; 714 715 -libdir | --libdir | --libdi | --libd) 716 ac_prev=libdir ;; 717 -libdir=* | --libdir=* | --libdi=* | --libd=*) 718 libdir=$ac_optarg ;; 719 720 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ 721 | --libexe | --libex | --libe) 722 ac_prev=libexecdir ;; 723 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ 724 | --libexe=* | --libex=* | --libe=*) 725 libexecdir=$ac_optarg ;; 726 727 -localedir | --localedir | --localedi | --localed | --locale) 728 ac_prev=localedir ;; 729 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) 730 localedir=$ac_optarg ;; 731 732 -localstatedir | --localstatedir | --localstatedi | --localstated \ 733 | --localstate | --localstat | --localsta | --localst | --locals) 734 ac_prev=localstatedir ;; 735 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ 736 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 737 localstatedir=$ac_optarg ;; 738 739 -mandir | --mandir | --mandi | --mand | --man | --ma | --m) 740 ac_prev=mandir ;; 741 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) 742 mandir=$ac_optarg ;; 743 744 -nfp | --nfp | --nf) 745 # Obsolete; use --without-fp. 746 with_fp=no ;; 747 748 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ 749 | --no-cr | --no-c | -n) 750 no_create=yes ;; 751 752 -no-recursion | --no-recursion | --no-recursio | --no-recursi \ 753 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) 754 no_recursion=yes ;; 755 756 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ 757 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ 758 | --oldin | --oldi | --old | --ol | --o) 759 ac_prev=oldincludedir ;; 760 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ 761 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ 762 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) 763 oldincludedir=$ac_optarg ;; 764 765 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) 766 ac_prev=prefix ;; 767 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) 768 prefix=$ac_optarg ;; 769 770 -program-prefix | --program-prefix | --program-prefi | --program-pref \ 771 | --program-pre | --program-pr | --program-p) 772 ac_prev=program_prefix ;; 773 -program-prefix=* | --program-prefix=* | --program-prefi=* \ 774 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) 775 program_prefix=$ac_optarg ;; 776 777 -program-suffix | --program-suffix | --program-suffi | --program-suff \ 778 | --program-suf | --program-su | --program-s) 779 ac_prev=program_suffix ;; 780 -program-suffix=* | --program-suffix=* | --program-suffi=* \ 781 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) 782 program_suffix=$ac_optarg ;; 783 784 -program-transform-name | --program-transform-name \ 785 | --program-transform-nam | --program-transform-na \ 786 | --program-transform-n | --program-transform- \ 787 | --program-transform | --program-transfor \ 788 | --program-transfo | --program-transf \ 789 | --program-trans | --program-tran \ 790 | --progr-tra | --program-tr | --program-t) 791 ac_prev=program_transform_name ;; 792 -program-transform-name=* | --program-transform-name=* \ 793 | --program-transform-nam=* | --program-transform-na=* \ 794 | --program-transform-n=* | --program-transform-=* \ 795 | --program-transform=* | --program-transfor=* \ 796 | --program-transfo=* | --program-transf=* \ 797 | --program-trans=* | --program-tran=* \ 798 | --progr-tra=* | --program-tr=* | --program-t=*) 799 program_transform_name=$ac_optarg ;; 800 801 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) 802 ac_prev=pdfdir ;; 803 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) 804 pdfdir=$ac_optarg ;; 805 806 -psdir | --psdir | --psdi | --psd | --ps) 807 ac_prev=psdir ;; 808 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) 809 psdir=$ac_optarg ;; 810 811 -q | -quiet | --quiet | --quie | --qui | --qu | --q \ 812 | -silent | --silent | --silen | --sile | --sil) 813 silent=yes ;; 814 815 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 816 ac_prev=sbindir ;; 817 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ 818 | --sbi=* | --sb=*) 819 sbindir=$ac_optarg ;; 820 821 -sharedstatedir | --sharedstatedir | --sharedstatedi \ 822 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ 823 | --sharedst | --shareds | --shared | --share | --shar \ 824 | --sha | --sh) 825 ac_prev=sharedstatedir ;; 826 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ 827 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ 828 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ 829 | --sha=* | --sh=*) 830 sharedstatedir=$ac_optarg ;; 831 832 -site | --site | --sit) 833 ac_prev=site ;; 834 -site=* | --site=* | --sit=*) 835 site=$ac_optarg ;; 836 837 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) 838 ac_prev=srcdir ;; 839 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) 840 srcdir=$ac_optarg ;; 841 842 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ 843 | --syscon | --sysco | --sysc | --sys | --sy) 844 ac_prev=sysconfdir ;; 845 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ 846 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) 847 sysconfdir=$ac_optarg ;; 848 849 -target | --target | --targe | --targ | --tar | --ta | --t) 850 ac_prev=target_alias ;; 851 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) 852 target_alias=$ac_optarg ;; 853 854 -v | -verbose | --verbose | --verbos | --verbo | --verb) 855 verbose=yes ;; 856 857 -version | --version | --versio | --versi | --vers | -V) 858 ac_init_version=: ;; 859 860 _AC_INIT_PARSE_ENABLE([with]) 861 862 _AC_INIT_PARSE_ENABLE([without]) 863 864 --x) 865 # Obsolete; use --with-x. 866 with_x=yes ;; 867 868 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ 869 | --x-incl | --x-inc | --x-in | --x-i) 870 ac_prev=x_includes ;; 871 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ 872 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) 873 x_includes=$ac_optarg ;; 874 875 -x-libraries | --x-libraries | --x-librarie | --x-librari \ 876 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) 877 ac_prev=x_libraries ;; 878 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ 879 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) 880 x_libraries=$ac_optarg ;; 881 882 -*) AC_MSG_ERROR([unrecognized option: `$ac_option' 883Try `$[0] --help' for more information]) 884 ;; 885 886 *=*) 887 ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='` 888 # Reject names that are not valid shell variable names. 889 case $ac_envvar in #( 890 '' | [[0-9]]* | *[[!_$as_cr_alnum]]* ) 891 AC_MSG_ERROR([invalid variable name: `$ac_envvar']) ;; 892 esac 893 eval $ac_envvar=\$ac_optarg 894 export $ac_envvar ;; 895 896 *) 897 # FIXME: should be removed in autoconf 3.0. 898 AC_MSG_WARN([you should use --build, --host, --target]) 899 expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null && 900 AC_MSG_WARN([invalid host type: $ac_option]) 901 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" 902 ;; 903 904 esac 905done 906 907if test -n "$ac_prev"; then 908 ac_option=--`echo $ac_prev | sed 's/_/-/g'` 909 AC_MSG_ERROR([missing argument to $ac_option]) 910fi 911 912if test -n "$ac_unrecognized_opts"; then 913 case $enable_option_checking in 914 no) ;; 915 fatal) AC_MSG_ERROR([unrecognized options: $ac_unrecognized_opts]) ;; 916 *) AC_MSG_WARN( [unrecognized options: $ac_unrecognized_opts]) ;; 917 esac 918fi 919 920# Check all directory arguments for consistency. 921for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ 922 datadir sysconfdir sharedstatedir localstatedir includedir \ 923 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ 924 libdir localedir mandir 925do 926 eval ac_val=\$$ac_var 927 # Remove trailing slashes. 928 case $ac_val in 929 */ ) 930 ac_val=`expr "X$ac_val" : 'X\(.*[[^/]]\)' \| "X$ac_val" : 'X\(.*\)'` 931 eval $ac_var=\$ac_val;; 932 esac 933 # Be sure to have absolute directory names. 934 case $ac_val in 935 [[\\/$]]* | ?:[[\\/]]* ) continue;; 936 NONE | '' ) case $ac_var in *prefix ) continue;; esac;; 937 esac 938 AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]) 939done 940 941# There might be people who depend on the old broken behavior: `$host' 942# used to hold the argument of --host etc. 943# FIXME: To remove some day. 944build=$build_alias 945host=$host_alias 946target=$target_alias 947 948# FIXME: To remove some day. 949if test "x$host_alias" != x; then 950 if test "x$build_alias" = x; then 951 cross_compiling=maybe 952 elif test "x$build_alias" != "x$host_alias"; then 953 cross_compiling=yes 954 fi 955fi 956 957ac_tool_prefix= 958test -n "$host_alias" && ac_tool_prefix=$host_alias- 959 960test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null 961 962m4_divert_pop([PARSE_ARGS])dnl 963])# _AC_INIT_PARSE_ARGS 964 965 966# _AC_INIT_PARSE_ENABLE(OPTION-NAME) 967# ---------------------------------- 968# A trivial front-end for _AC_INIT_PARSE_ENABLE2. 969# 970m4_define([_AC_INIT_PARSE_ENABLE], 971[m4_bmatch([$1], [^with], 972 [_AC_INIT_PARSE_ENABLE2([$1], [with])], 973 [_AC_INIT_PARSE_ENABLE2([$1], [enable])])]) 974 975 976# _AC_INIT_PARSE_ENABLE2(OPTION-NAME, POSITIVE-NAME) 977# -------------------------------------------------- 978# Handle an `--enable' or a `--with' option. 979# 980# OPTION-NAME is `enable', `disable', `with', or `without'. 981# POSITIVE-NAME is the corresponding positive variant, i.e. `enable' or `with'. 982# 983# Positive variant of the option is recognized by the condition 984# OPTION-NAME == POSITIVE-NAME . 985# 986m4_define([_AC_INIT_PARSE_ENABLE2], 987[-$1-* | --$1-*) 988 ac_useropt=`expr "x$ac_option" : 'x-*$1-\(m4_if([$1], [$2], [[[^=]]], [.])*\)'` 989 # Reject names that are not valid shell variable names. 990 expr "x$ac_useropt" : "[.*[^-+._$as_cr_alnum]]" >/dev/null && 991 AC_MSG_ERROR( 992 [invalid ]m4_if([$2], [with], [package], [feature])[ name: $ac_useropt]) 993 ac_useropt_orig=$ac_useropt 994 ac_useropt=`AS_ECHO(["$ac_useropt"]) | sed 's/[[-+.]]/_/g'` 995 case $ac_user_opts in 996 *" 997"$2_$ac_useropt" 998"*) ;; 999 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--$1-$ac_useropt_orig" 1000 ac_unrecognized_sep=', ';; 1001 esac 1002 eval $2_$ac_useropt=m4_if([$1], [$2], [\$ac_optarg], [no]) ;;dnl 1003]) 1004 1005 1006# _AC_INIT_HELP 1007# ------------- 1008# Handle the `configure --help' message. 1009m4_define([_AC_INIT_HELP], 1010[m4_divert_push([HELP_BEGIN])dnl 1011 1012# 1013# Report the --help message. 1014# 1015if test "$ac_init_help" = "long"; then 1016 # Omit some internal or obsolete options to make the list less imposing. 1017 # This message is too long to be a string in the A/UX 3.1 sh. 1018 cat <<_ACEOF 1019\`configure' configures m4_ifset([AC_PACKAGE_STRING], 1020 [AC_PACKAGE_STRING], 1021 [this package]) to adapt to many kinds of systems. 1022 1023Usage: $[0] [[OPTION]]... [[VAR=VALUE]]... 1024 1025[To assign environment variables (e.g., CC, CFLAGS...), specify them as 1026VAR=VALUE. See below for descriptions of some of the useful variables. 1027 1028Defaults for the options are specified in brackets. 1029 1030Configuration: 1031 -h, --help display this help and exit 1032 --help=short display options specific to this package 1033 --help=recursive display the short help of all the included packages 1034 -V, --version display version information and exit 1035 -q, --quiet, --silent do not print \`checking ...' messages 1036 --cache-file=FILE cache test results in FILE [disabled] 1037 -C, --config-cache alias for \`--cache-file=config.cache' 1038 -n, --no-create do not create output files 1039 --srcdir=DIR find the sources in DIR [configure dir or \`..'] 1040 1041Installation directories: 1042]AS_HELP_STRING([--prefix=PREFIX], 1043 [install architecture-independent files in PREFIX [$ac_default_prefix]]) 1044AS_HELP_STRING([--exec-prefix=EPREFIX], 1045 [install architecture-dependent files in EPREFIX [PREFIX]])[ 1046 1047By default, \`make install' will install all the files in 1048\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify 1049an installation prefix other than \`$ac_default_prefix' using \`--prefix', 1050for instance \`--prefix=\$HOME'. 1051 1052For better control, use the options below. 1053 1054Fine tuning of the installation directories: 1055 --bindir=DIR user executables [EPREFIX/bin] 1056 --sbindir=DIR system admin executables [EPREFIX/sbin] 1057 --libexecdir=DIR program executables [EPREFIX/libexec] 1058 --sysconfdir=DIR read-only single-machine data [PREFIX/etc] 1059 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] 1060 --localstatedir=DIR modifiable single-machine data [PREFIX/var] 1061 --libdir=DIR object code libraries [EPREFIX/lib] 1062 --includedir=DIR C header files [PREFIX/include] 1063 --oldincludedir=DIR C header files for non-gcc [/usr/include] 1064 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] 1065 --datadir=DIR read-only architecture-independent data [DATAROOTDIR] 1066 --infodir=DIR info documentation [DATAROOTDIR/info] 1067 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] 1068 --mandir=DIR man documentation [DATAROOTDIR/man] 1069]AS_HELP_STRING([--docdir=DIR], 1070 [documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME], 1071 [AC_PACKAGE_TARNAME], [PACKAGE])@:>@)[ 1072 --htmldir=DIR html documentation [DOCDIR] 1073 --dvidir=DIR dvi documentation [DOCDIR] 1074 --pdfdir=DIR pdf documentation [DOCDIR] 1075 --psdir=DIR ps documentation [DOCDIR] 1076_ACEOF 1077 1078 cat <<\_ACEOF] 1079m4_divert_pop([HELP_BEGIN])dnl 1080dnl The order of the diversions here is 1081dnl - HELP_BEGIN 1082dnl which may be extended by extra generic options such as with X or 1083dnl AC_ARG_PROGRAM. Displayed only in long --help. 1084dnl 1085dnl - HELP_CANON 1086dnl Support for cross compilation (--build, --host and --target). 1087dnl Display only in long --help. 1088dnl 1089dnl - HELP_ENABLE 1090dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section, 1091dnl then implements the header of the non generic options. 1092dnl 1093dnl - HELP_WITH 1094dnl 1095dnl - HELP_VAR 1096dnl 1097dnl - HELP_VAR_END 1098dnl 1099dnl - HELP_END 1100dnl initialized below, in which we dump the trailer (handling of the 1101dnl recursion for instance). 1102m4_divert_push([HELP_ENABLE])dnl 1103_ACEOF 1104fi 1105 1106if test -n "$ac_init_help"; then 1107m4_ifset([AC_PACKAGE_STRING], 1108[ case $ac_init_help in 1109 short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";; 1110 esac]) 1111 cat <<\_ACEOF 1112m4_divert_pop([HELP_ENABLE])dnl 1113m4_divert_push([HELP_END])dnl 1114 1115Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>], 1116 [the package provider]).dnl 1117m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [ 1118AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl 1119m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [ 1120General help using GNU software: <http://www.gnu.org/gethelp/>.])]) 1121_ACEOF 1122ac_status=$? 1123fi 1124 1125if test "$ac_init_help" = "recursive"; then 1126 # If there are subdirs, report their specific --help. 1127 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue 1128 test -d "$ac_dir" || 1129 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || 1130 continue 1131 _AC_SRCDIRS(["$ac_dir"]) 1132 cd "$ac_dir" || { ac_status=$?; continue; } 1133 # Check for guested configure. 1134 if test -f "$ac_srcdir/configure.gnu"; then 1135 echo && 1136 $SHELL "$ac_srcdir/configure.gnu" --help=recursive 1137 elif test -f "$ac_srcdir/configure"; then 1138 echo && 1139 $SHELL "$ac_srcdir/configure" --help=recursive 1140 else 1141 AC_MSG_WARN([no configuration information is in $ac_dir]) 1142 fi || ac_status=$? 1143 cd "$ac_pwd" || { ac_status=$?; break; } 1144 done 1145fi 1146 1147test -n "$ac_init_help" && exit $ac_status 1148m4_divert_pop([HELP_END])dnl 1149])# _AC_INIT_HELP 1150 1151 1152# _AC_INIT_VERSION 1153# ---------------- 1154# Handle the `configure --version' message. 1155m4_define([_AC_INIT_VERSION], 1156[m4_divert_text([VERSION_BEGIN], 1157[if $ac_init_version; then 1158 cat <<\_ACEOF 1159m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl 1160m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) 1161generated by m4_PACKAGE_STRING]) 1162m4_divert_text([VERSION_END], 1163[_ACEOF 1164 exit 1165fi])dnl 1166])# _AC_INIT_VERSION 1167 1168 1169# _AC_INIT_CONFIG_LOG 1170# ------------------- 1171# Initialize the config.log file descriptor and write header to it. 1172m4_define([_AC_INIT_CONFIG_LOG], 1173[m4_divert_text([INIT_PREPARE], 1174[m4_define([AS_MESSAGE_LOG_FD], 5)dnl 1175cat >config.log <<_ACEOF 1176This file contains any messages produced by compilers while 1177running configure, to aid debugging if configure makes a mistake. 1178 1179It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl 1180$as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was 1181generated by m4_PACKAGE_STRING. Invocation command line was 1182 1183 $ $[0] $[@] 1184 1185_ACEOF 1186exec AS_MESSAGE_LOG_FD>>config.log 1187AS_UNAME >&AS_MESSAGE_LOG_FD 1188 1189cat >&AS_MESSAGE_LOG_FD <<_ACEOF 1190 1191 1192m4_text_box([Core tests.]) 1193 1194_ACEOF 1195])])# _AC_INIT_CONFIG_LOG 1196 1197 1198# _AC_INIT_PREPARE 1199# ---------------- 1200# Called by AC_INIT to build the preamble of the `configure' scripts. 1201# 1. Trap and clean up various tmp files. 1202# 2. Set up the fd and output files 1203# 3. Remember the options given to `configure' for `config.status --recheck'. 1204# 4. Initiates confdefs.h 1205# 5. Loads site and cache files 1206m4_define([_AC_INIT_PREPARE], 1207[m4_divert_push([INIT_PREPARE])dnl 1208 1209# Keep a trace of the command line. 1210# Strip out --no-create and --no-recursion so they do not pile up. 1211# Strip out --silent because we don't want to record it for future runs. 1212# Also quote any args containing shell meta-characters. 1213# Make two passes to allow for proper duplicate-argument suppression. 1214ac_configure_args= 1215ac_configure_args0= 1216ac_configure_args1= 1217ac_must_keep_next=false 1218for ac_pass in 1 2 1219do 1220 for ac_arg 1221 do 1222 case $ac_arg in 1223 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; 1224 -q | -quiet | --quiet | --quie | --qui | --qu | --q \ 1225 | -silent | --silent | --silen | --sile | --sil) 1226 continue ;; 1227 *\'*) 1228 ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;; 1229 esac 1230 case $ac_pass in 1231 1) AS_VAR_APPEND([ac_configure_args0], [" '$ac_arg'"]) ;; 1232 2) 1233 AS_VAR_APPEND([ac_configure_args1], [" '$ac_arg'"]) 1234dnl If trying to remove duplicates, be sure to (i) keep the *last* 1235dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only), 1236dnl and (ii) not to strip long options (--prefix foo --prefix bar might 1237dnl give --prefix foo bar). 1238 if test $ac_must_keep_next = true; then 1239 ac_must_keep_next=false # Got value, back to normal. 1240 else 1241 case $ac_arg in 1242dnl Use broad patterns, as arguments that would have already made configure 1243dnl exit don't matter. 1244 *=* | --config-cache | -C | -disable-* | --disable-* \ 1245 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ 1246 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ 1247 | -with-* | --with-* | -without-* | --without-* | --x) 1248 case "$ac_configure_args0 " in 1249 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; 1250 esac 1251 ;; 1252 -* ) ac_must_keep_next=true ;; 1253 esac 1254 fi 1255 AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) 1256 ;; 1257 esac 1258 done 1259done 1260AS_UNSET(ac_configure_args0) 1261AS_UNSET(ac_configure_args1) 1262 1263# When interrupted or exit'd, cleanup temporary files, and complete 1264# config.log. We remove comments because anyway the quotes in there 1265# would cause problems or look ugly. 1266# WARNING: Use '\'' to represent an apostrophe within the trap. 1267# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 1268trap 'exit_status=$? 1269 # Save into config.log some information that might help in debugging. 1270 { 1271 echo 1272 1273 AS_BOX([Cache variables.]) 1274 echo 1275 m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]), 1276 [^ *\(#.*\)? 1277], [], 1278 ['], ['\\'']) 1279 echo 1280 1281 AS_BOX([Output variables.]) 1282 echo 1283 for ac_var in $ac_subst_vars 1284 do 1285 eval ac_val=\$$ac_var 1286 case $ac_val in 1287 *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; 1288 esac 1289 AS_ECHO(["$ac_var='\''$ac_val'\''"]) 1290 done | sort 1291 echo 1292 1293 if test -n "$ac_subst_files"; then 1294 AS_BOX([File substitutions.]) 1295 echo 1296 for ac_var in $ac_subst_files 1297 do 1298 eval ac_val=\$$ac_var 1299 case $ac_val in 1300 *\'\''*) ac_val=`AS_ECHO(["$ac_val"]) | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; 1301 esac 1302 AS_ECHO(["$ac_var='\''$ac_val'\''"]) 1303 done | sort 1304 echo 1305 fi 1306 1307 if test -s confdefs.h; then 1308 AS_BOX([confdefs.h.]) 1309 echo 1310 cat confdefs.h 1311 echo 1312 fi 1313 test "$ac_signal" != 0 && 1314 AS_ECHO(["$as_me: caught signal $ac_signal"]) 1315 AS_ECHO(["$as_me: exit $exit_status"]) 1316 } >&AS_MESSAGE_LOG_FD 1317 rm -f core *.core core.conftest.* && 1318 rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files && 1319 exit $exit_status 1320' 0 1321for ac_signal in 1 2 13 15; do 1322 trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal 1323done 1324ac_signal=0 1325 1326# confdefs.h avoids OS command line length limits that DEFS can exceed. 1327rm -f -r conftest* confdefs.h 1328 1329dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file 1330dnl containing less than 14 bytes (including the newline). 1331AS_ECHO(["/* confdefs.h */"]) > confdefs.h 1332 1333# Predefined preprocessor variables. 1334AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"], 1335 [Define to the full name of this package.])dnl 1336AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"], 1337 [Define to the one symbol short name of this package.])dnl 1338AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"], 1339 [Define to the version of this package.])dnl 1340AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"], 1341 [Define to the full name and version of this package.])dnl 1342AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"], 1343 [Define to the address where bug reports for this package 1344 should be sent.])dnl 1345AC_DEFINE_UNQUOTED([PACKAGE_URL], ["$PACKAGE_URL"], 1346 [Define to the home page for this package.]) 1347 1348# Let the site file select an alternate cache file if it wants to. 1349AC_SITE_LOAD 1350AC_CACHE_LOAD 1351m4_divert_pop([INIT_PREPARE])dnl 1352])# _AC_INIT_PREPARE 1353 1354 1355# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR]) 1356# ---------------------------------------- 1357# This macro is used only for Autoupdate. 1358AU_DEFUN([AC_INIT], 1359[m4_ifval([$2], [[AC_INIT($@)]], 1360 [m4_ifval([$1], 1361[[AC_INIT] 1362AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl 1363]) 1364 1365 1366# AC_INIT([PACKAGE, VERSION, [BUG-REPORT], [TARNAME], [URL]) 1367# ---------------------------------------------------------- 1368# Include the user macro files, prepare the diversions, and output the 1369# preamble of the `configure' script. 1370# 1371# If BUG-REPORT is omitted, do without (unless the user previously 1372# defined the m4 macro AC_PACKAGE_BUGREPORT). If TARNAME is omitted, 1373# use PACKAGE to seed it. If URL is omitted, use 1374# `http://www.gnu.org/software/TARNAME/' if PACKAGE begins with `GNU', 1375# otherwise, do without. 1376# 1377# Note that the order is important: first initialize, then set the 1378# AC_CONFIG_SRCDIR. 1379m4_define([AC_INIT], 1380[# Forbidden tokens and exceptions. 1381m4_pattern_forbid([^_?A[CHUM]_]) 1382m4_pattern_forbid([_AC_]) 1383m4_pattern_forbid([^LIBOBJS$], 1384 [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) 1385# Actually reserved by M4sh. 1386m4_pattern_allow([^AS_FLAGS$]) 1387# So that the autoconf-generated scripts will always re-execute 1388# themselves with $CONFIG_SHELL, if that's set in the environment. 1389m4_define([_AS_FORCE_REEXEC_WITH_CONFIG_SHELL], [yes]) 1390AS_INIT[]dnl 1391AS_PREPARE[]dnl 1392m4_divert_push([KILL]) 1393m4_ifval([$2], [_AC_INIT_PACKAGE($@)]) 1394_AC_INIT_DEFAULTS 1395_AC_INIT_PARSE_ARGS 1396_AC_INIT_DIRCHECK 1397_AC_INIT_SRCDIR 1398_AC_INIT_HELP 1399_AC_INIT_VERSION 1400_AC_INIT_CONFIG_LOG 1401_AC_INIT_PREPARE 1402_AC_INIT_NOTICE 1403_AC_INIT_COPYRIGHT 1404m4_divert_text([SHELL_FN], [ 1405m4_text_box([Autoconf initialization.])]) 1406m4_divert_pop 1407m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl 1408dnl 1409dnl Substitute for predefined variables. 1410AC_SUBST([DEFS])dnl 1411AC_SUBST([ECHO_C])dnl 1412AC_SUBST([ECHO_N])dnl 1413AC_SUBST([ECHO_T])dnl 1414AC_SUBST([LIBS])dnl 1415_AC_ARG_VAR_PRECIOUS([build_alias])AC_SUBST([build_alias])dnl 1416_AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl 1417_AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl 1418dnl 1419AC_LANG_PUSH(C) 1420]) 1421 1422 1423 1424 1425## ------------------------------------------------------------- ## 1426## Selecting optional features, working with optional software. ## 1427## ------------------------------------------------------------- ## 1428 1429# AC_PRESERVE_HELP_ORDER 1430# ---------------------- 1431# Emit help strings in the order given, rather than grouping all --enable-FOO 1432# and all --with-BAR. 1433AC_DEFUN([AC_PRESERVE_HELP_ORDER], 1434[m4_divert_once([HELP_ENABLE], [[ 1435Optional Features and Packages: 1436 --disable-option-checking ignore unrecognized --enable/--with options 1437 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1438 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 1439 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 1440 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]]) 1441m4_define([_m4_divert(HELP_ENABLE)], _m4_divert(HELP_WITH)) 1442])# AC_PRESERVE_HELP_ORDER 1443 1444# _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 1445# ------------------------------------------------------------------- 1446# Common code for AC_ARG_ENABLE and AC_ARG_WITH. 1447# OPTION is either "enable" or "with". 1448# 1449m4_define([_AC_ENABLE_IF], 1450[@%:@ Check whether --$1-$2 was given. 1451_AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-+.], [___]), [$3], [$4]) 1452]) 1453 1454m4_define([_AC_ENABLE_IF_ACTION], 1455[m4_append_uniq([_AC_USER_OPTS], [$1_$2], [ 1456])dnl 1457AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl 1458]) 1459 1460# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 1461# ------------------------------------------------------------------------ 1462AC_DEFUN([AC_ARG_ENABLE], 1463[AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER], 1464[], 1465[m4_divert_once([HELP_ENABLE], [[ 1466Optional Features: 1467 --disable-option-checking ignore unrecognized --enable/--with options 1468 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 1469 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])])dnl 1470m4_divert_once([HELP_ENABLE], [$2])dnl 1471_AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl 1472])# AC_ARG_ENABLE 1473 1474 1475AU_DEFUN([AC_ENABLE], 1476[AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])]) 1477 1478 1479# AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE]) 1480# -------------------------------------------------------------------- 1481AC_DEFUN([AC_ARG_WITH], 1482[AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER], 1483[], 1484[m4_divert_once([HELP_WITH], [[ 1485Optional Packages: 1486 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 1487 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])]) 1488m4_divert_once([HELP_WITH], [$2])dnl 1489_AC_ENABLE_IF([with], [$1], [$3], [$4])dnl 1490])# AC_ARG_WITH 1491 1492AU_DEFUN([AC_WITH], 1493[AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])]) 1494 1495# AC_DISABLE_OPTION_CHECKING 1496# -------------------------- 1497AC_DEFUN([AC_DISABLE_OPTION_CHECKING], 1498[m4_divert_once([DEFAULTS], [enable_option_checking=no]) 1499])# AC_DISABLE_OPTION_CHECKING 1500 1501 1502## ----------------------------------------- ## 1503## Remembering variables for reconfiguring. ## 1504## ----------------------------------------- ## 1505 1506 1507# AC_ARG_VAR(VARNAME, DOCUMENTATION) 1508# ---------------------------------- 1509# Register VARNAME as a precious variable, and document it in 1510# `configure --help' (but only once). 1511AC_DEFUN([AC_ARG_VAR], 1512[m4_divert_once([HELP_VAR], [[ 1513Some influential environment variables:]])dnl 1514m4_divert_once([HELP_VAR_END], [[ 1515Use these variables to override the choices made by `configure' or to help 1516it to find libraries and programs with nonstandard names/locations.]])dnl 1517m4_expand_once([m4_divert_text([HELP_VAR], 1518 [AS_HELP_STRING([$1], [$2], [ ])])], 1519 [$0($1)])dnl 1520AC_SUBST([$1])dnl 1521_AC_ARG_VAR_PRECIOUS([$1])dnl 1522])# AC_ARG_VAR 1523 1524 1525# _AC_ARG_VAR_PRECIOUS(VARNAME) 1526# ----------------------------- 1527# Declare VARNAME is precious. 1528m4_define([_AC_ARG_VAR_PRECIOUS], 1529[m4_append_uniq([_AC_PRECIOUS_VARS], [$1], [ 1530])dnl 1531]) 1532 1533 1534# _AC_ARG_VAR_STORE 1535# ----------------- 1536# We try to diagnose when precious variables have changed. To do this, 1537# make two early snapshots (after the option processing to take 1538# explicit variables into account) of those variables: one (ac_env_) 1539# which represents the current run, and a second (ac_cv_env_) which, 1540# at the first run, will be saved in the cache. As an exception to 1541# the cache mechanism, its loading will override these variables (non 1542# `ac_cv_env_' cache value are only set when unset). 1543# 1544# In subsequent runs, after having loaded the cache, compare 1545# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE. 1546m4_define([_AC_ARG_VAR_STORE], 1547[m4_divert_text([PARSE_ARGS], 1548[for ac_var in $ac_precious_vars; do 1549 eval ac_env_${ac_var}_set=\${${ac_var}+set} 1550 eval ac_env_${ac_var}_value=\$${ac_var} 1551 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} 1552 eval ac_cv_env_${ac_var}_value=\$${ac_var} 1553done])dnl 1554]) 1555 1556 1557# _AC_ARG_VAR_VALIDATE 1558# -------------------- 1559# The precious variables are saved twice at the beginning of 1560# configure. E.g., PRECIOUS is saved as `ac_env_PRECIOUS_set' and 1561# `ac_env_PRECIOUS_value' on the one hand and `ac_cv_env_PRECIOUS_set' 1562# and `ac_cv_env_PRECIOUS_value' on the other hand. 1563# 1564# Now the cache has just been loaded, so `ac_cv_env_' represents the 1565# content of the cached values, while `ac_env_' represents that of the 1566# current values. 1567# 1568# So we check that `ac_env_' and `ac_cv_env_' are consistent. If 1569# they aren't, die. 1570m4_define([_AC_ARG_VAR_VALIDATE], 1571[m4_divert_text([INIT_PREPARE], 1572[# Check that the precious variables saved in the cache have kept the same 1573# value. 1574ac_cache_corrupted=false 1575for ac_var in $ac_precious_vars; do 1576 eval ac_old_set=\$ac_cv_env_${ac_var}_set 1577 eval ac_new_set=\$ac_env_${ac_var}_set 1578 eval ac_old_val=\$ac_cv_env_${ac_var}_value 1579 eval ac_new_val=\$ac_env_${ac_var}_value 1580 case $ac_old_set,$ac_new_set in 1581 set,) 1582 AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2) 1583 ac_cache_corrupted=: ;; 1584 ,set) 1585 AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2) 1586 ac_cache_corrupted=: ;; 1587 ,);; 1588 *) 1589 if test "x$ac_old_val" != "x$ac_new_val"; then 1590 # differences in whitespace do not lead to failure. 1591 ac_old_val_w=`echo x $ac_old_val` 1592 ac_new_val_w=`echo x $ac_new_val` 1593 if test "$ac_old_val_w" != "$ac_new_val_w"; then 1594 AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2) 1595 ac_cache_corrupted=: 1596 else 1597 AS_MESSAGE([warning: ignoring whitespace changes in `$ac_var' since the previous run:], 2) 1598 eval $ac_var=\$ac_old_val 1599 fi 1600 AS_MESSAGE([ former value: `$ac_old_val'], 2) 1601 AS_MESSAGE([ current value: `$ac_new_val'], 2) 1602 fi;; 1603 esac 1604 # Pass precious variables to config.status. 1605 if test "$ac_new_set" = set; then 1606 case $ac_new_val in 1607 *\'*) ac_arg=$ac_var=`AS_ECHO(["$ac_new_val"]) | sed "s/'/'\\\\\\\\''/g"` ;; 1608 *) ac_arg=$ac_var=$ac_new_val ;; 1609 esac 1610 case " $ac_configure_args " in 1611 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. 1612 *) AS_VAR_APPEND([ac_configure_args], [" '$ac_arg'"]) ;; 1613 esac 1614 fi 1615done 1616if $ac_cache_corrupted; then 1617 AS_MESSAGE([error: in `$ac_pwd':], 2) 1618 AS_MESSAGE([error: changes in the environment can compromise the build], 2) 1619 AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over]) 1620fi])dnl 1621])# _AC_ARG_VAR_VALIDATE 1622 1623 1624 1625 1626 1627## ---------------------------- ## 1628## Transforming program names. ## 1629## ---------------------------- ## 1630 1631 1632# AC_ARG_PROGRAM 1633# -------------- 1634# This macro is expanded only once, to avoid that `foo' ends up being 1635# installed as `ggfoo'. 1636AC_DEFUN_ONCE([AC_ARG_PROGRAM], 1637[dnl Document the options. 1638m4_divert_push([HELP_BEGIN])dnl 1639 1640Program names: 1641 --program-prefix=PREFIX prepend PREFIX to installed program names 1642 --program-suffix=SUFFIX append SUFFIX to installed program names 1643 --program-transform-name=PROGRAM run sed PROGRAM on installed program names 1644m4_divert_pop([HELP_BEGIN])dnl 1645test "$program_prefix" != NONE && 1646 program_transform_name="s&^&$program_prefix&;$program_transform_name" 1647# Use a double $ so make ignores it. 1648test "$program_suffix" != NONE && 1649 program_transform_name="s&\$&$program_suffix&;$program_transform_name" 1650# Double any \ or $. 1651# By default was `s,x,x', remove it if useless. 1652[ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'] 1653program_transform_name=`AS_ECHO(["$program_transform_name"]) | sed "$ac_script"` 1654])# AC_ARG_PROGRAM 1655 1656 1657 1658 1659 1660## ------------------------- ## 1661## Finding auxiliary files. ## 1662## ------------------------- ## 1663 1664 1665# AC_CONFIG_AUX_DIR(DIR) 1666# ---------------------- 1667# Find install-sh, config.sub, config.guess, and Cygnus configure 1668# in directory DIR. These are auxiliary files used in configuration. 1669# DIR can be either absolute or relative to $srcdir. 1670AC_DEFUN([AC_CONFIG_AUX_DIR], 1671[AC_CONFIG_AUX_DIRS($1 "$srcdir"/$1)]) 1672 1673 1674# AC_CONFIG_AUX_DIR_DEFAULT 1675# ------------------------- 1676# The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'. 1677# There's no need to call this macro explicitly; just AC_REQUIRE it. 1678AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT], 1679[AC_CONFIG_AUX_DIRS("$srcdir" "$srcdir/.." "$srcdir/../..")]) 1680 1681 1682# AC_CONFIG_AUX_DIRS(DIR ...) 1683# --------------------------- 1684# Internal subroutine. 1685# Search for the configuration auxiliary files in directory list $1. 1686# We look only for install-sh, so users of AC_PROG_INSTALL 1687# do not automatically need to distribute the other auxiliary files. 1688AC_DEFUN([AC_CONFIG_AUX_DIRS], 1689[ac_aux_dir= 1690for ac_dir in $1; do 1691 if test -f "$ac_dir/install-sh"; then 1692 ac_aux_dir=$ac_dir 1693 ac_install_sh="$ac_aux_dir/install-sh -c" 1694 break 1695 elif test -f "$ac_dir/install.sh"; then 1696 ac_aux_dir=$ac_dir 1697 ac_install_sh="$ac_aux_dir/install.sh -c" 1698 break 1699 elif test -f "$ac_dir/shtool"; then 1700 ac_aux_dir=$ac_dir 1701 ac_install_sh="$ac_aux_dir/shtool install -c" 1702 break 1703 fi 1704done 1705if test -z "$ac_aux_dir"; then 1706 AC_MSG_ERROR([cannot find install-sh, install.sh, or shtool in $1]) 1707fi 1708 1709# These three variables are undocumented and unsupported, 1710# and are intended to be withdrawn in a future Autoconf release. 1711# They can cause serious problems if a builder's source tree is in a directory 1712# whose full name contains unusual characters. 1713ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. 1714ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. 1715ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. 1716 1717AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 1718])# AC_CONFIG_AUX_DIRS 1719 1720 1721 1722 1723## ------------------------ ## 1724## Finding aclocal macros. ## 1725## ------------------------ ## 1726 1727 1728# AC_CONFIG_MACRO_DIR(DIR) 1729# ------------------------ 1730# Declare directory containing additional macros for aclocal. 1731AC_DEFUN([AC_CONFIG_MACRO_DIR], []) 1732 1733 1734 1735## --------------------- ## 1736## Requiring aux files. ## 1737## --------------------- ## 1738 1739# AC_REQUIRE_AUX_FILE(FILE) 1740# ------------------------- 1741# This macro does nothing, it's a hook to be read with `autoconf --trace'. 1742# It announces FILE is required in the auxdir. 1743m4_define([AC_REQUIRE_AUX_FILE], 1744[AS_LITERAL_WORD_IF([$1], [], 1745 [m4_fatal([$0: requires a literal argument])])]) 1746 1747 1748 1749## ----------------------------------- ## 1750## Getting the canonical system type. ## 1751## ----------------------------------- ## 1752 1753# The inputs are: 1754# configure --host=HOST --target=TARGET --build=BUILD 1755# 1756# The rules are: 1757# 1. Build defaults to the current platform, as determined by config.guess. 1758# 2. Host defaults to build. 1759# 3. Target defaults to host. 1760 1761 1762# _AC_CANONICAL_SPLIT(THING) 1763# -------------------------- 1764# Generate the variables THING, THING_{alias cpu vendor os}. 1765m4_define([_AC_CANONICAL_SPLIT], 1766[case $ac_cv_$1 in 1767*-*-*) ;; 1768*) AC_MSG_ERROR([invalid value of canonical $1]);; 1769esac 1770AC_SUBST([$1], [$ac_cv_$1])dnl 1771ac_save_IFS=$IFS; IFS='-' 1772set x $ac_cv_$1 1773shift 1774AC_SUBST([$1_cpu], [$[1]])dnl 1775AC_SUBST([$1_vendor], [$[2]])dnl 1776shift; shift 1777[# Remember, the first character of IFS is used to create $]*, 1778# except with old shells: 1779$1_os=$[*] 1780IFS=$ac_save_IFS 1781case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac 1782AC_SUBST([$1_os])dnl 1783])# _AC_CANONICAL_SPLIT 1784 1785 1786# AC_CANONICAL_BUILD 1787# ------------------ 1788AC_DEFUN_ONCE([AC_CANONICAL_BUILD], 1789[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 1790AC_REQUIRE_AUX_FILE([config.sub])dnl 1791AC_REQUIRE_AUX_FILE([config.guess])dnl 1792m4_divert_once([HELP_CANON], 1793[[ 1794System types: 1795 --build=BUILD configure for building on BUILD [guessed]]])dnl 1796# Make sure we can run config.sub. 1797$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || 1798 AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub]) 1799 1800AC_CACHE_CHECK([build system type], [ac_cv_build], 1801[ac_build_alias=$build_alias 1802test "x$ac_build_alias" = x && 1803 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` 1804test "x$ac_build_alias" = x && 1805 AC_MSG_ERROR([cannot guess build type; you must specify one]) 1806ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || 1807 AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed]) 1808]) 1809_AC_CANONICAL_SPLIT(build) 1810])# AC_CANONICAL_BUILD 1811 1812 1813# AC_CANONICAL_HOST 1814# ----------------- 1815AC_DEFUN_ONCE([AC_CANONICAL_HOST], 1816[AC_REQUIRE([AC_CANONICAL_BUILD])dnl 1817m4_divert_once([HELP_CANON], 1818[[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnl 1819AC_CACHE_CHECK([host system type], [ac_cv_host], 1820[if test "x$host_alias" = x; then 1821 ac_cv_host=$ac_cv_build 1822else 1823 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || 1824 AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed]) 1825fi 1826]) 1827_AC_CANONICAL_SPLIT([host]) 1828])# AC_CANONICAL_HOST 1829 1830 1831# AC_CANONICAL_TARGET 1832# ------------------- 1833AC_DEFUN_ONCE([AC_CANONICAL_TARGET], 1834[AC_REQUIRE([AC_CANONICAL_HOST])dnl 1835AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl 1836m4_divert_once([HELP_CANON], 1837[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl 1838AC_CACHE_CHECK([target system type], [ac_cv_target], 1839[if test "x$target_alias" = x; then 1840 ac_cv_target=$ac_cv_host 1841else 1842 ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || 1843 AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed]) 1844fi 1845]) 1846_AC_CANONICAL_SPLIT([target]) 1847 1848# The aliases save the names the user supplied, while $host etc. 1849# will get canonicalized. 1850test -n "$target_alias" && 1851 test "$program_prefix$program_suffix$program_transform_name" = \ 1852 NONENONEs,x,x, && 1853 program_prefix=${target_alias}-[]dnl 1854])# AC_CANONICAL_TARGET 1855 1856 1857AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET]) 1858 1859 1860# AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD]) 1861# ------------------------------------------ 1862# If the cache file is inconsistent with the current host, 1863# target and build system types, execute CMD or print a default 1864# error message. Now handled via _AC_ARG_VAR_PRECIOUS. 1865AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], []) 1866 1867 1868## ---------------------- ## 1869## Caching test results. ## 1870## ---------------------- ## 1871 1872 1873# AC_SITE_LOAD 1874# ------------ 1875# Look for site- or system-specific initialization scripts. 1876m4_define([AC_SITE_LOAD], 1877[# Prefer an explicitly selected file to automatically selected ones. 1878ac_site_file1=NONE 1879ac_site_file2=NONE 1880if test -n "$CONFIG_SITE"; then 1881 # We do not want a PATH search for config.site. 1882 case $CONFIG_SITE in @%:@(( 1883 -*) ac_site_file1=./$CONFIG_SITE;; 1884 */*) ac_site_file1=$CONFIG_SITE;; 1885 *) ac_site_file1=./$CONFIG_SITE;; 1886 esac 1887elif test "x$prefix" != xNONE; then 1888 ac_site_file1=$prefix/share/config.site 1889 ac_site_file2=$prefix/etc/config.site 1890else 1891 ac_site_file1=$ac_default_prefix/share/config.site 1892 ac_site_file2=$ac_default_prefix/etc/config.site 1893fi 1894for ac_site_file in "$ac_site_file1" "$ac_site_file2" 1895do 1896 test "x$ac_site_file" = xNONE && continue 1897 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then 1898 AC_MSG_NOTICE([loading site script $ac_site_file]) 1899 sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD 1900 . "$ac_site_file" \ 1901 || AC_MSG_FAILURE([failed to load site script $ac_site_file]) 1902 fi 1903done 1904]) 1905 1906 1907# AC_CACHE_LOAD 1908# ------------- 1909m4_define([AC_CACHE_LOAD], 1910[if test -r "$cache_file"; then 1911 # Some versions of bash will fail to source /dev/null (special files 1912 # actually), so we avoid doing that. DJGPP emulates it as a regular file. 1913 if test /dev/null != "$cache_file" && test -f "$cache_file"; then 1914 AC_MSG_NOTICE([loading cache $cache_file]) 1915 case $cache_file in 1916 [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";; 1917 *) . "./$cache_file";; 1918 esac 1919 fi 1920else 1921 AC_MSG_NOTICE([creating cache $cache_file]) 1922 >$cache_file 1923fi 1924])# AC_CACHE_LOAD 1925 1926 1927# _AC_CACHE_DUMP 1928# -------------- 1929# Dump the cache to stdout. It can be in a pipe (this is a requirement). 1930m4_define([_AC_CACHE_DUMP], 1931[# The following way of writing the cache mishandles newlines in values, 1932# but we know of no workaround that is simple, portable, and efficient. 1933# So, we kill variables containing newlines. 1934# Ultrix sh set writes to stderr and can't be redirected directly, 1935# and sets the high bit in the cache file unless we assign to the vars. 1936( 1937 for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do 1938 eval ac_val=\$$ac_var 1939 case $ac_val in #( 1940 *${as_nl}*) 1941 case $ac_var in #( 1942 *_cv_*) AC_MSG_WARN([cache variable $ac_var contains a newline]) ;; 1943 esac 1944 case $ac_var in #( 1945 _ | IFS | as_nl) ;; #( 1946 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( 1947 *) AS_UNSET([$ac_var]) ;; 1948 esac ;; 1949 esac 1950 done 1951 1952 (set) 2>&1 | 1953 case $as_nl`(ac_space=' '; set) 2>&1` in #( 1954 *${as_nl}ac_space=\ *) 1955 # `set' does not quote correctly, so add quotes: double-quote 1956 # substitution turns \\\\ into \\, and sed turns \\ into \. 1957 sed -n \ 1958 ["s/'/'\\\\''/g; 1959 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"] 1960 ;; #( 1961 *) 1962 # `set' quotes correctly as required by POSIX, so do not add quotes. 1963 sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"] 1964 ;; 1965 esac | 1966 sort 1967)dnl 1968])# _AC_CACHE_DUMP 1969 1970 1971# AC_CACHE_SAVE 1972# ------------- 1973# Save the cache. 1974# Allow a site initialization script to override cache values. 1975m4_define([AC_CACHE_SAVE], 1976[cat >confcache <<\_ACEOF 1977# This file is a shell script that caches the results of configure 1978# tests run on this system so they can be shared between configure 1979# scripts and configure runs, see configure's option --config-cache. 1980# It is not useful on other systems. If it contains results you don't 1981# want to keep, you may remove or edit it. 1982# 1983# config.status only pays attention to the cache file if you give it 1984# the --recheck option to rerun configure. 1985# 1986# `ac_cv_env_foo' variables (set or unset) will be overridden when 1987# loading this file, other *unset* `ac_cv_foo' will be assigned the 1988# following values. 1989 1990_ACEOF 1991 1992_AC_CACHE_DUMP() | 1993 sed [' 1994 /^ac_cv_env_/b end 1995 t clear 1996 :clear 1997 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ 1998 t end 1999 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ 2000 :end'] >>confcache 2001if diff "$cache_file" confcache >/dev/null 2>&1; then :; else 2002 if test -w "$cache_file"; then 2003 if test "x$cache_file" != "x/dev/null"; then 2004 AC_MSG_NOTICE([updating cache $cache_file]) 2005 if test ! -f "$cache_file" || test -h "$cache_file"; then 2006 cat confcache >"$cache_file" 2007 else 2008dnl Try to update the cache file atomically even on different mount points; 2009dnl at the same time, avoid filename limitation issues in the common case. 2010 case $cache_file in #( 2011 */* | ?:*) 2012 mv -f confcache "$cache_file"$$ && 2013 mv -f "$cache_file"$$ "$cache_file" ;; #( 2014 *) 2015 mv -f confcache "$cache_file" ;; 2016 esac 2017 fi 2018 fi 2019 else 2020 AC_MSG_NOTICE([not updating unwritable cache $cache_file]) 2021 fi 2022fi 2023rm -f confcache[]dnl 2024])# AC_CACHE_SAVE 2025 2026 2027# AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) 2028# ------------------------------------------ 2029# The name of shell var CACHE-ID must contain `_cv_' in order to get saved. 2030# Should be dnl'ed. Try to catch common mistakes. 2031m4_defun([AC_CACHE_VAL], 2032[AS_LITERAL_WORD_IF([$1], [m4_if(m4_index(m4_quote($1), [_cv_]), [-1], 2033 [AC_DIAGNOSE([syntax], 2034[$0($1, ...): suspicious cache-id, must contain _cv_ to be cached])])])dnl 2035m4_if(m4_index([$2], [AC_DEFINE]), [-1], [], 2036 [AC_DIAGNOSE([syntax], 2037[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl 2038[where no actions should be taken])])dnl 2039m4_if(m4_index([$2], [AC_SUBST]), [-1], [], 2040 [AC_DIAGNOSE([syntax], 2041[$0($1, ...): suspicious presence of an AC_SUBST in the second argument, ]dnl 2042[where no actions should be taken])])dnl 2043AS_VAR_SET_IF([$1], 2044 [_AS_ECHO_N([(cached) ])], 2045 [$2]) 2046]) 2047 2048 2049# AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS) 2050# ------------------------------------------- 2051# Do not call this macro with a dnl right behind. 2052m4_defun([AC_CACHE_CHECK], 2053[AC_MSG_CHECKING([$1]) 2054AC_CACHE_VAL([$2], [$3])dnl 2055AS_LITERAL_WORD_IF([$2], 2056 [AC_MSG_RESULT([$$2])], 2057 [AS_VAR_COPY([ac_res], [$2]) 2058 AC_MSG_RESULT([$ac_res])])dnl 2059]) 2060 2061# _AC_CACHE_CHECK_INT(MESSAGE, CACHE-ID, EXPRESSION, 2062# [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS]) 2063# -------------------------------------------------------------- 2064AC_DEFUN([_AC_CACHE_CHECK_INT], 2065[AC_CACHE_CHECK([$1], [$2], 2066 [AC_COMPUTE_INT([$2], [$3], [$4], [$5])]) 2067])# _AC_CACHE_CHECK_INT 2068 2069 2070 2071## ---------------------- ## 2072## Defining CPP symbols. ## 2073## ---------------------- ## 2074 2075 2076# AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL) 2077# ------------------------------------------- 2078# Used by --trace to collect the list of AC_DEFINEd macros. 2079m4_define([AC_DEFINE_TRACE_LITERAL], 2080[m4_pattern_allow([^$1$])dnl 2081AS_IDENTIFIER_IF([$1], [], 2082 [m4_warn([syntax], [AC_DEFINE: not an identifier: $1])])dnl 2083])# AC_DEFINE_TRACE_LITERAL 2084 2085 2086# AC_DEFINE_TRACE(CPP-SYMBOL) 2087# --------------------------- 2088# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters 2089# out non literal symbols. CPP-SYMBOL must not include any parameters. 2090m4_define([AC_DEFINE_TRACE], 2091[AS_LITERAL_WORD_IF([$1], [AC_DEFINE_TRACE_LITERAL(_m4_expand([$1]))])]) 2092 2093 2094# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION]) 2095# ------------------------------------------- 2096# Set VARIABLE to VALUE, verbatim, or 1. Remember the value 2097# and if VARIABLE is affected the same VALUE, do nothing, else 2098# die. The third argument is used by autoheader. 2099m4_define([AC_DEFINE], [_AC_DEFINE_Q([_$0], $@)]) 2100 2101# _AC_DEFINE(STRING) 2102# ------------------ 2103# Append the pre-expanded STRING and a newline to confdefs.h, as if by 2104# a quoted here-doc. 2105m4_define([_AC_DEFINE], 2106[AS_ECHO(["AS_ESCAPE([[$1]])"]) >>confdefs.h]) 2107 2108 2109# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION]) 2110# ---------------------------------------------------- 2111# Similar, but perform shell substitutions $ ` \ once on VALUE, as 2112# in an unquoted here-doc. 2113m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([_$0], $@)]) 2114 2115# _AC_DEFINE_UNQUOTED(STRING) 2116# --------------------------- 2117# Append the pre-expanded STRING and a newline to confdefs.h, as if 2118# with an unquoted here-doc, but avoiding a fork in the common case of 2119# no backslash, no command substitution, no complex variable 2120# substitution, and no quadrigraphs. 2121m4_define([_AC_DEFINE_UNQUOTED], 2122[m4_if(m4_bregexp([$1], [\\\|`\|\$(\|\${\|@]), [-1], 2123 [AS_ECHO(["AS_ESCAPE([$1], [""])"]) >>confdefs.h], 2124 [cat >>confdefs.h <<_ACEOF 2125[$1] 2126_ACEOF])]) 2127 2128 2129# _AC_DEFINE_Q(MACRO, VARIABLE, [VALUE], [DESCRIPTION]) 2130# ----------------------------------------------------- 2131# Internal function that performs common elements of AC_DEFINE{,_UNQUOTED}. 2132# MACRO must take one argument, which is the fully expanded string to 2133# append to confdefs.h as if by a possibly-quoted here-doc. 2134# 2135# m4_index is roughly 5 to 8 times faster than m4_bpatsubst, so we use 2136# m4_format rather than regex to grab prefix up to first (). AC_name 2137# is defined with over-quotation, so that we can avoid m4_defn; this 2138# is only safe because the name should not contain $. 2139# 2140# Guarantee a match in m4_index, so as to avoid a bug with precision 2141# -1 in m4_format in older m4. 2142m4_define([_AC_DEFINE_Q], 2143[m4_pushdef([AC_name], m4_format([[[%.*s]]], m4_index([$2(], [(]), [$2]))]dnl 2144[AC_DEFINE_TRACE(AC_name)]dnl 2145[m4_cond([m4_index([$3], [ 2146])], [-1], [], 2147 [m4_bregexp([[$3]], [[^\\] 2148], [-])], [], [], 2149 [m4_warn([syntax], [AC_DEFINE]m4_if([$1], [_AC_DEFINE], [], 2150 [[_UNQUOTED]])[: `$3' is not a valid preprocessor define value])])]dnl 2151[m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4]) 2152])_m4_popdef([AC_name])]dnl 2153[$1(m4_expand([[@%:@define] $2 ]m4_if([$#], 2, 1, 2154 [$3], [], [/**/], [[$3]]))) 2155]) 2156 2157 2158 2159## -------------------------- ## 2160## Setting output variables. ## 2161## -------------------------- ## 2162 2163 2164# AC_SUBST_TRACE(VARIABLE) 2165# ------------------------ 2166# This macro is used with --trace to collect the list of substituted variables. 2167m4_define([AC_SUBST_TRACE]) 2168 2169 2170# AC_SUBST(VARIABLE, [VALUE]) 2171# --------------------------- 2172# Create an output variable from a shell VARIABLE. If VALUE is given 2173# assign it to VARIABLE. Use `""' if you want to set VARIABLE to an 2174# empty value, not an empty second argument. 2175# 2176m4_define([AC_SUBST], 2177[AS_IDENTIFIER_IF([$1], [], 2178 [m4_fatal([$0: `$1' is not a valid shell variable name])])]dnl 2179[AC_SUBST_TRACE([$1])]dnl 2180[m4_pattern_allow([^$1$])]dnl 2181[m4_ifvaln([$2], [$1=$2])[]]dnl 2182[m4_set_add([_AC_SUBST_VARS], [$1])])# AC_SUBST 2183 2184 2185# AC_SUBST_FILE(VARIABLE) 2186# ----------------------- 2187# Read the comments of the preceding macro. 2188m4_define([AC_SUBST_FILE], 2189[m4_pattern_allow([^$1$])dnl 2190m4_append_uniq([_AC_SUBST_FILES], [$1], [ 2191])]) 2192 2193 2194 2195## --------------------------------------- ## 2196## Printing messages at autoconf runtime. ## 2197## --------------------------------------- ## 2198 2199# In fact, I think we should promote the use of m4_warn and m4_fatal 2200# directly. This will also avoid to some people to get it wrong 2201# between AC_FATAL and AC_MSG_ERROR. 2202 2203 2204# AC_DIAGNOSE(CATEGORY, MESSAGE) 2205# AC_FATAL(MESSAGE, [EXIT-STATUS]) 2206# -------------------------------- 2207m4_define([AC_DIAGNOSE], [m4_warn($@)]) 2208m4_define([AC_FATAL], [m4_fatal($@)]) 2209 2210 2211# AC_WARNING(MESSAGE) 2212# ------------------- 2213# Report a MESSAGE to the user of autoconf if `-W' or `-W all' was 2214# specified. 2215m4_define([AC_WARNING], 2216[AC_DIAGNOSE([syntax], [$1])]) 2217 2218 2219 2220 2221## ---------------------------------------- ## 2222## Printing messages at configure runtime. ## 2223## ---------------------------------------- ## 2224 2225 2226# AC_MSG_CHECKING(FEATURE) 2227# ------------------------ 2228m4_define([AC_MSG_CHECKING], 2229[{ _AS_ECHO_LOG([checking $1]) 2230_AS_ECHO_N([checking $1... ]); }dnl 2231]) 2232 2233 2234# AC_MSG_RESULT(RESULT) 2235# --------------------- 2236m4_define([AC_MSG_RESULT], 2237[{ _AS_ECHO_LOG([result: $1]) 2238_AS_ECHO([$1]); }dnl 2239]) 2240 2241 2242# AC_MSG_WARN(PROBLEM) 2243# AC_MSG_NOTICE(STRING) 2244# AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1]) 2245# AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1]) 2246# ---------------------------------------- 2247m4_copy([AS_WARN], [AC_MSG_WARN]) 2248m4_copy([AS_MESSAGE], [AC_MSG_NOTICE]) 2249m4_copy([AS_ERROR], [AC_MSG_ERROR]) 2250m4_define([AC_MSG_FAILURE], 2251[{ AS_MESSAGE([error: in `$ac_pwd':], 2) 2252AC_MSG_ERROR([$1 2253See `config.log' for more details], [$2]); }]) 2254 2255 2256# _AC_MSG_LOG_CONFTEST 2257# -------------------- 2258m4_define([_AC_MSG_LOG_CONFTEST], 2259[AS_ECHO(["$as_me: failed program was:"]) >&AS_MESSAGE_LOG_FD 2260sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD 2261]) 2262 2263 2264# AU::AC_CHECKING(FEATURE) 2265# ------------------------ 2266AU_DEFUN([AC_CHECKING], 2267[AS_MESSAGE([checking $1...])]) 2268 2269 2270# AU::AC_MSG_RESULT_UNQUOTED(RESULT) 2271# ---------------------------------- 2272# No escaping, so it performed also backtick substitution. 2273AU_DEFUN([AC_MSG_RESULT_UNQUOTED], 2274[_AS_ECHO_UNQUOTED([$as_me:${as_lineno-$LINENO}: result: $1], AS_MESSAGE_LOG_FD) 2275_AS_ECHO_UNQUOTED([$1])[]dnl 2276]) 2277 2278 2279# AU::AC_VERBOSE(STRING) 2280# ---------------------- 2281AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT]) 2282 2283 2284 2285 2286 2287 2288## ---------------------------- ## 2289## Compiler-running mechanics. ## 2290## ---------------------------- ## 2291 2292 2293# _AC_RUN_LOG(COMMAND, LOG-COMMANDS) 2294# ---------------------------------- 2295# Eval COMMAND, save the exit status in ac_status, and log it. The return 2296# code is 0 if COMMAND succeeded, so that it can be used directly in AS_IF 2297# constructs. 2298AC_DEFUN([_AC_RUN_LOG], 2299[{ { $2; } >&AS_MESSAGE_LOG_FD 2300 ($1) 2>&AS_MESSAGE_LOG_FD 2301 ac_status=$? 2302 _AS_ECHO_LOG([\$? = $ac_status]) 2303 test $ac_status = 0; }]) 2304 2305 2306# _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS) 2307# ----------------------------------------- 2308# Run COMMAND, save its stderr into conftest.err, save the exit status 2309# in ac_status, and log it. Don't forget to clean up conftest.err after 2310# use. 2311# Note that when tracing, most shells will leave the traces in stderr 2312# starting with "+": that's what this macro tries to address. 2313# The return code is 0 if COMMAND succeeded, so that it can be used directly 2314# in AS_IF constructs. 2315AC_DEFUN([_AC_RUN_LOG_STDERR], 2316[{ { $2; } >&AS_MESSAGE_LOG_FD 2317 ($1) 2>conftest.err 2318 ac_status=$? 2319 if test -s conftest.err; then 2320 grep -v '^ *+' conftest.err >conftest.er1 2321 cat conftest.er1 >&AS_MESSAGE_LOG_FD 2322 mv -f conftest.er1 conftest.err 2323 fi 2324 _AS_ECHO_LOG([\$? = $ac_status]) 2325 test $ac_status = 0; }]) 2326 2327 2328# _AC_RUN_LOG_LIMIT(COMMAND, LOG-COMMANDS, [LINES]) 2329# ------------------------------------------------- 2330# Like _AC_RUN_LOG, but only log LINES lines from stderr, 2331# defaulting to 10 lines. 2332AC_DEFUN([_AC_RUN_LOG_LIMIT], 2333[{ { $2; } >&AS_MESSAGE_LOG_FD 2334 ($1) 2>conftest.err 2335 ac_status=$? 2336 if test -s conftest.err; then 2337 sed 'm4_default([$3], [10])a\ 2338... rest of stderr output deleted ... 2339 m4_default([$3], [10])q' conftest.err >conftest.er1 2340 cat conftest.er1 >&AS_MESSAGE_LOG_FD 2341 fi 2342 rm -f conftest.er1 conftest.err 2343 _AS_ECHO_LOG([\$? = $ac_status]) 2344 test $ac_status = 0; }]) 2345 2346 2347# _AC_DO_ECHO(COMMAND) 2348# -------------------- 2349# Echo COMMAND. This is designed to be used just before evaluating COMMAND. 2350AC_DEFUN([_AC_DO_ECHO], 2351[m4_if([$1], [$ac_try], [], [ac_try="$1" 2352])]dnl 2353dnl If the string contains '\"', '`', or '\\', then just echo it rather 2354dnl than expanding it. This is a hack, but it is safer, while also 2355dnl typically expanding simple substrings like '$CC', which is what we want. 2356dnl 2357dnl Much of this macro body is quoted, to work around misuses like 2358dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))', 2359dnl which underquotes the 3rd arg and would misbehave if we didn't quote here. 2360dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse 2361dnl underquoting misuses, such as 2362dnl `AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'. 2363dnl We normally wouldn't bother with this kind of workaround for invalid code 2364dnl but this change was put in just before Autoconf 2.60 and we wanted to 2365dnl minimize the integration hassle. 2366[[case "(($ac_try" in 2367 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 2368 *) ac_try_echo=$ac_try;; 2369esac 2370eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""] 2371AS_ECHO(["$ac_try_echo"])]) 2372 2373# _AC_DO(COMMAND) 2374# --------------- 2375# Eval COMMAND, save the exit status in ac_status, and log it. 2376# For internal use only. 2377AC_DEFUN([_AC_DO], 2378[_AC_RUN_LOG([eval "$1"], 2379 [_AC_DO_ECHO([$1])])]) 2380 2381 2382# _AC_DO_STDERR(COMMAND) 2383# ---------------------- 2384# Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND. 2385AC_DEFUN([_AC_DO_STDERR], 2386[_AC_RUN_LOG_STDERR([eval "$1"], 2387 [_AC_DO_ECHO([$1])])]) 2388 2389 2390# _AC_DO_VAR(VARIABLE) 2391# -------------------- 2392# Evaluate "$VARIABLE", which should be a valid shell command. 2393# The purpose of this macro is to write "configure:123: command line" 2394# into config.log for every test run. 2395AC_DEFUN([_AC_DO_VAR], 2396[_AC_DO([$$1])]) 2397 2398 2399# _AC_DO_TOKENS(COMMAND) 2400# ---------------------- 2401# Like _AC_DO_VAR, but execute COMMAND instead, where COMMAND is a series of 2402# tokens of the shell command language. 2403AC_DEFUN([_AC_DO_TOKENS], 2404[{ ac_try='$1' 2405 _AC_DO([$ac_try]); }]) 2406 2407 2408# _AC_DO_LIMIT(COMMAND, [LINES]) 2409# ------------------------------ 2410# Like _AC_DO, but limit the amount of stderr lines logged to LINES. 2411# For internal use only. 2412AC_DEFUN([_AC_DO_LIMIT], 2413[_AC_RUN_LOG_LIMIT([eval "$1"], 2414 [_AC_DO_ECHO([$1])], [$2])]) 2415 2416 2417# _AC_EVAL(COMMAND) 2418# ----------------- 2419# Eval COMMAND, save the exit status in ac_status, and log it. 2420# Unlike _AC_DO, this macro mishandles quoted arguments in some cases. 2421# It is present only for backward compatibility with previous Autoconf versions. 2422AC_DEFUN([_AC_EVAL], 2423[_AC_RUN_LOG([eval $1], 2424 [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])]) 2425 2426 2427# _AC_EVAL_STDERR(COMMAND) 2428# ------------------------ 2429# Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND. 2430# Unlike _AC_DO_STDERR, this macro mishandles quoted arguments in some cases. 2431# It is present only for backward compatibility with previous Autoconf versions. 2432AC_DEFUN([_AC_EVAL_STDERR], 2433[_AC_RUN_LOG_STDERR([eval $1], 2434 [eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$1\""])]) 2435 2436 2437# AC_TRY_EVAL(VARIABLE) 2438# --------------------- 2439# Evaluate $VARIABLE, which should be a valid shell command. 2440# The purpose of this macro is to write "configure:123: command line" 2441# into config.log for every test run. 2442# 2443# The AC_TRY_EVAL and AC_TRY_COMMAND macros are dangerous and 2444# undocumented, and should not be used. 2445# They may be removed or their API changed in a future release. 2446# Autoconf itself no longer uses these two macros; they are present 2447# only for backward compatibility with previous versions of Autoconf. 2448# Not every shell command will work due to problems with eval 2449# and quoting, and the rules for exactly what does work are tricky. 2450# Worse, due to double-expansion during evaluation, arbitrary unintended 2451# shell commands could be executed in some situations. 2452AC_DEFUN([AC_TRY_EVAL], 2453[_AC_EVAL([$$1])]) 2454 2455 2456# AC_TRY_COMMAND(COMMAND) 2457# ----------------------- 2458# Like AC_TRY_EVAL, but execute COMMAND instead, where COMMAND is a series of 2459# tokens of the shell command language. 2460# This macro should not be used; see the comments under AC_TRY_EVAL for why. 2461AC_DEFUN([AC_TRY_COMMAND], 2462[{ ac_try='$1' 2463 _AC_EVAL([$ac_try]); }]) 2464 2465 2466# AC_RUN_LOG(COMMAND) 2467# ------------------- 2468AC_DEFUN([AC_RUN_LOG], 2469[_AC_RUN_LOG([$1], 2470 [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"])])]) 2471 2472 2473 2474 2475## ------------------------ ## 2476## Examining declarations. ## 2477## ------------------------ ## 2478 2479 2480# _AC_PREPROC_IFELSE_BODY 2481# ----------------------- 2482# Shell function body for _AC_PREPROC_IFELSE. 2483m4_define([_AC_PREPROC_IFELSE_BODY], 2484[ AS_LINENO_PUSH([$[]1]) 2485 AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) > conftest.i && { 2486 test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" || 2487 test ! -s conftest.err 2488 }], 2489 [ac_retval=0], 2490 [_AC_MSG_LOG_CONFTEST 2491 ac_retval=1]) 2492 AS_LINENO_POP 2493 AS_SET_STATUS([$ac_retval]) 2494])# _AC_PREPROC_IFELSE_BODY 2495 2496 2497# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2498# ---------------------------------------------------------------- 2499# Try to preprocess PROGRAM. 2500# 2501# This macro can be used during the selection of a preprocessor. 2502# eval is necessary to expand ac_cpp. 2503AC_DEFUN([_AC_PREPROC_IFELSE], 2504[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_cpp], 2505 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_cpp], [LINENO], 2506 [Try to preprocess conftest.$ac_ext, and return whether this succeeded.])], 2507 [$0_BODY])]dnl 2508[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl 2509[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_cpp "$LINENO"], [$2], [$3]) 2510rm -f conftest.err conftest.i[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl 2511])# _AC_PREPROC_IFELSE 2512 2513# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2514# --------------------------------------------------------------- 2515# Try to preprocess PROGRAM. Requires that the preprocessor for the 2516# current language was checked for, hence do not use this macro in macros 2517# looking for a preprocessor. 2518AC_DEFUN([AC_PREPROC_IFELSE], 2519[AC_LANG_PREPROC_REQUIRE()dnl 2520_AC_PREPROC_IFELSE($@)]) 2521 2522 2523# AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2524# --------------------------------------------------------- 2525# AC_TRY_CPP is used to check whether particular header files exist. 2526# (But it actually tests whether INCLUDES produces no CPP errors.) 2527# 2528# INCLUDES are not defaulted and are double quoted. 2529AU_DEFUN([AC_TRY_CPP], 2530[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])]) 2531 2532 2533# AC_EGREP_CPP(PATTERN, PROGRAM, 2534# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2535# ------------------------------------------------------ 2536# Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must 2537# come early, it is not included in AC_BEFORE checks. 2538AC_DEFUN([AC_EGREP_CPP], 2539[AC_LANG_PREPROC_REQUIRE()dnl 2540AC_REQUIRE([AC_PROG_EGREP])dnl 2541AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) 2542AS_IF([dnl eval is necessary to expand ac_cpp. 2543dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. 2544(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | 2545dnl Quote $1 to prevent m4 from eating character classes 2546 $EGREP "[$1]" >/dev/null 2>&1], 2547 [$3], 2548 [$4]) 2549rm -f conftest* 2550])# AC_EGREP_CPP 2551 2552 2553# AC_EGREP_HEADER(PATTERN, HEADER-FILE, 2554# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2555# --------------------------------------------------------- 2556AC_DEFUN([AC_EGREP_HEADER], 2557[AC_EGREP_CPP([$1], 2558[#include <$2> 2559], [$3], [$4])]) 2560 2561 2562 2563 2564## ------------------ ## 2565## Examining syntax. ## 2566## ------------------ ## 2567 2568# _AC_COMPILE_IFELSE_BODY 2569# ----------------------- 2570# Shell function body for _AC_COMPILE_IFELSE. 2571m4_define([_AC_COMPILE_IFELSE_BODY], 2572[ AS_LINENO_PUSH([$[]1]) 2573 rm -f conftest.$ac_objext 2574 AS_IF([_AC_DO_STDERR($ac_compile) && { 2575 test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || 2576 test ! -s conftest.err 2577 } && test -s conftest.$ac_objext], 2578 [ac_retval=0], 2579 [_AC_MSG_LOG_CONFTEST 2580 ac_retval=1]) 2581 AS_LINENO_POP 2582 AS_SET_STATUS([$ac_retval]) 2583])# _AC_COMPILE_IFELSE_BODY 2584 2585 2586# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2587# ---------------------------------------------------------------- 2588# Try to compile PROGRAM. 2589# This macro can be used during the selection of a compiler. 2590AC_DEFUN([_AC_COMPILE_IFELSE], 2591[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_compile], 2592 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_compile], [LINENO], 2593 [Try to compile conftest.$ac_ext, and return whether this succeeded.])], 2594 [$0_BODY])]dnl 2595[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl 2596[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_compile "$LINENO"], [$2], [$3]) 2597rm -f core conftest.err conftest.$ac_objext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl 2598])# _AC_COMPILE_IFELSE 2599 2600 2601# AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2602# --------------------------------------------------------------- 2603# Try to compile PROGRAM. Requires that the compiler for the current 2604# language was checked for, hence do not use this macro in macros looking 2605# for a compiler. 2606AC_DEFUN([AC_COMPILE_IFELSE], 2607[AC_LANG_COMPILER_REQUIRE()dnl 2608_AC_COMPILE_IFELSE($@)]) 2609 2610 2611# AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY, 2612# [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2613# --------------------------------------------------- 2614AU_DEFUN([AC_TRY_COMPILE], 2615[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])]) 2616 2617 2618 2619## --------------------- ## 2620## Examining libraries. ## 2621## --------------------- ## 2622 2623 2624# _AC_LINK_IFELSE_BODY 2625# -------------------- 2626# Shell function body for _AC_LINK_IFELSE. 2627m4_define([_AC_LINK_IFELSE_BODY], 2628[ AS_LINENO_PUSH([$[]1]) 2629 rm -f conftest.$ac_objext conftest$ac_exeext 2630 AS_IF([_AC_DO_STDERR($ac_link) && { 2631 test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || 2632 test ! -s conftest.err 2633 } && test -s conftest$ac_exeext && { 2634 test "$cross_compiling" = yes || 2635 AS_TEST_X([conftest$ac_exeext]) 2636 }], 2637 [ac_retval=0], 2638 [_AC_MSG_LOG_CONFTEST 2639 ac_retval=1]) 2640 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information 2641 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would 2642 # interfere with the next link command; also delete a directory that is 2643 # left behind by Apple's compiler. We do this before executing the actions. 2644 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 2645 AS_LINENO_POP 2646 AS_SET_STATUS([$ac_retval]) 2647])# _AC_LINK_IFELSE_BODY 2648 2649 2650# _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2651# ------------------------------------------------------------- 2652# Try to link PROGRAM. 2653# This macro can be used during the selection of a compiler. 2654# 2655# Test that resulting file is executable; see the problem reported by mwoehlke 2656# in <http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00048.html>. 2657# But skip the test when cross-compiling, to prevent problems like the one 2658# reported by Chris Johns in 2659# <http://lists.gnu.org/archive/html/autoconf/2007-03/msg00085.html>. 2660# 2661AC_DEFUN([_AC_LINK_IFELSE], 2662[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_link], 2663 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_link], [LINENO], 2664 [Try to link conftest.$ac_ext, and return whether this succeeded.])], 2665 [$0_BODY])]dnl 2666[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl 2667[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_link "$LINENO"], [$2], [$3]) 2668rm -f core conftest.err conftest.$ac_objext \ 2669 conftest$ac_exeext[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl 2670])# _AC_LINK_IFELSE 2671 2672 2673# AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2674# ------------------------------------------------------------ 2675# Try to link PROGRAM. Requires that the compiler for the current 2676# language was checked for, hence do not use this macro in macros looking 2677# for a compiler. 2678AC_DEFUN([AC_LINK_IFELSE], 2679[AC_LANG_COMPILER_REQUIRE()dnl 2680_AC_LINK_IFELSE($@)]) 2681 2682 2683# AC_TRY_LINK(INCLUDES, FUNCTION-BODY, 2684# [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2685# ------------------------------------------------ 2686# Contrarily to AC_LINK_IFELSE, this macro double quote its first two args. 2687AU_DEFUN([AC_TRY_LINK], 2688[AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])]) 2689 2690 2691# AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, 2692# ACTION-IF-TRUE, [ACTION-IF-FALSE]) 2693# --------------------------------------------------- 2694AU_DEFUN([AC_COMPILE_CHECK], 2695[m4_ifvaln([$1], [AC_MSG_CHECKING([for $1])])dnl 2696AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])]) 2697 2698 2699 2700 2701## ------------------------------- ## 2702## Checking for runtime features. ## 2703## ------------------------------- ## 2704 2705 2706# _AC_RUN_IFELSE_BODY 2707# ------------------- 2708# Shell function body for _AC_RUN_IFELSE. 2709m4_define([_AC_RUN_IFELSE_BODY], 2710[ AS_LINENO_PUSH([$[]1]) 2711 AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)], 2712 [ac_retval=0], 2713 [AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD 2714 _AC_MSG_LOG_CONFTEST 2715 ac_retval=$ac_status]) 2716 rm -rf conftest.dSYM conftest_ipa8_conftest.oo 2717 AS_LINENO_POP 2718 AS_SET_STATUS([$ac_retval]) 2719])# _AC_RUN_IFELSE_BODY 2720 2721 2722# _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 2723# ------------------------------------------------------------ 2724# Compile, link, and run. 2725# This macro can be used during the selection of a compiler. 2726# We also remove conftest.o as if the compilation fails, some compilers 2727# don't remove it. We remove gmon.out and bb.out, which may be 2728# created during the run if the program is built with profiling support. 2729AC_DEFUN([_AC_RUN_IFELSE], 2730[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_try_run], 2731 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_try_run], [LINENO], 2732 [Try to link conftest.$ac_ext, and return whether this succeeded. 2733 Assumes that executables *can* be run.])], 2734 [$0_BODY])]dnl 2735[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])]dnl 2736[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_try_run "$LINENO"], [$2], [$3]) 2737rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ 2738 conftest.$ac_objext conftest.beam[]m4_ifval([$1], [ conftest.$ac_ext])[]dnl 2739])# _AC_RUN_IFELSE 2740 2741# AC_RUN_IFELSE(PROGRAM, 2742# [ACTION-IF-TRUE], [ACTION-IF-FALSE], 2743# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) 2744# ---------------------------------------------------------- 2745# Compile, link, and run. Requires that the compiler for the current 2746# language was checked for, hence do not use this macro in macros looking 2747# for a compiler. 2748AC_DEFUN([AC_RUN_IFELSE], 2749[AC_LANG_COMPILER_REQUIRE()dnl 2750m4_ifval([$4], [], 2751 [AC_DIAGNOSE([cross], 2752 [$0 called without default to allow cross compiling])])dnl 2753AS_IF([test "$cross_compiling" = yes], 2754 [m4_default([$4], 2755 [AC_MSG_FAILURE([cannot run test program while cross compiling])])], 2756 [_AC_RUN_IFELSE($@)]) 2757]) 2758 2759 2760# AC_TRY_RUN(PROGRAM, 2761# [ACTION-IF-TRUE], [ACTION-IF-FALSE], 2762# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) 2763# ------------------------------------------------------- 2764AU_DEFUN([AC_TRY_RUN], 2765[AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])]) 2766 2767 2768 2769## ------------------------------------- ## 2770## Checking for the existence of files. ## 2771## ------------------------------------- ## 2772 2773# AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2774# ------------------------------------------------------------- 2775# 2776# Check for the existence of FILE. 2777AC_DEFUN([AC_CHECK_FILE], 2778[AC_DIAGNOSE([cross], 2779 [cannot check for file existence when cross compiling])dnl 2780AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl 2781AC_CACHE_CHECK([for $1], [ac_File], 2782[test "$cross_compiling" = yes && 2783 AC_MSG_ERROR([cannot check for file existence when cross compiling]) 2784if test -r "$1"; then 2785 AS_VAR_SET([ac_File], [yes]) 2786else 2787 AS_VAR_SET([ac_File], [no]) 2788fi]) 2789AS_VAR_IF([ac_File], [yes], [$2], [$3]) 2790AS_VAR_POPDEF([ac_File])dnl 2791])# AC_CHECK_FILE 2792 2793 2794# _AC_CHECK_FILES(FILE) 2795# --------------------- 2796# Helper to AC_CHECK_FILES, which generates two of the three arguments 2797# to AC_CHECK_FILE based on FILE. 2798m4_define([_AC_CHECK_FILES], 2799[[$1], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]), [1], 2800 [Define to 1 if you have the file `$1'.])]]) 2801 2802 2803# AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 2804# ----------------------------------------------------------------- 2805# For each word in the whitespace-separated FILE list, perform either 2806# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND. For files that exist, also 2807# provide the preprocessor variable HAVE_FILE. 2808AC_DEFUN([AC_CHECK_FILES], 2809[m4_map_args_w([$1], [AC_CHECK_FILE(_$0(], [)[$2], [$3])])]) 2810 2811 2812## ------------------------------- ## 2813## Checking for declared symbols. ## 2814## ------------------------------- ## 2815 2816 2817# _AC_CHECK_DECL_BODY 2818# ------------------- 2819# Shell function body for AC_CHECK_DECL. 2820m4_define([_AC_CHECK_DECL_BODY], 2821[ AS_LINENO_PUSH([$[]1]) 2822 [as_decl_name=`echo $][2|sed 's/ *(.*//'`] 2823 [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`] 2824 AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3], 2825 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4], 2826[@%:@ifndef $[]as_decl_name 2827@%:@ifdef __cplusplus 2828 (void) $[]as_decl_use; 2829@%:@else 2830 (void) $[]as_decl_name; 2831@%:@endif 2832@%:@endif 2833])], 2834 [AS_VAR_SET([$[]3], [yes])], 2835 [AS_VAR_SET([$[]3], [no])])]) 2836 AS_LINENO_POP 2837])# _AC_CHECK_DECL_BODY 2838 2839# AC_CHECK_DECL(SYMBOL, 2840# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], 2841# [INCLUDES = DEFAULT-INCLUDES]) 2842# ------------------------------------------------------- 2843# Check whether SYMBOL (a function, variable, or constant) is declared. 2844AC_DEFUN([AC_CHECK_DECL], 2845[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_decl], 2846 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_decl], 2847 [LINENO SYMBOL VAR INCLUDES], 2848 [Tests whether SYMBOL is declared in INCLUDES, setting cache variable 2849 VAR accordingly.])], 2850 [_$0_BODY])]dnl 2851[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl 2852[ac_fn_[]_AC_LANG_ABBREV[]_check_decl ]dnl 2853["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])" 2854AS_VAR_IF([ac_Symbol], [yes], [$2], [$3]) 2855AS_VAR_POPDEF([ac_Symbol])dnl 2856])# AC_CHECK_DECL 2857 2858 2859# _AC_CHECK_DECLS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND, 2860# INCLUDES) 2861# ------------------------------------------------------------- 2862# Helper to AC_CHECK_DECLS, which generates the check for a single 2863# SYMBOL with INCLUDES, performs the AC_DEFINE, then expands 2864# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND. 2865m4_define([_AC_CHECK_DECLS], 2866[AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl 2867[AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])), 2868 [$ac_have_decl], 2869 [Define to 1 if you have the declaration of `$1', 2870 and to 0 if you don't.])]dnl 2871[m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])]) 2872 2873# AC_CHECK_DECLS(SYMBOLS, 2874# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], 2875# [INCLUDES = DEFAULT-INCLUDES]) 2876# -------------------------------------------------------- 2877# Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the 2878# documentation for a detailed explanation of this difference with 2879# other AC_CHECK_*S macros. SYMBOLS is an m4 list. 2880AC_DEFUN([AC_CHECK_DECLS], 2881[m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)]) 2882 2883 2884# _AC_CHECK_DECL_ONCE(SYMBOL) 2885# --------------------------- 2886# Check for a single SYMBOL once. 2887m4_define([_AC_CHECK_DECL_ONCE], 2888[AC_DEFUN([_AC_Check_Decl_$1], [_AC_CHECK_DECLS([$1])])]dnl 2889[AC_REQUIRE([_AC_Check_Decl_$1])]) 2890 2891# AC_CHECK_DECLS_ONCE(SYMBOLS) 2892# ---------------------------- 2893# Like AC_CHECK_DECLS(SYMBOLS), but do it at most once. 2894AC_DEFUN([AC_CHECK_DECLS_ONCE], 2895[m4_map_args_sep([_AC_CHECK_DECL_ONCE(], [)], [], $1)]) 2896 2897 2898 2899## ---------------------------------- ## 2900## Replacement of library functions. ## 2901## ---------------------------------- ## 2902 2903 2904# AC_CONFIG_LIBOBJ_DIR(DIRNAME) 2905# ----------------------------- 2906# Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME. 2907AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR], 2908[m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])]) 2909 2910 2911# AC_LIBSOURCE(FILE-NAME) 2912# ----------------------- 2913# Announce we might need the file `FILE-NAME'. 2914m4_define([AC_LIBSOURCE], []) 2915 2916 2917# AC_LIBSOURCES([FILE-NAME1, ...]) 2918# -------------------------------- 2919# Announce we might need these files. 2920AC_DEFUN([AC_LIBSOURCES], 2921[m4_map_args([AC_LIBSOURCE], $1)]) 2922 2923 2924# _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR) 2925# -------------------------------------------- 2926# We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. 2927m4_define([_AC_LIBOBJ], 2928[case " $LIB@&t@OBJS " in 2929 *" $1.$ac_objext "* ) ;; 2930 *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;; 2931esac 2932]) 2933 2934 2935# AC_LIBOBJ(FILE-NAME-NOEXT) 2936# -------------------------- 2937# We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'. 2938AC_DEFUN([AC_LIBOBJ], 2939[_AC_LIBOBJ([$1])]dnl 2940[AS_LITERAL_WORD_IF([$1], [AC_LIBSOURCE([$1.c])], 2941 [AC_DIAGNOSE([syntax], [$0($1): you should use literals])])]) 2942 2943 2944# _AC_LIBOBJS_NORMALIZE 2945# --------------------- 2946# Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext, 2947# 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three. 2948# Used with AC_CONFIG_COMMANDS_PRE. 2949AC_DEFUN([_AC_LIBOBJS_NORMALIZE], 2950[ac_libobjs= 2951ac_ltlibobjs= 2952m4_ifndef([AM_C_PROTOTYPES], [U= 2953])dnl 2954for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue 2955 # 1. Remove the extension, and $U if already installed. 2956 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' 2957 ac_i=`AS_ECHO(["$ac_i"]) | sed "$ac_script"` 2958 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR 2959 # will be set to the directory where LIBOBJS objects are built. 2960 AS_VAR_APPEND([ac_libobjs], [" \${LIBOBJDIR}$ac_i\$U.$ac_objext"]) 2961 AS_VAR_APPEND([ac_ltlibobjs], [" \${LIBOBJDIR}$ac_i"'$U.lo']) 2962done 2963AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) 2964AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) 2965]) 2966 2967 2968## ----------------------------------- ## 2969## Checking compiler characteristics. ## 2970## ----------------------------------- ## 2971 2972 2973# _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS], 2974# [IF-FAILURE]) 2975# --------------------------------------------------------------------- 2976# Compute the integer EXPRESSION and store the result in the VARIABLE. 2977# Works OK if cross compiling, but assumes twos-complement arithmetic. 2978m4_define([_AC_COMPUTE_INT_COMPILE], 2979[# Depending upon the size, compute the lo and hi bounds. 2980_AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])], 2981 [ac_lo=0 ac_mid=0 2982 while :; do 2983 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])], 2984 [ac_hi=$ac_mid; break], 2985 [AS_VAR_ARITH([ac_lo], [$ac_mid + 1]) 2986 if test $ac_lo -le $ac_mid; then 2987 ac_lo= ac_hi= 2988 break 2989 fi 2990 AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid + 1])]) 2991 done], 2992[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])], 2993 [ac_hi=-1 ac_mid=-1 2994 while :; do 2995 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])], 2996 [ac_lo=$ac_mid; break], 2997 [AS_VAR_ARITH([ac_hi], ['(' $ac_mid ')' - 1]) 2998 if test $ac_mid -le $ac_hi; then 2999 ac_lo= ac_hi= 3000 break 3001 fi 3002 AS_VAR_ARITH([ac_mid], [2 '*' $ac_mid])]) 3003 done], 3004 [ac_lo= ac_hi=])]) 3005# Binary search between lo and hi bounds. 3006while test "x$ac_lo" != "x$ac_hi"; do 3007 AS_VAR_ARITH([ac_mid], ['(' $ac_hi - $ac_lo ')' / 2 + $ac_lo]) 3008 _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])], 3009 [ac_hi=$ac_mid], 3010 [AS_VAR_ARITH([ac_lo], ['(' $ac_mid ')' + 1])]) 3011done 3012case $ac_lo in @%:@(( 3013?*) AS_VAR_SET([$2], [$ac_lo]); $4 ;; 3014'') $5 ;; 3015esac[]dnl 3016])# _AC_COMPUTE_INT_COMPILE 3017 3018 3019# _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-SUCCESS], 3020# [IF-FAILURE]) 3021# ----------------------------------------------------------------- 3022# Store the evaluation of the integer EXPRESSION in VARIABLE. 3023# 3024# AC_LANG_INT_SAVE intentionally does not end the file in a newline, so 3025# we must add one to make it a text file before passing it to read. 3026m4_define([_AC_COMPUTE_INT_RUN], 3027[_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])], 3028 [echo >>conftest.val; read $2 <conftest.val; $4], [$5]) 3029rm -f conftest.val 3030])# _AC_COMPUTE_INT_RUN 3031 3032 3033# _AC_COMPUTE_INT_BODY 3034# -------------------- 3035# Shell function body for AC_COMPUTE_INT. 3036m4_define([_AC_COMPUTE_INT_BODY], 3037[ AS_LINENO_PUSH([$[]1]) 3038 if test "$cross_compiling" = yes; then 3039 _AC_COMPUTE_INT_COMPILE([$[]2], [$[]3], [$[]4], 3040 [ac_retval=0], [ac_retval=1]) 3041 else 3042 _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4], 3043 [ac_retval=0], [ac_retval=1]) 3044 fi 3045 AS_LINENO_POP 3046 AS_SET_STATUS([$ac_retval]) 3047])# _AC_COMPUTE_INT_BODY 3048 3049# AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS]) 3050# ---------------------------------------------------------- 3051# Store into the shell variable VARIABLE the value of the integer C expression 3052# EXPRESSION. The value should fit in an initializer in a C variable of type 3053# `signed long'. If no PROLOGUE are specified, the default includes are used. 3054# IF-FAILS is evaluated if the value cannot be found (which includes the 3055# case of cross-compilation, if EXPRESSION is not computable at compile-time. 3056AC_DEFUN([AC_COMPUTE_INT], 3057[AC_LANG_COMPILER_REQUIRE()]dnl 3058[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_compute_int], 3059 [AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_compute_int], 3060 [LINENO EXPR VAR INCLUDES], 3061 [Tries to find the compile-time value of EXPR in a program that includes 3062 INCLUDES, setting VAR accordingly. Returns whether the value could 3063 be computed])], 3064 [_$0_BODY])]dnl 3065[AS_IF([ac_fn_[]_AC_LANG_ABBREV[]_compute_int "$LINENO" "$2" "$1" ]dnl 3066 ["AS_ESCAPE([$3], [""])"], 3067 [], [$4]) 3068])# AC_COMPUTE_INT 3069 3070# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS]) 3071# ----------------------------------------------------------- 3072# FIXME: this private interface was used by several packages. 3073# Give them time to transition to AC_COMPUTE_INT and then delete this one. 3074AC_DEFUN([_AC_COMPUTE_INT], 3075[AC_COMPUTE_INT([$2], [$1], [$3], [$4]) 3076AC_DIAGNOSE([obsolete], 3077[The macro `_AC_COMPUTE_INT' is obsolete and will be deleted in a 3078future version or Autoconf. Hence, it is suggested that you use 3079instead the public AC_COMPUTE_INT macro. Note that the arguments are 3080slightly different between the two.])dnl 3081])# _AC_COMPUTE_INT 3082