2002-11-27 David O'Brien <obrien@FreeBSD.org>
[deliverable/binutils-gdb.git] / gdb / configure
CommitLineData
c906108c
SS
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:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
413ccac7
AC
14ac_help="$ac_help
15 --enable-maintainer-mode enable make rules and dependencies not useful
16 (and sometimes confusing) to the casual installer"
c906108c
SS
17ac_help="$ac_help
18 --disable-nls do not use Native Language Support"
19ac_help="$ac_help
20 --with-included-gettext use the GNU gettext library included here"
96baa820
JM
21ac_help="$ac_help
22 --enable-multi-ice Build the multi-ice-gdb-server"
d318976c
FN
23ac_help="$ac_help
24 --enable-gdbcli Enable GDB-CLI interface"
fb40c209
AC
25ac_help="$ac_help
26 --enable-gdbmi Enable GDB-MI interface"
b4df4f68 27ac_help="$ac_help
6c5cfe5b 28 --with-uiout Use new uiout functions instead of *printf's"
c906108c
SS
29ac_help="$ac_help
30 --enable-tui Enable full-screen terminal user interface"
31ac_help="$ac_help
32 --enable-netrom Enable NetROM support"
33ac_help="$ac_help
34 --enable-build-warnings Enable build-time compiler warnings if gcc is used"
3b851bce
AC
35ac_help="$ac_help
36 --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used"
c906108c
SS
37ac_help="$ac_help
38 --with-mmalloc Use memory mapped malloc package"
88987551
L
39ac_help="$ac_help
40 --with-included-regex Use included regex"
7a292a7a
SS
41ac_help="$ac_help
42 --with-cpu=CPU Set the default CPU variant to debug"
43ac_help="$ac_help
44 --enable-gdbtk Enable GDBTK GUI front end"
45ac_help="$ac_help
46 --with-tclconfig=DIR Directory containing tcl configuration (tclConfig.sh)"
47ac_help="$ac_help
48 --with-tkconfig=DIR Directory containing tk configuration (tkConfig.sh)"
49ac_help="$ac_help
50 --with-tclinclude=DIR Directory where tcl private headers are"
51ac_help="$ac_help
52 --with-tkinclude=DIR Directory where tk private headers are"
53ac_help="$ac_help
54 --with-itclconfig Directory containing itcl configuration (itclConfig.sh)"
55ac_help="$ac_help
56 --with-itkconfig Directory containing itk configuration (itkConfig.sh)"
c906108c
SS
57ac_help="$ac_help
58 --with-x use the X Window System"
7a292a7a
SS
59ac_help="$ac_help
60 --enable-sim Link gdb with simulator"
c906108c
SS
61ac_help="$ac_help
62 --enable-shared Use shared libraries"
234b45d4
KB
63ac_help="$ac_help
64 --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib"
c906108c
SS
65
66# Initialize some variables set by options.
67# The variables have the same names as the options, with
68# dashes changed to underlines.
69build=NONE
70cache_file=./config.cache
71exec_prefix=NONE
72host=NONE
73no_create=
74nonopt=NONE
75no_recursion=
76prefix=NONE
77program_prefix=NONE
78program_suffix=NONE
79program_transform_name=s,x,x,
80silent=
81site=
82srcdir=
83target=NONE
84verbose=
85x_includes=NONE
86x_libraries=NONE
87bindir='${exec_prefix}/bin'
88sbindir='${exec_prefix}/sbin'
89libexecdir='${exec_prefix}/libexec'
90datadir='${prefix}/share'
91sysconfdir='${prefix}/etc'
92sharedstatedir='${prefix}/com'
93localstatedir='${prefix}/var'
94libdir='${exec_prefix}/lib'
95includedir='${prefix}/include'
96oldincludedir='/usr/include'
97infodir='${prefix}/info'
98mandir='${prefix}/man'
99
100# Initialize some other variables.
101subdirs=
102MFLAGS= MAKEFLAGS=
103SHELL=${CONFIG_SHELL-/bin/sh}
104# Maximum number of lines to put in a shell here document.
105ac_max_here_lines=12
106
107ac_prev=
108for ac_option
109do
110
111 # If the previous option needs an argument, assign it.
112 if test -n "$ac_prev"; then
113 eval "$ac_prev=\$ac_option"
114 ac_prev=
115 continue
116 fi
117
118 case "$ac_option" in
119 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
120 *) ac_optarg= ;;
121 esac
122
123 # Accept the important Cygnus configure options, so we can diagnose typos.
124
125 case "$ac_option" in
126
127 -bindir | --bindir | --bindi | --bind | --bin | --bi)
128 ac_prev=bindir ;;
129 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
130 bindir="$ac_optarg" ;;
131
132 -build | --build | --buil | --bui | --bu)
133 ac_prev=build ;;
134 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
135 build="$ac_optarg" ;;
136
137 -cache-file | --cache-file | --cache-fil | --cache-fi \
138 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
139 ac_prev=cache_file ;;
140 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
141 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
142 cache_file="$ac_optarg" ;;
143
144 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
145 ac_prev=datadir ;;
146 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
147 | --da=*)
148 datadir="$ac_optarg" ;;
149
150 -disable-* | --disable-*)
151 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
152 # Reject names that are not valid shell variable names.
153 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
154 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
155 fi
156 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
157 eval "enable_${ac_feature}=no" ;;
158
159 -enable-* | --enable-*)
160 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
161 # Reject names that are not valid shell variable names.
162 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
163 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
164 fi
165 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
166 case "$ac_option" in
167 *=*) ;;
168 *) ac_optarg=yes ;;
169 esac
170 eval "enable_${ac_feature}='$ac_optarg'" ;;
171
172 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
173 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
174 | --exec | --exe | --ex)
175 ac_prev=exec_prefix ;;
176 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
177 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
178 | --exec=* | --exe=* | --ex=*)
179 exec_prefix="$ac_optarg" ;;
180
181 -gas | --gas | --ga | --g)
182 # Obsolete; use --with-gas.
183 with_gas=yes ;;
184
185 -help | --help | --hel | --he)
186 # Omit some internal or obsolete options to make the list less imposing.
187 # This message is too long to be a string in the A/UX 3.1 sh.
188 cat << EOF
189Usage: configure [options] [host]
190Options: [defaults in brackets after descriptions]
191Configuration:
192 --cache-file=FILE cache test results in FILE
193 --help print this message
194 --no-create do not create output files
195 --quiet, --silent do not print \`checking...' messages
196 --version print the version of autoconf that created configure
197Directory and file names:
198 --prefix=PREFIX install architecture-independent files in PREFIX
199 [$ac_default_prefix]
200 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
201 [same as prefix]
202 --bindir=DIR user executables in DIR [EPREFIX/bin]
203 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
204 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
205 --datadir=DIR read-only architecture-independent data in DIR
206 [PREFIX/share]
207 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
208 --sharedstatedir=DIR modifiable architecture-independent data in DIR
209 [PREFIX/com]
210 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
211 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
212 --includedir=DIR C header files in DIR [PREFIX/include]
213 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
214 --infodir=DIR info documentation in DIR [PREFIX/info]
215 --mandir=DIR man documentation in DIR [PREFIX/man]
216 --srcdir=DIR find the sources in DIR [configure dir or ..]
217 --program-prefix=PREFIX prepend PREFIX to installed program names
218 --program-suffix=SUFFIX append SUFFIX to installed program names
219 --program-transform-name=PROGRAM
220 run sed PROGRAM on installed program names
221EOF
222 cat << EOF
223Host type:
224 --build=BUILD configure for building on BUILD [BUILD=HOST]
225 --host=HOST configure for HOST [guessed]
226 --target=TARGET configure for TARGET [TARGET=HOST]
227Features and packages:
228 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
229 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
230 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
231 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
232 --x-includes=DIR X include files are in DIR
233 --x-libraries=DIR X library files are in DIR
234EOF
235 if test -n "$ac_help"; then
236 echo "--enable and --with options recognized:$ac_help"
237 fi
238 exit 0 ;;
239
240 -host | --host | --hos | --ho)
241 ac_prev=host ;;
242 -host=* | --host=* | --hos=* | --ho=*)
243 host="$ac_optarg" ;;
244
245 -includedir | --includedir | --includedi | --included | --include \
246 | --includ | --inclu | --incl | --inc)
247 ac_prev=includedir ;;
248 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
249 | --includ=* | --inclu=* | --incl=* | --inc=*)
250 includedir="$ac_optarg" ;;
251
252 -infodir | --infodir | --infodi | --infod | --info | --inf)
253 ac_prev=infodir ;;
254 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
255 infodir="$ac_optarg" ;;
256
257 -libdir | --libdir | --libdi | --libd)
258 ac_prev=libdir ;;
259 -libdir=* | --libdir=* | --libdi=* | --libd=*)
260 libdir="$ac_optarg" ;;
261
262 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
263 | --libexe | --libex | --libe)
264 ac_prev=libexecdir ;;
265 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
266 | --libexe=* | --libex=* | --libe=*)
267 libexecdir="$ac_optarg" ;;
268
269 -localstatedir | --localstatedir | --localstatedi | --localstated \
270 | --localstate | --localstat | --localsta | --localst \
271 | --locals | --local | --loca | --loc | --lo)
272 ac_prev=localstatedir ;;
273 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
274 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
275 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
276 localstatedir="$ac_optarg" ;;
277
278 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
279 ac_prev=mandir ;;
280 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
281 mandir="$ac_optarg" ;;
282
283 -nfp | --nfp | --nf)
284 # Obsolete; use --without-fp.
285 with_fp=no ;;
286
287 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
288 | --no-cr | --no-c)
289 no_create=yes ;;
290
291 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
292 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
293 no_recursion=yes ;;
294
295 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
296 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
297 | --oldin | --oldi | --old | --ol | --o)
298 ac_prev=oldincludedir ;;
299 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
300 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
301 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
302 oldincludedir="$ac_optarg" ;;
303
304 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
305 ac_prev=prefix ;;
306 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
307 prefix="$ac_optarg" ;;
308
309 -program-prefix | --program-prefix | --program-prefi | --program-pref \
310 | --program-pre | --program-pr | --program-p)
311 ac_prev=program_prefix ;;
312 -program-prefix=* | --program-prefix=* | --program-prefi=* \
313 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
314 program_prefix="$ac_optarg" ;;
315
316 -program-suffix | --program-suffix | --program-suffi | --program-suff \
317 | --program-suf | --program-su | --program-s)
318 ac_prev=program_suffix ;;
319 -program-suffix=* | --program-suffix=* | --program-suffi=* \
320 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
321 program_suffix="$ac_optarg" ;;
322
323 -program-transform-name | --program-transform-name \
324 | --program-transform-nam | --program-transform-na \
325 | --program-transform-n | --program-transform- \
326 | --program-transform | --program-transfor \
327 | --program-transfo | --program-transf \
328 | --program-trans | --program-tran \
329 | --progr-tra | --program-tr | --program-t)
330 ac_prev=program_transform_name ;;
331 -program-transform-name=* | --program-transform-name=* \
332 | --program-transform-nam=* | --program-transform-na=* \
333 | --program-transform-n=* | --program-transform-=* \
334 | --program-transform=* | --program-transfor=* \
335 | --program-transfo=* | --program-transf=* \
336 | --program-trans=* | --program-tran=* \
337 | --progr-tra=* | --program-tr=* | --program-t=*)
338 program_transform_name="$ac_optarg" ;;
339
340 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
341 | -silent | --silent | --silen | --sile | --sil)
342 silent=yes ;;
343
344 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
345 ac_prev=sbindir ;;
346 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
347 | --sbi=* | --sb=*)
348 sbindir="$ac_optarg" ;;
349
350 -sharedstatedir | --sharedstatedir | --sharedstatedi \
351 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
352 | --sharedst | --shareds | --shared | --share | --shar \
353 | --sha | --sh)
354 ac_prev=sharedstatedir ;;
355 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
356 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
357 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
358 | --sha=* | --sh=*)
359 sharedstatedir="$ac_optarg" ;;
360
361 -site | --site | --sit)
362 ac_prev=site ;;
363 -site=* | --site=* | --sit=*)
364 site="$ac_optarg" ;;
365
366 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
367 ac_prev=srcdir ;;
368 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
369 srcdir="$ac_optarg" ;;
370
371 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
372 | --syscon | --sysco | --sysc | --sys | --sy)
373 ac_prev=sysconfdir ;;
374 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
375 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
376 sysconfdir="$ac_optarg" ;;
377
378 -target | --target | --targe | --targ | --tar | --ta | --t)
379 ac_prev=target ;;
380 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
381 target="$ac_optarg" ;;
382
383 -v | -verbose | --verbose | --verbos | --verbo | --verb)
384 verbose=yes ;;
385
386 -version | --version | --versio | --versi | --vers)
387 echo "configure generated by autoconf version 2.13"
388 exit 0 ;;
389
390 -with-* | --with-*)
391 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
392 # Reject names that are not valid shell variable names.
393 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
394 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
395 fi
396 ac_package=`echo $ac_package| sed 's/-/_/g'`
397 case "$ac_option" in
398 *=*) ;;
399 *) ac_optarg=yes ;;
400 esac
401 eval "with_${ac_package}='$ac_optarg'" ;;
402
403 -without-* | --without-*)
404 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
405 # Reject names that are not valid shell variable names.
406 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
407 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
408 fi
409 ac_package=`echo $ac_package| sed 's/-/_/g'`
410 eval "with_${ac_package}=no" ;;
411
412 --x)
413 # Obsolete; use --with-x.
414 with_x=yes ;;
415
416 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
417 | --x-incl | --x-inc | --x-in | --x-i)
418 ac_prev=x_includes ;;
419 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
420 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
421 x_includes="$ac_optarg" ;;
422
423 -x-libraries | --x-libraries | --x-librarie | --x-librari \
424 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
425 ac_prev=x_libraries ;;
426 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
427 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
428 x_libraries="$ac_optarg" ;;
429
430 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
431 ;;
432
433 *)
434 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
435 echo "configure: warning: $ac_option: invalid host type" 1>&2
436 fi
437 if test "x$nonopt" != xNONE; then
438 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
439 fi
440 nonopt="$ac_option"
441 ;;
442
443 esac
444done
445
446if test -n "$ac_prev"; then
447 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
448fi
449
450trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
451
452# File descriptor usage:
453# 0 standard input
454# 1 file creation
455# 2 errors and warnings
456# 3 some systems may open it to /dev/tty
457# 4 used on the Kubota Titan
458# 6 checking for... messages and results
459# 5 compiler messages saved in config.log
460if test "$silent" = yes; then
461 exec 6>/dev/null
462else
463 exec 6>&1
464fi
465exec 5>./config.log
466
467echo "\
468This file contains any messages produced by compilers while
469running configure, to aid debugging if configure makes a mistake.
470" 1>&5
471
472# Strip out --no-create and --no-recursion so they do not pile up.
473# Also quote any args containing shell metacharacters.
474ac_configure_args=
475for ac_arg
476do
477 case "$ac_arg" in
478 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
479 | --no-cr | --no-c) ;;
480 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
481 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
482 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
483 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
484 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
485 esac
486done
487
488# NLS nuisances.
489# Only set these to C if already set. These must not be set unconditionally
490# because not all systems understand e.g. LANG=C (notably SCO).
491# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
492# Non-C LC_CTYPE values break the ctype check.
493if test "${LANG+set}" = set; then LANG=C; export LANG; fi
494if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
495if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
496if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
497
498# confdefs.h avoids OS command line length limits that DEFS can exceed.
499rm -rf conftest* confdefs.h
500# AIX cpp loses on an empty file, so make sure it contains at least a newline.
501echo > confdefs.h
502
503# A filename unique to this package, relative to the directory that
504# configure is in, which we can look for to find out if srcdir is correct.
505ac_unique_file=main.c
506
507# Find the source files, if location was not specified.
508if test -z "$srcdir"; then
509 ac_srcdir_defaulted=yes
510 # Try the directory containing this script, then its parent.
511 ac_prog=$0
512 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
513 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
514 srcdir=$ac_confdir
515 if test ! -r $srcdir/$ac_unique_file; then
516 srcdir=..
517 fi
518else
519 ac_srcdir_defaulted=no
520fi
521if test ! -r $srcdir/$ac_unique_file; then
522 if test "$ac_srcdir_defaulted" = yes; then
523 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
524 else
525 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
526 fi
527fi
528srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
529
530# Prefer explicitly selected file to automatically selected ones.
b2a1bd4f
MH
531if test -z "$CONFIG_SITE"; then
532 if test "x$prefix" != xNONE; then
533 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
534 else
535 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
c906108c
SS
536 fi
537fi
538for ac_site_file in $CONFIG_SITE; do
539 if test -r "$ac_site_file"; then
540 echo "loading site script $ac_site_file"
541 . "$ac_site_file"
542 fi
543done
544
545if test -r "$cache_file"; then
546 echo "loading cache $cache_file"
547 . $cache_file
548else
549 echo "creating cache $cache_file"
550 > $cache_file
551fi
552
553ac_ext=c
554# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
555ac_cpp='$CPP $CPPFLAGS'
556ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
557ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
558cross_compiling=$ac_cv_prog_cc_cross
559
560ac_exeext=
561ac_objext=o
562if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
563 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
564 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
565 ac_n= ac_c='
566' ac_t=' '
567 else
568 ac_n=-n ac_c= ac_t=
569 fi
570else
571 ac_n= ac_c='\c' ac_t=
572fi
573
574
575
413ccac7 576echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
b2a1bd4f 577echo "configure:578: checking whether to enable maintainer-specific portions of Makefiles" >&5
413ccac7
AC
578 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
579if test "${enable_maintainer_mode+set}" = set; then
580 enableval="$enable_maintainer_mode"
581 USE_MAINTAINER_MODE=$enableval
582else
583 USE_MAINTAINER_MODE=no
584fi
585
586 echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
587
588
589if test $USE_MAINTAINER_MODE = yes; then
590 MAINTAINER_MODE_TRUE=
591 MAINTAINER_MODE_FALSE='#'
592else
593 MAINTAINER_MODE_TRUE='#'
594 MAINTAINER_MODE_FALSE=
595fi
596 MAINT=$MAINTAINER_MODE_TRUE
597
598
c906108c
SS
599
600# Extract the first word of "gcc", so it can be a program name with args.
601set dummy gcc; ac_word=$2
602echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
b2a1bd4f 603echo "configure:604: checking for $ac_word" >&5
c906108c
SS
604if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
605 echo $ac_n "(cached) $ac_c" 1>&6
606else
607 if test -n "$CC"; then
608 ac_cv_prog_CC="$CC" # Let the user override the test.
609else
610 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
611 ac_dummy="$PATH"
612 for ac_dir in $ac_dummy; do
613 test -z "$ac_dir" && ac_dir=.
614 if test -f $ac_dir/$ac_word; then
615 ac_cv_prog_CC="gcc"
616 break
617 fi
618 done
619 IFS="$ac_save_ifs"
620fi
621fi
622CC="$ac_cv_prog_CC"
623if test -n "$CC"; then
624 echo "$ac_t""$CC" 1>&6
625else
626 echo "$ac_t""no" 1>&6
627fi
628
629if test -z "$CC"; then
630 # Extract the first word of "cc", so it can be a program name with args.
631set dummy cc; ac_word=$2
632echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
b2a1bd4f 633echo "configure:634: checking for $ac_word" >&5
c906108c
SS
634if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
635 echo $ac_n "(cached) $ac_c" 1>&6
636else
637 if test -n "$CC"; then
638 ac_cv_prog_CC="$CC" # Let the user override the test.
639else
640 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
641 ac_prog_rejected=no
642 ac_dummy="$PATH"
643 for ac_dir in $ac_dummy; do
644 test -z "$ac_dir" && ac_dir=.
645 if test -f $ac_dir/$ac_word; then
646 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
647 ac_prog_rejected=yes
648 continue
649 fi
650 ac_cv_prog_CC="cc"
651 break
652 fi
653 done
654 IFS="$ac_save_ifs"
655if test $ac_prog_rejected = yes; then
656 # We found a bogon in the path, so make sure we never use it.
657 set dummy $ac_cv_prog_CC
658 shift
659 if test $# -gt 0; then
660 # We chose a different compiler from the bogus one.
661 # However, it has the same basename, so the bogon will be chosen
662 # first if we set CC to just the basename; use the full file name.
663 shift
664 set dummy "$ac_dir/$ac_word" "$@"
665 shift
666 ac_cv_prog_CC="$@"
667 fi
668fi
669fi
670fi
671CC="$ac_cv_prog_CC"
672if test -n "$CC"; then
673 echo "$ac_t""$CC" 1>&6
674else
675 echo "$ac_t""no" 1>&6
676fi
677
678 if test -z "$CC"; then
679 case "`uname -s`" in
680 *win32* | *WIN32*)
681 # Extract the first word of "cl", so it can be a program name with args.
682set dummy cl; ac_word=$2
683echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
b2a1bd4f 684echo "configure:685: checking for $ac_word" >&5
c906108c
SS
685if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
686 echo $ac_n "(cached) $ac_c" 1>&6
687else
688 if test -n "$CC"; then
689 ac_cv_prog_CC="$CC" # Let the user override the test.
690else
691 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
692 ac_dummy="$PATH"
693 for ac_dir in $ac_dummy; do
694 test -z "$ac_dir" && ac_dir=.
695 if test -f $ac_dir/$ac_word; then
696 ac_cv_prog_CC="cl"
697 break
698 fi
699 done
700 IFS="$ac_save_ifs"
701fi
702fi
703CC="$ac_cv_prog_CC"
704if test -n "$CC"; then
705 echo "$ac_t""$CC" 1>&6
706else
707 echo "$ac_t""no" 1>&6
708fi
709 ;;
710 esac
711 fi
712 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
713fi
714
715echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
b2a1bd4f 716echo "configure:717: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
c906108c
SS
717
718ac_ext=c
719# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
720ac_cpp='$CPP $CPPFLAGS'
721ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
722ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
723cross_compiling=$ac_cv_prog_cc_cross
724
725cat > conftest.$ac_ext << EOF
726
b2a1bd4f 727#line 728 "configure"
c906108c
SS
728#include "confdefs.h"
729
730main(){return(0);}
731EOF
b2a1bd4f 732if { (eval echo configure:733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
733 ac_cv_prog_cc_works=yes
734 # If we can't run a trivial program, we are probably using a cross compiler.
735 if (./conftest; exit) 2>/dev/null; then
736 ac_cv_prog_cc_cross=no
737 else
738 ac_cv_prog_cc_cross=yes
739 fi
740else
741 echo "configure: failed program was:" >&5
742 cat conftest.$ac_ext >&5
743 ac_cv_prog_cc_works=no
744fi
745rm -fr conftest*
746ac_ext=c
747# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
748ac_cpp='$CPP $CPPFLAGS'
749ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
750ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
751cross_compiling=$ac_cv_prog_cc_cross
752
753echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
754if test $ac_cv_prog_cc_works = no; then
755 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
756fi
757echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
b2a1bd4f 758echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
c906108c
SS
759echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
760cross_compiling=$ac_cv_prog_cc_cross
761
762echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
b2a1bd4f 763echo "configure:764: checking whether we are using GNU C" >&5
c906108c
SS
764if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
765 echo $ac_n "(cached) $ac_c" 1>&6
766else
767 cat > conftest.c <<EOF
768#ifdef __GNUC__
769 yes;
770#endif
771EOF
b2a1bd4f 772if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
c906108c
SS
773 ac_cv_prog_gcc=yes
774else
775 ac_cv_prog_gcc=no
776fi
777fi
778
779echo "$ac_t""$ac_cv_prog_gcc" 1>&6
780
781if test $ac_cv_prog_gcc = yes; then
782 GCC=yes
783else
784 GCC=
785fi
786
787ac_test_CFLAGS="${CFLAGS+set}"
788ac_save_CFLAGS="$CFLAGS"
789CFLAGS=
790echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
b2a1bd4f 791echo "configure:792: checking whether ${CC-cc} accepts -g" >&5
c906108c
SS
792if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
793 echo $ac_n "(cached) $ac_c" 1>&6
794else
795 echo 'void f(){}' > conftest.c
796if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
797 ac_cv_prog_cc_g=yes
798else
799 ac_cv_prog_cc_g=no
800fi
801rm -f conftest*
802
803fi
804
805echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
806if test "$ac_test_CFLAGS" = set; then
807 CFLAGS="$ac_save_CFLAGS"
808elif test $ac_cv_prog_cc_g = yes; then
809 if test "$GCC" = yes; then
810 CFLAGS="-g -O2"
811 else
812 CFLAGS="-g"
813 fi
814else
815 if test "$GCC" = yes; then
816 CFLAGS="-O2"
817 else
818 CFLAGS=
819 fi
820fi
821
822echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
b2a1bd4f 823echo "configure:824: checking how to run the C preprocessor" >&5
c906108c
SS
824# On Suns, sometimes $CPP names a directory.
825if test -n "$CPP" && test -d "$CPP"; then
826 CPP=
827fi
828if test -z "$CPP"; then
829if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
830 echo $ac_n "(cached) $ac_c" 1>&6
831else
832 # This must be in double quotes, not single quotes, because CPP may get
833 # substituted into the Makefile and "${CC-cc}" will confuse make.
834 CPP="${CC-cc} -E"
835 # On the NeXT, cc -E runs the code through the compiler's parser,
836 # not just through cpp.
837 cat > conftest.$ac_ext <<EOF
b2a1bd4f 838#line 839 "configure"
c906108c
SS
839#include "confdefs.h"
840#include <assert.h>
841Syntax Error
842EOF
843ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 844{ (eval echo configure:845: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
845ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
846if test -z "$ac_err"; then
847 :
848else
849 echo "$ac_err" >&5
850 echo "configure: failed program was:" >&5
851 cat conftest.$ac_ext >&5
852 rm -rf conftest*
853 CPP="${CC-cc} -E -traditional-cpp"
854 cat > conftest.$ac_ext <<EOF
b2a1bd4f 855#line 856 "configure"
c906108c
SS
856#include "confdefs.h"
857#include <assert.h>
858Syntax Error
859EOF
860ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 861{ (eval echo configure:862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
862ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
863if test -z "$ac_err"; then
864 :
865else
866 echo "$ac_err" >&5
867 echo "configure: failed program was:" >&5
868 cat conftest.$ac_ext >&5
869 rm -rf conftest*
870 CPP="${CC-cc} -nologo -E"
871 cat > conftest.$ac_ext <<EOF
b2a1bd4f 872#line 873 "configure"
c906108c
SS
873#include "confdefs.h"
874#include <assert.h>
875Syntax Error
876EOF
877ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 878{ (eval echo configure:879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
879ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
880if test -z "$ac_err"; then
881 :
882else
883 echo "$ac_err" >&5
884 echo "configure: failed program was:" >&5
885 cat conftest.$ac_ext >&5
886 rm -rf conftest*
887 CPP=/lib/cpp
888fi
889rm -f conftest*
890fi
891rm -f conftest*
892fi
893rm -f conftest*
894 ac_cv_prog_CPP="$CPP"
895fi
896 CPP="$ac_cv_prog_CPP"
897else
898 ac_cv_prog_CPP="$CPP"
899fi
900echo "$ac_t""$CPP" 1>&6
901
902echo $ac_n "checking for AIX""... $ac_c" 1>&6
b2a1bd4f 903echo "configure:904: checking for AIX" >&5
c906108c 904cat > conftest.$ac_ext <<EOF
b2a1bd4f 905#line 906 "configure"
c906108c
SS
906#include "confdefs.h"
907#ifdef _AIX
908 yes
909#endif
910
911EOF
912if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
913 egrep "yes" >/dev/null 2>&1; then
914 rm -rf conftest*
915 echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
916#define _ALL_SOURCE 1
917EOF
918
919else
920 rm -rf conftest*
921 echo "$ac_t""no" 1>&6
922fi
923rm -f conftest*
924
925
56157b4a 926echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
b2a1bd4f 927echo "configure:928: checking for POSIXized ISC" >&5
56157b4a
AC
928if test -d /etc/conf/kconfig.d &&
929 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
930then
931 echo "$ac_t""yes" 1>&6
932 ISC=yes # If later tests want to check for ISC.
933 cat >> confdefs.h <<\EOF
934#define _POSIX_SOURCE 1
c906108c
SS
935EOF
936
56157b4a
AC
937 if test "$GCC" = yes; then
938 CC="$CC -posix"
939 else
940 CC="$CC -Xp"
941 fi
c906108c
SS
942else
943 echo "$ac_t""no" 1>&6
56157b4a 944 ISC=
c906108c
SS
945fi
946
947
948
949
950echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
b2a1bd4f 951echo "configure:952: checking for ${CC-cc} option to accept ANSI C" >&5
c906108c
SS
952if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
953 echo $ac_n "(cached) $ac_c" 1>&6
954else
955 am_cv_prog_cc_stdc=no
956ac_save_CC="$CC"
957# Don't try gcc -ansi; that turns off useful extensions and
958# breaks some systems' header files.
959# AIX -qlanglvl=ansi
960# Ultrix and OSF/1 -std1
56157b4a
AC
961# HP-UX 10.20 and later -Ae
962# HP-UX older versions -Aa -D_HPUX_SOURCE
c906108c 963# SVR4 -Xc -D__EXTENSIONS__
56157b4a 964for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
c906108c
SS
965do
966 CC="$ac_save_CC $ac_arg"
967 cat > conftest.$ac_ext <<EOF
b2a1bd4f 968#line 969 "configure"
c906108c
SS
969#include "confdefs.h"
970#include <stdarg.h>
971#include <stdio.h>
972#include <sys/types.h>
973#include <sys/stat.h>
974/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
975struct buf { int x; };
976FILE * (*rcsopen) (struct buf *, struct stat *, int);
977static char *e (p, i)
978 char **p;
979 int i;
980{
981 return p[i];
982}
983static char *f (char * (*g) (char **, int), char **p, ...)
984{
985 char *s;
986 va_list v;
987 va_start (v,p);
988 s = g (p, va_arg (v,int));
989 va_end (v);
990 return s;
991}
992int test (int i, double x);
993struct s1 {int (*f) (int a);};
994struct s2 {int (*f) (double a);};
995int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
996int argc;
997char **argv;
998
999int main() {
1000
1001return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
1002
1003; return 0; }
1004EOF
b2a1bd4f 1005if { (eval echo configure:1006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
1006 rm -rf conftest*
1007 am_cv_prog_cc_stdc="$ac_arg"; break
1008else
1009 echo "configure: failed program was:" >&5
1010 cat conftest.$ac_ext >&5
1011fi
1012rm -f conftest*
1013done
1014CC="$ac_save_CC"
1015
1016fi
1017
1018if test -z "$am_cv_prog_cc_stdc"; then
1019 echo "$ac_t""none needed" 1>&6
1020else
1021 echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
1022fi
1023case "x$am_cv_prog_cc_stdc" in
1024 x|xno) ;;
1025 *) CC="$CC $am_cv_prog_cc_stdc" ;;
1026esac
1027
1028
1029ac_aux_dir=
1030for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
1031 if test -f $ac_dir/install-sh; then
1032 ac_aux_dir=$ac_dir
1033 ac_install_sh="$ac_aux_dir/install-sh -c"
1034 break
1035 elif test -f $ac_dir/install.sh; then
1036 ac_aux_dir=$ac_dir
1037 ac_install_sh="$ac_aux_dir/install.sh -c"
1038 break
1039 fi
1040done
1041if test -z "$ac_aux_dir"; then
1042 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/.." 1>&2; exit 1; }
1043fi
1044ac_config_guess=$ac_aux_dir/config.guess
1045ac_config_sub=$ac_aux_dir/config.sub
1046ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1047
1048
1049# Do some error checking and defaulting for the host and target type.
1050# The inputs are:
1051# configure --host=HOST --target=TARGET --build=BUILD NONOPT
1052#
1053# The rules are:
1054# 1. You are not allowed to specify --host, --target, and nonopt at the
1055# same time.
1056# 2. Host defaults to nonopt.
1057# 3. If nonopt is not specified, then host defaults to the current host,
1058# as determined by config.guess.
1059# 4. Target and build default to nonopt.
1060# 5. If nonopt is not specified, then target and build default to host.
1061
1062# The aliases save the names the user supplied, while $host etc.
1063# will get canonicalized.
1064case $host---$target---$nonopt in
1065NONE---*---* | *---NONE---* | *---*---NONE) ;;
1066*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1067esac
1068
1069
1070# Make sure we can run config.sub.
1071if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1072else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1073fi
1074
1075echo $ac_n "checking host system type""... $ac_c" 1>&6
b2a1bd4f 1076echo "configure:1077: checking host system type" >&5
c906108c
SS
1077
1078host_alias=$host
1079case "$host_alias" in
1080NONE)
1081 case $nonopt in
1082 NONE)
1083 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1084 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1085 fi ;;
1086 *) host_alias=$nonopt ;;
1087 esac ;;
1088esac
1089
1090host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1091host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1092host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1093host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1094echo "$ac_t""$host" 1>&6
1095
1096echo $ac_n "checking target system type""... $ac_c" 1>&6
b2a1bd4f 1097echo "configure:1098: checking target system type" >&5
c906108c
SS
1098
1099target_alias=$target
1100case "$target_alias" in
1101NONE)
1102 case $nonopt in
1103 NONE) target_alias=$host_alias ;;
1104 *) target_alias=$nonopt ;;
1105 esac ;;
1106esac
1107
1108target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
1109target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1110target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1111target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1112echo "$ac_t""$target" 1>&6
1113
1114echo $ac_n "checking build system type""... $ac_c" 1>&6
b2a1bd4f 1115echo "configure:1116: checking build system type" >&5
c906108c
SS
1116
1117build_alias=$build
1118case "$build_alias" in
1119NONE)
1120 case $nonopt in
1121 NONE) build_alias=$host_alias ;;
1122 *) build_alias=$nonopt ;;
1123 esac ;;
1124esac
1125
1126build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1127build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1128build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1129build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1130echo "$ac_t""$build" 1>&6
1131
1132test "$host_alias" != "$target_alias" &&
1133 test "$program_prefix$program_suffix$program_transform_name" = \
1134 NONENONEs,x,x, &&
1135 program_prefix=${target_alias}-
1136
1137
1138ALL_LINGUAS=
1139echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
b2a1bd4f 1140echo "configure:1141: checking whether ${MAKE-make} sets \${MAKE}" >&5
c906108c
SS
1141set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1142if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1143 echo $ac_n "(cached) $ac_c" 1>&6
1144else
1145 cat > conftestmake <<\EOF
1146all:
1147 @echo 'ac_maketemp="${MAKE}"'
1148EOF
1149# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1150eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1151if test -n "$ac_maketemp"; then
1152 eval ac_cv_prog_make_${ac_make}_set=yes
1153else
1154 eval ac_cv_prog_make_${ac_make}_set=no
1155fi
1156rm -f conftestmake
1157fi
1158if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1159 echo "$ac_t""yes" 1>&6
1160 SET_MAKE=
1161else
1162 echo "$ac_t""no" 1>&6
1163 SET_MAKE="MAKE=${MAKE-make}"
1164fi
1165
1166# Extract the first word of "ranlib", so it can be a program name with args.
1167set dummy ranlib; ac_word=$2
1168echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
b2a1bd4f 1169echo "configure:1170: checking for $ac_word" >&5
c906108c
SS
1170if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1171 echo $ac_n "(cached) $ac_c" 1>&6
1172else
1173 if test -n "$RANLIB"; then
1174 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1175else
1176 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
1177 ac_dummy="$PATH"
1178 for ac_dir in $ac_dummy; do
1179 test -z "$ac_dir" && ac_dir=.
1180 if test -f $ac_dir/$ac_word; then
1181 ac_cv_prog_RANLIB="ranlib"
1182 break
1183 fi
1184 done
1185 IFS="$ac_save_ifs"
1186 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1187fi
1188fi
1189RANLIB="$ac_cv_prog_RANLIB"
1190if test -n "$RANLIB"; then
1191 echo "$ac_t""$RANLIB" 1>&6
1192else
1193 echo "$ac_t""no" 1>&6
1194fi
1195
1196echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
b2a1bd4f 1197echo "configure:1198: checking for ANSI C header files" >&5
c906108c
SS
1198if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1199 echo $ac_n "(cached) $ac_c" 1>&6
1200else
1201 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1202#line 1203 "configure"
c906108c
SS
1203#include "confdefs.h"
1204#include <stdlib.h>
1205#include <stdarg.h>
1206#include <string.h>
1207#include <float.h>
1208EOF
1209ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 1210{ (eval echo configure:1211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
1211ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1212if test -z "$ac_err"; then
1213 rm -rf conftest*
1214 ac_cv_header_stdc=yes
1215else
1216 echo "$ac_err" >&5
1217 echo "configure: failed program was:" >&5
1218 cat conftest.$ac_ext >&5
1219 rm -rf conftest*
1220 ac_cv_header_stdc=no
1221fi
1222rm -f conftest*
1223
1224if test $ac_cv_header_stdc = yes; then
1225 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1226cat > conftest.$ac_ext <<EOF
b2a1bd4f 1227#line 1228 "configure"
c906108c
SS
1228#include "confdefs.h"
1229#include <string.h>
1230EOF
1231if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1232 egrep "memchr" >/dev/null 2>&1; then
1233 :
1234else
1235 rm -rf conftest*
1236 ac_cv_header_stdc=no
1237fi
1238rm -f conftest*
1239
1240fi
1241
1242if test $ac_cv_header_stdc = yes; then
1243 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1244cat > conftest.$ac_ext <<EOF
b2a1bd4f 1245#line 1246 "configure"
c906108c
SS
1246#include "confdefs.h"
1247#include <stdlib.h>
1248EOF
1249if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1250 egrep "free" >/dev/null 2>&1; then
1251 :
1252else
1253 rm -rf conftest*
1254 ac_cv_header_stdc=no
1255fi
1256rm -f conftest*
1257
1258fi
1259
1260if test $ac_cv_header_stdc = yes; then
1261 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1262if test "$cross_compiling" = yes; then
1263 :
1264else
1265 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1266#line 1267 "configure"
c906108c
SS
1267#include "confdefs.h"
1268#include <ctype.h>
1269#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1270#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1271#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1272int main () { int i; for (i = 0; i < 256; i++)
1273if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1274exit (0); }
1275
1276EOF
b2a1bd4f 1277if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
1278then
1279 :
1280else
1281 echo "configure: failed program was:" >&5
1282 cat conftest.$ac_ext >&5
1283 rm -fr conftest*
1284 ac_cv_header_stdc=no
1285fi
1286rm -fr conftest*
1287fi
1288
1289fi
1290fi
1291
1292echo "$ac_t""$ac_cv_header_stdc" 1>&6
1293if test $ac_cv_header_stdc = yes; then
1294 cat >> confdefs.h <<\EOF
1295#define STDC_HEADERS 1
1296EOF
1297
1298fi
1299
1300echo $ac_n "checking for working const""... $ac_c" 1>&6
b2a1bd4f 1301echo "configure:1302: checking for working const" >&5
c906108c
SS
1302if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1303 echo $ac_n "(cached) $ac_c" 1>&6
1304else
1305 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1306#line 1307 "configure"
c906108c
SS
1307#include "confdefs.h"
1308
1309int main() {
1310
1311/* Ultrix mips cc rejects this. */
1312typedef int charset[2]; const charset x;
1313/* SunOS 4.1.1 cc rejects this. */
1314char const *const *ccp;
1315char **p;
1316/* NEC SVR4.0.2 mips cc rejects this. */
1317struct point {int x, y;};
1318static struct point const zero = {0,0};
1319/* AIX XL C 1.02.0.0 rejects this.
1320 It does not let you subtract one const X* pointer from another in an arm
1321 of an if-expression whose if-part is not a constant expression */
1322const char *g = "string";
1323ccp = &g + (g ? g-g : 0);
1324/* HPUX 7.0 cc rejects these. */
1325++ccp;
1326p = (char**) ccp;
1327ccp = (char const *const *) p;
1328{ /* SCO 3.2v4 cc rejects this. */
1329 char *t;
1330 char const *s = 0 ? (char *) 0 : (char const *) 0;
1331
1332 *t++ = 0;
1333}
1334{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1335 int x[] = {25, 17};
1336 const int *foo = &x[0];
1337 ++foo;
1338}
1339{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1340 typedef const int *iptr;
1341 iptr p = 0;
1342 ++p;
1343}
1344{ /* AIX XL C 1.02.0.0 rejects this saying
1345 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1346 struct s { int j; const int *ap[3]; };
1347 struct s *b; b->j = 5;
1348}
1349{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1350 const int foo = 10;
1351}
1352
1353; return 0; }
1354EOF
b2a1bd4f 1355if { (eval echo configure:1356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
1356 rm -rf conftest*
1357 ac_cv_c_const=yes
1358else
1359 echo "configure: failed program was:" >&5
1360 cat conftest.$ac_ext >&5
1361 rm -rf conftest*
1362 ac_cv_c_const=no
1363fi
1364rm -f conftest*
1365fi
1366
1367echo "$ac_t""$ac_cv_c_const" 1>&6
1368if test $ac_cv_c_const = no; then
1369 cat >> confdefs.h <<\EOF
1370#define const
1371EOF
1372
1373fi
1374
1375echo $ac_n "checking for inline""... $ac_c" 1>&6
b2a1bd4f 1376echo "configure:1377: checking for inline" >&5
c906108c
SS
1377if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1378 echo $ac_n "(cached) $ac_c" 1>&6
1379else
1380 ac_cv_c_inline=no
1381for ac_kw in inline __inline__ __inline; do
1382 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1383#line 1384 "configure"
c906108c
SS
1384#include "confdefs.h"
1385
1386int main() {
1387} $ac_kw foo() {
1388; return 0; }
1389EOF
b2a1bd4f 1390if { (eval echo configure:1391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
1391 rm -rf conftest*
1392 ac_cv_c_inline=$ac_kw; break
1393else
1394 echo "configure: failed program was:" >&5
1395 cat conftest.$ac_ext >&5
1396fi
1397rm -f conftest*
1398done
1399
1400fi
1401
1402echo "$ac_t""$ac_cv_c_inline" 1>&6
1403case "$ac_cv_c_inline" in
1404 inline | yes) ;;
1405 no) cat >> confdefs.h <<\EOF
1406#define inline
1407EOF
1408 ;;
1409 *) cat >> confdefs.h <<EOF
1410#define inline $ac_cv_c_inline
1411EOF
1412 ;;
1413esac
1414
1415echo $ac_n "checking for off_t""... $ac_c" 1>&6
b2a1bd4f 1416echo "configure:1417: checking for off_t" >&5
c906108c
SS
1417if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
1418 echo $ac_n "(cached) $ac_c" 1>&6
1419else
1420 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1421#line 1422 "configure"
c906108c
SS
1422#include "confdefs.h"
1423#include <sys/types.h>
1424#if STDC_HEADERS
1425#include <stdlib.h>
1426#include <stddef.h>
1427#endif
1428EOF
1429if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1430 egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1431 rm -rf conftest*
1432 ac_cv_type_off_t=yes
1433else
1434 rm -rf conftest*
1435 ac_cv_type_off_t=no
1436fi
1437rm -f conftest*
1438
1439fi
1440echo "$ac_t""$ac_cv_type_off_t" 1>&6
1441if test $ac_cv_type_off_t = no; then
1442 cat >> confdefs.h <<\EOF
1443#define off_t long
1444EOF
1445
1446fi
1447
1448echo $ac_n "checking for size_t""... $ac_c" 1>&6
b2a1bd4f 1449echo "configure:1450: checking for size_t" >&5
c906108c
SS
1450if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1451 echo $ac_n "(cached) $ac_c" 1>&6
1452else
1453 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1454#line 1455 "configure"
c906108c
SS
1455#include "confdefs.h"
1456#include <sys/types.h>
1457#if STDC_HEADERS
1458#include <stdlib.h>
1459#include <stddef.h>
1460#endif
1461EOF
1462if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1463 egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1464 rm -rf conftest*
1465 ac_cv_type_size_t=yes
1466else
1467 rm -rf conftest*
1468 ac_cv_type_size_t=no
1469fi
1470rm -f conftest*
1471
1472fi
1473echo "$ac_t""$ac_cv_type_size_t" 1>&6
1474if test $ac_cv_type_size_t = no; then
1475 cat >> confdefs.h <<\EOF
1476#define size_t unsigned
1477EOF
1478
1479fi
1480
1481# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1482# for constant arguments. Useless!
1483echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
b2a1bd4f 1484echo "configure:1485: checking for working alloca.h" >&5
c906108c
SS
1485if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1486 echo $ac_n "(cached) $ac_c" 1>&6
1487else
1488 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1489#line 1490 "configure"
c906108c
SS
1490#include "confdefs.h"
1491#include <alloca.h>
1492int main() {
1493char *p = alloca(2 * sizeof(int));
1494; return 0; }
1495EOF
b2a1bd4f 1496if { (eval echo configure:1497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
1497 rm -rf conftest*
1498 ac_cv_header_alloca_h=yes
1499else
1500 echo "configure: failed program was:" >&5
1501 cat conftest.$ac_ext >&5
1502 rm -rf conftest*
1503 ac_cv_header_alloca_h=no
1504fi
1505rm -f conftest*
1506fi
1507
1508echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1509if test $ac_cv_header_alloca_h = yes; then
1510 cat >> confdefs.h <<\EOF
1511#define HAVE_ALLOCA_H 1
1512EOF
1513
1514fi
1515
1516echo $ac_n "checking for alloca""... $ac_c" 1>&6
b2a1bd4f 1517echo "configure:1518: checking for alloca" >&5
c906108c
SS
1518if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1519 echo $ac_n "(cached) $ac_c" 1>&6
1520else
1521 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1522#line 1523 "configure"
c906108c
SS
1523#include "confdefs.h"
1524
1525#ifdef __GNUC__
1526# define alloca __builtin_alloca
1527#else
1528# ifdef _MSC_VER
1529# include <malloc.h>
1530# define alloca _alloca
1531# else
1532# if HAVE_ALLOCA_H
1533# include <alloca.h>
1534# else
1535# ifdef _AIX
1536 #pragma alloca
1537# else
1538# ifndef alloca /* predefined by HP cc +Olibcalls */
1539char *alloca ();
1540# endif
1541# endif
1542# endif
1543# endif
1544#endif
1545
1546int main() {
1547char *p = (char *) alloca(1);
1548; return 0; }
1549EOF
b2a1bd4f 1550if { (eval echo configure:1551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
1551 rm -rf conftest*
1552 ac_cv_func_alloca_works=yes
1553else
1554 echo "configure: failed program was:" >&5
1555 cat conftest.$ac_ext >&5
1556 rm -rf conftest*
1557 ac_cv_func_alloca_works=no
1558fi
1559rm -f conftest*
1560fi
1561
1562echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1563if test $ac_cv_func_alloca_works = yes; then
1564 cat >> confdefs.h <<\EOF
1565#define HAVE_ALLOCA 1
1566EOF
1567
1568fi
1569
1570if test $ac_cv_func_alloca_works = no; then
1571 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1572 # that cause trouble. Some versions do not even contain alloca or
1573 # contain a buggy version. If you still want to use their alloca,
1574 # use ar to extract alloca.o from them instead of compiling alloca.c.
1575 ALLOCA=alloca.${ac_objext}
1576 cat >> confdefs.h <<\EOF
1577#define C_ALLOCA 1
1578EOF
1579
1580
1581echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
b2a1bd4f 1582echo "configure:1583: checking whether alloca needs Cray hooks" >&5
c906108c
SS
1583if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1584 echo $ac_n "(cached) $ac_c" 1>&6
1585else
1586 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1587#line 1588 "configure"
c906108c
SS
1588#include "confdefs.h"
1589#if defined(CRAY) && ! defined(CRAY2)
1590webecray
1591#else
1592wenotbecray
1593#endif
1594
1595EOF
1596if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1597 egrep "webecray" >/dev/null 2>&1; then
1598 rm -rf conftest*
1599 ac_cv_os_cray=yes
1600else
1601 rm -rf conftest*
1602 ac_cv_os_cray=no
1603fi
1604rm -f conftest*
1605
1606fi
1607
1608echo "$ac_t""$ac_cv_os_cray" 1>&6
1609if test $ac_cv_os_cray = yes; then
1610for ac_func in _getb67 GETB67 getb67; do
1611 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
b2a1bd4f 1612echo "configure:1613: checking for $ac_func" >&5
c906108c
SS
1613if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1614 echo $ac_n "(cached) $ac_c" 1>&6
1615else
1616 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1617#line 1618 "configure"
c906108c
SS
1618#include "confdefs.h"
1619/* System header to define __stub macros and hopefully few prototypes,
1620 which can conflict with char $ac_func(); below. */
1621#include <assert.h>
1622/* Override any gcc2 internal prototype to avoid an error. */
1623/* We use char because int might match the return type of a gcc2
1624 builtin and then its argument prototype would still apply. */
1625char $ac_func();
1626
1627int main() {
1628
1629/* The GNU C library defines this for functions which it implements
1630 to always fail with ENOSYS. Some functions are actually named
1631 something starting with __ and the normal name is an alias. */
1632#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1633choke me
1634#else
1635$ac_func();
1636#endif
1637
1638; return 0; }
1639EOF
b2a1bd4f 1640if { (eval echo configure:1641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
1641 rm -rf conftest*
1642 eval "ac_cv_func_$ac_func=yes"
1643else
1644 echo "configure: failed program was:" >&5
1645 cat conftest.$ac_ext >&5
1646 rm -rf conftest*
1647 eval "ac_cv_func_$ac_func=no"
1648fi
1649rm -f conftest*
1650fi
1651
1652if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1653 echo "$ac_t""yes" 1>&6
1654 cat >> confdefs.h <<EOF
1655#define CRAY_STACKSEG_END $ac_func
1656EOF
1657
1658 break
1659else
1660 echo "$ac_t""no" 1>&6
1661fi
1662
1663done
1664fi
1665
1666echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
b2a1bd4f 1667echo "configure:1668: checking stack direction for C alloca" >&5
c906108c
SS
1668if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1669 echo $ac_n "(cached) $ac_c" 1>&6
1670else
1671 if test "$cross_compiling" = yes; then
1672 ac_cv_c_stack_direction=0
1673else
1674 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1675#line 1676 "configure"
c906108c
SS
1676#include "confdefs.h"
1677find_stack_direction ()
1678{
1679 static char *addr = 0;
1680 auto char dummy;
1681 if (addr == 0)
1682 {
1683 addr = &dummy;
1684 return find_stack_direction ();
1685 }
1686 else
1687 return (&dummy > addr) ? 1 : -1;
1688}
1689main ()
1690{
1691 exit (find_stack_direction() < 0);
1692}
1693EOF
b2a1bd4f 1694if { (eval echo configure:1695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
1695then
1696 ac_cv_c_stack_direction=1
1697else
1698 echo "configure: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 rm -fr conftest*
1701 ac_cv_c_stack_direction=-1
1702fi
1703rm -fr conftest*
1704fi
1705
1706fi
1707
1708echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
1709cat >> confdefs.h <<EOF
1710#define STACK_DIRECTION $ac_cv_c_stack_direction
1711EOF
1712
1713fi
1714
b2a1bd4f 1715for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
c906108c
SS
1716do
1717ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1718echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
b2a1bd4f 1719echo "configure:1720: checking for $ac_hdr" >&5
c906108c
SS
1720if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1721 echo $ac_n "(cached) $ac_c" 1>&6
1722else
1723 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1724#line 1725 "configure"
c906108c
SS
1725#include "confdefs.h"
1726#include <$ac_hdr>
1727EOF
1728ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 1729{ (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
1730ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1731if test -z "$ac_err"; then
1732 rm -rf conftest*
1733 eval "ac_cv_header_$ac_safe=yes"
1734else
1735 echo "$ac_err" >&5
1736 echo "configure: failed program was:" >&5
1737 cat conftest.$ac_ext >&5
1738 rm -rf conftest*
1739 eval "ac_cv_header_$ac_safe=no"
1740fi
1741rm -f conftest*
1742fi
1743if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1744 echo "$ac_t""yes" 1>&6
1745 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1746 cat >> confdefs.h <<EOF
1747#define $ac_tr_hdr 1
1748EOF
1749
1750else
1751 echo "$ac_t""no" 1>&6
1752fi
1753done
1754
1755for ac_func in getpagesize
1756do
1757echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
b2a1bd4f 1758echo "configure:1759: checking for $ac_func" >&5
c906108c
SS
1759if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1760 echo $ac_n "(cached) $ac_c" 1>&6
1761else
1762 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1763#line 1764 "configure"
c906108c
SS
1764#include "confdefs.h"
1765/* System header to define __stub macros and hopefully few prototypes,
1766 which can conflict with char $ac_func(); below. */
1767#include <assert.h>
1768/* Override any gcc2 internal prototype to avoid an error. */
1769/* We use char because int might match the return type of a gcc2
1770 builtin and then its argument prototype would still apply. */
1771char $ac_func();
1772
1773int main() {
1774
1775/* The GNU C library defines this for functions which it implements
1776 to always fail with ENOSYS. Some functions are actually named
1777 something starting with __ and the normal name is an alias. */
1778#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1779choke me
1780#else
1781$ac_func();
1782#endif
1783
1784; return 0; }
1785EOF
b2a1bd4f 1786if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
1787 rm -rf conftest*
1788 eval "ac_cv_func_$ac_func=yes"
1789else
1790 echo "configure: failed program was:" >&5
1791 cat conftest.$ac_ext >&5
1792 rm -rf conftest*
1793 eval "ac_cv_func_$ac_func=no"
1794fi
1795rm -f conftest*
1796fi
1797
1798if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1799 echo "$ac_t""yes" 1>&6
1800 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1801 cat >> confdefs.h <<EOF
1802#define $ac_tr_func 1
1803EOF
1804
1805else
1806 echo "$ac_t""no" 1>&6
1807fi
1808done
1809
1810echo $ac_n "checking for working mmap""... $ac_c" 1>&6
b2a1bd4f 1811echo "configure:1812: checking for working mmap" >&5
c906108c
SS
1812if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
1813 echo $ac_n "(cached) $ac_c" 1>&6
1814else
1815 if test "$cross_compiling" = yes; then
1816 ac_cv_func_mmap_fixed_mapped=no
1817else
1818 cat > conftest.$ac_ext <<EOF
b2a1bd4f 1819#line 1820 "configure"
c906108c
SS
1820#include "confdefs.h"
1821
1822/* Thanks to Mike Haertel and Jim Avera for this test.
1823 Here is a matrix of mmap possibilities:
1824 mmap private not fixed
1825 mmap private fixed at somewhere currently unmapped
1826 mmap private fixed at somewhere already mapped
1827 mmap shared not fixed
1828 mmap shared fixed at somewhere currently unmapped
1829 mmap shared fixed at somewhere already mapped
1830 For private mappings, we should verify that changes cannot be read()
1831 back from the file, nor mmap's back from the file at a different
1832 address. (There have been systems where private was not correctly
1833 implemented like the infamous i386 svr4.0, and systems where the
1834 VM page cache was not coherent with the filesystem buffer cache
1835 like early versions of FreeBSD and possibly contemporary NetBSD.)
1836 For shared mappings, we should conversely verify that changes get
1837 propogated back to all the places they're supposed to be.
1838
1839 Grep wants private fixed already mapped.
1840 The main things grep needs to know about mmap are:
1841 * does it exist and is it safe to write into the mmap'd area
1842 * how to use it (BSD variants) */
1843#include <sys/types.h>
1844#include <fcntl.h>
1845#include <sys/mman.h>
1846
b2a1bd4f
MH
1847#if HAVE_SYS_TYPES_H
1848# include <sys/types.h>
1849#endif
1850
1851#if HAVE_STDLIB_H
1852# include <stdlib.h>
1853#endif
1854
1855#if HAVE_SYS_STAT_H
1856# include <sys/stat.h>
1857#endif
1858
1859#if HAVE_UNISTD_H
1860# include <unistd.h>
1861#endif
1862
c906108c
SS
1863/* This mess was copied from the GNU getpagesize.h. */
1864#ifndef HAVE_GETPAGESIZE
c906108c
SS
1865
1866/* Assume that all systems that can run configure have sys/param.h. */
1867# ifndef HAVE_SYS_PARAM_H
1868# define HAVE_SYS_PARAM_H 1
1869# endif
1870
1871# ifdef _SC_PAGESIZE
1872# define getpagesize() sysconf(_SC_PAGESIZE)
1873# else /* no _SC_PAGESIZE */
1874# ifdef HAVE_SYS_PARAM_H
1875# include <sys/param.h>
1876# ifdef EXEC_PAGESIZE
1877# define getpagesize() EXEC_PAGESIZE
1878# else /* no EXEC_PAGESIZE */
1879# ifdef NBPG
1880# define getpagesize() NBPG * CLSIZE
1881# ifndef CLSIZE
1882# define CLSIZE 1
1883# endif /* no CLSIZE */
1884# else /* no NBPG */
1885# ifdef NBPC
1886# define getpagesize() NBPC
1887# else /* no NBPC */
1888# ifdef PAGESIZE
1889# define getpagesize() PAGESIZE
1890# endif /* PAGESIZE */
1891# endif /* no NBPC */
1892# endif /* no NBPG */
1893# endif /* no EXEC_PAGESIZE */
1894# else /* no HAVE_SYS_PARAM_H */
1895# define getpagesize() 8192 /* punt totally */
1896# endif /* no HAVE_SYS_PARAM_H */
1897# endif /* no _SC_PAGESIZE */
1898
1899#endif /* no HAVE_GETPAGESIZE */
1900
1901#ifdef __cplusplus
1902extern "C" { void *malloc(unsigned); }
1903#else
1904char *malloc();
1905#endif
1906
1907int
1908main()
1909{
1910 char *data, *data2, *data3;
1911 int i, pagesize;
1912 int fd;
1913
1914 pagesize = getpagesize();
1915
1916 /*
1917 * First, make a file with some known garbage in it.
1918 */
1919 data = malloc(pagesize);
1920 if (!data)
1921 exit(1);
1922 for (i = 0; i < pagesize; ++i)
1923 *(data + i) = rand();
1924 umask(0);
1925 fd = creat("conftestmmap", 0600);
1926 if (fd < 0)
1927 exit(1);
1928 if (write(fd, data, pagesize) != pagesize)
1929 exit(1);
1930 close(fd);
1931
1932 /*
1933 * Next, try to mmap the file at a fixed address which
1934 * already has something else allocated at it. If we can,
1935 * also make sure that we see the same garbage.
1936 */
1937 fd = open("conftestmmap", O_RDWR);
1938 if (fd < 0)
1939 exit(1);
1940 data2 = malloc(2 * pagesize);
1941 if (!data2)
1942 exit(1);
1943 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
1944 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
1945 MAP_PRIVATE | MAP_FIXED, fd, 0L))
1946 exit(1);
1947 for (i = 0; i < pagesize; ++i)
1948 if (*(data + i) != *(data2 + i))
1949 exit(1);
1950
1951 /*
1952 * Finally, make sure that changes to the mapped area
1953 * do not percolate back to the file as seen by read().
1954 * (This is a bug on some variants of i386 svr4.0.)
1955 */
1956 for (i = 0; i < pagesize; ++i)
1957 *(data2 + i) = *(data2 + i) + 1;
1958 data3 = malloc(pagesize);
1959 if (!data3)
1960 exit(1);
1961 if (read(fd, data3, pagesize) != pagesize)
1962 exit(1);
1963 for (i = 0; i < pagesize; ++i)
1964 if (*(data + i) != *(data3 + i))
1965 exit(1);
1966 close(fd);
1967 unlink("conftestmmap");
1968 exit(0);
1969}
1970
1971EOF
8ec41317 1972if { (eval echo configure:1973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
1973then
1974 ac_cv_func_mmap_fixed_mapped=yes
1975else
1976 echo "configure: failed program was:" >&5
1977 cat conftest.$ac_ext >&5
1978 rm -fr conftest*
1979 ac_cv_func_mmap_fixed_mapped=no
1980fi
1981rm -fr conftest*
1982fi
1983
1984fi
1985
1986echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
1987if test $ac_cv_func_mmap_fixed_mapped = yes; then
1988 cat >> confdefs.h <<\EOF
1989#define HAVE_MMAP 1
1990EOF
1991
1992fi
1993
1994
1995 for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
1996unistd.h values.h sys/param.h
1997do
1998ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1999echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8ec41317 2000echo "configure:2001: checking for $ac_hdr" >&5
c906108c
SS
2001if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2002 echo $ac_n "(cached) $ac_c" 1>&6
2003else
2004 cat > conftest.$ac_ext <<EOF
8ec41317 2005#line 2006 "configure"
c906108c
SS
2006#include "confdefs.h"
2007#include <$ac_hdr>
2008EOF
2009ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 2010{ (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
2011ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2012if test -z "$ac_err"; then
2013 rm -rf conftest*
2014 eval "ac_cv_header_$ac_safe=yes"
2015else
2016 echo "$ac_err" >&5
2017 echo "configure: failed program was:" >&5
2018 cat conftest.$ac_ext >&5
2019 rm -rf conftest*
2020 eval "ac_cv_header_$ac_safe=no"
2021fi
2022rm -f conftest*
2023fi
2024if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2025 echo "$ac_t""yes" 1>&6
2026 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2027 cat >> confdefs.h <<EOF
2028#define $ac_tr_hdr 1
2029EOF
2030
2031else
2032 echo "$ac_t""no" 1>&6
2033fi
2034done
2035
2036 for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
2037__argz_count __argz_stringify __argz_next
2038do
2039echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 2040echo "configure:2041: checking for $ac_func" >&5
c906108c
SS
2041if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2042 echo $ac_n "(cached) $ac_c" 1>&6
2043else
2044 cat > conftest.$ac_ext <<EOF
8ec41317 2045#line 2046 "configure"
c906108c
SS
2046#include "confdefs.h"
2047/* System header to define __stub macros and hopefully few prototypes,
2048 which can conflict with char $ac_func(); below. */
2049#include <assert.h>
2050/* Override any gcc2 internal prototype to avoid an error. */
2051/* We use char because int might match the return type of a gcc2
2052 builtin and then its argument prototype would still apply. */
2053char $ac_func();
2054
2055int main() {
2056
2057/* The GNU C library defines this for functions which it implements
2058 to always fail with ENOSYS. Some functions are actually named
2059 something starting with __ and the normal name is an alias. */
2060#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2061choke me
2062#else
2063$ac_func();
2064#endif
2065
2066; return 0; }
2067EOF
8ec41317 2068if { (eval echo configure:2069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2069 rm -rf conftest*
2070 eval "ac_cv_func_$ac_func=yes"
2071else
2072 echo "configure: failed program was:" >&5
2073 cat conftest.$ac_ext >&5
2074 rm -rf conftest*
2075 eval "ac_cv_func_$ac_func=no"
2076fi
2077rm -f conftest*
2078fi
2079
2080if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2081 echo "$ac_t""yes" 1>&6
2082 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2083 cat >> confdefs.h <<EOF
2084#define $ac_tr_func 1
2085EOF
2086
2087else
2088 echo "$ac_t""no" 1>&6
2089fi
2090done
2091
2092
2093 if test "${ac_cv_func_stpcpy+set}" != "set"; then
2094 for ac_func in stpcpy
2095do
2096echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 2097echo "configure:2098: checking for $ac_func" >&5
c906108c
SS
2098if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2099 echo $ac_n "(cached) $ac_c" 1>&6
2100else
2101 cat > conftest.$ac_ext <<EOF
8ec41317 2102#line 2103 "configure"
c906108c
SS
2103#include "confdefs.h"
2104/* System header to define __stub macros and hopefully few prototypes,
2105 which can conflict with char $ac_func(); below. */
2106#include <assert.h>
2107/* Override any gcc2 internal prototype to avoid an error. */
2108/* We use char because int might match the return type of a gcc2
2109 builtin and then its argument prototype would still apply. */
2110char $ac_func();
2111
2112int main() {
2113
2114/* The GNU C library defines this for functions which it implements
2115 to always fail with ENOSYS. Some functions are actually named
2116 something starting with __ and the normal name is an alias. */
2117#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2118choke me
2119#else
2120$ac_func();
2121#endif
2122
2123; return 0; }
2124EOF
8ec41317 2125if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2126 rm -rf conftest*
2127 eval "ac_cv_func_$ac_func=yes"
2128else
2129 echo "configure: failed program was:" >&5
2130 cat conftest.$ac_ext >&5
2131 rm -rf conftest*
2132 eval "ac_cv_func_$ac_func=no"
2133fi
2134rm -f conftest*
2135fi
2136
2137if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2138 echo "$ac_t""yes" 1>&6
2139 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2140 cat >> confdefs.h <<EOF
2141#define $ac_tr_func 1
2142EOF
2143
2144else
2145 echo "$ac_t""no" 1>&6
2146fi
2147done
2148
2149 fi
2150 if test "${ac_cv_func_stpcpy}" = "yes"; then
2151 cat >> confdefs.h <<\EOF
2152#define HAVE_STPCPY 1
2153EOF
2154
2155 fi
2156
2157 if test $ac_cv_header_locale_h = yes; then
2158 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
8ec41317 2159echo "configure:2160: checking for LC_MESSAGES" >&5
c906108c
SS
2160if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
2161 echo $ac_n "(cached) $ac_c" 1>&6
2162else
2163 cat > conftest.$ac_ext <<EOF
8ec41317 2164#line 2165 "configure"
c906108c
SS
2165#include "confdefs.h"
2166#include <locale.h>
2167int main() {
2168return LC_MESSAGES
2169; return 0; }
2170EOF
8ec41317 2171if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2172 rm -rf conftest*
2173 am_cv_val_LC_MESSAGES=yes
2174else
2175 echo "configure: failed program was:" >&5
2176 cat conftest.$ac_ext >&5
2177 rm -rf conftest*
2178 am_cv_val_LC_MESSAGES=no
2179fi
2180rm -f conftest*
2181fi
2182
2183echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
2184 if test $am_cv_val_LC_MESSAGES = yes; then
2185 cat >> confdefs.h <<\EOF
2186#define HAVE_LC_MESSAGES 1
2187EOF
2188
2189 fi
2190 fi
2191 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
8ec41317 2192echo "configure:2193: checking whether NLS is requested" >&5
c906108c
SS
2193 # Check whether --enable-nls or --disable-nls was given.
2194if test "${enable_nls+set}" = set; then
2195 enableval="$enable_nls"
2196 USE_NLS=$enableval
2197else
2198 USE_NLS=yes
2199fi
2200
2201 echo "$ac_t""$USE_NLS" 1>&6
2202
2203
2204 USE_INCLUDED_LIBINTL=no
2205
2206 if test "$USE_NLS" = "yes"; then
2207 cat >> confdefs.h <<\EOF
2208#define ENABLE_NLS 1
2209EOF
2210
2211 echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
8ec41317 2212echo "configure:2213: checking whether included gettext is requested" >&5
c906108c
SS
2213 # Check whether --with-included-gettext or --without-included-gettext was given.
2214if test "${with_included_gettext+set}" = set; then
2215 withval="$with_included_gettext"
2216 nls_cv_force_use_gnu_gettext=$withval
2217else
2218 nls_cv_force_use_gnu_gettext=no
2219fi
2220
2221 echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
2222
2223 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2224 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2225 nls_cv_header_intl=
2226 nls_cv_header_libgt=
2227 CATOBJEXT=NONE
2228
2229 ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
2230echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
8ec41317 2231echo "configure:2232: checking for libintl.h" >&5
c906108c
SS
2232if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2233 echo $ac_n "(cached) $ac_c" 1>&6
2234else
2235 cat > conftest.$ac_ext <<EOF
8ec41317 2236#line 2237 "configure"
c906108c
SS
2237#include "confdefs.h"
2238#include <libintl.h>
2239EOF
2240ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 2241{ (eval echo configure:2242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
2242ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2243if test -z "$ac_err"; then
2244 rm -rf conftest*
2245 eval "ac_cv_header_$ac_safe=yes"
2246else
2247 echo "$ac_err" >&5
2248 echo "configure: failed program was:" >&5
2249 cat conftest.$ac_ext >&5
2250 rm -rf conftest*
2251 eval "ac_cv_header_$ac_safe=no"
2252fi
2253rm -f conftest*
2254fi
2255if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2256 echo "$ac_t""yes" 1>&6
2257 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
8ec41317 2258echo "configure:2259: checking for gettext in libc" >&5
c906108c
SS
2259if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
2260 echo $ac_n "(cached) $ac_c" 1>&6
2261else
2262 cat > conftest.$ac_ext <<EOF
8ec41317 2263#line 2264 "configure"
c906108c
SS
2264#include "confdefs.h"
2265#include <libintl.h>
2266int main() {
2267return (int) gettext ("")
2268; return 0; }
2269EOF
8ec41317 2270if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2271 rm -rf conftest*
2272 gt_cv_func_gettext_libc=yes
2273else
2274 echo "configure: failed program was:" >&5
2275 cat conftest.$ac_ext >&5
2276 rm -rf conftest*
2277 gt_cv_func_gettext_libc=no
2278fi
2279rm -f conftest*
2280fi
2281
2282echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
2283
2284 if test "$gt_cv_func_gettext_libc" != "yes"; then
2285 echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
8ec41317 2286echo "configure:2287: checking for bindtextdomain in -lintl" >&5
c906108c
SS
2287ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
2288if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2289 echo $ac_n "(cached) $ac_c" 1>&6
2290else
2291 ac_save_LIBS="$LIBS"
2292LIBS="-lintl $LIBS"
2293cat > conftest.$ac_ext <<EOF
8ec41317 2294#line 2295 "configure"
c906108c
SS
2295#include "confdefs.h"
2296/* Override any gcc2 internal prototype to avoid an error. */
2297/* We use char because int might match the return type of a gcc2
2298 builtin and then its argument prototype would still apply. */
2299char bindtextdomain();
2300
2301int main() {
2302bindtextdomain()
2303; return 0; }
2304EOF
8ec41317 2305if { (eval echo configure:2306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2306 rm -rf conftest*
2307 eval "ac_cv_lib_$ac_lib_var=yes"
2308else
2309 echo "configure: failed program was:" >&5
2310 cat conftest.$ac_ext >&5
2311 rm -rf conftest*
2312 eval "ac_cv_lib_$ac_lib_var=no"
2313fi
2314rm -f conftest*
2315LIBS="$ac_save_LIBS"
2316
2317fi
2318if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2319 echo "$ac_t""yes" 1>&6
2320 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
8ec41317 2321echo "configure:2322: checking for gettext in libintl" >&5
c906108c
SS
2322if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
2323 echo $ac_n "(cached) $ac_c" 1>&6
2324else
2325 cat > conftest.$ac_ext <<EOF
8ec41317 2326#line 2327 "configure"
c906108c
SS
2327#include "confdefs.h"
2328
2329int main() {
2330return (int) gettext ("")
2331; return 0; }
2332EOF
8ec41317 2333if { (eval echo configure:2334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2334 rm -rf conftest*
2335 gt_cv_func_gettext_libintl=yes
2336else
2337 echo "configure: failed program was:" >&5
2338 cat conftest.$ac_ext >&5
2339 rm -rf conftest*
2340 gt_cv_func_gettext_libintl=no
2341fi
2342rm -f conftest*
2343fi
2344
2345echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
2346else
2347 echo "$ac_t""no" 1>&6
2348fi
2349
2350 fi
2351
2352 if test "$gt_cv_func_gettext_libc" = "yes" \
2353 || test "$gt_cv_func_gettext_libintl" = "yes"; then
2354 cat >> confdefs.h <<\EOF
2355#define HAVE_GETTEXT 1
2356EOF
2357
2358 # Extract the first word of "msgfmt", so it can be a program name with args.
2359set dummy msgfmt; ac_word=$2
2360echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2361echo "configure:2362: checking for $ac_word" >&5
c906108c
SS
2362if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2363 echo $ac_n "(cached) $ac_c" 1>&6
2364else
2365 case "$MSGFMT" in
2366 /*)
2367 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2368 ;;
2369 *)
2370 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2371 for ac_dir in $PATH; do
2372 test -z "$ac_dir" && ac_dir=.
2373 if test -f $ac_dir/$ac_word; then
2374 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2375 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2376 break
2377 fi
2378 fi
2379 done
2380 IFS="$ac_save_ifs"
2381 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
2382 ;;
2383esac
2384fi
2385MSGFMT="$ac_cv_path_MSGFMT"
2386if test -n "$MSGFMT"; then
2387 echo "$ac_t""$MSGFMT" 1>&6
2388else
2389 echo "$ac_t""no" 1>&6
2390fi
2391 if test "$MSGFMT" != "no"; then
2392 for ac_func in dcgettext
2393do
2394echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 2395echo "configure:2396: checking for $ac_func" >&5
c906108c
SS
2396if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2397 echo $ac_n "(cached) $ac_c" 1>&6
2398else
2399 cat > conftest.$ac_ext <<EOF
8ec41317 2400#line 2401 "configure"
c906108c
SS
2401#include "confdefs.h"
2402/* System header to define __stub macros and hopefully few prototypes,
2403 which can conflict with char $ac_func(); below. */
2404#include <assert.h>
2405/* Override any gcc2 internal prototype to avoid an error. */
2406/* We use char because int might match the return type of a gcc2
2407 builtin and then its argument prototype would still apply. */
2408char $ac_func();
2409
2410int main() {
2411
2412/* The GNU C library defines this for functions which it implements
2413 to always fail with ENOSYS. Some functions are actually named
2414 something starting with __ and the normal name is an alias. */
2415#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2416choke me
2417#else
2418$ac_func();
2419#endif
2420
2421; return 0; }
2422EOF
8ec41317 2423if { (eval echo configure:2424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2424 rm -rf conftest*
2425 eval "ac_cv_func_$ac_func=yes"
2426else
2427 echo "configure: failed program was:" >&5
2428 cat conftest.$ac_ext >&5
2429 rm -rf conftest*
2430 eval "ac_cv_func_$ac_func=no"
2431fi
2432rm -f conftest*
2433fi
2434
2435if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2436 echo "$ac_t""yes" 1>&6
2437 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2438 cat >> confdefs.h <<EOF
2439#define $ac_tr_func 1
2440EOF
2441
2442else
2443 echo "$ac_t""no" 1>&6
2444fi
2445done
2446
2447 # Extract the first word of "gmsgfmt", so it can be a program name with args.
2448set dummy gmsgfmt; ac_word=$2
2449echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2450echo "configure:2451: checking for $ac_word" >&5
c906108c
SS
2451if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2452 echo $ac_n "(cached) $ac_c" 1>&6
2453else
2454 case "$GMSGFMT" in
2455 /*)
2456 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2457 ;;
2458 ?:/*)
2459 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2460 ;;
2461 *)
2462 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2463 ac_dummy="$PATH"
2464 for ac_dir in $ac_dummy; do
2465 test -z "$ac_dir" && ac_dir=.
2466 if test -f $ac_dir/$ac_word; then
2467 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2468 break
2469 fi
2470 done
2471 IFS="$ac_save_ifs"
2472 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2473 ;;
2474esac
2475fi
2476GMSGFMT="$ac_cv_path_GMSGFMT"
2477if test -n "$GMSGFMT"; then
2478 echo "$ac_t""$GMSGFMT" 1>&6
2479else
2480 echo "$ac_t""no" 1>&6
2481fi
2482
2483 # Extract the first word of "xgettext", so it can be a program name with args.
2484set dummy xgettext; ac_word=$2
2485echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2486echo "configure:2487: checking for $ac_word" >&5
c906108c
SS
2487if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2488 echo $ac_n "(cached) $ac_c" 1>&6
2489else
2490 case "$XGETTEXT" in
2491 /*)
2492 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2493 ;;
2494 *)
2495 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2496 for ac_dir in $PATH; do
2497 test -z "$ac_dir" && ac_dir=.
2498 if test -f $ac_dir/$ac_word; then
2499 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2500 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2501 break
2502 fi
2503 fi
2504 done
2505 IFS="$ac_save_ifs"
2506 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2507 ;;
2508esac
2509fi
2510XGETTEXT="$ac_cv_path_XGETTEXT"
2511if test -n "$XGETTEXT"; then
2512 echo "$ac_t""$XGETTEXT" 1>&6
2513else
2514 echo "$ac_t""no" 1>&6
2515fi
2516
2517 cat > conftest.$ac_ext <<EOF
8ec41317 2518#line 2519 "configure"
c906108c
SS
2519#include "confdefs.h"
2520
2521int main() {
2522extern int _nl_msg_cat_cntr;
2523 return _nl_msg_cat_cntr
2524; return 0; }
2525EOF
8ec41317 2526if { (eval echo configure:2527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
2527 rm -rf conftest*
2528 CATOBJEXT=.gmo
2529 DATADIRNAME=share
2530else
2531 echo "configure: failed program was:" >&5
2532 cat conftest.$ac_ext >&5
2533 rm -rf conftest*
2534 CATOBJEXT=.mo
2535 DATADIRNAME=lib
2536fi
2537rm -f conftest*
2538 INSTOBJEXT=.mo
2539 fi
2540 fi
2541
2542else
2543 echo "$ac_t""no" 1>&6
2544fi
2545
2546
2547
2548 if test "$CATOBJEXT" = "NONE"; then
2549 nls_cv_use_gnu_gettext=yes
2550 fi
2551 fi
2552
2553 if test "$nls_cv_use_gnu_gettext" = "yes"; then
2554 INTLOBJS="\$(GETTOBJS)"
2555 # Extract the first word of "msgfmt", so it can be a program name with args.
2556set dummy msgfmt; ac_word=$2
2557echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2558echo "configure:2559: checking for $ac_word" >&5
c906108c
SS
2559if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2560 echo $ac_n "(cached) $ac_c" 1>&6
2561else
2562 case "$MSGFMT" in
2563 /*)
2564 ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2565 ;;
2566 *)
2567 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2568 for ac_dir in $PATH; do
2569 test -z "$ac_dir" && ac_dir=.
2570 if test -f $ac_dir/$ac_word; then
2571 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2572 ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2573 break
2574 fi
2575 fi
2576 done
2577 IFS="$ac_save_ifs"
2578 test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
2579 ;;
2580esac
2581fi
2582MSGFMT="$ac_cv_path_MSGFMT"
2583if test -n "$MSGFMT"; then
2584 echo "$ac_t""$MSGFMT" 1>&6
2585else
2586 echo "$ac_t""no" 1>&6
2587fi
2588
2589 # Extract the first word of "gmsgfmt", so it can be a program name with args.
2590set dummy gmsgfmt; ac_word=$2
2591echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2592echo "configure:2593: checking for $ac_word" >&5
c906108c
SS
2593if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2594 echo $ac_n "(cached) $ac_c" 1>&6
2595else
2596 case "$GMSGFMT" in
2597 /*)
2598 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2599 ;;
2600 ?:/*)
2601 ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2602 ;;
2603 *)
2604 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2605 ac_dummy="$PATH"
2606 for ac_dir in $ac_dummy; do
2607 test -z "$ac_dir" && ac_dir=.
2608 if test -f $ac_dir/$ac_word; then
2609 ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2610 break
2611 fi
2612 done
2613 IFS="$ac_save_ifs"
2614 test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2615 ;;
2616esac
2617fi
2618GMSGFMT="$ac_cv_path_GMSGFMT"
2619if test -n "$GMSGFMT"; then
2620 echo "$ac_t""$GMSGFMT" 1>&6
2621else
2622 echo "$ac_t""no" 1>&6
2623fi
2624
2625 # Extract the first word of "xgettext", so it can be a program name with args.
2626set dummy xgettext; ac_word=$2
2627echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2628echo "configure:2629: checking for $ac_word" >&5
c906108c
SS
2629if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2630 echo $ac_n "(cached) $ac_c" 1>&6
2631else
2632 case "$XGETTEXT" in
2633 /*)
2634 ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2635 ;;
2636 *)
2637 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2638 for ac_dir in $PATH; do
2639 test -z "$ac_dir" && ac_dir=.
2640 if test -f $ac_dir/$ac_word; then
2641 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2642 ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2643 break
2644 fi
2645 fi
2646 done
2647 IFS="$ac_save_ifs"
2648 test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2649 ;;
2650esac
2651fi
2652XGETTEXT="$ac_cv_path_XGETTEXT"
2653if test -n "$XGETTEXT"; then
2654 echo "$ac_t""$XGETTEXT" 1>&6
2655else
2656 echo "$ac_t""no" 1>&6
2657fi
2658
2659
2660 USE_INCLUDED_LIBINTL=yes
2661 CATOBJEXT=.gmo
2662 INSTOBJEXT=.mo
2663 DATADIRNAME=share
2664 INTLDEPS='$(top_builddir)/../intl/libintl.a'
2665 INTLLIBS=$INTLDEPS
2666 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2667 nls_cv_header_intl=libintl.h
2668 nls_cv_header_libgt=libgettext.h
2669 fi
2670
2671 if test "$XGETTEXT" != ":"; then
2672 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2673 : ;
2674 else
2675 echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
2676 XGETTEXT=":"
2677 fi
2678 fi
2679
2680 # We need to process the po/ directory.
2681 POSUB=po
2682 else
2683 DATADIRNAME=share
2684 nls_cv_header_intl=libintl.h
2685 nls_cv_header_libgt=libgettext.h
2686 fi
2687
2688 # If this is used in GNU gettext we have to set USE_NLS to `yes'
2689 # because some of the sources are only built for this goal.
2690 if test "$PACKAGE" = gettext; then
2691 USE_NLS=yes
2692 USE_INCLUDED_LIBINTL=yes
2693 fi
2694
2695 for lang in $ALL_LINGUAS; do
2696 GMOFILES="$GMOFILES $lang.gmo"
2697 POFILES="$POFILES $lang.po"
2698 done
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713 if test "x$CATOBJEXT" != "x"; then
2714 if test "x$ALL_LINGUAS" = "x"; then
2715 LINGUAS=
2716 else
2717 echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
8ec41317 2718echo "configure:2719: checking for catalogs to be installed" >&5
c906108c
SS
2719 NEW_LINGUAS=
2720 for lang in ${LINGUAS=$ALL_LINGUAS}; do
2721 case "$ALL_LINGUAS" in
2722 *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2723 esac
2724 done
2725 LINGUAS=$NEW_LINGUAS
2726 echo "$ac_t""$LINGUAS" 1>&6
2727 fi
2728
2729 if test -n "$LINGUAS"; then
2730 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2731 fi
2732 fi
2733
2734 if test $ac_cv_header_locale_h = yes; then
2735 INCLUDE_LOCALE_H="#include <locale.h>"
2736 else
2737 INCLUDE_LOCALE_H="\
2738/* The system does not provide the header <locale.h>. Take care yourself. */"
2739 fi
2740
2741
2742 if test -f $srcdir/po2tbl.sed.in; then
2743 if test "$CATOBJEXT" = ".cat"; then
2744 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
2745echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
8ec41317 2746echo "configure:2747: checking for linux/version.h" >&5
c906108c
SS
2747if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2748 echo $ac_n "(cached) $ac_c" 1>&6
2749else
2750 cat > conftest.$ac_ext <<EOF
8ec41317 2751#line 2752 "configure"
c906108c
SS
2752#include "confdefs.h"
2753#include <linux/version.h>
2754EOF
2755ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 2756{ (eval echo configure:2757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
2757ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2758if test -z "$ac_err"; then
2759 rm -rf conftest*
2760 eval "ac_cv_header_$ac_safe=yes"
2761else
2762 echo "$ac_err" >&5
2763 echo "configure: failed program was:" >&5
2764 cat conftest.$ac_ext >&5
2765 rm -rf conftest*
2766 eval "ac_cv_header_$ac_safe=no"
2767fi
2768rm -f conftest*
2769fi
2770if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2771 echo "$ac_t""yes" 1>&6
2772 msgformat=linux
2773else
2774 echo "$ac_t""no" 1>&6
2775msgformat=xopen
2776fi
2777
2778
2779 sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
2780 fi
2781 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
2782 $srcdir/po2tbl.sed.in > po2tbl.sed
2783 fi
2784
2785 if test "$PACKAGE" = "gettext"; then
2786 GT_NO="#NO#"
2787 GT_YES=
2788 else
2789 GT_NO=
2790 GT_YES="#YES#"
2791 fi
2792
2793
2794
2795 MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
2796
2797
2798 l=
2799
2800
4536bbc6 2801 if test -f $srcdir/po/POTFILES.in; then
c906108c
SS
2802 test -d po || mkdir po
2803 if test "x$srcdir" != "x."; then
2804 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2805 posrcprefix="$srcdir/"
2806 else
2807 posrcprefix="../$srcdir/"
2808 fi
2809 else
2810 posrcprefix="../"
2811 fi
2812 rm -f po/POTFILES
2813 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2814 < $srcdir/po/POTFILES.in > po/POTFILES
2815 fi
2816
0fbb3da7
TT
2817cat >> confdefs.h <<\EOF
2818#define PACKAGE "gdb"
2819EOF
2820
2821
c906108c
SS
2822
2823
2824CONFIG_OBS=
66b965bb 2825CONFIG_LIB_OBS=
c906108c
SS
2826CONFIG_DEPS=
2827CONFIG_SRCS=
fb40c209
AC
2828CONFIG_INITS=
2829ENABLE_CFLAGS=
b3a90332
AC
2830CONFIG_ALL=
2831CONFIG_CLEAN=
e56ac5c3
AC
2832CONFIG_INSTALL=
2833CONFIG_UNINSTALL=
c906108c 2834
ffc6a242 2835SUBDIRS="doc testsuite nlm"
c906108c
SS
2836configdirs="doc testsuite"
2837
96baa820
JM
2838# Check whether --enable-multi-ice or --disable-multi-ice was given.
2839if test "${enable_multi_ice+set}" = set; then
2840 enableval="$enable_multi_ice"
2841 case "${enableval}" in
2842 yes ) enable_multi_ice="yes" ;;
2843 no) enable_multi_ice="no" ;;
2844 *) { echo "configure: error: Bad value for --enable-multi-ice: ${enableval}" 1>&2; exit 1; } ;;
2845 esac
2846
2847fi
2848
2849
2850if test "${enable_multi_ice}" = "yes"; then
2851 configdirs="${configdirs} multi-ice"
2852fi
2853
c906108c
SS
2854
2855. ${srcdir}/configure.host
2856
2857. ${srcdir}/configure.tgt
2858
1ba607ad
AC
2859targ=${target} ; . ${srcdir}/../bfd/config.bfd
2860
2861
2862targ=${target}
2863. ${srcdir}/../bfd/config.bfd
5c8cc331
AC
2864
2865targ_archs=`echo ${targ_archs} | sed -e 's/ .*//;'`
2866
1ba607ad
AC
2867if test x"${targ_archs}" != x ; then
2868 cat >> confdefs.h <<EOF
2869#define DEFAULT_BFD_ARCH ${targ_archs}
2870EOF
2871
2872fi
2873if test x"${targ_defvec}" != x ; then
2874 cat >> confdefs.h <<EOF
2875#define DEFAULT_BFD_VEC ${targ_defvec}
2876EOF
2877
2878fi
c906108c 2879
b2a1bd4f 2880for ac_prog in gawk mawk nawk awk
7a292a7a
SS
2881do
2882# Extract the first word of "$ac_prog", so it can be a program name with args.
2883set dummy $ac_prog; ac_word=$2
2884echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2885echo "configure:2886: checking for $ac_word" >&5
7a292a7a
SS
2886if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2887 echo $ac_n "(cached) $ac_c" 1>&6
2888else
2889 if test -n "$AWK"; then
2890 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2891else
2892 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2893 ac_dummy="$PATH"
2894 for ac_dir in $ac_dummy; do
2895 test -z "$ac_dir" && ac_dir=.
2896 if test -f $ac_dir/$ac_word; then
2897 ac_cv_prog_AWK="$ac_prog"
2898 break
2899 fi
2900 done
2901 IFS="$ac_save_ifs"
2902fi
2903fi
2904AWK="$ac_cv_prog_AWK"
2905if test -n "$AWK"; then
2906 echo "$ac_t""$AWK" 1>&6
2907else
2908 echo "$ac_t""no" 1>&6
2909fi
2910
2911test -n "$AWK" && break
2912done
2913
c906108c
SS
2914# Find a good install program. We prefer a C program (faster),
2915# so one script is as good as another. But avoid the broken or
2916# incompatible versions:
2917# SysV /etc/install, /usr/sbin/install
2918# SunOS /usr/etc/install
2919# IRIX /sbin/install
2920# AIX /bin/install
2921# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2922# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2923# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2924# ./install, which can be erroneously created by make from ./install.sh.
2925echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
8ec41317 2926echo "configure:2927: checking for a BSD compatible install" >&5
c906108c
SS
2927if test -z "$INSTALL"; then
2928if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2929 echo $ac_n "(cached) $ac_c" 1>&6
2930else
2931 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
2932 for ac_dir in $PATH; do
2933 # Account for people who put trailing slashes in PATH elements.
2934 case "$ac_dir/" in
2935 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2936 *)
2937 # OSF1 and SCO ODT 3.0 have their own names for install.
2938 # Don't use installbsd from OSF since it installs stuff as root
2939 # by default.
2940 for ac_prog in ginstall scoinst install; do
2941 if test -f $ac_dir/$ac_prog; then
2942 if test $ac_prog = install &&
2943 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2944 # AIX install. It has an incompatible calling convention.
2945 :
2946 else
2947 ac_cv_path_install="$ac_dir/$ac_prog -c"
2948 break 2
2949 fi
2950 fi
2951 done
2952 ;;
2953 esac
2954 done
2955 IFS="$ac_save_IFS"
2956
2957fi
2958 if test "${ac_cv_path_install+set}" = set; then
2959 INSTALL="$ac_cv_path_install"
2960 else
2961 # As a last resort, use the slow shell script. We don't cache a
2962 # path for INSTALL within a source directory, because that will
2963 # break other packages using the cache if that directory is
2964 # removed, or if the path is relative.
2965 INSTALL="$ac_install_sh"
2966 fi
2967fi
2968echo "$ac_t""$INSTALL" 1>&6
2969
2970# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2971# It thinks the first close brace ends the variable substitution.
2972test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2973
2974test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
2975
2976test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2977
2978if test $host != $build; then
2979 ac_tool_prefix=${host_alias}-
2980else
2981 ac_tool_prefix=
2982fi
2983
2984# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
2985set dummy ${ac_tool_prefix}ar; ac_word=$2
2986echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 2987echo "configure:2988: checking for $ac_word" >&5
c906108c
SS
2988if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
2989 echo $ac_n "(cached) $ac_c" 1>&6
2990else
2991 if test -n "$AR"; then
2992 ac_cv_prog_AR="$AR" # Let the user override the test.
2993else
2994 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2995 ac_dummy="$PATH"
2996 for ac_dir in $ac_dummy; do
2997 test -z "$ac_dir" && ac_dir=.
2998 if test -f $ac_dir/$ac_word; then
2999 ac_cv_prog_AR="${ac_tool_prefix}ar"
3000 break
3001 fi
3002 done
3003 IFS="$ac_save_ifs"
3004 test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
3005fi
3006fi
3007AR="$ac_cv_prog_AR"
3008if test -n "$AR"; then
3009 echo "$ac_t""$AR" 1>&6
3010else
3011 echo "$ac_t""no" 1>&6
3012fi
3013
3014
3015
3016# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
3017set dummy ${ac_tool_prefix}ranlib; ac_word=$2
3018echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3019echo "configure:3020: checking for $ac_word" >&5
c906108c
SS
3020if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
3021 echo $ac_n "(cached) $ac_c" 1>&6
3022else
3023 if test -n "$RANLIB"; then
3024 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3025else
3026 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3027 ac_dummy="$PATH"
3028 for ac_dir in $ac_dummy; do
3029 test -z "$ac_dir" && ac_dir=.
3030 if test -f $ac_dir/$ac_word; then
3031 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
3032 break
3033 fi
3034 done
3035 IFS="$ac_save_ifs"
3036fi
3037fi
3038RANLIB="$ac_cv_prog_RANLIB"
3039if test -n "$RANLIB"; then
3040 echo "$ac_t""$RANLIB" 1>&6
3041else
3042 echo "$ac_t""no" 1>&6
3043fi
3044
3045
3046if test -z "$ac_cv_prog_RANLIB"; then
3047if test -n "$ac_tool_prefix"; then
3048 # Extract the first word of "ranlib", so it can be a program name with args.
3049set dummy ranlib; ac_word=$2
3050echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3051echo "configure:3052: checking for $ac_word" >&5
c906108c
SS
3052if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
3053 echo $ac_n "(cached) $ac_c" 1>&6
3054else
3055 if test -n "$RANLIB"; then
3056 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
3057else
3058 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3059 ac_dummy="$PATH"
3060 for ac_dir in $ac_dummy; do
3061 test -z "$ac_dir" && ac_dir=.
3062 if test -f $ac_dir/$ac_word; then
3063 ac_cv_prog_RANLIB="ranlib"
3064 break
3065 fi
3066 done
3067 IFS="$ac_save_ifs"
3068 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
3069fi
3070fi
3071RANLIB="$ac_cv_prog_RANLIB"
3072if test -n "$RANLIB"; then
3073 echo "$ac_t""$RANLIB" 1>&6
3074else
3075 echo "$ac_t""no" 1>&6
3076fi
3077
3078else
3079 RANLIB=":"
3080fi
3081fi
3082
95ca63c4
CF
3083# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
3084set dummy ${ac_tool_prefix}dlltool; ac_word=$2
3085echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3086echo "configure:3087: checking for $ac_word" >&5
95ca63c4
CF
3087if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
3088 echo $ac_n "(cached) $ac_c" 1>&6
3089else
3090 if test -n "$DLLTOOL"; then
3091 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
3092else
3093 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3094 ac_dummy="$PATH"
3095 for ac_dir in $ac_dummy; do
3096 test -z "$ac_dir" && ac_dir=.
3097 if test -f $ac_dir/$ac_word; then
3098 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
3099 break
3100 fi
3101 done
3102 IFS="$ac_save_ifs"
3103 test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool"
3104fi
3105fi
3106DLLTOOL="$ac_cv_prog_DLLTOOL"
3107if test -n "$DLLTOOL"; then
3108 echo "$ac_t""$DLLTOOL" 1>&6
3109else
3110 echo "$ac_t""no" 1>&6
3111fi
3112
3113
3114
3115# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
3116set dummy ${ac_tool_prefix}windres; ac_word=$2
3117echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3118echo "configure:3119: checking for $ac_word" >&5
95ca63c4
CF
3119if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
3120 echo $ac_n "(cached) $ac_c" 1>&6
3121else
3122 if test -n "$WINDRES"; then
3123 ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
3124else
3125 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3126 ac_dummy="$PATH"
3127 for ac_dir in $ac_dummy; do
3128 test -z "$ac_dir" && ac_dir=.
3129 if test -f $ac_dir/$ac_word; then
3130 ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
3131 break
3132 fi
3133 done
3134 IFS="$ac_save_ifs"
3135 test -z "$ac_cv_prog_WINDRES" && ac_cv_prog_WINDRES="windres"
3136fi
3137fi
3138WINDRES="$ac_cv_prog_WINDRES"
3139if test -n "$WINDRES"; then
3140 echo "$ac_t""$WINDRES" 1>&6
3141else
3142 echo "$ac_t""no" 1>&6
3143fi
3144
3145
3146
c906108c
SS
3147for ac_prog in 'bison -y' byacc
3148do
3149# Extract the first word of "$ac_prog", so it can be a program name with args.
3150set dummy $ac_prog; ac_word=$2
3151echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3152echo "configure:3153: checking for $ac_word" >&5
c906108c
SS
3153if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
3154 echo $ac_n "(cached) $ac_c" 1>&6
3155else
3156 if test -n "$YACC"; then
3157 ac_cv_prog_YACC="$YACC" # Let the user override the test.
3158else
3159 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3160 ac_dummy="$PATH"
3161 for ac_dir in $ac_dummy; do
3162 test -z "$ac_dir" && ac_dir=.
3163 if test -f $ac_dir/$ac_word; then
3164 ac_cv_prog_YACC="$ac_prog"
3165 break
3166 fi
3167 done
3168 IFS="$ac_save_ifs"
3169fi
3170fi
3171YACC="$ac_cv_prog_YACC"
3172if test -n "$YACC"; then
3173 echo "$ac_t""$YACC" 1>&6
3174else
3175 echo "$ac_t""no" 1>&6
3176fi
3177
3178test -n "$YACC" && break
3179done
3180test -n "$YACC" || YACC="yacc"
3181
3182
75c6e08a
MK
3183# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
3184set dummy ${ac_tool_prefix}mig; ac_word=$2
3185echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
8ec41317 3186echo "configure:3187: checking for $ac_word" >&5
75c6e08a
MK
3187if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
3188 echo $ac_n "(cached) $ac_c" 1>&6
3189else
3190 if test -n "$MIG"; then
3191 ac_cv_prog_MIG="$MIG" # Let the user override the test.
3192else
3193 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
3194 ac_dummy="$PATH"
3195 for ac_dir in $ac_dummy; do
3196 test -z "$ac_dir" && ac_dir=.
3197 if test -f $ac_dir/$ac_word; then
3198 ac_cv_prog_MIG="${ac_tool_prefix}mig"
3199 break
3200 fi
3201 done
3202 IFS="$ac_save_ifs"
3203 test -z "$ac_cv_prog_MIG" && ac_cv_prog_MIG="mig"
3204fi
3205fi
3206MIG="$ac_cv_prog_MIG"
3207if test -n "$MIG"; then
3208 echo "$ac_t""$MIG" 1>&6
3209else
3210 echo "$ac_t""no" 1>&6
3211fi
3212
3213
3214
3215
c906108c
SS
3216if test "$program_transform_name" = s,x,x,; then
3217 program_transform_name=
3218else
3219 # Double any \ or $. echo might interpret backslashes.
3220 cat <<\EOF_SED > conftestsed
3221s,\\,\\\\,g; s,\$,$$,g
3222EOF_SED
3223 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
3224 rm -f conftestsed
3225fi
3226test "$program_prefix" != NONE &&
3227 program_transform_name="s,^,${program_prefix},; $program_transform_name"
3228# Use a double $ so make ignores it.
3229test "$program_suffix" != NONE &&
3230 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
3231
3232# sed with no file args requires a program.
3233test "$program_transform_name" = "" && program_transform_name="s,x,x,"
3234
3235
3236echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8ec41317 3237echo "configure:3238: checking return type of signal handlers" >&5
c906108c
SS
3238if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3239 echo $ac_n "(cached) $ac_c" 1>&6
3240else
3241 cat > conftest.$ac_ext <<EOF
8ec41317 3242#line 3243 "configure"
c906108c
SS
3243#include "confdefs.h"
3244#include <sys/types.h>
3245#include <signal.h>
3246#ifdef signal
3247#undef signal
3248#endif
3249#ifdef __cplusplus
3250extern "C" void (*signal (int, void (*)(int)))(int);
3251#else
3252void (*signal ()) ();
3253#endif
3254
3255int main() {
3256int i;
3257; return 0; }
3258EOF
8ec41317 3259if { (eval echo configure:3260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
3260 rm -rf conftest*
3261 ac_cv_type_signal=void
3262else
3263 echo "configure: failed program was:" >&5
3264 cat conftest.$ac_ext >&5
3265 rm -rf conftest*
3266 ac_cv_type_signal=int
3267fi
3268rm -f conftest*
3269fi
3270
3271echo "$ac_t""$ac_cv_type_signal" 1>&6
3272cat >> confdefs.h <<EOF
3273#define RETSIGTYPE $ac_cv_type_signal
3274EOF
3275
3276
3277
3278echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8ec41317 3279echo "configure:3280: checking for ANSI C header files" >&5
c906108c
SS
3280if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3281 echo $ac_n "(cached) $ac_c" 1>&6
3282else
3283 cat > conftest.$ac_ext <<EOF
8ec41317 3284#line 3285 "configure"
c906108c
SS
3285#include "confdefs.h"
3286#include <stdlib.h>
3287#include <stdarg.h>
3288#include <string.h>
3289#include <float.h>
3290EOF
3291ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 3292{ (eval echo configure:3293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
3293ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3294if test -z "$ac_err"; then
3295 rm -rf conftest*
3296 ac_cv_header_stdc=yes
3297else
3298 echo "$ac_err" >&5
3299 echo "configure: failed program was:" >&5
3300 cat conftest.$ac_ext >&5
3301 rm -rf conftest*
3302 ac_cv_header_stdc=no
3303fi
3304rm -f conftest*
3305
3306if test $ac_cv_header_stdc = yes; then
3307 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3308cat > conftest.$ac_ext <<EOF
8ec41317 3309#line 3310 "configure"
c906108c
SS
3310#include "confdefs.h"
3311#include <string.h>
3312EOF
3313if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3314 egrep "memchr" >/dev/null 2>&1; then
3315 :
3316else
3317 rm -rf conftest*
3318 ac_cv_header_stdc=no
3319fi
3320rm -f conftest*
3321
3322fi
3323
3324if test $ac_cv_header_stdc = yes; then
3325 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3326cat > conftest.$ac_ext <<EOF
8ec41317 3327#line 3328 "configure"
c906108c
SS
3328#include "confdefs.h"
3329#include <stdlib.h>
3330EOF
3331if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3332 egrep "free" >/dev/null 2>&1; then
3333 :
3334else
3335 rm -rf conftest*
3336 ac_cv_header_stdc=no
3337fi
3338rm -f conftest*
3339
3340fi
3341
3342if test $ac_cv_header_stdc = yes; then
3343 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3344if test "$cross_compiling" = yes; then
3345 :
3346else
3347 cat > conftest.$ac_ext <<EOF
8ec41317 3348#line 3349 "configure"
c906108c
SS
3349#include "confdefs.h"
3350#include <ctype.h>
3351#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3352#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3353#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3354int main () { int i; for (i = 0; i < 256; i++)
3355if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3356exit (0); }
3357
3358EOF
8ec41317 3359if { (eval echo configure:3360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
3360then
3361 :
3362else
3363 echo "configure: failed program was:" >&5
3364 cat conftest.$ac_ext >&5
3365 rm -fr conftest*
3366 ac_cv_header_stdc=no
3367fi
3368rm -fr conftest*
3369fi
3370
3371fi
3372fi
3373
3374echo "$ac_t""$ac_cv_header_stdc" 1>&6
3375if test $ac_cv_header_stdc = yes; then
3376 cat >> confdefs.h <<\EOF
3377#define STDC_HEADERS 1
3378EOF
3379
3380fi
3381
3382
6abadcf8 3383
3e0bf9f1 3384case $host_os in solaris2.7 | solaris2.8) case "$GCC" in yes)
6abadcf8
ND
3385 cat >> confdefs.h <<\EOF
3386#define _MSE_INT_H 1
3387EOF
3388
3389esac; esac
3390
9299404e 3391for ac_hdr in ctype.h nlist.h link.h thread_db.h proc_service.h \
c906108c 3392 memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
f15f768e 3393 string.h sys/procfs.h sys/proc.h sys/ptrace.h sys/reg.h stdint.h \
c906108c 3394 term.h termio.h termios.h unistd.h wait.h sys/wait.h \
104c1213 3395 wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
596c9d4b 3396 time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
0cf3e697 3397 dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
409a3f64
AC
3398 curses.h ncurses.h \
3399 poll.h sys/poll.h
c906108c
SS
3400do
3401ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3402echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8ec41317 3403echo "configure:3404: checking for $ac_hdr" >&5
c906108c
SS
3404if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3405 echo $ac_n "(cached) $ac_c" 1>&6
3406else
3407 cat > conftest.$ac_ext <<EOF
8ec41317 3408#line 3409 "configure"
c906108c
SS
3409#include "confdefs.h"
3410#include <$ac_hdr>
3411EOF
3412ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 3413{ (eval echo configure:3414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
3414ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3415if test -z "$ac_err"; then
3416 rm -rf conftest*
3417 eval "ac_cv_header_$ac_safe=yes"
3418else
3419 echo "$ac_err" >&5
3420 echo "configure: failed program was:" >&5
3421 cat conftest.$ac_ext >&5
3422 rm -rf conftest*
3423 eval "ac_cv_header_$ac_safe=no"
3424fi
3425rm -f conftest*
3426fi
3427if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3428 echo "$ac_t""yes" 1>&6
3429 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3430 cat >> confdefs.h <<EOF
3431#define $ac_tr_hdr 1
3432EOF
3433
3434else
3435 echo "$ac_t""no" 1>&6
3436fi
3437done
3438
3439echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
8ec41317 3440echo "configure:3441: checking whether stat file-mode macros are broken" >&5
c906108c
SS
3441if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
3442 echo $ac_n "(cached) $ac_c" 1>&6
3443else
3444 cat > conftest.$ac_ext <<EOF
8ec41317 3445#line 3446 "configure"
c906108c
SS
3446#include "confdefs.h"
3447#include <sys/types.h>
3448#include <sys/stat.h>
3449
3450#if defined(S_ISBLK) && defined(S_IFDIR)
3451# if S_ISBLK (S_IFDIR)
3452You lose.
3453# endif
3454#endif
3455
3456#if defined(S_ISBLK) && defined(S_IFCHR)
3457# if S_ISBLK (S_IFCHR)
3458You lose.
3459# endif
3460#endif
3461
3462#if defined(S_ISLNK) && defined(S_IFREG)
3463# if S_ISLNK (S_IFREG)
3464You lose.
3465# endif
3466#endif
3467
3468#if defined(S_ISSOCK) && defined(S_IFREG)
3469# if S_ISSOCK (S_IFREG)
3470You lose.
3471# endif
3472#endif
3473
3474EOF
3475if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3476 egrep "You lose" >/dev/null 2>&1; then
3477 rm -rf conftest*
3478 ac_cv_header_stat_broken=yes
3479else
3480 rm -rf conftest*
3481 ac_cv_header_stat_broken=no
3482fi
3483rm -f conftest*
3484
3485fi
3486
3487echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
3488if test $ac_cv_header_stat_broken = yes; then
3489 cat >> confdefs.h <<\EOF
3490#define STAT_MACROS_BROKEN 1
3491EOF
3492
3493fi
3494
3495
3496echo $ac_n "checking for working const""... $ac_c" 1>&6
8ec41317 3497echo "configure:3498: checking for working const" >&5
c906108c
SS
3498if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
3499 echo $ac_n "(cached) $ac_c" 1>&6
3500else
3501 cat > conftest.$ac_ext <<EOF
8ec41317 3502#line 3503 "configure"
c906108c
SS
3503#include "confdefs.h"
3504
3505int main() {
3506
3507/* Ultrix mips cc rejects this. */
3508typedef int charset[2]; const charset x;
3509/* SunOS 4.1.1 cc rejects this. */
3510char const *const *ccp;
3511char **p;
3512/* NEC SVR4.0.2 mips cc rejects this. */
3513struct point {int x, y;};
3514static struct point const zero = {0,0};
3515/* AIX XL C 1.02.0.0 rejects this.
3516 It does not let you subtract one const X* pointer from another in an arm
3517 of an if-expression whose if-part is not a constant expression */
3518const char *g = "string";
3519ccp = &g + (g ? g-g : 0);
3520/* HPUX 7.0 cc rejects these. */
3521++ccp;
3522p = (char**) ccp;
3523ccp = (char const *const *) p;
3524{ /* SCO 3.2v4 cc rejects this. */
3525 char *t;
3526 char const *s = 0 ? (char *) 0 : (char const *) 0;
3527
3528 *t++ = 0;
3529}
3530{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
3531 int x[] = {25, 17};
3532 const int *foo = &x[0];
3533 ++foo;
3534}
3535{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3536 typedef const int *iptr;
3537 iptr p = 0;
3538 ++p;
3539}
3540{ /* AIX XL C 1.02.0.0 rejects this saying
3541 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3542 struct s { int j; const int *ap[3]; };
3543 struct s *b; b->j = 5;
3544}
3545{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3546 const int foo = 10;
3547}
3548
3549; return 0; }
3550EOF
8ec41317 3551if { (eval echo configure:3552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
3552 rm -rf conftest*
3553 ac_cv_c_const=yes
3554else
3555 echo "configure: failed program was:" >&5
3556 cat conftest.$ac_ext >&5
3557 rm -rf conftest*
3558 ac_cv_c_const=no
3559fi
3560rm -f conftest*
3561fi
3562
3563echo "$ac_t""$ac_cv_c_const" 1>&6
3564if test $ac_cv_c_const = no; then
3565 cat >> confdefs.h <<\EOF
3566#define const
3567EOF
3568
3569fi
3570
bce58c09 3571echo $ac_n "checking for inline""... $ac_c" 1>&6
8ec41317 3572echo "configure:3573: checking for inline" >&5
bce58c09
JB
3573if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
3574 echo $ac_n "(cached) $ac_c" 1>&6
3575else
3576 ac_cv_c_inline=no
3577for ac_kw in inline __inline__ __inline; do
3578 cat > conftest.$ac_ext <<EOF
8ec41317 3579#line 3580 "configure"
bce58c09
JB
3580#include "confdefs.h"
3581
3582int main() {
3583} $ac_kw foo() {
3584; return 0; }
3585EOF
8ec41317 3586if { (eval echo configure:3587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
bce58c09
JB
3587 rm -rf conftest*
3588 ac_cv_c_inline=$ac_kw; break
3589else
3590 echo "configure: failed program was:" >&5
3591 cat conftest.$ac_ext >&5
3592fi
3593rm -f conftest*
3594done
3595
3596fi
3597
3598echo "$ac_t""$ac_cv_c_inline" 1>&6
3599case "$ac_cv_c_inline" in
3600 inline | yes) ;;
3601 no) cat >> confdefs.h <<\EOF
3602#define inline
3603EOF
3604 ;;
3605 *) cat >> confdefs.h <<EOF
3606#define inline $ac_cv_c_inline
3607EOF
3608 ;;
3609esac
3610
c906108c 3611
27aac7ff
AC
3612for ac_func in bcopy btowc bzero canonicalize_file_name isascii poll \
3613 realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask
c906108c
SS
3614do
3615echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 3616echo "configure:3617: checking for $ac_func" >&5
c906108c
SS
3617if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3618 echo $ac_n "(cached) $ac_c" 1>&6
3619else
3620 cat > conftest.$ac_ext <<EOF
8ec41317 3621#line 3622 "configure"
c906108c
SS
3622#include "confdefs.h"
3623/* System header to define __stub macros and hopefully few prototypes,
3624 which can conflict with char $ac_func(); below. */
3625#include <assert.h>
3626/* Override any gcc2 internal prototype to avoid an error. */
3627/* We use char because int might match the return type of a gcc2
3628 builtin and then its argument prototype would still apply. */
3629char $ac_func();
3630
3631int main() {
3632
3633/* The GNU C library defines this for functions which it implements
3634 to always fail with ENOSYS. Some functions are actually named
3635 something starting with __ and the normal name is an alias. */
3636#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3637choke me
3638#else
3639$ac_func();
3640#endif
3641
3642; return 0; }
3643EOF
8ec41317 3644if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
3645 rm -rf conftest*
3646 eval "ac_cv_func_$ac_func=yes"
3647else
3648 echo "configure: failed program was:" >&5
3649 cat conftest.$ac_ext >&5
3650 rm -rf conftest*
3651 eval "ac_cv_func_$ac_func=no"
3652fi
3653rm -f conftest*
3654fi
3655
3656if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3657 echo "$ac_t""yes" 1>&6
3658 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3659 cat >> confdefs.h <<EOF
3660#define $ac_tr_func 1
3661EOF
3662
3663else
3664 echo "$ac_t""no" 1>&6
3665fi
3666done
3667
46711df8
MK
3668# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
3669# for constant arguments. Useless!
3670echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
8ec41317 3671echo "configure:3672: checking for working alloca.h" >&5
46711df8
MK
3672if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
3673 echo $ac_n "(cached) $ac_c" 1>&6
3674else
3675 cat > conftest.$ac_ext <<EOF
8ec41317 3676#line 3677 "configure"
46711df8
MK
3677#include "confdefs.h"
3678#include <alloca.h>
3679int main() {
3680char *p = alloca(2 * sizeof(int));
3681; return 0; }
3682EOF
8ec41317 3683if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
46711df8
MK
3684 rm -rf conftest*
3685 ac_cv_header_alloca_h=yes
3686else
3687 echo "configure: failed program was:" >&5
3688 cat conftest.$ac_ext >&5
3689 rm -rf conftest*
3690 ac_cv_header_alloca_h=no
3691fi
3692rm -f conftest*
3693fi
3694
3695echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
3696if test $ac_cv_header_alloca_h = yes; then
3697 cat >> confdefs.h <<\EOF
3698#define HAVE_ALLOCA_H 1
3699EOF
3700
3701fi
3702
3703echo $ac_n "checking for alloca""... $ac_c" 1>&6
8ec41317 3704echo "configure:3705: checking for alloca" >&5
46711df8
MK
3705if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
3706 echo $ac_n "(cached) $ac_c" 1>&6
3707else
3708 cat > conftest.$ac_ext <<EOF
8ec41317 3709#line 3710 "configure"
46711df8
MK
3710#include "confdefs.h"
3711
3712#ifdef __GNUC__
3713# define alloca __builtin_alloca
3714#else
3715# ifdef _MSC_VER
3716# include <malloc.h>
3717# define alloca _alloca
3718# else
3719# if HAVE_ALLOCA_H
3720# include <alloca.h>
3721# else
3722# ifdef _AIX
3723 #pragma alloca
3724# else
3725# ifndef alloca /* predefined by HP cc +Olibcalls */
3726char *alloca ();
3727# endif
3728# endif
3729# endif
3730# endif
3731#endif
3732
3733int main() {
3734char *p = (char *) alloca(1);
3735; return 0; }
3736EOF
8ec41317 3737if { (eval echo configure:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
46711df8
MK
3738 rm -rf conftest*
3739 ac_cv_func_alloca_works=yes
3740else
3741 echo "configure: failed program was:" >&5
3742 cat conftest.$ac_ext >&5
3743 rm -rf conftest*
3744 ac_cv_func_alloca_works=no
3745fi
3746rm -f conftest*
3747fi
3748
3749echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
3750if test $ac_cv_func_alloca_works = yes; then
3751 cat >> confdefs.h <<\EOF
3752#define HAVE_ALLOCA 1
3753EOF
3754
3755fi
3756
3757if test $ac_cv_func_alloca_works = no; then
3758 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
3759 # that cause trouble. Some versions do not even contain alloca or
3760 # contain a buggy version. If you still want to use their alloca,
3761 # use ar to extract alloca.o from them instead of compiling alloca.c.
3762 ALLOCA=alloca.${ac_objext}
3763 cat >> confdefs.h <<\EOF
3764#define C_ALLOCA 1
3765EOF
3766
3767
3768echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
8ec41317 3769echo "configure:3770: checking whether alloca needs Cray hooks" >&5
46711df8
MK
3770if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
3771 echo $ac_n "(cached) $ac_c" 1>&6
3772else
3773 cat > conftest.$ac_ext <<EOF
8ec41317 3774#line 3775 "configure"
46711df8
MK
3775#include "confdefs.h"
3776#if defined(CRAY) && ! defined(CRAY2)
3777webecray
3778#else
3779wenotbecray
3780#endif
3781
3782EOF
3783if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3784 egrep "webecray" >/dev/null 2>&1; then
3785 rm -rf conftest*
3786 ac_cv_os_cray=yes
3787else
3788 rm -rf conftest*
3789 ac_cv_os_cray=no
3790fi
3791rm -f conftest*
3792
3793fi
3794
3795echo "$ac_t""$ac_cv_os_cray" 1>&6
3796if test $ac_cv_os_cray = yes; then
3797for ac_func in _getb67 GETB67 getb67; do
3798 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 3799echo "configure:3800: checking for $ac_func" >&5
46711df8
MK
3800if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3801 echo $ac_n "(cached) $ac_c" 1>&6
3802else
3803 cat > conftest.$ac_ext <<EOF
8ec41317 3804#line 3805 "configure"
46711df8
MK
3805#include "confdefs.h"
3806/* System header to define __stub macros and hopefully few prototypes,
3807 which can conflict with char $ac_func(); below. */
3808#include <assert.h>
3809/* Override any gcc2 internal prototype to avoid an error. */
3810/* We use char because int might match the return type of a gcc2
3811 builtin and then its argument prototype would still apply. */
3812char $ac_func();
3813
3814int main() {
3815
3816/* The GNU C library defines this for functions which it implements
3817 to always fail with ENOSYS. Some functions are actually named
3818 something starting with __ and the normal name is an alias. */
3819#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3820choke me
3821#else
3822$ac_func();
3823#endif
3824
3825; return 0; }
3826EOF
8ec41317 3827if { (eval echo configure:3828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
46711df8
MK
3828 rm -rf conftest*
3829 eval "ac_cv_func_$ac_func=yes"
3830else
3831 echo "configure: failed program was:" >&5
3832 cat conftest.$ac_ext >&5
3833 rm -rf conftest*
3834 eval "ac_cv_func_$ac_func=no"
3835fi
3836rm -f conftest*
3837fi
3838
3839if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3840 echo "$ac_t""yes" 1>&6
3841 cat >> confdefs.h <<EOF
3842#define CRAY_STACKSEG_END $ac_func
3843EOF
3844
3845 break
3846else
3847 echo "$ac_t""no" 1>&6
3848fi
3849
3850done
3851fi
3852
3853echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
8ec41317 3854echo "configure:3855: checking stack direction for C alloca" >&5
46711df8
MK
3855if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
3856 echo $ac_n "(cached) $ac_c" 1>&6
3857else
3858 if test "$cross_compiling" = yes; then
3859 ac_cv_c_stack_direction=0
3860else
3861 cat > conftest.$ac_ext <<EOF
8ec41317 3862#line 3863 "configure"
46711df8
MK
3863#include "confdefs.h"
3864find_stack_direction ()
3865{
3866 static char *addr = 0;
3867 auto char dummy;
3868 if (addr == 0)
3869 {
3870 addr = &dummy;
3871 return find_stack_direction ();
3872 }
3873 else
3874 return (&dummy > addr) ? 1 : -1;
3875}
3876main ()
3877{
3878 exit (find_stack_direction() < 0);
3879}
3880EOF
8ec41317 3881if { (eval echo configure:3882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
46711df8
MK
3882then
3883 ac_cv_c_stack_direction=1
3884else
3885 echo "configure: failed program was:" >&5
3886 cat conftest.$ac_ext >&5
3887 rm -fr conftest*
3888 ac_cv_c_stack_direction=-1
3889fi
3890rm -fr conftest*
3891fi
3892
3893fi
3894
3895echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
3896cat >> confdefs.h <<EOF
3897#define STACK_DIRECTION $ac_cv_c_stack_direction
3898EOF
3899
3900fi
3901
74c1b268 3902echo $ac_n "checking for pid_t""... $ac_c" 1>&6
8ec41317 3903echo "configure:3904: checking for pid_t" >&5
74c1b268
AC
3904if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
3905 echo $ac_n "(cached) $ac_c" 1>&6
3906else
3907 cat > conftest.$ac_ext <<EOF
8ec41317 3908#line 3909 "configure"
74c1b268
AC
3909#include "confdefs.h"
3910#include <sys/types.h>
3911#if STDC_HEADERS
3912#include <stdlib.h>
3913#include <stddef.h>
3914#endif
3915EOF
3916if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3917 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
3918 rm -rf conftest*
3919 ac_cv_type_pid_t=yes
3920else
3921 rm -rf conftest*
3922 ac_cv_type_pid_t=no
3923fi
3924rm -f conftest*
3925
3926fi
3927echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3928if test $ac_cv_type_pid_t = no; then
3929 cat >> confdefs.h <<\EOF
3930#define pid_t int
3931EOF
3932
3933fi
3934
3935ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
3936echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
8ec41317 3937echo "configure:3938: checking for vfork.h" >&5
74c1b268
AC
3938if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3939 echo $ac_n "(cached) $ac_c" 1>&6
3940else
3941 cat > conftest.$ac_ext <<EOF
8ec41317 3942#line 3943 "configure"
74c1b268
AC
3943#include "confdefs.h"
3944#include <vfork.h>
3945EOF
3946ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 3947{ (eval echo configure:3948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
74c1b268
AC
3948ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3949if test -z "$ac_err"; then
3950 rm -rf conftest*
3951 eval "ac_cv_header_$ac_safe=yes"
3952else
3953 echo "$ac_err" >&5
3954 echo "configure: failed program was:" >&5
3955 cat conftest.$ac_ext >&5
3956 rm -rf conftest*
3957 eval "ac_cv_header_$ac_safe=no"
3958fi
3959rm -f conftest*
3960fi
3961if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3962 echo "$ac_t""yes" 1>&6
3963 cat >> confdefs.h <<\EOF
3964#define HAVE_VFORK_H 1
3965EOF
3966
3967else
3968 echo "$ac_t""no" 1>&6
3969fi
3970
3971echo $ac_n "checking for working vfork""... $ac_c" 1>&6
8ec41317 3972echo "configure:3973: checking for working vfork" >&5
74c1b268
AC
3973if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
3974 echo $ac_n "(cached) $ac_c" 1>&6
3975else
3976 if test "$cross_compiling" = yes; then
3977 echo $ac_n "checking for vfork""... $ac_c" 1>&6
8ec41317 3978echo "configure:3979: checking for vfork" >&5
74c1b268
AC
3979if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
3980 echo $ac_n "(cached) $ac_c" 1>&6
3981else
3982 cat > conftest.$ac_ext <<EOF
8ec41317 3983#line 3984 "configure"
74c1b268
AC
3984#include "confdefs.h"
3985/* System header to define __stub macros and hopefully few prototypes,
3986 which can conflict with char vfork(); below. */
3987#include <assert.h>
3988/* Override any gcc2 internal prototype to avoid an error. */
3989/* We use char because int might match the return type of a gcc2
3990 builtin and then its argument prototype would still apply. */
3991char vfork();
3992
3993int main() {
3994
3995/* The GNU C library defines this for functions which it implements
3996 to always fail with ENOSYS. Some functions are actually named
3997 something starting with __ and the normal name is an alias. */
3998#if defined (__stub_vfork) || defined (__stub___vfork)
3999choke me
4000#else
4001vfork();
4002#endif
4003
4004; return 0; }
4005EOF
8ec41317 4006if { (eval echo configure:4007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
74c1b268
AC
4007 rm -rf conftest*
4008 eval "ac_cv_func_vfork=yes"
4009else
4010 echo "configure: failed program was:" >&5
4011 cat conftest.$ac_ext >&5
4012 rm -rf conftest*
4013 eval "ac_cv_func_vfork=no"
4014fi
4015rm -f conftest*
4016fi
4017
4018if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
4019 echo "$ac_t""yes" 1>&6
4020 :
4021else
4022 echo "$ac_t""no" 1>&6
4023fi
4024
4025ac_cv_func_vfork_works=$ac_cv_func_vfork
4026else
4027 cat > conftest.$ac_ext <<EOF
8ec41317 4028#line 4029 "configure"
74c1b268
AC
4029#include "confdefs.h"
4030/* Thanks to Paul Eggert for this test. */
4031#include <stdio.h>
4032#include <sys/types.h>
4033#include <sys/stat.h>
4034#ifdef HAVE_UNISTD_H
4035#include <unistd.h>
4036#endif
4037#ifdef HAVE_VFORK_H
4038#include <vfork.h>
4039#endif
4040/* On some sparc systems, changes by the child to local and incoming
4041 argument registers are propagated back to the parent.
4042 The compiler is told about this with #include <vfork.h>,
4043 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
4044 Test for this by using a static variable whose address
4045 is put into a register that is clobbered by the vfork. */
4046static
4047#ifdef __cplusplus
4048sparc_address_test (int arg)
4049#else
4050sparc_address_test (arg) int arg;
4051#endif
4052{
4053 static pid_t child;
4054 if (!child) {
4055 child = vfork ();
4056 if (child < 0) {
4057 perror ("vfork");
4058 _exit(2);
4059 }
4060 if (!child) {
4061 arg = getpid();
4062 write(-1, "", 0);
4063 _exit (arg);
4064 }
4065 }
4066}
4067main() {
4068 pid_t parent = getpid ();
4069 pid_t child;
4070
4071 sparc_address_test ();
4072
4073 child = vfork ();
4074
4075 if (child == 0) {
4076 /* Here is another test for sparc vfork register problems.
4077 This test uses lots of local variables, at least
4078 as many local variables as main has allocated so far
4079 including compiler temporaries. 4 locals are enough for
4080 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
4081 A buggy compiler should reuse the register of parent
4082 for one of the local variables, since it will think that
4083 parent can't possibly be used any more in this routine.
4084 Assigning to the local variable will thus munge parent
4085 in the parent process. */
4086 pid_t
4087 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
4088 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
4089 /* Convince the compiler that p..p7 are live; otherwise, it might
4090 use the same hardware register for all 8 local variables. */
4091 if (p != p1 || p != p2 || p != p3 || p != p4
4092 || p != p5 || p != p6 || p != p7)
4093 _exit(1);
4094
4095 /* On some systems (e.g. IRIX 3.3),
4096 vfork doesn't separate parent from child file descriptors.
4097 If the child closes a descriptor before it execs or exits,
4098 this munges the parent's descriptor as well.
4099 Test for this by closing stdout in the child. */
4100 _exit(close(fileno(stdout)) != 0);
4101 } else {
4102 int status;
4103 struct stat st;
4104
4105 while (wait(&status) != child)
4106 ;
4107 exit(
4108 /* Was there some problem with vforking? */
4109 child < 0
4110
4111 /* Did the child fail? (This shouldn't happen.) */
4112 || status
4113
4114 /* Did the vfork/compiler bug occur? */
4115 || parent != getpid()
4116
4117 /* Did the file descriptor bug occur? */
4118 || fstat(fileno(stdout), &st) != 0
4119 );
4120 }
4121}
4122EOF
8ec41317 4123if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
74c1b268
AC
4124then
4125 ac_cv_func_vfork_works=yes
4126else
4127 echo "configure: failed program was:" >&5
4128 cat conftest.$ac_ext >&5
4129 rm -fr conftest*
4130 ac_cv_func_vfork_works=no
4131fi
4132rm -fr conftest*
4133fi
4134
4135fi
4136
4137echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
4138if test $ac_cv_func_vfork_works = no; then
4139 cat >> confdefs.h <<\EOF
4140#define vfork fork
4141EOF
4142
4143fi
4144
72473524
DJ
4145if test "$cross_compiling" = no; then
4146 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
8ec41317 4147echo "configure:4148: checking whether setpgrp takes no argument" >&5
0200359f
MK
4148if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
4149 echo $ac_n "(cached) $ac_c" 1>&6
4150else
4151 if test "$cross_compiling" = yes; then
4152 { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
4153else
4154 cat > conftest.$ac_ext <<EOF
8ec41317 4155#line 4156 "configure"
0200359f
MK
4156#include "confdefs.h"
4157
4158#ifdef HAVE_UNISTD_H
4159#include <unistd.h>
4160#endif
4161
4162/*
4163 * If this system has a BSD-style setpgrp, which takes arguments, exit
4164 * successfully.
4165 */
4166main()
4167{
4168 if (setpgrp(1,1) == -1)
4169 exit(0);
4170 else
4171 exit(1);
4172}
4173
4174EOF
8ec41317 4175if { (eval echo configure:4176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
0200359f
MK
4176then
4177 ac_cv_func_setpgrp_void=no
4178else
4179 echo "configure: failed program was:" >&5
4180 cat conftest.$ac_ext >&5
4181 rm -fr conftest*
4182 ac_cv_func_setpgrp_void=yes
4183fi
4184rm -fr conftest*
4185fi
4186
4187
4188fi
4189
4190echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
4191if test $ac_cv_func_setpgrp_void = yes; then
4192 cat >> confdefs.h <<\EOF
4193#define SETPGRP_VOID 1
4194EOF
4195
4196fi
4197
72473524
DJ
4198else
4199 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
8ec41317 4200echo "configure:4201: checking whether setpgrp takes no argument" >&5
72473524
DJ
4201if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
4202 echo $ac_n "(cached) $ac_c" 1>&6
4203else
4204 cat > conftest.$ac_ext <<EOF
8ec41317 4205#line 4206 "configure"
72473524
DJ
4206#include "confdefs.h"
4207
4208#include <unistd.h>
4209
4210int main() {
4211
4212 if (setpgrp(1,1) == -1)
4213 exit (0);
4214 else
4215 exit (1);
4216
4217; return 0; }
4218EOF
8ec41317 4219if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
72473524
DJ
4220 rm -rf conftest*
4221 ac_cv_func_setpgrp_void=no
4222else
4223 echo "configure: failed program was:" >&5
4224 cat conftest.$ac_ext >&5
4225 rm -rf conftest*
4226 ac_cv_func_setpgrp_void=yes
4227fi
4228rm -f conftest*
4229fi
4230
4231echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
4232if test $ac_cv_func_setpgrp_void = yes; then
4233 cat >> confdefs.h <<\EOF
4234#define SETPGRP_VOID 1
4235EOF
4236
4237fi
4238fi
c906108c 4239
2b2d558c
MK
4240# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
4241# since sigsetjmp might only be defined as a macro.
4242echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
8ec41317 4243echo "configure:4244: checking for sigsetjmp" >&5
2b2d558c
MK
4244if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
4245 echo $ac_n "(cached) $ac_c" 1>&6
4246else
4247 cat > conftest.$ac_ext <<EOF
8ec41317 4248#line 4249 "configure"
2b2d558c
MK
4249#include "confdefs.h"
4250
4251#include <setjmp.h>
4252
4253int main() {
4254sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
4255; return 0; }
4256EOF
8ec41317 4257if { (eval echo configure:4258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2b2d558c
MK
4258 rm -rf conftest*
4259 gdb_cv_func_sigsetjmp=yes
4260else
4261 echo "configure: failed program was:" >&5
4262 cat conftest.$ac_ext >&5
4263 rm -rf conftest*
4264 gdb_cv_func_sigsetjmp=no
4265fi
4266rm -f conftest*
4267fi
4268
4269echo "$ac_t""$gdb_cv_func_sigsetjmp" 1>&6
4270if test $gdb_cv_func_sigsetjmp = yes; then
4271 cat >> confdefs.h <<\EOF
4272#define HAVE_SIGSETJMP 1
4273EOF
4274
4275fi
4276
0afdd437 4277# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
7dfa765c
MK
4278# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
4279echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
8ec41317 4280echo "configure:4281: checking for r_fs in struct reg" >&5
422ea4b8 4281if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
7dfa765c
MK
4282 echo $ac_n "(cached) $ac_c" 1>&6
4283else
4284 cat > conftest.$ac_ext <<EOF
8ec41317 4285#line 4286 "configure"
7dfa765c
MK
4286#include "confdefs.h"
4287#include <machine/reg.h>
4288int main() {
4289struct reg r; r.r_fs;
4290; return 0; }
4291EOF
8ec41317 4292if { (eval echo configure:4293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7dfa765c 4293 rm -rf conftest*
422ea4b8 4294 gdb_cv_struct_reg_r_fs=yes
7dfa765c
MK
4295else
4296 echo "configure: failed program was:" >&5
4297 cat conftest.$ac_ext >&5
4298 rm -rf conftest*
422ea4b8 4299 gdb_cv_struct_reg_r_fs=no
7dfa765c
MK
4300fi
4301rm -f conftest*
4302fi
4303
422ea4b8
MK
4304echo "$ac_t""$gdb_cv_struct_reg_r_fs" 1>&6
4305if test $gdb_cv_struct_reg_r_fs = yes; then
7dfa765c 4306 cat >> confdefs.h <<\EOF
422ea4b8 4307#define HAVE_STRUCT_REG_R_FS 1
7dfa765c
MK
4308EOF
4309
4310fi
4311echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
8ec41317 4312echo "configure:4313: checking for r_gs in struct reg" >&5
422ea4b8 4313if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
7dfa765c
MK
4314 echo $ac_n "(cached) $ac_c" 1>&6
4315else
4316 cat > conftest.$ac_ext <<EOF
8ec41317 4317#line 4318 "configure"
7dfa765c
MK
4318#include "confdefs.h"
4319#include <machine/reg.h>
4320int main() {
4321struct reg r; r.r_gs;
4322; return 0; }
4323EOF
8ec41317 4324if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7dfa765c 4325 rm -rf conftest*
422ea4b8 4326 gdb_cv_struct_reg_r_gs=yes
7dfa765c
MK
4327else
4328 echo "configure: failed program was:" >&5
4329 cat conftest.$ac_ext >&5
4330 rm -rf conftest*
422ea4b8 4331 gdb_cv_struct_reg_r_gs=no
7dfa765c
MK
4332fi
4333rm -f conftest*
4334fi
4335
422ea4b8
MK
4336echo "$ac_t""$gdb_cv_struct_reg_r_gs" 1>&6
4337if test $gdb_cv_struct_reg_r_gs = yes; then
7dfa765c 4338 cat >> confdefs.h <<\EOF
422ea4b8 4339#define HAVE_STRUCT_REG_R_GS 1
7dfa765c
MK
4340EOF
4341
4342fi
4343
0afdd437 4344# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
64bb1671 4345echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
8ec41317 4346echo "configure:4347: checking for PTRACE_GETREGS" >&5
64bb1671
MK
4347if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
4348 echo $ac_n "(cached) $ac_c" 1>&6
4349else
4350 cat > conftest.$ac_ext <<EOF
8ec41317 4351#line 4352 "configure"
64bb1671
MK
4352#include "confdefs.h"
4353#include <sys/ptrace.h>
4354int main() {
4355PTRACE_GETREGS;
4356; return 0; }
4357EOF
8ec41317 4358if { (eval echo configure:4359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
64bb1671
MK
4359 rm -rf conftest*
4360 gdb_cv_have_ptrace_getregs=yes
4361else
4362 echo "configure: failed program was:" >&5
4363 cat conftest.$ac_ext >&5
4364 rm -rf conftest*
4365 gdb_cv_have_ptrace_getregs=no
4366fi
4367rm -f conftest*
4368fi
4369
4397a6ab 4370echo "$ac_t""$gdb_cv_have_ptrace_getregs" 1>&6
64bb1671
MK
4371if test $gdb_cv_have_ptrace_getregs = yes; then
4372 cat >> confdefs.h <<\EOF
4373#define HAVE_PTRACE_GETREGS 1
4374EOF
4375
4376fi
4377
0afdd437 4378# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
6ce2ac0b 4379echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
8ec41317 4380echo "configure:4381: checking for PTRACE_GETFPXREGS" >&5
6ce2ac0b 4381if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
5c44784c
JM
4382 echo $ac_n "(cached) $ac_c" 1>&6
4383else
4384 cat > conftest.$ac_ext <<EOF
8ec41317 4385#line 4386 "configure"
5c44784c
JM
4386#include "confdefs.h"
4387#include <sys/ptrace.h>
4388int main() {
6ce2ac0b 4389PTRACE_GETFPXREGS;
5c44784c
JM
4390; return 0; }
4391EOF
8ec41317 4392if { (eval echo configure:4393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5c44784c 4393 rm -rf conftest*
6ce2ac0b 4394 gdb_cv_have_ptrace_getfpxregs=yes
5c44784c
JM
4395else
4396 echo "configure: failed program was:" >&5
4397 cat conftest.$ac_ext >&5
4398 rm -rf conftest*
6ce2ac0b 4399 gdb_cv_have_ptrace_getfpxregs=no
5c44784c
JM
4400fi
4401rm -f conftest*
4402fi
4403
6ce2ac0b
MK
4404echo "$ac_t""$gdb_cv_have_ptrace_getfpxregs" 1>&6
4405if test $gdb_cv_have_ptrace_getfpxregs = yes; then
5c44784c 4406 cat >> confdefs.h <<\EOF
6ce2ac0b 4407#define HAVE_PTRACE_GETFPXREGS 1
5c44784c
JM
4408EOF
4409
4410fi
4411
0afdd437
MK
4412# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
4413echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
8ec41317 4414echo "configure:4415: checking for PT_GETDBREGS" >&5
0afdd437
MK
4415if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
4416 echo $ac_n "(cached) $ac_c" 1>&6
4417else
4418 cat > conftest.$ac_ext <<EOF
8ec41317 4419#line 4420 "configure"
0afdd437
MK
4420#include "confdefs.h"
4421#include <sys/types.h>
4422#include <sys/ptrace.h>
4423int main() {
4424PT_GETDBREGS;
4425; return 0; }
4426EOF
8ec41317 4427if { (eval echo configure:4428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
0afdd437
MK
4428 rm -rf conftest*
4429 gdb_cv_have_pt_getdbregs=yes
4430else
4431 echo "configure: failed program was:" >&5
4432 cat conftest.$ac_ext >&5
4433 rm -rf conftest*
4434 gdb_cv_have_pt_getdbregs=no
4435fi
4436rm -f conftest*
4437fi
4438
4439echo "$ac_t""$gdb_cv_have_pt_getdbregs" 1>&6
4440if test $gdb_cv_have_pt_getdbregs = yes; then
4441 cat >> confdefs.h <<\EOF
4442#define HAVE_PT_GETDBREGS 1
4443EOF
4444
4445fi
4446
7e89e357
JT
4447# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
4448echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
8ec41317 4449echo "configure:4450: checking for PT_GETXMMREGS" >&5
7e89e357
JT
4450if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
4451 echo $ac_n "(cached) $ac_c" 1>&6
4452else
4453 cat > conftest.$ac_ext <<EOF
8ec41317 4454#line 4455 "configure"
7e89e357
JT
4455#include "confdefs.h"
4456#include <sys/types.h>
4457#include <sys/ptrace.h>
4458int main() {
4459PT_GETXMMREGS;
4460; return 0; }
4461EOF
8ec41317 4462if { (eval echo configure:4463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
7e89e357
JT
4463 rm -rf conftest*
4464 gdb_cv_have_pt_getxmmregs=yes
4465else
4466 echo "configure: failed program was:" >&5
4467 cat conftest.$ac_ext >&5
4468 rm -rf conftest*
4469 gdb_cv_have_pt_getxmmregs=no
4470fi
4471rm -f conftest*
4472fi
4473
4474echo "$ac_t""$gdb_cv_have_pt_getxmmregs" 1>&6
4475if test $gdb_cv_have_pt_getxmmregs = yes; then
4476 cat >> confdefs.h <<\EOF
4477#define HAVE_PT_GETXMMREGS 1
4478EOF
4479
4480fi
4481
0afdd437 4482
7be570e7 4483echo $ac_n "checking for socketpair in -lsocket""... $ac_c" 1>&6
8ec41317 4484echo "configure:4485: checking for socketpair in -lsocket" >&5
7be570e7
JM
4485ac_lib_var=`echo socket'_'socketpair | sed 'y%./+-%__p_%'`
4486if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4487 echo $ac_n "(cached) $ac_c" 1>&6
4488else
4489 ac_save_LIBS="$LIBS"
4490LIBS="-lsocket $LIBS"
4491cat > conftest.$ac_ext <<EOF
8ec41317 4492#line 4493 "configure"
7be570e7
JM
4493#include "confdefs.h"
4494/* Override any gcc2 internal prototype to avoid an error. */
4495/* We use char because int might match the return type of a gcc2
4496 builtin and then its argument prototype would still apply. */
4497char socketpair();
4498
4499int main() {
4500socketpair()
4501; return 0; }
4502EOF
8ec41317 4503if { (eval echo configure:4504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7be570e7
JM
4504 rm -rf conftest*
4505 eval "ac_cv_lib_$ac_lib_var=yes"
4506else
4507 echo "configure: failed program was:" >&5
4508 cat conftest.$ac_ext >&5
4509 rm -rf conftest*
4510 eval "ac_cv_lib_$ac_lib_var=no"
4511fi
4512rm -f conftest*
4513LIBS="$ac_save_LIBS"
4514
4515fi
4516if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4517 echo "$ac_t""yes" 1>&6
4518 ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4519 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4520 cat >> confdefs.h <<EOF
4521#define $ac_tr_lib 1
4522EOF
4523
4524 LIBS="-lsocket $LIBS"
4525
4526else
4527 echo "$ac_t""no" 1>&6
4528fi
4529
4530for ac_func in socketpair
4531do
4532echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 4533echo "configure:4534: checking for $ac_func" >&5
7be570e7
JM
4534if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4535 echo $ac_n "(cached) $ac_c" 1>&6
4536else
4537 cat > conftest.$ac_ext <<EOF
8ec41317 4538#line 4539 "configure"
7be570e7
JM
4539#include "confdefs.h"
4540/* System header to define __stub macros and hopefully few prototypes,
4541 which can conflict with char $ac_func(); below. */
4542#include <assert.h>
4543/* Override any gcc2 internal prototype to avoid an error. */
4544/* We use char because int might match the return type of a gcc2
4545 builtin and then its argument prototype would still apply. */
4546char $ac_func();
4547
4548int main() {
4549
4550/* The GNU C library defines this for functions which it implements
4551 to always fail with ENOSYS. Some functions are actually named
4552 something starting with __ and the normal name is an alias. */
4553#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4554choke me
4555#else
4556$ac_func();
4557#endif
4558
4559; return 0; }
4560EOF
8ec41317 4561if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7be570e7
JM
4562 rm -rf conftest*
4563 eval "ac_cv_func_$ac_func=yes"
4564else
4565 echo "configure: failed program was:" >&5
4566 cat conftest.$ac_ext >&5
4567 rm -rf conftest*
4568 eval "ac_cv_func_$ac_func=no"
4569fi
4570rm -f conftest*
4571fi
4572
4573if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4574 echo "$ac_t""yes" 1>&6
4575 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4576 cat >> confdefs.h <<EOF
4577#define $ac_tr_func 1
4578EOF
4579
4580else
4581 echo "$ac_t""no" 1>&6
4582fi
4583done
4584
4585
4586
c906108c 4587echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
8ec41317 4588echo "configure:4589: checking whether malloc must be declared" >&5
c906108c
SS
4589if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
4590 echo $ac_n "(cached) $ac_c" 1>&6
4591else
4592 cat > conftest.$ac_ext <<EOF
8ec41317 4593#line 4594 "configure"
c906108c
SS
4594#include "confdefs.h"
4595
4596#include <stdio.h>
4597#ifdef HAVE_STRING_H
4598#include <string.h>
4599#else
4600#ifdef HAVE_STRINGS_H
4601#include <strings.h>
4602#endif
4603#endif
4604#ifdef HAVE_STDLIB_H
4605#include <stdlib.h>
4606#endif
4607#ifdef HAVE_UNISTD_H
4608#include <unistd.h>
4609#endif
4610int main() {
4611char *(*pfn) = (char *(*)) malloc
4612; return 0; }
4613EOF
8ec41317 4614if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
4615 rm -rf conftest*
4616 bfd_cv_decl_needed_malloc=no
4617else
4618 echo "configure: failed program was:" >&5
4619 cat conftest.$ac_ext >&5
4620 rm -rf conftest*
4621 bfd_cv_decl_needed_malloc=yes
4622fi
4623rm -f conftest*
4624fi
4625
4626echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
4627if test $bfd_cv_decl_needed_malloc = yes; then
4628 cat >> confdefs.h <<\EOF
4629#define NEED_DECLARATION_MALLOC 1
4630EOF
4631
4632fi
4633
4634echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
8ec41317 4635echo "configure:4636: checking whether realloc must be declared" >&5
c906108c
SS
4636if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
4637 echo $ac_n "(cached) $ac_c" 1>&6
4638else
4639 cat > conftest.$ac_ext <<EOF
8ec41317 4640#line 4641 "configure"
c906108c
SS
4641#include "confdefs.h"
4642
4643#include <stdio.h>
4644#ifdef HAVE_STRING_H
4645#include <string.h>
4646#else
4647#ifdef HAVE_STRINGS_H
4648#include <strings.h>
4649#endif
4650#endif
4651#ifdef HAVE_STDLIB_H
4652#include <stdlib.h>
4653#endif
4654#ifdef HAVE_UNISTD_H
4655#include <unistd.h>
4656#endif
4657int main() {
4658char *(*pfn) = (char *(*)) realloc
4659; return 0; }
4660EOF
8ec41317 4661if { (eval echo configure:4662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
4662 rm -rf conftest*
4663 bfd_cv_decl_needed_realloc=no
4664else
4665 echo "configure: failed program was:" >&5
4666 cat conftest.$ac_ext >&5
4667 rm -rf conftest*
4668 bfd_cv_decl_needed_realloc=yes
4669fi
4670rm -f conftest*
4671fi
4672
4673echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
4674if test $bfd_cv_decl_needed_realloc = yes; then
4675 cat >> confdefs.h <<\EOF
4676#define NEED_DECLARATION_REALLOC 1
4677EOF
4678
4679fi
4680
4681echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
8ec41317 4682echo "configure:4683: checking whether free must be declared" >&5
c906108c
SS
4683if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
4684 echo $ac_n "(cached) $ac_c" 1>&6
4685else
4686 cat > conftest.$ac_ext <<EOF
8ec41317 4687#line 4688 "configure"
c906108c
SS
4688#include "confdefs.h"
4689
4690#include <stdio.h>
4691#ifdef HAVE_STRING_H
4692#include <string.h>
4693#else
4694#ifdef HAVE_STRINGS_H
4695#include <strings.h>
4696#endif
4697#endif
4698#ifdef HAVE_STDLIB_H
4699#include <stdlib.h>
4700#endif
4701#ifdef HAVE_UNISTD_H
4702#include <unistd.h>
4703#endif
4704int main() {
4705char *(*pfn) = (char *(*)) free
4706; return 0; }
4707EOF
8ec41317 4708if { (eval echo configure:4709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
4709 rm -rf conftest*
4710 bfd_cv_decl_needed_free=no
4711else
4712 echo "configure: failed program was:" >&5
4713 cat conftest.$ac_ext >&5
4714 rm -rf conftest*
4715 bfd_cv_decl_needed_free=yes
4716fi
4717rm -f conftest*
4718fi
4719
4720echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
4721if test $bfd_cv_decl_needed_free = yes; then
4722 cat >> confdefs.h <<\EOF
4723#define NEED_DECLARATION_FREE 1
4724EOF
4725
4726fi
4727
4728echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
8ec41317 4729echo "configure:4730: checking whether strerror must be declared" >&5
c906108c
SS
4730if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
4731 echo $ac_n "(cached) $ac_c" 1>&6
4732else
4733 cat > conftest.$ac_ext <<EOF
8ec41317 4734#line 4735 "configure"
c906108c
SS
4735#include "confdefs.h"
4736
4737#include <stdio.h>
4738#ifdef HAVE_STRING_H
4739#include <string.h>
4740#else
4741#ifdef HAVE_STRINGS_H
4742#include <strings.h>
4743#endif
4744#endif
4745#ifdef HAVE_STDLIB_H
4746#include <stdlib.h>
4747#endif
4748#ifdef HAVE_UNISTD_H
4749#include <unistd.h>
4750#endif
4751int main() {
4752char *(*pfn) = (char *(*)) strerror
4753; return 0; }
4754EOF
8ec41317 4755if { (eval echo configure:4756: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
4756 rm -rf conftest*
4757 bfd_cv_decl_needed_strerror=no
4758else
4759 echo "configure: failed program was:" >&5
4760 cat conftest.$ac_ext >&5
4761 rm -rf conftest*
4762 bfd_cv_decl_needed_strerror=yes
4763fi
4764rm -f conftest*
4765fi
4766
4767echo "$ac_t""$bfd_cv_decl_needed_strerror" 1>&6
4768if test $bfd_cv_decl_needed_strerror = yes; then
4769 cat >> confdefs.h <<\EOF
4770#define NEED_DECLARATION_STRERROR 1
4771EOF
4772
4773fi
4774
4775echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
8ec41317 4776echo "configure:4777: checking whether strdup must be declared" >&5
c906108c
SS
4777if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
4778 echo $ac_n "(cached) $ac_c" 1>&6
4779else
4780 cat > conftest.$ac_ext <<EOF
8ec41317 4781#line 4782 "configure"
c906108c
SS
4782#include "confdefs.h"
4783
4784#include <stdio.h>
4785#ifdef HAVE_STRING_H
4786#include <string.h>
4787#else
4788#ifdef HAVE_STRINGS_H
4789#include <strings.h>
4790#endif
4791#endif
4792#ifdef HAVE_STDLIB_H
4793#include <stdlib.h>
4794#endif
4795#ifdef HAVE_UNISTD_H
4796#include <unistd.h>
4797#endif
4798int main() {
4799char *(*pfn) = (char *(*)) strdup
4800; return 0; }
4801EOF
8ec41317 4802if { (eval echo configure:4803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
4803 rm -rf conftest*
4804 bfd_cv_decl_needed_strdup=no
4805else
4806 echo "configure: failed program was:" >&5
4807 cat conftest.$ac_ext >&5
4808 rm -rf conftest*
4809 bfd_cv_decl_needed_strdup=yes
4810fi
4811rm -f conftest*
4812fi
4813
4814echo "$ac_t""$bfd_cv_decl_needed_strdup" 1>&6
4815if test $bfd_cv_decl_needed_strdup = yes; then
4816 cat >> confdefs.h <<\EOF
4817#define NEED_DECLARATION_STRDUP 1
4818EOF
4819
4820fi
4821
b83266a0 4822echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
8ec41317 4823echo "configure:4824: checking whether strstr must be declared" >&5
b83266a0
SS
4824if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
4825 echo $ac_n "(cached) $ac_c" 1>&6
4826else
4827 cat > conftest.$ac_ext <<EOF
8ec41317 4828#line 4829 "configure"
b83266a0
SS
4829#include "confdefs.h"
4830
4831#include <stdio.h>
4832#ifdef HAVE_STRING_H
4833#include <string.h>
4834#else
4835#ifdef HAVE_STRINGS_H
4836#include <strings.h>
4837#endif
4838#endif
4839#ifdef HAVE_STDLIB_H
4840#include <stdlib.h>
4841#endif
4842#ifdef HAVE_UNISTD_H
4843#include <unistd.h>
4844#endif
4845int main() {
4846char *(*pfn) = (char *(*)) strstr
4847; return 0; }
4848EOF
8ec41317 4849if { (eval echo configure:4850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b83266a0
SS
4850 rm -rf conftest*
4851 bfd_cv_decl_needed_strstr=no
4852else
4853 echo "configure: failed program was:" >&5
4854 cat conftest.$ac_ext >&5
4855 rm -rf conftest*
4856 bfd_cv_decl_needed_strstr=yes
4857fi
4858rm -f conftest*
4859fi
4860
4861echo "$ac_t""$bfd_cv_decl_needed_strstr" 1>&6
4862if test $bfd_cv_decl_needed_strstr = yes; then
4863 cat >> confdefs.h <<\EOF
4864#define NEED_DECLARATION_STRSTR 1
4865EOF
4866
4867fi
4868
a4db0f07 4869echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
8ec41317 4870echo "configure:4871: checking whether canonicalize_file_name must be declared" >&5
a4db0f07
RH
4871if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
4872 echo $ac_n "(cached) $ac_c" 1>&6
4873else
4874 cat > conftest.$ac_ext <<EOF
8ec41317 4875#line 4876 "configure"
a4db0f07
RH
4876#include "confdefs.h"
4877
4878#include <stdio.h>
4879#ifdef HAVE_STRING_H
4880#include <string.h>
4881#else
4882#ifdef HAVE_STRINGS_H
4883#include <strings.h>
4884#endif
4885#endif
4886#ifdef HAVE_STDLIB_H
4887#include <stdlib.h>
4888#endif
4889#ifdef HAVE_UNISTD_H
4890#include <unistd.h>
4891#endif
4892int main() {
4893char *(*pfn) = (char *(*)) canonicalize_file_name
4894; return 0; }
4895EOF
8ec41317 4896if { (eval echo configure:4897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
a4db0f07
RH
4897 rm -rf conftest*
4898 bfd_cv_decl_needed_canonicalize_file_name=no
4899else
4900 echo "configure: failed program was:" >&5
4901 cat conftest.$ac_ext >&5
4902 rm -rf conftest*
4903 bfd_cv_decl_needed_canonicalize_file_name=yes
4904fi
4905rm -f conftest*
4906fi
4907
4908echo "$ac_t""$bfd_cv_decl_needed_canonicalize_file_name" 1>&6
4909if test $bfd_cv_decl_needed_canonicalize_file_name = yes; then
4910 cat >> confdefs.h <<\EOF
4911#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1
4912EOF
4913
4914fi
c906108c
SS
4915
4916
4917# The following save_state_t checkery is only necessary for HPUX
4918# versions earlier than 10.20. When those fade from memory, this
4919# could be expunged. --jsm 1999-03-22
4920
4921echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
8ec41317 4922echo "configure:4923: checking for HPUX save_state structure" >&5
c906108c 4923cat > conftest.$ac_ext <<EOF
8ec41317 4924#line 4925 "configure"
c906108c
SS
4925#include "confdefs.h"
4926#include <machine/save_state.h>
4927EOF
4928if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4929 egrep "save_state_t" >/dev/null 2>&1; then
4930 rm -rf conftest*
4931 gdb_cv_hpux_savestate=yes
4932else
4933 rm -rf conftest*
4934 gdb_cv_hpux_savestate=no
4935fi
4936rm -f conftest*
4937
4938cat > conftest.$ac_ext <<EOF
8ec41317 4939#line 4940 "configure"
c906108c
SS
4940#include "confdefs.h"
4941#include <machine/save_state.h>
4942EOF
4943if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4944 egrep "ss_wide" >/dev/null 2>&1; then
4945 rm -rf conftest*
4946 gdb_cv_hpux_sswide=yes
4947else
4948 rm -rf conftest*
4949 gdb_cv_hpux_sswide=no
4950fi
4951rm -f conftest*
4952
4953if test $gdb_cv_hpux_savestate = yes
4954then
4955 cat >> confdefs.h <<\EOF
4956#define HAVE_STRUCT_SAVE_STATE_T 1
4957EOF
4958
4959fi
4960if test $gdb_cv_hpux_sswide = yes
4961then
4962 cat >> confdefs.h <<\EOF
4963#define HAVE_STRUCT_MEMBER_SS_WIDE 1
4964EOF
4965
4966fi
4967echo "$ac_t""$gdb_cv_hpux_sswide" 1>&6
4968
4969
4970# If we are configured native on GNU/Linux, work around problems with
4971# sys/procfs.h
c3f6f71d 4972# Also detect which type of /proc is in use, such as for Unixware or Solaris.
c906108c
SS
4973
4974if test "${target}" = "${host}"; then
4975 case "${host}" in
4976 i[3456]86-*-linux*)
4977 cat >> confdefs.h <<\EOF
4978#define START_INFERIOR_TRAPS_EXPECTED 2
4979EOF
4980
4981 cat >> confdefs.h <<\EOF
4982#define sys_quotactl 1
4983EOF
4984
4985 ;;
596c9d4b
KB
4986 ia64-*-aix*)
4987 cat >> confdefs.h <<\EOF
4988#define NEW_PROC_API 1
4989EOF
4990
4991 ;;
1045b512 4992 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
c3f6f71d
JM
4993 cat >> confdefs.h <<\EOF
4994#define NEW_PROC_API 1
c906108c
SS
4995EOF
4996
c3f6f71d 4997 ;;
3423db82 4998 *-*-solaris2.[678])
c3f6f71d
JM
4999 cat >> confdefs.h <<\EOF
5000#define NEW_PROC_API 1
5001EOF
5002
5003 ;;
5004 esac
c906108c
SS
5005fi
5006
5007if test "$ac_cv_header_sys_procfs_h" = yes; then
5008 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5009echo "configure:5010: checking for pstatus_t in sys/procfs.h" >&5
c906108c
SS
5010 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
5011 echo $ac_n "(cached) $ac_c" 1>&6
5012else
5013 cat > conftest.$ac_ext <<EOF
8ec41317 5014#line 5015 "configure"
c906108c 5015#include "confdefs.h"
e17bf198
AO
5016
5017#define _SYSCALL32
c906108c
SS
5018#include <sys/procfs.h>
5019int main() {
5020pstatus_t avar
5021; return 0; }
5022EOF
8ec41317 5023if { (eval echo configure:5024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5024 rm -rf conftest*
5025 bfd_cv_have_sys_procfs_type_pstatus_t=yes
5026else
5027 echo "configure: failed program was:" >&5
5028 cat conftest.$ac_ext >&5
5029 rm -rf conftest*
5030 bfd_cv_have_sys_procfs_type_pstatus_t=no
5031
5032fi
5033rm -f conftest*
5034fi
5035
5036 if test $bfd_cv_have_sys_procfs_type_pstatus_t = yes; then
5037 cat >> confdefs.h <<\EOF
5038#define HAVE_PSTATUS_T 1
5039EOF
5040
5041 fi
5042 echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
5043
5044 echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5045echo "configure:5046: checking for prrun_t in sys/procfs.h" >&5
c906108c
SS
5046 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
5047 echo $ac_n "(cached) $ac_c" 1>&6
5048else
5049 cat > conftest.$ac_ext <<EOF
8ec41317 5050#line 5051 "configure"
c906108c 5051#include "confdefs.h"
e17bf198
AO
5052
5053#define _SYSCALL32
c906108c
SS
5054#include <sys/procfs.h>
5055int main() {
5056prrun_t avar
5057; return 0; }
5058EOF
8ec41317 5059if { (eval echo configure:5060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5060 rm -rf conftest*
5061 bfd_cv_have_sys_procfs_type_prrun_t=yes
5062else
5063 echo "configure: failed program was:" >&5
5064 cat conftest.$ac_ext >&5
5065 rm -rf conftest*
5066 bfd_cv_have_sys_procfs_type_prrun_t=no
5067
5068fi
5069rm -f conftest*
5070fi
5071
5072 if test $bfd_cv_have_sys_procfs_type_prrun_t = yes; then
5073 cat >> confdefs.h <<\EOF
5074#define HAVE_PRRUN_T 1
5075EOF
5076
5077 fi
5078 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
5079
5080 echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5081echo "configure:5082: checking for gregset_t in sys/procfs.h" >&5
c906108c
SS
5082 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
5083 echo $ac_n "(cached) $ac_c" 1>&6
5084else
5085 cat > conftest.$ac_ext <<EOF
8ec41317 5086#line 5087 "configure"
c906108c 5087#include "confdefs.h"
e17bf198
AO
5088
5089#define _SYSCALL32
c906108c
SS
5090#include <sys/procfs.h>
5091int main() {
5092gregset_t avar
5093; return 0; }
5094EOF
8ec41317 5095if { (eval echo configure:5096: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5096 rm -rf conftest*
5097 bfd_cv_have_sys_procfs_type_gregset_t=yes
5098else
5099 echo "configure: failed program was:" >&5
5100 cat conftest.$ac_ext >&5
5101 rm -rf conftest*
5102 bfd_cv_have_sys_procfs_type_gregset_t=no
5103
5104fi
5105rm -f conftest*
5106fi
5107
5108 if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then
5109 cat >> confdefs.h <<\EOF
5110#define HAVE_GREGSET_T 1
5111EOF
5112
5113 fi
5114 echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
5115
5116 echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5117echo "configure:5118: checking for fpregset_t in sys/procfs.h" >&5
c906108c
SS
5118 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
5119 echo $ac_n "(cached) $ac_c" 1>&6
5120else
5121 cat > conftest.$ac_ext <<EOF
8ec41317 5122#line 5123 "configure"
c906108c 5123#include "confdefs.h"
e17bf198
AO
5124
5125#define _SYSCALL32
c906108c
SS
5126#include <sys/procfs.h>
5127int main() {
5128fpregset_t avar
5129; return 0; }
5130EOF
8ec41317 5131if { (eval echo configure:5132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5132 rm -rf conftest*
5133 bfd_cv_have_sys_procfs_type_fpregset_t=yes
5134else
5135 echo "configure: failed program was:" >&5
5136 cat conftest.$ac_ext >&5
5137 rm -rf conftest*
5138 bfd_cv_have_sys_procfs_type_fpregset_t=no
5139
5140fi
5141rm -f conftest*
5142fi
5143
5144 if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then
5145 cat >> confdefs.h <<\EOF
5146#define HAVE_FPREGSET_T 1
5147EOF
5148
5149 fi
5150 echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
5151
3862412b 5152 echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5153echo "configure:5154: checking for prgregset_t in sys/procfs.h" >&5
3862412b
MK
5154 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
5155 echo $ac_n "(cached) $ac_c" 1>&6
5156else
5157 cat > conftest.$ac_ext <<EOF
8ec41317 5158#line 5159 "configure"
3862412b 5159#include "confdefs.h"
e17bf198
AO
5160
5161#define _SYSCALL32
3862412b
MK
5162#include <sys/procfs.h>
5163int main() {
5164prgregset_t avar
5165; return 0; }
5166EOF
8ec41317 5167if { (eval echo configure:5168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3862412b
MK
5168 rm -rf conftest*
5169 bfd_cv_have_sys_procfs_type_prgregset_t=yes
5170else
5171 echo "configure: failed program was:" >&5
5172 cat conftest.$ac_ext >&5
5173 rm -rf conftest*
5174 bfd_cv_have_sys_procfs_type_prgregset_t=no
5175
5176fi
5177rm -f conftest*
5178fi
5179
5180 if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
5181 cat >> confdefs.h <<\EOF
5182#define HAVE_PRGREGSET_T 1
5183EOF
5184
5185 fi
5186 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
5187
5188 echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5189echo "configure:5190: checking for prfpregset_t in sys/procfs.h" >&5
3862412b
MK
5190 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
5191 echo $ac_n "(cached) $ac_c" 1>&6
5192else
5193 cat > conftest.$ac_ext <<EOF
8ec41317 5194#line 5195 "configure"
3862412b 5195#include "confdefs.h"
e17bf198
AO
5196
5197#define _SYSCALL32
3862412b
MK
5198#include <sys/procfs.h>
5199int main() {
5200prfpregset_t avar
5201; return 0; }
5202EOF
8ec41317 5203if { (eval echo configure:5204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3862412b
MK
5204 rm -rf conftest*
5205 bfd_cv_have_sys_procfs_type_prfpregset_t=yes
5206else
5207 echo "configure: failed program was:" >&5
5208 cat conftest.$ac_ext >&5
5209 rm -rf conftest*
5210 bfd_cv_have_sys_procfs_type_prfpregset_t=no
5211
5212fi
5213rm -f conftest*
5214fi
5215
5216 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
5217 cat >> confdefs.h <<\EOF
5218#define HAVE_PRFPREGSET_T 1
5219EOF
5220
5221 fi
5222 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
5223
451928c5 5224 echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5225echo "configure:5226: checking for prgregset32_t in sys/procfs.h" >&5
451928c5
AC
5226 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
5227 echo $ac_n "(cached) $ac_c" 1>&6
5228else
5229 cat > conftest.$ac_ext <<EOF
8ec41317 5230#line 5231 "configure"
451928c5 5231#include "confdefs.h"
e17bf198
AO
5232
5233#define _SYSCALL32
451928c5
AC
5234#include <sys/procfs.h>
5235int main() {
5236prgregset32_t avar
5237; return 0; }
5238EOF
8ec41317 5239if { (eval echo configure:5240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
451928c5
AC
5240 rm -rf conftest*
5241 bfd_cv_have_sys_procfs_type_prgregset32_t=yes
5242else
5243 echo "configure: failed program was:" >&5
5244 cat conftest.$ac_ext >&5
5245 rm -rf conftest*
5246 bfd_cv_have_sys_procfs_type_prgregset32_t=no
5247
5248fi
5249rm -f conftest*
5250fi
5251
5252 if test $bfd_cv_have_sys_procfs_type_prgregset32_t = yes; then
5253 cat >> confdefs.h <<\EOF
5254#define HAVE_PRGREGSET32_T 1
5255EOF
5256
5257 fi
5258 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
5259
5260 echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5261echo "configure:5262: checking for prfpregset32_t in sys/procfs.h" >&5
451928c5
AC
5262 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
5263 echo $ac_n "(cached) $ac_c" 1>&6
5264else
5265 cat > conftest.$ac_ext <<EOF
8ec41317 5266#line 5267 "configure"
451928c5 5267#include "confdefs.h"
e17bf198
AO
5268
5269#define _SYSCALL32
451928c5
AC
5270#include <sys/procfs.h>
5271int main() {
5272prfpregset32_t avar
5273; return 0; }
5274EOF
8ec41317 5275if { (eval echo configure:5276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
451928c5
AC
5276 rm -rf conftest*
5277 bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
5278else
5279 echo "configure: failed program was:" >&5
5280 cat conftest.$ac_ext >&5
5281 rm -rf conftest*
5282 bfd_cv_have_sys_procfs_type_prfpregset32_t=no
5283
5284fi
5285rm -f conftest*
5286fi
5287
5288 if test $bfd_cv_have_sys_procfs_type_prfpregset32_t = yes; then
5289 cat >> confdefs.h <<\EOF
5290#define HAVE_PRFPREGSET32_T 1
5291EOF
5292
5293 fi
5294 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
5295
3862412b 5296 echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5297echo "configure:5298: checking for lwpid_t in sys/procfs.h" >&5
3862412b
MK
5298 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
5299 echo $ac_n "(cached) $ac_c" 1>&6
5300else
5301 cat > conftest.$ac_ext <<EOF
8ec41317 5302#line 5303 "configure"
3862412b 5303#include "confdefs.h"
e17bf198
AO
5304
5305#define _SYSCALL32
3862412b
MK
5306#include <sys/procfs.h>
5307int main() {
5308lwpid_t avar
5309; return 0; }
5310EOF
8ec41317 5311if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3862412b
MK
5312 rm -rf conftest*
5313 bfd_cv_have_sys_procfs_type_lwpid_t=yes
5314else
5315 echo "configure: failed program was:" >&5
5316 cat conftest.$ac_ext >&5
5317 rm -rf conftest*
5318 bfd_cv_have_sys_procfs_type_lwpid_t=no
5319
5320fi
5321rm -f conftest*
5322fi
5323
5324 if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
5325 cat >> confdefs.h <<\EOF
5326#define HAVE_LWPID_T 1
5327EOF
5328
5329 fi
5330 echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
5331
5332 echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5333echo "configure:5334: checking for psaddr_t in sys/procfs.h" >&5
3862412b
MK
5334 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
5335 echo $ac_n "(cached) $ac_c" 1>&6
5336else
5337 cat > conftest.$ac_ext <<EOF
8ec41317 5338#line 5339 "configure"
3862412b 5339#include "confdefs.h"
e17bf198
AO
5340
5341#define _SYSCALL32
3862412b
MK
5342#include <sys/procfs.h>
5343int main() {
5344psaddr_t avar
5345; return 0; }
5346EOF
8ec41317 5347if { (eval echo configure:5348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3862412b
MK
5348 rm -rf conftest*
5349 bfd_cv_have_sys_procfs_type_psaddr_t=yes
5350else
5351 echo "configure: failed program was:" >&5
5352 cat conftest.$ac_ext >&5
5353 rm -rf conftest*
5354 bfd_cv_have_sys_procfs_type_psaddr_t=no
5355
5356fi
5357rm -f conftest*
5358fi
5359
5360 if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
5361 cat >> confdefs.h <<\EOF
5362#define HAVE_PSADDR_T 1
5363EOF
5364
5365 fi
5366 echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
5367
596c9d4b 5368 echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5369echo "configure:5370: checking for prsysent_t in sys/procfs.h" >&5
596c9d4b
KB
5370 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
5371 echo $ac_n "(cached) $ac_c" 1>&6
5372else
5373 cat > conftest.$ac_ext <<EOF
8ec41317 5374#line 5375 "configure"
596c9d4b
KB
5375#include "confdefs.h"
5376
5377#define _SYSCALL32
5378#include <sys/procfs.h>
5379int main() {
5380prsysent_t avar
5381; return 0; }
5382EOF
8ec41317 5383if { (eval echo configure:5384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
596c9d4b
KB
5384 rm -rf conftest*
5385 bfd_cv_have_sys_procfs_type_prsysent_t=yes
5386else
5387 echo "configure: failed program was:" >&5
5388 cat conftest.$ac_ext >&5
5389 rm -rf conftest*
5390 bfd_cv_have_sys_procfs_type_prsysent_t=no
5391
5392fi
5393rm -f conftest*
5394fi
5395
5396 if test $bfd_cv_have_sys_procfs_type_prsysent_t = yes; then
5397 cat >> confdefs.h <<\EOF
5398#define HAVE_PRSYSENT_T 1
5399EOF
5400
5401 fi
5402 echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
5403
5404 echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5405echo "configure:5406: checking for pr_sigset_t in sys/procfs.h" >&5
596c9d4b
KB
5406 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
5407 echo $ac_n "(cached) $ac_c" 1>&6
5408else
5409 cat > conftest.$ac_ext <<EOF
8ec41317 5410#line 5411 "configure"
596c9d4b
KB
5411#include "confdefs.h"
5412
5413#define _SYSCALL32
5414#include <sys/procfs.h>
5415int main() {
5416pr_sigset_t avar
5417; return 0; }
5418EOF
8ec41317 5419if { (eval echo configure:5420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
596c9d4b
KB
5420 rm -rf conftest*
5421 bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
5422else
5423 echo "configure: failed program was:" >&5
5424 cat conftest.$ac_ext >&5
5425 rm -rf conftest*
5426 bfd_cv_have_sys_procfs_type_pr_sigset_t=no
5427
5428fi
5429rm -f conftest*
5430fi
5431
5432 if test $bfd_cv_have_sys_procfs_type_pr_sigset_t = yes; then
5433 cat >> confdefs.h <<\EOF
5434#define HAVE_PR_SIGSET_T 1
5435EOF
5436
5437 fi
5438 echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
5439
5440 echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5441echo "configure:5442: checking for pr_sigaction64_t in sys/procfs.h" >&5
596c9d4b
KB
5442 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
5443 echo $ac_n "(cached) $ac_c" 1>&6
5444else
5445 cat > conftest.$ac_ext <<EOF
8ec41317 5446#line 5447 "configure"
596c9d4b
KB
5447#include "confdefs.h"
5448
5449#define _SYSCALL32
5450#include <sys/procfs.h>
5451int main() {
5452pr_sigaction64_t avar
5453; return 0; }
5454EOF
8ec41317 5455if { (eval echo configure:5456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
596c9d4b
KB
5456 rm -rf conftest*
5457 bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
5458else
5459 echo "configure: failed program was:" >&5
5460 cat conftest.$ac_ext >&5
5461 rm -rf conftest*
5462 bfd_cv_have_sys_procfs_type_pr_sigaction64_t=no
5463
5464fi
5465rm -f conftest*
5466fi
5467
5468 if test $bfd_cv_have_sys_procfs_type_pr_sigaction64_t = yes; then
5469 cat >> confdefs.h <<\EOF
5470#define HAVE_PR_SIGACTION64_T 1
5471EOF
5472
5473 fi
5474 echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
5475
5476 echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5477echo "configure:5478: checking for pr_siginfo64_t in sys/procfs.h" >&5
596c9d4b
KB
5478 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
5479 echo $ac_n "(cached) $ac_c" 1>&6
5480else
5481 cat > conftest.$ac_ext <<EOF
8ec41317 5482#line 5483 "configure"
596c9d4b
KB
5483#include "confdefs.h"
5484
5485#define _SYSCALL32
5486#include <sys/procfs.h>
5487int main() {
5488pr_siginfo64_t avar
5489; return 0; }
5490EOF
8ec41317 5491if { (eval echo configure:5492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
596c9d4b
KB
5492 rm -rf conftest*
5493 bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
5494else
5495 echo "configure: failed program was:" >&5
5496 cat conftest.$ac_ext >&5
5497 rm -rf conftest*
5498 bfd_cv_have_sys_procfs_type_pr_siginfo64_t=no
5499
5500fi
5501rm -f conftest*
5502fi
5503
5504 if test $bfd_cv_have_sys_procfs_type_pr_siginfo64_t = yes; then
5505 cat >> confdefs.h <<\EOF
5506#define HAVE_PR_SIGINFO64_T 1
5507EOF
5508
5509 fi
5510 echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_siginfo64_t" 1>&6
5511
c906108c 5512
451928c5 5513
c906108c 5514
746a987d 5515
d84dd0c5
MK
5516 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
5517 echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
8ec41317 5518echo "configure:5519: checking whether prfpregset_t type is broken" >&5
d84dd0c5
MK
5519 if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
5520 echo $ac_n "(cached) $ac_c" 1>&6
5521else
5522 if test "$cross_compiling" = yes; then
5523 gdb_cv_prfpregset_t_broken=yes
5524else
5525 cat > conftest.$ac_ext <<EOF
8ec41317 5526#line 5527 "configure"
d84dd0c5
MK
5527#include "confdefs.h"
5528#include <sys/procfs.h>
5529 int main ()
5530 {
5531 if (sizeof (prfpregset_t) == sizeof (void *))
5532 return 1;
5533 return 0;
5534 }
5535EOF
8ec41317 5536if { (eval echo configure:5537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
d84dd0c5
MK
5537then
5538 gdb_cv_prfpregset_t_broken=no
5539else
5540 echo "configure: failed program was:" >&5
5541 cat conftest.$ac_ext >&5
5542 rm -fr conftest*
5543 gdb_cv_prfpregset_t_broken=yes
5544fi
5545rm -fr conftest*
5546fi
5547
5548fi
5549
5550 echo "$ac_t""$gdb_cv_prfpregset_t_broken" 1>&6
5551 if test $gdb_cv_prfpregset_t_broken = yes; then
5552 cat >> confdefs.h <<\EOF
5553#define PRFPREGSET_T_BROKEN 1
5554EOF
5555
5556 fi
5557 fi
5558
5559
c906108c 5560 echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
8ec41317 5561echo "configure:5562: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
c906108c
SS
5562 if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
5563 echo $ac_n "(cached) $ac_c" 1>&6
5564else
5565 cat > conftest.$ac_ext <<EOF
8ec41317 5566#line 5567 "configure"
c906108c
SS
5567#include "confdefs.h"
5568#include <unistd.h>
5569#include <sys/types.h>
5570#include <sys/procfs.h>
5571
5572int main() {
5573
5574 int dummy;;
5575 dummy = ioctl(0, PIOCSET, &dummy);
5576
5577; return 0; }
5578EOF
8ec41317 5579if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5580 rm -rf conftest*
5581 gdb_cv_have_procfs_piocset=yes
5582else
5583 echo "configure: failed program was:" >&5
5584 cat conftest.$ac_ext >&5
5585 rm -rf conftest*
5586 gdb_cv_have_procfs_piocset=no
5587fi
5588rm -f conftest*
5589fi
5590
5591 echo "$ac_t""$gdb_cv_have_procfs_piocset" 1>&6
5592 if test $gdb_cv_have_procfs_piocset = yes; then
5593 cat >> confdefs.h <<\EOF
5594#define HAVE_PROCFS_PIOCSET 1
5595EOF
5596
5597 fi
5598fi
5599
d45fe813
KB
5600if test ${host} = ${target} ; then
5601
5602 echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
8ec41317 5603echo "configure:5604: checking for member l_addr in struct link_map" >&5
d45fe813
KB
5604 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
5605 echo $ac_n "(cached) $ac_c" 1>&6
5606else
5607 cat > conftest.$ac_ext <<EOF
8ec41317 5608#line 5609 "configure"
d45fe813
KB
5609#include "confdefs.h"
5610#include <link.h>
5611int main() {
5612struct link_map lm; (void) lm.l_addr;
5613; return 0; }
5614EOF
8ec41317 5615if { (eval echo configure:5616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d45fe813
KB
5616 rm -rf conftest*
5617 gdb_cv_have_struct_link_map_with_l_members=yes
5618else
5619 echo "configure: failed program was:" >&5
5620 cat conftest.$ac_ext >&5
5621 rm -rf conftest*
5622 gdb_cv_have_struct_link_map_with_l_members=no
5623fi
5624rm -f conftest*
5625fi
5626
5627 echo "$ac_t""$gdb_cv_have_struct_link_map_with_l_members" 1>&6
5628 if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
5629 cat >> confdefs.h <<\EOF
5630#define HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS 1
5631EOF
5632
5633 fi
5634
5635
5636 echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
8ec41317 5637echo "configure:5638: checking for member lm_addr in struct link_map" >&5
d45fe813
KB
5638 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
5639 echo $ac_n "(cached) $ac_c" 1>&6
5640else
5641 cat > conftest.$ac_ext <<EOF
8ec41317 5642#line 5643 "configure"
d45fe813
KB
5643#include "confdefs.h"
5644#include <sys/types.h>
5645#include <link.h>
5646int main() {
5647struct link_map lm; (void) lm.lm_addr;
5648; return 0; }
5649EOF
8ec41317 5650if { (eval echo configure:5651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d45fe813
KB
5651 rm -rf conftest*
5652 gdb_cv_have_struct_link_map_with_lm_members=yes
5653else
5654 echo "configure: failed program was:" >&5
5655 cat conftest.$ac_ext >&5
5656 rm -rf conftest*
5657 gdb_cv_have_struct_link_map_with_lm_members=no
5658fi
5659rm -f conftest*
5660fi
5661
5662 echo "$ac_t""$gdb_cv_have_struct_link_map_with_lm_members" 1>&6
5663 if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
5664 cat >> confdefs.h <<\EOF
5665#define HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS 1
5666EOF
5667
5668 fi
5669
5670
5671 echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
8ec41317 5672echo "configure:5673: checking for member som_addr in struct so_map" >&5
d45fe813
KB
5673 if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
5674 echo $ac_n "(cached) $ac_c" 1>&6
5675else
5676 cat > conftest.$ac_ext <<EOF
8ec41317 5677#line 5678 "configure"
d45fe813
KB
5678#include "confdefs.h"
5679#include <sys/types.h>
39812ceb
C
5680#ifdef HAVE_NLIST_H
5681#include <nlist.h>
5682#endif
d45fe813
KB
5683#include <link.h>
5684int main() {
5685struct so_map lm; (void) lm.som_addr;
5686; return 0; }
5687EOF
8ec41317 5688if { (eval echo configure:5689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d45fe813
KB
5689 rm -rf conftest*
5690 gdb_cv_have_struct_so_map_with_som_members=yes
5691else
5692 echo "configure: failed program was:" >&5
5693 cat conftest.$ac_ext >&5
5694 rm -rf conftest*
5695 gdb_cv_have_struct_so_map_with_som_members=no
5696fi
5697rm -f conftest*
5698fi
5699
5700 echo "$ac_t""$gdb_cv_have_struct_so_map_with_som_members" 1>&6
5701 if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
5702 cat >> confdefs.h <<\EOF
5703#define HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS 1
5704EOF
5705
5706 fi
5707
5708
5709 echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
8ec41317 5710echo "configure:5711: checking for struct link_map32 in sys/link.h" >&5
d45fe813
KB
5711 if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
5712 echo $ac_n "(cached) $ac_c" 1>&6
5713else
5714 cat > conftest.$ac_ext <<EOF
8ec41317 5715#line 5716 "configure"
d45fe813
KB
5716#include "confdefs.h"
5717#define _SYSCALL32
5718#include <sys/link.h>
5719int main() {
5720struct link_map32 l;
5721; return 0; }
5722EOF
8ec41317 5723if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d45fe813
KB
5724 rm -rf conftest*
5725 gdb_cv_have_struct_link_map32=yes
5726else
5727 echo "configure: failed program was:" >&5
5728 cat conftest.$ac_ext >&5
5729 rm -rf conftest*
5730 gdb_cv_have_struct_link_map32=no
5731fi
5732rm -f conftest*
5733fi
5734
5735 echo "$ac_t""$gdb_cv_have_struct_link_map32" 1>&6
5736 if test $gdb_cv_have_struct_link_map32 = yes; then
5737 cat >> confdefs.h <<\EOF
5738#define HAVE_STRUCT_LINK_MAP32 1
943c9c25
MS
5739EOF
5740
5741 cat >> confdefs.h <<\EOF
5742#define _SYSCALL32 1
d45fe813
KB
5743EOF
5744
5745 fi
5746fi
5747
c906108c 5748echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
8ec41317 5749echo "configure:5750: checking for main in -lm" >&5
c906108c
SS
5750ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
5751if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5752 echo $ac_n "(cached) $ac_c" 1>&6
5753else
5754 ac_save_LIBS="$LIBS"
5755LIBS="-lm $LIBS"
5756cat > conftest.$ac_ext <<EOF
8ec41317 5757#line 5758 "configure"
c906108c
SS
5758#include "confdefs.h"
5759
5760int main() {
5761main()
5762; return 0; }
5763EOF
8ec41317 5764if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
5765 rm -rf conftest*
5766 eval "ac_cv_lib_$ac_lib_var=yes"
5767else
5768 echo "configure: failed program was:" >&5
5769 cat conftest.$ac_ext >&5
5770 rm -rf conftest*
5771 eval "ac_cv_lib_$ac_lib_var=no"
5772fi
5773rm -f conftest*
5774LIBS="$ac_save_LIBS"
5775
5776fi
5777if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5778 echo "$ac_t""yes" 1>&6
5779 ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5780 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5781 cat >> confdefs.h <<EOF
5782#define $ac_tr_lib 1
5783EOF
5784
5785 LIBS="-lm $LIBS"
5786
5787else
5788 echo "$ac_t""no" 1>&6
5789fi
5790
5791
5792echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
8ec41317 5793echo "configure:5794: checking for wctype in -lc" >&5
c906108c
SS
5794ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'`
5795if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5796 echo $ac_n "(cached) $ac_c" 1>&6
5797else
5798 ac_save_LIBS="$LIBS"
5799LIBS="-lc $LIBS"
5800cat > conftest.$ac_ext <<EOF
8ec41317 5801#line 5802 "configure"
c906108c
SS
5802#include "confdefs.h"
5803/* Override any gcc2 internal prototype to avoid an error. */
5804/* We use char because int might match the return type of a gcc2
5805 builtin and then its argument prototype would still apply. */
5806char wctype();
5807
5808int main() {
5809wctype()
5810; return 0; }
5811EOF
8ec41317 5812if { (eval echo configure:5813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
5813 rm -rf conftest*
5814 eval "ac_cv_lib_$ac_lib_var=yes"
5815else
5816 echo "configure: failed program was:" >&5
5817 cat conftest.$ac_ext >&5
5818 rm -rf conftest*
5819 eval "ac_cv_lib_$ac_lib_var=no"
5820fi
5821rm -f conftest*
5822LIBS="$ac_save_LIBS"
5823
5824fi
5825if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5826 echo "$ac_t""yes" 1>&6
5827 :
5828else
5829 echo "$ac_t""no" 1>&6
5830echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
8ec41317 5831echo "configure:5832: checking for wctype in -lw" >&5
c906108c
SS
5832ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
5833if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5834 echo $ac_n "(cached) $ac_c" 1>&6
5835else
5836 ac_save_LIBS="$LIBS"
5837LIBS="-lw $LIBS"
5838cat > conftest.$ac_ext <<EOF
8ec41317 5839#line 5840 "configure"
c906108c
SS
5840#include "confdefs.h"
5841/* Override any gcc2 internal prototype to avoid an error. */
5842/* We use char because int might match the return type of a gcc2
5843 builtin and then its argument prototype would still apply. */
5844char wctype();
5845
5846int main() {
5847wctype()
5848; return 0; }
5849EOF
8ec41317 5850if { (eval echo configure:5851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
5851 rm -rf conftest*
5852 eval "ac_cv_lib_$ac_lib_var=yes"
5853else
5854 echo "configure: failed program was:" >&5
5855 cat conftest.$ac_ext >&5
5856 rm -rf conftest*
5857 eval "ac_cv_lib_$ac_lib_var=no"
5858fi
5859rm -f conftest*
5860LIBS="$ac_save_LIBS"
5861
5862fi
5863if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5864 echo "$ac_t""yes" 1>&6
5865 ac_tr_lib=HAVE_LIB`echo w | sed -e 's/^a-zA-Z0-9_/_/g' \
5866 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5867 cat >> confdefs.h <<EOF
5868#define $ac_tr_lib 1
5869EOF
5870
5871 LIBS="-lw $LIBS"
5872
5873else
5874 echo "$ac_t""no" 1>&6
5875fi
5876
5877fi
5878
5879
5880
5881echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
8ec41317 5882echo "configure:5883: checking for long long support in compiler" >&5
c906108c
SS
5883if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
5884 echo $ac_n "(cached) $ac_c" 1>&6
5885else
5886 cat > conftest.$ac_ext <<EOF
8ec41317 5887#line 5888 "configure"
c906108c
SS
5888#include "confdefs.h"
5889
5890int main() {
5891
5892 extern long long foo;
5893 switch (foo & 2) { case 0: return 1; }
5894
5895; return 0; }
5896EOF
8ec41317 5897if { (eval echo configure:5898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5898 rm -rf conftest*
5899 gdb_cv_c_long_long=yes
5900else
5901 echo "configure: failed program was:" >&5
5902 cat conftest.$ac_ext >&5
5903 rm -rf conftest*
5904 gdb_cv_c_long_long=no
5905fi
5906rm -f conftest*
5907fi
5908
5909echo "$ac_t""$gdb_cv_c_long_long" 1>&6
5910if test $gdb_cv_c_long_long = yes; then
5911 cat >> confdefs.h <<\EOF
5912#define CC_HAS_LONG_LONG 1
5913EOF
5914
5915fi
5916
5917
5918echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
8ec41317 5919echo "configure:5920: checking for long long support in printf" >&5
c906108c
SS
5920if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
5921 echo $ac_n "(cached) $ac_c" 1>&6
5922else
5923 if test "$cross_compiling" = yes; then
5924 gdb_cv_printf_has_long_long=no
5925else
5926 cat > conftest.$ac_ext <<EOF
8ec41317 5927#line 5928 "configure"
c906108c
SS
5928#include "confdefs.h"
5929
5930int main () {
5931 char buf[32];
5932 long long l = 0;
5933 l = (l << 16) + 0x0123;
5934 l = (l << 16) + 0x4567;
5935 l = (l << 16) + 0x89ab;
5936 l = (l << 16) + 0xcdef;
5937 sprintf (buf, "0x%016llx", l);
5938 return (strcmp ("0x0123456789abcdef", buf));
5939}
5940EOF
8ec41317 5941if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
5942then
5943 gdb_cv_printf_has_long_long=yes
5944else
5945 echo "configure: failed program was:" >&5
5946 cat conftest.$ac_ext >&5
5947 rm -fr conftest*
5948 gdb_cv_printf_has_long_long=no
5949fi
5950rm -fr conftest*
5951fi
5952
5953fi
5954
5955if test $gdb_cv_printf_has_long_long = yes; then
5956 cat >> confdefs.h <<\EOF
5957#define PRINTF_HAS_LONG_LONG 1
5958EOF
5959
5960fi
5961echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
5962
5963
5964echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
8ec41317 5965echo "configure:5966: checking for long double support in compiler" >&5
c906108c
SS
5966if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
5967 echo $ac_n "(cached) $ac_c" 1>&6
5968else
5969 cat > conftest.$ac_ext <<EOF
8ec41317 5970#line 5971 "configure"
c906108c
SS
5971#include "confdefs.h"
5972
5973int main() {
5974long double foo;
5975; return 0; }
5976EOF
8ec41317 5977if { (eval echo configure:5978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
5978 rm -rf conftest*
5979 ac_cv_c_long_double=yes
5980else
5981 echo "configure: failed program was:" >&5
5982 cat conftest.$ac_ext >&5
5983 rm -rf conftest*
5984 ac_cv_c_long_double=no
5985fi
5986rm -f conftest*
5987fi
5988
5989echo "$ac_t""$ac_cv_c_long_double" 1>&6
5990if test $ac_cv_c_long_double = yes; then
5991 cat >> confdefs.h <<\EOF
5992#define HAVE_LONG_DOUBLE 1
5993EOF
5994
5995fi
5996
5997
5998echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
8ec41317 5999echo "configure:6000: checking for long double support in printf" >&5
c906108c
SS
6000if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
6001 echo $ac_n "(cached) $ac_c" 1>&6
6002else
6003 if test "$cross_compiling" = yes; then
6004 gdb_cv_printf_has_long_double=no
6005else
6006 cat > conftest.$ac_ext <<EOF
8ec41317 6007#line 6008 "configure"
c906108c
SS
6008#include "confdefs.h"
6009
6010int main () {
6011 char buf[16];
6012 long double f = 3.141592653;
6013 sprintf (buf, "%Lg", f);
6014 return (strncmp ("3.14159", buf, 7));
6015}
6016EOF
8ec41317 6017if { (eval echo configure:6018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
6018then
6019 gdb_cv_printf_has_long_double=yes
6020else
6021 echo "configure: failed program was:" >&5
6022 cat conftest.$ac_ext >&5
6023 rm -fr conftest*
6024 gdb_cv_printf_has_long_double=no
6025fi
6026rm -fr conftest*
6027fi
6028
6029fi
6030
6031if test $gdb_cv_printf_has_long_double = yes; then
6032 cat >> confdefs.h <<\EOF
6033#define PRINTF_HAS_LONG_DOUBLE 1
6034EOF
6035
6036fi
6037echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
6038
6039
6040echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
8ec41317 6041echo "configure:6042: checking for long double support in scanf" >&5
c906108c
SS
6042if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
6043 echo $ac_n "(cached) $ac_c" 1>&6
6044else
6045 if test "$cross_compiling" = yes; then
6046 gdb_cv_scanf_has_long_double=no
6047else
6048 cat > conftest.$ac_ext <<EOF
8ec41317 6049#line 6050 "configure"
c906108c
SS
6050#include "confdefs.h"
6051
6052int main () {
6053 char *buf = "3.141592653";
6054 long double f = 0;
6055 sscanf (buf, "%Lg", &f);
6056 return !(f > 3.14159 && f < 3.14160);
6057}
6058EOF
8ec41317 6059if { (eval echo configure:6060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
6060then
6061 gdb_cv_scanf_has_long_double=yes
6062else
6063 echo "configure: failed program was:" >&5
6064 cat conftest.$ac_ext >&5
6065 rm -fr conftest*
6066 gdb_cv_scanf_has_long_double=no
6067fi
6068rm -fr conftest*
6069fi
6070
6071fi
6072
6073if test $gdb_cv_scanf_has_long_double = yes; then
6074 cat >> confdefs.h <<\EOF
6075#define SCANF_HAS_LONG_DOUBLE 1
6076EOF
6077
6078fi
6079echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
6080
b2a1bd4f 6081for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
c906108c
SS
6082do
6083ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6084echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8ec41317 6085echo "configure:6086: checking for $ac_hdr" >&5
c906108c
SS
6086if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6087 echo $ac_n "(cached) $ac_c" 1>&6
6088else
6089 cat > conftest.$ac_ext <<EOF
8ec41317 6090#line 6091 "configure"
c906108c
SS
6091#include "confdefs.h"
6092#include <$ac_hdr>
6093EOF
6094ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8ec41317 6095{ (eval echo configure:6096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
6096ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6097if test -z "$ac_err"; then
6098 rm -rf conftest*
6099 eval "ac_cv_header_$ac_safe=yes"
6100else
6101 echo "$ac_err" >&5
6102 echo "configure: failed program was:" >&5
6103 cat conftest.$ac_ext >&5
6104 rm -rf conftest*
6105 eval "ac_cv_header_$ac_safe=no"
6106fi
6107rm -f conftest*
6108fi
6109if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6110 echo "$ac_t""yes" 1>&6
6111 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6112 cat >> confdefs.h <<EOF
6113#define $ac_tr_hdr 1
6114EOF
6115
6116else
6117 echo "$ac_t""no" 1>&6
6118fi
6119done
6120
6121for ac_func in getpagesize
6122do
6123echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
8ec41317 6124echo "configure:6125: checking for $ac_func" >&5
c906108c
SS
6125if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6126 echo $ac_n "(cached) $ac_c" 1>&6
6127else
6128 cat > conftest.$ac_ext <<EOF
8ec41317 6129#line 6130 "configure"
c906108c
SS
6130#include "confdefs.h"
6131/* System header to define __stub macros and hopefully few prototypes,
6132 which can conflict with char $ac_func(); below. */
6133#include <assert.h>
6134/* Override any gcc2 internal prototype to avoid an error. */
6135/* We use char because int might match the return type of a gcc2
6136 builtin and then its argument prototype would still apply. */
6137char $ac_func();
6138
6139int main() {
6140
6141/* The GNU C library defines this for functions which it implements
6142 to always fail with ENOSYS. Some functions are actually named
6143 something starting with __ and the normal name is an alias. */
6144#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6145choke me
6146#else
6147$ac_func();
6148#endif
6149
6150; return 0; }
6151EOF
8ec41317 6152if { (eval echo configure:6153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
6153 rm -rf conftest*
6154 eval "ac_cv_func_$ac_func=yes"
6155else
6156 echo "configure: failed program was:" >&5
6157 cat conftest.$ac_ext >&5
6158 rm -rf conftest*
6159 eval "ac_cv_func_$ac_func=no"
6160fi
6161rm -f conftest*
6162fi
6163
6164if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6165 echo "$ac_t""yes" 1>&6
6166 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6167 cat >> confdefs.h <<EOF
6168#define $ac_tr_func 1
6169EOF
6170
6171else
6172 echo "$ac_t""no" 1>&6
6173fi
6174done
6175
6176echo $ac_n "checking for working mmap""... $ac_c" 1>&6
8ec41317 6177echo "configure:6178: checking for working mmap" >&5
c906108c
SS
6178if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
6179 echo $ac_n "(cached) $ac_c" 1>&6
6180else
6181 if test "$cross_compiling" = yes; then
6182 ac_cv_func_mmap_fixed_mapped=no
6183else
6184 cat > conftest.$ac_ext <<EOF
8ec41317 6185#line 6186 "configure"
c906108c
SS
6186#include "confdefs.h"
6187
6188/* Thanks to Mike Haertel and Jim Avera for this test.
6189 Here is a matrix of mmap possibilities:
6190 mmap private not fixed
6191 mmap private fixed at somewhere currently unmapped
6192 mmap private fixed at somewhere already mapped
6193 mmap shared not fixed
6194 mmap shared fixed at somewhere currently unmapped
6195 mmap shared fixed at somewhere already mapped
6196 For private mappings, we should verify that changes cannot be read()
6197 back from the file, nor mmap's back from the file at a different
6198 address. (There have been systems where private was not correctly
6199 implemented like the infamous i386 svr4.0, and systems where the
6200 VM page cache was not coherent with the filesystem buffer cache
6201 like early versions of FreeBSD and possibly contemporary NetBSD.)
6202 For shared mappings, we should conversely verify that changes get
6203 propogated back to all the places they're supposed to be.
6204
6205 Grep wants private fixed already mapped.
6206 The main things grep needs to know about mmap are:
6207 * does it exist and is it safe to write into the mmap'd area
6208 * how to use it (BSD variants) */
6209#include <sys/types.h>
6210#include <fcntl.h>
6211#include <sys/mman.h>
6212
b2a1bd4f
MH
6213#if HAVE_SYS_TYPES_H
6214# include <sys/types.h>
6215#endif
6216
6217#if HAVE_STDLIB_H
6218# include <stdlib.h>
6219#endif
6220
6221#if HAVE_SYS_STAT_H
6222# include <sys/stat.h>
6223#endif
6224
6225#if HAVE_UNISTD_H
6226# include <unistd.h>
6227#endif
6228
c906108c
SS
6229/* This mess was copied from the GNU getpagesize.h. */
6230#ifndef HAVE_GETPAGESIZE
c906108c
SS
6231
6232/* Assume that all systems that can run configure have sys/param.h. */
6233# ifndef HAVE_SYS_PARAM_H
6234# define HAVE_SYS_PARAM_H 1
6235# endif
6236
6237# ifdef _SC_PAGESIZE
6238# define getpagesize() sysconf(_SC_PAGESIZE)
6239# else /* no _SC_PAGESIZE */
6240# ifdef HAVE_SYS_PARAM_H
6241# include <sys/param.h>
6242# ifdef EXEC_PAGESIZE
6243# define getpagesize() EXEC_PAGESIZE
6244# else /* no EXEC_PAGESIZE */
6245# ifdef NBPG
6246# define getpagesize() NBPG * CLSIZE
6247# ifndef CLSIZE
6248# define CLSIZE 1
6249# endif /* no CLSIZE */
6250# else /* no NBPG */
6251# ifdef NBPC
6252# define getpagesize() NBPC
6253# else /* no NBPC */
6254# ifdef PAGESIZE
6255# define getpagesize() PAGESIZE
6256# endif /* PAGESIZE */
6257# endif /* no NBPC */
6258# endif /* no NBPG */
6259# endif /* no EXEC_PAGESIZE */
6260# else /* no HAVE_SYS_PARAM_H */
6261# define getpagesize() 8192 /* punt totally */
6262# endif /* no HAVE_SYS_PARAM_H */
6263# endif /* no _SC_PAGESIZE */
6264
6265#endif /* no HAVE_GETPAGESIZE */
6266
6267#ifdef __cplusplus
6268extern "C" { void *malloc(unsigned); }
6269#else
6270char *malloc();
6271#endif
6272
6273int
6274main()
6275{
6276 char *data, *data2, *data3;
6277 int i, pagesize;
6278 int fd;
6279
6280 pagesize = getpagesize();
6281
6282 /*
6283 * First, make a file with some known garbage in it.
6284 */
6285 data = malloc(pagesize);
6286 if (!data)
6287 exit(1);
6288 for (i = 0; i < pagesize; ++i)
6289 *(data + i) = rand();
6290 umask(0);
6291 fd = creat("conftestmmap", 0600);
6292 if (fd < 0)
6293 exit(1);
6294 if (write(fd, data, pagesize) != pagesize)
6295 exit(1);
6296 close(fd);
6297
6298 /*
6299 * Next, try to mmap the file at a fixed address which
6300 * already has something else allocated at it. If we can,
6301 * also make sure that we see the same garbage.
6302 */
6303 fd = open("conftestmmap", O_RDWR);
6304 if (fd < 0)
6305 exit(1);
6306 data2 = malloc(2 * pagesize);
6307 if (!data2)
6308 exit(1);
6309 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
6310 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
6311 MAP_PRIVATE | MAP_FIXED, fd, 0L))
6312 exit(1);
6313 for (i = 0; i < pagesize; ++i)
6314 if (*(data + i) != *(data2 + i))
6315 exit(1);
6316
6317 /*
6318 * Finally, make sure that changes to the mapped area
6319 * do not percolate back to the file as seen by read().
6320 * (This is a bug on some variants of i386 svr4.0.)
6321 */
6322 for (i = 0; i < pagesize; ++i)
6323 *(data2 + i) = *(data2 + i) + 1;
6324 data3 = malloc(pagesize);
6325 if (!data3)
6326 exit(1);
6327 if (read(fd, data3, pagesize) != pagesize)
6328 exit(1);
6329 for (i = 0; i < pagesize; ++i)
6330 if (*(data + i) != *(data3 + i))
6331 exit(1);
6332 close(fd);
6333 unlink("conftestmmap");
6334 exit(0);
6335}
6336
6337EOF
b2a1bd4f 6338if { (eval echo configure:6339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c906108c
SS
6339then
6340 ac_cv_func_mmap_fixed_mapped=yes
6341else
6342 echo "configure: failed program was:" >&5
6343 cat conftest.$ac_ext >&5
6344 rm -fr conftest*
6345 ac_cv_func_mmap_fixed_mapped=no
6346fi
6347rm -fr conftest*
6348fi
6349
6350fi
6351
6352echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
6353if test $ac_cv_func_mmap_fixed_mapped = yes; then
6354 cat >> confdefs.h <<\EOF
6355#define HAVE_MMAP 1
6356EOF
6357
6358fi
6359
6360
438013df
AO
6361case ${host_os} in
6362aix*)
6363 echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
b2a1bd4f 6364echo "configure:6365: checking for -bbigtoc option" >&5
438013df
AO
6365if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
6366 echo $ac_n "(cached) $ac_c" 1>&6
6367else
6368
6369 SAVE_LDFLAGS=$LDFLAGS
6370
6371 case $GCC in
6372 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
6373 *) gdb_cv_bigtoc=-bbigtoc ;;
6374 esac
6375
6376 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
6377 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6378#line 6379 "configure"
438013df
AO
6379#include "confdefs.h"
6380
6381int main() {
6382int i;
6383; return 0; }
6384EOF
b2a1bd4f 6385if { (eval echo configure:6386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
438013df
AO
6386 :
6387else
6388 echo "configure: failed program was:" >&5
6389 cat conftest.$ac_ext >&5
6390 rm -rf conftest*
6391 gdb_cv_bigtoc=
6392fi
6393rm -f conftest*
6394
6395fi
6396
6397echo "$ac_t""$gdb_cv_bigtoc" 1>&6
6398 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
6399 ;;
6400esac
6401
c906108c
SS
6402
6403
6404if test ${build} = ${host} -a ${host} = ${target} ; then
6405 case ${host_os} in
6406 hpux*)
6407 echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
b2a1bd4f 6408echo "configure:6409: checking for HPUX/OSF thread support" >&5
c906108c
SS
6409 if test -f /usr/include/dce/cma_config.h ; then
6410 if test "$GCC" = "yes" ; then
6411 echo "$ac_t""yes" 1>&6
6412 cat >> confdefs.h <<\EOF
6413#define HAVE_HPUX_THREAD_SUPPORT 1
6414EOF
6415
66b965bb 6416 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} hpux-thread.o"
c906108c
SS
6417 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
6418 else
6419 echo "$ac_t""no (suppressed because you are not using GCC)" 1>&6
6420 fi
6421 else
6422 echo "$ac_t""no" 1>&6
6423 fi
6424 ;;
6425 solaris*)
6426 echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
b2a1bd4f 6427echo "configure:6428: checking for Solaris thread debugging library" >&5
c906108c
SS
6428 if test -f /usr/lib/libthread_db.so.1 ; then
6429 echo "$ac_t""yes" 1>&6
6430 cat >> confdefs.h <<\EOF
6431#define HAVE_THREAD_DB_LIB 1
6432EOF
6433
66b965bb 6434 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
c906108c
SS
6435 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
6436 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
b2a1bd4f 6437echo "configure:6438: checking for dlopen in -ldl" >&5
c906108c
SS
6438ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
6439if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6440 echo $ac_n "(cached) $ac_c" 1>&6
6441else
6442 ac_save_LIBS="$LIBS"
6443LIBS="-ldl $LIBS"
6444cat > conftest.$ac_ext <<EOF
b2a1bd4f 6445#line 6446 "configure"
c906108c
SS
6446#include "confdefs.h"
6447/* Override any gcc2 internal prototype to avoid an error. */
6448/* We use char because int might match the return type of a gcc2
6449 builtin and then its argument prototype would still apply. */
6450char dlopen();
6451
6452int main() {
6453dlopen()
6454; return 0; }
6455EOF
b2a1bd4f 6456if { (eval echo configure:6457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
6457 rm -rf conftest*
6458 eval "ac_cv_lib_$ac_lib_var=yes"
6459else
6460 echo "configure: failed program was:" >&5
6461 cat conftest.$ac_ext >&5
6462 rm -rf conftest*
6463 eval "ac_cv_lib_$ac_lib_var=no"
6464fi
6465rm -f conftest*
6466LIBS="$ac_save_LIBS"
6467
6468fi
6469if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6470 echo "$ac_t""yes" 1>&6
6471 ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
6472 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
6473 cat >> confdefs.h <<EOF
6474#define $ac_tr_lib 1
6475EOF
6476
6477 LIBS="-ldl $LIBS"
6478
6479else
6480 echo "$ac_t""no" 1>&6
6481fi
6482
6483 if test "$GCC" = "yes" ; then
6484 # The GNU linker requires the -export-dynamic option to make
6485 # all symbols visible in the dynamic symbol table.
6486 hold_ldflags=$LDFLAGS
6487 echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
b2a1bd4f 6488echo "configure:6489: checking for the ld -export-dynamic flag" >&5
c906108c
SS
6489 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
6490 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6491#line 6492 "configure"
c906108c
SS
6492#include "confdefs.h"
6493
6494int main() {
6495int i;
6496; return 0; }
6497EOF
b2a1bd4f 6498if { (eval echo configure:6499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
6499 rm -rf conftest*
6500 found=yes
6501else
6502 echo "configure: failed program was:" >&5
6503 cat conftest.$ac_ext >&5
6504 rm -rf conftest*
6505 found=no
6506fi
6507rm -f conftest*
6508 LDFLAGS=$hold_ldflags
6509 echo "$ac_t""$found" 1>&6
6510 if test $found = yes; then
6511 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
6512 fi
6513 fi
6514 # Sun randomly tweaked the prototypes in <proc_service.h>
6515 # at one point.
6516 echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
b2a1bd4f 6517echo "configure:6518: checking if <proc_service.h> is old" >&5
c906108c
SS
6518 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
6519 echo $ac_n "(cached) $ac_c" 1>&6
6520else
6521
6522 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6523#line 6524 "configure"
c906108c
SS
6524#include "confdefs.h"
6525
6526 #include <proc_service.h>
6527 ps_err_e ps_pdwrite
6528 (struct ps_prochandle*, psaddr_t, const void*, size_t);
6529
6530int main() {
6531
6532; return 0; }
6533EOF
b2a1bd4f 6534if { (eval echo configure:6535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
6535 rm -rf conftest*
6536 gdb_cv_proc_service_is_old=no
6537else
6538 echo "configure: failed program was:" >&5
6539 cat conftest.$ac_ext >&5
6540 rm -rf conftest*
6541 gdb_cv_proc_service_is_old=yes
6542fi
6543rm -f conftest*
6544
6545fi
6546
6547 echo "$ac_t""$gdb_cv_proc_service_is_old" 1>&6
6548 if test $gdb_cv_proc_service_is_old = yes; then
6549 cat >> confdefs.h <<\EOF
6550#define PROC_SERVICE_IS_OLD 1
6551EOF
6552
6553 fi
6554 else
6555 echo "$ac_t""no" 1>&6
6556 fi
6557 ;;
6558 esac
6559
6560fi
6561
3f47be5c
EZ
6562if test "x$ac_cv_header_thread_db_h" = "xyes"; then
6563 echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
b2a1bd4f 6564echo "configure:6565: checking whether <thread_db.h> has TD_NOTALLOC" >&5
3f47be5c
EZ
6565if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
6566 echo $ac_n "(cached) $ac_c" 1>&6
6567else
6568 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6569#line 6570 "configure"
3f47be5c
EZ
6570#include "confdefs.h"
6571#include <thread_db.h>
6572int main() {
6573int i = TD_NOTALLOC;
6574; return 0; }
6575EOF
b2a1bd4f 6576if { (eval echo configure:6577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3f47be5c
EZ
6577 rm -rf conftest*
6578 gdb_cv_thread_db_h_has_td_notalloc=yes
6579else
6580 echo "configure: failed program was:" >&5
6581 cat conftest.$ac_ext >&5
6582 rm -rf conftest*
6583 gdb_cv_thread_db_h_has_td_notalloc=no
6584
6585fi
6586rm -f conftest*
6587
6588fi
6589
6590echo "$ac_t""$gdb_cv_thread_db_h_has_td_notalloc" 1>&6
6591fi
6592if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
6593 cat >> confdefs.h <<\EOF
6594#define THREAD_DB_HAS_TD_NOTALLOC 1
6595EOF
6596
6597fi
6598
eb784848
DJ
6599if test $host = $target; then
6600 case $target in
6601 *-linux*)
6602 save_CFLAGS=$CFLAGS
6603 CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
6604 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6605#line 6606 "configure"
eb784848
DJ
6606#include "confdefs.h"
6607#include <unistd.h>
6608int main() {
6609pread64 (0, NULL, 0, 0);
6610; return 0; }
6611EOF
b2a1bd4f 6612if { (eval echo configure:6613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
eb784848
DJ
6613 rm -rf conftest*
6614 ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
6615 cat >> confdefs.h <<\EOF
6616#define HAVE_PREAD64 1
6617EOF
6618
6619else
6620 echo "configure: failed program was:" >&5
6621 cat conftest.$ac_ext >&5
6622fi
6623rm -f conftest*
6624 CFLAGS=$save_CFLAGS
6625 ;;
6626 esac
6627fi
6628
fb40c209 6629
d318976c
FN
6630# Check whether --enable-gdbcli or --disable-gdbcli was given.
6631if test "${enable_gdbcli+set}" = set; then
6632 enableval="$enable_gdbcli"
6633
6bad8db2
FN
6634 case "${enableval}" in
6635 yes) enable_gdbcli=yes ;;
6636 "") enable_gdbcli=yes ;;
d318976c
FN
6637 no)
6638 { echo "configure: error: The CLI cannot be disabled yet" 1>&2; exit 1; }
6639 ;;
6640 *)
6bad8db2 6641 { echo "configure: error: Bad value for --enable-gdbcli: ${enableval}" 1>&2; exit 1; }
d318976c
FN
6642 ;;
6643 esac
6644
6645else
6646 enable_gdbcli=yes
6647fi
6648
6649case ${enable_gdbcli} in
6650 "yes" )
6bad8db2 6651 if test -d "${srcdir}/cli" ; then
d318976c
FN
6652 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_CLI_OBS)"
6653 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_CLI_DEPS)"
486697a0 6654 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_CLI_SRCS)"
d318976c
FN
6655 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_CLI_INITS)"
6656 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_CLI_CFLAGS)"
6657 CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_CLI_ALL)"
6658 CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_CLI_CLEAN)"
6659 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_CLI_INSTALL)"
6660 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_CLI_UNINSTALL)"
6661 fi
6662 ;;
6663esac
6664
6665
fb40c209
AC
6666# Check whether --enable-gdbmi or --disable-gdbmi was given.
6667if test "${enable_gdbmi+set}" = set; then
6668 enableval="$enable_gdbmi"
6669
6670 case "${enable_gdbmi}" in
6671 yes | no) ;;
6672 "") enable_gdbmi=yes ;;
6673 *)
6674 { echo "configure: error: Bad value for --enable-gdbmi: ${enableval}" 1>&2; exit 1; }
6675 ;;
6676 esac
6677
b0e2e90a
AC
6678else
6679 enable_gdbmi=yes
fb40c209
AC
6680fi
6681
6682case ${enable_gdbmi} in
6683 "yes" )
6684 if test -d "${srcdir}/mi" ; then
6685 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_MI_OBS)"
6686 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_MI_DEPS)"
486697a0 6687 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_MI_SRCS)"
fb40c209 6688 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_MI_INITS)"
b0b1b869 6689 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_MI_CFLAGS)"
b3a90332
AC
6690 CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_MI_ALL)"
6691 CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_MI_CLEAN)"
e56ac5c3
AC
6692 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_MI_INSTALL)"
6693 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_MI_UNINSTALL)"
fb40c209
AC
6694 fi
6695 ;;
6696esac
c906108c 6697
b4df4f68
FN
6698# Configure UI_OUT by default (before 5.2 it can be disabled)
6699# It must be configured if gdbmi is configured
6700
6701UIOUT_CFLAGS=
6702
6703
6704# Check whether --with-uiout or --without-uiout was given.
6705if test "${with_uiout+set}" = set; then
6706 withval="$with_uiout"
6707 case "${withval}" in
6708 yes) want_uiout=true ;;
6709 no) if test $enable_gdbmi = yes; then
6710 { echo "configure: error: uiout is needed for MI and cannot be disabled" 1>&2; exit 1; }
6711 else
6712 want_uiout=false
6713 fi ;;
6714 *) { echo "configure: error: bad value ${withval} for GDB with-uiout option" 1>&2; exit 1; } ;;
6715esac
6716else
6717 want_uiout=true
6718fi
6719
6720if test $want_uiout = true; then
6721 UIOUT_CFLAGS="-DUI_OUT=1"
6722fi
6723
c906108c
SS
6724# Check whether --enable-tui or --disable-tui was given.
6725if test "${enable_tui+set}" = set; then
6726 enableval="$enable_tui"
6727
6728 case "${enable_tui}" in
6729 yes | no) ;;
6730 "") enable_tui=yes ;;
6731 *)
6732 { echo "configure: error: Bad value for --enable-tui: ${enableval}" 1>&2; exit 1; }
6733 ;;
6734 esac
6735
6736fi
6737
6738case ${enable_tui} in
6739 "yes" )
ed952ac5
AC
6740 if test -d "${srcdir}/tui" ; then
6741 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)"
6742 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)"
486697a0 6743 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_TUI_SRCS)"
ed952ac5
AC
6744 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)"
6745 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)"
6746 CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)"
6747 CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)"
6748 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)"
6749 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)"
6750 fi
6751 ;;
c906108c
SS
6752esac
6753
c906108c
SS
6754# Check whether --enable-netrom or --disable-netrom was given.
6755if test "${enable_netrom+set}" = set; then
6756 enableval="$enable_netrom"
6757 case "${enableval}" in
6758yes) enable_netrom=yes ;;
6759no) enable_netrom=no ;;
6760*) { echo "configure: error: bad value ${enableval} given for netrom option" 1>&2; exit 1; } ;;
6761esac
6762fi
6763
6764
6765if test "${enable_netrom}" = "yes"; then
66b965bb 6766 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} remote-nrom.o"
c906108c
SS
6767 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
6768fi
6769
1decb323 6770
3b851bce
AC
6771# NOTE: Don't add -Wall or -Wunused, they both include
6772# -Wunused-parameter which reports bogus warnings.
6773# NOTE: If you add to this list, remember to update
6774# gdb/doc/gdbint.texinfo.
1decb323 6775build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
93d56215 6776-Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
d8038014
AC
6777# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
6778# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
93d56215 6779# -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
d8038014
AC
6780# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
6781# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
6782# -Woverloaded-virtual -Winline -Werror"
c906108c
SS
6783# Check whether --enable-build-warnings or --disable-build-warnings was given.
6784if test "${enable_build_warnings+set}" = set; then
6785 enableval="$enable_build_warnings"
1decb323 6786 case "${enableval}" in
c906108c
SS
6787 yes) ;;
6788 no) build_warnings="-w";;
6789 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
6790 build_warnings="${build_warnings} ${t}";;
6791 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
6792 build_warnings="${t} ${build_warnings}";;
6793 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
6794esac
d4f3574e 6795if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
746a987d 6796 echo "Setting compiler warning flags = $build_warnings" 6>&1
c906108c 6797fi
1decb323 6798fi
3b851bce
AC
6799# Check whether --enable-gdb-build-warnings or --disable-gdb-build-warnings was given.
6800if test "${enable_gdb_build_warnings+set}" = set; then
6801 enableval="$enable_gdb_build_warnings"
6802 case "${enableval}" in
6803 yes) ;;
6804 no) build_warnings="-w";;
6805 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
6806 build_warnings="${build_warnings} ${t}";;
6807 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
6808 build_warnings="${t} ${build_warnings}";;
6809 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
6810esac
6811if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
6812 echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
6813fi
6814fi
104c1213
JM
6815WARN_CFLAGS=""
6816WERROR_CFLAGS=""
c906108c
SS
6817if test "x${build_warnings}" != x -a "x$GCC" = xyes
6818then
746a987d 6819 echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
b2a1bd4f 6820echo "configure:6821: checking compiler warning flags" >&5
746a987d
AC
6821 # Separate out the -Werror flag as some files just cannot be
6822 # compiled with it enabled.
6823 for w in ${build_warnings}; do
6824 case $w in
6825 -Werr*) WERROR_CFLAGS=-Werror ;;
6826 *) # Check that GCC accepts it
4536bbc6
AC
6827 saved_CFLAGS="$CFLAGS"
6828 CFLAGS="$CFLAGS $w"
6829 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6830#line 6831 "configure"
4536bbc6
AC
6831#include "confdefs.h"
6832
6833int main() {
6834
6835; return 0; }
6836EOF
b2a1bd4f 6837if { (eval echo configure:6838: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4536bbc6
AC
6838 rm -rf conftest*
6839 WARN_CFLAGS="${WARN_CFLAGS} $w"
6840else
6841 echo "configure: failed program was:" >&5
6842 cat conftest.$ac_ext >&5
6843fi
6844rm -f conftest*
6845 CFLAGS="$saved_CFLAGS"
746a987d
AC
6846 esac
6847 done
6848 echo "$ac_t""${WARN_CFLAGS}${WERROR_CFLAGS}" 1>&6
c906108c
SS
6849fi
6850
6851
104c1213 6852
c906108c
SS
6853MMALLOC_CFLAGS=
6854MMALLOC=
6855
6856
6857
6858# Check whether --with-mmalloc or --without-mmalloc was given.
6859if test "${with_mmalloc+set}" = set; then
6860 withval="$with_mmalloc"
6861 case "${withval}" in
6862 yes) want_mmalloc=true ;;
6863 no) want_mmalloc=false;;
6864 *) { echo "configure: error: bad value ${withval} for GDB with-mmalloc option" 1>&2; exit 1; } ;;
6865esac
6866else
6867 want_mmalloc=false
6868fi
6869
6870if test x$want_mmalloc = xtrue; then
6871 cat >> confdefs.h <<\EOF
6872#define USE_MMALLOC 1
6873EOF
6874
6875 cat >> confdefs.h <<\EOF
6876#define MMCHECK_FORCE 1
6877EOF
6878
6879 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
6880 MMALLOC='../mmalloc/libmmalloc.a'
6881fi
6882
88987551
L
6883# Check whether --with-included-regex or --without-included-regex was given.
6884if test "${with_included_regex+set}" = set; then
6885 withval="$with_included_regex"
6886 case "${withval}" in
6887 yes) want_included_regex=true ;;
6888 no) want_included_regex=false;;
6889 *) { echo "configure: error: bad value ${withval} for GDB with-included-regex option" 1>&2; exit 1; } ;;
6890esac
6891else
6892 want_included_regex=true
6893fi
6894
88987551
L
6895if test $want_included_regex = false; then
6896 echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
b2a1bd4f 6897echo "configure:6898: checking for GNU regex" >&5
88987551
L
6898 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
6899 echo $ac_n "(cached) $ac_c" 1>&6
6900else
6901 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6902#line 6903 "configure"
88987551
L
6903#include "confdefs.h"
6904#include <gnu-versions.h>
6905#include <sys/types.h>
6906#include <regex.h>
6907int main() {
6908#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2
6909#error No valid GNU regex.
6910#endif
6911
6912; return 0; }
6913EOF
b2a1bd4f 6914if { (eval echo configure:6915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
88987551
L
6915 rm -rf conftest*
6916 gdb_cv_have_gnu_regex=yes
6917else
6918 echo "configure: failed program was:" >&5
6919 cat conftest.$ac_ext >&5
6920 rm -rf conftest*
6921 gdb_cv_have_gnu_regex=no
6922fi
6923rm -f conftest*
6924fi
6925
6926 echo "$ac_t""$gdb_cv_have_gnu_regex" 1>&6
e48f66e4
AC
6927 if test $gdb_cv_have_gnu_regex = no; then
6928 want_included_regex=true
88987551
L
6929 fi
6930fi
6931
e48f66e4
AC
6932if test x${want_included_regex} = xtrue; then
6933 REGEX="gnu-regex.o"
6934 cat >> confdefs.h <<\EOF
6935#define USE_INCLUDED_REGEX 1
6936EOF
6937
6938fi
88987551 6939
7a292a7a
SS
6940
6941# In the Cygwin environment, we need some additional flags.
6942echo $ac_n "checking for cygwin""... $ac_c" 1>&6
b2a1bd4f 6943echo "configure:6944: checking for cygwin" >&5
7a292a7a
SS
6944if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
6945 echo $ac_n "(cached) $ac_c" 1>&6
6946else
6947 cat > conftest.$ac_ext <<EOF
b2a1bd4f 6948#line 6949 "configure"
7a292a7a
SS
6949#include "confdefs.h"
6950
6951#if defined (__CYGWIN__) || defined (__CYGWIN32__)
6952lose
6953#endif
6954EOF
6955if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6956 egrep "lose" >/dev/null 2>&1; then
6957 rm -rf conftest*
6958 gdb_cv_os_cygwin=yes
6959else
6960 rm -rf conftest*
6961 gdb_cv_os_cygwin=no
6962fi
6963rm -f conftest*
6964
6965fi
6966
6967echo "$ac_t""$gdb_cv_os_cygwin" 1>&6
6968
aff38e61
AC
6969
6970SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
6971case ${host} in
95cbc983
AC
6972 *go32* ) SER_HARDWIRE=ser-go32.o ;;
6973 *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
aff38e61
AC
6974esac
6975
6976
6977
b83266a0
SS
6978if test x$gdb_host = xgo32; then
6979 TERM_LIB=
6980else
c906108c
SS
6981if test x$gdb_cv_os_cygwin = xyes; then
6982 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
6983else
6984 TERM_LIB=
6985 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
b2a1bd4f 6986echo "configure:6987: checking for tgetent in -lncurses" >&5
c906108c
SS
6987ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
6988if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6989 echo $ac_n "(cached) $ac_c" 1>&6
6990else
6991 ac_save_LIBS="$LIBS"
6992LIBS="-lncurses $LIBS"
6993cat > conftest.$ac_ext <<EOF
b2a1bd4f 6994#line 6995 "configure"
c906108c
SS
6995#include "confdefs.h"
6996/* Override any gcc2 internal prototype to avoid an error. */
6997/* We use char because int might match the return type of a gcc2
6998 builtin and then its argument prototype would still apply. */
6999char tgetent();
7000
7001int main() {
7002tgetent()
7003; return 0; }
7004EOF
b2a1bd4f 7005if { (eval echo configure:7006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7006 rm -rf conftest*
7007 eval "ac_cv_lib_$ac_lib_var=yes"
7008else
7009 echo "configure: failed program was:" >&5
7010 cat conftest.$ac_ext >&5
7011 rm -rf conftest*
7012 eval "ac_cv_lib_$ac_lib_var=no"
7013fi
7014rm -f conftest*
7015LIBS="$ac_save_LIBS"
7016
7017fi
7018if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7019 echo "$ac_t""yes" 1>&6
7020 TERM_LIB=-lncurses
7021else
7022 echo "$ac_t""no" 1>&6
7023echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
b2a1bd4f 7024echo "configure:7025: checking for tgetent in -lHcurses" >&5
c906108c
SS
7025ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
7026if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7027 echo $ac_n "(cached) $ac_c" 1>&6
7028else
7029 ac_save_LIBS="$LIBS"
7030LIBS="-lHcurses $LIBS"
7031cat > conftest.$ac_ext <<EOF
b2a1bd4f 7032#line 7033 "configure"
c906108c
SS
7033#include "confdefs.h"
7034/* Override any gcc2 internal prototype to avoid an error. */
7035/* We use char because int might match the return type of a gcc2
7036 builtin and then its argument prototype would still apply. */
7037char tgetent();
7038
7039int main() {
7040tgetent()
7041; return 0; }
7042EOF
b2a1bd4f 7043if { (eval echo configure:7044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7044 rm -rf conftest*
7045 eval "ac_cv_lib_$ac_lib_var=yes"
7046else
7047 echo "configure: failed program was:" >&5
7048 cat conftest.$ac_ext >&5
7049 rm -rf conftest*
7050 eval "ac_cv_lib_$ac_lib_var=no"
7051fi
7052rm -f conftest*
7053LIBS="$ac_save_LIBS"
7054
7055fi
7056if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7057 echo "$ac_t""yes" 1>&6
7058 TERM_LIB=-lHcurses
7059else
7060 echo "$ac_t""no" 1>&6
7061echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
b2a1bd4f 7062echo "configure:7063: checking for tgetent in -ltermlib" >&5
c906108c
SS
7063ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
7064if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7065 echo $ac_n "(cached) $ac_c" 1>&6
7066else
7067 ac_save_LIBS="$LIBS"
7068LIBS="-ltermlib $LIBS"
7069cat > conftest.$ac_ext <<EOF
b2a1bd4f 7070#line 7071 "configure"
c906108c
SS
7071#include "confdefs.h"
7072/* Override any gcc2 internal prototype to avoid an error. */
7073/* We use char because int might match the return type of a gcc2
7074 builtin and then its argument prototype would still apply. */
7075char tgetent();
7076
7077int main() {
7078tgetent()
7079; return 0; }
7080EOF
b2a1bd4f 7081if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7082 rm -rf conftest*
7083 eval "ac_cv_lib_$ac_lib_var=yes"
7084else
7085 echo "configure: failed program was:" >&5
7086 cat conftest.$ac_ext >&5
7087 rm -rf conftest*
7088 eval "ac_cv_lib_$ac_lib_var=no"
7089fi
7090rm -f conftest*
7091LIBS="$ac_save_LIBS"
7092
7093fi
7094if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7095 echo "$ac_t""yes" 1>&6
7096 TERM_LIB=-ltermlib
7097else
7098 echo "$ac_t""no" 1>&6
7099echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
b2a1bd4f 7100echo "configure:7101: checking for tgetent in -ltermcap" >&5
c906108c
SS
7101ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
7102if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7103 echo $ac_n "(cached) $ac_c" 1>&6
7104else
7105 ac_save_LIBS="$LIBS"
7106LIBS="-ltermcap $LIBS"
7107cat > conftest.$ac_ext <<EOF
b2a1bd4f 7108#line 7109 "configure"
c906108c
SS
7109#include "confdefs.h"
7110/* Override any gcc2 internal prototype to avoid an error. */
7111/* We use char because int might match the return type of a gcc2
7112 builtin and then its argument prototype would still apply. */
7113char tgetent();
7114
7115int main() {
7116tgetent()
7117; return 0; }
7118EOF
b2a1bd4f 7119if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7120 rm -rf conftest*
7121 eval "ac_cv_lib_$ac_lib_var=yes"
7122else
7123 echo "configure: failed program was:" >&5
7124 cat conftest.$ac_ext >&5
7125 rm -rf conftest*
7126 eval "ac_cv_lib_$ac_lib_var=no"
7127fi
7128rm -f conftest*
7129LIBS="$ac_save_LIBS"
7130
7131fi
7132if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7133 echo "$ac_t""yes" 1>&6
7134 TERM_LIB=-ltermcap
7135else
7136 echo "$ac_t""no" 1>&6
7137echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
b2a1bd4f 7138echo "configure:7139: checking for tgetent in -lcurses" >&5
c906108c
SS
7139ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
7140if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7141 echo $ac_n "(cached) $ac_c" 1>&6
7142else
7143 ac_save_LIBS="$LIBS"
7144LIBS="-lcurses $LIBS"
7145cat > conftest.$ac_ext <<EOF
b2a1bd4f 7146#line 7147 "configure"
c906108c
SS
7147#include "confdefs.h"
7148/* Override any gcc2 internal prototype to avoid an error. */
7149/* We use char because int might match the return type of a gcc2
7150 builtin and then its argument prototype would still apply. */
7151char tgetent();
7152
7153int main() {
7154tgetent()
7155; return 0; }
7156EOF
b2a1bd4f 7157if { (eval echo configure:7158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7158 rm -rf conftest*
7159 eval "ac_cv_lib_$ac_lib_var=yes"
7160else
7161 echo "configure: failed program was:" >&5
7162 cat conftest.$ac_ext >&5
7163 rm -rf conftest*
7164 eval "ac_cv_lib_$ac_lib_var=no"
7165fi
7166rm -f conftest*
7167LIBS="$ac_save_LIBS"
7168
7169fi
7170if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7171 echo "$ac_t""yes" 1>&6
7172 TERM_LIB=-lcurses
7173else
7174 echo "$ac_t""no" 1>&6
7175echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
b2a1bd4f 7176echo "configure:7177: checking for tgetent in -lterminfo" >&5
c906108c
SS
7177ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
7178if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7179 echo $ac_n "(cached) $ac_c" 1>&6
7180else
7181 ac_save_LIBS="$LIBS"
7182LIBS="-lterminfo $LIBS"
7183cat > conftest.$ac_ext <<EOF
b2a1bd4f 7184#line 7185 "configure"
c906108c
SS
7185#include "confdefs.h"
7186/* Override any gcc2 internal prototype to avoid an error. */
7187/* We use char because int might match the return type of a gcc2
7188 builtin and then its argument prototype would still apply. */
7189char tgetent();
7190
7191int main() {
7192tgetent()
7193; return 0; }
7194EOF
b2a1bd4f 7195if { (eval echo configure:7196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
7196 rm -rf conftest*
7197 eval "ac_cv_lib_$ac_lib_var=yes"
7198else
7199 echo "configure: failed program was:" >&5
7200 cat conftest.$ac_ext >&5
7201 rm -rf conftest*
7202 eval "ac_cv_lib_$ac_lib_var=no"
7203fi
7204rm -f conftest*
7205LIBS="$ac_save_LIBS"
7206
7207fi
7208if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7209 echo "$ac_t""yes" 1>&6
7210 TERM_LIB=-lterminfo
7211else
7212 echo "$ac_t""no" 1>&6
7213fi
7214
7215fi
7216
7217fi
7218
7219fi
7220
7221fi
7222
7223fi
7224
7225
7226 if test "x$TERM_LIB" = x
7227 then
7228 { echo "configure: error: Could not find a term library" 1>&2; exit 1; }
7229 fi
7230fi
b83266a0 7231fi
c906108c
SS
7232
7233
cd0fc7c3
SS
7234# libreadline needs libuser32.a in a cygwin environment
7235WIN32LIBS=
7236if test x$gdb_cv_os_cygwin = xyes; then
c5394b80
JM
7237 WIN32LIBS="-luser32"
7238 case "${target}" in
7239 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
7240 ;;
7241 esac
cd0fc7c3 7242fi
c906108c 7243
7a292a7a 7244
3fc11d3e
JM
7245LIBGUI="../libgui/src/libgui.a"
7246GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
7247
7248
7a292a7a 7249
8b93c638
JM
7250# Check whether --with-cpu or --without-cpu was given.
7251if test "${with_cpu+set}" = set; then
7252 withval="$with_cpu"
7253 case "${target}" in
7254 powerpc-* | powerpcle-* )
7255 ## It would be nice to keep this table in sync with the one in
7256 ## gcc/configure.
7257 case "${with_cpu}" in
7258 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
7259 | 604 | 750 )
7260 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
7261 ;;
7262 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
7263 ## These are all RS6000 variants, as far as GDB is concerned.
7264 with_cpu=rs6000
7265 ;;
7266 603e | ec603e )
7267 with_cpu=603
7268 ;;
7269 604e )
7270 with_cpu=604
7271 ;;
7272 * )
7273 echo "configure: warning: GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'." 1>&2
7274 with_cpu=ppc-uisa
7275 ;;
7276 esac
7277 ;;
7278 * )
7279 echo "configure: warning: GDB may ignore the --with-cpu flag for ${target} targets" 1>&2
7280 ;;
7281esac
7282cat >> confdefs.h <<EOF
7283#define TARGET_CPU_DEFAULT "${with_cpu}"
7284EOF
7285
7286
7287fi
7288
7289
7290
3fc11d3e
JM
7291# Check whether --enable-gdbtk or --disable-gdbtk was given.
7292if test "${enable_gdbtk+set}" = set; then
7293 enableval="$enable_gdbtk"
7294 case "${enableval}" in
7295 yes)
7296 case "$host" in
7297 *go32*)
7298 echo "configure: warning: GDB does not support GDBtk on host ${host}. GDBtk will be disabled." 1>&2
7299 enable_gdbtk=no ;;
7300 *windows*)
7301 echo "configure: warning: GDB does not support GDBtk on host ${host}. GDBtk will be disabled." 1>&2
7302 enable_gdbtk=no ;;
7303 *)
7304 enable_gdbtk=yes ;;
7305 esac ;;
7306 no)
7307 enable_gdbtk=no ;;
7308 *)
7309 { echo "configure: error: bad value ${enableval} given for gdbtk option" 1>&2; exit 1; } ;;
7310esac
7311else
7312
7313# Default is on for everything but go32 and Cygwin
7314case "$host" in
7315 *go32* | *windows*)
7316 ;;
7317 *)
379d6434
AC
7318 if test -d "${srcdir}/gdbtk" ; then
7319 enable_gdbtk=yes
7320 fi
7321 ;;
7322esac
3fc11d3e
JM
7323
7324fi
7325
7326
7327WIN32LDAPP=
7328
7329
7330
7331configdir="unix"
7332
7333GDBTKLIBS=
7334if test "${enable_gdbtk}" = "yes"; then
7335
d1c3b63a
KS
7336 # Gdbtk must have an absolute path to srcdir in order to run
7337 # properly when not installed.
7338 here=`pwd`
7339 cd ${srcdir}
7340 GDBTK_SRC_DIR=`pwd`
7341 cd $here
7342
3fc11d3e
JM
7343
7344#
7345# Ok, lets find the tcl configuration
7346# First, look for one uninstalled.
7347# the alternative search directory is invoked by --with-tclconfig
7348#
7349
7350if test x"${no_tcl}" = x ; then
7351 # we reset no_tcl in case something fails here
7352 no_tcl=true
7353 # Check whether --with-tclconfig or --without-tclconfig was given.
7354if test "${with_tclconfig+set}" = set; then
7355 withval="$with_tclconfig"
7356 with_tclconfig=${withval}
7357fi
7358
7359 echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
b2a1bd4f 7360echo "configure:7361: checking for Tcl configuration" >&5
3fc11d3e
JM
7361 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
7362 echo $ac_n "(cached) $ac_c" 1>&6
7363else
7364
7365
7366 # First check to see if --with-tclconfig was specified.
7367 if test x"${with_tclconfig}" != x ; then
7368 if test -f "${with_tclconfig}/tclConfig.sh" ; then
7369 ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
7370 else
7371 { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; }
7372 fi
7373 fi
7374
7375 # then check for a private Tcl installation
7376 if test x"${ac_cv_c_tclconfig}" = x ; then
7377 for i in \
7378 ../tcl \
7379 `ls -dr ../tcl[7-9]* 2>/dev/null` \
7380 ../../tcl \
7381 `ls -dr ../../tcl[7-9]* 2>/dev/null` \
7382 ../../../tcl \
7383 `ls -dr ../../../tcl[7-9]* 2>/dev/null` ; do
7384 if test -f "$i/${configdir}/tclConfig.sh" ; then
7385 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
7386 break
7387 fi
7388 done
7389 fi
7390 # check in a few common install locations
7391 if test x"${ac_cv_c_tclconfig}" = x ; then
7392 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
7393 if test -f "$i/tclConfig.sh" ; then
7394 ac_cv_c_tclconfig=`(cd $i; pwd)`
7395 break
7396 fi
7397 done
7398 fi
7399 # check in a few other private locations
7400 if test x"${ac_cv_c_tclconfig}" = x ; then
7401 for i in \
7402 ${srcdir}/../tcl \
7403 `ls -dr ${srcdir}/../tcl[7-9]* 2>/dev/null` ; do
7404 if test -f "$i/${configdir}/tclConfig.sh" ; then
7405 ac_cv_c_tclconfig=`(cd $i/${configdir}; pwd)`
7406 break
7407 fi
7408 done
7409 fi
7410
7411fi
7412
7413 if test x"${ac_cv_c_tclconfig}" = x ; then
7414 TCLCONFIG="# no Tcl configs found"
7415 echo "configure: warning: Can't find Tcl configuration definitions" 1>&2
7416 else
7417 no_tcl=
7418 TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
7419 echo "$ac_t""found $TCLCONFIG" 1>&6
7420 fi
7421fi
7422
7423 if test -z "${no_tcl}"; then
7424
7425 . $TCLCONFIG
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452#
7453# Ok, lets find the tk configuration
7454# First, look for one uninstalled.
7455# the alternative search directory is invoked by --with-tkconfig
7456#
7457
7458if test x"${no_tk}" = x ; then
7459 # we reset no_tk in case something fails here
7460 no_tk=true
7461 # Check whether --with-tkconfig or --without-tkconfig was given.
7462if test "${with_tkconfig+set}" = set; then
7463 withval="$with_tkconfig"
7464 with_tkconfig=${withval}
7465fi
7466
7467 echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
b2a1bd4f 7468echo "configure:7469: checking for Tk configuration" >&5
3fc11d3e
JM
7469 if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
7470 echo $ac_n "(cached) $ac_c" 1>&6
7471else
7472
7473
7474 # First check to see if --with-tkconfig was specified.
7475 if test x"${with_tkconfig}" != x ; then
7476 if test -f "${with_tkconfig}/tkConfig.sh" ; then
7477 ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
7478 else
7479 { echo "configure: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" 1>&2; exit 1; }
7480 fi
7481 fi
7482
7483 # then check for a private Tk library
7484 if test x"${ac_cv_c_tkconfig}" = x ; then
7485 for i in \
7486 ../tk \
7487 `ls -dr ../tk[4-9]* 2>/dev/null` \
7488 ../../tk \
7489 `ls -dr ../../tk[4-9]* 2>/dev/null` \
7490 ../../../tk \
7491 `ls -dr ../../../tk[4-9]* 2>/dev/null` ; do
7492 if test -f "$i/${configdir}/tkConfig.sh" ; then
7493 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
7494 break
7495 fi
7496 done
7497 fi
7498 # check in a few common install locations
7499 if test x"${ac_cv_c_tkconfig}" = x ; then
7500 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
7501 if test -f "$i/tkConfig.sh" ; then
7502 ac_cv_c_tkconfig=`(cd $i; pwd)`
7503 break
7504 fi
7505 done
7506 fi
7507 # check in a few other private locations
7508 if test x"${ac_cv_c_tkconfig}" = x ; then
7509 for i in \
7510 ${srcdir}/../tk \
7511 `ls -dr ${srcdir}/../tk[4-9]* 2>/dev/null` ; do
7512 if test -f "$i/${configdir}/tkConfig.sh" ; then
7513 ac_cv_c_tkconfig=`(cd $i/${configdir}; pwd)`
7514 break
7515 fi
7516 done
7517 fi
7518
7519fi
7520
7521 if test x"${ac_cv_c_tkconfig}" = x ; then
7522 TKCONFIG="# no Tk configs found"
7523 echo "configure: warning: Can't find Tk configuration definitions" 1>&2
7524 else
7525 no_tk=
7526 TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
7527 echo "$ac_t""found $TKCONFIG" 1>&6
7528 fi
7529fi
7530
7531
7532
dd2504ab
JM
7533 # now look for Tcl library stuff
7534
7535 case "${host}" in
7536 *-*-cygwin*)
7537 tcldir=../tcl/win/
7538 ;;
7539 *)
7540 tcldir=../tcl/unix/
7541 ;;
7542 esac
7543
7544 TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
7545
3fc11d3e
JM
7546 # If $no_tk is nonempty, then we can't do Tk, and there is no
7547 # point to doing Tcl.
7548 if test -z "${no_tk}"; then
7549
7550 if test -f "$TKCONFIG" ; then
7551 . $TKCONFIG
7552 fi
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567#
7568# Ok, lets find the tcl source trees so we can use the headers
7569# Warning: transition of version 9 to 10 will break this algorithm
7570# because 10 sorts before 9. We also look for just tcl. We have to
7571# be careful that we don't match stuff like tclX by accident.
7572# the alternative search directory is involked by --with-tclinclude
7573#
7574
7575no_tcl=true
7576echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
b2a1bd4f 7577echo "configure:7578: checking for Tcl private headers. dir=${configdir}" >&5
3fc11d3e
JM
7578# Check whether --with-tclinclude or --without-tclinclude was given.
7579if test "${with_tclinclude+set}" = set; then
7580 withval="$with_tclinclude"
7581 with_tclinclude=${withval}
7582fi
7583
7584if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then
7585 echo $ac_n "(cached) $ac_c" 1>&6
7586else
7587
7588# first check to see if --with-tclinclude was specified
7589if test x"${with_tclinclude}" != x ; then
7590 if test -f ${with_tclinclude}/tclInt.h ; then
7591 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
7592 elif test -f ${with_tclinclude}/generic/tclInt.h ; then
7593 ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; pwd)`
7594 else
7595 { echo "configure: error: ${with_tclinclude} directory doesn't contain private headers" 1>&2; exit 1; }
7596 fi
7597fi
7598
7599# next check if it came with Tcl configuration file
7600if test x"${ac_cv_c_tclconfig}" = x ; then
7601 if test -f $ac_cv_c_tclconfig/../generic/tclInt.h ; then
7602 ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/..; pwd)`
7603 fi
7604fi
7605
7606# next check in private source directory
7607#
7608# since ls returns lowest version numbers first, reverse its output
7609if test x"${ac_cv_c_tclh}" = x ; then
7610 for i in \
7611 ${srcdir}/../tcl \
7612 `ls -dr ${srcdir}/../tcl[7-9]* 2>/dev/null` \
7613 ${srcdir}/../../tcl \
7614 `ls -dr ${srcdir}/../../tcl[7-9]* 2>/dev/null` \
7615 ${srcdir}/../../../tcl \
7616 `ls -dr ${srcdir}/../../../tcl[7-9]* 2>/dev/null ` ; do
7617 if test -f $i/generic/tclInt.h ; then
7618 ac_cv_c_tclh=`(cd $i/generic; pwd)`
7619 break
7620 fi
7621 done
7622fi
7623# finally check in a few common install locations
7624#
7625# since ls returns lowest version numbers first, reverse its output
7626if test x"${ac_cv_c_tclh}" = x ; then
7627 for i in \
7628 `ls -dr /usr/local/src/tcl[7-9]* 2>/dev/null` \
7629 `ls -dr /usr/local/lib/tcl[7-9]* 2>/dev/null` \
7630 /usr/local/src/tcl \
7631 /usr/local/lib/tcl \
7632 ${prefix}/include ; do
7633 if test -f $i/generic/tclInt.h ; then
7634 ac_cv_c_tclh=`(cd $i/generic; pwd)`
7635 break
7636 fi
7637 done
7638fi
7639# see if one is installed
7640if test x"${ac_cv_c_tclh}" = x ; then
7641 ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
7642echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
b2a1bd4f 7643echo "configure:7644: checking for tclInt.h" >&5
3fc11d3e
JM
7644if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7645 echo $ac_n "(cached) $ac_c" 1>&6
7646else
7647 cat > conftest.$ac_ext <<EOF
b2a1bd4f 7648#line 7649 "configure"
3fc11d3e
JM
7649#include "confdefs.h"
7650#include <tclInt.h>
7651EOF
7652ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 7653{ (eval echo configure:7654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3fc11d3e
JM
7654ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7655if test -z "$ac_err"; then
7656 rm -rf conftest*
7657 eval "ac_cv_header_$ac_safe=yes"
7658else
7659 echo "$ac_err" >&5
7660 echo "configure: failed program was:" >&5
7661 cat conftest.$ac_ext >&5
7662 rm -rf conftest*
7663 eval "ac_cv_header_$ac_safe=no"
7664fi
7665rm -f conftest*
7666fi
7667if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7668 echo "$ac_t""yes" 1>&6
7669 ac_cv_c_tclh=installed
7670else
7671 echo "$ac_t""no" 1>&6
7672ac_cv_c_tclh=""
7673fi
7674
7675fi
7676
7677fi
7678
7679if test x"${ac_cv_c_tclh}" = x ; then
7680 TCLHDIR="# no Tcl private headers found"
7681 { echo "configure: error: Can't find Tcl private headers" 1>&2; exit 1; }
7682fi
7683if test x"${ac_cv_c_tclh}" != x ; then
7684 no_tcl=""
7685 if test x"${ac_cv_c_tclh}" = x"installed" ; then
7686 echo "$ac_t""is installed" 1>&6
7687 TCLHDIR=""
7688 else
7689 echo "$ac_t""found in ${ac_cv_c_tclh}" 1>&6
7690 # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
7691 TCLHDIR="-I${ac_cv_c_tclh}"
7692 fi
7693fi
7694
7695
7696
7697
7698#
7699# Ok, lets find the tk source trees so we can use the headers
7700# If the directory (presumably symlink) named "tk" exists, use that one
7701# in preference to any others. Same logic is used when choosing library
7702# and again with Tcl. The search order is the best place to look first, then in
7703# decreasing significance. The loop breaks if the trigger file is found.
7704# Note the gross little conversion here of srcdir by cd'ing to the found
7705# directory. This converts the path from a relative to an absolute, so
7706# recursive cache variables for the path will work right. We check all
7707# the possible paths in one loop rather than many seperate loops to speed
7708# things up.
7709# the alternative search directory is involked by --with-tkinclude
7710#
7711no_tk=true
7712echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
b2a1bd4f 7713echo "configure:7714: checking for Tk private headers" >&5
3fc11d3e
JM
7714# Check whether --with-tkinclude or --without-tkinclude was given.
7715if test "${with_tkinclude+set}" = set; then
7716 withval="$with_tkinclude"
7717 with_tkinclude=${withval}
7718fi
7719
7720if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then
7721 echo $ac_n "(cached) $ac_c" 1>&6
7722else
7723
7724# first check to see if --with-tkinclude was specified
7725if test x"${with_tkinclude}" != x ; then
7726 if test -f ${with_tkinclude}/tk.h ; then
7727 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
7728 elif test -f ${with_tkinclude}/generic/tk.h ; then
7729 ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; pwd)`
7730 else
7731 { echo "configure: error: ${with_tkinclude} directory doesn't contain private headers" 1>&2; exit 1; }
7732 fi
7733fi
7734
7735# next check if it came with Tk configuration file
7736if test x"${ac_cv_c_tkconfig}" = x ; then
7737 if test -f $ac_cv_c_tkconfig/../generic/tk.h ; then
7738 ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/..; pwd)`
7739 fi
7740fi
7741
7742# next check in private source directory
7743#
7744# since ls returns lowest version numbers first, reverse its output
7745if test x"${ac_cv_c_tkh}" = x ; then
7746 for i in \
7747 ${srcdir}/../tk \
7748 `ls -dr ${srcdir}/../tk[4-9]* 2>/dev/null` \
7749 ${srcdir}/../../tk \
7750 `ls -dr ${srcdir}/../../tk[4-9]* 2>/dev/null` \
7751 ${srcdir}/../../../tk \
7752 `ls -dr ${srcdir}/../../../tk[4-9]* 2>/dev/null ` ; do
7753 if test -f $i/generic/tk.h ; then
7754 ac_cv_c_tkh=`(cd $i/generic; pwd)`
7755 break
7756 fi
7757 done
7758fi
7759# finally check in a few common install locations
7760#
7761# since ls returns lowest version numbers first, reverse its output
7762if test x"${ac_cv_c_tkh}" = x ; then
7763 for i in \
7764 `ls -dr /usr/local/src/tk[4-9]* 2>/dev/null` \
7765 `ls -dr /usr/local/lib/tk[4-9]* 2>/dev/null` \
7766 /usr/local/src/tk \
7767 /usr/local/lib/tk \
7768 ${prefix}/include ; do
7769 if test -f $i/generic/tk.h ; then
7770 ac_cv_c_tkh=`(cd $i/generic; pwd)`
7771 break
7772 fi
7773 done
7774fi
7775# see if one is installed
7776if test x"${ac_cv_c_tkh}" = x ; then
7777 ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
7778echo $ac_n "checking for tk.h""... $ac_c" 1>&6
b2a1bd4f 7779echo "configure:7780: checking for tk.h" >&5
3fc11d3e
JM
7780if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7781 echo $ac_n "(cached) $ac_c" 1>&6
7782else
7783 cat > conftest.$ac_ext <<EOF
b2a1bd4f 7784#line 7785 "configure"
3fc11d3e
JM
7785#include "confdefs.h"
7786#include <tk.h>
7787EOF
7788ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 7789{ (eval echo configure:7790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3fc11d3e
JM
7790ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7791if test -z "$ac_err"; then
7792 rm -rf conftest*
7793 eval "ac_cv_header_$ac_safe=yes"
7794else
7795 echo "$ac_err" >&5
7796 echo "configure: failed program was:" >&5
7797 cat conftest.$ac_ext >&5
7798 rm -rf conftest*
7799 eval "ac_cv_header_$ac_safe=no"
7800fi
7801rm -f conftest*
7802fi
7803if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7804 echo "$ac_t""yes" 1>&6
7805 ac_cv_c_tkh=installed
7806else
7807 echo "$ac_t""no" 1>&6
7808ac_cv_c_tkh=""
7809fi
7810
7811fi
7812
7813fi
7814
7815if test x"${ac_cv_c_tkh}" != x ; then
7816 no_tk=""
7817 if test x"${ac_cv_c_tkh}" = x"installed" ; then
7818 echo "$ac_t""is installed" 1>&6
7819 TKHDIR=""
7820 else
7821 echo "$ac_t""found in ${ac_cv_c_tkh}" 1>&6
7822 # this hack is cause the TKHDIR won't print if there is a "-I" in it.
7823 TKHDIR="-I${ac_cv_c_tkh}"
7824 fi
7825else
7826 TKHDIR="# no Tk directory found"
7827 echo "configure: warning: Can't find Tk private headers" 1>&2
7828 no_tk=true
7829fi
7830
7831
7832
7833
7834echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
b2a1bd4f 7835echo "configure:7836: checking for Itcl private headers. srcdir=${srcdir}" >&5
3fc11d3e
JM
7836if test x"${ac_cv_c_itclh}" = x ; then
7837 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
7838 if test -f $i/generic/itcl.h ; then
7839 ac_cv_c_itclh=`(cd $i/generic; pwd)`
7840 break
7841 fi
7842 done
7843fi
7844if test x"${ac_cv_c_itclh}" = x ; then
7845 ITCLHDIR="# no Itcl private headers found"
7846 { echo "configure: error: Can't find Itcl private headers" 1>&2; exit 1; }
7847fi
7848if test x"${ac_cv_c_itclh}" != x ; then
7849 ITCLHDIR="-I${ac_cv_c_itclh}"
7850fi
7851# should always be here
7852# ITCLLIB="../itcl/itcl/unix/libitcl.a"
7853
7854#AC_SUBST(ITCLLIB)
7855
7856
7857echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
b2a1bd4f 7858echo "configure:7859: checking for Itk private headers. srcdir=${srcdir}" >&5
3fc11d3e
JM
7859if test x"${ac_cv_c_itkh}" = x ; then
7860 for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
7861 if test -f $i/generic/itk.h ; then
7862 ac_cv_c_itkh=`(cd $i/generic; pwd)`
7863 break
7864 fi
7865 done
7866fi
7867if test x"${ac_cv_c_itkh}" = x ; then
7868 ITKHDIR="# no Itk private headers found"
7869 { echo "configure: error: Can't find Itk private headers" 1>&2; exit 1; }
7870fi
7871if test x"${ac_cv_c_itkh}" != x ; then
7872 ITKHDIR="-I${ac_cv_c_itkh}"
7873fi
7874# should always be here
7875# ITKLIB="../itcl/itk/unix/libitk.a"
7876
7877#AC_SUBST(ITKLIB)
7878
3fc11d3e 7879
dd2504ab
JM
7880
7881 # now look for Tk library stuff
7882
7883 case "${host}" in
7884 *-*-cygwin*)
7885 tkdir=../tk/win/
7886 ;;
7887 *)
7888 tkdir=../tk/unix/
7889 ;;
7890 esac
7891
7892 TK_DEPS="${tkdir}${TK_LIB_FILE}"
7893
3fc11d3e
JM
7894 # now look for Itcl library stuff
7895
7896
7897#
7898# Ok, lets find the itcl configuration
7899# First, look for one uninstalled.
7900# the alternative search directory is invoked by --with-itclconfig
7901#
7902
7903if test x"${no_itcl}" = x ; then
7904 # we reset no_itcl in case something fails here
7905 no_itcl=true
7906 # Check whether --with-itclconfig or --without-itclconfig was given.
7907if test "${with_itclconfig+set}" = set; then
7908 withval="$with_itclconfig"
7909 with_itclconfig=${withval}
7910fi
7911
7912 echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
b2a1bd4f 7913echo "configure:7914: checking for Itcl configuration" >&5
3fc11d3e
JM
7914 if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
7915 echo $ac_n "(cached) $ac_c" 1>&6
7916else
7917
7918
7919 # First check to see if --with-itclconfig was specified.
7920 if test x"${with_itclconfig}" != x ; then
7921 if test -f "${with_itclconfig}/itclConfig.sh" ; then
7922 ac_cv_c_itclconfig=`(cd ${with_itclconfig}; pwd)`
7923 else
7924 { echo "configure: error: ${with_itclconfig} directory doesn't contain itclConfig.sh" 1>&2; exit 1; }
7925 fi
7926 fi
7927
7928 # then check for a private Itcl library
7929 if test x"${ac_cv_c_itclconfig}" = x ; then
7930 for i in \
7931 ../itcl/itcl \
7932 `ls -dr ../itcl[4-9]*/itcl 2>/dev/null` \
7933 ../../itcl \
7934 `ls -dr ../../itcl[4-9]*/itcl 2>/dev/null` \
7935 ../../../itcl \
7936 `ls -dr ../../../itcl[4-9]*/itcl 2>/dev/null` ; do
7937 if test -f "$i/itclConfig.sh" ; then
7938 ac_cv_c_itclconfig=`(cd $i; pwd)`
7939 break
7940 fi
7941 done
7942 fi
7943 # check in a few common install locations
7944 if test x"${ac_cv_c_itclconfig}" = x ; then
7945 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
7946 if test -f "$i/itclConfig.sh" ; then
7947 ac_cv_c_itclconfig=`(cd $i; pwd)`
7948 break
7949 fi
7950 done
7951 fi
7952 # check in a few other private locations
7953 if test x"${ac_cv_c_itclconfig}" = x ; then
7954 for i in \
7955 ${srcdir}/../itcl/itcl \
7956 `ls -dr ${srcdir}/../itcl[4-9]*/itcl 2>/dev/null` ; do
7957 if test -f "$i/itclConfig.sh" ; then
7958 ac_cv_c_itclconfig=`(cd $i; pwd)`
7959 break
7960 fi
7961 done
7962 fi
7963
7964fi
7965
7966 if test x"${ac_cv_c_itclconfig}" = x ; then
7967 ITCLCONFIG="# no Itcl configs found"
7968 echo "configure: warning: Can't find Itcl configuration definitions" 1>&2
7969 else
7970 no_itcl=
7971 ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
7972 echo "$ac_t""found $ITCLCONFIG" 1>&6
7973 fi
7974fi
7975
7976 if test -z "${no_itcl}"; then
7977
7978 if test -f "$ITCLCONFIG" ; then
7979 . $ITCLCONFIG
7980 fi
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
3fc11d3e
JM
7991
7992
7993 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
b381d62d 7994 ITCL_DEPS="${ITCL_LIB_FULL_PATH}"
3fc11d3e
JM
7995 fi
7996
7997
7998 # now look for Itk library stuff
7999
8000#
8001# Ok, lets find the itk configuration
8002# First, look for one uninstalled.
8003# the alternative search directory is invoked by --with-itkconfig
8004#
8005
8006if test x"${no_itk}" = x ; then
8007 # we reset no_itk in case something fails here
8008 no_itk=true
8009 # Check whether --with-itkconfig or --without-itkconfig was given.
8010if test "${with_itkconfig+set}" = set; then
8011 withval="$with_itkconfig"
8012 with_itkconfig=${withval}
8013fi
8014
8015 echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
b2a1bd4f 8016echo "configure:8017: checking for Itk configuration" >&5
3fc11d3e
JM
8017 if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
8018 echo $ac_n "(cached) $ac_c" 1>&6
8019else
8020
8021
8022 # First check to see if --with-itkconfig was specified.
8023 if test x"${with_itkconfig}" != x ; then
8024 if test -f "${with_itkconfig}/itkConfig.sh" ; then
8025 ac_cv_c_itkconfig=`(cd ${with_itkconfig}; pwd)`
8026 else
8027 { echo "configure: error: ${with_itkconfig} directory doesn't contain itkConfig.sh" 1>&2; exit 1; }
8028 fi
8029 fi
8030
8031 # then check for a private Itk library
8032 if test x"${ac_cv_c_itkconfig}" = x ; then
8033 for i in \
8034 ../itcl/itk \
8035 `ls -dr ../itcl[4-9]*/itk 2>/dev/null` \
8036 ../../itk \
8037 `ls -dr ../../itcl[4-9]*/itk 2>/dev/null` \
8038 ../../../itk \
8039 `ls -dr ../../../itcl[4-9]*/itk 2>/dev/null` ; do
8040 if test -f "$i/itkConfig.sh" ; then
8041 ac_cv_c_itkconfig=`(cd $i; pwd)`
8042 break
8043 fi
8044 done
8045 fi
8046 # check in a few common install locations
8047 if test x"${ac_cv_c_itkconfig}" = x ; then
8048 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
8049 if test -f "$i/itkConfig.sh" ; then
8050 ac_cv_c_itkconfig=`(cd $i; pwd)`
8051 break
8052 fi
8053 done
8054 fi
8055 # check in a few other private locations
8056 if test x"${ac_cv_c_itkconfig}" = x ; then
8057 for i in \
8058 ${srcdir}/../itcl/itk \
8059 `ls -dr ${srcdir}/../itcl[4-9]*/itk 2>/dev/null` ; do
8060 if test -f "$i/itkConfig.sh" ; then
8061 ac_cv_c_itkconfig=`(cd $i; pwd)`
8062 break
8063 fi
8064 done
8065 fi
8066
8067fi
8068
8069 if test x"${ac_cv_c_itkconfig}" = x ; then
8070 ITKCONFIG="# no Itk configs found"
8071 echo "configure: warning: Can't find Itk configuration definitions" 1>&2
8072 else
8073 no_itk=
8074 ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
8075 echo "$ac_t""found $ITKCONFIG" 1>&6
8076 fi
8077fi
8078
8079
8080 if test -z "${no_itcl}"; then
8081
8082 if test -f "$ITKCONFIG" ; then
8083 . $ITKCONFIG
8084 fi
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
3fc11d3e 8097 ITKLIB="${ITK_BUILD_LIB_SPEC}"
b381d62d 8098 ITK_DEPS="${ITK_LIB_FULL_PATH}"
3fc11d3e
JM
8099 fi
8100
4226a5a5 8101 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
3fc11d3e
JM
8102 # Tcl/Tk 8.1 require -fwritable strings. I don't
8103 # know whether 8.2 will or not, but I bet it will.
8104 # I don't have to worry about 7.x since we don't support it.
8105 GDBTK_CFLAGS=""
8106 if test "$GCC" = "yes"; then
8107 if test "$TCL_VERSION" != "8.0" ; then
8108 GDBTK_CFLAGS="-fwritable-strings"
8109 fi
8110 fi
8111
8112 # Include some libraries that Tcl and Tk want.
b2a1bd4f 8113 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
3fc11d3e
JM
8114 # Yes, the ordering seems wrong here. But it isn't.
8115 # TK_LIBS is the list of libraries that need to be linked
8116 # after Tcl/Tk. Note that this isn't put into LIBS. If it
8117 # were in LIBS then any link tests after this point would
8118 # try to include things like `$(LIBGUI)', which wouldn't work.
8119 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
4226a5a5
FN
8120
8121 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
8122 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
8123 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
8124 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_GDBTK_INITS)"
b3a90332 8125 CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
ce844ae2 8126 CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_GDBTK_CLEAN)"
e56ac5c3
AC
8127 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
8128 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
3fc11d3e
JM
8129
8130 if test x$gdb_cv_os_cygwin = xyes; then
8131 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
8132 WIN32LDAPP="-Wl,--subsystem,console"
8133 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
8134 fi
8135 fi
8136 fi
ffc6a242
KS
8137
8138 SUBDIRS="${SUBDIRS} gdbtk"
8139 configdirs="${configdirs} gdbtk"
3fc11d3e
JM
8140fi
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
dd2504ab 8154
c906108c
SS
8155# If we find X, set shell vars x_includes and x_libraries to the
8156# paths, otherwise set no_x=yes.
8157# Uses ac_ vars as temps to allow command line to override cache and checks.
8158# --without-x overrides everything else, but does not touch the cache.
8159echo $ac_n "checking for X""... $ac_c" 1>&6
b2a1bd4f 8160echo "configure:8161: checking for X" >&5
c906108c
SS
8161
8162# Check whether --with-x or --without-x was given.
8163if test "${with_x+set}" = set; then
8164 withval="$with_x"
8165 :
8166fi
8167
8168# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
8169if test "x$with_x" = xno; then
8170 # The user explicitly disabled X.
8171 have_x=disabled
8172else
8173 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
8174 # Both variables are already set.
8175 have_x=yes
8176 else
8177if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
8178 echo $ac_n "(cached) $ac_c" 1>&6
8179else
8180 # One or both of the vars are not set, and there is no cached value.
8181ac_x_includes=NO ac_x_libraries=NO
8182rm -fr conftestdir
8183if mkdir conftestdir; then
8184 cd conftestdir
8185 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
8186 cat > Imakefile <<'EOF'
8187acfindx:
8188 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
8189EOF
8190 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
8191 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8192 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
8193 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
8194 for ac_extension in a so sl; do
8195 if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
8196 test -f $ac_im_libdir/libX11.$ac_extension; then
8197 ac_im_usrlibdir=$ac_im_libdir; break
8198 fi
8199 done
8200 # Screen out bogus values from the imake configuration. They are
8201 # bogus both because they are the default anyway, and because
8202 # using them would break gcc on systems where it needs fixed includes.
8203 case "$ac_im_incroot" in
8204 /usr/include) ;;
8205 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
8206 esac
8207 case "$ac_im_usrlibdir" in
8208 /usr/lib | /lib) ;;
8209 *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
8210 esac
8211 fi
8212 cd ..
8213 rm -fr conftestdir
8214fi
8215
8216if test "$ac_x_includes" = NO; then
8217 # Guess where to find include files, by looking for this one X11 .h file.
8218 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
8219
8220 # First, try using that file with no special directory specified.
8221cat > conftest.$ac_ext <<EOF
b2a1bd4f 8222#line 8223 "configure"
c906108c
SS
8223#include "confdefs.h"
8224#include <$x_direct_test_include>
8225EOF
8226ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
b2a1bd4f 8227{ (eval echo configure:8228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
c906108c
SS
8228ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8229if test -z "$ac_err"; then
8230 rm -rf conftest*
8231 # We can compile using X headers with no special include directory.
8232ac_x_includes=
8233else
8234 echo "$ac_err" >&5
8235 echo "configure: failed program was:" >&5
8236 cat conftest.$ac_ext >&5
8237 rm -rf conftest*
8238 # Look for the header file in a standard set of common directories.
8239# Check X11 before X11Rn because it is often a symlink to the current release.
8240 for ac_dir in \
8241 /usr/X11/include \
8242 /usr/X11R6/include \
8243 /usr/X11R5/include \
8244 /usr/X11R4/include \
8245 \
8246 /usr/include/X11 \
8247 /usr/include/X11R6 \
8248 /usr/include/X11R5 \
8249 /usr/include/X11R4 \
8250 \
8251 /usr/local/X11/include \
8252 /usr/local/X11R6/include \
8253 /usr/local/X11R5/include \
8254 /usr/local/X11R4/include \
8255 \
8256 /usr/local/include/X11 \
8257 /usr/local/include/X11R6 \
8258 /usr/local/include/X11R5 \
8259 /usr/local/include/X11R4 \
8260 \
8261 /usr/X386/include \
8262 /usr/x386/include \
8263 /usr/XFree86/include/X11 \
8264 \
8265 /usr/include \
8266 /usr/local/include \
8267 /usr/unsupported/include \
8268 /usr/athena/include \
8269 /usr/local/x11r5/include \
8270 /usr/lpp/Xamples/include \
8271 \
8272 /usr/openwin/include \
8273 /usr/openwin/share/include \
8274 ; \
8275 do
8276 if test -r "$ac_dir/$x_direct_test_include"; then
8277 ac_x_includes=$ac_dir
8278 break
8279 fi
8280 done
8281fi
8282rm -f conftest*
8283fi # $ac_x_includes = NO
8284
8285if test "$ac_x_libraries" = NO; then
8286 # Check for the libraries.
8287
8288 test -z "$x_direct_test_library" && x_direct_test_library=Xt
8289 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
8290
8291 # See if we find them without any special options.
8292 # Don't add to $LIBS permanently.
8293 ac_save_LIBS="$LIBS"
8294 LIBS="-l$x_direct_test_library $LIBS"
8295cat > conftest.$ac_ext <<EOF
b2a1bd4f 8296#line 8297 "configure"
c906108c
SS
8297#include "confdefs.h"
8298
8299int main() {
8300${x_direct_test_function}()
8301; return 0; }
8302EOF
b2a1bd4f 8303if { (eval echo configure:8304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c906108c
SS
8304 rm -rf conftest*
8305 LIBS="$ac_save_LIBS"
8306# We can link X programs with no special library path.
8307ac_x_libraries=
8308else
8309 echo "configure: failed program was:" >&5
8310 cat conftest.$ac_ext >&5
8311 rm -rf conftest*
8312 LIBS="$ac_save_LIBS"
8313# First see if replacing the include by lib works.
8314# Check X11 before X11Rn because it is often a symlink to the current release.
8315for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
8316 /usr/X11/lib \
8317 /usr/X11R6/lib \
8318 /usr/X11R5/lib \
8319 /usr/X11R4/lib \
8320 \
8321 /usr/lib/X11 \
8322 /usr/lib/X11R6 \
8323 /usr/lib/X11R5 \
8324 /usr/lib/X11R4 \
8325 \
8326 /usr/local/X11/lib \
8327 /usr/local/X11R6/lib \
8328 /usr/local/X11R5/lib \
8329 /usr/local/X11R4/lib \
8330 \
8331 /usr/local/lib/X11 \
8332 /usr/local/lib/X11R6 \
8333 /usr/local/lib/X11R5 \
8334 /usr/local/lib/X11R4 \
8335 \
8336 /usr/X386/lib \
8337 /usr/x386/lib \
8338 /usr/XFree86/lib/X11 \
8339 \
8340 /usr/lib \
8341 /usr/local/lib \
8342 /usr/unsupported/lib \
8343 /usr/athena/lib \
8344 /usr/local/x11r5/lib \
8345 /usr/lpp/Xamples/lib \
8346 /lib/usr/lib/X11 \
8347 \
8348 /usr/openwin/lib \
8349 /usr/openwin/share/lib \
8350 ; \
8351do
8352 for ac_extension in a so sl; do
8353 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
8354 ac_x_libraries=$ac_dir
8355 break 2
8356 fi
8357 done
8358done
8359fi
8360rm -f conftest*
8361fi # $ac_x_libraries = NO
8362
8363if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
8364 # Didn't find X anywhere. Cache the known absence of X.
8365 ac_cv_have_x="have_x=no"
8366else
8367 # Record where we found X for the cache.
8368 ac_cv_have_x="have_x=yes \
8369 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
8370fi
8371fi
8372 fi
8373 eval "$ac_cv_have_x"
8374fi # $with_x != no
8375
8376if test "$have_x" != yes; then
8377 echo "$ac_t""$have_x" 1>&6
8378 no_x=yes
8379else
8380 # If each of the values was on the command line, it overrides each guess.
8381 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
8382 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
8383 # Update the cache value to reflect the command line values.
8384 ac_cv_have_x="have_x=yes \
8385 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
8386 echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
8387fi
8388
8389
7a292a7a
SS
8390
8391# Unlike the sim directory, whether a simulator is linked is controlled by
8392# presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
8393# This code just checks for a few cases where we'd like to ignore those
8394# definitions, even when they're present in the '.mt' file. These cases
8395# are when --disable-sim is specified, or if the simulator directory is
6c5cfe5b 8396# not part of the source tree.
7a292a7a
SS
8397#
8398# Check whether --enable-sim or --disable-sim was given.
8399if test "${enable_sim+set}" = set; then
8400 enableval="$enable_sim"
8401 echo "enable_sim = $enable_sim";
8402 echo "enableval = ${enableval}";
8403 case "${enableval}" in
8404 yes) ignore_sim=false ;;
8405 no) ignore_sim=true ;;
8406 *) ignore_sim=false ;;
8407 esac
8408else
8409 ignore_sim=false
8410fi
8411
8412
8413if test ! -d "${srcdir}/../sim"; then
8414 ignore_sim=true
8415fi
8416
8417if test "${ignore_sim}" = "true"; then
8418 IGNORE_SIM="SIM="
8419 IGNORE_SIM_OBS="SIM_OBS="
8420else
8421 IGNORE_SIM=""
8422 IGNORE_SIM_OBS=""
8423 cat >> confdefs.h <<\EOF
8424#define WITH_SIM 1
8425EOF
8426
8427fi
8428
8429
8430
c906108c
SS
8431
8432
8433
8434
8435
8436
dfcd3bfb 8437
e56ac5c3
AC
8438
8439
b3a90332
AC
8440
8441
b46cd165 8442
c906108c
SS
8443# Begin stuff to support --enable-shared
8444# Check whether --enable-shared or --disable-shared was given.
8445if test "${enable_shared+set}" = set; then
8446 enableval="$enable_shared"
8447 case "${enableval}" in
8448 yes) shared=true ;;
8449 no) shared=false ;;
8450 *) shared=true ;;
8451esac
8452fi
8453
8454HLDFLAGS=
8455HLDENV=
8456# If we have shared libraries, try to set rpath reasonably.
8457if test "${shared}" = "true"; then
8458 case "${host}" in
8459 *-*-hpux*)
8460 HLDFLAGS='-Wl,+s,+b,$(libdir)'
8461 ;;
8462 *-*-irix5* | *-*-irix6*)
8463 HLDFLAGS='-Wl,-rpath,$(libdir)'
8464 ;;
8465 *-*-linux*aout*)
8466 ;;
88987551 8467 *-*-linux* | *-pc-linux-gnu*)
c906108c
SS
8468 HLDFLAGS='-Wl,-rpath,$(libdir)'
8469 ;;
8470 *-*-solaris*)
8471 HLDFLAGS='-R $(libdir)'
8472 ;;
8473 *-*-sysv4*)
8474 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
8475 ;;
8476 esac
8477fi
8478
8479# On SunOS, if the linker supports the -rpath option, use it to
8480# prevent ../bfd and ../opcodes from being included in the run time
8481# search path.
8482case "${host}" in
8483 *-*-sunos*)
8484 echo 'main () { }' > conftest.c
8485 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
8486 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
8487 :
8488 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
8489 :
8490 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
8491 :
8492 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
8493 :
8494 elif test "${shared}" = "true"; then
8495 HLDFLAGS='-Wl,-rpath=$(libdir)'
8496 else
8497 HLDFLAGS='-Wl,-rpath='
8498 fi
8499 rm -f conftest.t conftest.c conftest
8500 ;;
8501esac
8502
8503
8504# End stuff to support --enable-shared
8505
8506# target_subdir is used by the testsuite to find the target libraries.
8507target_subdir=
8508if test "${host}" != "${target}"; then
8509 target_subdir="${target_alias}/"
8510fi
8511
8512
8513frags=
8514host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
8515if test ! -f ${host_makefile_frag}; then
7fd60527
AC
8516 # When building a native debuger the .mh file containing things
8517 # like NATDEPFILES is needed. Cross debuggers don't need .mh
8518 # since it no longer contains anything useful.
8519 if test "${target}" = "${host}"; then
8520 { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; }
8521 else
8522 host_makefile_frag=/dev/null
8523 fi
c906108c
SS
8524fi
8525frags="$frags $host_makefile_frag"
8526
8527target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
8528if test ! -f ${target_makefile_frag}; then
8529{ echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; }
8530fi
8531frags="$frags $target_makefile_frag"
8532
8533
8534
8535
8536
8537hostfile=`sed -n '
8538s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
8539' ${host_makefile_frag}`
8540
8541targetfile=`sed -n '
8542s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
8543' ${target_makefile_frag}`
8544
6166d547
AC
8545GDB_MULTI_ARCH=`sed -n '
8546s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
8547' ${target_makefile_frag}`
8548
c906108c 8549if test "${target}" = "${host}"; then
a85f51e7
DJ
8550# We pick this up from the host configuration file (.mh) because we
8551# do not have a native configuration Makefile fragment.
c906108c
SS
8552nativefile=`sed -n '
8553s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
8554' ${host_makefile_frag}`
c906108c
SS
8555fi
8556
8557
6166d547
AC
8558# New targets should just set gdb_multi_arch=yes in configure.tgt.
8559# Old targets being converted can either do that or set GDB_MULTI_ARCH
8560# in the target specific makefile frag. Eventually gdb_multi_arch=yes
8561# will be the default.
8562if test x"${GDB_MULTI_ARCH}" = x ; then
8563 case "${gdb_multi_arch}" in
8564 yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
8565 no ) GDB_MULTI_ARCH=0 ;;
8566 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
8567 esac
8568fi
8569if test x"${GDB_MULTI_ARCH}" != x ; then
8570 cat >> confdefs.h <<EOF
8571#define GDB_MULTI_ARCH ${GDB_MULTI_ARCH}
8572EOF
8573
8574fi
6c5cfe5b 8575# Warn the user when they use an old practice
6166d547
AC
8576case "${GDB_MULTI_ARCH}" in
8577 "" ) ;;
8578 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
8579 echo "configure: warning: "GDB: Target is not pure multi-arch"" 1>&2 ;;
8580 GDB_MULTI_ARCH_PURE )
8581 if test x"${targetfile}" != x ; then
6c5cfe5b 8582 echo "configure: warning: "GDB: Ignoring TM_FILE in ${target_makefile_frag}"" 1>&2
5a2402b8 8583 targetfile=""
6166d547
AC
8584 fi ;;
8585 *) { echo "configure: error: "GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}"" 1>&2; exit 1; };;
8586esac
8587
96baa820
JM
8588if test "${enable_multi_ice}" = "yes"; then
8589 SUBDIRS="${SUBDIRS} multi-ice"
8590fi
8591
a85f51e7
DJ
8592# ``gdbserver'' can only be built in a native configuration.
8593if test x"${target}" = x"${host}"; then
8594 echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
b2a1bd4f 8595echo "configure:8596: checking whether gdbserver is supported on this host" >&5
a85f51e7
DJ
8596 if test x"${build_gdbserver}" = xyes ; then
8597 configdirs="${configdirs} gdbserver"
8598 SUBDIRS="${SUBDIRS} gdbserver"
8599 echo "$ac_t""yes" 1>&6
8600 else
8601 echo "$ac_t""no" 1>&6
8602 fi
8603fi
8604
96baa820
JM
8605
8606
c906108c 8607# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
5a2402b8
AC
8608# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
8609# version.
c906108c
SS
8610
8611files=
8612links=
5a2402b8 8613
c906108c 8614rm -f xm.h
5a2402b8 8615xm_h=""
c906108c 8616if test "${hostfile}" != ""; then
5a2402b8
AC
8617 xm_h=xm.h
8618 GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}"
8619 files="${files} ${GDB_XM_FILE}"
8620 links="${links} xm.h"
8621 cat >> confdefs.h <<EOF
8622#define GDB_XM_FILE ${GDB_XM_FILE}
8623EOF
8624
c906108c 8625fi
5a2402b8
AC
8626
8627
c906108c 8628rm -f tm.h
5a2402b8 8629tm_h=""
c906108c 8630if test "${targetfile}" != ""; then
5a2402b8
AC
8631 tm_h=tm.h
8632 GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}"
8633 files="${files} ${GDB_TM_FILE}"
8634 links="${links} tm.h"
8635 cat >> confdefs.h <<EOF
8636#define GDB_TM_FILE ${GDB_TM_FILE}
8637EOF
8638
c906108c 8639fi
5a2402b8
AC
8640
8641
c906108c 8642rm -f nm.h
5a2402b8 8643nm_h=""
c906108c 8644if test "${nativefile}" != ""; then
5a2402b8
AC
8645 nm_h=nm.h
8646 GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}"
8647 files="${files} ${GDB_NM_FILE}"
8648 links="${links} nm.h"
8649 cat >> confdefs.h <<EOF
8650#define GDB_NM_FILE ${GDB_NM_FILE}
8651EOF
8652
c906108c 8653fi
5a2402b8
AC
8654
8655
3fc11d3e 8656echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
b2a1bd4f 8657echo "configure:8658: checking whether ln -s works" >&5
3fc11d3e
JM
8658if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
8659 echo $ac_n "(cached) $ac_c" 1>&6
8660else
8661 rm -f conftestdata
8662if ln -s X conftestdata 2>/dev/null
8663then
8664 rm -f conftestdata
8665 ac_cv_prog_LN_S="ln -s"
8666else
8667 ac_cv_prog_LN_S=ln
8668fi
8669fi
8670LN_S="$ac_cv_prog_LN_S"
8671if test "$ac_cv_prog_LN_S" = "ln -s"; then
8672 echo "$ac_t""yes" 1>&6
8673else
8674 echo "$ac_t""no" 1>&6
8675fi
8676
c906108c
SS
8677
8678
8679
8680echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
b2a1bd4f 8681echo "configure:8682: checking for Cygwin environment" >&5
c906108c
SS
8682if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
8683 echo $ac_n "(cached) $ac_c" 1>&6
8684else
8685 cat > conftest.$ac_ext <<EOF
b2a1bd4f 8686#line 8687 "configure"
c906108c
SS
8687#include "confdefs.h"
8688
8689int main() {
8690
8691#ifndef __CYGWIN__
8692#define __CYGWIN__ __CYGWIN32__
8693#endif
8694return __CYGWIN__;
8695; return 0; }
8696EOF
b2a1bd4f 8697if { (eval echo configure:8698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
8698 rm -rf conftest*
8699 ac_cv_cygwin=yes
8700else
8701 echo "configure: failed program was:" >&5
8702 cat conftest.$ac_ext >&5
8703 rm -rf conftest*
8704 ac_cv_cygwin=no
8705fi
8706rm -f conftest*
8707rm -f conftest*
8708fi
8709
8710echo "$ac_t""$ac_cv_cygwin" 1>&6
8711CYGWIN=
8712test "$ac_cv_cygwin" = yes && CYGWIN=yes
8713echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
b2a1bd4f 8714echo "configure:8715: checking for mingw32 environment" >&5
c906108c
SS
8715if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
8716 echo $ac_n "(cached) $ac_c" 1>&6
8717else
8718 cat > conftest.$ac_ext <<EOF
b2a1bd4f 8719#line 8720 "configure"
c906108c
SS
8720#include "confdefs.h"
8721
8722int main() {
8723return __MINGW32__;
8724; return 0; }
8725EOF
b2a1bd4f 8726if { (eval echo configure:8727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c906108c
SS
8727 rm -rf conftest*
8728 ac_cv_mingw32=yes
8729else
8730 echo "configure: failed program was:" >&5
8731 cat conftest.$ac_ext >&5
8732 rm -rf conftest*
8733 ac_cv_mingw32=no
8734fi
8735rm -f conftest*
8736rm -f conftest*
8737fi
8738
8739echo "$ac_t""$ac_cv_mingw32" 1>&6
8740MINGW32=
8741test "$ac_cv_mingw32" = yes && MINGW32=yes
8742
8743
8744echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
b2a1bd4f 8745echo "configure:8746: checking for executable suffix" >&5
c906108c
SS
8746if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
8747 echo $ac_n "(cached) $ac_c" 1>&6
8748else
8749 if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
8750 ac_cv_exeext=.exe
8751else
8752 rm -f conftest*
8753 echo 'int main () { return 0; }' > conftest.$ac_ext
8754 ac_cv_exeext=
b2a1bd4f 8755 if { (eval echo configure:8756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
c906108c
SS
8756 for file in conftest.*; do
8757 case $file in
b2a1bd4f 8758 *.c | *.o | *.obj) ;;
c906108c
SS
8759 *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
8760 esac
8761 done
8762 else
8763 { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
8764 fi
8765 rm -f conftest*
8766 test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
8767fi
8768fi
8769
8770EXEEXT=""
8771test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
8772echo "$ac_t""${ac_cv_exeext}" 1>&6
8773ac_exeext=$EXEEXT
8774
8775
234b45d4
KB
8776
8777cat >> confdefs.h <<\EOF
8778#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
8779EOF
8780
8781
8782
8783
8784 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
8785if test "${with_libiconv_prefix+set}" = set; then
8786 withval="$with_libiconv_prefix"
8787
8788 for dir in `echo "$withval" | tr : ' '`; do
8789 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
8790 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
8791 done
8792
8793fi
8794
8795
8796 echo $ac_n "checking for iconv""... $ac_c" 1>&6
b2a1bd4f 8797echo "configure:8798: checking for iconv" >&5
234b45d4
KB
8798if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
8799 echo $ac_n "(cached) $ac_c" 1>&6
8800else
8801
8802 am_cv_func_iconv="no, consider installing GNU libiconv"
8803 am_cv_lib_iconv=no
8804 cat > conftest.$ac_ext <<EOF
b2a1bd4f 8805#line 8806 "configure"
234b45d4
KB
8806#include "confdefs.h"
8807#include <stdlib.h>
8808#include <iconv.h>
8809int main() {
8810iconv_t cd = iconv_open("","");
8811 iconv(cd,NULL,NULL,NULL,NULL);
8812 iconv_close(cd);
8813; return 0; }
8814EOF
b2a1bd4f 8815if { (eval echo configure:8816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
234b45d4
KB
8816 rm -rf conftest*
8817 am_cv_func_iconv=yes
8818else
8819 echo "configure: failed program was:" >&5
8820 cat conftest.$ac_ext >&5
8821fi
8822rm -f conftest*
8823 if test "$am_cv_func_iconv" != yes; then
8824 am_save_LIBS="$LIBS"
8825 LIBS="$LIBS -liconv"
8826 cat > conftest.$ac_ext <<EOF
b2a1bd4f 8827#line 8828 "configure"
234b45d4
KB
8828#include "confdefs.h"
8829#include <stdlib.h>
8830#include <iconv.h>
8831int main() {
8832iconv_t cd = iconv_open("","");
8833 iconv(cd,NULL,NULL,NULL,NULL);
8834 iconv_close(cd);
8835; return 0; }
8836EOF
b2a1bd4f 8837if { (eval echo configure:8838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
234b45d4
KB
8838 rm -rf conftest*
8839 am_cv_lib_iconv=yes
8840 am_cv_func_iconv=yes
8841else
8842 echo "configure: failed program was:" >&5
8843 cat conftest.$ac_ext >&5
8844fi
8845rm -f conftest*
8846 LIBS="$am_save_LIBS"
8847 fi
8848
8849fi
8850
8851echo "$ac_t""$am_cv_func_iconv" 1>&6
8852 if test "$am_cv_func_iconv" = yes; then
8853 cat >> confdefs.h <<\EOF
8854#define HAVE_ICONV 1
8855EOF
8856
8857 echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
b2a1bd4f 8858echo "configure:8859: checking for iconv declaration" >&5
234b45d4
KB
8859 if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
8860 echo $ac_n "(cached) $ac_c" 1>&6
8861else
8862
8863 cat > conftest.$ac_ext <<EOF
b2a1bd4f 8864#line 8865 "configure"
234b45d4
KB
8865#include "confdefs.h"
8866
8867#include <stdlib.h>
8868#include <iconv.h>
8869extern
8870#ifdef __cplusplus
8871"C"
8872#endif
8873#if defined(__STDC__) || defined(__cplusplus)
8874size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
8875#else
8876size_t iconv();
8877#endif
8878
8879int main() {
8880
8881; return 0; }
8882EOF
b2a1bd4f 8883if { (eval echo configure:8884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
234b45d4
KB
8884 rm -rf conftest*
8885 am_cv_proto_iconv_arg1=""
8886else
8887 echo "configure: failed program was:" >&5
8888 cat conftest.$ac_ext >&5
8889 rm -rf conftest*
8890 am_cv_proto_iconv_arg1="const"
8891fi
8892rm -f conftest*
8893 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
8894fi
8895
8896 am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
8897 echo "$ac_t""${ac_t:-
8898 }$am_cv_proto_iconv" 1>&6
8899 cat >> confdefs.h <<EOF
8900#define ICONV_CONST $am_cv_proto_iconv_arg1
8901EOF
8902
8903 fi
8904 LIBICONV=
8905 if test "$am_cv_lib_iconv" = yes; then
8906 LIBICONV="-liconv"
8907 fi
8908
8909
8910
c906108c
SS
8911subdirs="$configdirs"
8912
8913trap '' 1 2 15
8914cat > confcache <<\EOF
8915# This file is a shell script that caches the results of configure
8916# tests run on this system so they can be shared between configure
8917# scripts and configure runs. It is not useful on other systems.
8918# If it contains results you don't want to keep, you may remove or edit it.
8919#
8920# By default, configure uses ./config.cache as the cache file,
8921# creating it if it does not exist already. You can give configure
8922# the --cache-file=FILE option to use a different cache file; that is
8923# what configure does when it calls configure scripts in
8924# subdirectories, so they share the cache.
8925# Giving --cache-file=/dev/null disables caching, for debugging configure.
8926# config.status only pays attention to the cache file if you give it the
8927# --recheck option to rerun configure.
8928#
8929EOF
8930# The following way of writing the cache mishandles newlines in values,
8931# but we know of no workaround that is simple, portable, and efficient.
8932# So, don't put newlines in cache variables' values.
8933# Ultrix sh set writes to stderr and can't be redirected directly,
8934# and sets the high bit in the cache file unless we assign to the vars.
8935(set) 2>&1 |
8936 case `(ac_space=' '; set | grep ac_space) 2>&1` in
8937 *ac_space=\ *)
8938 # `set' does not quote correctly, so add quotes (double-quote substitution
8939 # turns \\\\ into \\, and sed turns \\ into \).
8940 sed -n \
8941 -e "s/'/'\\\\''/g" \
8942 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
8943 ;;
8944 *)
8945 # `set' quotes correctly as required by POSIX, so do not add quotes.
8946 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
8947 ;;
8948 esac >> confcache
8949if cmp -s $cache_file confcache; then
8950 :
8951else
8952 if test -w $cache_file; then
8953 echo "updating cache $cache_file"
8954 cat confcache > $cache_file
8955 else
8956 echo "not updating unwritable cache $cache_file"
8957 fi
8958fi
8959rm -f confcache
8960
8961trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
8962
8963test "x$prefix" = xNONE && prefix=$ac_default_prefix
8964# Let make expand exec_prefix.
8965test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
8966
8967# Any assignment to VPATH causes Sun make to only execute
8968# the first set of double-colon rules, so remove it if not needed.
8969# If there is a colon in the path, we need to keep it.
8970if test "x$srcdir" = x.; then
8971 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
8972fi
8973
8974trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
8975
8976DEFS=-DHAVE_CONFIG_H
8977
8978# Without the "./", some shells look in PATH for config.status.
8979: ${CONFIG_STATUS=./config.status}
8980
8981echo creating $CONFIG_STATUS
8982rm -f $CONFIG_STATUS
8983cat > $CONFIG_STATUS <<EOF
8984#! /bin/sh
8985# Generated automatically by configure.
8986# Run this file to recreate the current configuration.
8987# This directory was configured as follows,
8988# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
8989#
8990# $0 $ac_configure_args
8991#
8992# Compiler output produced by configure, useful for debugging
8993# configure, is in ./config.log if it exists.
8994
8995ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
8996for ac_option
8997do
8998 case "\$ac_option" in
8999 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
9000 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
9001 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
9002 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
9003 echo "$CONFIG_STATUS generated by autoconf version 2.13"
9004 exit 0 ;;
9005 -help | --help | --hel | --he | --h)
9006 echo "\$ac_cs_usage"; exit 0 ;;
9007 *) echo "\$ac_cs_usage"; exit 1 ;;
9008 esac
9009done
9010
9011ac_given_srcdir=$srcdir
9012ac_given_INSTALL="$INSTALL"
9013
ed952ac5 9014trap 'rm -fr `echo "Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
c906108c
SS
9015EOF
9016cat >> $CONFIG_STATUS <<EOF
9017
9018# Protect against being on the right side of a sed subst in config.status.
9019sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
9020 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
9021$ac_vpsub
9022$extrasub
9023s%@SHELL@%$SHELL%g
9024s%@CFLAGS@%$CFLAGS%g
9025s%@CPPFLAGS@%$CPPFLAGS%g
9026s%@CXXFLAGS@%$CXXFLAGS%g
9027s%@FFLAGS@%$FFLAGS%g
9028s%@DEFS@%$DEFS%g
9029s%@LDFLAGS@%$LDFLAGS%g
9030s%@LIBS@%$LIBS%g
9031s%@exec_prefix@%$exec_prefix%g
9032s%@prefix@%$prefix%g
9033s%@program_transform_name@%$program_transform_name%g
9034s%@bindir@%$bindir%g
9035s%@sbindir@%$sbindir%g
9036s%@libexecdir@%$libexecdir%g
9037s%@datadir@%$datadir%g
9038s%@sysconfdir@%$sysconfdir%g
9039s%@sharedstatedir@%$sharedstatedir%g
9040s%@localstatedir@%$localstatedir%g
9041s%@libdir@%$libdir%g
9042s%@includedir@%$includedir%g
9043s%@oldincludedir@%$oldincludedir%g
9044s%@infodir@%$infodir%g
9045s%@mandir@%$mandir%g
413ccac7
AC
9046s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
9047s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
9048s%@MAINT@%$MAINT%g
c906108c
SS
9049s%@CC@%$CC%g
9050s%@CPP@%$CPP%g
9051s%@host@%$host%g
9052s%@host_alias@%$host_alias%g
9053s%@host_cpu@%$host_cpu%g
9054s%@host_vendor@%$host_vendor%g
9055s%@host_os@%$host_os%g
9056s%@target@%$target%g
9057s%@target_alias@%$target_alias%g
9058s%@target_cpu@%$target_cpu%g
9059s%@target_vendor@%$target_vendor%g
9060s%@target_os@%$target_os%g
9061s%@build@%$build%g
9062s%@build_alias@%$build_alias%g
9063s%@build_cpu@%$build_cpu%g
9064s%@build_vendor@%$build_vendor%g
9065s%@build_os@%$build_os%g
9066s%@SET_MAKE@%$SET_MAKE%g
9067s%@RANLIB@%$RANLIB%g
9068s%@ALLOCA@%$ALLOCA%g
9069s%@USE_NLS@%$USE_NLS%g
9070s%@MSGFMT@%$MSGFMT%g
9071s%@GMSGFMT@%$GMSGFMT%g
9072s%@XGETTEXT@%$XGETTEXT%g
9073s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
9074s%@CATALOGS@%$CATALOGS%g
9075s%@CATOBJEXT@%$CATOBJEXT%g
9076s%@DATADIRNAME@%$DATADIRNAME%g
9077s%@GMOFILES@%$GMOFILES%g
9078s%@INSTOBJEXT@%$INSTOBJEXT%g
9079s%@INTLDEPS@%$INTLDEPS%g
9080s%@INTLLIBS@%$INTLLIBS%g
9081s%@INTLOBJS@%$INTLOBJS%g
9082s%@POFILES@%$POFILES%g
9083s%@POSUB@%$POSUB%g
9084s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
9085s%@GT_NO@%$GT_NO%g
9086s%@GT_YES@%$GT_YES%g
9087s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
9088s%@l@%$l%g
7a292a7a 9089s%@AWK@%$AWK%g
c906108c
SS
9090s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
9091s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
9092s%@INSTALL_DATA@%$INSTALL_DATA%g
9093s%@AR@%$AR%g
95ca63c4
CF
9094s%@DLLTOOL@%$DLLTOOL%g
9095s%@WINDRES@%$WINDRES%g
c906108c 9096s%@YACC@%$YACC%g
75c6e08a 9097s%@MIG@%$MIG%g
c906108c 9098s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g
b4df4f68 9099s%@UIOUT_CFLAGS@%$UIOUT_CFLAGS%g
c906108c 9100s%@WARN_CFLAGS@%$WARN_CFLAGS%g
104c1213 9101s%@WERROR_CFLAGS@%$WERROR_CFLAGS%g
c906108c
SS
9102s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g
9103s%@MMALLOC@%$MMALLOC%g
88987551 9104s%@REGEX@%$REGEX%g
aff38e61 9105s%@SER_HARDWIRE@%$SER_HARDWIRE%g
c906108c 9106s%@TERM_LIB@%$TERM_LIB%g
cd0fc7c3 9107s%@WIN32LIBS@%$WIN32LIBS%g
7a292a7a
SS
9108s%@LIBGUI@%$LIBGUI%g
9109s%@GUI_CFLAGS_X@%$GUI_CFLAGS_X%g
7a292a7a
SS
9110s%@WIN32LDAPP@%$WIN32LDAPP%g
9111s%@TCL_VERSION@%$TCL_VERSION%g
9112s%@TCL_MAJOR_VERSION@%$TCL_MAJOR_VERSION%g
9113s%@TCL_MINOR_VERSION@%$TCL_MINOR_VERSION%g
9114s%@TCL_CC@%$TCL_CC%g
9115s%@TCL_DEFS@%$TCL_DEFS%g
9116s%@TCL_SHLIB_CFLAGS@%$TCL_SHLIB_CFLAGS%g
9117s%@TCL_SHLIB_LD@%$TCL_SHLIB_LD%g
9118s%@TCL_SHLIB_LD_LIBS@%$TCL_SHLIB_LD_LIBS%g
9119s%@TCL_SHLIB_SUFFIX@%$TCL_SHLIB_SUFFIX%g
9120s%@TCL_DL_LIBS@%$TCL_DL_LIBS%g
9121s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g
9122s%@TCL_LD_SEARCH_FLAGS@%$TCL_LD_SEARCH_FLAGS%g
9123s%@TCL_COMPAT_OBJS@%$TCL_COMPAT_OBJS%g
9124s%@TCL_RANLIB@%$TCL_RANLIB%g
9125s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
9126s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
9127s%@TCL_LIB_VERSIONS_OK@%$TCL_LIB_VERSIONS_OK%g
9128s%@TK_VERSION@%$TK_VERSION%g
9129s%@TK_DEFS@%$TK_DEFS%g
9130s%@TK_BUILD_INCLUDES@%$TK_BUILD_INCLUDES%g
9131s%@TK_XINCLUDES@%$TK_XINCLUDES%g
9132s%@TK_XLIBSW@%$TK_XLIBSW%g
9133s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
9134s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
9135s%@TCLHDIR@%$TCLHDIR%g
9136s%@TKHDIR@%$TKHDIR%g
9137s%@ITCLHDIR@%$ITCLHDIR%g
9138s%@ITKHDIR@%$ITKHDIR%g
7a292a7a
SS
9139s%@ITCL_VERSION@%$ITCL_VERSION%g
9140s%@ITCL_DEFS@%$ITCL_DEFS%g
9141s%@ITCL_BUILD_INCLUDES@%$ITCL_BUILD_INCLUDES%g
9142s%@ITCL_BUILD_LIB_SPEC@%$ITCL_BUILD_LIB_SPEC%g
9143s%@ITCL_LIB_SPEC@%$ITCL_LIB_SPEC%g
9144s%@ITK_VERSION@%$ITK_VERSION%g
9145s%@ITK_DEFS@%$ITK_DEFS%g
9146s%@ITK_BUILD_INCLUDES@%$ITK_BUILD_INCLUDES%g
9147s%@ITK_BUILD_LIB_SPEC@%$ITK_BUILD_LIB_SPEC%g
9148s%@ITK_LIB_SPEC@%$ITK_LIB_SPEC%g
7a292a7a
SS
9149s%@X_CFLAGS@%$X_CFLAGS%g
9150s%@X_LDFLAGS@%$X_LDFLAGS%g
9151s%@X_LIBS@%$X_LIBS%g
dd2504ab
JM
9152s%@TCL_DEPS@%$TCL_DEPS%g
9153s%@TK_DEPS@%$TK_DEPS%g
7a292a7a
SS
9154s%@ITCLLIB@%$ITCLLIB%g
9155s%@ITCL_DEPS@%$ITCL_DEPS%g
9156s%@ITKLIB@%$ITKLIB%g
9157s%@ITK_DEPS@%$ITK_DEPS%g
7a292a7a
SS
9158s%@GDBTKLIBS@%$GDBTKLIBS%g
9159s%@GDBTK_CFLAGS@%$GDBTK_CFLAGS%g
d1c3b63a 9160s%@GDBTK_SRC_DIR@%$GDBTK_SRC_DIR%g
7a292a7a
SS
9161s%@IGNORE_SIM@%$IGNORE_SIM%g
9162s%@IGNORE_SIM_OBS@%$IGNORE_SIM_OBS%g
c906108c
SS
9163s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g
9164s%@CONFIG_OBS@%$CONFIG_OBS%g
66b965bb 9165s%@CONFIG_LIB_OBS@%$CONFIG_LIB_OBS%g
c906108c
SS
9166s%@CONFIG_DEPS@%$CONFIG_DEPS%g
9167s%@CONFIG_SRCS@%$CONFIG_SRCS%g
dfcd3bfb 9168s%@CONFIG_INITS@%$CONFIG_INITS%g
b3a90332
AC
9169s%@CONFIG_ALL@%$CONFIG_ALL%g
9170s%@CONFIG_CLEAN@%$CONFIG_CLEAN%g
e56ac5c3
AC
9171s%@CONFIG_INSTALL@%$CONFIG_INSTALL%g
9172s%@CONFIG_UNINSTALL@%$CONFIG_UNINSTALL%g
c906108c
SS
9173s%@HLDFLAGS@%$HLDFLAGS%g
9174s%@HLDENV@%$HLDENV%g
9175s%@target_subdir@%$target_subdir%g
9176/@host_makefile_frag@/r $host_makefile_frag
9177s%@host_makefile_frag@%%g
9178/@target_makefile_frag@/r $target_makefile_frag
9179s%@target_makefile_frag@%%g
9180s%@frags@%$frags%g
96baa820 9181s%@SUBDIRS@%$SUBDIRS%g
5a2402b8
AC
9182s%@xm_h@%$xm_h%g
9183s%@tm_h@%$tm_h%g
9184s%@nm_h@%$nm_h%g
7a292a7a 9185s%@LN_S@%$LN_S%g
c906108c 9186s%@EXEEXT@%$EXEEXT%g
234b45d4 9187s%@LIBICONV@%$LIBICONV%g
c906108c
SS
9188s%@subdirs@%$subdirs%g
9189
9190CEOF
9191EOF
9192
9193cat >> $CONFIG_STATUS <<\EOF
9194
9195# Split the substitutions into bite-sized pieces for seds with
9196# small command number limits, like on Digital OSF/1 and HP-UX.
234b45d4 9197ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
c906108c
SS
9198ac_file=1 # Number of current file.
9199ac_beg=1 # First line for current file.
9200ac_end=$ac_max_sed_cmds # Line after last line for current file.
9201ac_more_lines=:
9202ac_sed_cmds=""
9203while $ac_more_lines; do
9204 if test $ac_beg -gt 1; then
9205 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
9206 else
9207 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
9208 fi
9209 if test ! -s conftest.s$ac_file; then
9210 ac_more_lines=false
9211 rm -f conftest.s$ac_file
9212 else
9213 if test -z "$ac_sed_cmds"; then
9214 ac_sed_cmds="sed -f conftest.s$ac_file"
9215 else
9216 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
9217 fi
9218 ac_file=`expr $ac_file + 1`
9219 ac_beg=$ac_end
9220 ac_end=`expr $ac_end + $ac_max_sed_cmds`
9221 fi
9222done
9223if test -z "$ac_sed_cmds"; then
9224 ac_sed_cmds=cat
9225fi
9226EOF
9227
9228cat >> $CONFIG_STATUS <<EOF
9229
ed952ac5 9230CONFIG_FILES=\${CONFIG_FILES-"Makefile .gdbinit:gdbinit.in"}
c906108c
SS
9231EOF
9232cat >> $CONFIG_STATUS <<\EOF
9233for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
9234 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9235 case "$ac_file" in
9236 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9237 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9238 *) ac_file_in="${ac_file}.in" ;;
9239 esac
9240
9241 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
9242
9243 # Remove last slash and all that follows it. Not all systems have dirname.
9244 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9245 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9246 # The file is in a subdirectory.
9247 test ! -d "$ac_dir" && mkdir "$ac_dir"
9248 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
9249 # A "../" for each directory in $ac_dir_suffix.
9250 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
9251 else
9252 ac_dir_suffix= ac_dots=
9253 fi
9254
9255 case "$ac_given_srcdir" in
9256 .) srcdir=.
9257 if test -z "$ac_dots"; then top_srcdir=.
9258 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
9259 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
9260 *) # Relative path.
9261 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
9262 top_srcdir="$ac_dots$ac_given_srcdir" ;;
9263 esac
9264
9265 case "$ac_given_INSTALL" in
9266 [/$]*) INSTALL="$ac_given_INSTALL" ;;
9267 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
9268 esac
9269
9270 echo creating "$ac_file"
9271 rm -f "$ac_file"
9272 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
9273 case "$ac_file" in
9274 *Makefile*) ac_comsub="1i\\
9275# $configure_input" ;;
9276 *) ac_comsub= ;;
9277 esac
9278
9279 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9280 sed -e "$ac_comsub
9281s%@configure_input@%$configure_input%g
9282s%@srcdir@%$srcdir%g
9283s%@top_srcdir@%$top_srcdir%g
9284s%@INSTALL@%$INSTALL%g
9285" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
9286fi; done
9287rm -f conftest.s*
9288
9289# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
9290# NAME is the cpp macro being defined and VALUE is the value it is being given.
9291#
9292# ac_d sets the value in "#define NAME VALUE" lines.
9293ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
9294ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
9295ac_dC='\3'
9296ac_dD='%g'
9297# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
9298ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
9299ac_uB='\([ ]\)%\1#\2define\3'
9300ac_uC=' '
9301ac_uD='\4%g'
9302# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
9303ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
9304ac_eB='$%\1#\2define\3'
9305ac_eC=' '
9306ac_eD='%g'
9307
9308if test "${CONFIG_HEADERS+set}" != set; then
9309EOF
9310cat >> $CONFIG_STATUS <<EOF
9311 CONFIG_HEADERS="config.h:config.in"
9312EOF
9313cat >> $CONFIG_STATUS <<\EOF
9314fi
9315for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
9316 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
9317 case "$ac_file" in
9318 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
9319 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9320 *) ac_file_in="${ac_file}.in" ;;
9321 esac
9322
9323 echo creating $ac_file
9324
9325 rm -f conftest.frag conftest.in conftest.out
9326 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
9327 cat $ac_file_inputs > conftest.in
9328
9329EOF
9330
9331# Transform confdefs.h into a sed script conftest.vals that substitutes
9332# the proper values into config.h.in to produce config.h. And first:
9333# Protect against being on the right side of a sed subst in config.status.
9334# Protect against being in an unquoted here document in config.status.
9335rm -f conftest.vals
9336cat > conftest.hdr <<\EOF
9337s/[\\&%]/\\&/g
9338s%[\\$`]%\\&%g
9339s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
9340s%ac_d%ac_u%gp
9341s%ac_u%ac_e%gp
9342EOF
9343sed -n -f conftest.hdr confdefs.h > conftest.vals
9344rm -f conftest.hdr
9345
9346# This sed command replaces #undef with comments. This is necessary, for
9347# example, in the case of _POSIX_SOURCE, which is predefined and required
9348# on some systems where configure will not decide to define it.
9349cat >> conftest.vals <<\EOF
9350s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
9351EOF
9352
9353# Break up conftest.vals because some shells have a limit on
9354# the size of here documents, and old seds have small limits too.
9355
9356rm -f conftest.tail
9357while :
9358do
9359 ac_lines=`grep -c . conftest.vals`
9360 # grep -c gives empty output for an empty file on some AIX systems.
9361 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
9362 # Write a limited-size here document to conftest.frag.
9363 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
9364 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
9365 echo 'CEOF
9366 sed -f conftest.frag conftest.in > conftest.out
9367 rm -f conftest.in
9368 mv conftest.out conftest.in
9369' >> $CONFIG_STATUS
9370 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
9371 rm -f conftest.vals
9372 mv conftest.tail conftest.vals
9373done
9374rm -f conftest.vals
9375
9376cat >> $CONFIG_STATUS <<\EOF
9377 rm -f conftest.frag conftest.h
9378 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
9379 cat conftest.in >> conftest.h
9380 rm -f conftest.in
9381 if cmp -s $ac_file conftest.h 2>/dev/null; then
9382 echo "$ac_file is unchanged"
9383 rm -f conftest.h
9384 else
9385 # Remove last slash and all that follows it. Not all systems have dirname.
9386 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
9387 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
9388 # The file is in a subdirectory.
9389 test ! -d "$ac_dir" && mkdir "$ac_dir"
9390 fi
9391 rm -f $ac_file
9392 mv conftest.h $ac_file
9393 fi
9394fi; done
9395
9396EOF
9397
9398cat >> $CONFIG_STATUS <<EOF
9399ac_sources="$files"
9400ac_dests="$links"
9401EOF
9402
9403cat >> $CONFIG_STATUS <<\EOF
9404srcdir=$ac_given_srcdir
9405while test -n "$ac_sources"; do
9406 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
9407 set $ac_sources; ac_source=$1; shift; ac_sources=$*
9408
9409 echo "linking $srcdir/$ac_source to $ac_dest"
9410
9411 if test ! -r $srcdir/$ac_source; then
9412 { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
9413 fi
9414 rm -f $ac_dest
9415
9416 # Make relative symlinks.
9417 # Remove last slash and all that follows it. Not all systems have dirname.
9418 ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
9419 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
9420 # The dest file is in a subdirectory.
9421 test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
9422 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
9423 # A "../" for each directory in $ac_dest_dir_suffix.
9424 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
9425 else
9426 ac_dest_dir_suffix= ac_dots=
9427 fi
9428
9429 case "$srcdir" in
9430 [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
9431 *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
9432 esac
9433
9434 # Make a symlink if possible; otherwise try a hard link.
9435 if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
9436 ln $srcdir/$ac_source $ac_dest; then :
9437 else
9438 { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
9439 fi
9440done
9441EOF
9442cat >> $CONFIG_STATUS <<EOF
9443
9444gdb_host_cpu=$gdb_host_cpu
9445gdb_target_cpu=$gdb_target_cpu
9446nativefile=$nativefile
9447
9448EOF
9449cat >> $CONFIG_STATUS <<\EOF
9450
9451if test "${nativefile}" = ""; then
c4620205 9452 < Makefile \
e27da16d
JT
9453 sed -e '/^NATDEPFILES[ ]*=.*\\$/,/[^\\]$/s/^/# /' \
9454 -e '/^NATDEPFILES[ ]*=/s/^/# /' \
c4620205
JB
9455 | sed -e '/^\(NATDEPFILES[ ]*[+]=[ ]*\)/s//# \1/' \
9456 > Makefile.tem
c906108c
SS
9457mv -f Makefile.tem Makefile
9458fi
9459
9460sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
9461/^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
9462/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
9463mv -f Makefile.tmp Makefile
9464
2acceee2 9465
c906108c
SS
9466case x$CONFIG_HEADERS in
9467xconfig.h:config.in)
9468echo > stamp-h ;;
9469esac
9470
9471exit 0
9472EOF
9473chmod +x $CONFIG_STATUS
9474rm -fr confdefs* $ac_clean_files
9475test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
9476
9477if test "$no_recursion" != yes; then
9478
9479 # Remove --cache-file and --srcdir arguments so they do not pile up.
9480 ac_sub_configure_args=
9481 ac_prev=
9482 for ac_arg in $ac_configure_args; do
9483 if test -n "$ac_prev"; then
9484 ac_prev=
9485 continue
9486 fi
9487 case "$ac_arg" in
9488 -cache-file | --cache-file | --cache-fil | --cache-fi \
9489 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
9490 ac_prev=cache_file ;;
9491 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
9492 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
9493 ;;
9494 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
9495 ac_prev=srcdir ;;
9496 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
9497 ;;
9498 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
9499 esac
9500 done
9501
9502 for ac_config_dir in $configdirs; do
9503
9504 # Do not complain, so a configure script can configure whichever
9505 # parts of a large source tree are present.
9506 if test ! -d $srcdir/$ac_config_dir; then
9507 continue
9508 fi
9509
9510 echo configuring in $ac_config_dir
9511
9512 case "$srcdir" in
9513 .) ;;
9514 *)
9515 if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
9516 else
9517 { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
9518 fi
9519 ;;
9520 esac
9521
9522 ac_popdir=`pwd`
9523 cd $ac_config_dir
9524
9525 # A "../" for each directory in /$ac_config_dir.
9526 ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
9527
9528 case "$srcdir" in
9529 .) # No --srcdir option. We are building in place.
9530 ac_sub_srcdir=$srcdir ;;
9531 /*) # Absolute path.
9532 ac_sub_srcdir=$srcdir/$ac_config_dir ;;
9533 *) # Relative path.
9534 ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
9535 esac
9536
9537 # Check for guested configure; otherwise get Cygnus style configure.
9538 if test -f $ac_sub_srcdir/configure; then
9539 ac_sub_configure=$ac_sub_srcdir/configure
9540 elif test -f $ac_sub_srcdir/configure.in; then
9541 ac_sub_configure=$ac_configure
9542 else
9543 echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
9544 ac_sub_configure=
9545 fi
9546
9547 # The recursion is here.
9548 if test -n "$ac_sub_configure"; then
9549
9550 # Make the cache file name correct relative to the subdirectory.
9551 case "$cache_file" in
9552 /*) ac_sub_cache_file=$cache_file ;;
9553 *) # Relative path.
9554 ac_sub_cache_file="$ac_dots$cache_file" ;;
9555 esac
9556 case "$ac_given_INSTALL" in
9557 [/$]*) INSTALL="$ac_given_INSTALL" ;;
9558 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
9559 esac
9560
9561 echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
9562 # The eval makes quoting arguments work.
9563 if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
9564 then :
9565 else
9566 { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
9567 fi
9568 fi
9569
9570 cd $ac_popdir
9571 done
9572fi
9573
9574
9575exit 0
This page took 0.759028 seconds and 4 git commands to generate.