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