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

Last change on this file since 3368 was 3159, checked in by bird, 19 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)