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