source: trunk/essentials/sys-devel/autoconf-2.13/acgeneral.m4@ 3238

Last change on this file since 3238 was 3159, checked in by bird, 18 years ago

Applied OS/2 patches.

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