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