1
# This file is part of Autoconf. -*- Autoconf -*-
2
# Parameterized macros.
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
4
# Free Software Foundation, Inc.
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2, or (at your option)
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
# As a special exception, the Free Software Foundation gives unlimited
22
# permission to copy, distribute and modify the configure scripts that
23
# are the output of Autoconf. You need not follow the terms of the GNU
24
# General Public License when using or distributing such scripts, even
25
# though portions of the text of Autoconf appear in them. The GNU
26
# General Public License (GPL) does govern all other use of the material
27
# that constitutes the Autoconf program.
29
# Certain portions of the Autoconf source text are designed to be copied
30
# (in certain cases, depending on the input) into the output of
31
# Autoconf. We call these the "data" portions. The rest of the Autoconf
32
# source text consists of comments plus executable code that decides which
33
# of the data portions to output in any given case. We call these
34
# comments and executable code the "non-data" portions. Autoconf never
35
# copies any of the non-data portions into its output.
37
# This special exception to the GPL applies to versions of Autoconf
38
# released by the Free Software Foundation. When you make and
39
# distribute a modified version of Autoconf, you may extend this special
40
# exception to the GPL to apply to your modified version as well, *unless*
41
# your modified version has the potential to copy into its output some
42
# of the text that was the non-data portion of the version that you started
43
# with. (In other words, unless your change moves or copies text from
44
# the non-data portions to the data portions.) If your modification has
45
# such potential, you must delete any notice of this special exception
46
# to the GPL from your modified version.
48
# Written by David MacKenzie, with help from
49
# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
50
# Roland McGrath, Noah Friedman, david d zuhn, and many others.
53
## ---------------- ##
55
## ---------------- ##
58
# We heavily use m4's diversions both for the initializations and for
59
# required macros (see AC_REQUIRE), because in both cases we have to
60
# issue high in `configure' something which is discovered late.
62
# KILL is only used to suppress output.
64
# The layers of `configure'. We let m4 undivert them by itself, when
65
# it reaches the end of `configure.ac'.
72
# Purpose of the script.
76
# Initialization of bottom layers.
79
# early initializations (defaults)
81
# initialization code, option handling loop.
84
# Handling `configure --help'.
86
# Help msg for AC_CANONICAL_*
88
# Help msg from AC_ARG_ENABLE.
90
# Help msg from AC_ARG_WITH.
92
# Help msg from AC_ARG_VAR.
94
# A small paragraph on the use of the variables.
96
# Tail of the handling of --help.
99
# Head of the handling of --version.
101
# FSF copyright notice for --version.
103
# User copyright notice for --version.
105
# Tail of the handling of --version.
108
# Tail of initialization code.
111
# the tests and output code
115
# _m4_divert(DIVERSION-NAME)
116
# --------------------------
117
# Convert a diversion name into its number. Otherwise, return
118
# DIVERSION-NAME which is supposed to be an actual diversion number.
119
# Of course it would be nicer to use m4_case here, instead of zillions
120
# of little macros, but it then takes twice longer to run `autoconf'!
130
# 3. HEADER-COPYRIGHT
133
m4_define([_m4_divert(DEFAULTS)], 10)
134
m4_define([_m4_divert(PARSE_ARGS)], 20)
136
m4_define([_m4_divert(HELP_BEGIN)], 100)
137
m4_define([_m4_divert(HELP_CANON)], 101)
138
m4_define([_m4_divert(HELP_ENABLE)], 102)
139
m4_define([_m4_divert(HELP_WITH)], 103)
140
m4_define([_m4_divert(HELP_VAR)], 104)
141
m4_define([_m4_divert(HELP_VAR_END)], 105)
142
m4_define([_m4_divert(HELP_END)], 106)
144
m4_define([_m4_divert(VERSION_BEGIN)], 200)
145
m4_define([_m4_divert(VERSION_FSF)], 201)
146
m4_define([_m4_divert(VERSION_USER)], 202)
147
m4_define([_m4_divert(VERSION_END)], 203)
149
m4_define([_m4_divert(INIT_PREPARE)], 300)
153
# AC_DIVERT_PUSH(DIVERSION-NAME)
155
# ------------------------------
156
m4_copy([m4_divert_push],[AC_DIVERT_PUSH])
157
m4_copy([m4_divert_pop], [AC_DIVERT_POP])
161
## ------------------------------------ ##
162
## Defining/requiring Autoconf macros. ##
163
## ------------------------------------ ##
166
# AC_DEFUN(NAME, EXPANSION)
167
# AC_DEFUN_ONCE(NAME, EXPANSION)
168
# AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
170
# AC_PROVIDE(MACRO-NAME)
171
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
172
# -----------------------------------------------------------
173
m4_copy([m4_defun], [AC_DEFUN])
174
m4_copy([m4_defun_once], [AC_DEFUN_ONCE])
175
m4_copy([m4_before], [AC_BEFORE])
176
m4_copy([m4_require], [AC_REQUIRE])
177
m4_copy([m4_provide], [AC_PROVIDE])
178
m4_copy([m4_provide_if], [AC_PROVIDE_IFELSE])
181
# AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION])
182
# ------------------------------------------
183
m4_define([AC_OBSOLETE],
184
[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
188
## ----------------------------- ##
189
## Implementing Autoconf loops. ##
190
## ----------------------------- ##
193
# AC_FOREACH(VARIABLE, LIST, EXPRESSION)
194
# --------------------------------------
196
# Compute EXPRESSION assigning to VARIABLE each value of the LIST.
197
# LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2
198
# ... item_n ': white spaces are separators, and leading and trailing
199
# spaces are meaningless.
201
# This macro is robust to active symbols:
202
# AC_FOREACH([Var], [ active
205
# => -active--b--active-end
206
m4_define([AC_FOREACH],
207
[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
212
## ----------------------------------- ##
213
## Helping macros to display strings. ##
214
## ----------------------------------- ##
217
# AC_HELP_STRING(LHS, RHS, [COLUMN])
218
# ----------------------------------
220
# Format an Autoconf macro's help string so that it looks pretty when
221
# the user executes "configure --help". This macro takes three
222
# arguments, a "left hand side" (LHS), a "right hand side" (RHS), and
223
# the COLUMN which is a string of white spaces which leads to the
224
# the RHS column (default: 26 white spaces).
226
# The resulting string is suitable for use in other macros that require
227
# a help string (e.g. AC_ARG_WITH).
229
# Here is the sample string from the Autoconf manual (Node: External
230
# Software) which shows the proper spacing for help strings.
232
# --with-readline support fancy command line editing
235
# | column 2 column 26
239
# A help string is made up of a "left hand side" (LHS) and a "right
240
# hand side" (RHS). In the example above, the LHS is
241
# "--with-readline", while the RHS is "support fancy command line
244
# If the LHS extends past column 24, then the LHS is terminated with a
245
# newline so that the RHS is on a line of its own beginning in column
248
# Therefore, if the LHS were instead "--with-readline-blah-blah-blah",
249
# then the AC_HELP_STRING macro would expand into:
252
# --with-readline-blah-blah-blah
253
# ^ ^ support fancy command line editing
258
m4_define([AC_HELP_STRING],
259
[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
260
m4_pushdef([AC_Prefix_Format],
261
[ %-]m4_eval(m4_len(AC_Prefix) - 3)[s ])dnl [ %-23s ]
262
m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
263
m4_popdef([AC_Prefix_Format])dnl
264
m4_popdef([AC_Prefix])dnl
270
## ---------------------------------------------- ##
271
## Information on the package being Autoconf'ed. ##
272
## ---------------------------------------------- ##
275
# It is suggested that the macros in this section appear before
276
# AC_INIT in `configure.ac'. Nevertheless, this is just stylistic,
277
# and from the implementation point of, AC_INIT *must* be expanded
278
# beforehand: it puts data in diversions which must appear before the
279
# data provided by the macros of this section.
281
# The solution is to require AC_INIT in each of these macros. AC_INIT
282
# has the needed magic so that it can't be expanded twice.
286
# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME])
287
# --------------------------------------------------------------
288
m4_define([_AC_INIT_PACKAGE],
289
[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])
290
AS_LITERAL_IF([$2], [], [m4_warn([syntax], [AC_INIT: not a literal: $2])])
291
AS_LITERAL_IF([$3], [], [m4_warn([syntax], [AC_INIT: not a literal: $3])])
292
m4_ifndef([AC_PACKAGE_NAME],
293
[m4_define([AC_PACKAGE_NAME], [$1])])
294
m4_ifndef([AC_PACKAGE_TARNAME],
295
[m4_define([AC_PACKAGE_TARNAME],
297
[m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]],
299
[[^abcdefghijklmnopqrstuvwxyz0123456789]],
301
m4_ifndef([AC_PACKAGE_VERSION],
302
[m4_define([AC_PACKAGE_VERSION], [$2])])
303
m4_ifndef([AC_PACKAGE_STRING],
304
[m4_define([AC_PACKAGE_STRING], [$1 $2])])
305
m4_ifndef([AC_PACKAGE_BUGREPORT],
306
[m4_define([AC_PACKAGE_BUGREPORT], [$3])])
310
# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])
311
# ------------------------------------------------------
312
# Append Copyright information in the top of `configure'. TEXT is
313
# evaluated once, hence TEXT can use macros. Note that we do not
314
# prepend `# ' but `@%:@ ', since m4 does not evaluate the comments.
315
# Had we used `# ', the Copyright sent in the beginning of `configure'
316
# would have not been evaluated. Another solution, a bit fragile,
317
# would have be to use m4_quote to force an evaluation:
319
# m4_bpatsubst(m4_quote($1), [^], [# ])
320
m4_define([AC_COPYRIGHT],
321
[m4_divert_text([HEADER-COPYRIGHT],
323
$1], [^], [@%:@ ])])dnl
324
m4_divert_text(m4_default([$2], [VERSION_USER]),
330
# AC_REVISION(REVISION-INFO)
331
# --------------------------
332
# The second quote in the translit is just to cope with font-lock-mode
333
# which sees the opening of a string.
334
m4_define([AC_REVISION],
335
[m4_divert_text([HEADER-REVISION],
336
[@%:@ From __file__ m4_translit([$1], [$""]).])dnl
342
## ---------------------------------------- ##
343
## Requirements over the Autoconf version. ##
344
## ---------------------------------------- ##
347
# AU::AC_PREREQ(VERSION)
348
# ----------------------
349
# Update this `AC_PREREQ' statement to require the current version of
350
# Autoconf. But fail if ever this autoupdate is too old.
352
# Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before
353
# calling `AU_DEFUN', i.e., it is hard coded. Otherwise it would be
354
# quite complex for autoupdate to import the value of
355
# `m4_PACKAGE_VERSION'. We could `AU_DEFUN' `m4_PACKAGE_VERSION', but
356
# this would replace all its occurrences with the current version of
357
# Autoconf, which is certainly not what the user intended.
358
AU_DEFUN([AC_PREREQ],
359
[m4_version_prereq([$1])[]dnl
360
[AC_PREREQ(]]m4_defn([m4_PACKAGE_VERSION])[[)]])
365
# Complain and exit if the Autoconf version is less than VERSION.
366
m4_copy([m4_version_prereq], [AC_PREREQ])
373
## ---------------- ##
374
## Initialization. ##
375
## ---------------- ##
378
# All the following macros are used by AC_INIT. Ideally, they should
379
# be presented in the order in which they are output. Please, help us
380
# sorting it, or at least, don't augment the entropy.
385
m4_define([_AC_INIT_NOTICE],
386
[m4_divert_text([HEADER-COMMENT],
387
[@%:@ Guess values for system-dependent variables and create Makefiles.
388
@%:@ Generated by m4_PACKAGE_STRING[]dnl
389
m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
391
m4_ifset([AC_PACKAGE_BUGREPORT],
392
[m4_divert_text([HEADER-COMMENT],
394
@%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
400
# We dump to VERSION_FSF to make sure we are inserted before the
401
# user copyrights, and after the setup of the --version handling.
402
m4_define([_AC_INIT_COPYRIGHT],
404
[Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
405
Free Software Foundation, Inc.
406
This configure script is free software; the Free Software Foundation
407
gives unlimited permission to copy, distribute and modify it.],
414
# Set up the file descriptors used by `configure'.
415
# File descriptor usage:
418
# 2 errors and warnings
419
# AS_MESSAGE_LOG_FD compiler messages saved in config.log
420
# AS_MESSAGE_FD checking for... messages and results
422
m4_define([AS_MESSAGE_FD], 6)
423
# That's how they used to be named.
424
AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD])
425
AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
430
# Values which defaults can be set from `configure.ac'.
431
# `/bin/machine' is used in `glibcbug'. The others are used in config.*
432
m4_define([_AC_INIT_DEFAULTS],
433
[m4_divert_push([DEFAULTS])dnl
438
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
439
# so uname gets run too.
440
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
442
exec AS_MESSAGE_FD>&1
447
ac_default_prefix=/usr/local
452
AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])dnl
453
AC_SUBST([PATH_SEPARATOR])dnl
455
# Maximum number of lines to put in a shell here document.
456
# This variable seems obsolete. It should probably be removed, and
457
# only ac_max_sed_lines should be used.
458
: ${ac_max_here_lines=38}
460
# Identity of this package.
461
AC_SUBST([PACKAGE_NAME],
462
[m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnl
463
AC_SUBST([PACKAGE_TARNAME],
464
[m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl
465
AC_SUBST([PACKAGE_VERSION],
466
[m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])dnl
467
AC_SUBST([PACKAGE_STRING],
468
[m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl
469
AC_SUBST([PACKAGE_BUGREPORT],
470
[m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
472
m4_divert_pop([DEFAULTS])dnl
473
])# _AC_INIT_DEFAULTS
476
# AC_PREFIX_DEFAULT(PREFIX)
477
# -------------------------
478
AC_DEFUN([AC_PREFIX_DEFAULT],
479
[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
482
# AC_PREFIX_PROGRAM(PROGRAM)
483
# --------------------------
484
# Guess the value for the `prefix' variable by looking for
485
# the argument program along PATH and taking its parent.
486
# Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
487
# set `prefix' to /usr/local/gnu.
488
# This comes too late to find a site file based on the prefix,
489
# and it might use a cached value for the path.
490
# No big loss, I think, since most configures don't use this macro anyway.
491
AC_DEFUN([AC_PREFIX_PROGRAM],
492
[if test "x$prefix" = xNONE; then
493
dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
494
_AS_ECHO_N([checking for prefix by ])
495
AC_PATH_PROG(ac_prefix_program, [$1])
496
if test -n $ac_prefix_program; then
497
prefix=`AS_DIRNAME(["$ac_prefix_program"])`
498
prefix=`AS_DIRNAME(["$prefix"])`
501
])# AC_PREFIX_PROGRAM
504
# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
505
# ---------------------------------------------
506
# UNIQUE-FILE-IN-SOURCE-DIR is a filename unique to this package,
507
# relative to the directory that configure is in, which we can look
508
# for to find out if srcdir is correct.
509
AC_DEFUN([AC_CONFIG_SRCDIR],
510
[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
515
# Compute `srcdir' based on `$ac_unique_file'.
516
m4_define([_AC_INIT_SRCDIR],
517
[m4_divert_push([PARSE_ARGS])dnl
519
# Find the source files, if location was not specified.
520
if test -z "$srcdir"; then
521
ac_srcdir_defaulted=yes
522
# Try the directory containing this script, then its parent.
523
ac_confdir=`AS_DIRNAME(["$[0]"])`
525
if test ! -r $srcdir/$ac_unique_file; then
529
ac_srcdir_defaulted=no
531
if test ! -r $srcdir/$ac_unique_file; then
532
if test "$ac_srcdir_defaulted" = yes; then
533
AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $ac_confdir or ..])
535
AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
538
dnl Double slashes in pathnames in object file debugging info
539
dnl mess up M-x gdb in Emacs.
540
srcdir=`echo "$srcdir" | sed 's%\([[^\\/]]\)[[\\/]]*$%\1%'`
541
m4_divert_pop([PARSE_ARGS])dnl
545
# _AC_INIT_PARSE_ARGS
546
# -------------------
547
m4_define([_AC_INIT_PARSE_ARGS],
548
[m4_divert_push([PARSE_ARGS])dnl
550
# Initialize some variables set by options.
552
ac_init_version=false
553
# The variables have the same names as the options, with
554
# dashes changed to underlines.
556
AC_SUBST(exec_prefix, NONE)dnl
559
AC_SUBST(prefix, NONE)dnl
562
AC_SUBST(program_transform_name, [s,x,x,])dnl
570
# Installation directory options.
571
# These are left unexpanded so users can "make install exec_prefix=/foo"
572
# and all the variables that are supposed to be based on exec_prefix
573
# by default will actually change.
574
# Use braces instead of parens because sh, perl, etc. also accept them.
575
AC_SUBST([bindir], ['${exec_prefix}/bin'])dnl
576
AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl
577
AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])dnl
578
AC_SUBST([datadir], ['${prefix}/share'])dnl
579
AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl
580
AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
581
AC_SUBST([localstatedir], ['${prefix}/var'])dnl
582
AC_SUBST([libdir], ['${exec_prefix}/lib'])dnl
583
AC_SUBST([includedir], ['${prefix}/include'])dnl
584
AC_SUBST([oldincludedir], ['/usr/include'])dnl
585
AC_SUBST([infodir], ['${prefix}/info'])dnl
586
AC_SUBST([mandir], ['${prefix}/man'])dnl
591
# If the previous option needs an argument, assign it.
592
if test -n "$ac_prev"; then
593
eval "$ac_prev=\$ac_option"
598
ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'`
600
# Accept the important Cygnus configure options, so we can diagnose typos.
604
-bindir | --bindir | --bindi | --bind | --bin | --bi)
606
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
609
-build | --build | --buil | --bui | --bu)
610
ac_prev=build_alias ;;
611
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
612
build_alias=$ac_optarg ;;
614
-cache-file | --cache-file | --cache-fil | --cache-fi \
615
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
616
ac_prev=cache_file ;;
617
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
618
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
619
cache_file=$ac_optarg ;;
622
cache_file=config.cache ;;
624
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
626
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
628
datadir=$ac_optarg ;;
630
-disable-* | --disable-*)
631
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
632
# Reject names that are not valid shell variable names.
633
expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
634
AC_MSG_ERROR([invalid feature name: $ac_feature])
635
ac_feature=`echo $ac_feature | sed 's/-/_/g'`
636
eval "enable_$ac_feature=no" ;;
638
-enable-* | --enable-*)
639
ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'`
640
# Reject names that are not valid shell variable names.
641
expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
642
AC_MSG_ERROR([invalid feature name: $ac_feature])
643
ac_feature=`echo $ac_feature | sed 's/-/_/g'`
645
*=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
648
eval "enable_$ac_feature='$ac_optarg'" ;;
650
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
651
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
652
| --exec | --exe | --ex)
653
ac_prev=exec_prefix ;;
654
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
655
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
656
| --exec=* | --exe=* | --ex=*)
657
exec_prefix=$ac_optarg ;;
659
-gas | --gas | --ga | --g)
660
# Obsolete; use --with-gas.
663
-help | --help | --hel | --he | -h)
665
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
666
ac_init_help=recursive ;;
667
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
668
ac_init_help=short ;;
670
-host | --host | --hos | --ho)
671
ac_prev=host_alias ;;
672
-host=* | --host=* | --hos=* | --ho=*)
673
host_alias=$ac_optarg ;;
675
-includedir | --includedir | --includedi | --included | --include \
676
| --includ | --inclu | --incl | --inc)
677
ac_prev=includedir ;;
678
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
679
| --includ=* | --inclu=* | --incl=* | --inc=*)
680
includedir=$ac_optarg ;;
682
-infodir | --infodir | --infodi | --infod | --info | --inf)
684
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
685
infodir=$ac_optarg ;;
687
-libdir | --libdir | --libdi | --libd)
689
-libdir=* | --libdir=* | --libdi=* | --libd=*)
692
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
693
| --libexe | --libex | --libe)
694
ac_prev=libexecdir ;;
695
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
696
| --libexe=* | --libex=* | --libe=*)
697
libexecdir=$ac_optarg ;;
699
-localstatedir | --localstatedir | --localstatedi | --localstated \
700
| --localstate | --localstat | --localsta | --localst \
701
| --locals | --local | --loca | --loc | --lo)
702
ac_prev=localstatedir ;;
703
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
704
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
705
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
706
localstatedir=$ac_optarg ;;
708
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
710
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
714
# Obsolete; use --without-fp.
717
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
718
| --no-cr | --no-c | -n)
721
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
722
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
725
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
726
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
727
| --oldin | --oldi | --old | --ol | --o)
728
ac_prev=oldincludedir ;;
729
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
730
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
731
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
732
oldincludedir=$ac_optarg ;;
734
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
736
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
739
-program-prefix | --program-prefix | --program-prefi | --program-pref \
740
| --program-pre | --program-pr | --program-p)
741
ac_prev=program_prefix ;;
742
-program-prefix=* | --program-prefix=* | --program-prefi=* \
743
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
744
program_prefix=$ac_optarg ;;
746
-program-suffix | --program-suffix | --program-suffi | --program-suff \
747
| --program-suf | --program-su | --program-s)
748
ac_prev=program_suffix ;;
749
-program-suffix=* | --program-suffix=* | --program-suffi=* \
750
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
751
program_suffix=$ac_optarg ;;
753
-program-transform-name | --program-transform-name \
754
| --program-transform-nam | --program-transform-na \
755
| --program-transform-n | --program-transform- \
756
| --program-transform | --program-transfor \
757
| --program-transfo | --program-transf \
758
| --program-trans | --program-tran \
759
| --progr-tra | --program-tr | --program-t)
760
ac_prev=program_transform_name ;;
761
-program-transform-name=* | --program-transform-name=* \
762
| --program-transform-nam=* | --program-transform-na=* \
763
| --program-transform-n=* | --program-transform-=* \
764
| --program-transform=* | --program-transfor=* \
765
| --program-transfo=* | --program-transf=* \
766
| --program-trans=* | --program-tran=* \
767
| --progr-tra=* | --program-tr=* | --program-t=*)
768
program_transform_name=$ac_optarg ;;
770
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
771
| -silent | --silent | --silen | --sile | --sil)
774
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
776
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
778
sbindir=$ac_optarg ;;
780
-sharedstatedir | --sharedstatedir | --sharedstatedi \
781
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
782
| --sharedst | --shareds | --shared | --share | --shar \
784
ac_prev=sharedstatedir ;;
785
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
786
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
787
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
789
sharedstatedir=$ac_optarg ;;
791
-site | --site | --sit)
793
-site=* | --site=* | --sit=*)
796
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
798
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
801
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
802
| --syscon | --sysco | --sysc | --sys | --sy)
803
ac_prev=sysconfdir ;;
804
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
805
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
806
sysconfdir=$ac_optarg ;;
808
-target | --target | --targe | --targ | --tar | --ta | --t)
809
ac_prev=target_alias ;;
810
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
811
target_alias=$ac_optarg ;;
813
-v | -verbose | --verbose | --verbos | --verbo | --verb)
816
-version | --version | --versio | --versi | --vers | -V)
820
ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'`
821
# Reject names that are not valid shell variable names.
822
expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
823
AC_MSG_ERROR([invalid package name: $ac_package])
824
ac_package=`echo $ac_package| sed 's/-/_/g'`
826
*=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
829
eval "with_$ac_package='$ac_optarg'" ;;
831
-without-* | --without-*)
832
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
833
# Reject names that are not valid shell variable names.
834
expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null &&
835
AC_MSG_ERROR([invalid package name: $ac_package])
836
ac_package=`echo $ac_package | sed 's/-/_/g'`
837
eval "with_$ac_package=no" ;;
840
# Obsolete; use --with-x.
843
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
844
| --x-incl | --x-inc | --x-in | --x-i)
845
ac_prev=x_includes ;;
846
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
847
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
848
x_includes=$ac_optarg ;;
850
-x-libraries | --x-libraries | --x-librarie | --x-librari \
851
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
852
ac_prev=x_libraries ;;
853
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
854
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
855
x_libraries=$ac_optarg ;;
857
-*) AC_MSG_ERROR([unrecognized option: $ac_option
858
Try `$[0] --help' for more information.])
862
ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
863
# Reject names that are not valid shell variable names.
864
expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
865
AC_MSG_ERROR([invalid variable name: $ac_envvar])
866
ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
867
eval "$ac_envvar='$ac_optarg'"
871
# FIXME: should be removed in autoconf 3.0.
872
AC_MSG_WARN([you should use --build, --host, --target])
873
expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
874
AC_MSG_WARN([invalid host type: $ac_option])
875
: ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
881
if test -n "$ac_prev"; then
882
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
883
AC_MSG_ERROR([missing argument to $ac_option])
886
# Be sure to have absolute paths.
887
for ac_var in exec_prefix prefix
889
eval ac_val=$`echo $ac_var`
891
[[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;;
892
*) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
896
# Be sure to have absolute paths.
897
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
898
localstatedir libdir includedir oldincludedir infodir mandir
900
eval ac_val=$`echo $ac_var`
902
[[\\/$]]* | ?:[[\\/]]* ) ;;
903
*) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);;
907
# There might be people who depend on the old broken behavior: `$host'
908
# used to hold the argument of --host etc.
909
# FIXME: To remove some day.
914
# FIXME: To remove some day.
915
if test "x$host_alias" != x; then
916
if test "x$build_alias" = x; then
917
cross_compiling=maybe
918
AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
919
If a cross compiler is detected then cross compile mode will be used.])
920
elif test "x$build_alias" != "x$host_alias"; then
926
test -n "$host_alias" && ac_tool_prefix=$host_alias-
928
test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
930
m4_divert_pop([PARSE_ARGS])dnl
931
])# _AC_INIT_PARSE_ARGS
936
# Handle the `configure --help' message.
937
m4_define([_AC_INIT_HELP],
938
[m4_divert_push([HELP_BEGIN])dnl
941
# Report the --help message.
943
if test "$ac_init_help" = "long"; then
944
# Omit some internal or obsolete options to make the list less imposing.
945
# This message is too long to be a string in the A/UX 3.1 sh.
947
\`configure' configures m4_ifset([AC_PACKAGE_STRING],
949
[this package]) to adapt to many kinds of systems.
951
Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
953
[To assign environment variables (e.g., CC, CFLAGS...), specify them as
954
VAR=VALUE. See below for descriptions of some of the useful variables.
956
Defaults for the options are specified in brackets.
959
-h, --help display this help and exit
960
--help=short display options specific to this package
961
--help=recursive display the short help of all the included packages
962
-V, --version display version information and exit
963
-q, --quiet, --silent do not print \`checking...' messages
964
--cache-file=FILE cache test results in FILE [disabled]
965
-C, --config-cache alias for \`--cache-file=config.cache'
966
-n, --no-create do not create output files
967
--srcdir=DIR find the sources in DIR [configure dir or \`..']
972
Installation directories:
973
--prefix=PREFIX install architecture-independent files in PREFIX
975
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
978
By default, \`make install' will install all the files in
979
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
980
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
981
for instance \`--prefix=\$HOME'.
983
For better control, use the options below.
985
Fine tuning of the installation directories:
986
--bindir=DIR user executables [EPREFIX/bin]
987
--sbindir=DIR system admin executables [EPREFIX/sbin]
988
--libexecdir=DIR program executables [EPREFIX/libexec]
989
--datadir=DIR read-only architecture-independent data [PREFIX/share]
990
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
991
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
992
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
993
--libdir=DIR object code libraries [EPREFIX/lib]
994
--includedir=DIR C header files [PREFIX/include]
995
--oldincludedir=DIR C header files for non-gcc [/usr/include]
996
--infodir=DIR info documentation [PREFIX/info]
997
--mandir=DIR man documentation [PREFIX/man]
1001
m4_divert_pop([HELP_BEGIN])dnl
1002
dnl The order of the diversions here is
1004
dnl which may be prolongated by extra generic options such as with X or
1005
dnl AC_ARG_PROGRAM. Displayed only in long --help.
1008
dnl Support for cross compilation (--build, --host and --target).
1009
dnl Display only in long --help.
1012
dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
1013
dnl then implements the header of the non generic options.
1022
dnl initialized below, in which we dump the trailer (handling of the
1023
dnl recursion for instance).
1024
m4_divert_push([HELP_ENABLE])dnl
1028
if test -n "$ac_init_help"; then
1029
m4_ifset([AC_PACKAGE_STRING],
1030
[ case $ac_init_help in
1031
short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
1034
m4_divert_pop([HELP_ENABLE])dnl
1035
m4_divert_push([HELP_END])dnl
1036
m4_ifset([AC_PACKAGE_BUGREPORT], [
1037
Report bugs to <AC_PACKAGE_BUGREPORT>.])
1041
if test "$ac_init_help" = "recursive"; then
1042
# If there are subdirs, report their specific --help.
1044
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1045
test -d $ac_dir || continue
1046
_AC_SRCPATHS(["$ac_dir"])
1048
# Check for guested configure; otherwise get Cygnus style configure.
1049
if test -f $ac_srcdir/configure.gnu; then
1051
$SHELL $ac_srcdir/configure.gnu --help=recursive
1052
elif test -f $ac_srcdir/configure; then
1054
$SHELL $ac_srcdir/configure --help=recursive
1055
elif test -f $ac_srcdir/configure.ac ||
1056
test -f $ac_srcdir/configure.in; then
1058
$ac_configure --help
1060
AC_MSG_WARN([no configuration information is in $ac_dir])
1066
test -n "$ac_init_help" && exit 0
1067
m4_divert_pop([HELP_END])dnl
1073
# Handle the `configure --version' message.
1074
m4_define([_AC_INIT_VERSION],
1075
[m4_divert_text([VERSION_BEGIN],
1076
[if $ac_init_version; then
1078
m4_ifset([AC_PACKAGE_STRING],
1079
[m4_divert_text([VERSION_BEGIN],
1081
m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
1082
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
1083
generated by m4_PACKAGE_STRING])])
1084
m4_divert_text([VERSION_END],
1088
])# _AC_INIT_VERSION
1091
# _AC_INIT_CONFIG_LOG
1092
# -------------------
1093
# Initialize the config.log file descriptor and write header to it.
1094
m4_define([_AC_INIT_CONFIG_LOG],
1095
[m4_divert_text([INIT_PREPARE],
1096
[m4_define([AS_MESSAGE_LOG_FD], 5)dnl
1097
exec AS_MESSAGE_LOG_FD>config.log
1098
cat >&AS_MESSAGE_LOG_FD <<_ACEOF
1099
This file contains any messages produced by compilers while
1100
running configure, to aid debugging if configure makes a mistake.
1102
It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
1103
$as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
1104
generated by m4_PACKAGE_STRING. Invocation command line was
1109
AS_UNAME >&AS_MESSAGE_LOG_FD
1111
cat >&AS_MESSAGE_LOG_FD <<_ACEOF
1114
m4_text_box([Core tests.])
1117
])])# _AC_INIT_CONFIG_LOG
1122
# Called by AC_INIT to build the preamble of the `configure' scripts.
1123
# 1. Trap and clean up various tmp files.
1124
# 2. Set up the fd and output files
1125
# 3. Remember the options given to `configure' for `config.status --recheck'.
1126
# 4. Ensure a correct environment
1127
# 5. Required macros (cache, default AC_SUBST etc.)
1128
m4_define([_AC_INIT_PREPARE],
1129
[m4_divert_push([INIT_PREPARE])dnl
1131
# Keep a trace of the command line.
1132
# Strip out --no-create and --no-recursion so they do not pile up.
1133
# Also quote any args containing shell meta-characters.
1139
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
1140
| --no-cr | --no-c | -n ) continue ;;
1141
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
1142
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1144
dnl If you change this globbing pattern, test it on an old shell --
1145
dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
1146
[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
1147
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1149
case " $ac_configure_args " in
1150
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
1151
*) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1154
# Get rid of the leading space.
1157
# When interrupted or exit'd, cleanup temporary files, and complete
1158
# config.log. We remove comments because anyway the quotes in there
1159
# would cause problems or look ugly.
1160
# WARNING: Be sure not to use single quotes in there, as some shells,
1161
# such as our DU 5.0 friend, will then `close' the trap.
1162
trap 'exit_status=$?
1163
# Save into config.log some information that might help in debugging.
1166
AS_BOX([Cache variables.])
1168
m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]),
1173
if test -s confdefs.h; then
1174
AS_BOX([confdefs.h.])
1176
sed "/^$/d" confdefs.h
1179
test "$ac_signal" != 0 &&
1180
echo "$as_me: caught signal $ac_signal"
1181
echo "$as_me: exit $exit_status"
1182
} >&AS_MESSAGE_LOG_FD
1183
rm -f core core.* *.core &&
1184
rm -rf conftest* confdefs* conf$[$]* $ac_clean_files &&
1187
for ac_signal in 1 2 13 15; do
1188
trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
1192
# confdefs.h avoids OS command line length limits that DEFS can exceed.
1193
rm -rf conftest* confdefs.h
1194
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
1197
# Predefined preprocessor variables.
1198
AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
1199
[Define to the full name of this package.])
1200
AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
1201
[Define to the one symbol short name of this package.])
1202
AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
1203
[Define to the version of this package.])
1204
AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
1205
[Define to the full name and version of this package.])
1206
AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
1207
[Define to the address where bug reports for this package
1210
# Let the site file select an alternate cache file if it wants to.
1213
_AC_ARG_VAR_VALIDATE
1214
_AC_ARG_VAR_PRECIOUS([build_alias])dnl
1215
_AC_ARG_VAR_PRECIOUS([host_alias])dnl
1216
_AC_ARG_VAR_PRECIOUS([target_alias])dnl
1219
dnl Substitute for predefined variables.
1221
AC_SUBST([ECHO_C])dnl
1222
AC_SUBST([ECHO_N])dnl
1223
AC_SUBST([ECHO_T])dnl
1225
m4_divert_pop([INIT_PREPARE])dnl
1226
])# _AC_INIT_PREPARE
1229
# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
1230
# ----------------------------------------
1231
# This macro is used only for Autoupdate.
1233
[m4_ifval([$2], [[AC_INIT($@)]],
1236
AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
1240
# AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
1241
# ----------------------------------------
1242
# Include the user macro files, prepare the diversions, and output the
1243
# preamble of the `configure' script.
1244
# Note that the order is important: first initialize, then set the
1246
m4_define([AC_INIT],
1247
[# Forbidden tokens and exceptions.
1248
m4_pattern_forbid([^_?A[CHUM]_])
1249
m4_pattern_forbid([_AC_])
1250
m4_pattern_forbid([^LIBOBJS$],
1251
[do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs. LIBOBJS'])
1252
# Actually reserved by M4sh.
1253
m4_pattern_allow([^AS_FLAGS$])
1255
m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
1265
m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
1271
## ----------------------------- ##
1272
## Selecting optional features. ##
1273
## ----------------------------- ##
1276
# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
1277
# ------------------------------------------------------------------------
1278
AC_DEFUN([AC_ARG_ENABLE],
1279
[m4_divert_once([HELP_ENABLE], [[
1281
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1282
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl
1283
m4_divert_once([HELP_ENABLE], [$2])dnl
1284
# Check whether --enable-$1 or --disable-$1 was given.
1285
if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then
1286
enableval="[$enable_]m4_bpatsubst([$1], -, _)"
1288
m4_ifvaln([$4], [else
1294
AU_DEFUN([AC_ENABLE],
1295
[AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])])
1298
## ------------------------------ ##
1299
## Working with optional software ##
1300
## ------------------------------ ##
1304
# AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
1305
# --------------------------------------------------------------------
1306
AC_DEFUN([AC_ARG_WITH],
1307
[m4_divert_once([HELP_WITH], [[
1309
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1310
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
1311
m4_divert_once([HELP_WITH], [$2])dnl
1312
# Check whether --with-$1 or --without-$1 was given.
1313
if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then
1314
withval="[$with_]m4_bpatsubst([$1], -, _)"
1316
m4_ifvaln([$4], [else
1322
[AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])])
1326
## ----------------------------------------- ##
1327
## Remembering variables for reconfiguring. ##
1328
## ----------------------------------------- ##
1331
# _AC_ARG_VAR_PRECIOUS(VARNAME)
1332
# -----------------------------
1333
# Declare VARNAME is precious.
1335
# We try to diagnose when precious variables have changed. To do this,
1336
# make two early snapshots (after the option processing to take
1337
# explicit variables into account) of those variables: one (ac_env_)
1338
# which represents the current run, and a second (ac_cv_env_) which,
1339
# at the first run, will be saved in the cache. As an exception to
1340
# the cache mechanism, its loading will override these variables (non
1341
# `ac_cv_env_' cache value are only set when unset).
1343
# In subsequent runs, after having loaded the cache, compare
1344
# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE.
1345
m4_define([_AC_ARG_VAR_PRECIOUS],
1347
m4_divert_once([PARSE_ARGS],
1348
[ac_env_$1_set=${$1+set}
1350
ac_cv_env_$1_set=${$1+set}
1351
ac_cv_env_$1_value=$$1])dnl
1355
# _AC_ARG_VAR_VALIDATE
1356
# --------------------
1357
# The precious variables are saved twice at the beginning of
1358
# configure. E.g., PRECIOUS, is saved as `ac_env_PRECIOUS_SET' and
1359
# `ac_env_PRECIOUS_VALUE' on the one hand and `ac_cv_env_PRECIOUS_SET'
1360
# and `ac_cv_env_PRECIOUS_VALUE' on the other hand.
1362
# Now the cache has just been load, so `ac_cv_env_' represents the
1363
# content of the cached values, while `ac_env_' represents that of the
1366
# So we check that `ac_env_' and `ac_cv_env_' are consistant. If
1368
m4_define([_AC_ARG_VAR_VALIDATE],
1369
[# Check that the precious variables saved in the cache have kept the same
1371
ac_cache_corrupted=false
1372
for ac_var in `(set) 2>&1 |
1373
sed -n 's/^ac_env_\([[a-zA-Z_0-9]]*\)_set=.*/\1/p'`; do
1374
eval ac_old_set=\$ac_cv_env_${ac_var}_set
1375
eval ac_new_set=\$ac_env_${ac_var}_set
1376
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
1377
eval ac_new_val="\$ac_env_${ac_var}_value"
1378
case $ac_old_set,$ac_new_set in
1380
AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2)
1381
ac_cache_corrupted=: ;;
1383
AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2)
1384
ac_cache_corrupted=: ;;
1387
if test "x$ac_old_val" != "x$ac_new_val"; then
1388
AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
1389
AS_MESSAGE([ former value: $ac_old_val], 2)
1390
AS_MESSAGE([ current value: $ac_new_val], 2)
1391
ac_cache_corrupted=:
1394
# Pass precious variables to config.status.
1395
if test "$ac_new_set" = set; then
1397
dnl If you change this globbing pattern, test it on an old shell --
1398
dnl it's sensitive. Putting any kind of quote in it causes syntax errors.
1399
[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)]
1400
ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
1401
*) ac_arg=$ac_var=$ac_new_val ;;
1403
case " $ac_configure_args " in
1404
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
1405
*) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1409
if $ac_cache_corrupted; then
1410
AS_MESSAGE([error: changes in the environment can compromise the build], 2)
1411
AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
1413
])# _AC_ARG_VAR_VALIDATE
1416
# AC_ARG_VAR(VARNAME, DOCUMENTATION)
1417
# ----------------------------------
1418
# Register VARNAME as a precious variable, and document it in
1419
# `configure --help' (but only once).
1420
AC_DEFUN([AC_ARG_VAR],
1421
[m4_divert_once([HELP_VAR], [[
1422
Some influential environment variables:]])dnl
1423
m4_divert_once([HELP_VAR_END], [[
1424
Use these variables to override the choices made by `configure' or to help
1425
it to find libraries and programs with nonstandard names/locations.]])dnl
1426
m4_expand_once([m4_divert_once([HELP_VAR],
1427
[AC_HELP_STRING([$1], [$2], [ ])])],
1429
_AC_ARG_VAR_PRECIOUS([$1])dnl
1436
## ---------------------------- ##
1437
## Transforming program names. ##
1438
## ---------------------------- ##
1443
# This macro is expanded only once, to avoid that `foo' ends up being
1444
# installed as `ggfoo'.
1445
AC_DEFUN_ONCE([AC_ARG_PROGRAM],
1446
[dnl Document the options.
1447
m4_divert_push([HELP_BEGIN])dnl
1450
--program-prefix=PREFIX prepend PREFIX to installed program names
1451
--program-suffix=SUFFIX append SUFFIX to installed program names
1452
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
1453
m4_divert_pop([HELP_BEGIN])dnl
1454
test "$program_prefix" != NONE &&
1455
program_transform_name="s,^,$program_prefix,;$program_transform_name"
1456
# Use a double $ so make ignores it.
1457
test "$program_suffix" != NONE &&
1458
program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1459
# Double any \ or $. echo might interpret backslashes.
1460
# By default was `s,x,x', remove it if useless.
1461
cat <<\_ACEOF >conftest.sed
1462
[s/[\\$]/&&/g;s/;s,x,x,$//]
1464
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1472
## ------------------------- ##
1473
## Finding auxiliary files. ##
1474
## ------------------------- ##
1477
# AC_CONFIG_AUX_DIR(DIR)
1478
# ----------------------
1479
# Find install-sh, config.sub, config.guess, and Cygnus configure
1480
# in directory DIR. These are auxiliary files used in configuration.
1481
# DIR can be either absolute or relative to $srcdir.
1482
AC_DEFUN([AC_CONFIG_AUX_DIR],
1483
[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)])
1486
# AC_CONFIG_AUX_DIR_DEFAULT
1487
# -------------------------
1488
# The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
1489
# There's no need to call this macro explicitly; just AC_REQUIRE it.
1490
AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
1491
[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)])
1494
# AC_CONFIG_AUX_DIRS(DIR ...)
1495
# ---------------------------
1496
# Internal subroutine.
1497
# Search for the configuration auxiliary files in directory list $1.
1498
# We look only for install-sh, so users of AC_PROG_INSTALL
1499
# do not automatically need to distribute the other auxiliary files.
1500
AC_DEFUN([AC_CONFIG_AUX_DIRS],
1502
for ac_dir in $1; do
1503
if test -f $ac_dir/install-sh; then
1505
ac_install_sh="$ac_aux_dir/install-sh -c"
1507
elif test -f $ac_dir/install.sh; then
1509
ac_install_sh="$ac_aux_dir/install.sh -c"
1511
elif test -f $ac_dir/shtool; then
1513
ac_install_sh="$ac_aux_dir/shtool install -c"
1517
if test -z "$ac_aux_dir"; then
1518
AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
1520
ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1521
ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1522
ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1523
AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1524
])# AC_CONFIG_AUX_DIRS
1529
## ----------------------------------- ##
1530
## Getting the canonical system type. ##
1531
## ----------------------------------- ##
1534
# configure --host=HOST --target=TARGET --build=BUILD
1537
# 1. Build defaults to the current platform, as determined by config.guess.
1538
# 2. Host defaults to build.
1539
# 3. Target defaults to host.
1542
# _AC_CANONICAL_SPLIT(THING)
1543
# --------------------------
1544
# Generate the variables THING, THING_{alias cpu vendor os}.
1545
m4_define([_AC_CANONICAL_SPLIT],
1546
[AC_SUBST([$1], [$ac_cv_$1])dnl
1547
dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl
1549
[`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])dnl
1550
AC_SUBST([$1_vendor],
1551
[`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])dnl
1553
[`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])dnl
1554
])# _AC_CANONICAL_SPLIT
1557
# AC_CANONICAL_BUILD
1558
# ------------------
1559
AC_DEFUN_ONCE([AC_CANONICAL_BUILD],
1560
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1561
m4_divert_text([HELP_CANON],
1564
--build=BUILD configure for building on BUILD [guessed]]])dnl
1565
# Make sure we can run config.sub.
1566
$ac_config_sub sun4 >/dev/null 2>&1 ||
1567
AC_MSG_ERROR([cannot run $ac_config_sub])
1569
AC_CACHE_CHECK([build system type], [ac_cv_build],
1570
[ac_cv_build_alias=$build_alias
1571
test -z "$ac_cv_build_alias" &&
1572
ac_cv_build_alias=`$ac_config_guess`
1573
test -z "$ac_cv_build_alias" &&
1574
AC_MSG_ERROR([cannot guess build type; you must specify one])
1575
ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1576
AC_MSG_ERROR([$ac_config_sub $ac_cv_build_alias failed])
1578
_AC_CANONICAL_SPLIT(build)
1579
])# AC_CANONICAL_BUILD
1584
AC_DEFUN_ONCE([AC_CANONICAL_HOST],
1585
[AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1586
m4_divert_text([HELP_CANON],
1587
[[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnl
1588
AC_CACHE_CHECK([host system type], [ac_cv_host],
1589
[ac_cv_host_alias=$host_alias
1590
test -z "$ac_cv_host_alias" &&
1591
ac_cv_host_alias=$ac_cv_build_alias
1592
ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1593
AC_MSG_ERROR([$ac_config_sub $ac_cv_host_alias failed])
1595
_AC_CANONICAL_SPLIT([host])
1596
])# AC_CANONICAL_HOST
1599
# AC_CANONICAL_TARGET
1600
# -------------------
1601
AC_DEFUN_ONCE([AC_CANONICAL_TARGET],
1602
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1603
AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
1604
m4_divert_text([HELP_CANON],
1605
[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
1606
AC_CACHE_CHECK([target system type], [ac_cv_target],
1607
[dnl Set target_alias.
1608
ac_cv_target_alias=$target_alias
1609
test "x$ac_cv_target_alias" = "x" &&
1610
ac_cv_target_alias=$ac_cv_host_alias
1611
ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
1612
AC_MSG_ERROR([$ac_config_sub $ac_cv_target_alias failed])
1614
_AC_CANONICAL_SPLIT([target])
1616
# The aliases save the names the user supplied, while $host etc.
1617
# will get canonicalized.
1618
test -n "$target_alias" &&
1619
test "$program_prefix$program_suffix$program_transform_name" = \
1621
program_prefix=${target_alias}-[]dnl
1622
])# AC_CANONICAL_TARGET
1625
AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
1628
# AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
1629
# ------------------------------------------
1630
# If the cache file is inconsistent with the current host,
1631
# target and build system types, execute CMD or print a default
1632
# error message. Now handled via _AC_ARG_VAR_PRECIOUS.
1633
AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])
1636
## ---------------------- ##
1637
## Caching test results. ##
1638
## ---------------------- ##
1643
# Look for site or system specific initialization scripts.
1644
m4_define([AC_SITE_LOAD],
1645
[# Prefer explicitly selected file to automatically selected ones.
1646
if test -z "$CONFIG_SITE"; then
1647
if test "x$prefix" != xNONE; then
1648
CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
1650
CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
1653
for ac_site_file in $CONFIG_SITE; do
1654
if test -r "$ac_site_file"; then
1655
AC_MSG_NOTICE([loading site script $ac_site_file])
1656
sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
1665
m4_define([AC_CACHE_LOAD],
1666
[if test -r "$cache_file"; then
1667
# Some versions of bash will fail to source /dev/null (special
1668
# files actually), so we avoid doing that.
1669
if test -f "$cache_file"; then
1670
AC_MSG_NOTICE([loading cache $cache_file])
1672
[[\\/]]* | ?:[[\\/]]* ) . $cache_file;;
1673
*) . ./$cache_file;;
1677
AC_MSG_NOTICE([creating cache $cache_file])
1685
# Dump the cache to stdout. It can be in a pipe (this is a requirement).
1686
m4_define([_AC_CACHE_DUMP],
1687
[# The following way of writing the cache mishandles newlines in values,
1688
# but we know of no workaround that is simple, portable, and efficient.
1689
# So, don't put newlines in cache variables' values.
1690
# Ultrix sh set writes to stderr and can't be redirected directly,
1691
# and sets the high bit in the cache file unless we assign to the vars.
1694
case `(ac_space=' '; set | grep ac_space) 2>&1` in
1696
# `set' does not quote correctly, so add quotes (double-quote
1697
# substitution turns \\\\ into \\, and sed turns \\ into \).
1700
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
1703
# `set' quotes correctly as required by POSIX, so do not add quotes.
1705
["s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"]
1715
# Allow a site initialization script to override cache values.
1716
m4_define([AC_CACHE_SAVE],
1717
[cat >confcache <<\_ACEOF
1718
# This file is a shell script that caches the results of configure
1719
# tests run on this system so they can be shared between configure
1720
# scripts and configure runs, see configure's option --config-cache.
1721
# It is not useful on other systems. If it contains results you don't
1722
# want to keep, you may remove or edit it.
1724
# config.status only pays attention to the cache file if you give it
1725
# the --recheck option to rerun configure.
1727
# `ac_cv_env_foo' variables (set or unset) will be overriden when
1728
# loading this file, other *unset* `ac_cv_foo' will be assigned the
1737
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
1739
/^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
1741
if cmp -s $cache_file confcache; then :; else
1742
if test -w $cache_file; then
1743
test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
1744
cat confcache >$cache_file
1746
echo "not updating unwritable cache $cache_file"
1749
rm -f confcache[]dnl
1753
# AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
1754
# ------------------------------------------
1755
# The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
1756
# Should be dnl'ed. Try to catch common mistakes.
1757
m4_define([AC_CACHE_VAL],
1758
[m4_bmatch([$2], [AC_DEFINE],
1759
[AC_DIAGNOSE(syntax,
1760
[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
1761
[where no actions should be taken])])dnl
1763
[_AS_ECHO_N([(cached) ])],
1767
# AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
1768
# -------------------------------------------
1769
# Do not call this macro with a dnl right behind.
1770
m4_define([AC_CACHE_CHECK],
1771
[AC_MSG_CHECKING([$1])
1772
AC_CACHE_VAL([$2], [$3])dnl
1773
AC_MSG_RESULT_UNQUOTED([AS_VAR_GET([$2])])])
1777
## ---------------------- ##
1778
## Defining CPP symbols. ##
1779
## ---------------------- ##
1782
# AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
1783
# -------------------------------------------
1784
# This macro is useless, it is used only with --trace to collect the
1785
# list of *literals* CPP values passed to AC_DEFINE/AC_DEFINE_UNQUOTED.
1786
m4_define([AC_DEFINE_TRACE_LITERAL])
1789
# AC_DEFINE_TRACE(CPP-SYMBOL)
1790
# ---------------------------
1791
# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
1792
# out non literal symbols.
1793
m4_define([AC_DEFINE_TRACE],
1794
[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])])
1797
# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
1798
# -------------------------------------------
1799
# Set VARIABLE to VALUE, verbatim, or 1. Remember the value
1800
# and if VARIABLE is affected the same VALUE, do nothing, else
1801
# die. The third argument is used by autoheader.
1802
m4_define([AC_DEFINE],
1803
[AC_DEFINE_TRACE([$1])dnl
1804
m4_ifval([$3], [_AH_TEMPLATE_OLD([$1], [$3])])dnl
1805
cat >>confdefs.h <<\_ACEOF
1806
[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
1811
# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
1812
# ----------------------------------------------------
1813
# Similar, but perform shell substitutions $ ` \ once on VALUE.
1814
m4_define([AC_DEFINE_UNQUOTED],
1815
[AC_DEFINE_TRACE([$1])dnl
1816
m4_ifval([$3], [_AH_TEMPLATE_OLD([$1], [$3])])dnl
1817
cat >>confdefs.h <<_ACEOF
1818
[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
1824
## -------------------------- ##
1825
## Setting output variables. ##
1826
## -------------------------- ##
1829
# _AC_SUBST(VARIABLE, PROGRAM)
1830
# ----------------------------
1831
# If VARIABLE has not already been AC_SUBST'ed, append the sed PROGRAM
1832
# to `_AC_SUBST_SED_PROGRAM'.
1833
m4_define([_AC_SUBST],
1834
[m4_expand_once([m4_append([_AC_SUBST_SED_PROGRAM],
1840
m4_define([_AC_SUBST_SED_PROGRAM])
1843
# AC_SUBST(VARIABLE, [VALUE])
1844
# ---------------------------
1845
# Create an output variable from a shell VARIABLE. If VALUE is given
1846
# assign it to VARIABLE. Use `""' is you want to set VARIABLE to an
1847
# empty value, not an empty second argument.
1849
# Beware that if you change this macro, you also have to change the
1850
# sed script at the top of _AC_OUTPUT_FILES.
1851
m4_define([AC_SUBST],
1852
[m4_ifvaln([$2], [$1=$2])[]dnl
1853
_AC_SUBST([$1], [s,@$1@,[$]$1,;t t])dnl
1857
# AC_SUBST_FILE(VARIABLE)
1858
# -----------------------
1859
# Read the comments of the preceding macro.
1860
m4_define([AC_SUBST_FILE],
1861
[_AC_SUBST([$1], [/@$1@/r [$]$1
1866
## --------------------------------------- ##
1867
## Printing messages at autoconf runtime. ##
1868
## --------------------------------------- ##
1870
# In fact, I think we should promote the use of m4_warn and m4_fatal
1871
# directly. This will also avoid to some people to get it wrong
1872
# between AC_FATAL and AC_MSG_ERROR.
1875
# AC_DIAGNOSE(CATEGORY, MESSAGE)
1876
# AC_FATAL(MESSAGE, [EXIT-STATUS])
1877
# --------------------------------
1878
m4_copy([m4_warn], [AC_DIAGNOSE])
1879
m4_copy([m4_fatal], [AC_FATAL])
1882
# AC_WARNING(MESSAGE)
1883
# -------------------
1884
# Report a MESSAGE to the user of autoconf if `-W' or `-W all' was
1886
m4_define([AC_WARNING],
1887
[AC_DIAGNOSE([syntax], [$1])])
1892
## ---------------------------------------- ##
1893
## Printing messages at configure runtime. ##
1894
## ---------------------------------------- ##
1897
# AC_MSG_CHECKING(FEATURE)
1898
# ------------------------
1899
m4_define([AC_MSG_CHECKING],
1900
[_AS_ECHO([$as_me:$LINENO: checking $1], AS_MESSAGE_LOG_FD)
1901
_AS_ECHO_N([checking $1... ])[]dnl
1905
# AC_MSG_RESULT(RESULT)
1906
# ---------------------
1907
m4_define([AC_MSG_RESULT],
1908
[_AS_ECHO([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
1909
_AS_ECHO([${ECHO_T}$1])[]dnl
1913
# AC_MSG_RESULT_UNQUOTED(RESULT)
1914
# ------------------------------
1915
# Likewise, but perform $ ` \ shell substitutions.
1916
m4_define([AC_MSG_RESULT_UNQUOTED],
1917
[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
1918
_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
1922
# AC_MSG_WARN(PROBLEM)
1923
# AC_MSG_NOTICE(STRING)
1924
# AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
1925
# --------------------------------------
1926
m4_copy([AS_WARN], [AC_MSG_WARN])
1927
m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
1928
m4_copy([AS_ERROR], [AC_MSG_ERROR])
1931
# AU::AC_CHECKING(FEATURE)
1932
# ------------------------
1933
AU_DEFUN([AC_CHECKING],
1934
[AS_MESSAGE([checking $1...])])
1937
# AU::AC_VERBOSE(STRING)
1938
# ----------------------
1939
AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])
1946
## ---------------------------- ##
1947
## Compiler-running mechanics. ##
1948
## ---------------------------- ##
1951
# _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
1952
# ----------------------------------
1953
# Eval COMMAND, save the exit status in ac_status, and log it.
1954
AC_DEFUN([_AC_RUN_LOG],
1955
[{ ($2) >&AS_MESSAGE_LOG_FD
1956
($1) 2>&AS_MESSAGE_LOG_FD
1958
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1959
(exit $ac_status); }])
1962
# _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
1963
# -----------------------------------------
1964
# Eval COMMAND, save its stderr into conftest.err, save the exit status
1965
# in ac_status, and log it.
1966
# Note that when tracing, most shells will leave the traces in stderr
1967
AC_DEFUN([_AC_RUN_LOG_STDERR],
1968
[{ ($2) >&AS_MESSAGE_LOG_FD
1971
egrep -v '^ *\+' conftest.er1 >conftest.err
1973
cat conftest.err >&AS_MESSAGE_LOG_FD
1974
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1975
(exit $ac_status); }])
1980
# Eval COMMAND, save the exit status in ac_status, and log it.
1981
AC_DEFUN([_AC_EVAL],
1982
[_AC_RUN_LOG([eval $1],
1983
[eval echo "$as_me:$LINENO: \"$1\""])])
1986
# _AC_EVAL_STDERR(COMMAND)
1987
# ------------------------
1988
# Eval COMMAND, save its stderr into conftest.err, save the exit status
1989
# in ac_status, and log it.
1990
# Note that when tracing, most shells will leave the traces in stderr
1991
AC_DEFUN([_AC_EVAL_STDERR],
1992
[_AC_RUN_LOG_STDERR([eval $1],
1993
[eval echo "$as_me:$LINENO: \"$1\""])])
1996
# AC_TRY_EVAL(VARIABLE)
1997
# ---------------------
1998
# The purpose of this macro is to "configure:123: command line"
1999
# written into config.log for every test run.
2000
AC_DEFUN([AC_TRY_EVAL],
2004
# AC_TRY_COMMAND(COMMAND)
2005
# -----------------------
2006
AC_DEFUN([AC_TRY_COMMAND],
2008
_AC_EVAL([$ac_try]); }])
2011
# AC_RUN_LOG(COMMAND)
2012
# -------------------
2013
AC_DEFUN([AC_RUN_LOG],
2015
[echo "$as_me:$LINENO: AS_ESCAPE([$1])"])])
2020
## ------------------------ ##
2021
## Examining declarations. ##
2022
## ------------------------ ##
2026
# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2027
# ----------------------------------------------------------------
2028
# Try to preprocess PROGRAM.
2030
# This macro can be used during the selection of a preprocessor.
2031
# Run cpp and set ac_cpp_err to "yes" for an error, to
2032
# "$ac_(c,cxx)_preproc_warn_flag" if there are warnings or to "" if
2033
# neither warnings nor errors have been detected. eval is necessary
2035
AC_DEFUN([_AC_PREPROC_IFELSE],
2036
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2037
if _AC_EVAL_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null; then
2038
if test -s conftest.err; then
2039
ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag
2046
if test -z "$ac_cpp_err"; then
2049
echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
2050
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2053
rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
2054
])# _AC_PREPROC_IFELSE
2057
# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2058
# ---------------------------------------------------------------
2059
# Try to preprocess PROGRAM. Requires that the preprocessor for the
2060
# current language was checked for, hence do not use this macro in macros
2061
# looking for a preprocessor.
2062
AC_DEFUN([AC_PREPROC_IFELSE],
2063
[AC_LANG_PREPROC_REQUIRE()dnl
2064
_AC_PREPROC_IFELSE($@)])
2067
# AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2068
# ---------------------------------------------------------
2069
# AC_TRY_CPP is used to check whether particular header files exist.
2070
# (But it actually tests whether INCLUDES produces no CPP errors.)
2072
# INCLUDES are not defaulted and are double quoted.
2073
AC_DEFUN([AC_TRY_CPP],
2074
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
2077
# AC_EGREP_CPP(PATTERN, PROGRAM,
2078
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2079
# ------------------------------------------------------
2080
# Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
2081
# come early, it is not included in AC_BEFORE checks.
2082
AC_DEFUN([AC_EGREP_CPP],
2083
[AC_LANG_PREPROC_REQUIRE()dnl
2084
AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
2085
dnl eval is necessary to expand ac_cpp.
2086
dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
2087
if (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
2088
dnl Quote $1 to prevent m4 from eating character classes
2089
egrep "[$1]" >/dev/null 2>&1; then
2091
m4_ifvaln([$4], [else
2098
# AC_EGREP_HEADER(PATTERN, HEADER-FILE,
2099
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2100
# ---------------------------------------------------------
2101
AC_DEFUN([AC_EGREP_HEADER],
2109
## ------------------ ##
2110
## Examining syntax. ##
2111
## ------------------ ##
2114
# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2115
# ---------------------------------------------------------------------
2116
# Try to compile PROGRAM.
2117
# This macro can be used during the selection of a compiler.
2118
m4_define([_AC_COMPILE_IFELSE],
2119
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2120
rm -f conftest.$ac_objext
2121
AS_IF([AC_TRY_EVAL(ac_compile) &&
2122
AC_TRY_COMMAND([test -s conftest.$ac_objext])],
2124
[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
2125
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2126
m4_ifvaln([$3],[$3])dnl])dnl
2127
rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
2128
])# _AC_COMPILE_IFELSE
2131
# AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2132
# --------------------------------------------------------------------
2133
# Try to compile PROGRAM. Requires that the compiler for the current
2134
# language was checked for, hence do not use this macro in macros looking
2136
AC_DEFUN([AC_COMPILE_IFELSE],
2137
[AC_LANG_COMPILER_REQUIRE()dnl
2138
_AC_COMPILE_IFELSE($@)])
2141
# AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
2142
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2143
# --------------------------------------------------------
2144
AC_DEFUN([AC_TRY_COMPILE],
2145
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2149
## --------------------- ##
2150
## Examining libraries. ##
2151
## --------------------- ##
2154
# _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2155
# ------------------------------------------------------------------
2156
# Try to link PROGRAM.
2157
# This macro can be used during the selection of a compiler.
2158
m4_define([_AC_LINK_IFELSE],
2159
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2160
rm -f conftest.$ac_objext conftest$ac_exeext
2161
AS_IF([AC_TRY_EVAL(ac_link) &&
2162
AC_TRY_COMMAND([test -s conftest$ac_exeext])],
2164
[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
2165
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2166
m4_ifvaln([$3], [$3])dnl])[]dnl
2167
rm -f conftest.$ac_objext conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
2171
# AC_LINK_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2172
# -----------------------------------------------------------------
2173
# Try to link PROGRAM. Requires that the compiler for the current
2174
# language was checked for, hence do not use this macro in macros looking
2176
AC_DEFUN([AC_LINK_IFELSE],
2177
[AC_LANG_COMPILER_REQUIRE()dnl
2178
_AC_LINK_IFELSE($@)])
2181
# AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
2182
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2183
# -----------------------------------------------------
2184
# Should the INCLUDES be defaulted here?
2185
# Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
2186
# FIXME: WARNING: The code to compile was different in the case of
2187
# Fortran between AC_TRY_COMPILE and AC_TRY_LINK, though they should
2188
# equivalent as far as I can tell from the semantics and the docs. In
2189
# the former, $[2] is used as is, in the latter, it is `call' ed.
2190
# Remove these FIXME: once truth established.
2191
AC_DEFUN([AC_TRY_LINK],
2192
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
2195
# AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
2196
# ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND])
2197
# --------------------------------------------------------
2198
AU_DEFUN([AC_COMPILE_CHECK],
2199
[m4_ifvaln([$1], [AC_CHECKING([for $1])])dnl
2200
AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])
2206
## -------------------------------- ##
2207
## Checking for run-time features. ##
2208
## -------------------------------- ##
2211
# _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2212
# ------------------------------------------------------------
2213
# Compile, link, and run.
2214
# This macro can be used during the selection of a compiler.
2215
# We also remove conftest.o as if the compilation fails, some compilers
2217
m4_define([_AC_RUN_IFELSE],
2218
[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
2219
rm -f conftest$ac_exeext
2220
AS_IF([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)],
2222
[echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
2223
echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
2224
cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
2226
[( exit $ac_status )
2228
rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext m4_ifval([$1],
2229
[conftest.$ac_ext])[]dnl
2233
# AC_RUN_IFELSE(PROGRAM,
2234
# [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2235
# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2236
# ----------------------------------------------------------
2237
# Compile, link, and run. Requires that the compiler for the current
2238
# language was checked for, hence do not use this macro in macros looking
2240
AC_DEFUN([AC_RUN_IFELSE],
2241
[AC_LANG_COMPILER_REQUIRE()dnl
2243
[AC_DIAGNOSE([cross],
2244
[$0 called without default to allow cross compiling])])dnl
2245
if test "$cross_compiling" = yes; then
2247
[AC_MSG_ERROR([cannot run test program while cross compiling])])
2253
# AC_TRY_RUN(PROGRAM,
2254
# [ACTION-IF-TRUE], [ACTION-IF-FALSE],
2255
# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2256
# --------------------------------------------------------
2257
AC_DEFUN([AC_TRY_RUN],
2258
[AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])
2262
## ------------------------------------- ##
2263
## Checking for the existence of files. ##
2264
## ------------------------------------- ##
2266
# AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2267
# -------------------------------------------------------------
2269
# Check for the existence of FILE.
2270
AC_DEFUN([AC_CHECK_FILE],
2271
[AC_DIAGNOSE([cross],
2272
[cannot check for file existence when cross compiling])dnl
2273
AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
2274
AC_CACHE_CHECK([for $1], ac_File,
2275
[test "$cross_compiling" = yes &&
2276
AC_MSG_ERROR([cannot check for file existence when cross compiling])
2277
if test -r "$1"; then
2278
AS_VAR_SET(ac_File, yes)
2280
AS_VAR_SET(ac_File, no)
2282
AS_IF([test AS_VAR_GET(ac_File) = yes], [$2], [$3])[]dnl
2283
AS_VAR_POPDEF([ac_File])dnl
2287
# AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2288
# -----------------------------------------------------------------
2289
AC_DEFUN([AC_CHECK_FILES],
2290
[AC_FOREACH([AC_FILE_NAME], [$1],
2291
[AC_CHECK_FILE(AC_FILE_NAME,
2292
[AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
2293
[Define to 1 if you have the
2299
## ------------------------------- ##
2300
## Checking for declared symbols. ##
2301
## ------------------------------- ##
2304
# AC_CHECK_DECL(SYMBOL,
2305
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2306
# [INCLUDES = DEFAULT-INCLUDES])
2307
# -------------------------------------------------------
2308
# Check if SYMBOL (a variable or a function) is declared.
2309
AC_DEFUN([AC_CHECK_DECL],
2310
[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
2311
AC_CACHE_CHECK([whether $1 is declared], ac_Symbol,
2312
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
2314
char *p = (char *) $1;
2317
[AS_VAR_SET(ac_Symbol, yes)],
2318
[AS_VAR_SET(ac_Symbol, no)])])
2319
AS_IF([test AS_VAR_GET(ac_Symbol) = yes], [$2], [$3])[]dnl
2320
AS_VAR_POPDEF([ac_Symbol])dnl
2324
# AC_CHECK_DECLS(SYMBOLS,
2325
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2326
# [INCLUDES = DEFAULT-INCLUDES])
2327
# --------------------------------------------------------
2328
# Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the
2329
# documentation for a detailed explanation of this difference with
2330
# other AC_CHECK_*S macros. SYMBOLS is an m4 list.
2331
AC_DEFUN([AC_CHECK_DECLS],
2332
[m4_foreach([AC_Symbol], [$1],
2333
[AC_CHECK_DECL(AC_Symbol,
2334
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
2335
[Define to 1 if you have the declaration
2336
of `]AC_Symbol[', and to 0 if you don't.])
2338
[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
2344
## -------------------------------- ##
2345
## Checking for library functions. ##
2346
## -------------------------------- ##
2349
# AC_LIBSOURCE(FILENAME)
2350
# ----------------------
2351
# Announce we might need the file `FILENAME'.
2352
m4_define([AC_LIBSOURCE], [])
2355
# AC_LIBSOURCES([FILENAME1, ...])
2356
# -------------------------------
2357
# Announce we might need these files.
2358
m4_define([AC_LIBSOURCES],
2359
[m4_foreach([_AC_FILENAME], [$1],
2360
[AC_LIBSOURCE(_AC_FILENAME)])])
2363
# _AC_LIBOBJ(FILENAME-NOEXT, ACTION-IF-INDIR)
2364
# -------------------------------------------
2365
# We need `FILENAME-NOEXT.o', save this into `LIBOBJS'.
2366
# We don't use AC_SUBST/2 because it forces an unneeded eol.
2367
m4_define([_AC_LIBOBJ],
2368
[AS_LITERAL_IF([$1],
2369
[AC_LIBSOURCE([$1.c])],
2371
AC_SUBST([LIB@&t@OBJS])dnl
2372
LIB@&t@OBJS="$LIB@&t@OBJS $1.$ac_objext"])
2375
# AC_LIBOBJ(FILENAME-NOEXT)
2376
# -------------------------
2377
# We need `FILENAME-NOEXT.o', save this into `LIBOBJS'.
2378
# We don't use AC_SUBST/2 because it forces an unneeded eol.
2379
m4_define([AC_LIBOBJ],
2381
[AC_DIAGNOSE(syntax,
2382
[$0($1): you should use literals])])dnl
2387
## ----------------------------------- ##
2388
## Checking compiler characteristics. ##
2389
## ----------------------------------- ##
2392
# _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, [INCLUDES], [IF-FAILS])
2393
# ---------------------------------------------------------------------
2394
# Compute the integer EXPRESSION and store the result in the VARIABLE.
2395
# Works OK if cross compiling, but assumes twos-complement arithmetic.
2396
m4_define([_AC_COMPUTE_INT_COMPILE],
2397
[# Depending upon the size, compute the lo and hi bounds.
2398
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
2401
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2402
[ac_hi=$ac_mid; break],
2403
[ac_lo=`expr $ac_mid + 1`
2404
if test $ac_lo -le $ac_mid; then
2408
ac_mid=`expr 2 '*' $ac_mid + 1`])
2410
[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
2413
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
2414
[ac_lo=$ac_mid; break],
2415
[ac_hi=`expr '(' $ac_mid ')' - 1`
2416
if test $ac_mid -le $ac_hi; then
2420
ac_mid=`expr 2 '*' $ac_mid`])
2423
# Binary search between lo and hi bounds.
2424
while test "x$ac_lo" != "x$ac_hi"; do
2425
ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
2426
AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
2427
[ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`])
2433
])# _AC_COMPUTE_INT_COMPILE
2436
# _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, [INCLUDES], [IF-FAILS])
2437
# -----------------------------------------------------------------
2438
# Store the evaluation of the integer EXPRESSION in VARIABLE.
2439
m4_define([_AC_COMPUTE_INT_RUN],
2440
[AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
2441
[$2=`cat conftest.val`], [$4])])
2444
# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
2445
# ---------------------------------------------------------
2446
m4_define([_AC_COMPUTE_INT],
2447
[if test "$cross_compiling" = yes; then
2448
_AC_COMPUTE_INT_COMPILE([$1], [$2], [$3], [$4])
2450
_AC_COMPUTE_INT_RUN([$1], [$2], [$3], [$4])
2452
rm -f conftest.val[]dnl