merge from gcc
[deliverable/binutils-gdb.git] / libiberty / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13
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 --with-target-subdir=SUBDIR Configuring in a subdirectory for target"
16 ac_help="$ac_help
17 --with-build-subdir=SUBDIR Configuring in a subdirectory for build"
18 ac_help="$ac_help
19 --with-cross-host=HOST Configuring with a cross compiler"
20 ac_help="$ac_help
21 --with-newlib Configuring with newlib"
22 ac_help="$ac_help
23 --enable-maintainer-mode
24 enable make rules and dependencies not useful
25 (and sometimes confusing) to the casual installer"
26 ac_help="$ac_help
27 --enable-install-libiberty Install headers for end users"
28
29 # Initialize some variables set by options.
30 # The variables have the same names as the options, with
31 # dashes changed to underlines.
32 build=NONE
33 cache_file=./config.cache
34 exec_prefix=NONE
35 host=NONE
36 no_create=
37 nonopt=NONE
38 no_recursion=
39 prefix=NONE
40 program_prefix=NONE
41 program_suffix=NONE
42 program_transform_name=s,x,x,
43 silent=
44 site=
45 srcdir=
46 target=NONE
47 verbose=
48 x_includes=NONE
49 x_libraries=NONE
50 bindir='${exec_prefix}/bin'
51 sbindir='${exec_prefix}/sbin'
52 libexecdir='${exec_prefix}/libexec'
53 datadir='${prefix}/share'
54 sysconfdir='${prefix}/etc'
55 sharedstatedir='${prefix}/com'
56 localstatedir='${prefix}/var'
57 libdir='${exec_prefix}/lib'
58 includedir='${prefix}/include'
59 oldincludedir='/usr/include'
60 infodir='${prefix}/info'
61 mandir='${prefix}/man'
62
63 # Initialize some other variables.
64 subdirs=
65 MFLAGS= MAKEFLAGS=
66 SHELL=${CONFIG_SHELL-/bin/sh}
67 # Maximum number of lines to put in a shell here document.
68 ac_max_here_lines=12
69
70 ac_prev=
71 for ac_option
72 do
73
74 # If the previous option needs an argument, assign it.
75 if test -n "$ac_prev"; then
76 eval "$ac_prev=\$ac_option"
77 ac_prev=
78 continue
79 fi
80
81 case "$ac_option" in
82 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
83 *) ac_optarg= ;;
84 esac
85
86 # Accept the important Cygnus configure options, so we can diagnose typos.
87
88 case "$ac_option" in
89
90 -bindir | --bindir | --bindi | --bind | --bin | --bi)
91 ac_prev=bindir ;;
92 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
93 bindir="$ac_optarg" ;;
94
95 -build | --build | --buil | --bui | --bu)
96 ac_prev=build ;;
97 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
98 build="$ac_optarg" ;;
99
100 -cache-file | --cache-file | --cache-fil | --cache-fi \
101 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
102 ac_prev=cache_file ;;
103 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
104 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
105 cache_file="$ac_optarg" ;;
106
107 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
108 ac_prev=datadir ;;
109 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
110 | --da=*)
111 datadir="$ac_optarg" ;;
112
113 -disable-* | --disable-*)
114 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
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 eval "enable_${ac_feature}=no" ;;
121
122 -enable-* | --enable-*)
123 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
124 # Reject names that are not valid shell variable names.
125 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
126 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
127 fi
128 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
129 case "$ac_option" in
130 *=*) ;;
131 *) ac_optarg=yes ;;
132 esac
133 eval "enable_${ac_feature}='$ac_optarg'" ;;
134
135 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
136 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
137 | --exec | --exe | --ex)
138 ac_prev=exec_prefix ;;
139 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
140 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
141 | --exec=* | --exe=* | --ex=*)
142 exec_prefix="$ac_optarg" ;;
143
144 -gas | --gas | --ga | --g)
145 # Obsolete; use --with-gas.
146 with_gas=yes ;;
147
148 -help | --help | --hel | --he)
149 # Omit some internal or obsolete options to make the list less imposing.
150 # This message is too long to be a string in the A/UX 3.1 sh.
151 cat << EOF
152 Usage: configure [options] [host]
153 Options: [defaults in brackets after descriptions]
154 Configuration:
155 --cache-file=FILE cache test results in FILE
156 --help print this message
157 --no-create do not create output files
158 --quiet, --silent do not print \`checking...' messages
159 --version print the version of autoconf that created configure
160 Directory and file names:
161 --prefix=PREFIX install architecture-independent files in PREFIX
162 [$ac_default_prefix]
163 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
164 [same as prefix]
165 --bindir=DIR user executables in DIR [EPREFIX/bin]
166 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
167 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
168 --datadir=DIR read-only architecture-independent data in DIR
169 [PREFIX/share]
170 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
171 --sharedstatedir=DIR modifiable architecture-independent data in DIR
172 [PREFIX/com]
173 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
174 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
175 --includedir=DIR C header files in DIR [PREFIX/include]
176 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
177 --infodir=DIR info documentation in DIR [PREFIX/info]
178 --mandir=DIR man documentation in DIR [PREFIX/man]
179 --srcdir=DIR find the sources in DIR [configure dir or ..]
180 --program-prefix=PREFIX prepend PREFIX to installed program names
181 --program-suffix=SUFFIX append SUFFIX to installed program names
182 --program-transform-name=PROGRAM
183 run sed PROGRAM on installed program names
184 EOF
185 cat << EOF
186 Host type:
187 --build=BUILD configure for building on BUILD [BUILD=HOST]
188 --host=HOST configure for HOST [guessed]
189 --target=TARGET configure for TARGET [TARGET=HOST]
190 Features and packages:
191 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
192 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
193 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
194 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
195 --x-includes=DIR X include files are in DIR
196 --x-libraries=DIR X library files are in DIR
197 EOF
198 if test -n "$ac_help"; then
199 echo "--enable and --with options recognized:$ac_help"
200 fi
201 exit 0 ;;
202
203 -host | --host | --hos | --ho)
204 ac_prev=host ;;
205 -host=* | --host=* | --hos=* | --ho=*)
206 host="$ac_optarg" ;;
207
208 -includedir | --includedir | --includedi | --included | --include \
209 | --includ | --inclu | --incl | --inc)
210 ac_prev=includedir ;;
211 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
212 | --includ=* | --inclu=* | --incl=* | --inc=*)
213 includedir="$ac_optarg" ;;
214
215 -infodir | --infodir | --infodi | --infod | --info | --inf)
216 ac_prev=infodir ;;
217 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
218 infodir="$ac_optarg" ;;
219
220 -libdir | --libdir | --libdi | --libd)
221 ac_prev=libdir ;;
222 -libdir=* | --libdir=* | --libdi=* | --libd=*)
223 libdir="$ac_optarg" ;;
224
225 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
226 | --libexe | --libex | --libe)
227 ac_prev=libexecdir ;;
228 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
229 | --libexe=* | --libex=* | --libe=*)
230 libexecdir="$ac_optarg" ;;
231
232 -localstatedir | --localstatedir | --localstatedi | --localstated \
233 | --localstate | --localstat | --localsta | --localst \
234 | --locals | --local | --loca | --loc | --lo)
235 ac_prev=localstatedir ;;
236 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
237 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
238 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
239 localstatedir="$ac_optarg" ;;
240
241 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
242 ac_prev=mandir ;;
243 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
244 mandir="$ac_optarg" ;;
245
246 -nfp | --nfp | --nf)
247 # Obsolete; use --without-fp.
248 with_fp=no ;;
249
250 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
251 | --no-cr | --no-c)
252 no_create=yes ;;
253
254 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
255 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
256 no_recursion=yes ;;
257
258 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
259 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
260 | --oldin | --oldi | --old | --ol | --o)
261 ac_prev=oldincludedir ;;
262 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
263 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
264 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
265 oldincludedir="$ac_optarg" ;;
266
267 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
268 ac_prev=prefix ;;
269 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
270 prefix="$ac_optarg" ;;
271
272 -program-prefix | --program-prefix | --program-prefi | --program-pref \
273 | --program-pre | --program-pr | --program-p)
274 ac_prev=program_prefix ;;
275 -program-prefix=* | --program-prefix=* | --program-prefi=* \
276 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
277 program_prefix="$ac_optarg" ;;
278
279 -program-suffix | --program-suffix | --program-suffi | --program-suff \
280 | --program-suf | --program-su | --program-s)
281 ac_prev=program_suffix ;;
282 -program-suffix=* | --program-suffix=* | --program-suffi=* \
283 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
284 program_suffix="$ac_optarg" ;;
285
286 -program-transform-name | --program-transform-name \
287 | --program-transform-nam | --program-transform-na \
288 | --program-transform-n | --program-transform- \
289 | --program-transform | --program-transfor \
290 | --program-transfo | --program-transf \
291 | --program-trans | --program-tran \
292 | --progr-tra | --program-tr | --program-t)
293 ac_prev=program_transform_name ;;
294 -program-transform-name=* | --program-transform-name=* \
295 | --program-transform-nam=* | --program-transform-na=* \
296 | --program-transform-n=* | --program-transform-=* \
297 | --program-transform=* | --program-transfor=* \
298 | --program-transfo=* | --program-transf=* \
299 | --program-trans=* | --program-tran=* \
300 | --progr-tra=* | --program-tr=* | --program-t=*)
301 program_transform_name="$ac_optarg" ;;
302
303 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
304 | -silent | --silent | --silen | --sile | --sil)
305 silent=yes ;;
306
307 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
308 ac_prev=sbindir ;;
309 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
310 | --sbi=* | --sb=*)
311 sbindir="$ac_optarg" ;;
312
313 -sharedstatedir | --sharedstatedir | --sharedstatedi \
314 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
315 | --sharedst | --shareds | --shared | --share | --shar \
316 | --sha | --sh)
317 ac_prev=sharedstatedir ;;
318 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
319 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
320 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
321 | --sha=* | --sh=*)
322 sharedstatedir="$ac_optarg" ;;
323
324 -site | --site | --sit)
325 ac_prev=site ;;
326 -site=* | --site=* | --sit=*)
327 site="$ac_optarg" ;;
328
329 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
330 ac_prev=srcdir ;;
331 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
332 srcdir="$ac_optarg" ;;
333
334 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
335 | --syscon | --sysco | --sysc | --sys | --sy)
336 ac_prev=sysconfdir ;;
337 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
338 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
339 sysconfdir="$ac_optarg" ;;
340
341 -target | --target | --targe | --targ | --tar | --ta | --t)
342 ac_prev=target ;;
343 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
344 target="$ac_optarg" ;;
345
346 -v | -verbose | --verbose | --verbos | --verbo | --verb)
347 verbose=yes ;;
348
349 -version | --version | --versio | --versi | --vers)
350 echo "configure generated by autoconf version 2.13"
351 exit 0 ;;
352
353 -with-* | --with-*)
354 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
355 # Reject names that are not valid shell variable names.
356 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
357 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
358 fi
359 ac_package=`echo $ac_package| sed 's/-/_/g'`
360 case "$ac_option" in
361 *=*) ;;
362 *) ac_optarg=yes ;;
363 esac
364 eval "with_${ac_package}='$ac_optarg'" ;;
365
366 -without-* | --without-*)
367 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
368 # Reject names that are not valid shell variable names.
369 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
370 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
371 fi
372 ac_package=`echo $ac_package| sed 's/-/_/g'`
373 eval "with_${ac_package}=no" ;;
374
375 --x)
376 # Obsolete; use --with-x.
377 with_x=yes ;;
378
379 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
380 | --x-incl | --x-inc | --x-in | --x-i)
381 ac_prev=x_includes ;;
382 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
383 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
384 x_includes="$ac_optarg" ;;
385
386 -x-libraries | --x-libraries | --x-librarie | --x-librari \
387 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
388 ac_prev=x_libraries ;;
389 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
390 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
391 x_libraries="$ac_optarg" ;;
392
393 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
394 ;;
395
396 *)
397 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
398 echo "configure: warning: $ac_option: invalid host type" 1>&2
399 fi
400 if test "x$nonopt" != xNONE; then
401 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
402 fi
403 nonopt="$ac_option"
404 ;;
405
406 esac
407 done
408
409 if test -n "$ac_prev"; then
410 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
411 fi
412
413 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
414
415 # File descriptor usage:
416 # 0 standard input
417 # 1 file creation
418 # 2 errors and warnings
419 # 3 some systems may open it to /dev/tty
420 # 4 used on the Kubota Titan
421 # 6 checking for... messages and results
422 # 5 compiler messages saved in config.log
423 if test "$silent" = yes; then
424 exec 6>/dev/null
425 else
426 exec 6>&1
427 fi
428 exec 5>./config.log
429
430 echo "\
431 This file contains any messages produced by compilers while
432 running configure, to aid debugging if configure makes a mistake.
433 " 1>&5
434
435 # Strip out --no-create and --no-recursion so they do not pile up.
436 # Also quote any args containing shell metacharacters.
437 ac_configure_args=
438 for ac_arg
439 do
440 case "$ac_arg" in
441 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
442 | --no-cr | --no-c) ;;
443 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
444 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
445 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
446 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
447 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
448 esac
449 done
450
451 # NLS nuisances.
452 # Only set these to C if already set. These must not be set unconditionally
453 # because not all systems understand e.g. LANG=C (notably SCO).
454 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
455 # Non-C LC_CTYPE values break the ctype check.
456 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
457 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
458 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
459 if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
460
461 # confdefs.h avoids OS command line length limits that DEFS can exceed.
462 rm -rf conftest* confdefs.h
463 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
464 echo > confdefs.h
465
466 # A filename unique to this package, relative to the directory that
467 # configure is in, which we can look for to find out if srcdir is correct.
468 ac_unique_file=xmalloc.c
469
470 # Find the source files, if location was not specified.
471 if test -z "$srcdir"; then
472 ac_srcdir_defaulted=yes
473 # Try the directory containing this script, then its parent.
474 ac_prog=$0
475 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
476 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
477 srcdir=$ac_confdir
478 if test ! -r $srcdir/$ac_unique_file; then
479 srcdir=..
480 fi
481 else
482 ac_srcdir_defaulted=no
483 fi
484 if test ! -r $srcdir/$ac_unique_file; then
485 if test "$ac_srcdir_defaulted" = yes; then
486 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
487 else
488 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
489 fi
490 fi
491 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
492
493 # Prefer explicitly selected file to automatically selected ones.
494 if test -z "$CONFIG_SITE"; then
495 if test "x$prefix" != xNONE; then
496 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
497 else
498 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
499 fi
500 fi
501 for ac_site_file in $CONFIG_SITE; do
502 if test -r "$ac_site_file"; then
503 echo "loading site script $ac_site_file"
504 . "$ac_site_file"
505 fi
506 done
507
508 if test -r "$cache_file"; then
509 echo "loading cache $cache_file"
510 . $cache_file
511 else
512 echo "creating cache $cache_file"
513 > $cache_file
514 fi
515
516 ac_ext=c
517 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
518 ac_cpp='$CPP $CPPFLAGS'
519 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
520 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
521 cross_compiling=$ac_cv_prog_cc_cross
522
523 ac_exeext=
524 ac_objext=o
525 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
526 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
527 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
528 ac_n= ac_c='
529 ' ac_t=' '
530 else
531 ac_n=-n ac_c= ac_t=
532 fi
533 else
534 ac_n= ac_c='\c' ac_t=
535 fi
536
537
538
539 # This works around the fact that libtool configuration may change LD
540 # for this particular configuration, but some shells, instead of
541 # keeping the changes in LD private, export them just because LD is
542 # exported. We don't use libtool yet, but some day we might, so...
543 ORIGINAL_LD_FOR_MULTILIBS=$LD
544
545 # Check whether --with-target-subdir or --without-target-subdir was given.
546 if test "${with_target_subdir+set}" = set; then
547 withval="$with_target_subdir"
548 :
549 fi
550
551 # Check whether --with-build-subdir or --without-build-subdir was given.
552 if test "${with_build_subdir+set}" = set; then
553 withval="$with_build_subdir"
554 :
555 fi
556
557 # Check whether --with-cross-host or --without-cross-host was given.
558 if test "${with_cross_host+set}" = set; then
559 withval="$with_cross_host"
560 :
561 fi
562
563 # Check whether --with-newlib or --without-newlib was given.
564 if test "${with_newlib+set}" = set; then
565 withval="$with_newlib"
566 :
567 fi
568
569
570 if test "${srcdir}" = "."; then
571 if test -n "${with_build_subdir}"; then
572 libiberty_topdir="${srcdir}/../.."
573 with_target_subdir=
574 elif test -z "${with_target_subdir}"; then
575 libiberty_topdir="${srcdir}/.."
576 else
577 if test "${with_target_subdir}" != "."; then
578 libiberty_topdir="${srcdir}/${with_multisrctop}../.."
579 else
580 libiberty_topdir="${srcdir}/${with_multisrctop}.."
581 fi
582 fi
583 else
584 libiberty_topdir="${srcdir}/.."
585 fi
586
587 ac_aux_dir=
588 for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do
589 if test -f $ac_dir/install-sh; then
590 ac_aux_dir=$ac_dir
591 ac_install_sh="$ac_aux_dir/install-sh -c"
592 break
593 elif test -f $ac_dir/install.sh; then
594 ac_aux_dir=$ac_dir
595 ac_install_sh="$ac_aux_dir/install.sh -c"
596 break
597 fi
598 done
599 if test -z "$ac_aux_dir"; then
600 { echo "configure: error: can not find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; }
601 fi
602 ac_config_guess=$ac_aux_dir/config.guess
603 ac_config_sub=$ac_aux_dir/config.sub
604 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
605
606
607
608 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
609 echo "configure:610: checking whether to enable maintainer-specific portions of Makefiles" >&5
610 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
611 if test "${enable_maintainer_mode+set}" = set; then
612 enableval="$enable_maintainer_mode"
613 maintainer_mode=$enableval
614 else
615 maintainer_mode=no
616 fi
617
618
619 echo "$ac_t""$maintainer_mode" 1>&6
620
621 if test "$maintainer_mode" = "yes"; then
622 MAINT=''
623 NOTMAINT='#'
624 else
625 MAINT='#'
626 NOTMAINT=''
627 fi
628
629 # Do we have a single-tree copy of texinfo? Even if we do, we can't
630 # rely on it - libiberty is built before texinfo.
631 # Extract the first word of "makeinfo", so it can be a program name with args.
632 set dummy makeinfo; ac_word=$2
633 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
634 echo "configure:635: checking for $ac_word" >&5
635 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
636 echo $ac_n "(cached) $ac_c" 1>&6
637 else
638 if test -n "$MAKEINFO"; then
639 ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
640 else
641 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
642 ac_dummy="$PATH"
643 for ac_dir in $ac_dummy; do
644 test -z "$ac_dir" && ac_dir=.
645 if test -f $ac_dir/$ac_word; then
646 ac_cv_prog_MAKEINFO="makeinfo"
647 break
648 fi
649 done
650 IFS="$ac_save_ifs"
651 fi
652 fi
653 MAKEINFO="$ac_cv_prog_MAKEINFO"
654 if test -n "$MAKEINFO"; then
655 echo "$ac_t""$MAKEINFO" 1>&6
656 else
657 echo "$ac_t""no" 1>&6
658 fi
659
660 if test "x$MAKEINFO" = "x"; then
661 MAKEINFO="@echo makeinfo missing; true"
662 BUILD_INFO=
663 else
664 BUILD_INFO=info
665 case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
666 x*\ [1-3].* )
667 MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
668 BUILD_INFO=
669 echo "configure: warning:
670 *** Makeinfo is too old. Info documentation will not be built." 1>&2
671 ;;
672 esac
673 fi
674
675
676
677 # Extract the first word of "perl", so it can be a program name with args.
678 set dummy perl; ac_word=$2
679 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
680 echo "configure:681: checking for $ac_word" >&5
681 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
682 echo $ac_n "(cached) $ac_c" 1>&6
683 else
684 if test -n "$PERL"; then
685 ac_cv_prog_PERL="$PERL" # Let the user override the test.
686 else
687 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
688 ac_dummy="$PATH"
689 for ac_dir in $ac_dummy; do
690 test -z "$ac_dir" && ac_dir=.
691 if test -f $ac_dir/$ac_word; then
692 ac_cv_prog_PERL="perl"
693 break
694 fi
695 done
696 IFS="$ac_save_ifs"
697 fi
698 fi
699 PERL="$ac_cv_prog_PERL"
700 if test -n "$PERL"; then
701 echo "$ac_t""$PERL" 1>&6
702 else
703 echo "$ac_t""no" 1>&6
704 fi
705
706 if test x"$PERL" = x""; then
707 HAVE_PERL='#'
708 else
709 HAVE_PERL=''
710 fi
711
712
713
714 # Make sure we can run config.sub.
715 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
716 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
717 fi
718
719 echo $ac_n "checking host system type""... $ac_c" 1>&6
720 echo "configure:721: checking host system type" >&5
721
722 host_alias=$host
723 case "$host_alias" in
724 NONE)
725 case $nonopt in
726 NONE)
727 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
728 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
729 fi ;;
730 *) host_alias=$nonopt ;;
731 esac ;;
732 esac
733
734 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
735 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
736 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
737 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
738 echo "$ac_t""$host" 1>&6
739
740
741
742 echo $ac_n "checking build system type""... $ac_c" 1>&6
743 echo "configure:744: checking build system type" >&5
744
745 build_alias=$build
746 case "$build_alias" in
747 NONE)
748 case $nonopt in
749 NONE) build_alias=$host_alias ;;
750 *) build_alias=$nonopt ;;
751 esac ;;
752 esac
753
754 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
755 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
756 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
757 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
758 echo "$ac_t""$build" 1>&6
759
760 if test $host != $build; then
761 ac_tool_prefix=${host_alias}-
762 else
763 ac_tool_prefix=
764 fi
765
766 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
767 set dummy ${ac_tool_prefix}ar; ac_word=$2
768 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
769 echo "configure:770: checking for $ac_word" >&5
770 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
771 echo $ac_n "(cached) $ac_c" 1>&6
772 else
773 if test -n "$AR"; then
774 ac_cv_prog_AR="$AR" # Let the user override the test.
775 else
776 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
777 ac_dummy="$PATH"
778 for ac_dir in $ac_dummy; do
779 test -z "$ac_dir" && ac_dir=.
780 if test -f $ac_dir/$ac_word; then
781 ac_cv_prog_AR="${ac_tool_prefix}ar"
782 break
783 fi
784 done
785 IFS="$ac_save_ifs"
786 test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
787 fi
788 fi
789 AR="$ac_cv_prog_AR"
790 if test -n "$AR"; then
791 echo "$ac_t""$AR" 1>&6
792 else
793 echo "$ac_t""no" 1>&6
794 fi
795
796
797
798 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
799 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
800 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
801 echo "configure:802: checking for $ac_word" >&5
802 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
803 echo $ac_n "(cached) $ac_c" 1>&6
804 else
805 if test -n "$RANLIB"; then
806 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
807 else
808 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
809 ac_dummy="$PATH"
810 for ac_dir in $ac_dummy; do
811 test -z "$ac_dir" && ac_dir=.
812 if test -f $ac_dir/$ac_word; then
813 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
814 break
815 fi
816 done
817 IFS="$ac_save_ifs"
818 fi
819 fi
820 RANLIB="$ac_cv_prog_RANLIB"
821 if test -n "$RANLIB"; then
822 echo "$ac_t""$RANLIB" 1>&6
823 else
824 echo "$ac_t""no" 1>&6
825 fi
826
827
828 if test -z "$ac_cv_prog_RANLIB"; then
829 if test -n "$ac_tool_prefix"; then
830 # Extract the first word of "ranlib", so it can be a program name with args.
831 set dummy ranlib; ac_word=$2
832 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
833 echo "configure:834: checking for $ac_word" >&5
834 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
835 echo $ac_n "(cached) $ac_c" 1>&6
836 else
837 if test -n "$RANLIB"; then
838 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
839 else
840 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
841 ac_dummy="$PATH"
842 for ac_dir in $ac_dummy; do
843 test -z "$ac_dir" && ac_dir=.
844 if test -f $ac_dir/$ac_word; then
845 ac_cv_prog_RANLIB="ranlib"
846 break
847 fi
848 done
849 IFS="$ac_save_ifs"
850 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
851 fi
852 fi
853 RANLIB="$ac_cv_prog_RANLIB"
854 if test -n "$RANLIB"; then
855 echo "$ac_t""$RANLIB" 1>&6
856 else
857 echo "$ac_t""no" 1>&6
858 fi
859
860 else
861 RANLIB=":"
862 fi
863 fi
864
865
866
867 # Extract the first word of "gcc", so it can be a program name with args.
868 set dummy gcc; ac_word=$2
869 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
870 echo "configure:871: checking for $ac_word" >&5
871 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
872 echo $ac_n "(cached) $ac_c" 1>&6
873 else
874 if test -n "$CC"; then
875 ac_cv_prog_CC="$CC" # Let the user override the test.
876 else
877 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
878 ac_dummy="$PATH"
879 for ac_dir in $ac_dummy; do
880 test -z "$ac_dir" && ac_dir=.
881 if test -f $ac_dir/$ac_word; then
882 ac_cv_prog_CC="gcc"
883 break
884 fi
885 done
886 IFS="$ac_save_ifs"
887 fi
888 fi
889 CC="$ac_cv_prog_CC"
890 if test -n "$CC"; then
891 echo "$ac_t""$CC" 1>&6
892 else
893 echo "$ac_t""no" 1>&6
894 fi
895
896 if test -z "$CC"; then
897 # Extract the first word of "cc", so it can be a program name with args.
898 set dummy cc; ac_word=$2
899 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
900 echo "configure:901: checking for $ac_word" >&5
901 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
902 echo $ac_n "(cached) $ac_c" 1>&6
903 else
904 if test -n "$CC"; then
905 ac_cv_prog_CC="$CC" # Let the user override the test.
906 else
907 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
908 ac_prog_rejected=no
909 ac_dummy="$PATH"
910 for ac_dir in $ac_dummy; do
911 test -z "$ac_dir" && ac_dir=.
912 if test -f $ac_dir/$ac_word; then
913 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
914 ac_prog_rejected=yes
915 continue
916 fi
917 ac_cv_prog_CC="cc"
918 break
919 fi
920 done
921 IFS="$ac_save_ifs"
922 if test $ac_prog_rejected = yes; then
923 # We found a bogon in the path, so make sure we never use it.
924 set dummy $ac_cv_prog_CC
925 shift
926 if test $# -gt 0; then
927 # We chose a different compiler from the bogus one.
928 # However, it has the same basename, so the bogon will be chosen
929 # first if we set CC to just the basename; use the full file name.
930 shift
931 set dummy "$ac_dir/$ac_word" "$@"
932 shift
933 ac_cv_prog_CC="$@"
934 fi
935 fi
936 fi
937 fi
938 CC="$ac_cv_prog_CC"
939 if test -n "$CC"; then
940 echo "$ac_t""$CC" 1>&6
941 else
942 echo "$ac_t""no" 1>&6
943 fi
944
945 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
946 fi
947
948 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
949 echo "configure:950: checking whether we are using GNU C" >&5
950 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
951 echo $ac_n "(cached) $ac_c" 1>&6
952 else
953 cat > conftest.c <<EOF
954 #ifdef __GNUC__
955 yes;
956 #endif
957 EOF
958 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
959 ac_cv_prog_gcc=yes
960 else
961 ac_cv_prog_gcc=no
962 fi
963 fi
964
965 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
966
967 if test $ac_cv_prog_gcc = yes; then
968 GCC=yes
969 ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
970 ac_test_CFLAGS="${CFLAGS+set}"
971 ac_save_CFLAGS="$CFLAGS"
972 CFLAGS=
973 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
974 echo "configure:975: checking whether ${CC-cc} accepts -g" >&5
975 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
976 echo $ac_n "(cached) $ac_c" 1>&6
977 else
978 echo 'void f(){}' > conftest.c
979 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
980 ac_cv_prog_cc_g=yes
981 else
982 ac_cv_prog_cc_g=no
983 fi
984 rm -f conftest*
985
986 fi
987
988 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
989 if test "$ac_test_CFLAGS" = set; then
990 CFLAGS="$ac_save_CFLAGS"
991 elif test $ac_cv_prog_cc_g = yes; then
992 CFLAGS="-g -O2"
993 else
994 CFLAGS="-O2"
995 fi
996 else
997 GCC=
998 ac_libiberty_warn_cflags=
999 test "${CFLAGS+set}" = set || CFLAGS="-g"
1000 fi
1001
1002
1003
1004 if test "x$CC" != xcc; then
1005 echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
1006 echo "configure:1007: checking whether $CC and cc understand -c and -o together" >&5
1007 else
1008 echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
1009 echo "configure:1010: checking whether cc understands -c and -o together" >&5
1010 fi
1011 set dummy $CC; ac_cc="`echo $2 |
1012 sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
1013 if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
1014 echo $ac_n "(cached) $ac_c" 1>&6
1015 else
1016 echo 'foo(){}' > conftest.c
1017 # Make sure it works both with $CC and with simple cc.
1018 # We do the test twice because some compilers refuse to overwrite an
1019 # existing .o file with -o, though they will create one.
1020 ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
1021 if { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1022 test -f conftest.o && { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
1023 then
1024 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
1025 if test "x$CC" != xcc; then
1026 # Test first that cc exists at all.
1027 if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
1028 ac_try='cc -c conftest.c -o conftest.o 1>&5'
1029 if { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1030 test -f conftest.o && { (eval echo configure:1031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
1031 then
1032 # cc works too.
1033 :
1034 else
1035 # cc exists but doesn't like -o.
1036 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1037 fi
1038 fi
1039 fi
1040 else
1041 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1042 fi
1043 rm -f conftest*
1044
1045 fi
1046 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
1047 echo "$ac_t""yes" 1>&6
1048 else
1049 echo "$ac_t""no" 1>&6
1050 cat >> confdefs.h <<\EOF
1051 #define NO_MINUS_C_MINUS_O 1
1052 EOF
1053
1054 fi
1055
1056 # autoconf is lame and doesn't give us any substitution variable for this.
1057 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
1058 NO_MINUS_C_MINUS_O=yes
1059 else
1060 OUTPUT_OPTION='-o $@'
1061 fi
1062
1063
1064
1065 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1066 echo "configure:1067: checking for POSIXized ISC" >&5
1067 if test -d /etc/conf/kconfig.d &&
1068 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1069 then
1070 echo "$ac_t""yes" 1>&6
1071 ISC=yes # If later tests want to check for ISC.
1072 cat >> confdefs.h <<\EOF
1073 #define _POSIX_SOURCE 1
1074 EOF
1075
1076 if test "$GCC" = yes; then
1077 CC="$CC -posix"
1078 else
1079 CC="$CC -Xp"
1080 fi
1081 else
1082 echo "$ac_t""no" 1>&6
1083 ISC=
1084 fi
1085
1086 echo $ac_n "checking for working const""... $ac_c" 1>&6
1087 echo "configure:1088: checking for working const" >&5
1088 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1089 echo $ac_n "(cached) $ac_c" 1>&6
1090 else
1091 cat > conftest.$ac_ext <<EOF
1092 #line 1093 "configure"
1093 #include "confdefs.h"
1094
1095 int main() {
1096
1097 /* Ultrix mips cc rejects this. */
1098 typedef int charset[2]; const charset x;
1099 /* SunOS 4.1.1 cc rejects this. */
1100 char const *const *ccp;
1101 char **p;
1102 /* NEC SVR4.0.2 mips cc rejects this. */
1103 struct point {int x, y;};
1104 static struct point const zero = {0,0};
1105 /* AIX XL C 1.02.0.0 rejects this.
1106 It does not let you subtract one const X* pointer from another in an arm
1107 of an if-expression whose if-part is not a constant expression */
1108 const char *g = "string";
1109 ccp = &g + (g ? g-g : 0);
1110 /* HPUX 7.0 cc rejects these. */
1111 ++ccp;
1112 p = (char**) ccp;
1113 ccp = (char const *const *) p;
1114 { /* SCO 3.2v4 cc rejects this. */
1115 char *t;
1116 char const *s = 0 ? (char *) 0 : (char const *) 0;
1117
1118 *t++ = 0;
1119 }
1120 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1121 int x[] = {25, 17};
1122 const int *foo = &x[0];
1123 ++foo;
1124 }
1125 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1126 typedef const int *iptr;
1127 iptr p = 0;
1128 ++p;
1129 }
1130 { /* AIX XL C 1.02.0.0 rejects this saying
1131 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1132 struct s { int j; const int *ap[3]; };
1133 struct s *b; b->j = 5;
1134 }
1135 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1136 const int foo = 10;
1137 }
1138
1139 ; return 0; }
1140 EOF
1141 if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1142 rm -rf conftest*
1143 ac_cv_c_const=yes
1144 else
1145 echo "configure: failed program was:" >&5
1146 cat conftest.$ac_ext >&5
1147 rm -rf conftest*
1148 ac_cv_c_const=no
1149 fi
1150 rm -f conftest*
1151 fi
1152
1153 echo "$ac_t""$ac_cv_c_const" 1>&6
1154 if test $ac_cv_c_const = no; then
1155 cat >> confdefs.h <<\EOF
1156 #define const
1157 EOF
1158
1159 fi
1160
1161 echo $ac_n "checking for inline""... $ac_c" 1>&6
1162 echo "configure:1163: checking for inline" >&5
1163 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1164 echo $ac_n "(cached) $ac_c" 1>&6
1165 else
1166 ac_cv_c_inline=no
1167 for ac_kw in inline __inline__ __inline; do
1168 cat > conftest.$ac_ext <<EOF
1169 #line 1170 "configure"
1170 #include "confdefs.h"
1171
1172 int main() {
1173 } $ac_kw foo() {
1174 ; return 0; }
1175 EOF
1176 if { (eval echo configure:1177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1177 rm -rf conftest*
1178 ac_cv_c_inline=$ac_kw; break
1179 else
1180 echo "configure: failed program was:" >&5
1181 cat conftest.$ac_ext >&5
1182 fi
1183 rm -f conftest*
1184 done
1185
1186 fi
1187
1188 echo "$ac_t""$ac_cv_c_inline" 1>&6
1189 case "$ac_cv_c_inline" in
1190 inline | yes) ;;
1191 no) cat >> confdefs.h <<\EOF
1192 #define inline
1193 EOF
1194 ;;
1195 *) cat >> confdefs.h <<EOF
1196 #define inline $ac_cv_c_inline
1197 EOF
1198 ;;
1199 esac
1200
1201 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
1202 echo "configure:1203: checking whether byte ordering is bigendian" >&5
1203 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
1204 echo $ac_n "(cached) $ac_c" 1>&6
1205 else
1206 ac_cv_c_bigendian=unknown
1207 # See if sys/param.h defines the BYTE_ORDER macro.
1208 cat > conftest.$ac_ext <<EOF
1209 #line 1210 "configure"
1210 #include "confdefs.h"
1211 #include <sys/types.h>
1212 #include <sys/param.h>
1213 int main() {
1214
1215 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
1216 bogus endian macros
1217 #endif
1218 ; return 0; }
1219 EOF
1220 if { (eval echo configure:1221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1221 rm -rf conftest*
1222 # It does; now see whether it defined to BIG_ENDIAN or not.
1223 cat > conftest.$ac_ext <<EOF
1224 #line 1225 "configure"
1225 #include "confdefs.h"
1226 #include <sys/types.h>
1227 #include <sys/param.h>
1228 int main() {
1229
1230 #if BYTE_ORDER != BIG_ENDIAN
1231 not big endian
1232 #endif
1233 ; return 0; }
1234 EOF
1235 if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1236 rm -rf conftest*
1237 ac_cv_c_bigendian=yes
1238 else
1239 echo "configure: failed program was:" >&5
1240 cat conftest.$ac_ext >&5
1241 rm -rf conftest*
1242 ac_cv_c_bigendian=no
1243 fi
1244 rm -f conftest*
1245 else
1246 echo "configure: failed program was:" >&5
1247 cat conftest.$ac_ext >&5
1248 fi
1249 rm -f conftest*
1250 if test $ac_cv_c_bigendian = unknown; then
1251 if test "$cross_compiling" = yes; then
1252 echo $ac_n "cross-compiling... " 2>&6
1253 else
1254 cat > conftest.$ac_ext <<EOF
1255 #line 1256 "configure"
1256 #include "confdefs.h"
1257 main () {
1258 /* Are we little or big endian? From Harbison&Steele. */
1259 union
1260 {
1261 long l;
1262 char c[sizeof (long)];
1263 } u;
1264 u.l = 1;
1265 exit (u.c[sizeof (long) - 1] == 1);
1266 }
1267 EOF
1268 if { (eval echo configure:1269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1269 then
1270 ac_cv_c_bigendian=no
1271 else
1272 echo "configure: failed program was:" >&5
1273 cat conftest.$ac_ext >&5
1274 rm -fr conftest*
1275 ac_cv_c_bigendian=yes
1276 fi
1277 rm -fr conftest*
1278 fi
1279
1280 fi
1281 fi
1282
1283 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
1284 if test $ac_cv_c_bigendian = unknown; then
1285 echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
1286 echo "configure:1287: checking to probe for byte ordering" >&5
1287
1288 cat >conftest.c <<EOF
1289 short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
1290 short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
1291 void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
1292 short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
1293 short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
1294 void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
1295 int main() { _ascii (); _ebcdic (); return 0; }
1296 EOF
1297 if test -f conftest.c ; then
1298 if ${CC-cc} ${CFLAGS} conftest.c -o conftest.o && test -f conftest.o ; then
1299 if test `grep -l BIGenDianSyS conftest.o` ; then
1300 echo $ac_n ' big endian probe OK, ' 1>&6
1301 ac_cv_c_bigendian=yes
1302 fi
1303 if test `grep -l LiTTleEnDian conftest.o` ; then
1304 echo $ac_n ' little endian probe OK, ' 1>&6
1305 if test $ac_cv_c_bigendian = yes ; then
1306 ac_cv_c_bigendian=unknown;
1307 else
1308 ac_cv_c_bigendian=no
1309 fi
1310 fi
1311 echo $ac_n 'guessing bigendian ... ' >&6
1312 fi
1313 fi
1314 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
1315 fi
1316 if test $ac_cv_c_bigendian = yes; then
1317 cat >> confdefs.h <<\EOF
1318 #define WORDS_BIGENDIAN 1
1319 EOF
1320
1321 cat >> confdefs.h <<\EOF
1322 #define HOST_WORDS_BIG_ENDIAN 1
1323 EOF
1324
1325 BYTEORDER=4321
1326 else
1327 BYTEORDER=1234
1328 fi
1329 cat >> confdefs.h <<EOF
1330 #define BYTEORDER $BYTEORDER
1331 EOF
1332
1333 if test $ac_cv_c_bigendian = unknown; then
1334 { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
1335 fi
1336
1337
1338
1339
1340
1341
1342
1343 # Find a good install program. We prefer a C program (faster),
1344 # so one script is as good as another. But avoid the broken or
1345 # incompatible versions:
1346 # SysV /etc/install, /usr/sbin/install
1347 # SunOS /usr/etc/install
1348 # IRIX /sbin/install
1349 # AIX /bin/install
1350 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1351 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1352 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1353 # ./install, which can be erroneously created by make from ./install.sh.
1354 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1355 echo "configure:1356: checking for a BSD compatible install" >&5
1356 if test -z "$INSTALL"; then
1357 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1358 echo $ac_n "(cached) $ac_c" 1>&6
1359 else
1360 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
1361 for ac_dir in $PATH; do
1362 # Account for people who put trailing slashes in PATH elements.
1363 case "$ac_dir/" in
1364 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1365 *)
1366 # OSF1 and SCO ODT 3.0 have their own names for install.
1367 # Don't use installbsd from OSF since it installs stuff as root
1368 # by default.
1369 for ac_prog in ginstall scoinst install; do
1370 if test -f $ac_dir/$ac_prog; then
1371 if test $ac_prog = install &&
1372 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1373 # AIX install. It has an incompatible calling convention.
1374 :
1375 else
1376 ac_cv_path_install="$ac_dir/$ac_prog -c"
1377 break 2
1378 fi
1379 fi
1380 done
1381 ;;
1382 esac
1383 done
1384 IFS="$ac_save_IFS"
1385
1386 fi
1387 if test "${ac_cv_path_install+set}" = set; then
1388 INSTALL="$ac_cv_path_install"
1389 else
1390 # As a last resort, use the slow shell script. We don't cache a
1391 # path for INSTALL within a source directory, because that will
1392 # break other packages using the cache if that directory is
1393 # removed, or if the path is relative.
1394 INSTALL="$ac_install_sh"
1395 fi
1396 fi
1397 echo "$ac_t""$INSTALL" 1>&6
1398
1399 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1400 # It thinks the first close brace ends the variable substitution.
1401 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1402
1403 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1404
1405 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1406
1407
1408 . ${srcdir}/config.table
1409 host_makefile_frag=${frag}
1410
1411
1412 # It's OK to check for header files. Although the compiler may not be
1413 # able to link anything, it had better be able to at least compile
1414 # something.
1415 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1416 echo "configure:1417: checking how to run the C preprocessor" >&5
1417 # On Suns, sometimes $CPP names a directory.
1418 if test -n "$CPP" && test -d "$CPP"; then
1419 CPP=
1420 fi
1421 if test -z "$CPP"; then
1422 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1423 echo $ac_n "(cached) $ac_c" 1>&6
1424 else
1425 # This must be in double quotes, not single quotes, because CPP may get
1426 # substituted into the Makefile and "${CC-cc}" will confuse make.
1427 CPP="${CC-cc} -E"
1428 # On the NeXT, cc -E runs the code through the compiler's parser,
1429 # not just through cpp.
1430 cat > conftest.$ac_ext <<EOF
1431 #line 1432 "configure"
1432 #include "confdefs.h"
1433 #include <assert.h>
1434 Syntax Error
1435 EOF
1436 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1437 { (eval echo configure:1438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1438 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1439 if test -z "$ac_err"; then
1440 :
1441 else
1442 echo "$ac_err" >&5
1443 echo "configure: failed program was:" >&5
1444 cat conftest.$ac_ext >&5
1445 rm -rf conftest*
1446 CPP="${CC-cc} -E -traditional-cpp"
1447 cat > conftest.$ac_ext <<EOF
1448 #line 1449 "configure"
1449 #include "confdefs.h"
1450 #include <assert.h>
1451 Syntax Error
1452 EOF
1453 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1454 { (eval echo configure:1455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1455 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1456 if test -z "$ac_err"; then
1457 :
1458 else
1459 echo "$ac_err" >&5
1460 echo "configure: failed program was:" >&5
1461 cat conftest.$ac_ext >&5
1462 rm -rf conftest*
1463 CPP="${CC-cc} -nologo -E"
1464 cat > conftest.$ac_ext <<EOF
1465 #line 1466 "configure"
1466 #include "confdefs.h"
1467 #include <assert.h>
1468 Syntax Error
1469 EOF
1470 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1471 { (eval echo configure:1472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1472 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1473 if test -z "$ac_err"; then
1474 :
1475 else
1476 echo "$ac_err" >&5
1477 echo "configure: failed program was:" >&5
1478 cat conftest.$ac_ext >&5
1479 rm -rf conftest*
1480 CPP=/lib/cpp
1481 fi
1482 rm -f conftest*
1483 fi
1484 rm -f conftest*
1485 fi
1486 rm -f conftest*
1487 ac_cv_prog_CPP="$CPP"
1488 fi
1489 CPP="$ac_cv_prog_CPP"
1490 else
1491 ac_cv_prog_CPP="$CPP"
1492 fi
1493 echo "$ac_t""$CPP" 1>&6
1494
1495 for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
1496 do
1497 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1498 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1499 echo "configure:1500: checking for $ac_hdr" >&5
1500 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1501 echo $ac_n "(cached) $ac_c" 1>&6
1502 else
1503 cat > conftest.$ac_ext <<EOF
1504 #line 1505 "configure"
1505 #include "confdefs.h"
1506 #include <$ac_hdr>
1507 EOF
1508 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1509 { (eval echo configure:1510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1510 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1511 if test -z "$ac_err"; then
1512 rm -rf conftest*
1513 eval "ac_cv_header_$ac_safe=yes"
1514 else
1515 echo "$ac_err" >&5
1516 echo "configure: failed program was:" >&5
1517 cat conftest.$ac_ext >&5
1518 rm -rf conftest*
1519 eval "ac_cv_header_$ac_safe=no"
1520 fi
1521 rm -f conftest*
1522 fi
1523 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1524 echo "$ac_t""yes" 1>&6
1525 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1526 cat >> confdefs.h <<EOF
1527 #define $ac_tr_hdr 1
1528 EOF
1529
1530 else
1531 echo "$ac_t""no" 1>&6
1532 fi
1533 done
1534
1535 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1536 echo "configure:1537: checking for sys/wait.h that is POSIX.1 compatible" >&5
1537 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1538 echo $ac_n "(cached) $ac_c" 1>&6
1539 else
1540 cat > conftest.$ac_ext <<EOF
1541 #line 1542 "configure"
1542 #include "confdefs.h"
1543 #include <sys/types.h>
1544 #include <sys/wait.h>
1545 #ifndef WEXITSTATUS
1546 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1547 #endif
1548 #ifndef WIFEXITED
1549 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1550 #endif
1551 int main() {
1552 int s;
1553 wait (&s);
1554 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1555 ; return 0; }
1556 EOF
1557 if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1558 rm -rf conftest*
1559 ac_cv_header_sys_wait_h=yes
1560 else
1561 echo "configure: failed program was:" >&5
1562 cat conftest.$ac_ext >&5
1563 rm -rf conftest*
1564 ac_cv_header_sys_wait_h=no
1565 fi
1566 rm -f conftest*
1567 fi
1568
1569 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1570 if test $ac_cv_header_sys_wait_h = yes; then
1571 cat >> confdefs.h <<\EOF
1572 #define HAVE_SYS_WAIT_H 1
1573 EOF
1574
1575 fi
1576
1577 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1578 echo "configure:1579: checking whether time.h and sys/time.h may both be included" >&5
1579 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1580 echo $ac_n "(cached) $ac_c" 1>&6
1581 else
1582 cat > conftest.$ac_ext <<EOF
1583 #line 1584 "configure"
1584 #include "confdefs.h"
1585 #include <sys/types.h>
1586 #include <sys/time.h>
1587 #include <time.h>
1588 int main() {
1589 struct tm *tp;
1590 ; return 0; }
1591 EOF
1592 if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1593 rm -rf conftest*
1594 ac_cv_header_time=yes
1595 else
1596 echo "configure: failed program was:" >&5
1597 cat conftest.$ac_ext >&5
1598 rm -rf conftest*
1599 ac_cv_header_time=no
1600 fi
1601 rm -f conftest*
1602 fi
1603
1604 echo "$ac_t""$ac_cv_header_time" 1>&6
1605 if test $ac_cv_header_time = yes; then
1606 cat >> confdefs.h <<\EOF
1607 #define TIME_WITH_SYS_TIME 1
1608 EOF
1609
1610 fi
1611
1612
1613 echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
1614 echo "configure:1615: checking whether errno must be declared" >&5
1615 if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
1616 echo $ac_n "(cached) $ac_c" 1>&6
1617 else
1618 cat > conftest.$ac_ext <<EOF
1619 #line 1620 "configure"
1620 #include "confdefs.h"
1621 #include <errno.h>
1622 int main() {
1623 int x = errno;
1624 ; return 0; }
1625 EOF
1626 if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1627 rm -rf conftest*
1628 libiberty_cv_declare_errno=no
1629 else
1630 echo "configure: failed program was:" >&5
1631 cat conftest.$ac_ext >&5
1632 rm -rf conftest*
1633 libiberty_cv_declare_errno=yes
1634 fi
1635 rm -f conftest*
1636 fi
1637
1638 echo "$ac_t""$libiberty_cv_declare_errno" 1>&6
1639 if test $libiberty_cv_declare_errno = yes
1640 then cat >> confdefs.h <<\EOF
1641 #define NEED_DECLARATION_ERRNO 1
1642 EOF
1643
1644 fi
1645
1646
1647 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1648 echo "configure:1649: checking for ANSI C header files" >&5
1649 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1650 echo $ac_n "(cached) $ac_c" 1>&6
1651 else
1652 cat > conftest.$ac_ext <<EOF
1653 #line 1654 "configure"
1654 #include "confdefs.h"
1655 #include <stdlib.h>
1656 #include <stdarg.h>
1657 #include <string.h>
1658 #include <float.h>
1659 EOF
1660 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1661 { (eval echo configure:1662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1662 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1663 if test -z "$ac_err"; then
1664 rm -rf conftest*
1665 ac_cv_header_stdc=yes
1666 else
1667 echo "$ac_err" >&5
1668 echo "configure: failed program was:" >&5
1669 cat conftest.$ac_ext >&5
1670 rm -rf conftest*
1671 ac_cv_header_stdc=no
1672 fi
1673 rm -f conftest*
1674
1675 if test $ac_cv_header_stdc = yes; then
1676 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1677 cat > conftest.$ac_ext <<EOF
1678 #line 1679 "configure"
1679 #include "confdefs.h"
1680 #include <string.h>
1681 EOF
1682 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1683 egrep "memchr" >/dev/null 2>&1; then
1684 :
1685 else
1686 rm -rf conftest*
1687 ac_cv_header_stdc=no
1688 fi
1689 rm -f conftest*
1690
1691 fi
1692
1693 if test $ac_cv_header_stdc = yes; then
1694 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1695 cat > conftest.$ac_ext <<EOF
1696 #line 1697 "configure"
1697 #include "confdefs.h"
1698 #include <stdlib.h>
1699 EOF
1700 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1701 egrep "free" >/dev/null 2>&1; then
1702 :
1703 else
1704 rm -rf conftest*
1705 ac_cv_header_stdc=no
1706 fi
1707 rm -f conftest*
1708
1709 fi
1710
1711 if test $ac_cv_header_stdc = yes; then
1712 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1713 if test "$cross_compiling" = yes; then
1714 :
1715 else
1716 cat > conftest.$ac_ext <<EOF
1717 #line 1718 "configure"
1718 #include "confdefs.h"
1719 #include <ctype.h>
1720 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1721 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1722 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1723 int main () { int i; for (i = 0; i < 256; i++)
1724 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1725 exit (0); }
1726
1727 EOF
1728 if { (eval echo configure:1729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1729 then
1730 :
1731 else
1732 echo "configure: failed program was:" >&5
1733 cat conftest.$ac_ext >&5
1734 rm -fr conftest*
1735 ac_cv_header_stdc=no
1736 fi
1737 rm -fr conftest*
1738 fi
1739
1740 fi
1741 fi
1742
1743 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1744 if test $ac_cv_header_stdc = yes; then
1745 cat >> confdefs.h <<\EOF
1746 #define STDC_HEADERS 1
1747 EOF
1748
1749 fi
1750
1751 echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
1752 echo "configure:1753: checking for uintptr_t" >&5
1753 if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
1754 echo $ac_n "(cached) $ac_c" 1>&6
1755 else
1756 cat > conftest.$ac_ext <<EOF
1757 #line 1758 "configure"
1758 #include "confdefs.h"
1759 #include <sys/types.h>
1760 #if STDC_HEADERS
1761 #include <stdlib.h>
1762 #include <stddef.h>
1763 #endif
1764 EOF
1765 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1766 egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1767 rm -rf conftest*
1768 ac_cv_type_uintptr_t=yes
1769 else
1770 rm -rf conftest*
1771 ac_cv_type_uintptr_t=no
1772 fi
1773 rm -f conftest*
1774
1775 fi
1776 echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6
1777 if test $ac_cv_type_uintptr_t = no; then
1778 cat >> confdefs.h <<\EOF
1779 #define uintptr_t unsigned long
1780 EOF
1781
1782 fi
1783
1784 # Given the above check, we always have uintptr_t or a fallback
1785 # definition. So define HAVE_UINTPTR_T in case any imported code
1786 # relies on it.
1787 cat >> confdefs.h <<\EOF
1788 #define HAVE_UINTPTR_T 1
1789 EOF
1790
1791
1792 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1793 echo "configure:1794: checking for pid_t" >&5
1794 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1795 echo $ac_n "(cached) $ac_c" 1>&6
1796 else
1797 cat > conftest.$ac_ext <<EOF
1798 #line 1799 "configure"
1799 #include "confdefs.h"
1800 #include <sys/types.h>
1801 #if STDC_HEADERS
1802 #include <stdlib.h>
1803 #include <stddef.h>
1804 #endif
1805 EOF
1806 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1807 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1808 rm -rf conftest*
1809 ac_cv_type_pid_t=yes
1810 else
1811 rm -rf conftest*
1812 ac_cv_type_pid_t=no
1813 fi
1814 rm -f conftest*
1815
1816 fi
1817 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1818 if test $ac_cv_type_pid_t = no; then
1819 cat >> confdefs.h <<\EOF
1820 #define pid_t int
1821 EOF
1822
1823 fi
1824
1825
1826 # This is the list of functions which libiberty will provide if they
1827 # are not available on the host.
1828
1829 funcs="asprintf"
1830 funcs="$funcs atexit"
1831 funcs="$funcs basename"
1832 funcs="$funcs bcmp"
1833 funcs="$funcs bcopy"
1834 funcs="$funcs bsearch"
1835 funcs="$funcs bzero"
1836 funcs="$funcs calloc"
1837 funcs="$funcs clock"
1838 funcs="$funcs ffs"
1839 funcs="$funcs getcwd"
1840 funcs="$funcs getpagesize"
1841 funcs="$funcs index"
1842 funcs="$funcs insque"
1843 funcs="$funcs memchr"
1844 funcs="$funcs memcmp"
1845 funcs="$funcs memcpy"
1846 funcs="$funcs memmove"
1847 funcs="$funcs mempcpy"
1848 funcs="$funcs memset"
1849 funcs="$funcs mkstemps"
1850 funcs="$funcs putenv"
1851 funcs="$funcs random"
1852 funcs="$funcs rename"
1853 funcs="$funcs rindex"
1854 funcs="$funcs setenv"
1855 funcs="$funcs snprintf"
1856 funcs="$funcs sigsetmask"
1857 funcs="$funcs stpcpy"
1858 funcs="$funcs stpncpy"
1859 funcs="$funcs strcasecmp"
1860 funcs="$funcs strchr"
1861 funcs="$funcs strdup"
1862 funcs="$funcs strncasecmp"
1863 funcs="$funcs strrchr"
1864 funcs="$funcs strstr"
1865 funcs="$funcs strtod"
1866 funcs="$funcs strtol"
1867 funcs="$funcs strtoul"
1868 funcs="$funcs tmpnam"
1869 funcs="$funcs vasprintf"
1870 funcs="$funcs vfprintf"
1871 funcs="$funcs vprintf"
1872 funcs="$funcs vsnprintf"
1873 funcs="$funcs vsprintf"
1874 funcs="$funcs waitpid"
1875
1876 # Also in the old function.def file: alloca, vfork, getopt.
1877
1878 vars="sys_errlist sys_nerr sys_siglist"
1879
1880 checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
1881 checkfuncs="$checkfuncs realpath canonicalize_file_name pstat_getstatic pstat_getdynamic sysmp"
1882 checkfuncs="$checkfuncs getsysinfo table sysctl"
1883
1884 # These are neither executed nor required, but they help keep
1885 # autoheader happy without adding a bunch of text to acconfig.h.
1886 if test "x" = "y"; then
1887 for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock \
1888 getcwd getpagesize index insque mkstemps memchr memcmp memcpy \
1889 memmove mempcpy memset putenv random rename rindex sigsetmask \
1890 strcasecmp setenv stpcpy stpncpy strchr strdup strncasecmp strrchr strstr \
1891 strtod strtol strtoul tmpnam vasprintf vfprintf vprintf \
1892 vsprintf waitpid getrusage on_exit psignal strerror strsignal \
1893 sysconf times sbrk gettimeofday ffs snprintf vsnprintf \
1894 pstat_getstatic pstat_getdynamic sysmp getsysinfo table sysctl \
1895 realpath canonicalize_file_name
1896 do
1897 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1898 echo "configure:1899: checking for $ac_func" >&5
1899 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1900 echo $ac_n "(cached) $ac_c" 1>&6
1901 else
1902 cat > conftest.$ac_ext <<EOF
1903 #line 1904 "configure"
1904 #include "confdefs.h"
1905 /* System header to define __stub macros and hopefully few prototypes,
1906 which can conflict with char $ac_func(); below. */
1907 #include <assert.h>
1908 /* Override any gcc2 internal prototype to avoid an error. */
1909 /* We use char because int might match the return type of a gcc2
1910 builtin and then its argument prototype would still apply. */
1911 char $ac_func();
1912
1913 int main() {
1914
1915 /* The GNU C library defines this for functions which it implements
1916 to always fail with ENOSYS. Some functions are actually named
1917 something starting with __ and the normal name is an alias. */
1918 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1919 choke me
1920 #else
1921 $ac_func();
1922 #endif
1923
1924 ; return 0; }
1925 EOF
1926 if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1927 rm -rf conftest*
1928 eval "ac_cv_func_$ac_func=yes"
1929 else
1930 echo "configure: failed program was:" >&5
1931 cat conftest.$ac_ext >&5
1932 rm -rf conftest*
1933 eval "ac_cv_func_$ac_func=no"
1934 fi
1935 rm -f conftest*
1936 fi
1937
1938 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1939 echo "$ac_t""yes" 1>&6
1940 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1941 cat >> confdefs.h <<EOF
1942 #define $ac_tr_func 1
1943 EOF
1944
1945 else
1946 echo "$ac_t""no" 1>&6
1947 fi
1948 done
1949
1950 cat >> confdefs.h <<\EOF
1951 #define HAVE_SYS_ERRLIST 1
1952 EOF
1953
1954 cat >> confdefs.h <<\EOF
1955 #define HAVE_SYS_NERR 1
1956 EOF
1957
1958 cat >> confdefs.h <<\EOF
1959 #define HAVE_SYS_SIGLIST 1
1960 EOF
1961
1962 fi
1963
1964 # For each of these functions, if the host does not provide the
1965 # function we want to put FN.o in LIBOBJS, and if the host does
1966 # provide the function, we want to define HAVE_FN in config.h.
1967
1968 setobjs=
1969 CHECK=
1970 target_header_dir=
1971 if test -n "${with_target_subdir}"; then
1972
1973 # We are being configured as a target library. AC_REPLACE_FUNCS
1974 # may not work correctly, because the compiler may not be able to
1975 # link executables. Note that we may still be being configured
1976 # native.
1977
1978 # If we are being configured for newlib, we know which functions
1979 # newlib provide and which ones we will be expected to provide.
1980
1981 if test "x${with_newlib}" = "xyes"; then
1982 LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
1983
1984 for f in $funcs; do
1985 case "$f" in
1986 asprintf | basename | insque | random | strdup | vasprintf)
1987 ;;
1988 *)
1989 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1990 cat >> confdefs.h <<EOF
1991 #define $n 1
1992 EOF
1993
1994 ;;
1995 esac
1996 done
1997
1998 # newlib doesnt provide any of the variables in $vars, so we
1999 # dont have to check them here.
2000
2001 # Of the functions in $checkfuncs, newlib only has strerror.
2002 cat >> confdefs.h <<\EOF
2003 #define HAVE_STRERROR 1
2004 EOF
2005
2006
2007 setobjs=yes
2008
2009 fi
2010
2011 # We may wish to install the target headers somewhere.
2012 # Check whether --enable-install-libiberty or --disable-install-libiberty was given.
2013 if test "${enable_install_libiberty+set}" = set; then
2014 enableval="$enable_install_libiberty"
2015 enable_install_libiberty=$enableval
2016 else
2017 enable_install_libiberty=no
2018 fi
2019
2020 # Option parsed, now set things appropriately.
2021 case x"$enable_install_libiberty" in
2022 xyes|x)
2023 target_header_dir=libiberty
2024 ;;
2025 xno)
2026 target_header_dir=
2027 ;;
2028 *)
2029 # This could be sanity-checked in various ways...
2030 target_header_dir="${enable_install_libiberty}"
2031 ;;
2032 esac
2033
2034
2035 else
2036
2037 # Not a target library, so we set things up to run the test suite.
2038 CHECK=check-cplus-dem
2039
2040 fi
2041
2042
2043
2044
2045 case "${host}" in
2046 *-*-cygwin* | *-*-mingw*)
2047 cat >> confdefs.h <<\EOF
2048 #define HAVE_SYS_ERRLIST 1
2049 EOF
2050
2051 cat >> confdefs.h <<\EOF
2052 #define HAVE_SYS_NERR 1
2053 EOF
2054
2055 ;;
2056 esac
2057
2058 if test -z "${setobjs}"; then
2059 case "${host}" in
2060
2061 *-*-vxworks*)
2062 # Handle VxWorks configuration specially, since on VxWorks the
2063 # libraries are actually on the target board, not in the file
2064 # system.
2065 LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
2066 LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
2067 for f in $funcs; do
2068 case "$f" in
2069 basename | getpagesize | insque | random | strcasecmp)
2070 ;;
2071 strncasecmp | strdup | vfork | waitpid | vasprintf)
2072 ;;
2073 *)
2074 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2075 cat >> confdefs.h <<EOF
2076 #define $n 1
2077 EOF
2078
2079 ;;
2080 esac
2081 done
2082
2083 # VxWorks doesn't provide any of the variables in $vars, so we
2084 # don't have to check them here.
2085
2086 # Of the functions in $checkfuncs, VxWorks only has strerror.
2087 cat >> confdefs.h <<\EOF
2088 #define HAVE_STRERROR 1
2089 EOF
2090
2091
2092 setobjs=yes
2093 ;;
2094
2095 esac
2096 fi
2097
2098 if test -z "${setobjs}"; then
2099
2100 case "${host}" in
2101
2102 *-*-cygwin*)
2103 # The Cygwin library actually uses a couple of files from
2104 # libiberty when it is built. If we are building a native
2105 # Cygwin, and we run the tests, we will appear to have these
2106 # files. However, when we go on to build winsup, we will wind up
2107 # with a library which does not have the files, since they should
2108 # have come from libiberty.
2109
2110 # We handle this by removing the functions the winsup library
2111 # provides from our shell variables, so that they appear to be
2112 # missing.
2113
2114 # DJ - only if we're *building* cygwin, not just building *with* cygwin
2115
2116 if test -n "${with_target_subdir}"
2117 then
2118 funcs="`echo $funcs | sed -e 's/random//'`"
2119 LIBOBJS="$LIBOBJS random.o"
2120 vars="`echo $vars | sed -e 's/sys_siglist//'`"
2121 checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
2122 fi
2123 ;;
2124
2125 *-*-mingw32*)
2126 # Under mingw32, sys_nerr and sys_errlist exist, but they are
2127 # macros, so the test below won't find them.
2128 libiberty_cv_var_sys_nerr=yes
2129 libiberty_cv_var_sys_errlist=yes
2130 ;;
2131
2132 *-*-uwin*)
2133 # Under some versions of uwin, vfork is notoriously buggy and the test
2134 # can hang configure; on other versions, vfork exists just as a stub.
2135 # FIXME: This should be removed once vfork in uwin's runtime is fixed.
2136 ac_cv_func_vfork_works=no
2137 # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
2138 # macros (actually, these are imported from a DLL, but the end effect
2139 # is the same), so the test below won't find them.
2140 libiberty_cv_var_sys_nerr=yes
2141 libiberty_cv_var_sys_errlist=yes
2142 ;;
2143
2144 *-*-*vms*)
2145 # Under VMS, vfork works very different than on Unix. The standard test
2146 # won't work, and it isn't easily adaptable. It makes more sense to
2147 # just force it.
2148 ac_cv_func_vfork_works=yes
2149 ;;
2150
2151 esac
2152
2153 # We haven't set the list of objects yet. Use the standard autoconf
2154 # tests. This will only work if the compiler works.
2155 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2156 echo "configure:2157: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2157
2158 ac_ext=c
2159 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2160 ac_cpp='$CPP $CPPFLAGS'
2161 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2162 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2163 cross_compiling=$ac_cv_prog_cc_cross
2164
2165 cat > conftest.$ac_ext << EOF
2166
2167 #line 2168 "configure"
2168 #include "confdefs.h"
2169
2170 main(){return(0);}
2171 EOF
2172 if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2173 ac_cv_prog_cc_works=yes
2174 # If we can't run a trivial program, we are probably using a cross compiler.
2175 if (./conftest; exit) 2>/dev/null; then
2176 ac_cv_prog_cc_cross=no
2177 else
2178 ac_cv_prog_cc_cross=yes
2179 fi
2180 else
2181 echo "configure: failed program was:" >&5
2182 cat conftest.$ac_ext >&5
2183 ac_cv_prog_cc_works=no
2184 fi
2185 rm -fr conftest*
2186 ac_ext=c
2187 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2188 ac_cpp='$CPP $CPPFLAGS'
2189 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2190 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2191 cross_compiling=$ac_cv_prog_cc_cross
2192
2193 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2194 if test $ac_cv_prog_cc_works = no; then
2195 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2196 fi
2197 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2198 echo "configure:2199: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2199 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2200 cross_compiling=$ac_cv_prog_cc_cross
2201
2202 for ac_func in $funcs
2203 do
2204 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2205 echo "configure:2206: checking for $ac_func" >&5
2206 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2207 echo $ac_n "(cached) $ac_c" 1>&6
2208 else
2209 cat > conftest.$ac_ext <<EOF
2210 #line 2211 "configure"
2211 #include "confdefs.h"
2212 /* System header to define __stub macros and hopefully few prototypes,
2213 which can conflict with char $ac_func(); below. */
2214 #include <assert.h>
2215 /* Override any gcc2 internal prototype to avoid an error. */
2216 /* We use char because int might match the return type of a gcc2
2217 builtin and then its argument prototype would still apply. */
2218 char $ac_func();
2219
2220 int main() {
2221
2222 /* The GNU C library defines this for functions which it implements
2223 to always fail with ENOSYS. Some functions are actually named
2224 something starting with __ and the normal name is an alias. */
2225 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2226 choke me
2227 #else
2228 $ac_func();
2229 #endif
2230
2231 ; return 0; }
2232 EOF
2233 if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2234 rm -rf conftest*
2235 eval "ac_cv_func_$ac_func=yes"
2236 else
2237 echo "configure: failed program was:" >&5
2238 cat conftest.$ac_ext >&5
2239 rm -rf conftest*
2240 eval "ac_cv_func_$ac_func=no"
2241 fi
2242 rm -f conftest*
2243 fi
2244
2245 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2246 echo "$ac_t""yes" 1>&6
2247 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2248 cat >> confdefs.h <<EOF
2249 #define $ac_tr_func 1
2250 EOF
2251
2252 else
2253 echo "$ac_t""no" 1>&6
2254 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
2255 fi
2256 done
2257
2258
2259 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
2260 echo "configure:2261: checking whether alloca needs Cray hooks" >&5
2261 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
2262 echo $ac_n "(cached) $ac_c" 1>&6
2263 else
2264 cat > conftest.$ac_ext <<EOF
2265 #line 2266 "configure"
2266 #include "confdefs.h"
2267 #if defined(CRAY) && ! defined(CRAY2)
2268 webecray
2269 #else
2270 wenotbecray
2271 #endif
2272
2273 EOF
2274 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2275 egrep "webecray" >/dev/null 2>&1; then
2276 rm -rf conftest*
2277 ac_cv_os_cray=yes
2278 else
2279 rm -rf conftest*
2280 ac_cv_os_cray=no
2281 fi
2282 rm -f conftest*
2283
2284 fi
2285
2286 echo "$ac_t""$ac_cv_os_cray" 1>&6
2287 if test $ac_cv_os_cray = yes; then
2288 for ac_func in _getb67 GETB67 getb67; do
2289 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2290 echo "configure:2291: checking for $ac_func" >&5
2291 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2292 echo $ac_n "(cached) $ac_c" 1>&6
2293 else
2294 cat > conftest.$ac_ext <<EOF
2295 #line 2296 "configure"
2296 #include "confdefs.h"
2297 /* System header to define __stub macros and hopefully few prototypes,
2298 which can conflict with char $ac_func(); below. */
2299 #include <assert.h>
2300 /* Override any gcc2 internal prototype to avoid an error. */
2301 /* We use char because int might match the return type of a gcc2
2302 builtin and then its argument prototype would still apply. */
2303 char $ac_func();
2304
2305 int main() {
2306
2307 /* The GNU C library defines this for functions which it implements
2308 to always fail with ENOSYS. Some functions are actually named
2309 something starting with __ and the normal name is an alias. */
2310 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2311 choke me
2312 #else
2313 $ac_func();
2314 #endif
2315
2316 ; return 0; }
2317 EOF
2318 if { (eval echo configure:2319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2319 rm -rf conftest*
2320 eval "ac_cv_func_$ac_func=yes"
2321 else
2322 echo "configure: failed program was:" >&5
2323 cat conftest.$ac_ext >&5
2324 rm -rf conftest*
2325 eval "ac_cv_func_$ac_func=no"
2326 fi
2327 rm -f conftest*
2328 fi
2329
2330 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2331 echo "$ac_t""yes" 1>&6
2332 cat >> confdefs.h <<EOF
2333 #define CRAY_STACKSEG_END $ac_func
2334 EOF
2335 break
2336 else
2337 echo "$ac_t""no" 1>&6
2338 fi
2339
2340 done
2341 fi
2342
2343 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
2344 echo "configure:2345: checking stack direction for C alloca" >&5
2345 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
2346 echo $ac_n "(cached) $ac_c" 1>&6
2347 else
2348 if test "$cross_compiling" = yes; then
2349 ac_cv_c_stack_direction=0
2350 else
2351 cat > conftest.$ac_ext <<EOF
2352 #line 2353 "configure"
2353 #include "confdefs.h"
2354 find_stack_direction ()
2355 {
2356 static char *addr = 0;
2357 auto char dummy;
2358 if (addr == 0)
2359 {
2360 addr = &dummy;
2361 return find_stack_direction ();
2362 }
2363 else
2364 return (&dummy > addr) ? 1 : -1;
2365 }
2366 main ()
2367 {
2368 exit (find_stack_direction() < 0);
2369 }
2370 EOF
2371 if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2372 then
2373 ac_cv_c_stack_direction=1
2374 else
2375 echo "configure: failed program was:" >&5
2376 cat conftest.$ac_ext >&5
2377 rm -fr conftest*
2378 ac_cv_c_stack_direction=-1
2379 fi
2380 rm -fr conftest*
2381 fi
2382
2383 fi
2384
2385 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
2386 cat >> confdefs.h <<EOF
2387 #define STACK_DIRECTION $ac_cv_c_stack_direction
2388 EOF
2389
2390
2391 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
2392 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
2393 echo "configure:2394: checking for vfork.h" >&5
2394 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2395 echo $ac_n "(cached) $ac_c" 1>&6
2396 else
2397 cat > conftest.$ac_ext <<EOF
2398 #line 2399 "configure"
2399 #include "confdefs.h"
2400 #include <vfork.h>
2401 EOF
2402 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2403 { (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2404 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2405 if test -z "$ac_err"; then
2406 rm -rf conftest*
2407 eval "ac_cv_header_$ac_safe=yes"
2408 else
2409 echo "$ac_err" >&5
2410 echo "configure: failed program was:" >&5
2411 cat conftest.$ac_ext >&5
2412 rm -rf conftest*
2413 eval "ac_cv_header_$ac_safe=no"
2414 fi
2415 rm -f conftest*
2416 fi
2417 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2418 echo "$ac_t""yes" 1>&6
2419 cat >> confdefs.h <<\EOF
2420 #define HAVE_VFORK_H 1
2421 EOF
2422
2423 else
2424 echo "$ac_t""no" 1>&6
2425 fi
2426
2427 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
2428 echo "configure:2429: checking for working vfork" >&5
2429 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
2430 echo $ac_n "(cached) $ac_c" 1>&6
2431 else
2432 if test "$cross_compiling" = yes; then
2433 echo $ac_n "checking for vfork""... $ac_c" 1>&6
2434 echo "configure:2435: checking for vfork" >&5
2435 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
2436 echo $ac_n "(cached) $ac_c" 1>&6
2437 else
2438 cat > conftest.$ac_ext <<EOF
2439 #line 2440 "configure"
2440 #include "confdefs.h"
2441 /* System header to define __stub macros and hopefully few prototypes,
2442 which can conflict with char vfork(); below. */
2443 #include <assert.h>
2444 /* Override any gcc2 internal prototype to avoid an error. */
2445 /* We use char because int might match the return type of a gcc2
2446 builtin and then its argument prototype would still apply. */
2447 char vfork();
2448
2449 int main() {
2450
2451 /* The GNU C library defines this for functions which it implements
2452 to always fail with ENOSYS. Some functions are actually named
2453 something starting with __ and the normal name is an alias. */
2454 #if defined (__stub_vfork) || defined (__stub___vfork)
2455 choke me
2456 #else
2457 vfork();
2458 #endif
2459
2460 ; return 0; }
2461 EOF
2462 if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2463 rm -rf conftest*
2464 eval "ac_cv_func_vfork=yes"
2465 else
2466 echo "configure: failed program was:" >&5
2467 cat conftest.$ac_ext >&5
2468 rm -rf conftest*
2469 eval "ac_cv_func_vfork=no"
2470 fi
2471 rm -f conftest*
2472 fi
2473
2474 if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
2475 echo "$ac_t""yes" 1>&6
2476 :
2477 else
2478 echo "$ac_t""no" 1>&6
2479 fi
2480
2481 ac_cv_func_vfork_works=$ac_cv_func_vfork
2482 else
2483 cat > conftest.$ac_ext <<EOF
2484 #line 2485 "configure"
2485 #include "confdefs.h"
2486 /* Thanks to Paul Eggert for this test. */
2487 #include <stdio.h>
2488 #include <sys/types.h>
2489 #include <sys/stat.h>
2490 #ifdef HAVE_UNISTD_H
2491 #include <unistd.h>
2492 #endif
2493 #ifdef HAVE_VFORK_H
2494 #include <vfork.h>
2495 #endif
2496 /* On some sparc systems, changes by the child to local and incoming
2497 argument registers are propagated back to the parent.
2498 The compiler is told about this with #include <vfork.h>,
2499 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
2500 Test for this by using a static variable whose address
2501 is put into a register that is clobbered by the vfork. */
2502 static
2503 #ifdef __cplusplus
2504 sparc_address_test (int arg)
2505 #else
2506 sparc_address_test (arg) int arg;
2507 #endif
2508 {
2509 static pid_t child;
2510 if (!child) {
2511 child = vfork ();
2512 if (child < 0) {
2513 perror ("vfork");
2514 _exit(2);
2515 }
2516 if (!child) {
2517 arg = getpid();
2518 write(-1, "", 0);
2519 _exit (arg);
2520 }
2521 }
2522 }
2523 main() {
2524 pid_t parent = getpid ();
2525 pid_t child;
2526
2527 sparc_address_test ();
2528
2529 child = vfork ();
2530
2531 if (child == 0) {
2532 /* Here is another test for sparc vfork register problems.
2533 This test uses lots of local variables, at least
2534 as many local variables as main has allocated so far
2535 including compiler temporaries. 4 locals are enough for
2536 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
2537 A buggy compiler should reuse the register of parent
2538 for one of the local variables, since it will think that
2539 parent can't possibly be used any more in this routine.
2540 Assigning to the local variable will thus munge parent
2541 in the parent process. */
2542 pid_t
2543 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
2544 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
2545 /* Convince the compiler that p..p7 are live; otherwise, it might
2546 use the same hardware register for all 8 local variables. */
2547 if (p != p1 || p != p2 || p != p3 || p != p4
2548 || p != p5 || p != p6 || p != p7)
2549 _exit(1);
2550
2551 /* On some systems (e.g. IRIX 3.3),
2552 vfork doesn't separate parent from child file descriptors.
2553 If the child closes a descriptor before it execs or exits,
2554 this munges the parent's descriptor as well.
2555 Test for this by closing stdout in the child. */
2556 _exit(close(fileno(stdout)) != 0);
2557 } else {
2558 int status;
2559 struct stat st;
2560
2561 while (wait(&status) != child)
2562 ;
2563 exit(
2564 /* Was there some problem with vforking? */
2565 child < 0
2566
2567 /* Did the child fail? (This shouldn't happen.) */
2568 || status
2569
2570 /* Did the vfork/compiler bug occur? */
2571 || parent != getpid()
2572
2573 /* Did the file descriptor bug occur? */
2574 || fstat(fileno(stdout), &st) != 0
2575 );
2576 }
2577 }
2578 EOF
2579 if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2580 then
2581 ac_cv_func_vfork_works=yes
2582 else
2583 echo "configure: failed program was:" >&5
2584 cat conftest.$ac_ext >&5
2585 rm -fr conftest*
2586 ac_cv_func_vfork_works=no
2587 fi
2588 rm -fr conftest*
2589 fi
2590
2591 fi
2592
2593 echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
2594 if test $ac_cv_func_vfork_works = no; then
2595 cat >> confdefs.h <<\EOF
2596 #define vfork fork
2597 EOF
2598
2599 fi
2600
2601 if test $ac_cv_func_vfork_works = no; then
2602 LIBOBJS="$LIBOBJS vfork.o"
2603 fi
2604 # We only need _doprnt if we might use it to implement v*printf.
2605 if test $ac_cv_func_vprintf != yes \
2606 || test $ac_cv_func_vfprintf != yes \
2607 || test $ac_cv_func_vsprintf != yes; then
2608 for ac_func in _doprnt
2609 do
2610 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2611 echo "configure:2612: checking for $ac_func" >&5
2612 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2613 echo $ac_n "(cached) $ac_c" 1>&6
2614 else
2615 cat > conftest.$ac_ext <<EOF
2616 #line 2617 "configure"
2617 #include "confdefs.h"
2618 /* System header to define __stub macros and hopefully few prototypes,
2619 which can conflict with char $ac_func(); below. */
2620 #include <assert.h>
2621 /* Override any gcc2 internal prototype to avoid an error. */
2622 /* We use char because int might match the return type of a gcc2
2623 builtin and then its argument prototype would still apply. */
2624 char $ac_func();
2625
2626 int main() {
2627
2628 /* The GNU C library defines this for functions which it implements
2629 to always fail with ENOSYS. Some functions are actually named
2630 something starting with __ and the normal name is an alias. */
2631 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2632 choke me
2633 #else
2634 $ac_func();
2635 #endif
2636
2637 ; return 0; }
2638 EOF
2639 if { (eval echo configure:2640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2640 rm -rf conftest*
2641 eval "ac_cv_func_$ac_func=yes"
2642 else
2643 echo "configure: failed program was:" >&5
2644 cat conftest.$ac_ext >&5
2645 rm -rf conftest*
2646 eval "ac_cv_func_$ac_func=no"
2647 fi
2648 rm -f conftest*
2649 fi
2650
2651 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2652 echo "$ac_t""yes" 1>&6
2653 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2654 cat >> confdefs.h <<EOF
2655 #define $ac_tr_func 1
2656 EOF
2657
2658 else
2659 echo "$ac_t""no" 1>&6
2660 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
2661 fi
2662 done
2663
2664
2665 else
2666 for ac_func in _doprnt
2667 do
2668 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2669 echo "configure:2670: checking for $ac_func" >&5
2670 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2671 echo $ac_n "(cached) $ac_c" 1>&6
2672 else
2673 cat > conftest.$ac_ext <<EOF
2674 #line 2675 "configure"
2675 #include "confdefs.h"
2676 /* System header to define __stub macros and hopefully few prototypes,
2677 which can conflict with char $ac_func(); below. */
2678 #include <assert.h>
2679 /* Override any gcc2 internal prototype to avoid an error. */
2680 /* We use char because int might match the return type of a gcc2
2681 builtin and then its argument prototype would still apply. */
2682 char $ac_func();
2683
2684 int main() {
2685
2686 /* The GNU C library defines this for functions which it implements
2687 to always fail with ENOSYS. Some functions are actually named
2688 something starting with __ and the normal name is an alias. */
2689 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2690 choke me
2691 #else
2692 $ac_func();
2693 #endif
2694
2695 ; return 0; }
2696 EOF
2697 if { (eval echo configure:2698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2698 rm -rf conftest*
2699 eval "ac_cv_func_$ac_func=yes"
2700 else
2701 echo "configure: failed program was:" >&5
2702 cat conftest.$ac_ext >&5
2703 rm -rf conftest*
2704 eval "ac_cv_func_$ac_func=no"
2705 fi
2706 rm -f conftest*
2707 fi
2708
2709 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2710 echo "$ac_t""yes" 1>&6
2711 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2712 cat >> confdefs.h <<EOF
2713 #define $ac_tr_func 1
2714 EOF
2715
2716 else
2717 echo "$ac_t""no" 1>&6
2718 fi
2719 done
2720
2721 fi
2722
2723 for v in $vars; do
2724 echo $ac_n "checking for $v""... $ac_c" 1>&6
2725 echo "configure:2726: checking for $v" >&5
2726 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
2727 echo $ac_n "(cached) $ac_c" 1>&6
2728 else
2729 cat > conftest.$ac_ext <<EOF
2730 #line 2731 "configure"
2731 #include "confdefs.h"
2732 int *p;
2733 int main() {
2734 extern int $v []; p = $v;
2735 ; return 0; }
2736 EOF
2737 if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2738 rm -rf conftest*
2739 eval "libiberty_cv_var_$v=yes"
2740 else
2741 echo "configure: failed program was:" >&5
2742 cat conftest.$ac_ext >&5
2743 rm -rf conftest*
2744 eval "libiberty_cv_var_$v=no"
2745 fi
2746 rm -f conftest*
2747 fi
2748
2749 if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
2750 echo "$ac_t""yes" 1>&6
2751 n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2752 cat >> confdefs.h <<EOF
2753 #define $n 1
2754 EOF
2755
2756 else
2757 echo "$ac_t""no" 1>&6
2758 fi
2759 done
2760
2761 # special check for _system_configuration because AIX <4.3.2 do not
2762 # contain the `physmem' member.
2763 echo $ac_n "checking for external symbol _system_configuration""... $ac_c" 1>&6
2764 echo "configure:2765: checking for external symbol _system_configuration" >&5
2765 cat > conftest.$ac_ext <<EOF
2766 #line 2767 "configure"
2767 #include "confdefs.h"
2768 #include <sys/systemcfg.h>
2769 int main() {
2770 double x = _system_configuration.physmem;
2771 ; return 0; }
2772 EOF
2773 if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2774 rm -rf conftest*
2775 echo "$ac_t""yes" 1>&6
2776 cat >> confdefs.h <<\EOF
2777 #define HAVE__SYSTEM_CONFIGURATION 1
2778 EOF
2779
2780 else
2781 echo "configure: failed program was:" >&5
2782 cat conftest.$ac_ext >&5
2783 rm -rf conftest*
2784 echo "$ac_t""no" 1>&6
2785 fi
2786 rm -f conftest*
2787
2788 for ac_func in $checkfuncs
2789 do
2790 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2791 echo "configure:2792: checking for $ac_func" >&5
2792 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2793 echo $ac_n "(cached) $ac_c" 1>&6
2794 else
2795 cat > conftest.$ac_ext <<EOF
2796 #line 2797 "configure"
2797 #include "confdefs.h"
2798 /* System header to define __stub macros and hopefully few prototypes,
2799 which can conflict with char $ac_func(); below. */
2800 #include <assert.h>
2801 /* Override any gcc2 internal prototype to avoid an error. */
2802 /* We use char because int might match the return type of a gcc2
2803 builtin and then its argument prototype would still apply. */
2804 char $ac_func();
2805
2806 int main() {
2807
2808 /* The GNU C library defines this for functions which it implements
2809 to always fail with ENOSYS. Some functions are actually named
2810 something starting with __ and the normal name is an alias. */
2811 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2812 choke me
2813 #else
2814 $ac_func();
2815 #endif
2816
2817 ; return 0; }
2818 EOF
2819 if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2820 rm -rf conftest*
2821 eval "ac_cv_func_$ac_func=yes"
2822 else
2823 echo "configure: failed program was:" >&5
2824 cat conftest.$ac_ext >&5
2825 rm -rf conftest*
2826 eval "ac_cv_func_$ac_func=no"
2827 fi
2828 rm -f conftest*
2829 fi
2830
2831 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2832 echo "$ac_t""yes" 1>&6
2833 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2834 cat >> confdefs.h <<EOF
2835 #define $ac_tr_func 1
2836 EOF
2837
2838 else
2839 echo "$ac_t""no" 1>&6
2840 fi
2841 done
2842
2843 echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
2844 echo "configure:2845: checking whether canonicalize_file_name must be declared" >&5
2845 if eval "test \"`echo '$''{'libiberty_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
2846 echo $ac_n "(cached) $ac_c" 1>&6
2847 else
2848 cat > conftest.$ac_ext <<EOF
2849 #line 2850 "configure"
2850 #include "confdefs.h"
2851
2852 #include "confdefs.h"
2853 #include <stdio.h>
2854 #ifdef HAVE_STRING_H
2855 #include <string.h>
2856 #else
2857 #ifdef HAVE_STRINGS_H
2858 #include <strings.h>
2859 #endif
2860 #endif
2861 #ifdef HAVE_STDLIB_H
2862 #include <stdlib.h>
2863 #endif
2864 #ifdef HAVE_UNISTD_H
2865 #include <unistd.h>
2866 #endif
2867 int main() {
2868 char *(*pfn) = (char *(*)) canonicalize_file_name
2869 ; return 0; }
2870 EOF
2871 if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2872 rm -rf conftest*
2873 libiberty_cv_decl_needed_canonicalize_file_name=no
2874 else
2875 echo "configure: failed program was:" >&5
2876 cat conftest.$ac_ext >&5
2877 rm -rf conftest*
2878 libiberty_cv_decl_needed_canonicalize_file_name=yes
2879 fi
2880 rm -f conftest*
2881 fi
2882
2883 echo "$ac_t""$libiberty_cv_decl_needed_canonicalize_file_name" 1>&6
2884 if test $libiberty_cv_decl_needed_canonicalize_file_name = yes; then
2885 cat >> confdefs.h <<\EOF
2886 #define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
2887 EOF
2888
2889 fi
2890
2891 fi
2892
2893 # Figure out which version of pexecute to use.
2894 case "${host}" in
2895 *-*-mingw* | *-*-winnt*) pexecute=pex-win32.o ;;
2896 *-*-msdosdjgpp*) pexecute=pex-djgpp.o ;;
2897 *-*-msdos*) pexecute=pex-msdos.o ;;
2898 *-*-os2-emx*) pexecute=pex-os2.o ;;
2899 *) pexecute=pex-unix.o ;;
2900 esac
2901
2902
2903 for ac_hdr in unistd.h
2904 do
2905 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2906 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2907 echo "configure:2908: checking for $ac_hdr" >&5
2908 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2909 echo $ac_n "(cached) $ac_c" 1>&6
2910 else
2911 cat > conftest.$ac_ext <<EOF
2912 #line 2913 "configure"
2913 #include "confdefs.h"
2914 #include <$ac_hdr>
2915 EOF
2916 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2917 { (eval echo configure:2918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2918 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2919 if test -z "$ac_err"; then
2920 rm -rf conftest*
2921 eval "ac_cv_header_$ac_safe=yes"
2922 else
2923 echo "$ac_err" >&5
2924 echo "configure: failed program was:" >&5
2925 cat conftest.$ac_ext >&5
2926 rm -rf conftest*
2927 eval "ac_cv_header_$ac_safe=no"
2928 fi
2929 rm -f conftest*
2930 fi
2931 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2932 echo "$ac_t""yes" 1>&6
2933 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2934 cat >> confdefs.h <<EOF
2935 #define $ac_tr_hdr 1
2936 EOF
2937
2938 else
2939 echo "$ac_t""no" 1>&6
2940 fi
2941 done
2942
2943 for ac_func in getpagesize
2944 do
2945 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2946 echo "configure:2947: checking for $ac_func" >&5
2947 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2948 echo $ac_n "(cached) $ac_c" 1>&6
2949 else
2950 cat > conftest.$ac_ext <<EOF
2951 #line 2952 "configure"
2952 #include "confdefs.h"
2953 /* System header to define __stub macros and hopefully few prototypes,
2954 which can conflict with char $ac_func(); below. */
2955 #include <assert.h>
2956 /* Override any gcc2 internal prototype to avoid an error. */
2957 /* We use char because int might match the return type of a gcc2
2958 builtin and then its argument prototype would still apply. */
2959 char $ac_func();
2960
2961 int main() {
2962
2963 /* The GNU C library defines this for functions which it implements
2964 to always fail with ENOSYS. Some functions are actually named
2965 something starting with __ and the normal name is an alias. */
2966 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2967 choke me
2968 #else
2969 $ac_func();
2970 #endif
2971
2972 ; return 0; }
2973 EOF
2974 if { (eval echo configure:2975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2975 rm -rf conftest*
2976 eval "ac_cv_func_$ac_func=yes"
2977 else
2978 echo "configure: failed program was:" >&5
2979 cat conftest.$ac_ext >&5
2980 rm -rf conftest*
2981 eval "ac_cv_func_$ac_func=no"
2982 fi
2983 rm -f conftest*
2984 fi
2985
2986 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2987 echo "$ac_t""yes" 1>&6
2988 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2989 cat >> confdefs.h <<EOF
2990 #define $ac_tr_func 1
2991 EOF
2992
2993 else
2994 echo "$ac_t""no" 1>&6
2995 fi
2996 done
2997
2998 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
2999 echo "configure:3000: checking for working mmap" >&5
3000 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
3001 echo $ac_n "(cached) $ac_c" 1>&6
3002 else
3003 if test "$cross_compiling" = yes; then
3004 ac_cv_func_mmap_fixed_mapped=no
3005 else
3006 cat > conftest.$ac_ext <<EOF
3007 #line 3008 "configure"
3008 #include "confdefs.h"
3009
3010 /* Thanks to Mike Haertel and Jim Avera for this test.
3011 Here is a matrix of mmap possibilities:
3012 mmap private not fixed
3013 mmap private fixed at somewhere currently unmapped
3014 mmap private fixed at somewhere already mapped
3015 mmap shared not fixed
3016 mmap shared fixed at somewhere currently unmapped
3017 mmap shared fixed at somewhere already mapped
3018 For private mappings, we should verify that changes cannot be read()
3019 back from the file, nor mmap's back from the file at a different
3020 address. (There have been systems where private was not correctly
3021 implemented like the infamous i386 svr4.0, and systems where the
3022 VM page cache was not coherent with the filesystem buffer cache
3023 like early versions of FreeBSD and possibly contemporary NetBSD.)
3024 For shared mappings, we should conversely verify that changes get
3025 propogated back to all the places they're supposed to be.
3026
3027 Grep wants private fixed already mapped.
3028 The main things grep needs to know about mmap are:
3029 * does it exist and is it safe to write into the mmap'd area
3030 * how to use it (BSD variants) */
3031 #include <sys/types.h>
3032 #include <fcntl.h>
3033 #include <sys/mman.h>
3034
3035 /* This mess was copied from the GNU getpagesize.h. */
3036 #ifndef HAVE_GETPAGESIZE
3037 # ifdef HAVE_UNISTD_H
3038 # include <unistd.h>
3039 # endif
3040
3041 /* Assume that all systems that can run configure have sys/param.h. */
3042 # ifndef HAVE_SYS_PARAM_H
3043 # define HAVE_SYS_PARAM_H 1
3044 # endif
3045
3046 # ifdef _SC_PAGESIZE
3047 # define getpagesize() sysconf(_SC_PAGESIZE)
3048 # else /* no _SC_PAGESIZE */
3049 # ifdef HAVE_SYS_PARAM_H
3050 # include <sys/param.h>
3051 # ifdef EXEC_PAGESIZE
3052 # define getpagesize() EXEC_PAGESIZE
3053 # else /* no EXEC_PAGESIZE */
3054 # ifdef NBPG
3055 # define getpagesize() NBPG * CLSIZE
3056 # ifndef CLSIZE
3057 # define CLSIZE 1
3058 # endif /* no CLSIZE */
3059 # else /* no NBPG */
3060 # ifdef NBPC
3061 # define getpagesize() NBPC
3062 # else /* no NBPC */
3063 # ifdef PAGESIZE
3064 # define getpagesize() PAGESIZE
3065 # endif /* PAGESIZE */
3066 # endif /* no NBPC */
3067 # endif /* no NBPG */
3068 # endif /* no EXEC_PAGESIZE */
3069 # else /* no HAVE_SYS_PARAM_H */
3070 # define getpagesize() 8192 /* punt totally */
3071 # endif /* no HAVE_SYS_PARAM_H */
3072 # endif /* no _SC_PAGESIZE */
3073
3074 #endif /* no HAVE_GETPAGESIZE */
3075
3076 #ifdef __cplusplus
3077 extern "C" { void *malloc(unsigned); }
3078 #else
3079 char *malloc();
3080 #endif
3081
3082 int
3083 main()
3084 {
3085 char *data, *data2, *data3;
3086 int i, pagesize;
3087 int fd;
3088
3089 pagesize = getpagesize();
3090
3091 /*
3092 * First, make a file with some known garbage in it.
3093 */
3094 data = malloc(pagesize);
3095 if (!data)
3096 exit(1);
3097 for (i = 0; i < pagesize; ++i)
3098 *(data + i) = rand();
3099 umask(0);
3100 fd = creat("conftestmmap", 0600);
3101 if (fd < 0)
3102 exit(1);
3103 if (write(fd, data, pagesize) != pagesize)
3104 exit(1);
3105 close(fd);
3106
3107 /*
3108 * Next, try to mmap the file at a fixed address which
3109 * already has something else allocated at it. If we can,
3110 * also make sure that we see the same garbage.
3111 */
3112 fd = open("conftestmmap", O_RDWR);
3113 if (fd < 0)
3114 exit(1);
3115 data2 = malloc(2 * pagesize);
3116 if (!data2)
3117 exit(1);
3118 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
3119 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
3120 MAP_PRIVATE | MAP_FIXED, fd, 0L))
3121 exit(1);
3122 for (i = 0; i < pagesize; ++i)
3123 if (*(data + i) != *(data2 + i))
3124 exit(1);
3125
3126 /*
3127 * Finally, make sure that changes to the mapped area
3128 * do not percolate back to the file as seen by read().
3129 * (This is a bug on some variants of i386 svr4.0.)
3130 */
3131 for (i = 0; i < pagesize; ++i)
3132 *(data2 + i) = *(data2 + i) + 1;
3133 data3 = malloc(pagesize);
3134 if (!data3)
3135 exit(1);
3136 if (read(fd, data3, pagesize) != pagesize)
3137 exit(1);
3138 for (i = 0; i < pagesize; ++i)
3139 if (*(data + i) != *(data3 + i))
3140 exit(1);
3141 close(fd);
3142 unlink("conftestmmap");
3143 exit(0);
3144 }
3145
3146 EOF
3147 if { (eval echo configure:3148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3148 then
3149 ac_cv_func_mmap_fixed_mapped=yes
3150 else
3151 echo "configure: failed program was:" >&5
3152 cat conftest.$ac_ext >&5
3153 rm -fr conftest*
3154 ac_cv_func_mmap_fixed_mapped=no
3155 fi
3156 rm -fr conftest*
3157 fi
3158
3159 fi
3160
3161 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
3162 if test $ac_cv_func_mmap_fixed_mapped = yes; then
3163 cat >> confdefs.h <<\EOF
3164 #define HAVE_MMAP 1
3165 EOF
3166
3167 fi
3168
3169
3170 echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
3171 echo "configure:3172: checking for working strncmp" >&5
3172 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
3173 echo $ac_n "(cached) $ac_c" 1>&6
3174 else
3175 if test "$cross_compiling" = yes; then
3176 ac_cv_func_strncmp_works=no
3177 else
3178 cat > conftest.$ac_ext <<EOF
3179 #line 3180 "configure"
3180 #include "confdefs.h"
3181
3182 /* Test by Jim Wilson and Kaveh Ghazi.
3183 Check whether strncmp reads past the end of its string parameters. */
3184 #include <sys/types.h>
3185
3186 #ifdef HAVE_FCNTL_H
3187 #include <fcntl.h>
3188 #endif
3189
3190 #ifdef HAVE_SYS_MMAN_H
3191 #include <sys/mman.h>
3192 #endif
3193
3194 #ifndef MAP_ANON
3195 #ifdef MAP_ANONYMOUS
3196 #define MAP_ANON MAP_ANONYMOUS
3197 #else
3198 #define MAP_ANON MAP_FILE
3199 #endif
3200 #endif
3201
3202 #ifndef MAP_FILE
3203 #define MAP_FILE 0
3204 #endif
3205 #ifndef O_RDONLY
3206 #define O_RDONLY 0
3207 #endif
3208
3209 #define MAP_LEN 0x10000
3210
3211 main ()
3212 {
3213 #if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
3214 char *p;
3215 int dev_zero;
3216
3217 dev_zero = open ("/dev/zero", O_RDONLY);
3218 if (dev_zero < 0)
3219 exit (1);
3220
3221 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
3222 MAP_ANON|MAP_PRIVATE, dev_zero, 0);
3223 if (p == (char *)-1)
3224 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
3225 MAP_ANON|MAP_PRIVATE, -1, 0);
3226 if (p == (char *)-1)
3227 exit (2);
3228 else
3229 {
3230 char *string = "__si_type_info";
3231 char *q = (char *) p + MAP_LEN - strlen (string) - 2;
3232 char *r = (char *) p + 0xe;
3233
3234 strcpy (q, string);
3235 strcpy (r, string);
3236 strncmp (r, q, 14);
3237 }
3238 #endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
3239 exit (0);
3240 }
3241
3242 EOF
3243 if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3244 then
3245 ac_cv_func_strncmp_works=yes
3246 else
3247 echo "configure: failed program was:" >&5
3248 cat conftest.$ac_ext >&5
3249 rm -fr conftest*
3250 ac_cv_func_strncmp_works=no
3251 fi
3252 rm -fr conftest*
3253 fi
3254
3255 rm -f core core.* *.core
3256 fi
3257
3258 echo "$ac_t""$ac_cv_func_strncmp_works" 1>&6
3259 if test $ac_cv_func_strncmp_works = no ; then
3260 LIBOBJS="$LIBOBJS strncmp.o"
3261 fi
3262
3263
3264 # Install a library built with a cross compiler in $(tooldir) rather
3265 # than $(libdir).
3266 if test -z "${with_cross_host}"; then
3267 INSTALL_DEST=libdir
3268 else
3269 INSTALL_DEST=tooldir
3270 fi
3271
3272
3273 # We need multilib support, but only if configuring for the target.
3274 trap '' 1 2 15
3275 cat > confcache <<\EOF
3276 # This file is a shell script that caches the results of configure
3277 # tests run on this system so they can be shared between configure
3278 # scripts and configure runs. It is not useful on other systems.
3279 # If it contains results you don't want to keep, you may remove or edit it.
3280 #
3281 # By default, configure uses ./config.cache as the cache file,
3282 # creating it if it does not exist already. You can give configure
3283 # the --cache-file=FILE option to use a different cache file; that is
3284 # what configure does when it calls configure scripts in
3285 # subdirectories, so they share the cache.
3286 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3287 # config.status only pays attention to the cache file if you give it the
3288 # --recheck option to rerun configure.
3289 #
3290 EOF
3291 # The following way of writing the cache mishandles newlines in values,
3292 # but we know of no workaround that is simple, portable, and efficient.
3293 # So, don't put newlines in cache variables' values.
3294 # Ultrix sh set writes to stderr and can't be redirected directly,
3295 # and sets the high bit in the cache file unless we assign to the vars.
3296 (set) 2>&1 |
3297 case `(ac_space=' '; set | grep ac_space) 2>&1` in
3298 *ac_space=\ *)
3299 # `set' does not quote correctly, so add quotes (double-quote substitution
3300 # turns \\\\ into \\, and sed turns \\ into \).
3301 sed -n \
3302 -e "s/'/'\\\\''/g" \
3303 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3304 ;;
3305 *)
3306 # `set' quotes correctly as required by POSIX, so do not add quotes.
3307 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3308 ;;
3309 esac >> confcache
3310 if cmp -s $cache_file confcache; then
3311 :
3312 else
3313 if test -w $cache_file; then
3314 echo "updating cache $cache_file"
3315 cat confcache > $cache_file
3316 else
3317 echo "not updating unwritable cache $cache_file"
3318 fi
3319 fi
3320 rm -f confcache
3321
3322 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3323
3324 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3325 # Let make expand exec_prefix.
3326 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3327
3328 # Any assignment to VPATH causes Sun make to only execute
3329 # the first set of double-colon rules, so remove it if not needed.
3330 # If there is a colon in the path, we need to keep it.
3331 if test "x$srcdir" = x.; then
3332 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
3333 fi
3334
3335 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3336
3337 DEFS=-DHAVE_CONFIG_H
3338
3339 # Without the "./", some shells look in PATH for config.status.
3340 : ${CONFIG_STATUS=./config.status}
3341
3342 echo creating $CONFIG_STATUS
3343 rm -f $CONFIG_STATUS
3344 cat > $CONFIG_STATUS <<EOF
3345 #! /bin/sh
3346 # Generated automatically by configure.
3347 # Run this file to recreate the current configuration.
3348 # This directory was configured as follows,
3349 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3350 #
3351 # $0 $ac_configure_args
3352 #
3353 # Compiler output produced by configure, useful for debugging
3354 # configure, is in ./config.log if it exists.
3355
3356 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3357 for ac_option
3358 do
3359 case "\$ac_option" in
3360 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3361 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3362 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3363 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3364 echo "$CONFIG_STATUS generated by autoconf version 2.13"
3365 exit 0 ;;
3366 -help | --help | --hel | --he | --h)
3367 echo "\$ac_cs_usage"; exit 0 ;;
3368 *) echo "\$ac_cs_usage"; exit 1 ;;
3369 esac
3370 done
3371
3372 ac_given_srcdir=$srcdir
3373 ac_given_INSTALL="$INSTALL"
3374
3375 trap 'rm -fr `echo "Makefile testsuite/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3376 EOF
3377 cat >> $CONFIG_STATUS <<EOF
3378
3379 # Protect against being on the right side of a sed subst in config.status.
3380 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3381 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3382 $ac_vpsub
3383 $extrasub
3384 s%@SHELL@%$SHELL%g
3385 s%@CFLAGS@%$CFLAGS%g
3386 s%@CPPFLAGS@%$CPPFLAGS%g
3387 s%@CXXFLAGS@%$CXXFLAGS%g
3388 s%@FFLAGS@%$FFLAGS%g
3389 s%@DEFS@%$DEFS%g
3390 s%@LDFLAGS@%$LDFLAGS%g
3391 s%@LIBS@%$LIBS%g
3392 s%@exec_prefix@%$exec_prefix%g
3393 s%@prefix@%$prefix%g
3394 s%@program_transform_name@%$program_transform_name%g
3395 s%@bindir@%$bindir%g
3396 s%@sbindir@%$sbindir%g
3397 s%@libexecdir@%$libexecdir%g
3398 s%@datadir@%$datadir%g
3399 s%@sysconfdir@%$sysconfdir%g
3400 s%@sharedstatedir@%$sharedstatedir%g
3401 s%@localstatedir@%$localstatedir%g
3402 s%@libdir@%$libdir%g
3403 s%@includedir@%$includedir%g
3404 s%@oldincludedir@%$oldincludedir%g
3405 s%@infodir@%$infodir%g
3406 s%@mandir@%$mandir%g
3407 s%@libiberty_topdir@%$libiberty_topdir%g
3408 s%@MAINT@%$MAINT%g
3409 s%@NOTMAINT@%$NOTMAINT%g
3410 s%@MAKEINFO@%$MAKEINFO%g
3411 s%@BUILD_INFO@%$BUILD_INFO%g
3412 s%@PERL@%$PERL%g
3413 s%@HAVE_PERL@%$HAVE_PERL%g
3414 s%@host@%$host%g
3415 s%@host_alias@%$host_alias%g
3416 s%@host_cpu@%$host_cpu%g
3417 s%@host_vendor@%$host_vendor%g
3418 s%@host_os@%$host_os%g
3419 s%@build@%$build%g
3420 s%@build_alias@%$build_alias%g
3421 s%@build_cpu@%$build_cpu%g
3422 s%@build_vendor@%$build_vendor%g
3423 s%@build_os@%$build_os%g
3424 s%@AR@%$AR%g
3425 s%@RANLIB@%$RANLIB%g
3426 s%@CC@%$CC%g
3427 s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g
3428 s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
3429 s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
3430 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3431 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
3432 s%@INSTALL_DATA@%$INSTALL_DATA%g
3433 /@host_makefile_frag@/r $host_makefile_frag
3434 s%@host_makefile_frag@%%g
3435 s%@CPP@%$CPP%g
3436 s%@CHECK@%$CHECK%g
3437 s%@target_header_dir@%$target_header_dir%g
3438 s%@LIBOBJS@%$LIBOBJS%g
3439 s%@pexecute@%$pexecute%g
3440 s%@INSTALL_DEST@%$INSTALL_DEST%g
3441
3442 CEOF
3443 EOF
3444
3445 cat >> $CONFIG_STATUS <<\EOF
3446
3447 # Split the substitutions into bite-sized pieces for seds with
3448 # small command number limits, like on Digital OSF/1 and HP-UX.
3449 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3450 ac_file=1 # Number of current file.
3451 ac_beg=1 # First line for current file.
3452 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3453 ac_more_lines=:
3454 ac_sed_cmds=""
3455 while $ac_more_lines; do
3456 if test $ac_beg -gt 1; then
3457 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3458 else
3459 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3460 fi
3461 if test ! -s conftest.s$ac_file; then
3462 ac_more_lines=false
3463 rm -f conftest.s$ac_file
3464 else
3465 if test -z "$ac_sed_cmds"; then
3466 ac_sed_cmds="sed -f conftest.s$ac_file"
3467 else
3468 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3469 fi
3470 ac_file=`expr $ac_file + 1`
3471 ac_beg=$ac_end
3472 ac_end=`expr $ac_end + $ac_max_sed_cmds`
3473 fi
3474 done
3475 if test -z "$ac_sed_cmds"; then
3476 ac_sed_cmds=cat
3477 fi
3478 EOF
3479
3480 cat >> $CONFIG_STATUS <<EOF
3481
3482 CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
3483 EOF
3484 cat >> $CONFIG_STATUS <<\EOF
3485 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3486 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3487 case "$ac_file" in
3488 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3489 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3490 *) ac_file_in="${ac_file}.in" ;;
3491 esac
3492
3493 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3494
3495 # Remove last slash and all that follows it. Not all systems have dirname.
3496 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3497 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3498 # The file is in a subdirectory.
3499 test ! -d "$ac_dir" && mkdir "$ac_dir"
3500 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3501 # A "../" for each directory in $ac_dir_suffix.
3502 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3503 else
3504 ac_dir_suffix= ac_dots=
3505 fi
3506
3507 case "$ac_given_srcdir" in
3508 .) srcdir=.
3509 if test -z "$ac_dots"; then top_srcdir=.
3510 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3511 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3512 *) # Relative path.
3513 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3514 top_srcdir="$ac_dots$ac_given_srcdir" ;;
3515 esac
3516
3517 case "$ac_given_INSTALL" in
3518 [/$]*) INSTALL="$ac_given_INSTALL" ;;
3519 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3520 esac
3521
3522 echo creating "$ac_file"
3523 rm -f "$ac_file"
3524 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3525 case "$ac_file" in
3526 *Makefile*) ac_comsub="1i\\
3527 # $configure_input" ;;
3528 *) ac_comsub= ;;
3529 esac
3530
3531 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3532 sed -e "$ac_comsub
3533 s%@configure_input@%$configure_input%g
3534 s%@srcdir@%$srcdir%g
3535 s%@top_srcdir@%$top_srcdir%g
3536 s%@INSTALL@%$INSTALL%g
3537 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3538 fi; done
3539 rm -f conftest.s*
3540
3541 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3542 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3543 #
3544 # ac_d sets the value in "#define NAME VALUE" lines.
3545 ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
3546 ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
3547 ac_dC='\3'
3548 ac_dD='%g'
3549 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3550 ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3551 ac_uB='\([ ]\)%\1#\2define\3'
3552 ac_uC=' '
3553 ac_uD='\4%g'
3554 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3555 ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3556 ac_eB='$%\1#\2define\3'
3557 ac_eC=' '
3558 ac_eD='%g'
3559
3560 if test "${CONFIG_HEADERS+set}" != set; then
3561 EOF
3562 cat >> $CONFIG_STATUS <<EOF
3563 CONFIG_HEADERS="config.h:config.in"
3564 EOF
3565 cat >> $CONFIG_STATUS <<\EOF
3566 fi
3567 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3568 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3569 case "$ac_file" in
3570 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3571 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3572 *) ac_file_in="${ac_file}.in" ;;
3573 esac
3574
3575 echo creating $ac_file
3576
3577 rm -f conftest.frag conftest.in conftest.out
3578 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3579 cat $ac_file_inputs > conftest.in
3580
3581 EOF
3582
3583 # Transform confdefs.h into a sed script conftest.vals that substitutes
3584 # the proper values into config.h.in to produce config.h. And first:
3585 # Protect against being on the right side of a sed subst in config.status.
3586 # Protect against being in an unquoted here document in config.status.
3587 rm -f conftest.vals
3588 cat > conftest.hdr <<\EOF
3589 s/[\\&%]/\\&/g
3590 s%[\\$`]%\\&%g
3591 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3592 s%ac_d%ac_u%gp
3593 s%ac_u%ac_e%gp
3594 EOF
3595 sed -n -f conftest.hdr confdefs.h > conftest.vals
3596 rm -f conftest.hdr
3597
3598 # This sed command replaces #undef with comments. This is necessary, for
3599 # example, in the case of _POSIX_SOURCE, which is predefined and required
3600 # on some systems where configure will not decide to define it.
3601 cat >> conftest.vals <<\EOF
3602 s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3603 EOF
3604
3605 # Break up conftest.vals because some shells have a limit on
3606 # the size of here documents, and old seds have small limits too.
3607
3608 rm -f conftest.tail
3609 while :
3610 do
3611 ac_lines=`grep -c . conftest.vals`
3612 # grep -c gives empty output for an empty file on some AIX systems.
3613 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3614 # Write a limited-size here document to conftest.frag.
3615 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3616 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3617 echo 'CEOF
3618 sed -f conftest.frag conftest.in > conftest.out
3619 rm -f conftest.in
3620 mv conftest.out conftest.in
3621 ' >> $CONFIG_STATUS
3622 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3623 rm -f conftest.vals
3624 mv conftest.tail conftest.vals
3625 done
3626 rm -f conftest.vals
3627
3628 cat >> $CONFIG_STATUS <<\EOF
3629 rm -f conftest.frag conftest.h
3630 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
3631 cat conftest.in >> conftest.h
3632 rm -f conftest.in
3633 if cmp -s $ac_file conftest.h 2>/dev/null; then
3634 echo "$ac_file is unchanged"
3635 rm -f conftest.h
3636 else
3637 # Remove last slash and all that follows it. Not all systems have dirname.
3638 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3639 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3640 # The file is in a subdirectory.
3641 test ! -d "$ac_dir" && mkdir "$ac_dir"
3642 fi
3643 rm -f $ac_file
3644 mv conftest.h $ac_file
3645 fi
3646 fi; done
3647
3648 EOF
3649 cat >> $CONFIG_STATUS <<EOF
3650 srcdir=${srcdir}
3651 host=${host}
3652 target=${target}
3653 with_target_subdir=${with_target_subdir}
3654 with_build_subdir=${with_build_subdir}
3655 with_multisubdir=${with_multisubdir}
3656 ac_configure_args="--enable-multilib ${ac_configure_args}"
3657 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3658 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
3659 libiberty_topdir=${libiberty_topdir}
3660
3661 EOF
3662 cat >> $CONFIG_STATUS <<\EOF
3663 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
3664 if test -n "$CONFIG_FILES"; then
3665 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
3666 # FIXME: We shouldn't need to set ac_file
3667 ac_file=Makefile
3668 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
3669 . ${libiberty_topdir}/config-ml.in
3670 fi
3671 fi
3672 exit 0
3673 EOF
3674 chmod +x $CONFIG_STATUS
3675 rm -fr confdefs* $ac_clean_files
3676 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3677
This page took 0.154823 seconds and 5 git commands to generate.