1dnl Parameterized macros. 2dnl Requires GNU m4. 3dnl This file is part of Autoconf. 4dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. 5dnl 6dnl This program is free software; you can redistribute it and/or modify 7dnl it under the terms of the GNU General Public License as published by 8dnl the Free Software Foundation; either version 2, or (at your option) 9dnl any later version. 10dnl 11dnl This program is distributed in the hope that it will be useful, 12dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 13dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14dnl GNU General Public License for more details. 15dnl 16dnl You should have received a copy of the GNU General Public License 17dnl along with this program; if not, write to the Free Software 18dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19dnl 02111-1307, USA. 20dnl 21dnl As a special exception, the Free Software Foundation gives unlimited 22dnl permission to copy, distribute and modify the configure scripts that 23dnl are the output of Autoconf. You need not follow the terms of the GNU 24dnl General Public License when using or distributing such scripts, even 25dnl though portions of the text of Autoconf appear in them. The GNU 26dnl General Public License (GPL) does govern all other use of the material 27dnl that constitutes the Autoconf program. 28dnl 29dnl Certain portions of the Autoconf source text are designed to be copied 30dnl (in certain cases, depending on the input) into the output of 31dnl Autoconf. We call these the "data" portions. The rest of the Autoconf 32dnl source text consists of comments plus executable code that decides which 33dnl of the data portions to output in any given case. We call these 34dnl comments and executable code the "non-data" portions. Autoconf never 35dnl copies any of the non-data portions into its output. 36dnl 37dnl This special exception to the GPL applies to versions of Autoconf 38dnl released by the Free Software Foundation. When you make and 39dnl distribute a modified version of Autoconf, you may extend this special 40dnl exception to the GPL to apply to your modified version as well, *unless* 41dnl your modified version has the potential to copy into its output some 42dnl of the text that was the non-data portion of the version that you started 43dnl with. (In other words, unless your change moves or copies text from 44dnl the non-data portions to the data portions.) If your modification has 45dnl such potential, you must delete any notice of this special exception 46dnl to the GPL from your modified version. 47dnl 48dnl Written by David MacKenzie, with help from 49dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, 50dnl Roland McGrath, Noah Friedman, david d zuhn, and many others. 51dnl 52divert(-1)dnl Throw away output until AC_INIT is called. 53changequote([, ]) 54 55define(AC_ACVERSION, 2.13) 56 57dnl Some old m4's don't support m4exit. But they provide 58dnl equivalent functionality by core dumping because of the 59dnl long macros we define. 60ifdef([__gnu__], , [errprint(Autoconf requires GNU m4. 61Install it before installing Autoconf or set the 62M4 environment variable to its path name. 63)m4exit(2)]) 64 65undefine([eval]) 66undefine([include]) 67undefine([shift]) 68undefine([format]) 69 70 71dnl ### Defining macros 72 73 74dnl m4 output diversions. We let m4 output them all in order at the end, 75dnl except that we explicitly undivert AC_DIVERSION_SED, AC_DIVERSION_CMDS, 76dnl and AC_DIVERSION_ICMDS. 77 78dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line 79define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings 80define(AC_DIVERSION_INIT, 2)dnl initialization code 81define(AC_DIVERSION_NORMAL_4, 3)dnl AC_REQUIRE'd code, 4 level deep 82define(AC_DIVERSION_NORMAL_3, 4)dnl AC_REQUIRE'd code, 3 level deep 83define(AC_DIVERSION_NORMAL_2, 5)dnl AC_REQUIRE'd code, 2 level deep 84define(AC_DIVERSION_NORMAL_1, 6)dnl AC_REQUIRE'd code, 1 level deep 85define(AC_DIVERSION_NORMAL, 7)dnl the tests and output code 86define(AC_DIVERSION_SED, 8)dnl variable substitutions in config.status 87define(AC_DIVERSION_CMDS, 9)dnl extra shell commands in config.status 88define(AC_DIVERSION_ICMDS, 10)dnl extra initialization in config.status 89 90dnl Change the diversion stream to STREAM, while stacking old values. 91dnl AC_DIVERT_PUSH(STREAM) 92define(AC_DIVERT_PUSH, 93[pushdef([AC_DIVERSION_CURRENT], $1)dnl 94divert(AC_DIVERSION_CURRENT)dnl 95]) 96 97dnl Change the diversion stream to its previous value, unstacking it. 98dnl AC_DIVERT_POP() 99define(AC_DIVERT_POP, 100[popdef([AC_DIVERSION_CURRENT])dnl 101divert(AC_DIVERSION_CURRENT)dnl 102]) 103 104dnl Initialize the diversion setup. 105define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL) 106dnl This will be popped by AC_REQUIRE in AC_INIT. 107pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE) 108 109dnl The prologue for Autoconf macros. 110dnl AC_PRO(MACRO-NAME) 111define(AC_PRO, 112[define([AC_PROVIDE_$1], )dnl 113ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, 114[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))], 115[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl 116]) 117 118dnl The Epilogue for Autoconf macros. 119dnl AC_EPI() 120define(AC_EPI, 121[AC_DIVERT_POP()dnl 122ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, 123[undivert(AC_DIVERSION_NORMAL_4)dnl 124undivert(AC_DIVERSION_NORMAL_3)dnl 125undivert(AC_DIVERSION_NORMAL_2)dnl 126undivert(AC_DIVERSION_NORMAL_1)dnl 127])dnl 128]) 129 130dnl Define a macro which automatically provides itself. Add machinery 131dnl so the macro automatically switches expansion to the diversion 132dnl stack if it is not already using it. In this case, once finished, 133dnl it will bring back all the code accumulated in the diversion stack. 134dnl This, combined with AC_REQUIRE, achieves the topological ordering of 135dnl macros. We don't use this macro to define some frequently called 136dnl macros that are not involved in ordering constraints, to save m4 137dnl processing. 138dnl AC_DEFUN(NAME, EXPANSION) 139define([AC_DEFUN], 140[define($1, [AC_PRO([$1])$2[]AC_EPI()])]) 141 142 143dnl ### Initialization 144 145 146dnl AC_INIT_NOTICE() 147AC_DEFUN(AC_INIT_NOTICE, 148[# Guess values for system-dependent variables and create Makefiles. 149# Generated automatically using autoconf version] AC_ACVERSION [ 150# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. 151# 152# This configure script is free software; the Free Software Foundation 153# gives unlimited permission to copy, distribute and modify it. 154 155# Defaults: 156ac_help= 157ac_default_prefix=/usr/local 158[#] Any additions from configure.in:]) 159 160dnl AC_PREFIX_DEFAULT(PREFIX) 161AC_DEFUN(AC_PREFIX_DEFAULT, 162[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl 163ac_default_prefix=$1 164AC_DIVERT_POP()]) 165 166dnl AC_INIT_PARSE_ARGS() 167AC_DEFUN(AC_INIT_PARSE_ARGS, 168[ 169# Initialize some variables set by options. 170# The variables have the same names as the options, with 171# dashes changed to underlines. 172build=NONE 173cache_file=./config.cache 174exec_prefix=NONE 175host=NONE 176no_create= 177nonopt=NONE 178no_recursion= 179prefix=NONE 180program_prefix=NONE 181program_suffix=NONE 182program_transform_name=s,x,x, 183silent= 184site= 185srcdir= 186target=NONE 187verbose= 188x_includes=NONE 189x_libraries=NONE 190dnl Installation directory options. 191dnl These are left unexpanded so users can "make install exec_prefix=/foo" 192dnl and all the variables that are supposed to be based on exec_prefix 193dnl by default will actually change. 194dnl Use braces instead of parens because sh, perl, etc. also accept them. 195bindir='${exec_prefix}/bin' 196sbindir='${exec_prefix}/sbin' 197libexecdir='${exec_prefix}/libexec' 198datadir='${prefix}/share' 199sysconfdir='${prefix}/etc' 200sharedstatedir='${prefix}/com' 201localstatedir='${prefix}/var' 202libdir='${exec_prefix}/lib' 203includedir='${prefix}/include' 204oldincludedir='/usr/include' 205infodir='${prefix}/info' 206mandir='${prefix}/man' 207 208# Initialize some other variables. 209subdirs= 210MFLAGS= MAKEFLAGS= 211SHELL=${CONFIG_SHELL-/bin/sh} 212# Maximum number of lines to put in a shell here document. 213ac_max_here_lines=12 214 215ac_prev= 216for ac_option 217do 218 219 # If the previous option needs an argument, assign it. 220 if test -n "$ac_prev"; then 221 eval "$ac_prev=\$ac_option" 222 ac_prev= 223 continue 224 fi 225 226 case "$ac_option" in 227changequote(, )dnl 228 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 229changequote([, ])dnl 230 *) ac_optarg= ;; 231 esac 232 233 # Accept the important Cygnus configure options, so we can diagnose typos. 234 235 case "$ac_option" in 236 237 -bindir | --bindir | --bindi | --bind | --bin | --bi) 238 ac_prev=bindir ;; 239 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) 240 bindir="$ac_optarg" ;; 241 242 -build | --build | --buil | --bui | --bu) 243 ac_prev=build ;; 244 -build=* | --build=* | --buil=* | --bui=* | --bu=*) 245 build="$ac_optarg" ;; 246 247 -cache-file | --cache-file | --cache-fil | --cache-fi \ 248 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) 249 ac_prev=cache_file ;; 250 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ 251 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) 252 cache_file="$ac_optarg" ;; 253 254 -cc=* | --cc=* ) 255 CC="$ac_optarg" ; echo using $CC as compiler ;; 256 257 -datadir | --datadir | --datadi | --datad | --data | --dat | --da) 258 ac_prev=datadir ;; 259 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ 260 | --da=*) 261 datadir="$ac_optarg" ;; 262 263 -disable-* | --disable-*) 264 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` 265 # Reject names that are not valid shell variable names. 266changequote(, )dnl 267 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then 268changequote([, ])dnl 269 AC_MSG_ERROR($ac_feature: invalid feature name) 270 fi 271 ac_feature=`echo $ac_feature| sed 's/-/_/g'` 272 eval "enable_${ac_feature}=no" ;; 273 274 -enable-* | --enable-*) 275 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` 276 # Reject names that are not valid shell variable names. 277changequote(, )dnl 278 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then 279changequote([, ])dnl 280 AC_MSG_ERROR($ac_feature: invalid feature name) 281 fi 282 ac_feature=`echo $ac_feature| sed 's/-/_/g'` 283 case "$ac_option" in 284 *=*) ;; 285 *) ac_optarg=yes ;; 286 esac 287 eval "enable_${ac_feature}='$ac_optarg'" ;; 288 289 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ 290 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ 291 | --exec | --exe | --ex) 292 ac_prev=exec_prefix ;; 293 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ 294 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ 295 | --exec=* | --exe=* | --ex=*) 296 exec_prefix="$ac_optarg" ;; 297 298 -gas | --gas | --ga | --g) 299 # Obsolete; use --with-gas. 300 with_gas=yes ;; 301 302 -help | --help | --hel | --he) 303 # Omit some internal or obsolete options to make the list less imposing. 304 # This message is too long to be a string in the A/UX 3.1 sh. 305 cat << EOF 306changequote(, )dnl 307Usage: configure [options] [host] 308Options: [defaults in brackets after descriptions] 309Configuration: 310 --cache-file=FILE cache test results in FILE 311 --help print this message 312 --no-create do not create output files 313 --quiet, --silent do not print \`checking...' messages 314 --version print the version of autoconf that created configure 315Directory and file names: 316 --prefix=PREFIX install architecture-independent files in PREFIX 317 [$ac_default_prefix] 318 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX 319 [same as prefix] 320 --bindir=DIR user executables in DIR [EPREFIX/bin] 321 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] 322 --libexecdir=DIR program executables in DIR [EPREFIX/libexec] 323 --datadir=DIR read-only architecture-independent data in DIR 324 [PREFIX/share] 325 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] 326 --sharedstatedir=DIR modifiable architecture-independent data in DIR 327 [PREFIX/com] 328 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] 329 --libdir=DIR object code libraries in DIR [EPREFIX/lib] 330 --includedir=DIR C header files in DIR [PREFIX/include] 331 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] 332 --infodir=DIR info documentation in DIR [PREFIX/info] 333 --mandir=DIR man documentation in DIR [PREFIX/man] 334 --srcdir=DIR find the sources in DIR [configure dir or ..] 335 --program-prefix=PREFIX prepend PREFIX to installed program names 336 --program-suffix=SUFFIX append SUFFIX to installed program names 337 --program-transform-name=PROGRAM 338 run sed PROGRAM on installed program names 339EOF 340 cat << EOF 341Host type: 342 --build=BUILD configure for building on BUILD [BUILD=HOST] 343 --host=HOST configure for HOST [guessed] 344 --target=TARGET configure for TARGET [TARGET=HOST] 345Features and packages: 346 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 347 --enable-FEATURE[=ARG] include FEATURE [ARG=yes] 348 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 349 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) 350 --x-includes=DIR X include files are in DIR 351 --x-libraries=DIR X library files are in DIR 352changequote([, ])dnl 353EOF 354 if test -n "$ac_help"; then 355 echo "--enable and --with options recognized:$ac_help" 356 fi 357 exit 0 ;; 358 359 -host | --host | --hos | --ho) 360 ac_prev=host ;; 361 -host=* | --host=* | --hos=* | --ho=*) 362 host="$ac_optarg" ;; 363 364 -includedir | --includedir | --includedi | --included | --include \ 365 | --includ | --inclu | --incl | --inc) 366 ac_prev=includedir ;; 367 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ 368 | --includ=* | --inclu=* | --incl=* | --inc=*) 369 includedir="$ac_optarg" ;; 370 371 -infodir | --infodir | --infodi | --infod | --info | --inf) 372 ac_prev=infodir ;; 373 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) 374 infodir="$ac_optarg" ;; 375 376 -libdir | --libdir | --libdi | --libd) 377 ac_prev=libdir ;; 378 -libdir=* | --libdir=* | --libdi=* | --libd=*) 379 libdir="$ac_optarg" ;; 380 381 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ 382 | --libexe | --libex | --libe) 383 ac_prev=libexecdir ;; 384 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ 385 | --libexe=* | --libex=* | --libe=*) 386 libexecdir="$ac_optarg" ;; 387 388 -localstatedir | --localstatedir | --localstatedi | --localstated \ 389 | --localstate | --localstat | --localsta | --localst \ 390 | --locals | --local | --loca | --loc | --lo) 391 ac_prev=localstatedir ;; 392 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ 393 | --localstate=* | --localstat=* | --localsta=* | --localst=* \ 394 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 395 localstatedir="$ac_optarg" ;; 396 397 -mandir | --mandir | --mandi | --mand | --man | --ma | --m) 398 ac_prev=mandir ;; 399 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) 400 mandir="$ac_optarg" ;; 401 402 -nfp | --nfp | --nf) 403 # Obsolete; use --without-fp. 404 with_fp=no ;; 405 406 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ 407 | --no-cr | --no-c) 408 no_create=yes ;; 409 410 -no-recursion | --no-recursion | --no-recursio | --no-recursi \ 411 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) 412 no_recursion=yes ;; 413 414 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ 415 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ 416 | --oldin | --oldi | --old | --ol | --o) 417 ac_prev=oldincludedir ;; 418 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ 419 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ 420 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) 421 oldincludedir="$ac_optarg" ;; 422 423 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) 424 ac_prev=prefix ;; 425 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) 426 prefix="$ac_optarg" ;; 427 428 -program-prefix | --program-prefix | --program-prefi | --program-pref \ 429 | --program-pre | --program-pr | --program-p) 430 ac_prev=program_prefix ;; 431 -program-prefix=* | --program-prefix=* | --program-prefi=* \ 432 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) 433 program_prefix="$ac_optarg" ;; 434 435 -program-suffix | --program-suffix | --program-suffi | --program-suff \ 436 | --program-suf | --program-su | --program-s) 437 ac_prev=program_suffix ;; 438 -program-suffix=* | --program-suffix=* | --program-suffi=* \ 439 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) 440 program_suffix="$ac_optarg" ;; 441 442 -program-transform-name | --program-transform-name \ 443 | --program-transform-nam | --program-transform-na \ 444 | --program-transform-n | --program-transform- \ 445 | --program-transform | --program-transfor \ 446 | --program-transfo | --program-transf \ 447 | --program-trans | --program-tran \ 448 | --progr-tra | --program-tr | --program-t) 449 ac_prev=program_transform_name ;; 450 -program-transform-name=* | --program-transform-name=* \ 451 | --program-transform-nam=* | --program-transform-na=* \ 452 | --program-transform-n=* | --program-transform-=* \ 453 | --program-transform=* | --program-transfor=* \ 454 | --program-transfo=* | --program-transf=* \ 455 | --program-trans=* | --program-tran=* \ 456 | --progr-tra=* | --program-tr=* | --program-t=*) 457 program_transform_name="$ac_optarg" ;; 458 459 -q | -quiet | --quiet | --quie | --qui | --qu | --q \ 460 | -silent | --silent | --silen | --sile | --sil) 461 silent=yes ;; 462 463 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) 464 ac_prev=sbindir ;; 465 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ 466 | --sbi=* | --sb=*) 467 sbindir="$ac_optarg" ;; 468 469 -sharedstatedir | --sharedstatedir | --sharedstatedi \ 470 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ 471 | --sharedst | --shareds | --shared | --share | --shar \ 472 | --sha | --sh) 473 ac_prev=sharedstatedir ;; 474 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ 475 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ 476 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ 477 | --sha=* | --sh=*) 478 sharedstatedir="$ac_optarg" ;; 479 480 -site | --site | --sit) 481 ac_prev=site ;; 482 -site=* | --site=* | --sit=*) 483 site="$ac_optarg" ;; 484 485 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) 486 ac_prev=srcdir ;; 487 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) 488 srcdir="$ac_optarg" ;; 489 490 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ 491 | --syscon | --sysco | --sysc | --sys | --sy) 492 ac_prev=sysconfdir ;; 493 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ 494 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) 495 sysconfdir="$ac_optarg" ;; 496 497 -target | --target | --targe | --targ | --tar | --ta | --t) 498 ac_prev=target ;; 499 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) 500 target="$ac_optarg" ;; 501 502 -v | -verbose | --verbose | --verbos | --verbo | --verb) 503 verbose=yes ;; 504 505 -version | --version | --versio | --versi | --vers) 506 echo "configure generated by autoconf version AC_ACVERSION" 507 exit 0 ;; 508 509 -with-* | --with-*) 510 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` 511 # Reject names that are not valid shell variable names. 512changequote(, )dnl 513 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then 514changequote([, ])dnl 515 AC_MSG_ERROR($ac_package: invalid package name) 516 fi 517 ac_package=`echo $ac_package| sed 's/-/_/g'` 518 case "$ac_option" in 519 *=*) ;; 520 *) ac_optarg=yes ;; 521 esac 522 eval "with_${ac_package}='$ac_optarg'" ;; 523 524 -without-* | --without-*) 525 ac_package=`echo $ac_option|sed -e 's/-*without-//'` 526 # Reject names that are not valid shell variable names. 527changequote(, )dnl 528 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then 529changequote([, ])dnl 530 AC_MSG_ERROR($ac_package: invalid package name) 531 fi 532 ac_package=`echo $ac_package| sed 's/-/_/g'` 533 eval "with_${ac_package}=no" ;; 534 535 --x) 536 # Obsolete; use --with-x. 537 with_x=yes ;; 538 539 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ 540 | --x-incl | --x-inc | --x-in | --x-i) 541 ac_prev=x_includes ;; 542 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ 543 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) 544 x_includes="$ac_optarg" ;; 545 546 -x-libraries | --x-libraries | --x-librarie | --x-librari \ 547 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) 548 ac_prev=x_libraries ;; 549 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ 550 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) 551 x_libraries="$ac_optarg" ;; 552 553 -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage]) 554 ;; 555 556 *) 557changequote(, )dnl 558 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then 559changequote([, ])dnl 560 AC_MSG_WARN($ac_option: invalid host type) 561 fi 562 if test "x$nonopt" != xNONE; then 563 AC_MSG_ERROR(can only configure for one host and one target at a time) 564 fi 565 nonopt="$ac_option" 566 ;; 567 568 esac 569done 570 571if test -n "$ac_prev"; then 572 AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) 573fi 574]) 575 576dnl Try to have only one #! line, so the script doesn't look funny 577dnl for users of AC_REVISION. 578dnl AC_INIT_BINSH() 579AC_DEFUN(AC_INIT_BINSH, 580[#! /bin/sh 581]) 582 583dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) 584AC_DEFUN(AC_INIT, 585[sinclude(acsite.m4)dnl 586sinclude(./aclocal.m4)dnl 587AC_REQUIRE([AC_INIT_BINSH])dnl 588AC_INIT_NOTICE 589AC_DIVERT_POP()dnl to NORMAL 590AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl 591AC_INIT_PARSE_ARGS 592AC_INIT_PREPARE($1)dnl 593AC_DIVERT_POP()dnl to NORMAL 594]) 595 596dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) 597AC_DEFUN(AC_INIT_PREPARE, 598[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 599 600# File descriptor usage: 601# 0 standard input 602# 1 file creation 603# 2 errors and warnings 604# 3 some systems may open it to /dev/tty 605# 4 used on the Kubota Titan 606define(AC_FD_MSG, 6)dnl 607[#] AC_FD_MSG checking for... messages and results 608define(AC_FD_CC, 5)dnl 609[#] AC_FD_CC compiler messages saved in config.log 610if test "$silent" = yes; then 611 exec AC_FD_MSG>/dev/null 612else 613 exec AC_FD_MSG>&1 614fi 615exec AC_FD_CC>./config.log 616 617echo "\ 618This file contains any messages produced by compilers while 619running configure, to aid debugging if configure makes a mistake. 620" 1>&AC_FD_CC 621 622# Strip out --no-create and --no-recursion so they do not pile up. 623# Also quote any args containing shell metacharacters. 624ac_configure_args= 625for ac_arg 626do 627 case "$ac_arg" in 628 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ 629 | --no-cr | --no-c) ;; 630 -no-recursion | --no-recursion | --no-recursio | --no-recursi \ 631 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; 632changequote(<<, >>)dnl 633dnl If you change this globbing pattern, test it on an old shell -- 634dnl it's sensitive. Putting any kind of quote in it causes syntax errors. 635 *" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) 636 ac_configure_args="$ac_configure_args '$ac_arg'" ;; 637changequote([, ])dnl 638 *) ac_configure_args="$ac_configure_args $ac_arg" ;; 639 esac 640done 641 642# NLS nuisances. 643# Only set these to C if already set. These must not be set unconditionally 644# because not all systems understand e.g. LANG=C (notably SCO). 645# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! 646# Non-C LC_CTYPE values break the ctype check. 647if test "${LANG+set}" = set; then LANG=C; export LANG; fi 648if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi 649if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi 650if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi 651 652# confdefs.h avoids OS command line length limits that DEFS can exceed. 653rm -rf conftest* confdefs.h 654# AIX cpp loses on an empty file, so make sure it contains at least a newline. 655echo > confdefs.h 656 657# A filename unique to this package, relative to the directory that 658# configure is in, which we can look for to find out if srcdir is correct. 659ac_unique_file=$1 660 661# Find the source files, if location was not specified. 662if test -z "$srcdir"; then 663 ac_srcdir_defaulted=yes 664 # Try the directory containing this script, then its parent. 665 ac_prog=[$]0 666changequote(, )dnl 667 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` 668changequote([, ])dnl 669 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. 670 srcdir=$ac_confdir 671 if test ! -r $srcdir/$ac_unique_file; then 672 srcdir=.. 673 fi 674else 675 ac_srcdir_defaulted=no 676fi 677if test ! -r $srcdir/$ac_unique_file; then 678 if test "$ac_srcdir_defaulted" = yes; then 679 AC_MSG_ERROR(can not find sources in $ac_confdir or ..) 680 else 681 AC_MSG_ERROR(can not find sources in $srcdir) 682 fi 683fi 684dnl Double slashes in pathnames in object file debugging info 685dnl mess up M-x gdb in Emacs. 686changequote(, )dnl 687srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` 688changequote([, ])dnl 689 690dnl Let the site file select an alternate cache file if it wants to. 691AC_SITE_LOAD 692AC_CACHE_LOAD 693AC_LANG_C 694dnl By default always use an empty string as the executable 695dnl extension. Only change it if the script calls AC_EXEEXT. 696ac_exeext= 697dnl By default assume that objects files use an extension of .o. Only 698dnl change it if the script calls AC_OBJEXT. 699ac_objext=o 700AC_PROG_ECHO_N 701dnl Substitute for predefined variables. 702AC_SUBST(SHELL)dnl 703AC_SUBST(CFLAGS)dnl 704AC_SUBST(CPPFLAGS)dnl 705AC_SUBST(CXXFLAGS)dnl 706AC_SUBST(FFLAGS)dnl 707AC_SUBST(DEFS)dnl 708AC_SUBST(LDFLAGS)dnl 709AC_SUBST(LIBS)dnl 710AC_SUBST(exec_prefix)dnl 711AC_SUBST(prefix)dnl 712AC_SUBST(program_transform_name)dnl 713dnl Installation directory options. 714AC_SUBST(bindir)dnl 715AC_SUBST(sbindir)dnl 716AC_SUBST(libexecdir)dnl 717AC_SUBST(datadir)dnl 718AC_SUBST(sysconfdir)dnl 719AC_SUBST(sharedstatedir)dnl 720AC_SUBST(localstatedir)dnl 721AC_SUBST(libdir)dnl 722AC_SUBST(includedir)dnl 723AC_SUBST(oldincludedir)dnl 724AC_SUBST(infodir)dnl 725AC_SUBST(mandir)dnl 726]) 727 728 729dnl ### Selecting optional features 730 731 732dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) 733AC_DEFUN(AC_ARG_ENABLE, 734[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl 735ac_help="$ac_help 736[$2]" 737AC_DIVERT_POP()dnl 738[#] Check whether --enable-[$1] or --disable-[$1] was given. 739if test "[${enable_]patsubst([$1], -, _)+set}" = set; then 740 enableval="[$enable_]patsubst([$1], -, _)" 741 ifelse([$3], , :, [$3]) 742ifelse([$4], , , [else 743 $4 744])dnl 745fi 746]) 747 748AC_DEFUN(AC_ENABLE, 749[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl 750AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl 751]) 752 753 754dnl ### Working with optional software 755 756 757dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) 758AC_DEFUN(AC_ARG_WITH, 759[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl 760ac_help="$ac_help 761[$2]" 762AC_DIVERT_POP()dnl 763[#] Check whether --with-[$1] or --without-[$1] was given. 764if test "[${with_]patsubst([$1], -, _)+set}" = set; then 765 withval="[$with_]patsubst([$1], -, _)" 766 ifelse([$3], , :, [$3]) 767ifelse([$4], , , [else 768 $4 769])dnl 770fi 771]) 772 773AC_DEFUN(AC_WITH, 774[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl 775AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl 776]) 777 778 779dnl ### Transforming program names. 780 781 782dnl AC_ARG_PROGRAM() 783AC_DEFUN(AC_ARG_PROGRAM, 784[if test "$program_transform_name" = s,x,x,; then 785 program_transform_name= 786else 787 # Double any \ or $. echo might interpret backslashes. 788 cat <<\EOF_SED > conftestsed 789s,\\,\\\\,g; s,\$,$$,g 790EOF_SED 791 program_transform_name="`echo $program_transform_name|sed -f conftestsed`" 792 rm -f conftestsed 793fi 794test "$program_prefix" != NONE && 795 program_transform_name="s,^,${program_prefix},; $program_transform_name" 796# Use a double $ so make ignores it. 797test "$program_suffix" != NONE && 798 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" 799 800# sed with no file args requires a program. 801test "$program_transform_name" = "" && program_transform_name="s,x,x," 802]) 803 804 805dnl ### Version numbers 806 807 808dnl AC_REVISION(REVISION-INFO) 809AC_DEFUN(AC_REVISION, 810[AC_REQUIRE([AC_INIT_BINSH])dnl 811[# From configure.in] translit([$1], $")]) 812 813dnl Subroutines of AC_PREREQ. 814 815dnl Change the dots in NUMBER into commas. 816dnl AC_PREREQ_SPLIT(NUMBER) 817define(AC_PREREQ_SPLIT, 818[translit($1, ., [, ])]) 819 820dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0). 821dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY]) 822define(AC_PREREQ_CANON, 823[$1, $2, ifelse([$3], , 0, [$3])]) 824 825dnl Complain and exit if version number 1 is less than version number 2. 826dnl PRINTABLE2 is the printable version of version number 2. 827dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2, 828dnl PRINTABLE2) 829define(AC_PREREQ_COMPARE, 830[ifelse(builtin([eval], 831[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1, 832[errprint(dnl 833FATAL ERROR: Autoconf version $7 or higher is required for this script 834)m4exit(3)])]) 835 836dnl Complain and exit if the Autoconf version is less than VERSION. 837dnl AC_PREREQ(VERSION) 838define(AC_PREREQ, 839[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), 840AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])]) 841 842 843dnl ### Getting the canonical system type 844 845 846dnl Find install-sh, config.sub, config.guess, and Cygnus configure 847dnl in directory DIR. These are auxiliary files used in configuration. 848dnl DIR can be either absolute or relative to $srcdir. 849dnl AC_CONFIG_AUX_DIR(DIR) 850AC_DEFUN(AC_CONFIG_AUX_DIR, 851[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)]) 852 853dnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'. 854dnl There's no need to call this macro explicitly; just AC_REQUIRE it. 855AC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT, 856[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)]) 857 858dnl Internal subroutine. 859dnl Search for the configuration auxiliary files in directory list $1. 860dnl We look only for install-sh, so users of AC_PROG_INSTALL 861dnl do not automatically need to distribute the other auxiliary files. 862dnl AC_CONFIG_AUX_DIRS(DIR ...) 863AC_DEFUN(AC_CONFIG_AUX_DIRS, 864[ac_aux_dir= 865for ac_dir in $1; do 866 if test -f $ac_dir/install-sh; then 867 ac_aux_dir=$ac_dir 868 ac_install_sh="$ac_aux_dir/install-sh -c" 869 break 870 elif test -f $ac_dir/install.sh; then 871 ac_aux_dir=$ac_dir 872 ac_install_sh="$ac_aux_dir/install.sh -c" 873 break 874 fi 875done 876if test -z "$ac_aux_dir"; then 877 AC_MSG_ERROR([can not find install-sh or install.sh in $1]) 878fi 879ac_config_guess=$ac_aux_dir/config.guess 880ac_config_sub=$ac_aux_dir/config.sub 881ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. 882AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 883]) 884 885dnl Canonicalize the host, target, and build system types. 886AC_DEFUN(AC_CANONICAL_SYSTEM, 887[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 888AC_BEFORE([$0], [AC_ARG_PROGRAM]) 889# Do some error checking and defaulting for the host and target type. 890# The inputs are: 891# configure --host=HOST --target=TARGET --build=BUILD NONOPT 892# 893# The rules are: 894# 1. You are not allowed to specify --host, --target, and nonopt at the 895# same time. 896# 2. Host defaults to nonopt. 897# 3. If nonopt is not specified, then host defaults to the current host, 898# as determined by config.guess. 899# 4. Target and build default to nonopt. 900# 5. If nonopt is not specified, then target and build default to host. 901 902# The aliases save the names the user supplied, while $host etc. 903# will get canonicalized. 904case $host---$target---$nonopt in 905NONE---*---* | *---NONE---* | *---*---NONE) ;; 906*) AC_MSG_ERROR(can only configure for one host and one target at a time) ;; 907esac 908 909AC_CANONICAL_HOST 910AC_CANONICAL_TARGET 911AC_CANONICAL_BUILD 912test "$host_alias" != "$target_alias" && 913 test "$program_prefix$program_suffix$program_transform_name" = \ 914 NONENONEs,x,x, && 915 program_prefix=${target_alias}- 916]) 917 918dnl Subroutines of AC_CANONICAL_SYSTEM. 919 920AC_DEFUN(AC_CANONICAL_HOST, 921[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 922 923# Make sure we can run config.sub. 924if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : 925else AC_MSG_ERROR(can not run $ac_config_sub) 926fi 927 928AC_MSG_CHECKING(host system type) 929 930dnl Set host_alias. 931host_alias=$host 932case "$host_alias" in 933NONE) 934 case $nonopt in 935 NONE) 936 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : 937 else AC_MSG_ERROR(can not guess host type; you must specify one) 938 fi ;; 939 *) host_alias=$nonopt ;; 940 esac ;; 941esac 942 943dnl Set the other host vars. 944changequote(<<, >>)dnl 945host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` 946host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 947host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 948host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 949changequote([, ])dnl 950AC_MSG_RESULT($host) 951AC_SUBST(host)dnl 952AC_SUBST(host_alias)dnl 953AC_SUBST(host_cpu)dnl 954AC_SUBST(host_vendor)dnl 955AC_SUBST(host_os)dnl 956]) 957 958dnl Internal use only. 959AC_DEFUN(AC_CANONICAL_TARGET, 960[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 961AC_MSG_CHECKING(target system type) 962 963dnl Set target_alias. 964target_alias=$target 965case "$target_alias" in 966NONE) 967 case $nonopt in 968 NONE) target_alias=$host_alias ;; 969 *) target_alias=$nonopt ;; 970 esac ;; 971esac 972 973dnl Set the other target vars. 974changequote(<<, >>)dnl 975target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` 976target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 977target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 978target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 979changequote([, ])dnl 980AC_MSG_RESULT($target) 981AC_SUBST(target)dnl 982AC_SUBST(target_alias)dnl 983AC_SUBST(target_cpu)dnl 984AC_SUBST(target_vendor)dnl 985AC_SUBST(target_os)dnl 986]) 987 988dnl Internal use only. 989AC_DEFUN(AC_CANONICAL_BUILD, 990[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 991AC_MSG_CHECKING(build system type) 992 993dnl Set build_alias. 994build_alias=$build 995case "$build_alias" in 996NONE) 997 case $nonopt in 998 NONE) build_alias=$host_alias ;; 999 *) build_alias=$nonopt ;; 1000 esac ;; 1001esac 1002 1003dnl Set the other build vars. 1004changequote(<<, >>)dnl 1005build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` 1006build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 1007build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 1008build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 1009changequote([, ])dnl 1010AC_MSG_RESULT($build) 1011AC_SUBST(build)dnl 1012AC_SUBST(build_alias)dnl 1013AC_SUBST(build_cpu)dnl 1014AC_SUBST(build_vendor)dnl 1015AC_SUBST(build_os)dnl 1016]) 1017 1018 1019dnl AC_VALIDATE_CACHED_SYSTEM_TUPLE[(cmd)] 1020dnl if the cache file is inconsistent with the current host, 1021dnl target and build system types, execute CMD or print a default 1022dnl error message. 1023AC_DEFUN(AC_VALIDATE_CACHED_SYSTEM_TUPLE, [ 1024 AC_REQUIRE([AC_CANONICAL_SYSTEM]) 1025 AC_MSG_CHECKING([cached system tuple]) 1026 if { test x"${ac_cv_host_system_type+set}" = x"set" && 1027 test x"$ac_cv_host_system_type" != x"$host"; } || 1028 { test x"${ac_cv_build_system_type+set}" = x"set" && 1029 test x"$ac_cv_build_system_type" != x"$build"; } || 1030 { test x"${ac_cv_target_system_type+set}" = x"set" && 1031 test x"$ac_cv_target_system_type" != x"$target"; }; then 1032 AC_MSG_RESULT([different]) 1033 ifelse($#, 1, [$1], 1034 [AC_MSG_ERROR([remove config.cache and re-run configure])]) 1035 else 1036 AC_MSG_RESULT(ok) 1037 fi 1038 ac_cv_host_system_type="$host" 1039 ac_cv_build_system_type="$build" 1040 ac_cv_target_system_type="$target" 1041]) 1042 1043 1044dnl ### Caching test results 1045 1046 1047dnl Look for site or system specific initialization scripts. 1048dnl AC_SITE_LOAD() 1049define(AC_SITE_LOAD, 1050[# Prefer explicitly selected file to automatically selected ones. 1051if test -z "$CONFIG_SITE"; then 1052 if test "x$prefix" != xNONE; then 1053 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" 1054 else 1055 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" 1056 fi 1057fi 1058for ac_site_file in $CONFIG_SITE; do 1059 if test -r "$ac_site_file"; then 1060 echo "loading site script $ac_site_file" 1061 . "$ac_site_file" 1062 fi 1063done 1064]) 1065 1066dnl AC_CACHE_LOAD() 1067define(AC_CACHE_LOAD, 1068[if test -r "$cache_file"; then 1069 echo "loading cache $cache_file" 1070 . $cache_file 1071else 1072 echo "creating cache $cache_file" 1073 > $cache_file 1074fi 1075]) 1076 1077dnl AC_CACHE_SAVE() 1078define(AC_CACHE_SAVE, 1079[cat > confcache <<\EOF 1080# This file is a shell script that caches the results of configure 1081# tests run on this system so they can be shared between configure 1082# scripts and configure runs. It is not useful on other systems. 1083# If it contains results you don't want to keep, you may remove or edit it. 1084# 1085# By default, configure uses ./config.cache as the cache file, 1086# creating it if it does not exist already. You can give configure 1087# the --cache-file=FILE option to use a different cache file; that is 1088# what configure does when it calls configure scripts in 1089# subdirectories, so they share the cache. 1090# Giving --cache-file=/dev/null disables caching, for debugging configure. 1091# config.status only pays attention to the cache file if you give it the 1092# --recheck option to rerun configure. 1093# 1094EOF 1095dnl Allow a site initialization script to override cache values. 1096# The following way of writing the cache mishandles newlines in values, 1097# but we know of no workaround that is simple, portable, and efficient. 1098# So, don't put newlines in cache variables' values. 1099# Ultrix sh set writes to stderr and can't be redirected directly, 1100# and sets the high bit in the cache file unless we assign to the vars. 1101changequote(, )dnl 1102(set) 2>&1 | 1103 case `(ac_space=' '; set | grep ac_space) 2>&1` in 1104 *ac_space=\ *) 1105 # `set' does not quote correctly, so add quotes (double-quote substitution 1106 # turns \\\\ into \\, and sed turns \\ into \). 1107 sed -n \ 1108 -e "s/'/'\\\\''/g" \ 1109 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" 1110 ;; 1111 *) 1112 # `set' quotes correctly as required by POSIX, so do not add quotes. 1113 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' 1114 ;; 1115 esac >> confcache 1116changequote([, ])dnl 1117if cmp -s $cache_file confcache; then 1118 : 1119else 1120 if test -w $cache_file; then 1121 echo "updating cache $cache_file" 1122 cat confcache > $cache_file 1123 else 1124 echo "not updating unwritable cache $cache_file" 1125 fi 1126fi 1127rm -f confcache 1128]) 1129 1130dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved. 1131dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) 1132define(AC_CACHE_VAL, 1133[dnl We used to use the below line, but it fails if the 1st arg is a 1134dnl shell variable, so we need the eval. 1135dnl if test "${$1+set}" = set; then 1136dnl the '' avoids an AIX 4.1 sh bug ("invalid expansion"). 1137if eval "test \"`echo '$''{'$1'+set}'`\" = set"; then 1138 echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG 1139else 1140 $2 1141fi 1142]) 1143 1144dnl AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS) 1145define(AC_CACHE_CHECK, 1146[AC_MSG_CHECKING([$1]) 1147AC_CACHE_VAL([$2], [$3]) 1148AC_MSG_RESULT([$]$2)]) 1149 1150 1151dnl ### Defining symbols 1152 1153 1154dnl Set VARIABLE to VALUE, verbatim, or 1. 1155dnl AC_DEFINE(VARIABLE [, VALUE]) 1156define(AC_DEFINE, 1157[cat >> confdefs.h <<\EOF 1158[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) 1159EOF 1160]) 1161 1162dnl Similar, but perform shell substitutions $ ` \ once on VALUE. 1163define(AC_DEFINE_UNQUOTED, 1164[cat >> confdefs.h <<EOF 1165[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) 1166EOF 1167]) 1168 1169 1170dnl ### Setting output variables 1171 1172 1173dnl This macro protects VARIABLE from being diverted twice 1174dnl if this macro is called twice for it. 1175dnl AC_SUBST(VARIABLE) 1176define(AC_SUBST, 1177[ifdef([AC_SUBST_$1], , 1178[define([AC_SUBST_$1], )dnl 1179AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl 1180s%@$1@%[$]$1%g 1181AC_DIVERT_POP()dnl 1182])]) 1183 1184dnl AC_SUBST_FILE(VARIABLE) 1185define(AC_SUBST_FILE, 1186[ifdef([AC_SUBST_$1], , 1187[define([AC_SUBST_$1], )dnl 1188AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl 1189/@$1@/r [$]$1 1190s%@$1@%%g 1191AC_DIVERT_POP()dnl 1192])]) 1193 1194 1195dnl ### Printing messages 1196 1197 1198dnl AC_MSG_CHECKING(FEATURE-DESCRIPTION) 1199define(AC_MSG_CHECKING, 1200[echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG 1201echo "configure:__oline__: checking $1" >&AC_FD_CC]) 1202 1203dnl AC_CHECKING(FEATURE-DESCRIPTION) 1204define(AC_CHECKING, 1205[echo "checking $1" 1>&AC_FD_MSG 1206echo "configure:__oline__: checking $1" >&AC_FD_CC]) 1207 1208dnl AC_MSG_RESULT(RESULT-DESCRIPTION) 1209define(AC_MSG_RESULT, 1210[echo "$ac_t""$1" 1>&AC_FD_MSG]) 1211 1212dnl AC_VERBOSE(RESULT-DESCRIPTION) 1213define(AC_VERBOSE, 1214[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl 1215echo " $1" 1>&AC_FD_MSG]) 1216 1217dnl AC_MSG_WARN(PROBLEM-DESCRIPTION) 1218define(AC_MSG_WARN, 1219[echo "configure: warning: $1" 1>&2]) 1220 1221dnl AC_MSG_ERROR(ERROR-DESCRIPTION) 1222define(AC_MSG_ERROR, 1223[{ echo "configure: error: $1" 1>&2; exit 1; }]) 1224 1225 1226dnl ### Selecting which language to use for testing 1227 1228 1229dnl AC_LANG_C() 1230AC_DEFUN(AC_LANG_C, 1231[define([AC_LANG], [C])dnl 1232ac_ext=c 1233# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. 1234ac_cpp='$CPP $CPPFLAGS' 1235ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' 1236ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' 1237cross_compiling=$ac_cv_prog_cc_cross 1238]) 1239 1240dnl AC_LANG_CPLUSPLUS() 1241AC_DEFUN(AC_LANG_CPLUSPLUS, 1242[define([AC_LANG], [CPLUSPLUS])dnl 1243ac_ext=C 1244# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. 1245ac_cpp='$CXXCPP $CPPFLAGS' 1246ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' 1247ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' 1248cross_compiling=$ac_cv_prog_cxx_cross 1249]) 1250 1251dnl AC_LANG_FORTRAN77() 1252AC_DEFUN(AC_LANG_FORTRAN77, 1253[define([AC_LANG], [FORTRAN77])dnl 1254ac_ext=f 1255ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&AC_FD_CC' 1256ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC' 1257cross_compiling=$ac_cv_prog_f77_cross 1258]) 1259 1260dnl Push the current language on a stack. 1261dnl AC_LANG_SAVE() 1262define(AC_LANG_SAVE, 1263[pushdef([AC_LANG_STACK], AC_LANG)]) 1264 1265dnl Restore the current language from the stack. 1266dnl AC_LANG_RESTORE() 1267pushdef([AC_LANG_RESTORE], 1268[ifelse(AC_LANG_STACK, [C], [AC_LANG_C],dnl 1269AC_LANG_STACK, [CPLUSPLUS], [AC_LANG_CPLUSPLUS],dnl 1270AC_LANG_STACK, [FORTRAN77], [AC_LANG_FORTRAN77])[]popdef([AC_LANG_STACK])]) 1271 1272 1273dnl ### Compiler-running mechanics 1274 1275 1276dnl The purpose of this macro is to "configure:123: command line" 1277dnl written into config.log for every test run. 1278dnl AC_TRY_EVAL(VARIABLE) 1279AC_DEFUN(AC_TRY_EVAL, 1280[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl 1281(eval [$]$1) 2>&AC_FD_CC; }]) 1282 1283dnl AC_TRY_COMMAND(COMMAND) 1284AC_DEFUN(AC_TRY_COMMAND, 1285[{ ac_try='$1'; AC_TRY_EVAL(ac_try); }]) 1286 1287 1288dnl ### Dependencies between macros 1289 1290 1291dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) 1292define(AC_BEFORE, 1293[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 1294])])]) 1295 1296dnl AC_REQUIRE(MACRO-NAME) 1297define(AC_REQUIRE, 1298[ifdef([AC_PROVIDE_$1], , 1299[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl 1300indir([$1]) 1301AC_DIVERT_POP()dnl 1302])]) 1303 1304dnl AC_PROVIDE(MACRO-NAME) 1305define(AC_PROVIDE, 1306[define([AC_PROVIDE_$1], )]) 1307 1308dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION]) 1309define(AC_OBSOLETE, 1310[errprint(__file__:__line__: warning: [$1] is obsolete[$2] 1311)]) 1312 1313 1314dnl ### Checking for programs 1315 1316 1317dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND 1318dnl [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]]) 1319AC_DEFUN(AC_CHECK_PROG, 1320[# Extract the first word of "$2", so it can be a program name with args. 1321set dummy $2; ac_word=[$]2 1322AC_MSG_CHECKING([for $ac_word]) 1323AC_CACHE_VAL(ac_cv_prog_$1, 1324[if test -n "[$]$1"; then 1325 ac_cv_prog_$1="[$]$1" # Let the user override the test. 1326else 1327 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" 1328ifelse([$6], , , [ ac_prog_rejected=no 1329])dnl 1330dnl $ac_dummy forces splitting on constant user-supplied paths. 1331dnl POSIX.2 word splitting is done only on the output of word expansions, 1332dnl not every word. This closes a longstanding sh security hole. 1333 ac_dummy="ifelse([$5], , $PATH, [$5])" 1334 for ac_dir in $ac_dummy; do 1335 test -z "$ac_dir" && ac_dir=. 1336 if test -f $ac_dir/$ac_word; then 1337ifelse([$6], , , dnl 1338[ if test "[$ac_dir/$ac_word]" = "$6"; then 1339 ac_prog_rejected=yes 1340 continue 1341 fi 1342])dnl 1343 ac_cv_prog_$1="$3" 1344 break 1345 fi 1346 done 1347 IFS="$ac_save_ifs" 1348ifelse([$6], , , [if test $ac_prog_rejected = yes; then 1349 # We found a bogon in the path, so make sure we never use it. 1350 set dummy [$]ac_cv_prog_$1 1351 shift 1352 if test [$]# -gt 0; then 1353 # We chose a different compiler from the bogus one. 1354 # However, it has the same basename, so the bogon will be chosen 1355 # first if we set $1 to just the basename; use the full file name. 1356 shift 1357 set dummy "$ac_dir/$ac_word" "[$]@" 1358 shift 1359 ac_cv_prog_$1="[$]@" 1360ifelse([$2], [$4], dnl 1361[ else 1362 # Default is a loser. 1363 AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl 1364ifelse([$5], , [\$]PATH, [$5])]) 1365])dnl 1366 fi 1367fi 1368])dnl 1369dnl If no 4th arg is given, leave the cache variable unset, 1370dnl so AC_CHECK_PROGS will keep looking. 1371ifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" 1372])dnl 1373fi])dnl 1374$1="$ac_cv_prog_$1" 1375if test -n "[$]$1"; then 1376 AC_MSG_RESULT([$]$1) 1377else 1378 AC_MSG_RESULT(no) 1379fi 1380AC_SUBST($1)dnl 1381]) 1382 1383dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]]) 1384AC_DEFUN(AC_PATH_PROG, 1385[# Extract the first word of "$2", so it can be a program name with args. 1386set dummy $2; ac_word=[$]2 1387AC_MSG_CHECKING([for $ac_word]) 1388AC_CACHE_VAL(ac_cv_path_$1, 1389[case "[$]$1" in 1390 /*) 1391 ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 1392 ;; 1393 ?:/*) 1394 ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path. 1395 ;; 1396 *) 1397 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" 1398dnl $ac_dummy forces splitting on constant user-supplied paths. 1399dnl POSIX.2 word splitting is done only on the output of word expansions, 1400dnl not every word. This closes a longstanding sh security hole. 1401 ac_dummy="ifelse([$4], , $PATH, [$4])" 1402 for ac_dir in $ac_dummy; do 1403 test -z "$ac_dir" && ac_dir=. 1404 if test -f $ac_dir/$ac_word; then 1405 ac_cv_path_$1="$ac_dir/$ac_word" 1406 break 1407 fi 1408 done 1409 IFS="$ac_save_ifs" 1410dnl If no 3rd arg is given, leave the cache variable unset, 1411dnl so AC_PATH_PROGS will keep looking. 1412ifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" 1413])dnl 1414 ;; 1415esac])dnl 1416$1="$ac_cv_path_$1" 1417if test -n "[$]$1"; then 1418 AC_MSG_RESULT([$]$1) 1419else 1420 AC_MSG_RESULT(no) 1421fi 1422AC_SUBST($1)dnl 1423]) 1424 1425dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND 1426dnl [, PATH]]) 1427AC_DEFUN(AC_CHECK_PROGS, 1428[for ac_prog in $2 1429do 1430AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4) 1431test -n "[$]$1" && break 1432done 1433ifelse([$3], , , [test -n "[$]$1" || $1="$3" 1434])]) 1435 1436dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND 1437dnl [, PATH]]) 1438AC_DEFUN(AC_PATH_PROGS, 1439[for ac_prog in $2 1440do 1441AC_PATH_PROG($1, [$]ac_prog, , $4) 1442test -n "[$]$1" && break 1443done 1444ifelse([$3], , , [test -n "[$]$1" || $1="$3" 1445])]) 1446 1447dnl Internal subroutine. 1448AC_DEFUN(AC_CHECK_TOOL_PREFIX, 1449[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl 1450if test $host != $build; then 1451 ac_tool_prefix=${host_alias}- 1452else 1453 ac_tool_prefix= 1454fi 1455]) 1456 1457dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]]) 1458AC_DEFUN(AC_CHECK_TOOL, 1459[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl 1460AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, 1461 ifelse([$3], , [$2], ), $4) 1462ifelse([$3], , , [ 1463if test -z "$ac_cv_prog_$1"; then 1464if test -n "$ac_tool_prefix"; then 1465 AC_CHECK_PROG($1, $2, $2, $3) 1466else 1467 $1="$3" 1468fi 1469fi]) 1470]) 1471 1472dnl Guess the value for the `prefix' variable by looking for 1473dnl the argument program along PATH and taking its parent. 1474dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, 1475dnl set `prefix' to /usr/local/gnu. 1476dnl This comes too late to find a site file based on the prefix, 1477dnl and it might use a cached value for the path. 1478dnl No big loss, I think, since most configures don't use this macro anyway. 1479dnl AC_PREFIX_PROGRAM(PROGRAM) 1480AC_DEFUN(AC_PREFIX_PROGRAM, 1481[if test "x$prefix" = xNONE; then 1482changequote(<<, >>)dnl 1483define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl 1484changequote([, ])dnl 1485dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. 1486echo $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG 1487AC_PATH_PROG(AC_VAR_NAME, $1) 1488changequote(<<, >>)dnl 1489 if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then 1490 prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'` 1491changequote([, ])dnl 1492 fi 1493fi 1494undefine([AC_VAR_NAME])dnl 1495]) 1496 1497dnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to 1498dnl `yes' if the current compiler works, otherwise set it ti `no'. Set 1499dnl CROSS-VAR to `yes' if the compiler and linker produce non-native 1500dnl executables, otherwise set it to `no'. Before calling 1501dnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right 1502dnl language. 1503dnl 1504dnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR) 1505AC_DEFUN(AC_TRY_COMPILER, 1506[cat > conftest.$ac_ext << EOF 1507ifelse(AC_LANG, [FORTRAN77], , 1508[ 1509[#]line __oline__ "configure" 1510#include "confdefs.h" 1511]) 1512[$1] 1513EOF 1514if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then 1515 [$2]=yes 1516 # If we can't run a trivial program, we are probably using a cross compiler. 1517 if (./conftest; exit) 2>/dev/null; then 1518 [$3]=no 1519 else 1520 [$3]=yes 1521 fi 1522else 1523 echo "configure: failed program was:" >&AC_FD_CC 1524 cat conftest.$ac_ext >&AC_FD_CC 1525 [$2]=no 1526fi 1527rm -fr conftest*]) 1528 1529 1530dnl ### Checking for libraries 1531 1532 1533dnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) 1534dnl Try to link a program that calls FUNC, handling GCC builtins. If 1535dnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute 1536dnl ACTION-IF-NOT-FOUND. 1537 1538AC_DEFUN(AC_TRY_LINK_FUNC, 1539AC_TRY_LINK(dnl 1540ifelse([$1], [main], , dnl Avoid conflicting decl of main. 1541[/* Override any gcc2 internal prototype to avoid an error. */ 1542]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus 1543extern "C" 1544#endif 1545])dnl 1546[/* We use char because int might match the return type of a gcc2 1547 builtin and then its argument prototype would still apply. */ 1548char $1(); 1549]), 1550[$1()], 1551[$2], 1552[$3])) 1553 1554 1555dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND 1556dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) 1557dnl Search for a library defining FUNC, if it's not already available. 1558 1559AC_DEFUN(AC_SEARCH_LIBS, 1560[AC_PREREQ([2.13]) 1561AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1], 1562[ac_func_search_save_LIBS="$LIBS" 1563ac_cv_search_$1="no" 1564AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"]) 1565test "$ac_cv_search_$1" = "no" && for i in $2; do 1566LIBS="-l$i $5 $ac_func_search_save_LIBS" 1567AC_TRY_LINK_FUNC([$1], 1568[ac_cv_search_$1="-l$i" 1569break]) 1570done 1571LIBS="$ac_func_search_save_LIBS"]) 1572if test "$ac_cv_search_$1" != "no"; then 1573 test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS" 1574 $3 1575else : 1576 $4 1577fi]) 1578 1579 1580 1581dnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND 1582dnl [, OTHER-LIBRARIES]]]) 1583AC_DEFUN(AC_CHECK_LIB, 1584[AC_MSG_CHECKING([for $2 in -l$1]) 1585dnl Use a cache variable name containing both the library and function name, 1586dnl because the test really is for library $1 defining function $2, not 1587dnl just for library $1. Separate tests with the same $1 and different $2s 1588dnl may have different results. 1589ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` 1590AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, 1591[ac_save_LIBS="$LIBS" 1592LIBS="-l$1 $5 $LIBS" 1593AC_TRY_LINK(dnl 1594ifelse(AC_LANG, [FORTRAN77], , 1595ifelse([$2], [main], , dnl Avoid conflicting decl of main. 1596[/* Override any gcc2 internal prototype to avoid an error. */ 1597]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus 1598extern "C" 1599#endif 1600])dnl 1601[/* We use char because int might match the return type of a gcc2 1602 builtin and then its argument prototype would still apply. */ 1603char $2(); 1604])), 1605 [$2()], 1606 eval "ac_cv_lib_$ac_lib_var=yes", 1607 eval "ac_cv_lib_$ac_lib_var=no") 1608LIBS="$ac_save_LIBS" 1609])dnl 1610if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 1611 AC_MSG_RESULT(yes) 1612 ifelse([$3], , 1613[changequote(, )dnl 1614 ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ 1615 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` 1616changequote([, ])dnl 1617 AC_DEFINE_UNQUOTED($ac_tr_lib) 1618 LIBS="-l$1 $LIBS" 1619], [$3]) 1620else 1621 AC_MSG_RESULT(no) 1622ifelse([$4], , , [$4 1623])dnl 1624fi 1625]) 1626 1627dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND 1628dnl [, OTHER-LIBRARIES]]]) 1629AC_DEFUN(AC_HAVE_LIBRARY, 1630[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl 1631changequote(<<, >>)dnl 1632define(<<AC_LIB_NAME>>, dnl 1633patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl 1634define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl 1635changequote([, ])dnl 1636AC_MSG_CHECKING([for -l[]AC_LIB_NAME]) 1637AC_CACHE_VAL(AC_CV_NAME, 1638[ac_save_LIBS="$LIBS" 1639LIBS="-l[]AC_LIB_NAME[] $4 $LIBS" 1640AC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no) 1641LIBS="$ac_save_LIBS" 1642])dnl 1643AC_MSG_RESULT($AC_CV_NAME) 1644if test "$AC_CV_NAME" = yes; then 1645 ifelse([$2], , 1646[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) 1647 LIBS="-l[]AC_LIB_NAME[] $LIBS" 1648], [$2]) 1649ifelse([$3], , , [else 1650 $3 1651])dnl 1652fi 1653undefine([AC_LIB_NAME])dnl 1654undefine([AC_CV_NAME])dnl 1655]) 1656 1657 1658dnl ### Examining declarations 1659 1660 1661dnl AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) 1662AC_DEFUN(AC_TRY_CPP, 1663[AC_REQUIRE_CPP()dnl 1664cat > conftest.$ac_ext <<EOF 1665[#]line __oline__ "configure" 1666#include "confdefs.h" 1667[$1] 1668EOF 1669dnl Capture the stderr of cpp. eval is necessary to expand ac_cpp. 1670dnl We used to copy stderr to stdout and capture it in a variable, but 1671dnl that breaks under sh -x, which writes compile commands starting 1672dnl with ` +' to stderr in eval and subshells. 1673ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1674AC_TRY_EVAL(ac_try) 1675ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1676if test -z "$ac_err"; then 1677 ifelse([$2], , :, [rm -rf conftest* 1678 $2]) 1679else 1680 echo "$ac_err" >&AC_FD_CC 1681 echo "configure: failed program was:" >&AC_FD_CC 1682 cat conftest.$ac_ext >&AC_FD_CC 1683ifelse([$3], , , [ rm -rf conftest* 1684 $3 1685])dnl 1686fi 1687rm -f conftest*]) 1688 1689dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [, 1690dnl ACTION-IF-NOT-FOUND]) 1691AC_DEFUN(AC_EGREP_HEADER, 1692[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])]) 1693 1694dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must 1695dnl come early, it is not included in AC_BEFORE checks. 1696dnl AC_EGREP_CPP(PATTERN, PROGRAM, [ACTION-IF-FOUND [, 1697dnl ACTION-IF-NOT-FOUND]]) 1698AC_DEFUN(AC_EGREP_CPP, 1699[AC_REQUIRE_CPP()dnl 1700cat > conftest.$ac_ext <<EOF 1701[#]line __oline__ "configure" 1702#include "confdefs.h" 1703[$2] 1704EOF 1705dnl eval is necessary to expand ac_cpp. 1706dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. 1707if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC | 1708dnl Prevent m4 from eating character classes: 1709changequote(, )dnl 1710 egrep "$1" >/dev/null 2>&1; then 1711changequote([, ])dnl 1712 ifelse([$3], , :, [rm -rf conftest* 1713 $3]) 1714ifelse([$4], , , [else 1715 rm -rf conftest* 1716 $4 1717])dnl 1718fi 1719rm -f conftest* 1720]) 1721 1722 1723dnl ### Examining syntax 1724 1725 1726dnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY, 1727dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1728AC_DEFUN(AC_TRY_COMPILE, 1729[cat > conftest.$ac_ext <<EOF 1730ifelse(AC_LANG, [FORTRAN77], 1731[ program main 1732[$2] 1733 end], 1734[dnl This sometimes fails to find confdefs.h, for some reason. 1735dnl [#]line __oline__ "[$]0" 1736[#]line __oline__ "configure" 1737#include "confdefs.h" 1738[$1] 1739int main() { 1740[$2] 1741; return 0; } 1742])EOF 1743if AC_TRY_EVAL(ac_compile); then 1744 ifelse([$3], , :, [rm -rf conftest* 1745 $3]) 1746else 1747 echo "configure: failed program was:" >&AC_FD_CC 1748 cat conftest.$ac_ext >&AC_FD_CC 1749ifelse([$4], , , [ rm -rf conftest* 1750 $4 1751])dnl 1752fi 1753rm -f conftest*]) 1754 1755 1756dnl ### Examining libraries 1757 1758 1759dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, 1760dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) 1761AC_DEFUN(AC_COMPILE_CHECK, 1762[AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl 1763ifelse([$1], , , [AC_CHECKING([for $1]) 1764])dnl 1765AC_TRY_LINK([$2], [$3], [$4], [$5]) 1766]) 1767 1768dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY, 1769dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1770AC_DEFUN(AC_TRY_LINK, 1771[cat > conftest.$ac_ext <<EOF 1772ifelse(AC_LANG, [FORTRAN77], 1773[ 1774 program main 1775 call [$2] 1776 end 1777], 1778[dnl This sometimes fails to find confdefs.h, for some reason. 1779dnl [#]line __oline__ "[$]0" 1780[#]line __oline__ "configure" 1781#include "confdefs.h" 1782[$1] 1783int main() { 1784[$2] 1785; return 0; } 1786])EOF 1787if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then 1788 ifelse([$3], , :, [rm -rf conftest* 1789 $3]) 1790else 1791 echo "configure: failed program was:" >&AC_FD_CC 1792 cat conftest.$ac_ext >&AC_FD_CC 1793ifelse([$4], , , [ rm -rf conftest* 1794 $4 1795])dnl 1796fi 1797rm -f conftest*]) 1798 1799 1800dnl ### Checking for run-time features 1801 1802 1803dnl AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE 1804dnl [, ACTION-IF-CROSS-COMPILING]]]) 1805AC_DEFUN(AC_TRY_RUN, 1806[if test "$cross_compiling" = yes; then 1807 ifelse([$4], , 1808 [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling 1809)dnl 1810 AC_MSG_ERROR(can not run test program while cross compiling)], 1811 [$4]) 1812else 1813 AC_TRY_RUN_NATIVE([$1], [$2], [$3]) 1814fi 1815]) 1816 1817dnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. 1818dnl AC_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) 1819AC_DEFUN(AC_TRY_RUN_NATIVE, 1820[cat > conftest.$ac_ext <<EOF 1821[#]line __oline__ "configure" 1822#include "confdefs.h" 1823ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus 1824extern "C" void exit(int); 1825#endif 1826])dnl 1827[$1] 1828EOF 1829if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 1830then 1831dnl Don't remove the temporary files here, so they can be examined. 1832 ifelse([$2], , :, [$2]) 1833else 1834 echo "configure: failed program was:" >&AC_FD_CC 1835 cat conftest.$ac_ext >&AC_FD_CC 1836ifelse([$3], , , [ rm -fr conftest* 1837 $3 1838])dnl 1839fi 1840rm -fr conftest*]) 1841 1842 1843dnl ### Checking for header files 1844 1845 1846dnl AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1847AC_DEFUN(AC_CHECK_HEADER, 1848[dnl Do the transliteration at runtime so arg 1 can be a shell variable. 1849ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` 1850AC_MSG_CHECKING([for $1]) 1851AC_CACHE_VAL(ac_cv_header_$ac_safe, 1852[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes", 1853 eval "ac_cv_header_$ac_safe=no")])dnl 1854if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 1855 AC_MSG_RESULT(yes) 1856 ifelse([$2], , :, [$2]) 1857else 1858 AC_MSG_RESULT(no) 1859ifelse([$3], , , [$3 1860])dnl 1861fi 1862]) 1863 1864dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1865AC_DEFUN(AC_CHECK_HEADERS, 1866[for ac_hdr in $1 1867do 1868AC_CHECK_HEADER($ac_hdr, 1869[changequote(, )dnl 1870 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 1871changequote([, ])dnl 1872 AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl 1873done 1874]) 1875 1876 1877dnl ### Checking for the existence of files 1878 1879dnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1880AC_DEFUN(AC_CHECK_FILE, 1881[AC_REQUIRE([AC_PROG_CC]) 1882dnl Do the transliteration at runtime so arg 1 can be a shell variable. 1883ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` 1884AC_MSG_CHECKING([for $1]) 1885AC_CACHE_VAL(ac_cv_file_$ac_safe, 1886[if test "$cross_compiling" = yes; then 1887 errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling 1888)dnl 1889 AC_MSG_ERROR(Cannot check for file existence when cross compiling) 1890else 1891 if test -r $1; then 1892 eval "ac_cv_file_$ac_safe=yes" 1893 else 1894 eval "ac_cv_file_$ac_safe=no" 1895 fi 1896fi])dnl 1897if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then 1898 AC_MSG_RESULT(yes) 1899 ifelse([$2], , :, [$2]) 1900else 1901 AC_MSG_RESULT(no) 1902ifelse([$3], , , [$3]) 1903fi 1904]) 1905 1906dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1907AC_DEFUN(AC_CHECK_FILES, 1908[for ac_file in $1 1909do 1910AC_CHECK_FILE($ac_file, 1911[changequote(, )dnl 1912 ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` 1913changequote([, ])dnl 1914 AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl 1915done 1916]) 1917 1918 1919dnl ### Checking for library functions 1920 1921 1922dnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1923AC_DEFUN(AC_CHECK_FUNC, 1924[AC_MSG_CHECKING([for $1]) 1925AC_CACHE_VAL(ac_cv_func_$1, 1926[AC_TRY_LINK( 1927dnl Don't include <ctype.h> because on OSF/1 3.0 it includes <sys/types.h> 1928dnl which includes <sys/select.h> which contains a prototype for 1929dnl select. Similarly for bzero. 1930[/* System header to define __stub macros and hopefully few prototypes, 1931 which can conflict with char $1(); below. */ 1932#include <assert.h> 1933/* Override any gcc2 internal prototype to avoid an error. */ 1934]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus 1935extern "C" 1936#endif 1937])dnl 1938[/* We use char because int might match the return type of a gcc2 1939 builtin and then its argument prototype would still apply. */ 1940char $1(); 1941], [ 1942/* The GNU C library defines this for functions which it implements 1943 to always fail with ENOSYS. Some functions are actually named 1944 something starting with __ and the normal name is an alias. */ 1945#if defined (__stub_$1) || defined (__stub___$1) 1946choke me 1947#else 1948$1(); 1949#endif 1950], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")]) 1951if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then 1952 AC_MSG_RESULT(yes) 1953 ifelse([$2], , :, [$2]) 1954else 1955 AC_MSG_RESULT(no) 1956ifelse([$3], , , [$3 1957])dnl 1958fi 1959]) 1960 1961dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) 1962AC_DEFUN(AC_CHECK_FUNCS, 1963[for ac_func in $1 1964do 1965AC_CHECK_FUNC($ac_func, 1966[changequote(, )dnl 1967 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` 1968changequote([, ])dnl 1969 AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl 1970done 1971]) 1972 1973dnl AC_REPLACE_FUNCS(FUNCTION...) 1974AC_DEFUN(AC_REPLACE_FUNCS, 1975[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"]) 1976AC_SUBST(LIBOBJS)dnl 1977]) 1978 1979 1980dnl ### Checking compiler characteristics 1981 1982 1983dnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE]) 1984AC_DEFUN(AC_CHECK_SIZEOF, 1985[changequote(<<, >>)dnl 1986dnl The name to #define. 1987define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl 1988dnl The cache variable name. 1989define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl 1990changequote([, ])dnl 1991AC_MSG_CHECKING(size of $1) 1992AC_CACHE_VAL(AC_CV_NAME, 1993[AC_TRY_RUN([#include <stdio.h> 1994main() 1995{ 1996 FILE *f=fopen("conftestval", "w"); 1997 if (!f) exit(1); 1998 fprintf(f, "%d\n", sizeof($1)); 1999 exit(0); 2000}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl 2001AC_MSG_RESULT($AC_CV_NAME) 2002AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) 2003undefine([AC_TYPE_NAME])dnl 2004undefine([AC_CV_NAME])dnl 2005]) 2006 2007 2008dnl ### Checking for typedefs 2009 2010 2011dnl AC_CHECK_TYPE(TYPE, DEFAULT) 2012AC_DEFUN(AC_CHECK_TYPE, 2013[AC_REQUIRE([AC_HEADER_STDC])dnl 2014AC_MSG_CHECKING(for $1) 2015AC_CACHE_VAL(ac_cv_type_$1, 2016[AC_EGREP_CPP(dnl 2017changequote(<<,>>)dnl 2018<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl 2019changequote([,]), [#include <sys/types.h> 2020#if STDC_HEADERS 2021#include <stdlib.h> 2022#include <stddef.h> 2023#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl 2024AC_MSG_RESULT($ac_cv_type_$1) 2025if test $ac_cv_type_$1 = no; then 2026 AC_DEFINE($1, $2) 2027fi 2028]) 2029 2030 2031dnl ### Creating output files 2032 2033 2034dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...) 2035AC_DEFUN(AC_CONFIG_HEADER, 2036[define(AC_LIST_HEADER, $1)]) 2037 2038dnl Link each of the existing files SOURCE... to the corresponding 2039dnl link name in DEST... 2040dnl AC_LINK_FILES(SOURCE..., DEST...) 2041AC_DEFUN(AC_LINK_FILES, 2042[dnl 2043define([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl 2044define([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])]) 2045 2046dnl Add additional commands for AC_OUTPUT to put into config.status. 2047dnl Use diversions instead of macros so we can be robust in the 2048dnl presence of commas in $1 and/or $2. 2049dnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS) 2050AC_DEFUN(AC_OUTPUT_COMMANDS, 2051[AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl 2052[$1] 2053AC_DIVERT_POP()dnl 2054AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)dnl 2055[$2] 2056AC_DIVERT_POP()]) 2057 2058dnl AC_CONFIG_SUBDIRS(DIR ...) 2059AC_DEFUN(AC_CONFIG_SUBDIRS, 2060[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 2061define([AC_LIST_SUBDIRS], ifdef([AC_LIST_SUBDIRS], [AC_LIST_SUBDIRS ],)[$1])dnl 2062subdirs="AC_LIST_SUBDIRS" 2063AC_SUBST(subdirs)dnl 2064]) 2065 2066dnl The big finish. 2067dnl Produce config.status, config.h, and links; and configure subdirs. 2068dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) 2069define(AC_OUTPUT, 2070[trap '' 1 2 15 2071AC_CACHE_SAVE 2072trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 2073 2074test "x$prefix" = xNONE && prefix=$ac_default_prefix 2075# Let make expand exec_prefix. 2076test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' 2077 2078# Any assignment to VPATH causes Sun make to only execute 2079# the first set of double-colon rules, so remove it if not needed. 2080# If there is a colon in the path, we need to keep it. 2081if test "x$srcdir" = x.; then 2082changequote(, )dnl 2083 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' 2084changequote([, ])dnl 2085fi 2086 2087trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 2088 2089ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()]) 2090 2091# Without the "./", some shells look in PATH for config.status. 2092: ${CONFIG_STATUS=./config.status} 2093 2094echo creating $CONFIG_STATUS 2095rm -f $CONFIG_STATUS 2096cat > $CONFIG_STATUS <<EOF 2097#! /bin/sh 2098# Generated automatically by configure. 2099# Run this file to recreate the current configuration. 2100# This directory was configured as follows, 2101dnl hostname on some systems (SVR3.2, Linux) returns a bogus exit status, 2102dnl so uname gets run too. 2103# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: 2104# 2105[#] [$]0 [$]ac_configure_args 2106# 2107# Compiler output produced by configure, useful for debugging 2108# configure, is in ./config.log if it exists. 2109 2110changequote(, )dnl 2111ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" 2112changequote([, ])dnl 2113for ac_option 2114do 2115 case "[\$]ac_option" in 2116 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) 2117 echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion" 2118 exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;; 2119 -version | --version | --versio | --versi | --vers | --ver | --ve | --v) 2120 echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION" 2121 exit 0 ;; 2122 -help | --help | --hel | --he | --h) 2123 echo "[\$]ac_cs_usage"; exit 0 ;; 2124 *) echo "[\$]ac_cs_usage"; exit 1 ;; 2125 esac 2126done 2127 2128ac_given_srcdir=$srcdir 2129ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL" 2130])dnl 2131 2132changequote(<<, >>)dnl 2133ifdef(<<AC_LIST_HEADER>>, 2134<<trap 'rm -fr `echo "$1 AC_LIST_HEADER" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>, 2135<<trap 'rm -fr `echo "$1" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15>>) 2136changequote([, ])dnl 2137EOF 2138cat >> $CONFIG_STATUS <<EOF 2139 2140AC_OUTPUT_FILES($1) 2141ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl 2142ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_FILES, AC_LIST_LINKS)])dnl 2143EOF 2144cat >> $CONFIG_STATUS <<EOF 2145undivert(AC_DIVERSION_ICMDS)dnl 2146$3 2147EOF 2148cat >> $CONFIG_STATUS <<\EOF 2149undivert(AC_DIVERSION_CMDS)dnl 2150$2 2151exit 0 2152EOF 2153chmod +x $CONFIG_STATUS 2154rm -fr confdefs* $ac_clean_files 2155test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 2156dnl config.status should not do recursion. 2157ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl 2158])dnl 2159 2160dnl Set the DEFS variable to the -D options determined earlier. 2161dnl This is a subroutine of AC_OUTPUT. 2162dnl It is called inside configure, outside of config.status. 2163dnl AC_OUTPUT_MAKE_DEFS() 2164define(AC_OUTPUT_MAKE_DEFS, 2165[# Transform confdefs.h into DEFS. 2166dnl Using a here document instead of a string reduces the quoting nightmare. 2167# Protect against shell expansion while executing Makefile rules. 2168# Protect against Makefile macro expansion. 2169cat > conftest.defs <<\EOF 2170changequote(<<, >>)dnl 2171s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g 2172s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g 2173s%\[%\\&%g 2174s%\]%\\&%g 2175s%\$%$$%g 2176changequote([, ])dnl 2177EOF 2178DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` 2179rm -f conftest.defs 2180]) 2181 2182dnl Do the variable substitutions to create the Makefiles or whatever. 2183dnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted 2184dnl here document whose contents are going into config.status, but 2185dnl upon returning, the here document is being quoted. 2186dnl AC_OUTPUT_FILES(FILE...) 2187define(AC_OUTPUT_FILES, 2188[# Protect against being on the right side of a sed subst in config.status. 2189changequote(, )dnl 2190sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; 2191 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF 2192changequote([, ])dnl 2193dnl These here document variables are unquoted when configure runs 2194dnl but quoted when config.status runs, so variables are expanded once. 2195$ac_vpsub 2196dnl Shell code in configure.in might set extrasub. 2197$extrasub 2198dnl Insert the sed substitutions of variables. 2199undivert(AC_DIVERSION_SED) 2200CEOF 2201EOF 2202 2203cat >> $CONFIG_STATUS <<\EOF 2204 2205# Split the substitutions into bite-sized pieces for seds with 2206# small command number limits, like on Digital OSF/1 and HP-UX. 2207ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. 2208ac_file=1 # Number of current file. 2209ac_beg=1 # First line for current file. 2210ac_end=$ac_max_sed_cmds # Line after last line for current file. 2211ac_more_lines=: 2212ac_sed_cmds="" 2213while $ac_more_lines; do 2214 if test $ac_beg -gt 1; then 2215 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file 2216 else 2217 sed "${ac_end}q" conftest.subs > conftest.s$ac_file 2218 fi 2219 if test ! -s conftest.s$ac_file; then 2220 ac_more_lines=false 2221 rm -f conftest.s$ac_file 2222 else 2223 if test -z "$ac_sed_cmds"; then 2224 ac_sed_cmds="sed -f conftest.s$ac_file" 2225 else 2226 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" 2227 fi 2228 ac_file=`expr $ac_file + 1` 2229 ac_beg=$ac_end 2230 ac_end=`expr $ac_end + $ac_max_sed_cmds` 2231 fi 2232done 2233if test -z "$ac_sed_cmds"; then 2234 ac_sed_cmds=cat 2235fi 2236EOF 2237 2238cat >> $CONFIG_STATUS <<EOF 2239 2240CONFIG_FILES=\${CONFIG_FILES-"$1"} 2241EOF 2242cat >> $CONFIG_STATUS <<\EOF 2243for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then 2244changequote(, )dnl 2245 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". 2246 case "$ac_file" in 2247 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` 2248 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; 2249 *) ac_file_in="${ac_file}.in" ;; 2250 esac 2251 2252 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. 2253 2254 # Remove last slash and all that follows it. Not all systems have dirname. 2255 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` 2256changequote([, ])dnl 2257 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then 2258 # The file is in a subdirectory. 2259 test ! -d "$ac_dir" && mkdir "$ac_dir" 2260 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" 2261 # A "../" for each directory in $ac_dir_suffix. 2262changequote(, )dnl 2263 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` 2264changequote([, ])dnl 2265 else 2266 ac_dir_suffix= ac_dots= 2267 fi 2268 2269 case "$ac_given_srcdir" in 2270 .) srcdir=. 2271 if test -z "$ac_dots"; then top_srcdir=. 2272 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; 2273 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; 2274 *) # Relative path. 2275 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" 2276 top_srcdir="$ac_dots$ac_given_srcdir" ;; 2277 esac 2278 2279ifdef([AC_PROVIDE_AC_PROG_INSTALL], 2280[ case "$ac_given_INSTALL" in 2281changequote(, )dnl 2282 [/$]*) INSTALL="$ac_given_INSTALL" ;; 2283changequote([, ])dnl 2284 *) INSTALL="$ac_dots$ac_given_INSTALL" ;; 2285 esac 2286])dnl 2287 2288 echo creating "$ac_file" 2289 rm -f "$ac_file" 2290 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." 2291 case "$ac_file" in 2292 *Makefile*) ac_comsub="1i\\ 2293# $configure_input" ;; 2294 *) ac_comsub= ;; 2295 esac 2296 2297 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` 2298 sed -e "$ac_comsub 2299s%@configure_input@%$configure_input%g 2300s%@srcdir@%$srcdir%g 2301s%@top_srcdir@%$top_srcdir%g 2302ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g 2303])dnl 2304dnl The parens around the eval prevent an "illegal io" in Ultrix sh. 2305" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file 2306dnl This would break Makefile dependencies. 2307dnl if cmp -s $ac_file conftest.out 2>/dev/null; then 2308dnl echo "$ac_file is unchanged" 2309dnl rm -f conftest.out 2310dnl else 2311dnl rm -f $ac_file 2312dnl mv conftest.out $ac_file 2313dnl fi 2314fi; done 2315rm -f conftest.s* 2316]) 2317 2318dnl Create the config.h files from the config.h.in files. 2319dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted 2320dnl here document whose contents are going into config.status. 2321dnl AC_OUTPUT_HEADER(HEADER-FILE...) 2322define(AC_OUTPUT_HEADER, 2323[changequote(<<, >>)dnl 2324# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where 2325# NAME is the cpp macro being defined and VALUE is the value it is being given. 2326# 2327# ac_d sets the value in "#define NAME VALUE" lines. 2328ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' 2329ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' 2330ac_dC='\3' 2331ac_dD='%g' 2332# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". 2333ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' 2334ac_uB='\([ ]\)%\1#\2define\3' 2335ac_uC=' ' 2336ac_uD='\4%g' 2337# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". 2338ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' 2339ac_eB='<<$>>%\1#\2define\3' 2340ac_eC=' ' 2341ac_eD='%g' 2342changequote([, ])dnl 2343 2344if test "${CONFIG_HEADERS+set}" != set; then 2345EOF 2346dnl Support passing AC_CONFIG_HEADER a value containing shell variables. 2347cat >> $CONFIG_STATUS <<EOF 2348 CONFIG_HEADERS="$1" 2349EOF 2350cat >> $CONFIG_STATUS <<\EOF 2351fi 2352for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then 2353changequote(, )dnl 2354 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". 2355 case "$ac_file" in 2356 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` 2357 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; 2358 *) ac_file_in="${ac_file}.in" ;; 2359 esac 2360changequote([, ])dnl 2361 2362 echo creating $ac_file 2363 2364 rm -f conftest.frag conftest.in conftest.out 2365 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` 2366 cat $ac_file_inputs > conftest.in 2367 2368EOF 2369 2370# Transform confdefs.h into a sed script conftest.vals that substitutes 2371# the proper values into config.h.in to produce config.h. And first: 2372# Protect against being on the right side of a sed subst in config.status. 2373# Protect against being in an unquoted here document in config.status. 2374rm -f conftest.vals 2375dnl Using a here document instead of a string reduces the quoting nightmare. 2376dnl Putting comments in sed scripts is not portable. 2377cat > conftest.hdr <<\EOF 2378changequote(<<, >>)dnl 2379s/[\\&%]/\\&/g 2380s%[\\$`]%\\&%g 2381s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp 2382s%ac_d%ac_u%gp 2383s%ac_u%ac_e%gp 2384changequote([, ])dnl 2385EOF 2386sed -n -f conftest.hdr confdefs.h > conftest.vals 2387rm -f conftest.hdr 2388 2389# This sed command replaces #undef with comments. This is necessary, for 2390# example, in the case of _POSIX_SOURCE, which is predefined and required 2391# on some systems where configure will not decide to define it. 2392cat >> conftest.vals <<\EOF 2393changequote(, )dnl 2394s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% 2395changequote([, ])dnl 2396EOF 2397 2398# Break up conftest.vals because some shells have a limit on 2399# the size of here documents, and old seds have small limits too. 2400 2401rm -f conftest.tail 2402while : 2403do 2404 ac_lines=`grep -c . conftest.vals` 2405 # grep -c gives empty output for an empty file on some AIX systems. 2406 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi 2407 # Write a limited-size here document to conftest.frag. 2408 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS 2409 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS 2410 echo 'CEOF 2411 sed -f conftest.frag conftest.in > conftest.out 2412 rm -f conftest.in 2413 mv conftest.out conftest.in 2414' >> $CONFIG_STATUS 2415 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail 2416 rm -f conftest.vals 2417 mv conftest.tail conftest.vals 2418done 2419rm -f conftest.vals 2420 2421dnl Now back to your regularly scheduled config.status. 2422cat >> $CONFIG_STATUS <<\EOF 2423 rm -f conftest.frag conftest.h 2424 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h 2425 cat conftest.in >> conftest.h 2426 rm -f conftest.in 2427 if cmp -s $ac_file conftest.h 2>/dev/null; then 2428 echo "$ac_file is unchanged" 2429 rm -f conftest.h 2430 else 2431 # Remove last slash and all that follows it. Not all systems have dirname. 2432 changequote(, )dnl 2433 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` 2434 changequote([, ])dnl 2435 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then 2436 # The file is in a subdirectory. 2437 test ! -d "$ac_dir" && mkdir "$ac_dir" 2438 fi 2439 rm -f $ac_file 2440 mv conftest.h $ac_file 2441 fi 2442fi; done 2443 2444]) 2445 2446dnl This is a subroutine of AC_OUTPUT. It is called inside a quoted 2447dnl here document whose contents are going into config.status. 2448dnl AC_OUTPUT_LINKS(SOURCE..., DEST...) 2449define(AC_OUTPUT_LINKS, 2450[EOF 2451 2452cat >> $CONFIG_STATUS <<EOF 2453ac_sources="$1" 2454ac_dests="$2" 2455EOF 2456 2457cat >> $CONFIG_STATUS <<\EOF 2458srcdir=$ac_given_srcdir 2459while test -n "$ac_sources"; do 2460 set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]* 2461 set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]* 2462 2463 echo "linking $srcdir/$ac_source to $ac_dest" 2464 2465 if test ! -r $srcdir/$ac_source; then 2466 AC_MSG_ERROR($srcdir/$ac_source: File not found) 2467 fi 2468 rm -f $ac_dest 2469 2470 # Make relative symlinks. 2471 # Remove last slash and all that follows it. Not all systems have dirname. 2472changequote(, )dnl 2473 ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` 2474changequote([, ])dnl 2475 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then 2476 # The dest file is in a subdirectory. 2477 test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" 2478 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" 2479 # A "../" for each directory in $ac_dest_dir_suffix. 2480changequote(, )dnl 2481 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` 2482changequote([, ])dnl 2483 else 2484 ac_dest_dir_suffix= ac_dots= 2485 fi 2486 2487 case "$srcdir" in 2488changequote(, )dnl 2489 [/$]*) ac_rel_source="$srcdir/$ac_source" ;; 2490changequote([, ])dnl 2491 *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; 2492 esac 2493 2494 # Make a symlink if possible; otherwise try a hard link. 2495 if ln -s $ac_rel_source $ac_dest 2>/dev/null || 2496 ln $srcdir/$ac_source $ac_dest; then : 2497 else 2498 AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source) 2499 fi 2500done 2501]) 2502 2503dnl This is a subroutine of AC_OUTPUT. 2504dnl It is called after running config.status. 2505dnl AC_OUTPUT_SUBDIRS(DIRECTORY...) 2506define(AC_OUTPUT_SUBDIRS, 2507[ 2508if test "$no_recursion" != yes; then 2509 2510 # Remove --cache-file and --srcdir arguments so they do not pile up. 2511 ac_sub_configure_args= 2512 ac_prev= 2513 for ac_arg in $ac_configure_args; do 2514 if test -n "$ac_prev"; then 2515 ac_prev= 2516 continue 2517 fi 2518 case "$ac_arg" in 2519 -cache-file | --cache-file | --cache-fil | --cache-fi \ 2520 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) 2521 ac_prev=cache_file ;; 2522 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ 2523 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) 2524 ;; 2525 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) 2526 ac_prev=srcdir ;; 2527 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) 2528 ;; 2529 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; 2530 esac 2531 done 2532 2533 for ac_config_dir in $1; do 2534 2535 # Do not complain, so a configure script can configure whichever 2536 # parts of a large source tree are present. 2537 if test ! -d $srcdir/$ac_config_dir; then 2538 continue 2539 fi 2540 2541 echo configuring in $ac_config_dir 2542 2543 case "$srcdir" in 2544 .) ;; 2545 *) 2546 if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; 2547 else 2548 AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) 2549 fi 2550 ;; 2551 esac 2552 2553 ac_popdir=`pwd` 2554 cd $ac_config_dir 2555 2556changequote(, )dnl 2557 # A "../" for each directory in /$ac_config_dir. 2558 ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` 2559changequote([, ])dnl 2560 2561 case "$srcdir" in 2562 .) # No --srcdir option. We are building in place. 2563 ac_sub_srcdir=$srcdir ;; 2564 /*) # Absolute path. 2565 ac_sub_srcdir=$srcdir/$ac_config_dir ;; 2566 *) # Relative path. 2567 ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; 2568 esac 2569 2570 # Check for guested configure; otherwise get Cygnus style configure. 2571 if test -f $ac_sub_srcdir/configure; then 2572 ac_sub_configure=$ac_sub_srcdir/configure 2573 elif test -f $ac_sub_srcdir/configure.in; then 2574 ac_sub_configure=$ac_configure 2575 else 2576 AC_MSG_WARN(no configuration information is in $ac_config_dir) 2577 ac_sub_configure= 2578 fi 2579 2580 # The recursion is here. 2581 if test -n "$ac_sub_configure"; then 2582 2583 # Make the cache file name correct relative to the subdirectory. 2584 case "$cache_file" in 2585 /*) ac_sub_cache_file=$cache_file ;; 2586 *) # Relative path. 2587 ac_sub_cache_file="$ac_dots$cache_file" ;; 2588 esac 2589ifdef([AC_PROVIDE_AC_PROG_INSTALL], 2590 [ case "$ac_given_INSTALL" in 2591changequote(, )dnl 2592 [/$]*) INSTALL="$ac_given_INSTALL" ;; 2593changequote([, ])dnl 2594 *) INSTALL="$ac_dots$ac_given_INSTALL" ;; 2595 esac 2596])dnl 2597 2598 echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" 2599 # The eval makes quoting arguments work. 2600 if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir 2601 then : 2602 else 2603 AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) 2604 fi 2605 fi 2606 2607 cd $ac_popdir 2608 done 2609fi 2610]) 2611