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