* configure.in: Add AC_FUNC_ALLOCA.
[binutils-gdb.git] / binutils / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.12
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15 --enable-targets alternative target configurations"
16 ac_help="$ac_help
17 --enable-shared build shared BFD library"
18 ac_help="$ac_help
19 --enable-commonbfdlib build shared BFD/opcodes/libiberty library"
20
21 # Initialize some variables set by options.
22 # The variables have the same names as the options, with
23 # dashes changed to underlines.
24 build=NONE
25 cache_file=./config.cache
26 exec_prefix=NONE
27 host=NONE
28 no_create=
29 nonopt=NONE
30 no_recursion=
31 prefix=NONE
32 program_prefix=NONE
33 program_suffix=NONE
34 program_transform_name=s,x,x,
35 silent=
36 site=
37 srcdir=
38 target=NONE
39 verbose=
40 x_includes=NONE
41 x_libraries=NONE
42 bindir='${exec_prefix}/bin'
43 sbindir='${exec_prefix}/sbin'
44 libexecdir='${exec_prefix}/libexec'
45 datadir='${prefix}/share'
46 sysconfdir='${prefix}/etc'
47 sharedstatedir='${prefix}/com'
48 localstatedir='${prefix}/var'
49 libdir='${exec_prefix}/lib'
50 includedir='${prefix}/include'
51 oldincludedir='/usr/include'
52 infodir='${prefix}/info'
53 mandir='${prefix}/man'
54
55 # Initialize some other variables.
56 subdirs=
57 MFLAGS= MAKEFLAGS=
58 # Maximum number of lines to put in a shell here document.
59 ac_max_here_lines=12
60
61 ac_prev=
62 for ac_option
63 do
64
65 # If the previous option needs an argument, assign it.
66 if test -n "$ac_prev"; then
67 eval "$ac_prev=\$ac_option"
68 ac_prev=
69 continue
70 fi
71
72 case "$ac_option" in
73 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
74 *) ac_optarg= ;;
75 esac
76
77 # Accept the important Cygnus configure options, so we can diagnose typos.
78
79 case "$ac_option" in
80
81 -bindir | --bindir | --bindi | --bind | --bin | --bi)
82 ac_prev=bindir ;;
83 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
84 bindir="$ac_optarg" ;;
85
86 -build | --build | --buil | --bui | --bu)
87 ac_prev=build ;;
88 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
89 build="$ac_optarg" ;;
90
91 -cache-file | --cache-file | --cache-fil | --cache-fi \
92 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
93 ac_prev=cache_file ;;
94 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
95 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
96 cache_file="$ac_optarg" ;;
97
98 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
99 ac_prev=datadir ;;
100 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
101 | --da=*)
102 datadir="$ac_optarg" ;;
103
104 -disable-* | --disable-*)
105 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
106 # Reject names that are not valid shell variable names.
107 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
108 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
109 fi
110 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
111 eval "enable_${ac_feature}=no" ;;
112
113 -enable-* | --enable-*)
114 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
115 # Reject names that are not valid shell variable names.
116 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
117 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
118 fi
119 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
120 case "$ac_option" in
121 *=*) ;;
122 *) ac_optarg=yes ;;
123 esac
124 eval "enable_${ac_feature}='$ac_optarg'" ;;
125
126 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
127 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
128 | --exec | --exe | --ex)
129 ac_prev=exec_prefix ;;
130 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
131 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
132 | --exec=* | --exe=* | --ex=*)
133 exec_prefix="$ac_optarg" ;;
134
135 -gas | --gas | --ga | --g)
136 # Obsolete; use --with-gas.
137 with_gas=yes ;;
138
139 -help | --help | --hel | --he)
140 # Omit some internal or obsolete options to make the list less imposing.
141 # This message is too long to be a string in the A/UX 3.1 sh.
142 cat << EOF
143 Usage: configure [options] [host]
144 Options: [defaults in brackets after descriptions]
145 Configuration:
146 --cache-file=FILE cache test results in FILE
147 --help print this message
148 --no-create do not create output files
149 --quiet, --silent do not print \`checking...' messages
150 --version print the version of autoconf that created configure
151 Directory and file names:
152 --prefix=PREFIX install architecture-independent files in PREFIX
153 [$ac_default_prefix]
154 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
155 [same as prefix]
156 --bindir=DIR user executables in DIR [EPREFIX/bin]
157 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
158 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
159 --datadir=DIR read-only architecture-independent data in DIR
160 [PREFIX/share]
161 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
162 --sharedstatedir=DIR modifiable architecture-independent data in DIR
163 [PREFIX/com]
164 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
165 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
166 --includedir=DIR C header files in DIR [PREFIX/include]
167 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
168 --infodir=DIR info documentation in DIR [PREFIX/info]
169 --mandir=DIR man documentation in DIR [PREFIX/man]
170 --srcdir=DIR find the sources in DIR [configure dir or ..]
171 --program-prefix=PREFIX prepend PREFIX to installed program names
172 --program-suffix=SUFFIX append SUFFIX to installed program names
173 --program-transform-name=PROGRAM
174 run sed PROGRAM on installed program names
175 EOF
176 cat << EOF
177 Host type:
178 --build=BUILD configure for building on BUILD [BUILD=HOST]
179 --host=HOST configure for HOST [guessed]
180 --target=TARGET configure for TARGET [TARGET=HOST]
181 Features and packages:
182 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
183 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
184 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
185 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
186 --x-includes=DIR X include files are in DIR
187 --x-libraries=DIR X library files are in DIR
188 EOF
189 if test -n "$ac_help"; then
190 echo "--enable and --with options recognized:$ac_help"
191 fi
192 exit 0 ;;
193
194 -host | --host | --hos | --ho)
195 ac_prev=host ;;
196 -host=* | --host=* | --hos=* | --ho=*)
197 host="$ac_optarg" ;;
198
199 -includedir | --includedir | --includedi | --included | --include \
200 | --includ | --inclu | --incl | --inc)
201 ac_prev=includedir ;;
202 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
203 | --includ=* | --inclu=* | --incl=* | --inc=*)
204 includedir="$ac_optarg" ;;
205
206 -infodir | --infodir | --infodi | --infod | --info | --inf)
207 ac_prev=infodir ;;
208 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
209 infodir="$ac_optarg" ;;
210
211 -libdir | --libdir | --libdi | --libd)
212 ac_prev=libdir ;;
213 -libdir=* | --libdir=* | --libdi=* | --libd=*)
214 libdir="$ac_optarg" ;;
215
216 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
217 | --libexe | --libex | --libe)
218 ac_prev=libexecdir ;;
219 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
220 | --libexe=* | --libex=* | --libe=*)
221 libexecdir="$ac_optarg" ;;
222
223 -localstatedir | --localstatedir | --localstatedi | --localstated \
224 | --localstate | --localstat | --localsta | --localst \
225 | --locals | --local | --loca | --loc | --lo)
226 ac_prev=localstatedir ;;
227 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
228 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
229 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
230 localstatedir="$ac_optarg" ;;
231
232 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
233 ac_prev=mandir ;;
234 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
235 mandir="$ac_optarg" ;;
236
237 -nfp | --nfp | --nf)
238 # Obsolete; use --without-fp.
239 with_fp=no ;;
240
241 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
242 | --no-cr | --no-c)
243 no_create=yes ;;
244
245 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
246 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
247 no_recursion=yes ;;
248
249 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
250 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
251 | --oldin | --oldi | --old | --ol | --o)
252 ac_prev=oldincludedir ;;
253 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
254 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
255 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
256 oldincludedir="$ac_optarg" ;;
257
258 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
259 ac_prev=prefix ;;
260 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
261 prefix="$ac_optarg" ;;
262
263 -program-prefix | --program-prefix | --program-prefi | --program-pref \
264 | --program-pre | --program-pr | --program-p)
265 ac_prev=program_prefix ;;
266 -program-prefix=* | --program-prefix=* | --program-prefi=* \
267 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
268 program_prefix="$ac_optarg" ;;
269
270 -program-suffix | --program-suffix | --program-suffi | --program-suff \
271 | --program-suf | --program-su | --program-s)
272 ac_prev=program_suffix ;;
273 -program-suffix=* | --program-suffix=* | --program-suffi=* \
274 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
275 program_suffix="$ac_optarg" ;;
276
277 -program-transform-name | --program-transform-name \
278 | --program-transform-nam | --program-transform-na \
279 | --program-transform-n | --program-transform- \
280 | --program-transform | --program-transfor \
281 | --program-transfo | --program-transf \
282 | --program-trans | --program-tran \
283 | --progr-tra | --program-tr | --program-t)
284 ac_prev=program_transform_name ;;
285 -program-transform-name=* | --program-transform-name=* \
286 | --program-transform-nam=* | --program-transform-na=* \
287 | --program-transform-n=* | --program-transform-=* \
288 | --program-transform=* | --program-transfor=* \
289 | --program-transfo=* | --program-transf=* \
290 | --program-trans=* | --program-tran=* \
291 | --progr-tra=* | --program-tr=* | --program-t=*)
292 program_transform_name="$ac_optarg" ;;
293
294 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
295 | -silent | --silent | --silen | --sile | --sil)
296 silent=yes ;;
297
298 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
299 ac_prev=sbindir ;;
300 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
301 | --sbi=* | --sb=*)
302 sbindir="$ac_optarg" ;;
303
304 -sharedstatedir | --sharedstatedir | --sharedstatedi \
305 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
306 | --sharedst | --shareds | --shared | --share | --shar \
307 | --sha | --sh)
308 ac_prev=sharedstatedir ;;
309 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
310 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
311 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
312 | --sha=* | --sh=*)
313 sharedstatedir="$ac_optarg" ;;
314
315 -site | --site | --sit)
316 ac_prev=site ;;
317 -site=* | --site=* | --sit=*)
318 site="$ac_optarg" ;;
319
320 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
321 ac_prev=srcdir ;;
322 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
323 srcdir="$ac_optarg" ;;
324
325 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
326 | --syscon | --sysco | --sysc | --sys | --sy)
327 ac_prev=sysconfdir ;;
328 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
329 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
330 sysconfdir="$ac_optarg" ;;
331
332 -target | --target | --targe | --targ | --tar | --ta | --t)
333 ac_prev=target ;;
334 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
335 target="$ac_optarg" ;;
336
337 -v | -verbose | --verbose | --verbos | --verbo | --verb)
338 verbose=yes ;;
339
340 -version | --version | --versio | --versi | --vers)
341 echo "configure generated by autoconf version 2.12"
342 exit 0 ;;
343
344 -with-* | --with-*)
345 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
346 # Reject names that are not valid shell variable names.
347 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
348 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
349 fi
350 ac_package=`echo $ac_package| sed 's/-/_/g'`
351 case "$ac_option" in
352 *=*) ;;
353 *) ac_optarg=yes ;;
354 esac
355 eval "with_${ac_package}='$ac_optarg'" ;;
356
357 -without-* | --without-*)
358 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
359 # Reject names that are not valid shell variable names.
360 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
361 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
362 fi
363 ac_package=`echo $ac_package| sed 's/-/_/g'`
364 eval "with_${ac_package}=no" ;;
365
366 --x)
367 # Obsolete; use --with-x.
368 with_x=yes ;;
369
370 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
371 | --x-incl | --x-inc | --x-in | --x-i)
372 ac_prev=x_includes ;;
373 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
374 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
375 x_includes="$ac_optarg" ;;
376
377 -x-libraries | --x-libraries | --x-librarie | --x-librari \
378 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
379 ac_prev=x_libraries ;;
380 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
381 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
382 x_libraries="$ac_optarg" ;;
383
384 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
385 ;;
386
387 *)
388 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
389 echo "configure: warning: $ac_option: invalid host type" 1>&2
390 fi
391 if test "x$nonopt" != xNONE; then
392 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
393 fi
394 nonopt="$ac_option"
395 ;;
396
397 esac
398 done
399
400 if test -n "$ac_prev"; then
401 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
402 fi
403
404 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
405
406 # File descriptor usage:
407 # 0 standard input
408 # 1 file creation
409 # 2 errors and warnings
410 # 3 some systems may open it to /dev/tty
411 # 4 used on the Kubota Titan
412 # 6 checking for... messages and results
413 # 5 compiler messages saved in config.log
414 if test "$silent" = yes; then
415 exec 6>/dev/null
416 else
417 exec 6>&1
418 fi
419 exec 5>./config.log
420
421 echo "\
422 This file contains any messages produced by compilers while
423 running configure, to aid debugging if configure makes a mistake.
424 " 1>&5
425
426 # Strip out --no-create and --no-recursion so they do not pile up.
427 # Also quote any args containing shell metacharacters.
428 ac_configure_args=
429 for ac_arg
430 do
431 case "$ac_arg" in
432 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
433 | --no-cr | --no-c) ;;
434 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
435 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
436 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
437 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
438 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
439 esac
440 done
441
442 # NLS nuisances.
443 # Only set these to C if already set. These must not be set unconditionally
444 # because not all systems understand e.g. LANG=C (notably SCO).
445 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
446 # Non-C LC_CTYPE values break the ctype check.
447 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
448 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
450 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
451
452 # confdefs.h avoids OS command line length limits that DEFS can exceed.
453 rm -rf conftest* confdefs.h
454 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
455 echo > confdefs.h
456
457 # A filename unique to this package, relative to the directory that
458 # configure is in, which we can look for to find out if srcdir is correct.
459 ac_unique_file=ar.c
460
461 # Find the source files, if location was not specified.
462 if test -z "$srcdir"; then
463 ac_srcdir_defaulted=yes
464 # Try the directory containing this script, then its parent.
465 ac_prog=$0
466 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
467 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
468 srcdir=$ac_confdir
469 if test ! -r $srcdir/$ac_unique_file; then
470 srcdir=..
471 fi
472 else
473 ac_srcdir_defaulted=no
474 fi
475 if test ! -r $srcdir/$ac_unique_file; then
476 if test "$ac_srcdir_defaulted" = yes; then
477 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
478 else
479 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
480 fi
481 fi
482 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
483
484 # Prefer explicitly selected file to automatically selected ones.
485 if test -z "$CONFIG_SITE"; then
486 if test "x$prefix" != xNONE; then
487 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
488 else
489 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
490 fi
491 fi
492 for ac_site_file in $CONFIG_SITE; do
493 if test -r "$ac_site_file"; then
494 echo "loading site script $ac_site_file"
495 . "$ac_site_file"
496 fi
497 done
498
499 if test -r "$cache_file"; then
500 echo "loading cache $cache_file"
501 . $cache_file
502 else
503 echo "creating cache $cache_file"
504 > $cache_file
505 fi
506
507 ac_ext=c
508 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
509 ac_cpp='$CPP $CPPFLAGS'
510 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
511 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
512 cross_compiling=$ac_cv_prog_cc_cross
513
514 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
515 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
516 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
517 ac_n= ac_c='
518 ' ac_t=' '
519 else
520 ac_n=-n ac_c= ac_t=
521 fi
522 else
523 ac_n= ac_c='\c' ac_t=
524 fi
525
526
527
528 # Check whether --enable-targets or --disable-targets was given.
529 if test "${enable_targets+set}" = set; then
530 enableval="$enable_targets"
531 case "${enableval}" in
532 yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
533 ;;
534 no) enable_targets= ;;
535 *) enable_targets=$enableval ;;
536 esac
537 fi
538 # Check whether --enable-shared or --disable-shared was given.
539 if test "${enable_shared+set}" = set; then
540 enableval="$enable_shared"
541 case "${enableval}" in
542 yes) shared=true shared_bfd=true shared_opcodes=true ;;
543 no) shared=false ;;
544 *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
545 *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
546 *bfd*) shared=true shared_bfd=true ;;
547 *opcodes*) shared=true shared_opcodes=true ;;
548 *) shared=false ;;
549 esac
550 fi
551 # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
552 if test "${enable_commonbfdlib+set}" = set; then
553 enableval="$enable_commonbfdlib"
554 case "${enableval}" in
555 yes) commonbfdlib=true ;;
556 no) commonbfdlib=false ;;
557 *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
558 esac
559 fi
560
561
562
563 ac_aux_dir=
564 for ac_dir in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`; do
565 if test -f $ac_dir/install-sh; then
566 ac_aux_dir=$ac_dir
567 ac_install_sh="$ac_aux_dir/install-sh -c"
568 break
569 elif test -f $ac_dir/install.sh; then
570 ac_aux_dir=$ac_dir
571 ac_install_sh="$ac_aux_dir/install.sh -c"
572 break
573 fi
574 done
575 if test -z "$ac_aux_dir"; then
576 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir/..; pwd` $srcdir/`cd $srcdir/..; pwd`" 1>&2; exit 1; }
577 fi
578 ac_config_guess=$ac_aux_dir/config.guess
579 ac_config_sub=$ac_aux_dir/config.sub
580 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
581
582
583 # Do some error checking and defaulting for the host and target type.
584 # The inputs are:
585 # configure --host=HOST --target=TARGET --build=BUILD NONOPT
586 #
587 # The rules are:
588 # 1. You are not allowed to specify --host, --target, and nonopt at the
589 # same time.
590 # 2. Host defaults to nonopt.
591 # 3. If nonopt is not specified, then host defaults to the current host,
592 # as determined by config.guess.
593 # 4. Target and build default to nonopt.
594 # 5. If nonopt is not specified, then target and build default to host.
595
596 # The aliases save the names the user supplied, while $host etc.
597 # will get canonicalized.
598 case $host---$target---$nonopt in
599 NONE---*---* | *---NONE---* | *---*---NONE) ;;
600 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
601 esac
602
603
604 # Make sure we can run config.sub.
605 if $ac_config_sub sun4 >/dev/null 2>&1; then :
606 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
607 fi
608
609 echo $ac_n "checking host system type""... $ac_c" 1>&6
610 echo "configure:611: checking host system type" >&5
611
612 host_alias=$host
613 case "$host_alias" in
614 NONE)
615 case $nonopt in
616 NONE)
617 if host_alias=`$ac_config_guess`; then :
618 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
619 fi ;;
620 *) host_alias=$nonopt ;;
621 esac ;;
622 esac
623
624 host=`$ac_config_sub $host_alias`
625 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
626 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
627 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
628 echo "$ac_t""$host" 1>&6
629
630 echo $ac_n "checking target system type""... $ac_c" 1>&6
631 echo "configure:632: checking target system type" >&5
632
633 target_alias=$target
634 case "$target_alias" in
635 NONE)
636 case $nonopt in
637 NONE) target_alias=$host_alias ;;
638 *) target_alias=$nonopt ;;
639 esac ;;
640 esac
641
642 target=`$ac_config_sub $target_alias`
643 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
644 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
645 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
646 echo "$ac_t""$target" 1>&6
647
648 echo $ac_n "checking build system type""... $ac_c" 1>&6
649 echo "configure:650: checking build system type" >&5
650
651 build_alias=$build
652 case "$build_alias" in
653 NONE)
654 case $nonopt in
655 NONE) build_alias=$host_alias ;;
656 *) build_alias=$nonopt ;;
657 esac ;;
658 esac
659
660 build=`$ac_config_sub $build_alias`
661 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
662 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
663 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
664 echo "$ac_t""$build" 1>&6
665
666 test "$host_alias" != "$target_alias" &&
667 test "$program_prefix$program_suffix$program_transform_name" = \
668 NONENONEs,x,x, &&
669 program_prefix=${target_alias}-
670
671 if test -z "$target" ; then
672 { echo "configure: error: Unrecognized target system type; please check config.sub." 1>&2; exit 1; }
673 fi
674 if test -z "$host" ; then
675 { echo "configure: error: Unrecognized host system type; please check config.sub." 1>&2; exit 1; }
676 fi
677 if test "$program_transform_name" = s,x,x,; then
678 program_transform_name=
679 else
680 # Double any \ or $. echo might interpret backslashes.
681 cat <<\EOF_SED > conftestsed
682 s,\\,\\\\,g; s,\$,$$,g
683 EOF_SED
684 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
685 rm -f conftestsed
686 fi
687 test "$program_prefix" != NONE &&
688 program_transform_name="s,^,${program_prefix},; $program_transform_name"
689 # Use a double $ so make ignores it.
690 test "$program_suffix" != NONE &&
691 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
692
693 # sed with no file args requires a program.
694 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
695
696
697 # host-specific stuff:
698
699 HDEFINES=
700 HLDFLAGS=
701 HLDENV=
702 RPATH_ENVVAR=LD_LIBRARY_PATH
703
704 # Extract the first word of "gcc", so it can be a program name with args.
705 set dummy gcc; ac_word=$2
706 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
707 echo "configure:708: checking for $ac_word" >&5
708 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
709 echo $ac_n "(cached) $ac_c" 1>&6
710 else
711 if test -n "$CC"; then
712 ac_cv_prog_CC="$CC" # Let the user override the test.
713 else
714 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
715 for ac_dir in $PATH; do
716 test -z "$ac_dir" && ac_dir=.
717 if test -f $ac_dir/$ac_word; then
718 ac_cv_prog_CC="gcc"
719 break
720 fi
721 done
722 IFS="$ac_save_ifs"
723 fi
724 fi
725 CC="$ac_cv_prog_CC"
726 if test -n "$CC"; then
727 echo "$ac_t""$CC" 1>&6
728 else
729 echo "$ac_t""no" 1>&6
730 fi
731
732 if test -z "$CC"; then
733 # Extract the first word of "cc", so it can be a program name with args.
734 set dummy cc; ac_word=$2
735 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
736 echo "configure:737: checking for $ac_word" >&5
737 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
738 echo $ac_n "(cached) $ac_c" 1>&6
739 else
740 if test -n "$CC"; then
741 ac_cv_prog_CC="$CC" # Let the user override the test.
742 else
743 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
744 ac_prog_rejected=no
745 for ac_dir in $PATH; do
746 test -z "$ac_dir" && ac_dir=.
747 if test -f $ac_dir/$ac_word; then
748 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
749 ac_prog_rejected=yes
750 continue
751 fi
752 ac_cv_prog_CC="cc"
753 break
754 fi
755 done
756 IFS="$ac_save_ifs"
757 if test $ac_prog_rejected = yes; then
758 # We found a bogon in the path, so make sure we never use it.
759 set dummy $ac_cv_prog_CC
760 shift
761 if test $# -gt 0; then
762 # We chose a different compiler from the bogus one.
763 # However, it has the same basename, so the bogon will be chosen
764 # first if we set CC to just the basename; use the full file name.
765 shift
766 set dummy "$ac_dir/$ac_word" "$@"
767 shift
768 ac_cv_prog_CC="$@"
769 fi
770 fi
771 fi
772 fi
773 CC="$ac_cv_prog_CC"
774 if test -n "$CC"; then
775 echo "$ac_t""$CC" 1>&6
776 else
777 echo "$ac_t""no" 1>&6
778 fi
779
780 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
781 fi
782
783 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
784 echo "configure:785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
785
786 ac_ext=c
787 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
788 ac_cpp='$CPP $CPPFLAGS'
789 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
790 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
791 cross_compiling=$ac_cv_prog_cc_cross
792
793 cat > conftest.$ac_ext <<EOF
794 #line 795 "configure"
795 #include "confdefs.h"
796 main(){return(0);}
797 EOF
798 if { (eval echo configure:799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
799 ac_cv_prog_cc_works=yes
800 # If we can't run a trivial program, we are probably using a cross compiler.
801 if (./conftest; exit) 2>/dev/null; then
802 ac_cv_prog_cc_cross=no
803 else
804 ac_cv_prog_cc_cross=yes
805 fi
806 else
807 echo "configure: failed program was:" >&5
808 cat conftest.$ac_ext >&5
809 ac_cv_prog_cc_works=no
810 fi
811 rm -fr conftest*
812
813 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
814 if test $ac_cv_prog_cc_works = no; then
815 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
816 fi
817 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
818 echo "configure:819: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
819 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
820 cross_compiling=$ac_cv_prog_cc_cross
821
822 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
823 echo "configure:824: checking whether we are using GNU C" >&5
824 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
825 echo $ac_n "(cached) $ac_c" 1>&6
826 else
827 cat > conftest.c <<EOF
828 #ifdef __GNUC__
829 yes;
830 #endif
831 EOF
832 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
833 ac_cv_prog_gcc=yes
834 else
835 ac_cv_prog_gcc=no
836 fi
837 fi
838
839 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
840
841 if test $ac_cv_prog_gcc = yes; then
842 GCC=yes
843 ac_test_CFLAGS="${CFLAGS+set}"
844 ac_save_CFLAGS="$CFLAGS"
845 CFLAGS=
846 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
847 echo "configure:848: checking whether ${CC-cc} accepts -g" >&5
848 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
849 echo $ac_n "(cached) $ac_c" 1>&6
850 else
851 echo 'void f(){}' > conftest.c
852 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
853 ac_cv_prog_cc_g=yes
854 else
855 ac_cv_prog_cc_g=no
856 fi
857 rm -f conftest*
858
859 fi
860
861 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
862 if test "$ac_test_CFLAGS" = set; then
863 CFLAGS="$ac_save_CFLAGS"
864 elif test $ac_cv_prog_cc_g = yes; then
865 CFLAGS="-g -O2"
866 else
867 CFLAGS="-O2"
868 fi
869 else
870 GCC=
871 test "${CFLAGS+set}" = set || CFLAGS="-g"
872 fi
873
874
875 . ${srcdir}/../bfd/configure.host
876
877
878
879
880
881 AR=${AR-ar}
882
883 # Extract the first word of "ranlib", so it can be a program name with args.
884 set dummy ranlib; ac_word=$2
885 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
886 echo "configure:887: checking for $ac_word" >&5
887 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
888 echo $ac_n "(cached) $ac_c" 1>&6
889 else
890 if test -n "$RANLIB"; then
891 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
892 else
893 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
894 for ac_dir in $PATH; do
895 test -z "$ac_dir" && ac_dir=.
896 if test -f $ac_dir/$ac_word; then
897 ac_cv_prog_RANLIB="ranlib"
898 break
899 fi
900 done
901 IFS="$ac_save_ifs"
902 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
903 fi
904 fi
905 RANLIB="$ac_cv_prog_RANLIB"
906 if test -n "$RANLIB"; then
907 echo "$ac_t""$RANLIB" 1>&6
908 else
909 echo "$ac_t""no" 1>&6
910 fi
911
912 # Find a good install program. We prefer a C program (faster),
913 # so one script is as good as another. But avoid the broken or
914 # incompatible versions:
915 # SysV /etc/install, /usr/sbin/install
916 # SunOS /usr/etc/install
917 # IRIX /sbin/install
918 # AIX /bin/install
919 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
920 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
921 # ./install, which can be erroneously created by make from ./install.sh.
922 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
923 echo "configure:924: checking for a BSD compatible install" >&5
924 if test -z "$INSTALL"; then
925 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
926 echo $ac_n "(cached) $ac_c" 1>&6
927 else
928 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
929 for ac_dir in $PATH; do
930 # Account for people who put trailing slashes in PATH elements.
931 case "$ac_dir/" in
932 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
933 *)
934 # OSF1 and SCO ODT 3.0 have their own names for install.
935 for ac_prog in ginstall installbsd scoinst install; do
936 if test -f $ac_dir/$ac_prog; then
937 if test $ac_prog = install &&
938 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
939 # AIX install. It has an incompatible calling convention.
940 # OSF/1 installbsd also uses dspmsg, but is usable.
941 :
942 else
943 ac_cv_path_install="$ac_dir/$ac_prog -c"
944 break 2
945 fi
946 fi
947 done
948 ;;
949 esac
950 done
951 IFS="$ac_save_IFS"
952
953 fi
954 if test "${ac_cv_path_install+set}" = set; then
955 INSTALL="$ac_cv_path_install"
956 else
957 # As a last resort, use the slow shell script. We don't cache a
958 # path for INSTALL within a source directory, because that will
959 # break other packages using the cache if that directory is
960 # removed, or if the path is relative.
961 INSTALL="$ac_install_sh"
962 fi
963 fi
964 echo "$ac_t""$INSTALL" 1>&6
965
966 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
967 # It thinks the first close brace ends the variable substitution.
968 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
969
970 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
971
972
973 # For most hosts we can use a simple definition to pick up the BFD and
974 # opcodes libraries. However, if we are building shared libraries, we
975 # need to handle some hosts specially.
976 BFDLIB='-L../bfd -lbfd'
977 OPCODES='-L../opcodes -lopcodes'
978
979 case "${host}" in
980 *-*-sunos*)
981 # On SunOS, we must link against the name we are going to install,
982 # not -lbfd, since SunOS does not support SONAME.
983 if test "${shared_bfd}" = "true"; then
984 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
985 fi
986 if test "${shared_opcodes}" = "true"; then
987 OPCODES='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
988 fi
989 ;;
990 alpha*-*-osf*)
991 # On Alpha OSF/1, the native linker searches all the -L
992 # directories for any LIB.so files, and only then searches for any
993 # LIB.a files. That means that if there is an installed
994 # libbfd.so, but this build is not done with --enable-shared, the
995 # link will wind up being against the install libbfd.so rather
996 # than the newly built libbfd. To avoid this, we must explicitly
997 # link against libbfd.a when --enable-shared is not used.
998 if test "${shared_bfd}" != "true"; then
999 BFDLIB='../bfd/libbfd.a'
1000 fi
1001 if test "${shared_opcodes}" != "true"; then
1002 OPCODES='../opcodes/libopcodes.a'
1003 fi
1004 ;;
1005 esac
1006
1007 if test "${commonbfdlib}" = "true"; then
1008 # when a shared libbfd is built with --enable-commonbfdlib,
1009 # all of libopcodes is available in libbfd.so
1010 OPCODES=
1011 fi
1012
1013
1014
1015
1016 # Put a plausible default for CC_FOR_BUILD in Makefile.
1017 if test -z "$CC_FOR_BUILD"; then
1018 if test "x$cross_compiling" = "xno"; then
1019 CC_FOR_BUILD='$(CC)'
1020 else
1021 CC_FOR_BUILD=gcc
1022 fi
1023 fi
1024
1025
1026 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1027 echo "configure:1028: checking how to run the C preprocessor" >&5
1028 # On Suns, sometimes $CPP names a directory.
1029 if test -n "$CPP" && test -d "$CPP"; then
1030 CPP=
1031 fi
1032 if test -z "$CPP"; then
1033 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1034 echo $ac_n "(cached) $ac_c" 1>&6
1035 else
1036 # This must be in double quotes, not single quotes, because CPP may get
1037 # substituted into the Makefile and "${CC-cc}" will confuse make.
1038 CPP="${CC-cc} -E"
1039 # On the NeXT, cc -E runs the code through the compiler's parser,
1040 # not just through cpp.
1041 cat > conftest.$ac_ext <<EOF
1042 #line 1043 "configure"
1043 #include "confdefs.h"
1044 #include <assert.h>
1045 Syntax Error
1046 EOF
1047 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1048 { (eval echo configure:1049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1049 ac_err=`grep -v '^ *+' conftest.out`
1050 if test -z "$ac_err"; then
1051 :
1052 else
1053 echo "$ac_err" >&5
1054 echo "configure: failed program was:" >&5
1055 cat conftest.$ac_ext >&5
1056 rm -rf conftest*
1057 CPP="${CC-cc} -E -traditional-cpp"
1058 cat > conftest.$ac_ext <<EOF
1059 #line 1060 "configure"
1060 #include "confdefs.h"
1061 #include <assert.h>
1062 Syntax Error
1063 EOF
1064 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1065 { (eval echo configure:1066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1066 ac_err=`grep -v '^ *+' conftest.out`
1067 if test -z "$ac_err"; then
1068 :
1069 else
1070 echo "$ac_err" >&5
1071 echo "configure: failed program was:" >&5
1072 cat conftest.$ac_ext >&5
1073 rm -rf conftest*
1074 CPP=/lib/cpp
1075 fi
1076 rm -f conftest*
1077 fi
1078 rm -f conftest*
1079 ac_cv_prog_CPP="$CPP"
1080 fi
1081 CPP="$ac_cv_prog_CPP"
1082 else
1083 ac_cv_prog_CPP="$CPP"
1084 fi
1085 echo "$ac_t""$CPP" 1>&6
1086
1087 for ac_hdr in string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h
1088 do
1089 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1090 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1091 echo "configure:1092: checking for $ac_hdr" >&5
1092 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1093 echo $ac_n "(cached) $ac_c" 1>&6
1094 else
1095 cat > conftest.$ac_ext <<EOF
1096 #line 1097 "configure"
1097 #include "confdefs.h"
1098 #include <$ac_hdr>
1099 EOF
1100 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1101 { (eval echo configure:1102: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1102 ac_err=`grep -v '^ *+' conftest.out`
1103 if test -z "$ac_err"; then
1104 rm -rf conftest*
1105 eval "ac_cv_header_$ac_safe=yes"
1106 else
1107 echo "$ac_err" >&5
1108 echo "configure: failed program was:" >&5
1109 cat conftest.$ac_ext >&5
1110 rm -rf conftest*
1111 eval "ac_cv_header_$ac_safe=no"
1112 fi
1113 rm -f conftest*
1114 fi
1115 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1116 echo "$ac_t""yes" 1>&6
1117 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1118 cat >> confdefs.h <<EOF
1119 #define $ac_tr_hdr 1
1120 EOF
1121
1122 else
1123 echo "$ac_t""no" 1>&6
1124 fi
1125 done
1126
1127 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1128 echo "configure:1129: checking for sys/wait.h that is POSIX.1 compatible" >&5
1129 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1130 echo $ac_n "(cached) $ac_c" 1>&6
1131 else
1132 cat > conftest.$ac_ext <<EOF
1133 #line 1134 "configure"
1134 #include "confdefs.h"
1135 #include <sys/types.h>
1136 #include <sys/wait.h>
1137 #ifndef WEXITSTATUS
1138 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1139 #endif
1140 #ifndef WIFEXITED
1141 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1142 #endif
1143 int main() {
1144 int s;
1145 wait (&s);
1146 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1147 ; return 0; }
1148 EOF
1149 if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1150 rm -rf conftest*
1151 ac_cv_header_sys_wait_h=yes
1152 else
1153 echo "configure: failed program was:" >&5
1154 cat conftest.$ac_ext >&5
1155 rm -rf conftest*
1156 ac_cv_header_sys_wait_h=no
1157 fi
1158 rm -f conftest*
1159 fi
1160
1161 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1162 if test $ac_cv_header_sys_wait_h = yes; then
1163 cat >> confdefs.h <<\EOF
1164 #define HAVE_SYS_WAIT_H 1
1165 EOF
1166
1167 fi
1168
1169 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1170 # for constant arguments. Useless!
1171 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1172 echo "configure:1173: checking for working alloca.h" >&5
1173 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1174 echo $ac_n "(cached) $ac_c" 1>&6
1175 else
1176 cat > conftest.$ac_ext <<EOF
1177 #line 1178 "configure"
1178 #include "confdefs.h"
1179 #include <alloca.h>
1180 int main() {
1181 char *p = alloca(2 * sizeof(int));
1182 ; return 0; }
1183 EOF
1184 if { (eval echo configure:1185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1185 rm -rf conftest*
1186 ac_cv_header_alloca_h=yes
1187 else
1188 echo "configure: failed program was:" >&5
1189 cat conftest.$ac_ext >&5
1190 rm -rf conftest*
1191 ac_cv_header_alloca_h=no
1192 fi
1193 rm -f conftest*
1194 fi
1195
1196 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1197 if test $ac_cv_header_alloca_h = yes; then
1198 cat >> confdefs.h <<\EOF
1199 #define HAVE_ALLOCA_H 1
1200 EOF
1201
1202 fi
1203
1204 echo $ac_n "checking for alloca""... $ac_c" 1>&6
1205 echo "configure:1206: checking for alloca" >&5
1206 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1207 echo $ac_n "(cached) $ac_c" 1>&6
1208 else
1209 cat > conftest.$ac_ext <<EOF
1210 #line 1211 "configure"
1211 #include "confdefs.h"
1212
1213 #ifdef __GNUC__
1214 # define alloca __builtin_alloca
1215 #else
1216 # if HAVE_ALLOCA_H
1217 # include <alloca.h>
1218 # else
1219 # ifdef _AIX
1220 #pragma alloca
1221 # else
1222 # ifndef alloca /* predefined by HP cc +Olibcalls */
1223 char *alloca ();
1224 # endif
1225 # endif
1226 # endif
1227 #endif
1228
1229 int main() {
1230 char *p = (char *) alloca(1);
1231 ; return 0; }
1232 EOF
1233 if { (eval echo configure:1234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1234 rm -rf conftest*
1235 ac_cv_func_alloca_works=yes
1236 else
1237 echo "configure: failed program was:" >&5
1238 cat conftest.$ac_ext >&5
1239 rm -rf conftest*
1240 ac_cv_func_alloca_works=no
1241 fi
1242 rm -f conftest*
1243 fi
1244
1245 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1246 if test $ac_cv_func_alloca_works = yes; then
1247 cat >> confdefs.h <<\EOF
1248 #define HAVE_ALLOCA 1
1249 EOF
1250
1251 fi
1252
1253 if test $ac_cv_func_alloca_works = no; then
1254 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1255 # that cause trouble. Some versions do not even contain alloca or
1256 # contain a buggy version. If you still want to use their alloca,
1257 # use ar to extract alloca.o from them instead of compiling alloca.c.
1258 ALLOCA=alloca.o
1259 cat >> confdefs.h <<\EOF
1260 #define C_ALLOCA 1
1261 EOF
1262
1263
1264 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
1265 echo "configure:1266: checking whether alloca needs Cray hooks" >&5
1266 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1267 echo $ac_n "(cached) $ac_c" 1>&6
1268 else
1269 cat > conftest.$ac_ext <<EOF
1270 #line 1271 "configure"
1271 #include "confdefs.h"
1272 #if defined(CRAY) && ! defined(CRAY2)
1273 webecray
1274 #else
1275 wenotbecray
1276 #endif
1277
1278 EOF
1279 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1280 egrep "webecray" >/dev/null 2>&1; then
1281 rm -rf conftest*
1282 ac_cv_os_cray=yes
1283 else
1284 rm -rf conftest*
1285 ac_cv_os_cray=no
1286 fi
1287 rm -f conftest*
1288
1289 fi
1290
1291 echo "$ac_t""$ac_cv_os_cray" 1>&6
1292 if test $ac_cv_os_cray = yes; then
1293 for ac_func in _getb67 GETB67 getb67; do
1294 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1295 echo "configure:1296: checking for $ac_func" >&5
1296 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1297 echo $ac_n "(cached) $ac_c" 1>&6
1298 else
1299 cat > conftest.$ac_ext <<EOF
1300 #line 1301 "configure"
1301 #include "confdefs.h"
1302 /* System header to define __stub macros and hopefully few prototypes,
1303 which can conflict with char $ac_func(); below. */
1304 #include <assert.h>
1305 /* Override any gcc2 internal prototype to avoid an error. */
1306 /* We use char because int might match the return type of a gcc2
1307 builtin and then its argument prototype would still apply. */
1308 char $ac_func();
1309
1310 int main() {
1311
1312 /* The GNU C library defines this for functions which it implements
1313 to always fail with ENOSYS. Some functions are actually named
1314 something starting with __ and the normal name is an alias. */
1315 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1316 choke me
1317 #else
1318 $ac_func();
1319 #endif
1320
1321 ; return 0; }
1322 EOF
1323 if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1324 rm -rf conftest*
1325 eval "ac_cv_func_$ac_func=yes"
1326 else
1327 echo "configure: failed program was:" >&5
1328 cat conftest.$ac_ext >&5
1329 rm -rf conftest*
1330 eval "ac_cv_func_$ac_func=no"
1331 fi
1332 rm -f conftest*
1333 fi
1334
1335 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1336 echo "$ac_t""yes" 1>&6
1337 cat >> confdefs.h <<EOF
1338 #define CRAY_STACKSEG_END $ac_func
1339 EOF
1340
1341 break
1342 else
1343 echo "$ac_t""no" 1>&6
1344 fi
1345
1346 done
1347 fi
1348
1349 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
1350 echo "configure:1351: checking stack direction for C alloca" >&5
1351 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1352 echo $ac_n "(cached) $ac_c" 1>&6
1353 else
1354 if test "$cross_compiling" = yes; then
1355 ac_cv_c_stack_direction=0
1356 else
1357 cat > conftest.$ac_ext <<EOF
1358 #line 1359 "configure"
1359 #include "confdefs.h"
1360 find_stack_direction ()
1361 {
1362 static char *addr = 0;
1363 auto char dummy;
1364 if (addr == 0)
1365 {
1366 addr = &dummy;
1367 return find_stack_direction ();
1368 }
1369 else
1370 return (&dummy > addr) ? 1 : -1;
1371 }
1372 main ()
1373 {
1374 exit (find_stack_direction() < 0);
1375 }
1376 EOF
1377 if { (eval echo configure:1378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1378 then
1379 ac_cv_c_stack_direction=1
1380 else
1381 echo "configure: failed program was:" >&5
1382 cat conftest.$ac_ext >&5
1383 rm -fr conftest*
1384 ac_cv_c_stack_direction=-1
1385 fi
1386 rm -fr conftest*
1387 fi
1388
1389 fi
1390
1391 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
1392 cat >> confdefs.h <<EOF
1393 #define STACK_DIRECTION $ac_cv_c_stack_direction
1394 EOF
1395
1396 fi
1397
1398 for ac_func in sbrk utimes
1399 do
1400 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1401 echo "configure:1402: checking for $ac_func" >&5
1402 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1403 echo $ac_n "(cached) $ac_c" 1>&6
1404 else
1405 cat > conftest.$ac_ext <<EOF
1406 #line 1407 "configure"
1407 #include "confdefs.h"
1408 /* System header to define __stub macros and hopefully few prototypes,
1409 which can conflict with char $ac_func(); below. */
1410 #include <assert.h>
1411 /* Override any gcc2 internal prototype to avoid an error. */
1412 /* We use char because int might match the return type of a gcc2
1413 builtin and then its argument prototype would still apply. */
1414 char $ac_func();
1415
1416 int main() {
1417
1418 /* The GNU C library defines this for functions which it implements
1419 to always fail with ENOSYS. Some functions are actually named
1420 something starting with __ and the normal name is an alias. */
1421 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1422 choke me
1423 #else
1424 $ac_func();
1425 #endif
1426
1427 ; return 0; }
1428 EOF
1429 if { (eval echo configure:1430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1430 rm -rf conftest*
1431 eval "ac_cv_func_$ac_func=yes"
1432 else
1433 echo "configure: failed program was:" >&5
1434 cat conftest.$ac_ext >&5
1435 rm -rf conftest*
1436 eval "ac_cv_func_$ac_func=no"
1437 fi
1438 rm -f conftest*
1439 fi
1440
1441 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1442 echo "$ac_t""yes" 1>&6
1443 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1444 cat >> confdefs.h <<EOF
1445 #define $ac_tr_func 1
1446 EOF
1447
1448 else
1449 echo "$ac_t""no" 1>&6
1450 fi
1451 done
1452
1453 if test "x$cross_compiling" = "xno"; then
1454 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1455 echo "configure:1456: checking for ANSI C header files" >&5
1456 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1457 echo $ac_n "(cached) $ac_c" 1>&6
1458 else
1459 cat > conftest.$ac_ext <<EOF
1460 #line 1461 "configure"
1461 #include "confdefs.h"
1462 #include <stdlib.h>
1463 #include <stdarg.h>
1464 #include <string.h>
1465 #include <float.h>
1466 EOF
1467 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1468 { (eval echo configure:1469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1469 ac_err=`grep -v '^ *+' conftest.out`
1470 if test -z "$ac_err"; then
1471 rm -rf conftest*
1472 ac_cv_header_stdc=yes
1473 else
1474 echo "$ac_err" >&5
1475 echo "configure: failed program was:" >&5
1476 cat conftest.$ac_ext >&5
1477 rm -rf conftest*
1478 ac_cv_header_stdc=no
1479 fi
1480 rm -f conftest*
1481
1482 if test $ac_cv_header_stdc = yes; then
1483 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1484 cat > conftest.$ac_ext <<EOF
1485 #line 1486 "configure"
1486 #include "confdefs.h"
1487 #include <string.h>
1488 EOF
1489 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1490 egrep "memchr" >/dev/null 2>&1; then
1491 :
1492 else
1493 rm -rf conftest*
1494 ac_cv_header_stdc=no
1495 fi
1496 rm -f conftest*
1497
1498 fi
1499
1500 if test $ac_cv_header_stdc = yes; then
1501 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1502 cat > conftest.$ac_ext <<EOF
1503 #line 1504 "configure"
1504 #include "confdefs.h"
1505 #include <stdlib.h>
1506 EOF
1507 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1508 egrep "free" >/dev/null 2>&1; then
1509 :
1510 else
1511 rm -rf conftest*
1512 ac_cv_header_stdc=no
1513 fi
1514 rm -f conftest*
1515
1516 fi
1517
1518 if test $ac_cv_header_stdc = yes; then
1519 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1520 if test "$cross_compiling" = yes; then
1521 :
1522 else
1523 cat > conftest.$ac_ext <<EOF
1524 #line 1525 "configure"
1525 #include "confdefs.h"
1526 #include <ctype.h>
1527 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1528 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1529 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1530 int main () { int i; for (i = 0; i < 256; i++)
1531 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1532 exit (0); }
1533
1534 EOF
1535 if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1536 then
1537 :
1538 else
1539 echo "configure: failed program was:" >&5
1540 cat conftest.$ac_ext >&5
1541 rm -fr conftest*
1542 ac_cv_header_stdc=no
1543 fi
1544 rm -fr conftest*
1545 fi
1546
1547 fi
1548 fi
1549
1550 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1551 if test $ac_cv_header_stdc = yes; then
1552 cat >> confdefs.h <<\EOF
1553 #define STDC_HEADERS 1
1554 EOF
1555
1556 fi
1557
1558 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1559 echo "configure:1560: checking for pid_t" >&5
1560 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1561 echo $ac_n "(cached) $ac_c" 1>&6
1562 else
1563 cat > conftest.$ac_ext <<EOF
1564 #line 1565 "configure"
1565 #include "confdefs.h"
1566 #include <sys/types.h>
1567 #if STDC_HEADERS
1568 #include <stdlib.h>
1569 #include <stddef.h>
1570 #endif
1571 EOF
1572 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1573 egrep "pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1574 rm -rf conftest*
1575 ac_cv_type_pid_t=yes
1576 else
1577 rm -rf conftest*
1578 ac_cv_type_pid_t=no
1579 fi
1580 rm -f conftest*
1581
1582 fi
1583 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1584 if test $ac_cv_type_pid_t = no; then
1585 cat >> confdefs.h <<\EOF
1586 #define pid_t int
1587 EOF
1588
1589 fi
1590
1591 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
1592 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
1593 echo "configure:1594: checking for vfork.h" >&5
1594 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1595 echo $ac_n "(cached) $ac_c" 1>&6
1596 else
1597 cat > conftest.$ac_ext <<EOF
1598 #line 1599 "configure"
1599 #include "confdefs.h"
1600 #include <vfork.h>
1601 EOF
1602 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1603 { (eval echo configure:1604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1604 ac_err=`grep -v '^ *+' conftest.out`
1605 if test -z "$ac_err"; then
1606 rm -rf conftest*
1607 eval "ac_cv_header_$ac_safe=yes"
1608 else
1609 echo "$ac_err" >&5
1610 echo "configure: failed program was:" >&5
1611 cat conftest.$ac_ext >&5
1612 rm -rf conftest*
1613 eval "ac_cv_header_$ac_safe=no"
1614 fi
1615 rm -f conftest*
1616 fi
1617 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1618 echo "$ac_t""yes" 1>&6
1619 cat >> confdefs.h <<\EOF
1620 #define HAVE_VFORK_H 1
1621 EOF
1622
1623 else
1624 echo "$ac_t""no" 1>&6
1625 fi
1626
1627 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
1628 echo "configure:1629: checking for working vfork" >&5
1629 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
1630 echo $ac_n "(cached) $ac_c" 1>&6
1631 else
1632 if test "$cross_compiling" = yes; then
1633 echo $ac_n "checking for vfork""... $ac_c" 1>&6
1634 echo "configure:1635: checking for vfork" >&5
1635 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
1636 echo $ac_n "(cached) $ac_c" 1>&6
1637 else
1638 cat > conftest.$ac_ext <<EOF
1639 #line 1640 "configure"
1640 #include "confdefs.h"
1641 /* System header to define __stub macros and hopefully few prototypes,
1642 which can conflict with char vfork(); below. */
1643 #include <assert.h>
1644 /* Override any gcc2 internal prototype to avoid an error. */
1645 /* We use char because int might match the return type of a gcc2
1646 builtin and then its argument prototype would still apply. */
1647 char vfork();
1648
1649 int main() {
1650
1651 /* The GNU C library defines this for functions which it implements
1652 to always fail with ENOSYS. Some functions are actually named
1653 something starting with __ and the normal name is an alias. */
1654 #if defined (__stub_vfork) || defined (__stub___vfork)
1655 choke me
1656 #else
1657 vfork();
1658 #endif
1659
1660 ; return 0; }
1661 EOF
1662 if { (eval echo configure:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1663 rm -rf conftest*
1664 eval "ac_cv_func_vfork=yes"
1665 else
1666 echo "configure: failed program was:" >&5
1667 cat conftest.$ac_ext >&5
1668 rm -rf conftest*
1669 eval "ac_cv_func_vfork=no"
1670 fi
1671 rm -f conftest*
1672 fi
1673
1674 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
1675 echo "$ac_t""yes" 1>&6
1676 :
1677 else
1678 echo "$ac_t""no" 1>&6
1679 fi
1680
1681 else
1682 cat > conftest.$ac_ext <<EOF
1683 #line 1684 "configure"
1684 #include "confdefs.h"
1685 /* Thanks to Paul Eggert for this test. */
1686 #include <stdio.h>
1687 #include <sys/types.h>
1688 #include <sys/stat.h>
1689 #ifdef HAVE_UNISTD_H
1690 #include <unistd.h>
1691 #endif
1692 #ifdef HAVE_VFORK_H
1693 #include <vfork.h>
1694 #endif
1695 /* On some sparc systems, changes by the child to local and incoming
1696 argument registers are propagated back to the parent.
1697 The compiler is told about this with #include <vfork.h>,
1698 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
1699 Test for this by using a static variable whose address
1700 is put into a register that is clobbered by the vfork. */
1701 static
1702 #ifdef __cplusplus
1703 sparc_address_test (int arg)
1704 #else
1705 sparc_address_test (arg) int arg;
1706 #endif
1707 {
1708 static pid_t child;
1709 if (!child) {
1710 child = vfork ();
1711 if (child < 0) {
1712 perror ("vfork");
1713 _exit(2);
1714 }
1715 if (!child) {
1716 arg = getpid();
1717 write(-1, "", 0);
1718 _exit (arg);
1719 }
1720 }
1721 }
1722 main() {
1723 pid_t parent = getpid ();
1724 pid_t child;
1725
1726 sparc_address_test ();
1727
1728 child = vfork ();
1729
1730 if (child == 0) {
1731 /* Here is another test for sparc vfork register problems.
1732 This test uses lots of local variables, at least
1733 as many local variables as main has allocated so far
1734 including compiler temporaries. 4 locals are enough for
1735 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
1736 A buggy compiler should reuse the register of parent
1737 for one of the local variables, since it will think that
1738 parent can't possibly be used any more in this routine.
1739 Assigning to the local variable will thus munge parent
1740 in the parent process. */
1741 pid_t
1742 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
1743 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
1744 /* Convince the compiler that p..p7 are live; otherwise, it might
1745 use the same hardware register for all 8 local variables. */
1746 if (p != p1 || p != p2 || p != p3 || p != p4
1747 || p != p5 || p != p6 || p != p7)
1748 _exit(1);
1749
1750 /* On some systems (e.g. IRIX 3.3),
1751 vfork doesn't separate parent from child file descriptors.
1752 If the child closes a descriptor before it execs or exits,
1753 this munges the parent's descriptor as well.
1754 Test for this by closing stdout in the child. */
1755 _exit(close(fileno(stdout)) != 0);
1756 } else {
1757 int status;
1758 struct stat st;
1759
1760 while (wait(&status) != child)
1761 ;
1762 exit(
1763 /* Was there some problem with vforking? */
1764 child < 0
1765
1766 /* Did the child fail? (This shouldn't happen.) */
1767 || status
1768
1769 /* Did the vfork/compiler bug occur? */
1770 || parent != getpid()
1771
1772 /* Did the file descriptor bug occur? */
1773 || fstat(fileno(stdout), &st) != 0
1774 );
1775 }
1776 }
1777 EOF
1778 if { (eval echo configure:1779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
1779 then
1780 ac_cv_func_vfork_works=yes
1781 else
1782 echo "configure: failed program was:" >&5
1783 cat conftest.$ac_ext >&5
1784 rm -fr conftest*
1785 ac_cv_func_vfork_works=no
1786 fi
1787 rm -fr conftest*
1788 fi
1789
1790 fi
1791
1792 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
1793 if test $ac_cv_func_vfork_works = no; then
1794 cat >> confdefs.h <<\EOF
1795 #define vfork fork
1796 EOF
1797
1798 fi
1799
1800 else
1801 echo $ac_n "checking for vfork""... $ac_c" 1>&6
1802 echo "configure:1803: checking for vfork" >&5
1803 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
1804 echo $ac_n "(cached) $ac_c" 1>&6
1805 else
1806 cat > conftest.$ac_ext <<EOF
1807 #line 1808 "configure"
1808 #include "confdefs.h"
1809 /* System header to define __stub macros and hopefully few prototypes,
1810 which can conflict with char vfork(); below. */
1811 #include <assert.h>
1812 /* Override any gcc2 internal prototype to avoid an error. */
1813 /* We use char because int might match the return type of a gcc2
1814 builtin and then its argument prototype would still apply. */
1815 char vfork();
1816
1817 int main() {
1818
1819 /* The GNU C library defines this for functions which it implements
1820 to always fail with ENOSYS. Some functions are actually named
1821 something starting with __ and the normal name is an alias. */
1822 #if defined (__stub_vfork) || defined (__stub___vfork)
1823 choke me
1824 #else
1825 vfork();
1826 #endif
1827
1828 ; return 0; }
1829 EOF
1830 if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1831 rm -rf conftest*
1832 eval "ac_cv_func_vfork=yes"
1833 else
1834 echo "configure: failed program was:" >&5
1835 cat conftest.$ac_ext >&5
1836 rm -rf conftest*
1837 eval "ac_cv_func_vfork=no"
1838 fi
1839 rm -f conftest*
1840 fi
1841
1842 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
1843 echo "$ac_t""yes" 1>&6
1844 :
1845 else
1846 echo "$ac_t""no" 1>&6
1847 cat >> confdefs.h <<\EOF
1848 #define vfork fork
1849 EOF
1850
1851 fi
1852
1853 fi
1854
1855 echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6
1856 echo "configure:1857: checking for time_t in time.h" >&5
1857 if eval "test \"`echo '$''{'bu_cv_decl_time_t_time_h'+set}'`\" = set"; then
1858 echo $ac_n "(cached) $ac_c" 1>&6
1859 else
1860 cat > conftest.$ac_ext <<EOF
1861 #line 1862 "configure"
1862 #include "confdefs.h"
1863 #include <time.h>
1864 int main() {
1865 time_t i;
1866 ; return 0; }
1867 EOF
1868 if { (eval echo configure:1869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1869 rm -rf conftest*
1870 bu_cv_decl_time_t_time_h=yes
1871 else
1872 echo "configure: failed program was:" >&5
1873 cat conftest.$ac_ext >&5
1874 rm -rf conftest*
1875 bu_cv_decl_time_t_time_h=no
1876 fi
1877 rm -f conftest*
1878 fi
1879
1880 echo "$ac_t""$bu_cv_decl_time_t_time_h" 1>&6
1881 if test $bu_cv_decl_time_t_time_h = yes; then
1882 cat >> confdefs.h <<\EOF
1883 #define HAVE_TIME_T_IN_TIME_H 1
1884 EOF
1885
1886 fi
1887
1888 echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6
1889 echo "configure:1890: checking for time_t in sys/types.h" >&5
1890 if eval "test \"`echo '$''{'bu_cv_decl_time_t_types_h'+set}'`\" = set"; then
1891 echo $ac_n "(cached) $ac_c" 1>&6
1892 else
1893 cat > conftest.$ac_ext <<EOF
1894 #line 1895 "configure"
1895 #include "confdefs.h"
1896 #include <sys/types.h>
1897 int main() {
1898 time_t i;
1899 ; return 0; }
1900 EOF
1901 if { (eval echo configure:1902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1902 rm -rf conftest*
1903 bu_cv_decl_time_t_types_h=yes
1904 else
1905 echo "configure: failed program was:" >&5
1906 cat conftest.$ac_ext >&5
1907 rm -rf conftest*
1908 bu_cv_decl_time_t_types_h=no
1909 fi
1910 rm -f conftest*
1911 fi
1912
1913 echo "$ac_t""$bu_cv_decl_time_t_types_h" 1>&6
1914 if test $bu_cv_decl_time_t_types_h = yes; then
1915 cat >> confdefs.h <<\EOF
1916 #define HAVE_TIME_T_IN_TYPES_H 1
1917 EOF
1918
1919 fi
1920
1921 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
1922 # by default.
1923 echo $ac_n "checking for utime.h""... $ac_c" 1>&6
1924 echo "configure:1925: checking for utime.h" >&5
1925 if eval "test \"`echo '$''{'bu_cv_header_utime_h'+set}'`\" = set"; then
1926 echo $ac_n "(cached) $ac_c" 1>&6
1927 else
1928 cat > conftest.$ac_ext <<EOF
1929 #line 1930 "configure"
1930 #include "confdefs.h"
1931 #include <sys/types.h>
1932 #ifdef HAVE_TIME_H
1933 #include <time.h>
1934 #endif
1935 #include <utime.h>
1936 int main() {
1937 struct utimbuf s;
1938 ; return 0; }
1939 EOF
1940 if { (eval echo configure:1941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1941 rm -rf conftest*
1942 bu_cv_header_utime_h=yes
1943 else
1944 echo "configure: failed program was:" >&5
1945 cat conftest.$ac_ext >&5
1946 rm -rf conftest*
1947 bu_cv_header_utime_h=no
1948 fi
1949 rm -f conftest*
1950 fi
1951
1952 echo "$ac_t""$bu_cv_header_utime_h" 1>&6
1953 if test $bu_cv_header_utime_h = yes; then
1954 cat >> confdefs.h <<\EOF
1955 #define HAVE_GOOD_UTIME_H 1
1956 EOF
1957
1958 fi
1959
1960 echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6
1961 echo "configure:1962: checking whether fprintf must be declared" >&5
1962 if eval "test \"`echo '$''{'bfd_cv_decl_needed_fprintf'+set}'`\" = set"; then
1963 echo $ac_n "(cached) $ac_c" 1>&6
1964 else
1965 cat > conftest.$ac_ext <<EOF
1966 #line 1967 "configure"
1967 #include "confdefs.h"
1968
1969 #include <stdio.h>
1970 #ifdef HAVE_STRING_H
1971 #include <string.h>
1972 #else
1973 #ifdef HAVE_STRINGS_H
1974 #include <strings.h>
1975 #endif
1976 #endif
1977 #ifdef HAVE_STDLIB_H
1978 #include <stdlib.h>
1979 #endif
1980 #ifdef HAVE_UNISTD_H
1981 #include <unistd.h>
1982 #endif
1983 int main() {
1984 char *(*pfn) = (char *(*)) fprintf
1985 ; return 0; }
1986 EOF
1987 if { (eval echo configure:1988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1988 rm -rf conftest*
1989 bfd_cv_decl_needed_fprintf=no
1990 else
1991 echo "configure: failed program was:" >&5
1992 cat conftest.$ac_ext >&5
1993 rm -rf conftest*
1994 bfd_cv_decl_needed_fprintf=yes
1995 fi
1996 rm -f conftest*
1997 fi
1998
1999 echo "$ac_t""$bfd_cv_decl_needed_fprintf" 1>&6
2000 if test $bfd_cv_decl_needed_fprintf = yes; then
2001 bfd_tr_decl=NEED_DECLARATION_`echo fprintf | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2002 cat >> confdefs.h <<EOF
2003 #define $bfd_tr_decl 1
2004 EOF
2005
2006 fi
2007
2008 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
2009 echo "configure:2010: checking whether strstr must be declared" >&5
2010 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
2011 echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013 cat > conftest.$ac_ext <<EOF
2014 #line 2015 "configure"
2015 #include "confdefs.h"
2016
2017 #include <stdio.h>
2018 #ifdef HAVE_STRING_H
2019 #include <string.h>
2020 #else
2021 #ifdef HAVE_STRINGS_H
2022 #include <strings.h>
2023 #endif
2024 #endif
2025 #ifdef HAVE_STDLIB_H
2026 #include <stdlib.h>
2027 #endif
2028 #ifdef HAVE_UNISTD_H
2029 #include <unistd.h>
2030 #endif
2031 int main() {
2032 char *(*pfn) = (char *(*)) strstr
2033 ; return 0; }
2034 EOF
2035 if { (eval echo configure:2036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2036 rm -rf conftest*
2037 bfd_cv_decl_needed_strstr=no
2038 else
2039 echo "configure: failed program was:" >&5
2040 cat conftest.$ac_ext >&5
2041 rm -rf conftest*
2042 bfd_cv_decl_needed_strstr=yes
2043 fi
2044 rm -f conftest*
2045 fi
2046
2047 echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
2048 if test $bfd_cv_decl_needed_strstr = yes; then
2049 bfd_tr_decl=NEED_DECLARATION_`echo strstr | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2050 cat >> confdefs.h <<EOF
2051 #define $bfd_tr_decl 1
2052 EOF
2053
2054 fi
2055
2056 echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6
2057 echo "configure:2058: checking whether sbrk must be declared" >&5
2058 if eval "test \"`echo '$''{'bfd_cv_decl_needed_sbrk'+set}'`\" = set"; then
2059 echo $ac_n "(cached) $ac_c" 1>&6
2060 else
2061 cat > conftest.$ac_ext <<EOF
2062 #line 2063 "configure"
2063 #include "confdefs.h"
2064
2065 #include <stdio.h>
2066 #ifdef HAVE_STRING_H
2067 #include <string.h>
2068 #else
2069 #ifdef HAVE_STRINGS_H
2070 #include <strings.h>
2071 #endif
2072 #endif
2073 #ifdef HAVE_STDLIB_H
2074 #include <stdlib.h>
2075 #endif
2076 #ifdef HAVE_UNISTD_H
2077 #include <unistd.h>
2078 #endif
2079 int main() {
2080 char *(*pfn) = (char *(*)) sbrk
2081 ; return 0; }
2082 EOF
2083 if { (eval echo configure:2084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2084 rm -rf conftest*
2085 bfd_cv_decl_needed_sbrk=no
2086 else
2087 echo "configure: failed program was:" >&5
2088 cat conftest.$ac_ext >&5
2089 rm -rf conftest*
2090 bfd_cv_decl_needed_sbrk=yes
2091 fi
2092 rm -f conftest*
2093 fi
2094
2095 echo "$ac_t""$bfd_cv_decl_needed_sbrk" 1>&6
2096 if test $bfd_cv_decl_needed_sbrk = yes; then
2097 bfd_tr_decl=NEED_DECLARATION_`echo sbrk | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2098 cat >> confdefs.h <<EOF
2099 #define $bfd_tr_decl 1
2100 EOF
2101
2102 fi
2103
2104 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
2105 echo "configure:2106: checking whether getenv must be declared" >&5
2106 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
2107 echo $ac_n "(cached) $ac_c" 1>&6
2108 else
2109 cat > conftest.$ac_ext <<EOF
2110 #line 2111 "configure"
2111 #include "confdefs.h"
2112
2113 #include <stdio.h>
2114 #ifdef HAVE_STRING_H
2115 #include <string.h>
2116 #else
2117 #ifdef HAVE_STRINGS_H
2118 #include <strings.h>
2119 #endif
2120 #endif
2121 #ifdef HAVE_STDLIB_H
2122 #include <stdlib.h>
2123 #endif
2124 #ifdef HAVE_UNISTD_H
2125 #include <unistd.h>
2126 #endif
2127 int main() {
2128 char *(*pfn) = (char *(*)) getenv
2129 ; return 0; }
2130 EOF
2131 if { (eval echo configure:2132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2132 rm -rf conftest*
2133 bfd_cv_decl_needed_getenv=no
2134 else
2135 echo "configure: failed program was:" >&5
2136 cat conftest.$ac_ext >&5
2137 rm -rf conftest*
2138 bfd_cv_decl_needed_getenv=yes
2139 fi
2140 rm -f conftest*
2141 fi
2142
2143 echo "$ac_t""$bfd_cv_decl_needed_getenv" 1>&6
2144 if test $bfd_cv_decl_needed_getenv = yes; then
2145 bfd_tr_decl=NEED_DECLARATION_`echo getenv | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2146 cat >> confdefs.h <<EOF
2147 #define $bfd_tr_decl 1
2148 EOF
2149
2150 fi
2151
2152
2153
2154 case "${host}" in
2155 i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32 | *-*-windows)
2156 cat >> confdefs.h <<\EOF
2157 #define USE_BINARY_FOPEN 1
2158 EOF
2159 ;;
2160 esac
2161
2162 # target-specific stuff:
2163
2164 # Canonicalize the secondary target names.
2165 if test -n "$enable_targets"; then
2166 for targ in `echo $enable_targets | sed 's/,/ /g'`
2167 do
2168 result=`$ac_config_sub $targ 2>/dev/null`
2169 if test -n "$result"; then
2170 canon_targets="$canon_targets $result"
2171 else
2172 # Allow targets that config.sub doesn't recognize, like "all".
2173 canon_targets="$canon_targets $targ"
2174 fi
2175 done
2176 fi
2177
2178 all_targets=false
2179 BUILD_NLMCONV=
2180 NLMCONV_DEFS=
2181 BUILD_SRCONV=
2182 BUILD_DLLTOOL=
2183 DLLTOOL_DEFS=
2184
2185 for targ in $target $canon_targets
2186 do
2187 if test "x$targ" = "xall"; then
2188 all_targets=true
2189 BUILD_NLMCONV='$(NLMCONV_PROG)'
2190 BUILD_SRCONV='$(SRCONV_PROG)'
2191 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
2192 else
2193 case $targ in
2194 i[3456]86*-*-netware*)
2195 BUILD_NLMCONV='$(NLMCONV_PROG)'
2196 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
2197 ;;
2198 alpha*-*-netware*)
2199 BUILD_NLMCONV='$(NLMCONV_PROG)'
2200 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
2201 ;;
2202 powerpc*-*-netware*)
2203 BUILD_NLMCONV='$(NLMCONV_PROG)'
2204 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
2205 ;;
2206 sparc*-*-netware*)
2207 BUILD_NLMCONV='$(NLMCONV_PROG)'
2208 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
2209 ;;
2210 esac
2211 case $targ in
2212 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
2213 esac
2214 case $targ in
2215 arm-*pe*)
2216 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2217 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
2218 ;;
2219 i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
2220 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2221 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
2222 ;;
2223 powerpc*-*-*pe* | powerpc*-*-cygwin32)
2224 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
2225 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
2226 ;;
2227 esac
2228 fi
2229 done
2230
2231
2232
2233
2234
2235
2236
2237 targ=$target
2238 . $srcdir/../bfd/config.bfd
2239 if test "x$targ_underscore" = "xyes"; then
2240 UNDERSCORE=1
2241 else
2242 UNDERSCORE=0
2243 fi
2244
2245
2246 trap '' 1 2 15
2247 cat > confcache <<\EOF
2248 # This file is a shell script that caches the results of configure
2249 # tests run on this system so they can be shared between configure
2250 # scripts and configure runs. It is not useful on other systems.
2251 # If it contains results you don't want to keep, you may remove or edit it.
2252 #
2253 # By default, configure uses ./config.cache as the cache file,
2254 # creating it if it does not exist already. You can give configure
2255 # the --cache-file=FILE option to use a different cache file; that is
2256 # what configure does when it calls configure scripts in
2257 # subdirectories, so they share the cache.
2258 # Giving --cache-file=/dev/null disables caching, for debugging configure.
2259 # config.status only pays attention to the cache file if you give it the
2260 # --recheck option to rerun configure.
2261 #
2262 EOF
2263 # The following way of writing the cache mishandles newlines in values,
2264 # but we know of no workaround that is simple, portable, and efficient.
2265 # So, don't put newlines in cache variables' values.
2266 # Ultrix sh set writes to stderr and can't be redirected directly,
2267 # and sets the high bit in the cache file unless we assign to the vars.
2268 (set) 2>&1 |
2269 case `(ac_space=' '; set) 2>&1` in
2270 *ac_space=\ *)
2271 # `set' does not quote correctly, so add quotes (double-quote substitution
2272 # turns \\\\ into \\, and sed turns \\ into \).
2273 sed -n \
2274 -e "s/'/'\\\\''/g" \
2275 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2276 ;;
2277 *)
2278 # `set' quotes correctly as required by POSIX, so do not add quotes.
2279 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2280 ;;
2281 esac >> confcache
2282 if cmp -s $cache_file confcache; then
2283 :
2284 else
2285 if test -w $cache_file; then
2286 echo "updating cache $cache_file"
2287 cat confcache > $cache_file
2288 else
2289 echo "not updating unwritable cache $cache_file"
2290 fi
2291 fi
2292 rm -f confcache
2293
2294 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
2295
2296 test "x$prefix" = xNONE && prefix=$ac_default_prefix
2297 # Let make expand exec_prefix.
2298 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2299
2300 # Any assignment to VPATH causes Sun make to only execute
2301 # the first set of double-colon rules, so remove it if not needed.
2302 # If there is a colon in the path, we need to keep it.
2303 if test "x$srcdir" = x.; then
2304 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2305 fi
2306
2307 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2308
2309 DEFS=-DHAVE_CONFIG_H
2310
2311 # Without the "./", some shells look in PATH for config.status.
2312 : ${CONFIG_STATUS=./config.status}
2313
2314 echo creating $CONFIG_STATUS
2315 rm -f $CONFIG_STATUS
2316 cat > $CONFIG_STATUS <<EOF
2317 #! /bin/sh
2318 # Generated automatically by configure.
2319 # Run this file to recreate the current configuration.
2320 # This directory was configured as follows,
2321 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2322 #
2323 # $0 $ac_configure_args
2324 #
2325 # Compiler output produced by configure, useful for debugging
2326 # configure, is in ./config.log if it exists.
2327
2328 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
2329 for ac_option
2330 do
2331 case "\$ac_option" in
2332 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
2333 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2334 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
2335 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
2336 echo "$CONFIG_STATUS generated by autoconf version 2.12"
2337 exit 0 ;;
2338 -help | --help | --hel | --he | --h)
2339 echo "\$ac_cs_usage"; exit 0 ;;
2340 *) echo "\$ac_cs_usage"; exit 1 ;;
2341 esac
2342 done
2343
2344 ac_given_srcdir=$srcdir
2345 ac_given_INSTALL="$INSTALL"
2346
2347 trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
2348 EOF
2349 cat >> $CONFIG_STATUS <<EOF
2350
2351 # Protect against being on the right side of a sed subst in config.status.
2352 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2353 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
2354 $ac_vpsub
2355 $extrasub
2356 s%@CFLAGS@%$CFLAGS%g
2357 s%@CPPFLAGS@%$CPPFLAGS%g
2358 s%@CXXFLAGS@%$CXXFLAGS%g
2359 s%@DEFS@%$DEFS%g
2360 s%@LDFLAGS@%$LDFLAGS%g
2361 s%@LIBS@%$LIBS%g
2362 s%@exec_prefix@%$exec_prefix%g
2363 s%@prefix@%$prefix%g
2364 s%@program_transform_name@%$program_transform_name%g
2365 s%@bindir@%$bindir%g
2366 s%@sbindir@%$sbindir%g
2367 s%@libexecdir@%$libexecdir%g
2368 s%@datadir@%$datadir%g
2369 s%@sysconfdir@%$sysconfdir%g
2370 s%@sharedstatedir@%$sharedstatedir%g
2371 s%@localstatedir@%$localstatedir%g
2372 s%@libdir@%$libdir%g
2373 s%@includedir@%$includedir%g
2374 s%@oldincludedir@%$oldincludedir%g
2375 s%@infodir@%$infodir%g
2376 s%@mandir@%$mandir%g
2377 s%@host@%$host%g
2378 s%@host_alias@%$host_alias%g
2379 s%@host_cpu@%$host_cpu%g
2380 s%@host_vendor@%$host_vendor%g
2381 s%@host_os@%$host_os%g
2382 s%@target@%$target%g
2383 s%@target_alias@%$target_alias%g
2384 s%@target_cpu@%$target_cpu%g
2385 s%@target_vendor@%$target_vendor%g
2386 s%@target_os@%$target_os%g
2387 s%@build@%$build%g
2388 s%@build_alias@%$build_alias%g
2389 s%@build_cpu@%$build_cpu%g
2390 s%@build_vendor@%$build_vendor%g
2391 s%@build_os@%$build_os%g
2392 s%@CC@%$CC%g
2393 s%@HDEFINES@%$HDEFINES%g
2394 s%@HLDFLAGS@%$HLDFLAGS%g
2395 s%@HLDENV@%$HLDENV%g
2396 s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
2397 s%@AR@%$AR%g
2398 s%@RANLIB@%$RANLIB%g
2399 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2400 s%@INSTALL_DATA@%$INSTALL_DATA%g
2401 s%@BFDLIB@%$BFDLIB%g
2402 s%@OPCODES@%$OPCODES%g
2403 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
2404 s%@CPP@%$CPP%g
2405 s%@ALLOCA@%$ALLOCA%g
2406 s%@NLMCONV_DEFS@%$NLMCONV_DEFS%g
2407 s%@BUILD_NLMCONV@%$BUILD_NLMCONV%g
2408 s%@BUILD_SRCONV@%$BUILD_SRCONV%g
2409 s%@BUILD_DLLTOOL@%$BUILD_DLLTOOL%g
2410 s%@DLLTOOL_DEFS@%$DLLTOOL_DEFS%g
2411 s%@UNDERSCORE@%$UNDERSCORE%g
2412
2413 CEOF
2414 EOF
2415
2416 cat >> $CONFIG_STATUS <<\EOF
2417
2418 # Split the substitutions into bite-sized pieces for seds with
2419 # small command number limits, like on Digital OSF/1 and HP-UX.
2420 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2421 ac_file=1 # Number of current file.
2422 ac_beg=1 # First line for current file.
2423 ac_end=$ac_max_sed_cmds # Line after last line for current file.
2424 ac_more_lines=:
2425 ac_sed_cmds=""
2426 while $ac_more_lines; do
2427 if test $ac_beg -gt 1; then
2428 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2429 else
2430 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2431 fi
2432 if test ! -s conftest.s$ac_file; then
2433 ac_more_lines=false
2434 rm -f conftest.s$ac_file
2435 else
2436 if test -z "$ac_sed_cmds"; then
2437 ac_sed_cmds="sed -f conftest.s$ac_file"
2438 else
2439 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2440 fi
2441 ac_file=`expr $ac_file + 1`
2442 ac_beg=$ac_end
2443 ac_end=`expr $ac_end + $ac_max_sed_cmds`
2444 fi
2445 done
2446 if test -z "$ac_sed_cmds"; then
2447 ac_sed_cmds=cat
2448 fi
2449 EOF
2450
2451 cat >> $CONFIG_STATUS <<EOF
2452
2453 CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
2454 EOF
2455 cat >> $CONFIG_STATUS <<\EOF
2456 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
2457 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2458 case "$ac_file" in
2459 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2460 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2461 *) ac_file_in="${ac_file}.in" ;;
2462 esac
2463
2464 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
2465
2466 # Remove last slash and all that follows it. Not all systems have dirname.
2467 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2468 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2469 # The file is in a subdirectory.
2470 test ! -d "$ac_dir" && mkdir "$ac_dir"
2471 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
2472 # A "../" for each directory in $ac_dir_suffix.
2473 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2474 else
2475 ac_dir_suffix= ac_dots=
2476 fi
2477
2478 case "$ac_given_srcdir" in
2479 .) srcdir=.
2480 if test -z "$ac_dots"; then top_srcdir=.
2481 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2482 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2483 *) # Relative path.
2484 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2485 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2486 esac
2487
2488 case "$ac_given_INSTALL" in
2489 [/$]*) INSTALL="$ac_given_INSTALL" ;;
2490 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
2491 esac
2492
2493 echo creating "$ac_file"
2494 rm -f "$ac_file"
2495 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
2496 case "$ac_file" in
2497 *Makefile*) ac_comsub="1i\\
2498 # $configure_input" ;;
2499 *) ac_comsub= ;;
2500 esac
2501
2502 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2503 sed -e "$ac_comsub
2504 s%@configure_input@%$configure_input%g
2505 s%@srcdir@%$srcdir%g
2506 s%@top_srcdir@%$top_srcdir%g
2507 s%@INSTALL@%$INSTALL%g
2508 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
2509 fi; done
2510 rm -f conftest.s*
2511
2512 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2513 # NAME is the cpp macro being defined and VALUE is the value it is being given.
2514 #
2515 # ac_d sets the value in "#define NAME VALUE" lines.
2516 ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2517 ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2518 ac_dC='\3'
2519 ac_dD='%g'
2520 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2521 ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2522 ac_uB='\([ ]\)%\1#\2define\3'
2523 ac_uC=' '
2524 ac_uD='\4%g'
2525 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2526 ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2527 ac_eB='$%\1#\2define\3'
2528 ac_eC=' '
2529 ac_eD='%g'
2530
2531 if test "${CONFIG_HEADERS+set}" != set; then
2532 EOF
2533 cat >> $CONFIG_STATUS <<EOF
2534 CONFIG_HEADERS="config.h:config.in"
2535 EOF
2536 cat >> $CONFIG_STATUS <<\EOF
2537 fi
2538 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
2539 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
2540 case "$ac_file" in
2541 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
2542 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2543 *) ac_file_in="${ac_file}.in" ;;
2544 esac
2545
2546 echo creating $ac_file
2547
2548 rm -f conftest.frag conftest.in conftest.out
2549 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2550 cat $ac_file_inputs > conftest.in
2551
2552 EOF
2553
2554 # Transform confdefs.h into a sed script conftest.vals that substitutes
2555 # the proper values into config.h.in to produce config.h. And first:
2556 # Protect against being on the right side of a sed subst in config.status.
2557 # Protect against being in an unquoted here document in config.status.
2558 rm -f conftest.vals
2559 cat > conftest.hdr <<\EOF
2560 s/[\\&%]/\\&/g
2561 s%[\\$`]%\\&%g
2562 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
2563 s%ac_d%ac_u%gp
2564 s%ac_u%ac_e%gp
2565 EOF
2566 sed -n -f conftest.hdr confdefs.h > conftest.vals
2567 rm -f conftest.hdr
2568
2569 # This sed command replaces #undef with comments. This is necessary, for
2570 # example, in the case of _POSIX_SOURCE, which is predefined and required
2571 # on some systems where configure will not decide to define it.
2572 cat >> conftest.vals <<\EOF
2573 s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2574 EOF
2575
2576 # Break up conftest.vals because some shells have a limit on
2577 # the size of here documents, and old seds have small limits too.
2578
2579 rm -f conftest.tail
2580 while :
2581 do
2582 ac_lines=`grep -c . conftest.vals`
2583 # grep -c gives empty output for an empty file on some AIX systems.
2584 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2585 # Write a limited-size here document to conftest.frag.
2586 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2587 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
2588 echo 'CEOF
2589 sed -f conftest.frag conftest.in > conftest.out
2590 rm -f conftest.in
2591 mv conftest.out conftest.in
2592 ' >> $CONFIG_STATUS
2593 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2594 rm -f conftest.vals
2595 mv conftest.tail conftest.vals
2596 done
2597 rm -f conftest.vals
2598
2599 cat >> $CONFIG_STATUS <<\EOF
2600 rm -f conftest.frag conftest.h
2601 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2602 cat conftest.in >> conftest.h
2603 rm -f conftest.in
2604 if cmp -s $ac_file conftest.h 2>/dev/null; then
2605 echo "$ac_file is unchanged"
2606 rm -f conftest.h
2607 else
2608 # Remove last slash and all that follows it. Not all systems have dirname.
2609 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2610 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2611 # The file is in a subdirectory.
2612 test ! -d "$ac_dir" && mkdir "$ac_dir"
2613 fi
2614 rm -f $ac_file
2615 mv conftest.h $ac_file
2616 fi
2617 fi; done
2618
2619 EOF
2620 cat >> $CONFIG_STATUS <<EOF
2621
2622 EOF
2623 cat >> $CONFIG_STATUS <<\EOF
2624 case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac
2625 exit 0
2626 EOF
2627 chmod +x $CONFIG_STATUS
2628 rm -fr confdefs* $ac_clean_files
2629 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
2630