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