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