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