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