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