Use M_INTWAIT, not M_NOWAIT. We don't really support fast interrupt
[dragonfly.git] / contrib / gdb / gdb / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --disable-nls           do not use Native Language Support"
16 ac_help="$ac_help
17   --with-included-gettext use the GNU gettext library included here"
18 ac_help="$ac_help
19   --enable-tui            Enable full-screen terminal user interface"
20 ac_help="$ac_help
21   --enable-netrom         Enable NetROM support"
22 ac_help="$ac_help
23   --enable-build-warnings Enable build-time compiler warnings if gcc is used"
24 ac_help="$ac_help
25   --with-mmalloc          Use memory mapped malloc package"
26 ac_help="$ac_help
27   --with-x                use the X Window System"
28 ac_help="$ac_help
29   --enable-shared         Use shared libraries"
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 SHELL=${CONFIG_SHELL-/bin/sh}
69 # Maximum number of lines to put in a shell here document.
70 ac_max_here_lines=12
71
72 ac_prev=
73 for ac_option
74 do
75
76   # If the previous option needs an argument, assign it.
77   if test -n "$ac_prev"; then
78     eval "$ac_prev=\$ac_option"
79     ac_prev=
80     continue
81   fi
82
83   case "$ac_option" in
84   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
85   *) ac_optarg= ;;
86   esac
87
88   # Accept the important Cygnus configure options, so we can diagnose typos.
89
90   case "$ac_option" in
91
92   -bindir | --bindir | --bindi | --bind | --bin | --bi)
93     ac_prev=bindir ;;
94   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
95     bindir="$ac_optarg" ;;
96
97   -build | --build | --buil | --bui | --bu)
98     ac_prev=build ;;
99   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
100     build="$ac_optarg" ;;
101
102   -cache-file | --cache-file | --cache-fil | --cache-fi \
103   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
104     ac_prev=cache_file ;;
105   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
106   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
107     cache_file="$ac_optarg" ;;
108
109   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
110     ac_prev=datadir ;;
111   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
112   | --da=*)
113     datadir="$ac_optarg" ;;
114
115   -disable-* | --disable-*)
116     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
117     # Reject names that are not valid shell variable names.
118     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
119       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
120     fi
121     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
122     eval "enable_${ac_feature}=no" ;;
123
124   -enable-* | --enable-*)
125     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
126     # Reject names that are not valid shell variable names.
127     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
128       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
129     fi
130     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
131     case "$ac_option" in
132       *=*) ;;
133       *) ac_optarg=yes ;;
134     esac
135     eval "enable_${ac_feature}='$ac_optarg'" ;;
136
137   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
138   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
139   | --exec | --exe | --ex)
140     ac_prev=exec_prefix ;;
141   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
142   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
143   | --exec=* | --exe=* | --ex=*)
144     exec_prefix="$ac_optarg" ;;
145
146   -gas | --gas | --ga | --g)
147     # Obsolete; use --with-gas.
148     with_gas=yes ;;
149
150   -help | --help | --hel | --he)
151     # Omit some internal or obsolete options to make the list less imposing.
152     # This message is too long to be a string in the A/UX 3.1 sh.
153     cat << EOF
154 Usage: configure [options] [host]
155 Options: [defaults in brackets after descriptions]
156 Configuration:
157   --cache-file=FILE       cache test results in FILE
158   --help                  print this message
159   --no-create             do not create output files
160   --quiet, --silent       do not print \`checking...' messages
161   --version               print the version of autoconf that created configure
162 Directory and file names:
163   --prefix=PREFIX         install architecture-independent files in PREFIX
164                           [$ac_default_prefix]
165   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
166                           [same as prefix]
167   --bindir=DIR            user executables in DIR [EPREFIX/bin]
168   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
169   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
170   --datadir=DIR           read-only architecture-independent data in DIR
171                           [PREFIX/share]
172   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
173   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
174                           [PREFIX/com]
175   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
176   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
177   --includedir=DIR        C header files in DIR [PREFIX/include]
178   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
179   --infodir=DIR           info documentation in DIR [PREFIX/info]
180   --mandir=DIR            man documentation in DIR [PREFIX/man]
181   --srcdir=DIR            find the sources in DIR [configure dir or ..]
182   --program-prefix=PREFIX prepend PREFIX to installed program names
183   --program-suffix=SUFFIX append SUFFIX to installed program names
184   --program-transform-name=PROGRAM
185                           run sed PROGRAM on installed program names
186 EOF
187     cat << EOF
188 Host type:
189   --build=BUILD           configure for building on BUILD [BUILD=HOST]
190   --host=HOST             configure for HOST [guessed]
191   --target=TARGET         configure for TARGET [TARGET=HOST]
192 Features and packages:
193   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
194   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
195   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
196   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
197   --x-includes=DIR        X include files are in DIR
198   --x-libraries=DIR       X library files are in DIR
199 EOF
200     if test -n "$ac_help"; then
201       echo "--enable and --with options recognized:$ac_help"
202     fi
203     exit 0 ;;
204
205   -host | --host | --hos | --ho)
206     ac_prev=host ;;
207   -host=* | --host=* | --hos=* | --ho=*)
208     host="$ac_optarg" ;;
209
210   -includedir | --includedir | --includedi | --included | --include \
211   | --includ | --inclu | --incl | --inc)
212     ac_prev=includedir ;;
213   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
214   | --includ=* | --inclu=* | --incl=* | --inc=*)
215     includedir="$ac_optarg" ;;
216
217   -infodir | --infodir | --infodi | --infod | --info | --inf)
218     ac_prev=infodir ;;
219   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
220     infodir="$ac_optarg" ;;
221
222   -libdir | --libdir | --libdi | --libd)
223     ac_prev=libdir ;;
224   -libdir=* | --libdir=* | --libdi=* | --libd=*)
225     libdir="$ac_optarg" ;;
226
227   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
228   | --libexe | --libex | --libe)
229     ac_prev=libexecdir ;;
230   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
231   | --libexe=* | --libex=* | --libe=*)
232     libexecdir="$ac_optarg" ;;
233
234   -localstatedir | --localstatedir | --localstatedi | --localstated \
235   | --localstate | --localstat | --localsta | --localst \
236   | --locals | --local | --loca | --loc | --lo)
237     ac_prev=localstatedir ;;
238   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
239   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
240   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
241     localstatedir="$ac_optarg" ;;
242
243   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
244     ac_prev=mandir ;;
245   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
246     mandir="$ac_optarg" ;;
247
248   -nfp | --nfp | --nf)
249     # Obsolete; use --without-fp.
250     with_fp=no ;;
251
252   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
253   | --no-cr | --no-c)
254     no_create=yes ;;
255
256   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
257   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
258     no_recursion=yes ;;
259
260   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
261   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
262   | --oldin | --oldi | --old | --ol | --o)
263     ac_prev=oldincludedir ;;
264   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
265   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
266   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
267     oldincludedir="$ac_optarg" ;;
268
269   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
270     ac_prev=prefix ;;
271   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
272     prefix="$ac_optarg" ;;
273
274   -program-prefix | --program-prefix | --program-prefi | --program-pref \
275   | --program-pre | --program-pr | --program-p)
276     ac_prev=program_prefix ;;
277   -program-prefix=* | --program-prefix=* | --program-prefi=* \
278   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
279     program_prefix="$ac_optarg" ;;
280
281   -program-suffix | --program-suffix | --program-suffi | --program-suff \
282   | --program-suf | --program-su | --program-s)
283     ac_prev=program_suffix ;;
284   -program-suffix=* | --program-suffix=* | --program-suffi=* \
285   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
286     program_suffix="$ac_optarg" ;;
287
288   -program-transform-name | --program-transform-name \
289   | --program-transform-nam | --program-transform-na \
290   | --program-transform-n | --program-transform- \
291   | --program-transform | --program-transfor \
292   | --program-transfo | --program-transf \
293   | --program-trans | --program-tran \
294   | --progr-tra | --program-tr | --program-t)
295     ac_prev=program_transform_name ;;
296   -program-transform-name=* | --program-transform-name=* \
297   | --program-transform-nam=* | --program-transform-na=* \
298   | --program-transform-n=* | --program-transform-=* \
299   | --program-transform=* | --program-transfor=* \
300   | --program-transfo=* | --program-transf=* \
301   | --program-trans=* | --program-tran=* \
302   | --progr-tra=* | --program-tr=* | --program-t=*)
303     program_transform_name="$ac_optarg" ;;
304
305   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
306   | -silent | --silent | --silen | --sile | --sil)
307     silent=yes ;;
308
309   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
310     ac_prev=sbindir ;;
311   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
312   | --sbi=* | --sb=*)
313     sbindir="$ac_optarg" ;;
314
315   -sharedstatedir | --sharedstatedir | --sharedstatedi \
316   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
317   | --sharedst | --shareds | --shared | --share | --shar \
318   | --sha | --sh)
319     ac_prev=sharedstatedir ;;
320   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
321   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
322   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
323   | --sha=* | --sh=*)
324     sharedstatedir="$ac_optarg" ;;
325
326   -site | --site | --sit)
327     ac_prev=site ;;
328   -site=* | --site=* | --sit=*)
329     site="$ac_optarg" ;;
330
331   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
332     ac_prev=srcdir ;;
333   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
334     srcdir="$ac_optarg" ;;
335
336   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
337   | --syscon | --sysco | --sysc | --sys | --sy)
338     ac_prev=sysconfdir ;;
339   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
340   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
341     sysconfdir="$ac_optarg" ;;
342
343   -target | --target | --targe | --targ | --tar | --ta | --t)
344     ac_prev=target ;;
345   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
346     target="$ac_optarg" ;;
347
348   -v | -verbose | --verbose | --verbos | --verbo | --verb)
349     verbose=yes ;;
350
351   -version | --version | --versio | --versi | --vers)
352     echo "configure generated by autoconf version 2.13"
353     exit 0 ;;
354
355   -with-* | --with-*)
356     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
357     # Reject names that are not valid shell variable names.
358     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
359       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
360     fi
361     ac_package=`echo $ac_package| sed 's/-/_/g'`
362     case "$ac_option" in
363       *=*) ;;
364       *) ac_optarg=yes ;;
365     esac
366     eval "with_${ac_package}='$ac_optarg'" ;;
367
368   -without-* | --without-*)
369     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
370     # Reject names that are not valid shell variable names.
371     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
372       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
373     fi
374     ac_package=`echo $ac_package| sed 's/-/_/g'`
375     eval "with_${ac_package}=no" ;;
376
377   --x)
378     # Obsolete; use --with-x.
379     with_x=yes ;;
380
381   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
382   | --x-incl | --x-inc | --x-in | --x-i)
383     ac_prev=x_includes ;;
384   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
385   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
386     x_includes="$ac_optarg" ;;
387
388   -x-libraries | --x-libraries | --x-librarie | --x-librari \
389   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
390     ac_prev=x_libraries ;;
391   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
392   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
393     x_libraries="$ac_optarg" ;;
394
395   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
396     ;;
397
398   *)
399     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
400       echo "configure: warning: $ac_option: invalid host type" 1>&2
401     fi
402     if test "x$nonopt" != xNONE; then
403       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
404     fi
405     nonopt="$ac_option"
406     ;;
407
408   esac
409 done
410
411 if test -n "$ac_prev"; then
412   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
413 fi
414
415 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
416
417 # File descriptor usage:
418 # 0 standard input
419 # 1 file creation
420 # 2 errors and warnings
421 # 3 some systems may open it to /dev/tty
422 # 4 used on the Kubota Titan
423 # 6 checking for... messages and results
424 # 5 compiler messages saved in config.log
425 if test "$silent" = yes; then
426   exec 6>/dev/null
427 else
428   exec 6>&1
429 fi
430 exec 5>./config.log
431
432 echo "\
433 This file contains any messages produced by compilers while
434 running configure, to aid debugging if configure makes a mistake.
435 " 1>&5
436
437 # Strip out --no-create and --no-recursion so they do not pile up.
438 # Also quote any args containing shell metacharacters.
439 ac_configure_args=
440 for ac_arg
441 do
442   case "$ac_arg" in
443   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
444   | --no-cr | --no-c) ;;
445   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
446   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
447   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
448   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
449   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
450   esac
451 done
452
453 # NLS nuisances.
454 # Only set these to C if already set.  These must not be set unconditionally
455 # because not all systems understand e.g. LANG=C (notably SCO).
456 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
457 # Non-C LC_CTYPE values break the ctype check.
458 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
459 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
460 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
461 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
462
463 # confdefs.h avoids OS command line length limits that DEFS can exceed.
464 rm -rf conftest* confdefs.h
465 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
466 echo > confdefs.h
467
468 # A filename unique to this package, relative to the directory that
469 # configure is in, which we can look for to find out if srcdir is correct.
470 ac_unique_file=main.c
471
472 # Find the source files, if location was not specified.
473 if test -z "$srcdir"; then
474   ac_srcdir_defaulted=yes
475   # Try the directory containing this script, then its parent.
476   ac_prog=$0
477   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
478   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
479   srcdir=$ac_confdir
480   if test ! -r $srcdir/$ac_unique_file; then
481     srcdir=..
482   fi
483 else
484   ac_srcdir_defaulted=no
485 fi
486 if test ! -r $srcdir/$ac_unique_file; then
487   if test "$ac_srcdir_defaulted" = yes; then
488     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
489   else
490     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
491   fi
492 fi
493 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
494
495 # Prefer explicitly selected file to automatically selected ones.
496 if test -z "$CONFIG_SITE"; then
497   if test "x$prefix" != xNONE; then
498     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
499   else
500     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
501   fi
502 fi
503 for ac_site_file in $CONFIG_SITE; do
504   if test -r "$ac_site_file"; then
505     echo "loading site script $ac_site_file"
506     . "$ac_site_file"
507   fi
508 done
509
510 if test -r "$cache_file"; then
511   echo "loading cache $cache_file"
512   . $cache_file
513 else
514   echo "creating cache $cache_file"
515   > $cache_file
516 fi
517
518 ac_ext=c
519 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
520 ac_cpp='$CPP $CPPFLAGS'
521 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
522 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
523 cross_compiling=$ac_cv_prog_cc_cross
524
525 ac_exeext=
526 ac_objext=o
527 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
528   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
529   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
530     ac_n= ac_c='
531 ' ac_t='        '
532   else
533     ac_n=-n ac_c= ac_t=
534   fi
535 else
536   ac_n= ac_c='\c' ac_t=
537 fi
538
539
540
541
542 # Extract the first word of "gcc", so it can be a program name with args.
543 set dummy gcc; ac_word=$2
544 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
545 echo "configure:546: checking for $ac_word" >&5
546 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
547   echo $ac_n "(cached) $ac_c" 1>&6
548 else
549   if test -n "$CC"; then
550   ac_cv_prog_CC="$CC" # Let the user override the test.
551 else
552   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
553   ac_dummy="$PATH"
554   for ac_dir in $ac_dummy; do
555     test -z "$ac_dir" && ac_dir=.
556     if test -f $ac_dir/$ac_word; then
557       ac_cv_prog_CC="gcc"
558       break
559     fi
560   done
561   IFS="$ac_save_ifs"
562 fi
563 fi
564 CC="$ac_cv_prog_CC"
565 if test -n "$CC"; then
566   echo "$ac_t""$CC" 1>&6
567 else
568   echo "$ac_t""no" 1>&6
569 fi
570
571 if test -z "$CC"; then
572   # Extract the first word of "cc", so it can be a program name with args.
573 set dummy cc; ac_word=$2
574 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
575 echo "configure:576: checking for $ac_word" >&5
576 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
577   echo $ac_n "(cached) $ac_c" 1>&6
578 else
579   if test -n "$CC"; then
580   ac_cv_prog_CC="$CC" # Let the user override the test.
581 else
582   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
583   ac_prog_rejected=no
584   ac_dummy="$PATH"
585   for ac_dir in $ac_dummy; do
586     test -z "$ac_dir" && ac_dir=.
587     if test -f $ac_dir/$ac_word; then
588       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
589         ac_prog_rejected=yes
590         continue
591       fi
592       ac_cv_prog_CC="cc"
593       break
594     fi
595   done
596   IFS="$ac_save_ifs"
597 if test $ac_prog_rejected = yes; then
598   # We found a bogon in the path, so make sure we never use it.
599   set dummy $ac_cv_prog_CC
600   shift
601   if test $# -gt 0; then
602     # We chose a different compiler from the bogus one.
603     # However, it has the same basename, so the bogon will be chosen
604     # first if we set CC to just the basename; use the full file name.
605     shift
606     set dummy "$ac_dir/$ac_word" "$@"
607     shift
608     ac_cv_prog_CC="$@"
609   fi
610 fi
611 fi
612 fi
613 CC="$ac_cv_prog_CC"
614 if test -n "$CC"; then
615   echo "$ac_t""$CC" 1>&6
616 else
617   echo "$ac_t""no" 1>&6
618 fi
619
620   if test -z "$CC"; then
621     case "`uname -s`" in
622     *win32* | *WIN32*)
623       # Extract the first word of "cl", so it can be a program name with args.
624 set dummy cl; ac_word=$2
625 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
626 echo "configure:627: checking for $ac_word" >&5
627 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
628   echo $ac_n "(cached) $ac_c" 1>&6
629 else
630   if test -n "$CC"; then
631   ac_cv_prog_CC="$CC" # Let the user override the test.
632 else
633   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
634   ac_dummy="$PATH"
635   for ac_dir in $ac_dummy; do
636     test -z "$ac_dir" && ac_dir=.
637     if test -f $ac_dir/$ac_word; then
638       ac_cv_prog_CC="cl"
639       break
640     fi
641   done
642   IFS="$ac_save_ifs"
643 fi
644 fi
645 CC="$ac_cv_prog_CC"
646 if test -n "$CC"; then
647   echo "$ac_t""$CC" 1>&6
648 else
649   echo "$ac_t""no" 1>&6
650 fi
651  ;;
652     esac
653   fi
654   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
655 fi
656
657 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
658 echo "configure:659: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
659
660 ac_ext=c
661 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
662 ac_cpp='$CPP $CPPFLAGS'
663 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
664 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
665 cross_compiling=$ac_cv_prog_cc_cross
666
667 cat > conftest.$ac_ext << EOF
668
669 #line 670 "configure"
670 #include "confdefs.h"
671
672 main(){return(0);}
673 EOF
674 if { (eval echo configure:675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
675   ac_cv_prog_cc_works=yes
676   # If we can't run a trivial program, we are probably using a cross compiler.
677   if (./conftest; exit) 2>/dev/null; then
678     ac_cv_prog_cc_cross=no
679   else
680     ac_cv_prog_cc_cross=yes
681   fi
682 else
683   echo "configure: failed program was:" >&5
684   cat conftest.$ac_ext >&5
685   ac_cv_prog_cc_works=no
686 fi
687 rm -fr conftest*
688 ac_ext=c
689 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
690 ac_cpp='$CPP $CPPFLAGS'
691 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
692 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
693 cross_compiling=$ac_cv_prog_cc_cross
694
695 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
696 if test $ac_cv_prog_cc_works = no; then
697   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
698 fi
699 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
700 echo "configure:701: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
701 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
702 cross_compiling=$ac_cv_prog_cc_cross
703
704 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
705 echo "configure:706: checking whether we are using GNU C" >&5
706 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
707   echo $ac_n "(cached) $ac_c" 1>&6
708 else
709   cat > conftest.c <<EOF
710 #ifdef __GNUC__
711   yes;
712 #endif
713 EOF
714 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
715   ac_cv_prog_gcc=yes
716 else
717   ac_cv_prog_gcc=no
718 fi
719 fi
720
721 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
722
723 if test $ac_cv_prog_gcc = yes; then
724   GCC=yes
725 else
726   GCC=
727 fi
728
729 ac_test_CFLAGS="${CFLAGS+set}"
730 ac_save_CFLAGS="$CFLAGS"
731 CFLAGS=
732 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
733 echo "configure:734: checking whether ${CC-cc} accepts -g" >&5
734 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
735   echo $ac_n "(cached) $ac_c" 1>&6
736 else
737   echo 'void f(){}' > conftest.c
738 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
739   ac_cv_prog_cc_g=yes
740 else
741   ac_cv_prog_cc_g=no
742 fi
743 rm -f conftest*
744
745 fi
746
747 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
748 if test "$ac_test_CFLAGS" = set; then
749   CFLAGS="$ac_save_CFLAGS"
750 elif test $ac_cv_prog_cc_g = yes; then
751   if test "$GCC" = yes; then
752     CFLAGS="-g -O2"
753   else
754     CFLAGS="-g"
755   fi
756 else
757   if test "$GCC" = yes; then
758     CFLAGS="-O2"
759   else
760     CFLAGS=
761   fi
762 fi
763
764 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
765 echo "configure:766: checking how to run the C preprocessor" >&5
766 # On Suns, sometimes $CPP names a directory.
767 if test -n "$CPP" && test -d "$CPP"; then
768   CPP=
769 fi
770 if test -z "$CPP"; then
771 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
772   echo $ac_n "(cached) $ac_c" 1>&6
773 else
774     # This must be in double quotes, not single quotes, because CPP may get
775   # substituted into the Makefile and "${CC-cc}" will confuse make.
776   CPP="${CC-cc} -E"
777   # On the NeXT, cc -E runs the code through the compiler's parser,
778   # not just through cpp.
779   cat > conftest.$ac_ext <<EOF
780 #line 781 "configure"
781 #include "confdefs.h"
782 #include <assert.h>
783 Syntax Error
784 EOF
785 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
786 { (eval echo configure:787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
787 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
788 if test -z "$ac_err"; then
789   :
790 else
791   echo "$ac_err" >&5
792   echo "configure: failed program was:" >&5
793   cat conftest.$ac_ext >&5
794   rm -rf conftest*
795   CPP="${CC-cc} -E -traditional-cpp"
796   cat > conftest.$ac_ext <<EOF
797 #line 798 "configure"
798 #include "confdefs.h"
799 #include <assert.h>
800 Syntax Error
801 EOF
802 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
803 { (eval echo configure:804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
804 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
805 if test -z "$ac_err"; then
806   :
807 else
808   echo "$ac_err" >&5
809   echo "configure: failed program was:" >&5
810   cat conftest.$ac_ext >&5
811   rm -rf conftest*
812   CPP="${CC-cc} -nologo -E"
813   cat > conftest.$ac_ext <<EOF
814 #line 815 "configure"
815 #include "confdefs.h"
816 #include <assert.h>
817 Syntax Error
818 EOF
819 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
820 { (eval echo configure:821: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
821 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
822 if test -z "$ac_err"; then
823   :
824 else
825   echo "$ac_err" >&5
826   echo "configure: failed program was:" >&5
827   cat conftest.$ac_ext >&5
828   rm -rf conftest*
829   CPP=/lib/cpp
830 fi
831 rm -f conftest*
832 fi
833 rm -f conftest*
834 fi
835 rm -f conftest*
836   ac_cv_prog_CPP="$CPP"
837 fi
838   CPP="$ac_cv_prog_CPP"
839 else
840   ac_cv_prog_CPP="$CPP"
841 fi
842 echo "$ac_t""$CPP" 1>&6
843
844 echo $ac_n "checking for AIX""... $ac_c" 1>&6
845 echo "configure:846: checking for AIX" >&5
846 cat > conftest.$ac_ext <<EOF
847 #line 848 "configure"
848 #include "confdefs.h"
849 #ifdef _AIX
850   yes
851 #endif
852
853 EOF
854 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
855   egrep "yes" >/dev/null 2>&1; then
856   rm -rf conftest*
857   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
858 #define _ALL_SOURCE 1
859 EOF
860
861 else
862   rm -rf conftest*
863   echo "$ac_t""no" 1>&6
864 fi
865 rm -f conftest*
866
867
868 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
869 echo "configure:870: checking for POSIXized ISC" >&5
870 if test -d /etc/conf/kconfig.d &&
871   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
872 then
873   echo "$ac_t""yes" 1>&6
874   ISC=yes # If later tests want to check for ISC.
875   cat >> confdefs.h <<\EOF
876 #define _POSIX_SOURCE 1
877 EOF
878
879   if test "$GCC" = yes; then
880     CC="$CC -posix"
881   else
882     CC="$CC -Xp"
883   fi
884 else
885   echo "$ac_t""no" 1>&6
886   ISC=
887 fi
888
889
890
891
892 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
893 echo "configure:894: checking for ${CC-cc} option to accept ANSI C" >&5
894 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
895   echo $ac_n "(cached) $ac_c" 1>&6
896 else
897   am_cv_prog_cc_stdc=no
898 ac_save_CC="$CC"
899 # Don't try gcc -ansi; that turns off useful extensions and
900 # breaks some systems' header files.
901 # AIX                   -qlanglvl=ansi
902 # Ultrix and OSF/1      -std1
903 # HP-UX                 -Aa -D_HPUX_SOURCE
904 # SVR4                  -Xc -D__EXTENSIONS__
905 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
906 do
907   CC="$ac_save_CC $ac_arg"
908   cat > conftest.$ac_ext <<EOF
909 #line 910 "configure"
910 #include "confdefs.h"
911 #include <stdarg.h>
912 #include <stdio.h>
913 #include <sys/types.h>
914 #include <sys/stat.h>
915 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
916 struct buf { int x; };
917 FILE * (*rcsopen) (struct buf *, struct stat *, int);
918 static char *e (p, i)
919      char **p;
920      int i;
921 {
922   return p[i];
923 }
924 static char *f (char * (*g) (char **, int), char **p, ...)
925 {
926   char *s;
927   va_list v;
928   va_start (v,p);
929   s = g (p, va_arg (v,int));
930   va_end (v);
931   return s;
932 }
933 int test (int i, double x);
934 struct s1 {int (*f) (int a);};
935 struct s2 {int (*f) (double a);};
936 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
937 int argc;
938 char **argv;
939
940 int main() {
941
942 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
943
944 ; return 0; }
945 EOF
946 if { (eval echo configure:947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
947   rm -rf conftest*
948   am_cv_prog_cc_stdc="$ac_arg"; break
949 else
950   echo "configure: failed program was:" >&5
951   cat conftest.$ac_ext >&5
952 fi
953 rm -f conftest*
954 done
955 CC="$ac_save_CC"
956
957 fi
958
959 if test -z "$am_cv_prog_cc_stdc"; then
960   echo "$ac_t""none needed" 1>&6
961 else
962   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
963 fi
964 case "x$am_cv_prog_cc_stdc" in
965   x|xno) ;;
966   *) CC="$CC $am_cv_prog_cc_stdc" ;;
967 esac
968
969
970 ac_aux_dir=
971 for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
972   if test -f $ac_dir/install-sh; then
973     ac_aux_dir=$ac_dir
974     ac_install_sh="$ac_aux_dir/install-sh -c"
975     break
976   elif test -f $ac_dir/install.sh; then
977     ac_aux_dir=$ac_dir
978     ac_install_sh="$ac_aux_dir/install.sh -c"
979     break
980   fi
981 done
982 if test -z "$ac_aux_dir"; then
983   { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/.." 1>&2; exit 1; }
984 fi
985 ac_config_guess=$ac_aux_dir/config.guess
986 ac_config_sub=$ac_aux_dir/config.sub
987 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
988
989
990 # Do some error checking and defaulting for the host and target type.
991 # The inputs are:
992 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
993 #
994 # The rules are:
995 # 1. You are not allowed to specify --host, --target, and nonopt at the
996 #    same time.
997 # 2. Host defaults to nonopt.
998 # 3. If nonopt is not specified, then host defaults to the current host,
999 #    as determined by config.guess.
1000 # 4. Target and build default to nonopt.
1001 # 5. If nonopt is not specified, then target and build default to host.
1002
1003 # The aliases save the names the user supplied, while $host etc.
1004 # will get canonicalized.
1005 case $host---$target---$nonopt in
1006 NONE---*---* | *---NONE---* | *---*---NONE) ;;
1007 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1008 esac
1009
1010
1011 # Make sure we can run config.sub.
1012 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1013 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1014 fi
1015
1016 echo $ac_n "checking host system type""... $ac_c" 1>&6
1017 echo "configure:1018: checking host system type" >&5
1018
1019 host_alias=$host
1020 case "$host_alias" in
1021 NONE)
1022   case $nonopt in
1023   NONE)
1024     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1025     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1026     fi ;;
1027   *) host_alias=$nonopt ;;
1028   esac ;;
1029 esac
1030
1031 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1032 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1033 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1034 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1035 echo "$ac_t""$host" 1>&6
1036
1037 echo $ac_n "checking target system type""... $ac_c" 1>&6
1038 echo "configure:1039: checking target system type" >&5
1039
1040 target_alias=$target
1041 case "$target_alias" in
1042 NONE)
1043   case $nonopt in
1044   NONE) target_alias=$host_alias ;;
1045   *) target_alias=$nonopt ;;
1046   esac ;;
1047 esac
1048
1049 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
1050 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1051 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1052 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1053 echo "$ac_t""$target" 1>&6
1054
1055 echo $ac_n "checking build system type""... $ac_c" 1>&6
1056 echo "configure:1057: checking build system type" >&5
1057
1058 build_alias=$build
1059 case "$build_alias" in
1060 NONE)
1061   case $nonopt in
1062   NONE) build_alias=$host_alias ;;
1063   *) build_alias=$nonopt ;;
1064   esac ;;
1065 esac
1066
1067 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
1068 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1069 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1070 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1071 echo "$ac_t""$build" 1>&6
1072
1073 test "$host_alias" != "$target_alias" &&
1074   test "$program_prefix$program_suffix$program_transform_name" = \
1075     NONENONEs,x,x, &&
1076   program_prefix=${target_alias}-
1077
1078
1079 ALL_LINGUAS=
1080 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1081 echo "configure:1082: checking whether ${MAKE-make} sets \${MAKE}" >&5
1082 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1083 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1084   echo $ac_n "(cached) $ac_c" 1>&6
1085 else
1086   cat > conftestmake <<\EOF
1087 all:
1088         @echo 'ac_maketemp="${MAKE}"'
1089 EOF
1090 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1091 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1092 if test -n "$ac_maketemp"; then
1093   eval ac_cv_prog_make_${ac_make}_set=yes
1094 else
1095   eval ac_cv_prog_make_${ac_make}_set=no
1096 fi
1097 rm -f conftestmake
1098 fi
1099 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1100   echo "$ac_t""yes" 1>&6
1101   SET_MAKE=
1102 else
1103   echo "$ac_t""no" 1>&6
1104   SET_MAKE="MAKE=${MAKE-make}"
1105 fi
1106
1107 # Extract the first word of "ranlib", so it can be a program name with args.
1108 set dummy ranlib; ac_word=$2
1109 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1110 echo "configure:1111: checking for $ac_word" >&5
1111 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1112   echo $ac_n "(cached) $ac_c" 1>&6
1113 else
1114   if test -n "$RANLIB"; then
1115   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1116 else
1117   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1118   ac_dummy="$PATH"
1119   for ac_dir in $ac_dummy; do
1120     test -z "$ac_dir" && ac_dir=.
1121     if test -f $ac_dir/$ac_word; then
1122       ac_cv_prog_RANLIB="ranlib"
1123       break
1124     fi
1125   done
1126   IFS="$ac_save_ifs"
1127   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1128 fi
1129 fi
1130 RANLIB="$ac_cv_prog_RANLIB"
1131 if test -n "$RANLIB"; then
1132   echo "$ac_t""$RANLIB" 1>&6
1133 else
1134   echo "$ac_t""no" 1>&6
1135 fi
1136
1137 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1138 echo "configure:1139: checking for ANSI C header files" >&5
1139 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1140   echo $ac_n "(cached) $ac_c" 1>&6
1141 else
1142   cat > conftest.$ac_ext <<EOF
1143 #line 1144 "configure"
1144 #include "confdefs.h"
1145 #include <stdlib.h>
1146 #include <stdarg.h>
1147 #include <string.h>
1148 #include <float.h>
1149 EOF
1150 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1151 { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1152 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1153 if test -z "$ac_err"; then
1154   rm -rf conftest*
1155   ac_cv_header_stdc=yes
1156 else
1157   echo "$ac_err" >&5
1158   echo "configure: failed program was:" >&5
1159   cat conftest.$ac_ext >&5
1160   rm -rf conftest*
1161   ac_cv_header_stdc=no
1162 fi
1163 rm -f conftest*
1164
1165 if test $ac_cv_header_stdc = yes; then
1166   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1167 cat > conftest.$ac_ext <<EOF
1168 #line 1169 "configure"
1169 #include "confdefs.h"
1170 #include <string.h>
1171 EOF
1172 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1173   egrep "memchr" >/dev/null 2>&1; then
1174   :
1175 else
1176   rm -rf conftest*
1177   ac_cv_header_stdc=no
1178 fi
1179 rm -f conftest*
1180
1181 fi
1182
1183 if test $ac_cv_header_stdc = yes; then
1184   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1185 cat > conftest.$ac_ext <<EOF
1186 #line 1187 "configure"
1187 #include "confdefs.h"
1188 #include <stdlib.h>
1189 EOF
1190 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1191   egrep "free" >/dev/null 2>&1; then
1192   :
1193 else
1194   rm -rf conftest*
1195   ac_cv_header_stdc=no
1196 fi
1197 rm -f conftest*
1198
1199 fi
1200
1201 if test $ac_cv_header_stdc = yes; then
1202   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1203 if test "$cross_compiling" = yes; then
1204   :
1205 else
1206   cat > conftest.$ac_ext <<EOF
1207 #line 1208 "configure"
1208 #include "confdefs.h"
1209 #include <ctype.h>
1210 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1211 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1212 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1213 int main () { int i; for (i = 0; i < 256; i++)
1214 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1215 exit (0); }
1216
1217 EOF
1218 if { (eval echo configure:1219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1219 then
1220   :
1221 else
1222   echo "configure: failed program was:" >&5
1223   cat conftest.$ac_ext >&5
1224   rm -fr conftest*
1225   ac_cv_header_stdc=no
1226 fi
1227 rm -fr conftest*
1228 fi
1229
1230 fi
1231 fi
1232
1233 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1234 if test $ac_cv_header_stdc = yes; then
1235   cat >> confdefs.h <<\EOF
1236 #define STDC_HEADERS 1
1237 EOF
1238
1239 fi
1240
1241 echo $ac_n "checking for working const""... $ac_c" 1>&6
1242 echo "configure:1243: checking for working const" >&5
1243 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1244   echo $ac_n "(cached) $ac_c" 1>&6
1245 else
1246   cat > conftest.$ac_ext <<EOF
1247 #line 1248 "configure"
1248 #include "confdefs.h"
1249
1250 int main() {
1251
1252 /* Ultrix mips cc rejects this.  */
1253 typedef int charset[2]; const charset x;
1254 /* SunOS 4.1.1 cc rejects this.  */
1255 char const *const *ccp;
1256 char **p;
1257 /* NEC SVR4.0.2 mips cc rejects this.  */
1258 struct point {int x, y;};
1259 static struct point const zero = {0,0};
1260 /* AIX XL C 1.02.0.0 rejects this.
1261    It does not let you subtract one const X* pointer from another in an arm
1262    of an if-expression whose if-part is not a constant expression */
1263 const char *g = "string";
1264 ccp = &g + (g ? g-g : 0);
1265 /* HPUX 7.0 cc rejects these. */
1266 ++ccp;
1267 p = (char**) ccp;
1268 ccp = (char const *const *) p;
1269 { /* SCO 3.2v4 cc rejects this.  */
1270   char *t;
1271   char const *s = 0 ? (char *) 0 : (char const *) 0;
1272
1273   *t++ = 0;
1274 }
1275 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1276   int x[] = {25, 17};
1277   const int *foo = &x[0];
1278   ++foo;
1279 }
1280 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1281   typedef const int *iptr;
1282   iptr p = 0;
1283   ++p;
1284 }
1285 { /* AIX XL C 1.02.0.0 rejects this saying
1286      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1287   struct s { int j; const int *ap[3]; };
1288   struct s *b; b->j = 5;
1289 }
1290 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1291   const int foo = 10;
1292 }
1293
1294 ; return 0; }
1295 EOF
1296 if { (eval echo configure:1297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1297   rm -rf conftest*
1298   ac_cv_c_const=yes
1299 else
1300   echo "configure: failed program was:" >&5
1301   cat conftest.$ac_ext >&5
1302   rm -rf conftest*
1303   ac_cv_c_const=no
1304 fi
1305 rm -f conftest*
1306 fi
1307
1308 echo "$ac_t""$ac_cv_c_const" 1>&6
1309 if test $ac_cv_c_const = no; then
1310   cat >> confdefs.h <<\EOF
1311 #define const 
1312 EOF
1313
1314 fi
1315
1316 echo $ac_n "checking for inline""... $ac_c" 1>&6
1317 echo "configure:1318: checking for inline" >&5
1318 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1319   echo $ac_n "(cached) $ac_c" 1>&6
1320 else
1321   ac_cv_c_inline=no
1322 for ac_kw in inline __inline__ __inline; do
1323   cat > conftest.$ac_ext <<EOF
1324 #line 1325 "configure"
1325 #include "confdefs.h"
1326
1327 int main() {
1328 } $ac_kw foo() {
1329 ; return 0; }
1330 EOF
1331 if { (eval echo configure:1332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1332   rm -rf conftest*
1333   ac_cv_c_inline=$ac_kw; break
1334 else
1335   echo "configure: failed program was:" >&5
1336   cat conftest.$ac_ext >&5
1337 fi
1338 rm -f conftest*
1339 done
1340
1341 fi
1342
1343 echo "$ac_t""$ac_cv_c_inline" 1>&6
1344 case "$ac_cv_c_inline" in
1345   inline | yes) ;;
1346   no) cat >> confdefs.h <<\EOF
1347 #define inline 
1348 EOF
1349  ;;
1350   *)  cat >> confdefs.h <<EOF
1351 #define inline $ac_cv_c_inline
1352 EOF
1353  ;;
1354 esac
1355
1356 echo $ac_n "checking for off_t""... $ac_c" 1>&6
1357 echo "configure:1358: checking for off_t" >&5
1358 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
1359   echo $ac_n "(cached) $ac_c" 1>&6
1360 else
1361   cat > conftest.$ac_ext <<EOF
1362 #line 1363 "configure"
1363 #include "confdefs.h"
1364 #include <sys/types.h>
1365 #if STDC_HEADERS
1366 #include <stdlib.h>
1367 #include <stddef.h>
1368 #endif
1369 EOF
1370 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1371   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1372   rm -rf conftest*
1373   ac_cv_type_off_t=yes
1374 else
1375   rm -rf conftest*
1376   ac_cv_type_off_t=no
1377 fi
1378 rm -f conftest*
1379
1380 fi
1381 echo "$ac_t""$ac_cv_type_off_t" 1>&6
1382 if test $ac_cv_type_off_t = no; then
1383   cat >> confdefs.h <<\EOF
1384 #define off_t long
1385 EOF
1386
1387 fi
1388
1389 echo $ac_n "checking for size_t""... $ac_c" 1>&6
1390 echo "configure:1391: checking for size_t" >&5
1391 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
1392   echo $ac_n "(cached) $ac_c" 1>&6
1393 else
1394   cat > conftest.$ac_ext <<EOF
1395 #line 1396 "configure"
1396 #include "confdefs.h"
1397 #include <sys/types.h>
1398 #if STDC_HEADERS
1399 #include <stdlib.h>
1400 #include <stddef.h>
1401 #endif
1402 EOF
1403 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1404   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1405   rm -rf conftest*
1406   ac_cv_type_size_t=yes
1407 else
1408   rm -rf conftest*
1409   ac_cv_type_size_t=no
1410 fi
1411 rm -f conftest*
1412
1413 fi
1414 echo "$ac_t""$ac_cv_type_size_t" 1>&6
1415 if test $ac_cv_type_size_t = no; then
1416   cat >> confdefs.h <<\EOF
1417 #define size_t unsigned
1418 EOF
1419
1420 fi
1421
1422 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1423 # for constant arguments.  Useless!
1424 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
1425 echo "configure:1426: checking for working alloca.h" >&5
1426 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1427   echo $ac_n "(cached) $ac_c" 1>&6
1428 else
1429   cat > conftest.$ac_ext <<EOF
1430 #line 1431 "configure"
1431 #include "confdefs.h"
1432 #include <alloca.h>
1433 int main() {
1434 char *p = alloca(2 * sizeof(int));
1435 ; return 0; }
1436 EOF
1437 if { (eval echo configure:1438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1438   rm -rf conftest*
1439   ac_cv_header_alloca_h=yes
1440 else
1441   echo "configure: failed program was:" >&5
1442   cat conftest.$ac_ext >&5
1443   rm -rf conftest*
1444   ac_cv_header_alloca_h=no
1445 fi
1446 rm -f conftest*
1447 fi
1448
1449 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
1450 if test $ac_cv_header_alloca_h = yes; then
1451   cat >> confdefs.h <<\EOF
1452 #define HAVE_ALLOCA_H 1
1453 EOF
1454
1455 fi
1456
1457 echo $ac_n "checking for alloca""... $ac_c" 1>&6
1458 echo "configure:1459: checking for alloca" >&5
1459 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
1460   echo $ac_n "(cached) $ac_c" 1>&6
1461 else
1462   cat > conftest.$ac_ext <<EOF
1463 #line 1464 "configure"
1464 #include "confdefs.h"
1465
1466 #ifdef __GNUC__
1467 # define alloca __builtin_alloca
1468 #else
1469 # ifdef _MSC_VER
1470 #  include <malloc.h>
1471 #  define alloca _alloca
1472 # else
1473 #  if HAVE_ALLOCA_H
1474 #   include <alloca.h>
1475 #  else
1476 #   ifdef _AIX
1477  #pragma alloca
1478 #   else
1479 #    ifndef alloca /* predefined by HP cc +Olibcalls */
1480 char *alloca ();
1481 #    endif
1482 #   endif
1483 #  endif
1484 # endif
1485 #endif
1486
1487 int main() {
1488 char *p = (char *) alloca(1);
1489 ; return 0; }
1490 EOF
1491 if { (eval echo configure:1492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1492   rm -rf conftest*
1493   ac_cv_func_alloca_works=yes
1494 else
1495   echo "configure: failed program was:" >&5
1496   cat conftest.$ac_ext >&5
1497   rm -rf conftest*
1498   ac_cv_func_alloca_works=no
1499 fi
1500 rm -f conftest*
1501 fi
1502
1503 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1504 if test $ac_cv_func_alloca_works = yes; then
1505   cat >> confdefs.h <<\EOF
1506 #define HAVE_ALLOCA 1
1507 EOF
1508
1509 fi
1510
1511 if test $ac_cv_func_alloca_works = no; then
1512   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1513   # that cause trouble.  Some versions do not even contain alloca or
1514   # contain a buggy version.  If you still want to use their alloca,
1515   # use ar to extract alloca.o from them instead of compiling alloca.c.
1516   ALLOCA=alloca.${ac_objext}
1517   cat >> confdefs.h <<\EOF
1518 #define C_ALLOCA 1
1519 EOF
1520
1521
1522 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
1523 echo "configure:1524: checking whether alloca needs Cray hooks" >&5
1524 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1525   echo $ac_n "(cached) $ac_c" 1>&6
1526 else
1527   cat > conftest.$ac_ext <<EOF
1528 #line 1529 "configure"
1529 #include "confdefs.h"
1530 #if defined(CRAY) && ! defined(CRAY2)
1531 webecray
1532 #else
1533 wenotbecray
1534 #endif
1535
1536 EOF
1537 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1538   egrep "webecray" >/dev/null 2>&1; then
1539   rm -rf conftest*
1540   ac_cv_os_cray=yes
1541 else
1542   rm -rf conftest*
1543   ac_cv_os_cray=no
1544 fi
1545 rm -f conftest*
1546
1547 fi
1548
1549 echo "$ac_t""$ac_cv_os_cray" 1>&6
1550 if test $ac_cv_os_cray = yes; then
1551 for ac_func in _getb67 GETB67 getb67; do
1552   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1553 echo "configure:1554: checking for $ac_func" >&5
1554 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1555   echo $ac_n "(cached) $ac_c" 1>&6
1556 else
1557   cat > conftest.$ac_ext <<EOF
1558 #line 1559 "configure"
1559 #include "confdefs.h"
1560 /* System header to define __stub macros and hopefully few prototypes,
1561     which can conflict with char $ac_func(); below.  */
1562 #include <assert.h>
1563 /* Override any gcc2 internal prototype to avoid an error.  */
1564 /* We use char because int might match the return type of a gcc2
1565     builtin and then its argument prototype would still apply.  */
1566 char $ac_func();
1567
1568 int main() {
1569
1570 /* The GNU C library defines this for functions which it implements
1571     to always fail with ENOSYS.  Some functions are actually named
1572     something starting with __ and the normal name is an alias.  */
1573 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1574 choke me
1575 #else
1576 $ac_func();
1577 #endif
1578
1579 ; return 0; }
1580 EOF
1581 if { (eval echo configure:1582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1582   rm -rf conftest*
1583   eval "ac_cv_func_$ac_func=yes"
1584 else
1585   echo "configure: failed program was:" >&5
1586   cat conftest.$ac_ext >&5
1587   rm -rf conftest*
1588   eval "ac_cv_func_$ac_func=no"
1589 fi
1590 rm -f conftest*
1591 fi
1592
1593 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1594   echo "$ac_t""yes" 1>&6
1595   cat >> confdefs.h <<EOF
1596 #define CRAY_STACKSEG_END $ac_func
1597 EOF
1598
1599   break
1600 else
1601   echo "$ac_t""no" 1>&6
1602 fi
1603
1604 done
1605 fi
1606
1607 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
1608 echo "configure:1609: checking stack direction for C alloca" >&5
1609 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1610   echo $ac_n "(cached) $ac_c" 1>&6
1611 else
1612   if test "$cross_compiling" = yes; then
1613   ac_cv_c_stack_direction=0
1614 else
1615   cat > conftest.$ac_ext <<EOF
1616 #line 1617 "configure"
1617 #include "confdefs.h"
1618 find_stack_direction ()
1619 {
1620   static char *addr = 0;
1621   auto char dummy;
1622   if (addr == 0)
1623     {
1624       addr = &dummy;
1625       return find_stack_direction ();
1626     }
1627   else
1628     return (&dummy > addr) ? 1 : -1;
1629 }
1630 main ()
1631 {
1632   exit (find_stack_direction() < 0);
1633 }
1634 EOF
1635 if { (eval echo configure:1636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1636 then
1637   ac_cv_c_stack_direction=1
1638 else
1639   echo "configure: failed program was:" >&5
1640   cat conftest.$ac_ext >&5
1641   rm -fr conftest*
1642   ac_cv_c_stack_direction=-1
1643 fi
1644 rm -fr conftest*
1645 fi
1646
1647 fi
1648
1649 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
1650 cat >> confdefs.h <<EOF
1651 #define STACK_DIRECTION $ac_cv_c_stack_direction
1652 EOF
1653
1654 fi
1655
1656 for ac_hdr in unistd.h
1657 do
1658 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1659 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1660 echo "configure:1661: checking for $ac_hdr" >&5
1661 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1662   echo $ac_n "(cached) $ac_c" 1>&6
1663 else
1664   cat > conftest.$ac_ext <<EOF
1665 #line 1666 "configure"
1666 #include "confdefs.h"
1667 #include <$ac_hdr>
1668 EOF
1669 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1670 { (eval echo configure:1671: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1671 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1672 if test -z "$ac_err"; then
1673   rm -rf conftest*
1674   eval "ac_cv_header_$ac_safe=yes"
1675 else
1676   echo "$ac_err" >&5
1677   echo "configure: failed program was:" >&5
1678   cat conftest.$ac_ext >&5
1679   rm -rf conftest*
1680   eval "ac_cv_header_$ac_safe=no"
1681 fi
1682 rm -f conftest*
1683 fi
1684 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1685   echo "$ac_t""yes" 1>&6
1686     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1687   cat >> confdefs.h <<EOF
1688 #define $ac_tr_hdr 1
1689 EOF
1690  
1691 else
1692   echo "$ac_t""no" 1>&6
1693 fi
1694 done
1695
1696 for ac_func in getpagesize
1697 do
1698 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1699 echo "configure:1700: checking for $ac_func" >&5
1700 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1701   echo $ac_n "(cached) $ac_c" 1>&6
1702 else
1703   cat > conftest.$ac_ext <<EOF
1704 #line 1705 "configure"
1705 #include "confdefs.h"
1706 /* System header to define __stub macros and hopefully few prototypes,
1707     which can conflict with char $ac_func(); below.  */
1708 #include <assert.h>
1709 /* Override any gcc2 internal prototype to avoid an error.  */
1710 /* We use char because int might match the return type of a gcc2
1711     builtin and then its argument prototype would still apply.  */
1712 char $ac_func();
1713
1714 int main() {
1715
1716 /* The GNU C library defines this for functions which it implements
1717     to always fail with ENOSYS.  Some functions are actually named
1718     something starting with __ and the normal name is an alias.  */
1719 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1720 choke me
1721 #else
1722 $ac_func();
1723 #endif
1724
1725 ; return 0; }
1726 EOF
1727 if { (eval echo configure:1728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1728   rm -rf conftest*
1729   eval "ac_cv_func_$ac_func=yes"
1730 else
1731   echo "configure: failed program was:" >&5
1732   cat conftest.$ac_ext >&5
1733   rm -rf conftest*
1734   eval "ac_cv_func_$ac_func=no"
1735 fi
1736 rm -f conftest*
1737 fi
1738
1739 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1740   echo "$ac_t""yes" 1>&6
1741     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1742   cat >> confdefs.h <<EOF
1743 #define $ac_tr_func 1
1744 EOF
1745  
1746 else
1747   echo "$ac_t""no" 1>&6
1748 fi
1749 done
1750
1751 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
1752 echo "configure:1753: checking for working mmap" >&5
1753 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
1754   echo $ac_n "(cached) $ac_c" 1>&6
1755 else
1756   if test "$cross_compiling" = yes; then
1757   ac_cv_func_mmap_fixed_mapped=no
1758 else
1759   cat > conftest.$ac_ext <<EOF
1760 #line 1761 "configure"
1761 #include "confdefs.h"
1762
1763 /* Thanks to Mike Haertel and Jim Avera for this test.
1764    Here is a matrix of mmap possibilities:
1765         mmap private not fixed
1766         mmap private fixed at somewhere currently unmapped
1767         mmap private fixed at somewhere already mapped
1768         mmap shared not fixed
1769         mmap shared fixed at somewhere currently unmapped
1770         mmap shared fixed at somewhere already mapped
1771    For private mappings, we should verify that changes cannot be read()
1772    back from the file, nor mmap's back from the file at a different
1773    address.  (There have been systems where private was not correctly
1774    implemented like the infamous i386 svr4.0, and systems where the
1775    VM page cache was not coherent with the filesystem buffer cache
1776    like early versions of FreeBSD and possibly contemporary NetBSD.)
1777    For shared mappings, we should conversely verify that changes get
1778    propogated back to all the places they're supposed to be.
1779
1780    Grep wants private fixed already mapped.
1781    The main things grep needs to know about mmap are:
1782    * does it exist and is it safe to write into the mmap'd area
1783    * how to use it (BSD variants)  */
1784 #include <sys/types.h>
1785 #include <fcntl.h>
1786 #include <sys/mman.h>
1787
1788 /* This mess was copied from the GNU getpagesize.h.  */
1789 #ifndef HAVE_GETPAGESIZE
1790 # ifdef HAVE_UNISTD_H
1791 #  include <unistd.h>
1792 # endif
1793
1794 /* Assume that all systems that can run configure have sys/param.h.  */
1795 # ifndef HAVE_SYS_PARAM_H
1796 #  define HAVE_SYS_PARAM_H 1
1797 # endif
1798
1799 # ifdef _SC_PAGESIZE
1800 #  define getpagesize() sysconf(_SC_PAGESIZE)
1801 # else /* no _SC_PAGESIZE */
1802 #  ifdef HAVE_SYS_PARAM_H
1803 #   include <sys/param.h>
1804 #   ifdef EXEC_PAGESIZE
1805 #    define getpagesize() EXEC_PAGESIZE
1806 #   else /* no EXEC_PAGESIZE */
1807 #    ifdef NBPG
1808 #     define getpagesize() NBPG * CLSIZE
1809 #     ifndef CLSIZE
1810 #      define CLSIZE 1
1811 #     endif /* no CLSIZE */
1812 #    else /* no NBPG */
1813 #     ifdef NBPC
1814 #      define getpagesize() NBPC
1815 #     else /* no NBPC */
1816 #      ifdef PAGESIZE
1817 #       define getpagesize() PAGESIZE
1818 #      endif /* PAGESIZE */
1819 #     endif /* no NBPC */
1820 #    endif /* no NBPG */
1821 #   endif /* no EXEC_PAGESIZE */
1822 #  else /* no HAVE_SYS_PARAM_H */
1823 #   define getpagesize() 8192   /* punt totally */
1824 #  endif /* no HAVE_SYS_PARAM_H */
1825 # endif /* no _SC_PAGESIZE */
1826
1827 #endif /* no HAVE_GETPAGESIZE */
1828
1829 #ifdef __cplusplus
1830 extern "C" { void *malloc(unsigned); }
1831 #else
1832 char *malloc();
1833 #endif
1834
1835 int
1836 main()
1837 {
1838         char *data, *data2, *data3;
1839         int i, pagesize;
1840         int fd;
1841
1842         pagesize = getpagesize();
1843
1844         /*
1845          * First, make a file with some known garbage in it.
1846          */
1847         data = malloc(pagesize);
1848         if (!data)
1849                 exit(1);
1850         for (i = 0; i < pagesize; ++i)
1851                 *(data + i) = rand();
1852         umask(0);
1853         fd = creat("conftestmmap", 0600);
1854         if (fd < 0)
1855                 exit(1);
1856         if (write(fd, data, pagesize) != pagesize)
1857                 exit(1);
1858         close(fd);
1859
1860         /*
1861          * Next, try to mmap the file at a fixed address which
1862          * already has something else allocated at it.  If we can,
1863          * also make sure that we see the same garbage.
1864          */
1865         fd = open("conftestmmap", O_RDWR);
1866         if (fd < 0)
1867                 exit(1);
1868         data2 = malloc(2 * pagesize);
1869         if (!data2)
1870                 exit(1);
1871         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
1872         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
1873             MAP_PRIVATE | MAP_FIXED, fd, 0L))
1874                 exit(1);
1875         for (i = 0; i < pagesize; ++i)
1876                 if (*(data + i) != *(data2 + i))
1877                         exit(1);
1878
1879         /*
1880          * Finally, make sure that changes to the mapped area
1881          * do not percolate back to the file as seen by read().
1882          * (This is a bug on some variants of i386 svr4.0.)
1883          */
1884         for (i = 0; i < pagesize; ++i)
1885                 *(data2 + i) = *(data2 + i) + 1;
1886         data3 = malloc(pagesize);
1887         if (!data3)
1888                 exit(1);
1889         if (read(fd, data3, pagesize) != pagesize)
1890                 exit(1);
1891         for (i = 0; i < pagesize; ++i)
1892                 if (*(data + i) != *(data3 + i))
1893                         exit(1);
1894         close(fd);
1895         unlink("conftestmmap");
1896         exit(0);
1897 }
1898
1899 EOF
1900 if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1901 then
1902   ac_cv_func_mmap_fixed_mapped=yes
1903 else
1904   echo "configure: failed program was:" >&5
1905   cat conftest.$ac_ext >&5
1906   rm -fr conftest*
1907   ac_cv_func_mmap_fixed_mapped=no
1908 fi
1909 rm -fr conftest*
1910 fi
1911
1912 fi
1913
1914 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
1915 if test $ac_cv_func_mmap_fixed_mapped = yes; then
1916   cat >> confdefs.h <<\EOF
1917 #define HAVE_MMAP 1
1918 EOF
1919
1920 fi
1921
1922                               
1923    for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
1924 unistd.h values.h sys/param.h
1925 do
1926 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1927 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1928 echo "configure:1929: checking for $ac_hdr" >&5
1929 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1930   echo $ac_n "(cached) $ac_c" 1>&6
1931 else
1932   cat > conftest.$ac_ext <<EOF
1933 #line 1934 "configure"
1934 #include "confdefs.h"
1935 #include <$ac_hdr>
1936 EOF
1937 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1938 { (eval echo configure:1939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1939 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1940 if test -z "$ac_err"; then
1941   rm -rf conftest*
1942   eval "ac_cv_header_$ac_safe=yes"
1943 else
1944   echo "$ac_err" >&5
1945   echo "configure: failed program was:" >&5
1946   cat conftest.$ac_ext >&5
1947   rm -rf conftest*
1948   eval "ac_cv_header_$ac_safe=no"
1949 fi
1950 rm -f conftest*
1951 fi
1952 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1953   echo "$ac_t""yes" 1>&6
1954     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1955   cat >> confdefs.h <<EOF
1956 #define $ac_tr_hdr 1
1957 EOF
1958  
1959 else
1960   echo "$ac_t""no" 1>&6
1961 fi
1962 done
1963
1964    for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
1965 __argz_count __argz_stringify __argz_next
1966 do
1967 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1968 echo "configure:1969: checking for $ac_func" >&5
1969 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1970   echo $ac_n "(cached) $ac_c" 1>&6
1971 else
1972   cat > conftest.$ac_ext <<EOF
1973 #line 1974 "configure"
1974 #include "confdefs.h"
1975 /* System header to define __stub macros and hopefully few prototypes,
1976     which can conflict with char $ac_func(); below.  */
1977 #include <assert.h>
1978 /* Override any gcc2 internal prototype to avoid an error.  */
1979 /* We use char because int might match the return type of a gcc2
1980     builtin and then its argument prototype would still apply.  */
1981 char $ac_func();
1982
1983 int main() {
1984
1985 /* The GNU C library defines this for functions which it implements
1986     to always fail with ENOSYS.  Some functions are actually named
1987     something starting with __ and the normal name is an alias.  */
1988 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1989 choke me
1990 #else
1991 $ac_func();
1992 #endif
1993
1994 ; return 0; }
1995 EOF
1996 if { (eval echo configure:1997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1997   rm -rf conftest*
1998   eval "ac_cv_func_$ac_func=yes"
1999 else
2000   echo "configure: failed program was:" >&5
2001   cat conftest.$ac_ext >&5
2002   rm -rf conftest*
2003   eval "ac_cv_func_$ac_func=no"
2004 fi
2005 rm -f conftest*
2006 fi
2007
2008 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2009   echo "$ac_t""yes" 1>&6
2010     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2011   cat >> confdefs.h <<EOF
2012 #define $ac_tr_func 1
2013 EOF
2014  
2015 else
2016   echo "$ac_t""no" 1>&6
2017 fi
2018 done
2019
2020
2021    if test "${ac_cv_func_stpcpy+set}" != "set"; then
2022      for ac_func in stpcpy
2023 do
2024 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2025 echo "configure:2026: checking for $ac_func" >&5
2026 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2027   echo $ac_n "(cached) $ac_c" 1>&6
2028 else
2029   cat > conftest.$ac_ext <<EOF
2030 #line 2031 "configure"
2031 #include "confdefs.h"
2032 /* System header to define __stub macros and hopefully few prototypes,
2033     which can conflict with char $ac_func(); below.  */
2034 #include <assert.h>
2035 /* Override any gcc2 internal prototype to avoid an error.  */
2036 /* We use char because int might match the return type of a gcc2
2037     builtin and then its argument prototype would still apply.  */
2038 char $ac_func();
2039
2040 int main() {
2041
2042 /* The GNU C library defines this for functions which it implements
2043     to always fail with ENOSYS.  Some functions are actually named
2044     something starting with __ and the normal name is an alias.  */
2045 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2046 choke me
2047 #else
2048 $ac_func();
2049 #endif
2050
2051 ; return 0; }
2052 EOF
2053 if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2054   rm -rf conftest*
2055   eval "ac_cv_func_$ac_func=yes"
2056 else
2057   echo "configure: failed program was:" >&5
2058   cat conftest.$ac_ext >&5
2059   rm -rf conftest*
2060   eval "ac_cv_func_$ac_func=no"
2061 fi
2062 rm -f conftest*
2063 fi
2064
2065 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2066   echo "$ac_t""yes" 1>&6
2067     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2068   cat >> confdefs.h <<EOF
2069 #define $ac_tr_func 1
2070 EOF
2071  
2072 else
2073   echo "$ac_t""no" 1>&6
2074 fi
2075 done
2076
2077    fi
2078    if test "${ac_cv_func_stpcpy}" = "yes"; then
2079      cat >> confdefs.h <<\EOF
2080 #define HAVE_STPCPY 1
2081 EOF
2082
2083    fi
2084
2085    if test $ac_cv_header_locale_h = yes; then
2086     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
2087 echo "configure:2088: checking for LC_MESSAGES" >&5
2088 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
2089   echo $ac_n "(cached) $ac_c" 1>&6
2090 else
2091   cat > conftest.$ac_ext <<EOF
2092 #line 2093 "configure"
2093 #include "confdefs.h"
2094 #include <locale.h>
2095 int main() {
2096 return LC_MESSAGES
2097 ; return 0; }
2098 EOF
2099 if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2100   rm -rf conftest*
2101   am_cv_val_LC_MESSAGES=yes
2102 else
2103   echo "configure: failed program was:" >&5
2104   cat conftest.$ac_ext >&5
2105   rm -rf conftest*
2106   am_cv_val_LC_MESSAGES=no
2107 fi
2108 rm -f conftest*
2109 fi
2110
2111 echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
2112     if test $am_cv_val_LC_MESSAGES = yes; then
2113       cat >> confdefs.h <<\EOF
2114 #define HAVE_LC_MESSAGES 1
2115 EOF
2116
2117     fi
2118   fi
2119    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
2120 echo "configure:2121: checking whether NLS is requested" >&5
2121         # Check whether --enable-nls or --disable-nls was given.
2122 if test "${enable_nls+set}" = set; then
2123   enableval="$enable_nls"
2124   USE_NLS=$enableval
2125 else
2126   USE_NLS=yes
2127 fi
2128
2129     echo "$ac_t""$USE_NLS" 1>&6
2130     
2131
2132     USE_INCLUDED_LIBINTL=no
2133
2134         if test "$USE_NLS" = "yes"; then
2135       cat >> confdefs.h <<\EOF
2136 #define ENABLE_NLS 1
2137 EOF
2138
2139       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
2140 echo "configure:2141: checking whether included gettext is requested" >&5
2141       # Check whether --with-included-gettext or --without-included-gettext was given.
2142 if test "${with_included_gettext+set}" = set; then
2143   withval="$with_included_gettext"
2144   nls_cv_force_use_gnu_gettext=$withval
2145 else
2146   nls_cv_force_use_gnu_gettext=no
2147 fi
2148
2149       echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
2150
2151       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
2152       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
2153                                         nls_cv_header_intl=
2154         nls_cv_header_libgt=
2155         CATOBJEXT=NONE
2156
2157         ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
2158 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
2159 echo "configure:2160: checking for libintl.h" >&5
2160 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2161   echo $ac_n "(cached) $ac_c" 1>&6
2162 else
2163   cat > conftest.$ac_ext <<EOF
2164 #line 2165 "configure"
2165 #include "confdefs.h"
2166 #include <libintl.h>
2167 EOF
2168 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2169 { (eval echo configure:2170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2170 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2171 if test -z "$ac_err"; then
2172   rm -rf conftest*
2173   eval "ac_cv_header_$ac_safe=yes"
2174 else
2175   echo "$ac_err" >&5
2176   echo "configure: failed program was:" >&5
2177   cat conftest.$ac_ext >&5
2178   rm -rf conftest*
2179   eval "ac_cv_header_$ac_safe=no"
2180 fi
2181 rm -f conftest*
2182 fi
2183 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2184   echo "$ac_t""yes" 1>&6
2185   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
2186 echo "configure:2187: checking for gettext in libc" >&5
2187 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
2188   echo $ac_n "(cached) $ac_c" 1>&6
2189 else
2190   cat > conftest.$ac_ext <<EOF
2191 #line 2192 "configure"
2192 #include "confdefs.h"
2193 #include <libintl.h>
2194 int main() {
2195 return (int) gettext ("")
2196 ; return 0; }
2197 EOF
2198 if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2199   rm -rf conftest*
2200   gt_cv_func_gettext_libc=yes
2201 else
2202   echo "configure: failed program was:" >&5
2203   cat conftest.$ac_ext >&5
2204   rm -rf conftest*
2205   gt_cv_func_gettext_libc=no
2206 fi
2207 rm -f conftest*
2208 fi
2209
2210 echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
2211
2212            if test "$gt_cv_func_gettext_libc" != "yes"; then
2213              echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
2214 echo "configure:2215: checking for bindtextdomain in -lintl" >&5
2215 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
2216 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2217   echo $ac_n "(cached) $ac_c" 1>&6
2218 else
2219   ac_save_LIBS="$LIBS"
2220 LIBS="-lintl  $LIBS"
2221 cat > conftest.$ac_ext <<EOF
2222 #line 2223 "configure"
2223 #include "confdefs.h"
2224 /* Override any gcc2 internal prototype to avoid an error.  */
2225 /* We use char because int might match the return type of a gcc2
2226     builtin and then its argument prototype would still apply.  */
2227 char bindtextdomain();
2228
2229 int main() {
2230 bindtextdomain()
2231 ; return 0; }
2232 EOF
2233 if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2234   rm -rf conftest*
2235   eval "ac_cv_lib_$ac_lib_var=yes"
2236 else
2237   echo "configure: failed program was:" >&5
2238   cat conftest.$ac_ext >&5
2239   rm -rf conftest*
2240   eval "ac_cv_lib_$ac_lib_var=no"
2241 fi
2242 rm -f conftest*
2243 LIBS="$ac_save_LIBS"
2244
2245 fi
2246 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2247   echo "$ac_t""yes" 1>&6
2248   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
2249 echo "configure:2250: checking for gettext in libintl" >&5
2250 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
2251   echo $ac_n "(cached) $ac_c" 1>&6
2252 else
2253   cat > conftest.$ac_ext <<EOF
2254 #line 2255 "configure"
2255 #include "confdefs.h"
2256
2257 int main() {
2258 return (int) gettext ("")
2259 ; return 0; }
2260 EOF
2261 if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2262   rm -rf conftest*
2263   gt_cv_func_gettext_libintl=yes
2264 else
2265   echo "configure: failed program was:" >&5
2266   cat conftest.$ac_ext >&5
2267   rm -rf conftest*
2268   gt_cv_func_gettext_libintl=no
2269 fi
2270 rm -f conftest*
2271 fi
2272
2273 echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
2274 else
2275   echo "$ac_t""no" 1>&6
2276 fi
2277
2278            fi
2279
2280            if test "$gt_cv_func_gettext_libc" = "yes" \
2281               || test "$gt_cv_func_gettext_libintl" = "yes"; then
2282               cat >> confdefs.h <<\EOF
2283 #define HAVE_GETTEXT 1
2284 EOF
2285
2286               # Extract the first word of "msgfmt", so it can be a program name with args.
2287 set dummy msgfmt; ac_word=$2
2288 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2289 echo "configure:2290: checking for $ac_word" >&5
2290 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2291   echo $ac_n "(cached) $ac_c" 1>&6
2292 else
2293   case "$MSGFMT" in
2294   /*)
2295   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2296   ;;
2297   *)
2298   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2299   for ac_dir in $PATH; do
2300     test -z "$ac_dir" && ac_dir=.
2301     if test -f $ac_dir/$ac_word; then
2302       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2303         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2304         break
2305       fi
2306     fi
2307   done
2308   IFS="$ac_save_ifs"
2309   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
2310   ;;
2311 esac
2312 fi
2313 MSGFMT="$ac_cv_path_MSGFMT"
2314 if test -n "$MSGFMT"; then
2315   echo "$ac_t""$MSGFMT" 1>&6
2316 else
2317   echo "$ac_t""no" 1>&6
2318 fi
2319               if test "$MSGFMT" != "no"; then
2320                 for ac_func in dcgettext
2321 do
2322 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2323 echo "configure:2324: checking for $ac_func" >&5
2324 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2325   echo $ac_n "(cached) $ac_c" 1>&6
2326 else
2327   cat > conftest.$ac_ext <<EOF
2328 #line 2329 "configure"
2329 #include "confdefs.h"
2330 /* System header to define __stub macros and hopefully few prototypes,
2331     which can conflict with char $ac_func(); below.  */
2332 #include <assert.h>
2333 /* Override any gcc2 internal prototype to avoid an error.  */
2334 /* We use char because int might match the return type of a gcc2
2335     builtin and then its argument prototype would still apply.  */
2336 char $ac_func();
2337
2338 int main() {
2339
2340 /* The GNU C library defines this for functions which it implements
2341     to always fail with ENOSYS.  Some functions are actually named
2342     something starting with __ and the normal name is an alias.  */
2343 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2344 choke me
2345 #else
2346 $ac_func();
2347 #endif
2348
2349 ; return 0; }
2350 EOF
2351 if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2352   rm -rf conftest*
2353   eval "ac_cv_func_$ac_func=yes"
2354 else
2355   echo "configure: failed program was:" >&5
2356   cat conftest.$ac_ext >&5
2357   rm -rf conftest*
2358   eval "ac_cv_func_$ac_func=no"
2359 fi
2360 rm -f conftest*
2361 fi
2362
2363 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2364   echo "$ac_t""yes" 1>&6
2365     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2366   cat >> confdefs.h <<EOF
2367 #define $ac_tr_func 1
2368 EOF
2369  
2370 else
2371   echo "$ac_t""no" 1>&6
2372 fi
2373 done
2374
2375                 # Extract the first word of "gmsgfmt", so it can be a program name with args.
2376 set dummy gmsgfmt; ac_word=$2
2377 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2378 echo "configure:2379: checking for $ac_word" >&5
2379 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2380   echo $ac_n "(cached) $ac_c" 1>&6
2381 else
2382   case "$GMSGFMT" in
2383   /*)
2384   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2385   ;;
2386   ?:/*)                  
2387   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2388   ;;
2389   *)
2390   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2391   ac_dummy="$PATH"
2392   for ac_dir in $ac_dummy; do 
2393     test -z "$ac_dir" && ac_dir=.
2394     if test -f $ac_dir/$ac_word; then
2395       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2396       break
2397     fi
2398   done
2399   IFS="$ac_save_ifs"
2400   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2401   ;;
2402 esac
2403 fi
2404 GMSGFMT="$ac_cv_path_GMSGFMT"
2405 if test -n "$GMSGFMT"; then
2406   echo "$ac_t""$GMSGFMT" 1>&6
2407 else
2408   echo "$ac_t""no" 1>&6
2409 fi
2410
2411                 # Extract the first word of "xgettext", so it can be a program name with args.
2412 set dummy xgettext; ac_word=$2
2413 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2414 echo "configure:2415: checking for $ac_word" >&5
2415 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2416   echo $ac_n "(cached) $ac_c" 1>&6
2417 else
2418   case "$XGETTEXT" in
2419   /*)
2420   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2421   ;;
2422   *)
2423   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2424   for ac_dir in $PATH; do
2425     test -z "$ac_dir" && ac_dir=.
2426     if test -f $ac_dir/$ac_word; then
2427       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2428         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2429         break
2430       fi
2431     fi
2432   done
2433   IFS="$ac_save_ifs"
2434   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2435   ;;
2436 esac
2437 fi
2438 XGETTEXT="$ac_cv_path_XGETTEXT"
2439 if test -n "$XGETTEXT"; then
2440   echo "$ac_t""$XGETTEXT" 1>&6
2441 else
2442   echo "$ac_t""no" 1>&6
2443 fi
2444
2445                 cat > conftest.$ac_ext <<EOF
2446 #line 2447 "configure"
2447 #include "confdefs.h"
2448
2449 int main() {
2450 extern int _nl_msg_cat_cntr;
2451                                return _nl_msg_cat_cntr
2452 ; return 0; }
2453 EOF
2454 if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2455   rm -rf conftest*
2456   CATOBJEXT=.gmo
2457                    DATADIRNAME=share
2458 else
2459   echo "configure: failed program was:" >&5
2460   cat conftest.$ac_ext >&5
2461   rm -rf conftest*
2462   CATOBJEXT=.mo
2463                    DATADIRNAME=lib
2464 fi
2465 rm -f conftest*
2466                 INSTOBJEXT=.mo
2467               fi
2468             fi
2469         
2470 else
2471   echo "$ac_t""no" 1>&6
2472 fi
2473
2474
2475                 
2476         if test "$CATOBJEXT" = "NONE"; then
2477                           nls_cv_use_gnu_gettext=yes
2478         fi
2479       fi
2480
2481       if test "$nls_cv_use_gnu_gettext" = "yes"; then
2482                 INTLOBJS="\$(GETTOBJS)"
2483         # Extract the first word of "msgfmt", so it can be a program name with args.
2484 set dummy msgfmt; ac_word=$2
2485 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2486 echo "configure:2487: checking for $ac_word" >&5
2487 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
2488   echo $ac_n "(cached) $ac_c" 1>&6
2489 else
2490   case "$MSGFMT" in
2491   /*)
2492   ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
2493   ;;
2494   *)
2495   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2496   for ac_dir in $PATH; do
2497     test -z "$ac_dir" && ac_dir=.
2498     if test -f $ac_dir/$ac_word; then
2499       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
2500         ac_cv_path_MSGFMT="$ac_dir/$ac_word"
2501         break
2502       fi
2503     fi
2504   done
2505   IFS="$ac_save_ifs"
2506   test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
2507   ;;
2508 esac
2509 fi
2510 MSGFMT="$ac_cv_path_MSGFMT"
2511 if test -n "$MSGFMT"; then
2512   echo "$ac_t""$MSGFMT" 1>&6
2513 else
2514   echo "$ac_t""no" 1>&6
2515 fi
2516
2517         # Extract the first word of "gmsgfmt", so it can be a program name with args.
2518 set dummy gmsgfmt; ac_word=$2
2519 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2520 echo "configure:2521: checking for $ac_word" >&5
2521 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
2522   echo $ac_n "(cached) $ac_c" 1>&6
2523 else
2524   case "$GMSGFMT" in
2525   /*)
2526   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
2527   ;;
2528   ?:/*)                  
2529   ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
2530   ;;
2531   *)
2532   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2533   ac_dummy="$PATH"
2534   for ac_dir in $ac_dummy; do 
2535     test -z "$ac_dir" && ac_dir=.
2536     if test -f $ac_dir/$ac_word; then
2537       ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
2538       break
2539     fi
2540   done
2541   IFS="$ac_save_ifs"
2542   test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
2543   ;;
2544 esac
2545 fi
2546 GMSGFMT="$ac_cv_path_GMSGFMT"
2547 if test -n "$GMSGFMT"; then
2548   echo "$ac_t""$GMSGFMT" 1>&6
2549 else
2550   echo "$ac_t""no" 1>&6
2551 fi
2552
2553         # Extract the first word of "xgettext", so it can be a program name with args.
2554 set dummy xgettext; ac_word=$2
2555 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2556 echo "configure:2557: checking for $ac_word" >&5
2557 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
2558   echo $ac_n "(cached) $ac_c" 1>&6
2559 else
2560   case "$XGETTEXT" in
2561   /*)
2562   ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
2563   ;;
2564   *)
2565   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2566   for ac_dir in $PATH; do
2567     test -z "$ac_dir" && ac_dir=.
2568     if test -f $ac_dir/$ac_word; then
2569       if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
2570         ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
2571         break
2572       fi
2573     fi
2574   done
2575   IFS="$ac_save_ifs"
2576   test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
2577   ;;
2578 esac
2579 fi
2580 XGETTEXT="$ac_cv_path_XGETTEXT"
2581 if test -n "$XGETTEXT"; then
2582   echo "$ac_t""$XGETTEXT" 1>&6
2583 else
2584   echo "$ac_t""no" 1>&6
2585 fi
2586
2587         
2588         USE_INCLUDED_LIBINTL=yes
2589         CATOBJEXT=.gmo
2590         INSTOBJEXT=.mo
2591         DATADIRNAME=share
2592         INTLDEPS='$(top_builddir)/../intl/libintl.a'
2593         INTLLIBS=$INTLDEPS
2594         LIBS=`echo $LIBS | sed -e 's/-lintl//'`
2595         nls_cv_header_intl=libintl.h
2596         nls_cv_header_libgt=libgettext.h
2597       fi
2598
2599             if test "$XGETTEXT" != ":"; then
2600                         if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
2601           : ;
2602         else
2603           echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
2604           XGETTEXT=":"
2605         fi
2606       fi
2607
2608       # We need to process the po/ directory.
2609       POSUB=po
2610     else
2611       DATADIRNAME=share
2612       nls_cv_header_intl=libintl.h
2613       nls_cv_header_libgt=libgettext.h
2614     fi
2615
2616     # If this is used in GNU gettext we have to set USE_NLS to `yes'
2617     # because some of the sources are only built for this goal.
2618     if test "$PACKAGE" = gettext; then
2619       USE_NLS=yes
2620       USE_INCLUDED_LIBINTL=yes
2621     fi
2622
2623                 for lang in $ALL_LINGUAS; do
2624       GMOFILES="$GMOFILES $lang.gmo"
2625       POFILES="$POFILES $lang.po"
2626     done
2627
2628         
2629     
2630     
2631     
2632     
2633     
2634     
2635     
2636     
2637     
2638     
2639   
2640
2641    if test "x$CATOBJEXT" != "x"; then
2642      if test "x$ALL_LINGUAS" = "x"; then
2643        LINGUAS=
2644      else
2645        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
2646 echo "configure:2647: checking for catalogs to be installed" >&5
2647        NEW_LINGUAS=
2648        for lang in ${LINGUAS=$ALL_LINGUAS}; do
2649          case "$ALL_LINGUAS" in
2650           *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
2651          esac
2652        done
2653        LINGUAS=$NEW_LINGUAS
2654        echo "$ac_t""$LINGUAS" 1>&6
2655      fi
2656
2657           if test -n "$LINGUAS"; then
2658        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
2659      fi
2660    fi
2661
2662             if test $ac_cv_header_locale_h = yes; then
2663      INCLUDE_LOCALE_H="#include <locale.h>"
2664    else
2665      INCLUDE_LOCALE_H="\
2666 /* The system does not provide the header <locale.h>.  Take care yourself.  */"
2667    fi
2668    
2669
2670             if test -f $srcdir/po2tbl.sed.in; then
2671       if test "$CATOBJEXT" = ".cat"; then
2672          ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
2673 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
2674 echo "configure:2675: checking for linux/version.h" >&5
2675 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2676   echo $ac_n "(cached) $ac_c" 1>&6
2677 else
2678   cat > conftest.$ac_ext <<EOF
2679 #line 2680 "configure"
2680 #include "confdefs.h"
2681 #include <linux/version.h>
2682 EOF
2683 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2684 { (eval echo configure:2685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2685 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2686 if test -z "$ac_err"; then
2687   rm -rf conftest*
2688   eval "ac_cv_header_$ac_safe=yes"
2689 else
2690   echo "$ac_err" >&5
2691   echo "configure: failed program was:" >&5
2692   cat conftest.$ac_ext >&5
2693   rm -rf conftest*
2694   eval "ac_cv_header_$ac_safe=no"
2695 fi
2696 rm -f conftest*
2697 fi
2698 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2699   echo "$ac_t""yes" 1>&6
2700   msgformat=linux
2701 else
2702   echo "$ac_t""no" 1>&6
2703 msgformat=xopen
2704 fi
2705
2706
2707                          sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed
2708       fi
2709             sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
2710          $srcdir/po2tbl.sed.in > po2tbl.sed
2711    fi
2712
2713             if test "$PACKAGE" = "gettext"; then
2714      GT_NO="#NO#"
2715      GT_YES=
2716    else
2717      GT_NO=
2718      GT_YES="#YES#"
2719    fi
2720    
2721    
2722
2723    MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs"
2724    
2725
2726       l=
2727    
2728
2729             if test -d $srcdir/po; then
2730       test -d po || mkdir po
2731       if test "x$srcdir" != "x."; then
2732          if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
2733             posrcprefix="$srcdir/"
2734          else
2735             posrcprefix="../$srcdir/"
2736          fi
2737       else
2738          posrcprefix="../"
2739       fi
2740       rm -f po/POTFILES
2741       sed -e "/^#/d" -e "/^\$/d" -e "s,.*,      $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
2742          < $srcdir/po/POTFILES.in > po/POTFILES
2743    fi
2744   
2745
2746
2747 CONFIG_OBS=
2748 CONFIG_DEPS=
2749 CONFIG_SRCS=
2750
2751 configdirs="doc testsuite"
2752
2753
2754 . ${srcdir}/configure.host
2755
2756 . ${srcdir}/configure.tgt
2757
2758
2759 # Find a good install program.  We prefer a C program (faster),
2760 # so one script is as good as another.  But avoid the broken or
2761 # incompatible versions:
2762 # SysV /etc/install, /usr/sbin/install
2763 # SunOS /usr/etc/install
2764 # IRIX /sbin/install
2765 # AIX /bin/install
2766 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2767 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2768 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2769 # ./install, which can be erroneously created by make from ./install.sh.
2770 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
2771 echo "configure:2772: checking for a BSD compatible install" >&5
2772 if test -z "$INSTALL"; then
2773 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
2774   echo $ac_n "(cached) $ac_c" 1>&6
2775 else
2776     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
2777   for ac_dir in $PATH; do
2778     # Account for people who put trailing slashes in PATH elements.
2779     case "$ac_dir/" in
2780     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
2781     *)
2782       # OSF1 and SCO ODT 3.0 have their own names for install.
2783       # Don't use installbsd from OSF since it installs stuff as root
2784       # by default.
2785       for ac_prog in ginstall scoinst install; do
2786         if test -f $ac_dir/$ac_prog; then
2787           if test $ac_prog = install &&
2788             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
2789             # AIX install.  It has an incompatible calling convention.
2790             :
2791           else
2792             ac_cv_path_install="$ac_dir/$ac_prog -c"
2793             break 2
2794           fi
2795         fi
2796       done
2797       ;;
2798     esac
2799   done
2800   IFS="$ac_save_IFS"
2801
2802 fi
2803   if test "${ac_cv_path_install+set}" = set; then
2804     INSTALL="$ac_cv_path_install"
2805   else
2806     # As a last resort, use the slow shell script.  We don't cache a
2807     # path for INSTALL within a source directory, because that will
2808     # break other packages using the cache if that directory is
2809     # removed, or if the path is relative.
2810     INSTALL="$ac_install_sh"
2811   fi
2812 fi
2813 echo "$ac_t""$INSTALL" 1>&6
2814
2815 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2816 # It thinks the first close brace ends the variable substitution.
2817 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2818
2819 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
2820
2821 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2822
2823 if test $host != $build; then
2824   ac_tool_prefix=${host_alias}-
2825 else
2826   ac_tool_prefix=
2827 fi
2828
2829 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
2830 set dummy ${ac_tool_prefix}ar; ac_word=$2
2831 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2832 echo "configure:2833: checking for $ac_word" >&5
2833 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
2834   echo $ac_n "(cached) $ac_c" 1>&6
2835 else
2836   if test -n "$AR"; then
2837   ac_cv_prog_AR="$AR" # Let the user override the test.
2838 else
2839   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2840   ac_dummy="$PATH"
2841   for ac_dir in $ac_dummy; do
2842     test -z "$ac_dir" && ac_dir=.
2843     if test -f $ac_dir/$ac_word; then
2844       ac_cv_prog_AR="${ac_tool_prefix}ar"
2845       break
2846     fi
2847   done
2848   IFS="$ac_save_ifs"
2849   test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
2850 fi
2851 fi
2852 AR="$ac_cv_prog_AR"
2853 if test -n "$AR"; then
2854   echo "$ac_t""$AR" 1>&6
2855 else
2856   echo "$ac_t""no" 1>&6
2857 fi
2858
2859
2860
2861 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2862 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2863 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2864 echo "configure:2865: checking for $ac_word" >&5
2865 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2866   echo $ac_n "(cached) $ac_c" 1>&6
2867 else
2868   if test -n "$RANLIB"; then
2869   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2870 else
2871   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2872   ac_dummy="$PATH"
2873   for ac_dir in $ac_dummy; do
2874     test -z "$ac_dir" && ac_dir=.
2875     if test -f $ac_dir/$ac_word; then
2876       ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2877       break
2878     fi
2879   done
2880   IFS="$ac_save_ifs"
2881 fi
2882 fi
2883 RANLIB="$ac_cv_prog_RANLIB"
2884 if test -n "$RANLIB"; then
2885   echo "$ac_t""$RANLIB" 1>&6
2886 else
2887   echo "$ac_t""no" 1>&6
2888 fi
2889
2890
2891 if test -z "$ac_cv_prog_RANLIB"; then
2892 if test -n "$ac_tool_prefix"; then
2893   # Extract the first word of "ranlib", so it can be a program name with args.
2894 set dummy ranlib; ac_word=$2
2895 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2896 echo "configure:2897: checking for $ac_word" >&5
2897 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2898   echo $ac_n "(cached) $ac_c" 1>&6
2899 else
2900   if test -n "$RANLIB"; then
2901   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2902 else
2903   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2904   ac_dummy="$PATH"
2905   for ac_dir in $ac_dummy; do
2906     test -z "$ac_dir" && ac_dir=.
2907     if test -f $ac_dir/$ac_word; then
2908       ac_cv_prog_RANLIB="ranlib"
2909       break
2910     fi
2911   done
2912   IFS="$ac_save_ifs"
2913   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2914 fi
2915 fi
2916 RANLIB="$ac_cv_prog_RANLIB"
2917 if test -n "$RANLIB"; then
2918   echo "$ac_t""$RANLIB" 1>&6
2919 else
2920   echo "$ac_t""no" 1>&6
2921 fi
2922
2923 else
2924   RANLIB=":"
2925 fi
2926 fi
2927
2928 for ac_prog in 'bison -y' byacc
2929 do
2930 # Extract the first word of "$ac_prog", so it can be a program name with args.
2931 set dummy $ac_prog; ac_word=$2
2932 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2933 echo "configure:2934: checking for $ac_word" >&5
2934 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
2935   echo $ac_n "(cached) $ac_c" 1>&6
2936 else
2937   if test -n "$YACC"; then
2938   ac_cv_prog_YACC="$YACC" # Let the user override the test.
2939 else
2940   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2941   ac_dummy="$PATH"
2942   for ac_dir in $ac_dummy; do
2943     test -z "$ac_dir" && ac_dir=.
2944     if test -f $ac_dir/$ac_word; then
2945       ac_cv_prog_YACC="$ac_prog"
2946       break
2947     fi
2948   done
2949   IFS="$ac_save_ifs"
2950 fi
2951 fi
2952 YACC="$ac_cv_prog_YACC"
2953 if test -n "$YACC"; then
2954   echo "$ac_t""$YACC" 1>&6
2955 else
2956   echo "$ac_t""no" 1>&6
2957 fi
2958
2959 test -n "$YACC" && break
2960 done
2961 test -n "$YACC" || YACC="yacc"
2962
2963
2964 if test "$program_transform_name" = s,x,x,; then
2965   program_transform_name=
2966 else
2967   # Double any \ or $.  echo might interpret backslashes.
2968   cat <<\EOF_SED > conftestsed
2969 s,\\,\\\\,g; s,\$,$$,g
2970 EOF_SED
2971   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
2972   rm -f conftestsed
2973 fi
2974 test "$program_prefix" != NONE &&
2975   program_transform_name="s,^,${program_prefix},; $program_transform_name"
2976 # Use a double $ so make ignores it.
2977 test "$program_suffix" != NONE &&
2978   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
2979
2980 # sed with no file args requires a program.
2981 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
2982
2983
2984 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
2985 echo "configure:2986: checking return type of signal handlers" >&5
2986 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
2987   echo $ac_n "(cached) $ac_c" 1>&6
2988 else
2989   cat > conftest.$ac_ext <<EOF
2990 #line 2991 "configure"
2991 #include "confdefs.h"
2992 #include <sys/types.h>
2993 #include <signal.h>
2994 #ifdef signal
2995 #undef signal
2996 #endif
2997 #ifdef __cplusplus
2998 extern "C" void (*signal (int, void (*)(int)))(int);
2999 #else
3000 void (*signal ()) ();
3001 #endif
3002
3003 int main() {
3004 int i;
3005 ; return 0; }
3006 EOF
3007 if { (eval echo configure:3008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3008   rm -rf conftest*
3009   ac_cv_type_signal=void
3010 else
3011   echo "configure: failed program was:" >&5
3012   cat conftest.$ac_ext >&5
3013   rm -rf conftest*
3014   ac_cv_type_signal=int
3015 fi
3016 rm -f conftest*
3017 fi
3018
3019 echo "$ac_t""$ac_cv_type_signal" 1>&6
3020 cat >> confdefs.h <<EOF
3021 #define RETSIGTYPE $ac_cv_type_signal
3022 EOF
3023
3024
3025
3026 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
3027 echo "configure:3028: checking for ANSI C header files" >&5
3028 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
3029   echo $ac_n "(cached) $ac_c" 1>&6
3030 else
3031   cat > conftest.$ac_ext <<EOF
3032 #line 3033 "configure"
3033 #include "confdefs.h"
3034 #include <stdlib.h>
3035 #include <stdarg.h>
3036 #include <string.h>
3037 #include <float.h>
3038 EOF
3039 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3040 { (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3041 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3042 if test -z "$ac_err"; then
3043   rm -rf conftest*
3044   ac_cv_header_stdc=yes
3045 else
3046   echo "$ac_err" >&5
3047   echo "configure: failed program was:" >&5
3048   cat conftest.$ac_ext >&5
3049   rm -rf conftest*
3050   ac_cv_header_stdc=no
3051 fi
3052 rm -f conftest*
3053
3054 if test $ac_cv_header_stdc = yes; then
3055   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
3056 cat > conftest.$ac_ext <<EOF
3057 #line 3058 "configure"
3058 #include "confdefs.h"
3059 #include <string.h>
3060 EOF
3061 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3062   egrep "memchr" >/dev/null 2>&1; then
3063   :
3064 else
3065   rm -rf conftest*
3066   ac_cv_header_stdc=no
3067 fi
3068 rm -f conftest*
3069
3070 fi
3071
3072 if test $ac_cv_header_stdc = yes; then
3073   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
3074 cat > conftest.$ac_ext <<EOF
3075 #line 3076 "configure"
3076 #include "confdefs.h"
3077 #include <stdlib.h>
3078 EOF
3079 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3080   egrep "free" >/dev/null 2>&1; then
3081   :
3082 else
3083   rm -rf conftest*
3084   ac_cv_header_stdc=no
3085 fi
3086 rm -f conftest*
3087
3088 fi
3089
3090 if test $ac_cv_header_stdc = yes; then
3091   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
3092 if test "$cross_compiling" = yes; then
3093   :
3094 else
3095   cat > conftest.$ac_ext <<EOF
3096 #line 3097 "configure"
3097 #include "confdefs.h"
3098 #include <ctype.h>
3099 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
3100 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
3101 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
3102 int main () { int i; for (i = 0; i < 256; i++)
3103 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
3104 exit (0); }
3105
3106 EOF
3107 if { (eval echo configure:3108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3108 then
3109   :
3110 else
3111   echo "configure: failed program was:" >&5
3112   cat conftest.$ac_ext >&5
3113   rm -fr conftest*
3114   ac_cv_header_stdc=no
3115 fi
3116 rm -fr conftest*
3117 fi
3118
3119 fi
3120 fi
3121
3122 echo "$ac_t""$ac_cv_header_stdc" 1>&6
3123 if test $ac_cv_header_stdc = yes; then
3124   cat >> confdefs.h <<\EOF
3125 #define STDC_HEADERS 1
3126 EOF
3127
3128 fi
3129
3130
3131 for ac_hdr in ctype.h curses.h endian.h link.h \
3132         memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
3133         string.h sys/procfs.h sys/ptrace.h sys/reg.h \
3134         term.h termio.h termios.h unistd.h wait.h sys/wait.h \
3135         wchar.h wctype.h asm/debugreg.h sys/debugreg.h
3136 do
3137 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3138 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3139 echo "configure:3140: checking for $ac_hdr" >&5
3140 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3141   echo $ac_n "(cached) $ac_c" 1>&6
3142 else
3143   cat > conftest.$ac_ext <<EOF
3144 #line 3145 "configure"
3145 #include "confdefs.h"
3146 #include <$ac_hdr>
3147 EOF
3148 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3149 { (eval echo configure:3150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3150 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3151 if test -z "$ac_err"; then
3152   rm -rf conftest*
3153   eval "ac_cv_header_$ac_safe=yes"
3154 else
3155   echo "$ac_err" >&5
3156   echo "configure: failed program was:" >&5
3157   cat conftest.$ac_ext >&5
3158   rm -rf conftest*
3159   eval "ac_cv_header_$ac_safe=no"
3160 fi
3161 rm -f conftest*
3162 fi
3163 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3164   echo "$ac_t""yes" 1>&6
3165     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3166   cat >> confdefs.h <<EOF
3167 #define $ac_tr_hdr 1
3168 EOF
3169  
3170 else
3171   echo "$ac_t""no" 1>&6
3172 fi
3173 done
3174
3175 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
3176 echo "configure:3177: checking whether stat file-mode macros are broken" >&5
3177 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
3178   echo $ac_n "(cached) $ac_c" 1>&6
3179 else
3180   cat > conftest.$ac_ext <<EOF
3181 #line 3182 "configure"
3182 #include "confdefs.h"
3183 #include <sys/types.h>
3184 #include <sys/stat.h>
3185
3186 #if defined(S_ISBLK) && defined(S_IFDIR)
3187 # if S_ISBLK (S_IFDIR)
3188 You lose.
3189 # endif
3190 #endif
3191
3192 #if defined(S_ISBLK) && defined(S_IFCHR)
3193 # if S_ISBLK (S_IFCHR)
3194 You lose.
3195 # endif
3196 #endif
3197
3198 #if defined(S_ISLNK) && defined(S_IFREG)
3199 # if S_ISLNK (S_IFREG)
3200 You lose.
3201 # endif
3202 #endif
3203
3204 #if defined(S_ISSOCK) && defined(S_IFREG)
3205 # if S_ISSOCK (S_IFREG)
3206 You lose.
3207 # endif
3208 #endif
3209
3210 EOF
3211 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3212   egrep "You lose" >/dev/null 2>&1; then
3213   rm -rf conftest*
3214   ac_cv_header_stat_broken=yes
3215 else
3216   rm -rf conftest*
3217   ac_cv_header_stat_broken=no
3218 fi
3219 rm -f conftest*
3220
3221 fi
3222
3223 echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
3224 if test $ac_cv_header_stat_broken = yes; then
3225   cat >> confdefs.h <<\EOF
3226 #define STAT_MACROS_BROKEN 1
3227 EOF
3228
3229 fi
3230
3231
3232 echo $ac_n "checking for working const""... $ac_c" 1>&6
3233 echo "configure:3234: checking for working const" >&5
3234 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
3235   echo $ac_n "(cached) $ac_c" 1>&6
3236 else
3237   cat > conftest.$ac_ext <<EOF
3238 #line 3239 "configure"
3239 #include "confdefs.h"
3240
3241 int main() {
3242
3243 /* Ultrix mips cc rejects this.  */
3244 typedef int charset[2]; const charset x;
3245 /* SunOS 4.1.1 cc rejects this.  */
3246 char const *const *ccp;
3247 char **p;
3248 /* NEC SVR4.0.2 mips cc rejects this.  */
3249 struct point {int x, y;};
3250 static struct point const zero = {0,0};
3251 /* AIX XL C 1.02.0.0 rejects this.
3252    It does not let you subtract one const X* pointer from another in an arm
3253    of an if-expression whose if-part is not a constant expression */
3254 const char *g = "string";
3255 ccp = &g + (g ? g-g : 0);
3256 /* HPUX 7.0 cc rejects these. */
3257 ++ccp;
3258 p = (char**) ccp;
3259 ccp = (char const *const *) p;
3260 { /* SCO 3.2v4 cc rejects this.  */
3261   char *t;
3262   char const *s = 0 ? (char *) 0 : (char const *) 0;
3263
3264   *t++ = 0;
3265 }
3266 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
3267   int x[] = {25, 17};
3268   const int *foo = &x[0];
3269   ++foo;
3270 }
3271 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
3272   typedef const int *iptr;
3273   iptr p = 0;
3274   ++p;
3275 }
3276 { /* AIX XL C 1.02.0.0 rejects this saying
3277      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
3278   struct s { int j; const int *ap[3]; };
3279   struct s *b; b->j = 5;
3280 }
3281 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
3282   const int foo = 10;
3283 }
3284
3285 ; return 0; }
3286 EOF
3287 if { (eval echo configure:3288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3288   rm -rf conftest*
3289   ac_cv_c_const=yes
3290 else
3291   echo "configure: failed program was:" >&5
3292   cat conftest.$ac_ext >&5
3293   rm -rf conftest*
3294   ac_cv_c_const=no
3295 fi
3296 rm -f conftest*
3297 fi
3298
3299 echo "$ac_t""$ac_cv_c_const" 1>&6
3300 if test $ac_cv_c_const = no; then
3301   cat >> confdefs.h <<\EOF
3302 #define const 
3303 EOF
3304
3305 fi
3306
3307
3308 for ac_func in setpgid sbrk sigaction isascii bzero bcopy btowc
3309 do
3310 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3311 echo "configure:3312: checking for $ac_func" >&5
3312 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3313   echo $ac_n "(cached) $ac_c" 1>&6
3314 else
3315   cat > conftest.$ac_ext <<EOF
3316 #line 3317 "configure"
3317 #include "confdefs.h"
3318 /* System header to define __stub macros and hopefully few prototypes,
3319     which can conflict with char $ac_func(); below.  */
3320 #include <assert.h>
3321 /* Override any gcc2 internal prototype to avoid an error.  */
3322 /* We use char because int might match the return type of a gcc2
3323     builtin and then its argument prototype would still apply.  */
3324 char $ac_func();
3325
3326 int main() {
3327
3328 /* The GNU C library defines this for functions which it implements
3329     to always fail with ENOSYS.  Some functions are actually named
3330     something starting with __ and the normal name is an alias.  */
3331 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3332 choke me
3333 #else
3334 $ac_func();
3335 #endif
3336
3337 ; return 0; }
3338 EOF
3339 if { (eval echo configure:3340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3340   rm -rf conftest*
3341   eval "ac_cv_func_$ac_func=yes"
3342 else
3343   echo "configure: failed program was:" >&5
3344   cat conftest.$ac_ext >&5
3345   rm -rf conftest*
3346   eval "ac_cv_func_$ac_func=no"
3347 fi
3348 rm -f conftest*
3349 fi
3350
3351 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3352   echo "$ac_t""yes" 1>&6
3353     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3354   cat >> confdefs.h <<EOF
3355 #define $ac_tr_func 1
3356 EOF
3357  
3358 else
3359   echo "$ac_t""no" 1>&6
3360 fi
3361 done
3362
3363 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
3364 # for constant arguments.  Useless!
3365 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
3366 echo "configure:3367: checking for working alloca.h" >&5
3367 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
3368   echo $ac_n "(cached) $ac_c" 1>&6
3369 else
3370   cat > conftest.$ac_ext <<EOF
3371 #line 3372 "configure"
3372 #include "confdefs.h"
3373 #include <alloca.h>
3374 int main() {
3375 char *p = alloca(2 * sizeof(int));
3376 ; return 0; }
3377 EOF
3378 if { (eval echo configure:3379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3379   rm -rf conftest*
3380   ac_cv_header_alloca_h=yes
3381 else
3382   echo "configure: failed program was:" >&5
3383   cat conftest.$ac_ext >&5
3384   rm -rf conftest*
3385   ac_cv_header_alloca_h=no
3386 fi
3387 rm -f conftest*
3388 fi
3389
3390 echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
3391 if test $ac_cv_header_alloca_h = yes; then
3392   cat >> confdefs.h <<\EOF
3393 #define HAVE_ALLOCA_H 1
3394 EOF
3395
3396 fi
3397
3398 echo $ac_n "checking for alloca""... $ac_c" 1>&6
3399 echo "configure:3400: checking for alloca" >&5
3400 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
3401   echo $ac_n "(cached) $ac_c" 1>&6
3402 else
3403   cat > conftest.$ac_ext <<EOF
3404 #line 3405 "configure"
3405 #include "confdefs.h"
3406
3407 #ifdef __GNUC__
3408 # define alloca __builtin_alloca
3409 #else
3410 # ifdef _MSC_VER
3411 #  include <malloc.h>
3412 #  define alloca _alloca
3413 # else
3414 #  if HAVE_ALLOCA_H
3415 #   include <alloca.h>
3416 #  else
3417 #   ifdef _AIX
3418  #pragma alloca
3419 #   else
3420 #    ifndef alloca /* predefined by HP cc +Olibcalls */
3421 char *alloca ();
3422 #    endif
3423 #   endif
3424 #  endif
3425 # endif
3426 #endif
3427
3428 int main() {
3429 char *p = (char *) alloca(1);
3430 ; return 0; }
3431 EOF
3432 if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3433   rm -rf conftest*
3434   ac_cv_func_alloca_works=yes
3435 else
3436   echo "configure: failed program was:" >&5
3437   cat conftest.$ac_ext >&5
3438   rm -rf conftest*
3439   ac_cv_func_alloca_works=no
3440 fi
3441 rm -f conftest*
3442 fi
3443
3444 echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
3445 if test $ac_cv_func_alloca_works = yes; then
3446   cat >> confdefs.h <<\EOF
3447 #define HAVE_ALLOCA 1
3448 EOF
3449
3450 fi
3451
3452 if test $ac_cv_func_alloca_works = no; then
3453   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
3454   # that cause trouble.  Some versions do not even contain alloca or
3455   # contain a buggy version.  If you still want to use their alloca,
3456   # use ar to extract alloca.o from them instead of compiling alloca.c.
3457   ALLOCA=alloca.${ac_objext}
3458   cat >> confdefs.h <<\EOF
3459 #define C_ALLOCA 1
3460 EOF
3461
3462
3463 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
3464 echo "configure:3465: checking whether alloca needs Cray hooks" >&5
3465 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
3466   echo $ac_n "(cached) $ac_c" 1>&6
3467 else
3468   cat > conftest.$ac_ext <<EOF
3469 #line 3470 "configure"
3470 #include "confdefs.h"
3471 #if defined(CRAY) && ! defined(CRAY2)
3472 webecray
3473 #else
3474 wenotbecray
3475 #endif
3476
3477 EOF
3478 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3479   egrep "webecray" >/dev/null 2>&1; then
3480   rm -rf conftest*
3481   ac_cv_os_cray=yes
3482 else
3483   rm -rf conftest*
3484   ac_cv_os_cray=no
3485 fi
3486 rm -f conftest*
3487
3488 fi
3489
3490 echo "$ac_t""$ac_cv_os_cray" 1>&6
3491 if test $ac_cv_os_cray = yes; then
3492 for ac_func in _getb67 GETB67 getb67; do
3493   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3494 echo "configure:3495: checking for $ac_func" >&5
3495 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3496   echo $ac_n "(cached) $ac_c" 1>&6
3497 else
3498   cat > conftest.$ac_ext <<EOF
3499 #line 3500 "configure"
3500 #include "confdefs.h"
3501 /* System header to define __stub macros and hopefully few prototypes,
3502     which can conflict with char $ac_func(); below.  */
3503 #include <assert.h>
3504 /* Override any gcc2 internal prototype to avoid an error.  */
3505 /* We use char because int might match the return type of a gcc2
3506     builtin and then its argument prototype would still apply.  */
3507 char $ac_func();
3508
3509 int main() {
3510
3511 /* The GNU C library defines this for functions which it implements
3512     to always fail with ENOSYS.  Some functions are actually named
3513     something starting with __ and the normal name is an alias.  */
3514 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3515 choke me
3516 #else
3517 $ac_func();
3518 #endif
3519
3520 ; return 0; }
3521 EOF
3522 if { (eval echo configure:3523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3523   rm -rf conftest*
3524   eval "ac_cv_func_$ac_func=yes"
3525 else
3526   echo "configure: failed program was:" >&5
3527   cat conftest.$ac_ext >&5
3528   rm -rf conftest*
3529   eval "ac_cv_func_$ac_func=no"
3530 fi
3531 rm -f conftest*
3532 fi
3533
3534 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3535   echo "$ac_t""yes" 1>&6
3536   cat >> confdefs.h <<EOF
3537 #define CRAY_STACKSEG_END $ac_func
3538 EOF
3539
3540   break
3541 else
3542   echo "$ac_t""no" 1>&6
3543 fi
3544
3545 done
3546 fi
3547
3548 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
3549 echo "configure:3550: checking stack direction for C alloca" >&5
3550 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
3551   echo $ac_n "(cached) $ac_c" 1>&6
3552 else
3553   if test "$cross_compiling" = yes; then
3554   ac_cv_c_stack_direction=0
3555 else
3556   cat > conftest.$ac_ext <<EOF
3557 #line 3558 "configure"
3558 #include "confdefs.h"
3559 find_stack_direction ()
3560 {
3561   static char *addr = 0;
3562   auto char dummy;
3563   if (addr == 0)
3564     {
3565       addr = &dummy;
3566       return find_stack_direction ();
3567     }
3568   else
3569     return (&dummy > addr) ? 1 : -1;
3570 }
3571 main ()
3572 {
3573   exit (find_stack_direction() < 0);
3574 }
3575 EOF
3576 if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3577 then
3578   ac_cv_c_stack_direction=1
3579 else
3580   echo "configure: failed program was:" >&5
3581   cat conftest.$ac_ext >&5
3582   rm -fr conftest*
3583   ac_cv_c_stack_direction=-1
3584 fi
3585 rm -fr conftest*
3586 fi
3587
3588 fi
3589
3590 echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
3591 cat >> confdefs.h <<EOF
3592 #define STACK_DIRECTION $ac_cv_c_stack_direction
3593 EOF
3594
3595 fi
3596
3597
3598 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
3599 echo "configure:3600: checking whether malloc must be declared" >&5
3600 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
3601   echo $ac_n "(cached) $ac_c" 1>&6
3602 else
3603   cat > conftest.$ac_ext <<EOF
3604 #line 3605 "configure"
3605 #include "confdefs.h"
3606
3607 #include <stdio.h>
3608 #ifdef HAVE_STRING_H
3609 #include <string.h>
3610 #else
3611 #ifdef HAVE_STRINGS_H
3612 #include <strings.h>
3613 #endif
3614 #endif
3615 #ifdef HAVE_STDLIB_H
3616 #include <stdlib.h>
3617 #endif
3618 #ifdef HAVE_UNISTD_H
3619 #include <unistd.h>
3620 #endif
3621 int main() {
3622 char *(*pfn) = (char *(*)) malloc
3623 ; return 0; }
3624 EOF
3625 if { (eval echo configure:3626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3626   rm -rf conftest*
3627   bfd_cv_decl_needed_malloc=no
3628 else
3629   echo "configure: failed program was:" >&5
3630   cat conftest.$ac_ext >&5
3631   rm -rf conftest*
3632   bfd_cv_decl_needed_malloc=yes
3633 fi
3634 rm -f conftest*
3635 fi
3636
3637 echo "$ac_t""$bfd_cv_decl_needed_malloc" 1>&6
3638 if test $bfd_cv_decl_needed_malloc = yes; then
3639   cat >> confdefs.h <<\EOF
3640 #define NEED_DECLARATION_MALLOC 1
3641 EOF
3642
3643 fi
3644
3645 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
3646 echo "configure:3647: checking whether realloc must be declared" >&5
3647 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
3648   echo $ac_n "(cached) $ac_c" 1>&6
3649 else
3650   cat > conftest.$ac_ext <<EOF
3651 #line 3652 "configure"
3652 #include "confdefs.h"
3653
3654 #include <stdio.h>
3655 #ifdef HAVE_STRING_H
3656 #include <string.h>
3657 #else
3658 #ifdef HAVE_STRINGS_H
3659 #include <strings.h>
3660 #endif
3661 #endif
3662 #ifdef HAVE_STDLIB_H
3663 #include <stdlib.h>
3664 #endif
3665 #ifdef HAVE_UNISTD_H
3666 #include <unistd.h>
3667 #endif
3668 int main() {
3669 char *(*pfn) = (char *(*)) realloc
3670 ; return 0; }
3671 EOF
3672 if { (eval echo configure:3673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3673   rm -rf conftest*
3674   bfd_cv_decl_needed_realloc=no
3675 else
3676   echo "configure: failed program was:" >&5
3677   cat conftest.$ac_ext >&5
3678   rm -rf conftest*
3679   bfd_cv_decl_needed_realloc=yes
3680 fi
3681 rm -f conftest*
3682 fi
3683
3684 echo "$ac_t""$bfd_cv_decl_needed_realloc" 1>&6
3685 if test $bfd_cv_decl_needed_realloc = yes; then
3686   cat >> confdefs.h <<\EOF
3687 #define NEED_DECLARATION_REALLOC 1
3688 EOF
3689
3690 fi
3691
3692 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
3693 echo "configure:3694: checking whether free must be declared" >&5
3694 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
3695   echo $ac_n "(cached) $ac_c" 1>&6
3696 else
3697   cat > conftest.$ac_ext <<EOF
3698 #line 3699 "configure"
3699 #include "confdefs.h"
3700
3701 #include <stdio.h>
3702 #ifdef HAVE_STRING_H
3703 #include <string.h>
3704 #else
3705 #ifdef HAVE_STRINGS_H
3706 #include <strings.h>
3707 #endif
3708 #endif
3709 #ifdef HAVE_STDLIB_H
3710 #include <stdlib.h>
3711 #endif
3712 #ifdef HAVE_UNISTD_H
3713 #include <unistd.h>
3714 #endif
3715 int main() {
3716 char *(*pfn) = (char *(*)) free
3717 ; return 0; }
3718 EOF
3719 if { (eval echo configure:3720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3720   rm -rf conftest*
3721   bfd_cv_decl_needed_free=no
3722 else
3723   echo "configure: failed program was:" >&5
3724   cat conftest.$ac_ext >&5
3725   rm -rf conftest*
3726   bfd_cv_decl_needed_free=yes
3727 fi
3728 rm -f conftest*
3729 fi
3730
3731 echo "$ac_t""$bfd_cv_decl_needed_free" 1>&6
3732 if test $bfd_cv_decl_needed_free = yes; then
3733   cat >> confdefs.h <<\EOF
3734 #define NEED_DECLARATION_FREE 1
3735 EOF
3736
3737 fi
3738
3739 echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
3740 echo "configure:3741: checking whether strerror must be declared" >&5
3741 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
3742   echo $ac_n "(cached) $ac_c" 1>&6
3743 else
3744   cat > conftest.$ac_ext <<EOF
3745 #line 3746 "configure"
3746 #include "confdefs.h"
3747
3748 #include <stdio.h>
3749 #ifdef HAVE_STRING_H
3750 #include <string.h>
3751 #else
3752 #ifdef HAVE_STRINGS_H
3753 #include <strings.h>
3754 #endif
3755 #endif
3756 #ifdef HAVE_STDLIB_H
3757 #include <stdlib.h>
3758 #endif
3759 #ifdef HAVE_UNISTD_H
3760 #include <unistd.h>
3761 #endif
3762 int main() {
3763 char *(*pfn) = (char *(*)) strerror
3764 ; return 0; }
3765 EOF
3766 if { (eval echo configure:3767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3767   rm -rf conftest*
3768   bfd_cv_decl_needed_strerror=no
3769 else
3770   echo "configure: failed program was:" >&5
3771   cat conftest.$ac_ext >&5
3772   rm -rf conftest*
3773   bfd_cv_decl_needed_strerror=yes
3774 fi
3775 rm -f conftest*
3776 fi
3777
3778 echo "$ac_t""$bfd_cv_decl_needed_strerror" 1>&6
3779 if test $bfd_cv_decl_needed_strerror = yes; then
3780   cat >> confdefs.h <<\EOF
3781 #define NEED_DECLARATION_STRERROR 1
3782 EOF
3783
3784 fi
3785
3786 echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
3787 echo "configure:3788: checking whether strdup must be declared" >&5
3788 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
3789   echo $ac_n "(cached) $ac_c" 1>&6
3790 else
3791   cat > conftest.$ac_ext <<EOF
3792 #line 3793 "configure"
3793 #include "confdefs.h"
3794
3795 #include <stdio.h>
3796 #ifdef HAVE_STRING_H
3797 #include <string.h>
3798 #else
3799 #ifdef HAVE_STRINGS_H
3800 #include <strings.h>
3801 #endif
3802 #endif
3803 #ifdef HAVE_STDLIB_H
3804 #include <stdlib.h>
3805 #endif
3806 #ifdef HAVE_UNISTD_H
3807 #include <unistd.h>
3808 #endif
3809 int main() {
3810 char *(*pfn) = (char *(*)) strdup
3811 ; return 0; }
3812 EOF
3813 if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3814   rm -rf conftest*
3815   bfd_cv_decl_needed_strdup=no
3816 else
3817   echo "configure: failed program was:" >&5
3818   cat conftest.$ac_ext >&5
3819   rm -rf conftest*
3820   bfd_cv_decl_needed_strdup=yes
3821 fi
3822 rm -f conftest*
3823 fi
3824
3825 echo "$ac_t""$bfd_cv_decl_needed_strdup" 1>&6
3826 if test $bfd_cv_decl_needed_strdup = yes; then
3827   cat >> confdefs.h <<\EOF
3828 #define NEED_DECLARATION_STRDUP 1
3829 EOF
3830
3831 fi
3832
3833
3834
3835 # The following save_state_t checkery is only necessary for HPUX 
3836 # versions earlier than 10.20.  When those fade from memory, this 
3837 # could be expunged. --jsm 1999-03-22
3838
3839 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
3840 echo "configure:3841: checking for HPUX save_state structure" >&5
3841 cat > conftest.$ac_ext <<EOF
3842 #line 3843 "configure"
3843 #include "confdefs.h"
3844 #include <machine/save_state.h>
3845 EOF
3846 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3847   egrep "save_state_t" >/dev/null 2>&1; then
3848   rm -rf conftest*
3849   gdb_cv_hpux_savestate=yes
3850 else
3851   rm -rf conftest*
3852   gdb_cv_hpux_savestate=no
3853 fi
3854 rm -f conftest*
3855
3856 cat > conftest.$ac_ext <<EOF
3857 #line 3858 "configure"
3858 #include "confdefs.h"
3859 #include <machine/save_state.h>
3860 EOF
3861 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3862   egrep "ss_wide" >/dev/null 2>&1; then
3863   rm -rf conftest*
3864   gdb_cv_hpux_sswide=yes
3865 else
3866   rm -rf conftest*
3867   gdb_cv_hpux_sswide=no
3868 fi
3869 rm -f conftest*
3870
3871 if test $gdb_cv_hpux_savestate = yes
3872 then
3873   cat >> confdefs.h <<\EOF
3874 #define HAVE_STRUCT_SAVE_STATE_T 1
3875 EOF
3876
3877 fi
3878 if test $gdb_cv_hpux_sswide = yes
3879 then
3880   cat >> confdefs.h <<\EOF
3881 #define HAVE_STRUCT_MEMBER_SS_WIDE 1
3882 EOF
3883
3884 fi
3885 echo "$ac_t""$gdb_cv_hpux_sswide" 1>&6
3886
3887
3888 # If we are configured native on GNU/Linux, work around problems with
3889 # sys/procfs.h
3890 # Also detect which type of /proc is in use, such as for Unixware.
3891
3892 if test "${target}" = "${host}"; then
3893   case "${host}" in
3894   i[3456]86-*-linux*)
3895         cat >> confdefs.h <<\EOF
3896 #define START_INFERIOR_TRAPS_EXPECTED 2
3897 EOF
3898
3899         cat >> confdefs.h <<\EOF
3900 #define sys_quotactl 1
3901 EOF
3902
3903         ;;
3904   esac
3905   echo $ac_n "checking for directory proc entries""... $ac_c" 1>&6
3906 echo "configure:3907: checking for directory proc entries" >&5
3907 # The [gdb_host != sun4sol2] hack is because Solaris does provide the
3908 # multiple procfs files as of Solaris 2.6, but GDB can't use it right now.
3909   if test "$ac_cv_header_sys_procfs_h" = yes -a "$gdb_host" != sun4sol2 \
3910   -a -d /proc/$$ \
3911   -a -f /proc/$$/ctl \
3912   -a -f /proc/$$/as \
3913   -a -f /proc/$$/map \
3914   -a -f /proc/$$/status; then
3915     echo "$ac_t""yes" 1>&6
3916     cat >> confdefs.h <<\EOF
3917 #define HAVE_MULTIPLE_PROC_FDS 1
3918 EOF
3919
3920   else
3921     echo "$ac_t""no" 1>&6
3922   fi
3923 fi
3924
3925 if test "$ac_cv_header_sys_procfs_h" = yes; then
3926   echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
3927 echo "configure:3928: checking for pstatus_t in sys/procfs.h" >&5
3928  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
3929   echo $ac_n "(cached) $ac_c" 1>&6
3930 else
3931   cat > conftest.$ac_ext <<EOF
3932 #line 3933 "configure"
3933 #include "confdefs.h"
3934 #include <sys/procfs.h>
3935 int main() {
3936 pstatus_t avar
3937 ; return 0; }
3938 EOF
3939 if { (eval echo configure:3940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3940   rm -rf conftest*
3941   bfd_cv_have_sys_procfs_type_pstatus_t=yes
3942 else
3943   echo "configure: failed program was:" >&5
3944   cat conftest.$ac_ext >&5
3945   rm -rf conftest*
3946   bfd_cv_have_sys_procfs_type_pstatus_t=no
3947    
3948 fi
3949 rm -f conftest*
3950 fi
3951
3952  if test $bfd_cv_have_sys_procfs_type_pstatus_t = yes; then
3953    cat >> confdefs.h <<\EOF
3954 #define HAVE_PSTATUS_T 1
3955 EOF
3956
3957  fi
3958  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
3959
3960   echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
3961 echo "configure:3962: checking for prrun_t in sys/procfs.h" >&5
3962  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
3963   echo $ac_n "(cached) $ac_c" 1>&6
3964 else
3965   cat > conftest.$ac_ext <<EOF
3966 #line 3967 "configure"
3967 #include "confdefs.h"
3968 #include <sys/procfs.h>
3969 int main() {
3970 prrun_t avar
3971 ; return 0; }
3972 EOF
3973 if { (eval echo configure:3974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3974   rm -rf conftest*
3975   bfd_cv_have_sys_procfs_type_prrun_t=yes
3976 else
3977   echo "configure: failed program was:" >&5
3978   cat conftest.$ac_ext >&5
3979   rm -rf conftest*
3980   bfd_cv_have_sys_procfs_type_prrun_t=no
3981    
3982 fi
3983 rm -f conftest*
3984 fi
3985
3986  if test $bfd_cv_have_sys_procfs_type_prrun_t = yes; then
3987    cat >> confdefs.h <<\EOF
3988 #define HAVE_PRRUN_T 1
3989 EOF
3990
3991  fi
3992  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
3993
3994   echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
3995 echo "configure:3996: checking for gregset_t in sys/procfs.h" >&5
3996  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
3997   echo $ac_n "(cached) $ac_c" 1>&6
3998 else
3999   cat > conftest.$ac_ext <<EOF
4000 #line 4001 "configure"
4001 #include "confdefs.h"
4002 #include <sys/procfs.h>
4003 int main() {
4004 gregset_t avar
4005 ; return 0; }
4006 EOF
4007 if { (eval echo configure:4008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4008   rm -rf conftest*
4009   bfd_cv_have_sys_procfs_type_gregset_t=yes
4010 else
4011   echo "configure: failed program was:" >&5
4012   cat conftest.$ac_ext >&5
4013   rm -rf conftest*
4014   bfd_cv_have_sys_procfs_type_gregset_t=no
4015    
4016 fi
4017 rm -f conftest*
4018 fi
4019
4020  if test $bfd_cv_have_sys_procfs_type_gregset_t = yes; then
4021    cat >> confdefs.h <<\EOF
4022 #define HAVE_GREGSET_T 1
4023 EOF
4024
4025  fi
4026  echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
4027
4028   echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
4029 echo "configure:4030: checking for fpregset_t in sys/procfs.h" >&5
4030  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
4031   echo $ac_n "(cached) $ac_c" 1>&6
4032 else
4033   cat > conftest.$ac_ext <<EOF
4034 #line 4035 "configure"
4035 #include "confdefs.h"
4036 #include <sys/procfs.h>
4037 int main() {
4038 fpregset_t avar
4039 ; return 0; }
4040 EOF
4041 if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4042   rm -rf conftest*
4043   bfd_cv_have_sys_procfs_type_fpregset_t=yes
4044 else
4045   echo "configure: failed program was:" >&5
4046   cat conftest.$ac_ext >&5
4047   rm -rf conftest*
4048   bfd_cv_have_sys_procfs_type_fpregset_t=no
4049    
4050 fi
4051 rm -f conftest*
4052 fi
4053
4054  if test $bfd_cv_have_sys_procfs_type_fpregset_t = yes; then
4055    cat >> confdefs.h <<\EOF
4056 #define HAVE_FPREGSET_T 1
4057 EOF
4058
4059  fi
4060  echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
4061
4062
4063   
4064   echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
4065 echo "configure:4066: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
4066   if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
4067   echo $ac_n "(cached) $ac_c" 1>&6
4068 else
4069   cat > conftest.$ac_ext <<EOF
4070 #line 4071 "configure"
4071 #include "confdefs.h"
4072 #include <unistd.h>
4073 #include <sys/types.h>
4074 #include <sys/procfs.h>
4075
4076 int main() {
4077
4078     int dummy;;
4079     dummy = ioctl(0, PIOCSET, &dummy);
4080   
4081 ; return 0; }
4082 EOF
4083 if { (eval echo configure:4084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4084   rm -rf conftest*
4085   gdb_cv_have_procfs_piocset=yes
4086 else
4087   echo "configure: failed program was:" >&5
4088   cat conftest.$ac_ext >&5
4089   rm -rf conftest*
4090   gdb_cv_have_procfs_piocset=no
4091 fi
4092 rm -f conftest*
4093 fi
4094
4095   echo "$ac_t""$gdb_cv_have_procfs_piocset" 1>&6
4096   if test $gdb_cv_have_procfs_piocset = yes; then
4097     cat >> confdefs.h <<\EOF
4098 #define HAVE_PROCFS_PIOCSET 1
4099 EOF
4100
4101   fi
4102 fi
4103
4104 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
4105 echo "configure:4106: checking for main in -lm" >&5
4106 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
4107 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4108   echo $ac_n "(cached) $ac_c" 1>&6
4109 else
4110   ac_save_LIBS="$LIBS"
4111 LIBS="-lm  $LIBS"
4112 cat > conftest.$ac_ext <<EOF
4113 #line 4114 "configure"
4114 #include "confdefs.h"
4115
4116 int main() {
4117 main()
4118 ; return 0; }
4119 EOF
4120 if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4121   rm -rf conftest*
4122   eval "ac_cv_lib_$ac_lib_var=yes"
4123 else
4124   echo "configure: failed program was:" >&5
4125   cat conftest.$ac_ext >&5
4126   rm -rf conftest*
4127   eval "ac_cv_lib_$ac_lib_var=no"
4128 fi
4129 rm -f conftest*
4130 LIBS="$ac_save_LIBS"
4131
4132 fi
4133 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4134   echo "$ac_t""yes" 1>&6
4135     ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4136     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4137   cat >> confdefs.h <<EOF
4138 #define $ac_tr_lib 1
4139 EOF
4140
4141   LIBS="-lm $LIBS"
4142
4143 else
4144   echo "$ac_t""no" 1>&6
4145 fi
4146
4147
4148 echo $ac_n "checking for wctype in -lc""... $ac_c" 1>&6
4149 echo "configure:4150: checking for wctype in -lc" >&5
4150 ac_lib_var=`echo c'_'wctype | sed 'y%./+-%__p_%'`
4151 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4152   echo $ac_n "(cached) $ac_c" 1>&6
4153 else
4154   ac_save_LIBS="$LIBS"
4155 LIBS="-lc  $LIBS"
4156 cat > conftest.$ac_ext <<EOF
4157 #line 4158 "configure"
4158 #include "confdefs.h"
4159 /* Override any gcc2 internal prototype to avoid an error.  */
4160 /* We use char because int might match the return type of a gcc2
4161     builtin and then its argument prototype would still apply.  */
4162 char wctype();
4163
4164 int main() {
4165 wctype()
4166 ; return 0; }
4167 EOF
4168 if { (eval echo configure:4169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4169   rm -rf conftest*
4170   eval "ac_cv_lib_$ac_lib_var=yes"
4171 else
4172   echo "configure: failed program was:" >&5
4173   cat conftest.$ac_ext >&5
4174   rm -rf conftest*
4175   eval "ac_cv_lib_$ac_lib_var=no"
4176 fi
4177 rm -f conftest*
4178 LIBS="$ac_save_LIBS"
4179
4180 fi
4181 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4182   echo "$ac_t""yes" 1>&6
4183   : 
4184 else
4185   echo "$ac_t""no" 1>&6
4186 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
4187 echo "configure:4188: checking for wctype in -lw" >&5
4188 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
4189 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4190   echo $ac_n "(cached) $ac_c" 1>&6
4191 else
4192   ac_save_LIBS="$LIBS"
4193 LIBS="-lw  $LIBS"
4194 cat > conftest.$ac_ext <<EOF
4195 #line 4196 "configure"
4196 #include "confdefs.h"
4197 /* Override any gcc2 internal prototype to avoid an error.  */
4198 /* We use char because int might match the return type of a gcc2
4199     builtin and then its argument prototype would still apply.  */
4200 char wctype();
4201
4202 int main() {
4203 wctype()
4204 ; return 0; }
4205 EOF
4206 if { (eval echo configure:4207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4207   rm -rf conftest*
4208   eval "ac_cv_lib_$ac_lib_var=yes"
4209 else
4210   echo "configure: failed program was:" >&5
4211   cat conftest.$ac_ext >&5
4212   rm -rf conftest*
4213   eval "ac_cv_lib_$ac_lib_var=no"
4214 fi
4215 rm -f conftest*
4216 LIBS="$ac_save_LIBS"
4217
4218 fi
4219 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4220   echo "$ac_t""yes" 1>&6
4221     ac_tr_lib=HAVE_LIB`echo w | sed -e 's/^a-zA-Z0-9_/_/g' \
4222     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4223   cat >> confdefs.h <<EOF
4224 #define $ac_tr_lib 1
4225 EOF
4226
4227   LIBS="-lw $LIBS"
4228
4229 else
4230   echo "$ac_t""no" 1>&6
4231 fi
4232
4233 fi
4234
4235
4236
4237 echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
4238 echo "configure:4239: checking for long long support in compiler" >&5
4239 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
4240   echo $ac_n "(cached) $ac_c" 1>&6
4241 else
4242   cat > conftest.$ac_ext <<EOF
4243 #line 4244 "configure"
4244 #include "confdefs.h"
4245
4246 int main() {
4247
4248   extern long long foo;
4249   switch (foo & 2) { case 0: return 1; }
4250
4251 ; return 0; }
4252 EOF
4253 if { (eval echo configure:4254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4254   rm -rf conftest*
4255   gdb_cv_c_long_long=yes
4256 else
4257   echo "configure: failed program was:" >&5
4258   cat conftest.$ac_ext >&5
4259   rm -rf conftest*
4260   gdb_cv_c_long_long=no
4261 fi
4262 rm -f conftest*
4263 fi
4264
4265 echo "$ac_t""$gdb_cv_c_long_long" 1>&6
4266 if test $gdb_cv_c_long_long = yes; then
4267   cat >> confdefs.h <<\EOF
4268 #define CC_HAS_LONG_LONG 1
4269 EOF
4270
4271 fi
4272
4273
4274 echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
4275 echo "configure:4276: checking for long long support in printf" >&5
4276 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
4277   echo $ac_n "(cached) $ac_c" 1>&6
4278 else
4279   if test "$cross_compiling" = yes; then
4280   gdb_cv_printf_has_long_long=no
4281 else
4282   cat > conftest.$ac_ext <<EOF
4283 #line 4284 "configure"
4284 #include "confdefs.h"
4285
4286 int main () {
4287   char buf[32];
4288   long long l = 0;
4289   l = (l << 16) + 0x0123;
4290   l = (l << 16) + 0x4567;
4291   l = (l << 16) + 0x89ab;
4292   l = (l << 16) + 0xcdef;
4293   sprintf (buf, "0x%016llx", l);
4294   return (strcmp ("0x0123456789abcdef", buf));
4295 }
4296 EOF
4297 if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4298 then
4299   gdb_cv_printf_has_long_long=yes
4300 else
4301   echo "configure: failed program was:" >&5
4302   cat conftest.$ac_ext >&5
4303   rm -fr conftest*
4304   gdb_cv_printf_has_long_long=no
4305 fi
4306 rm -fr conftest*
4307 fi
4308
4309 fi
4310
4311 if test $gdb_cv_printf_has_long_long = yes; then
4312   cat >> confdefs.h <<\EOF
4313 #define PRINTF_HAS_LONG_LONG 1
4314 EOF
4315
4316 fi
4317 echo "$ac_t""$gdb_cv_printf_has_long_long" 1>&6
4318
4319
4320 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
4321 echo "configure:4322: checking for long double support in compiler" >&5
4322 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
4323   echo $ac_n "(cached) $ac_c" 1>&6
4324 else
4325   cat > conftest.$ac_ext <<EOF
4326 #line 4327 "configure"
4327 #include "confdefs.h"
4328
4329 int main() {
4330 long double foo;
4331 ; return 0; }
4332 EOF
4333 if { (eval echo configure:4334: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4334   rm -rf conftest*
4335   ac_cv_c_long_double=yes
4336 else
4337   echo "configure: failed program was:" >&5
4338   cat conftest.$ac_ext >&5
4339   rm -rf conftest*
4340   ac_cv_c_long_double=no
4341 fi
4342 rm -f conftest*
4343 fi
4344
4345 echo "$ac_t""$ac_cv_c_long_double" 1>&6
4346 if test $ac_cv_c_long_double = yes; then
4347   cat >> confdefs.h <<\EOF
4348 #define HAVE_LONG_DOUBLE 1
4349 EOF
4350
4351 fi
4352
4353
4354 echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
4355 echo "configure:4356: checking for long double support in printf" >&5
4356 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
4357   echo $ac_n "(cached) $ac_c" 1>&6
4358 else
4359   if test "$cross_compiling" = yes; then
4360   gdb_cv_printf_has_long_double=no
4361 else
4362   cat > conftest.$ac_ext <<EOF
4363 #line 4364 "configure"
4364 #include "confdefs.h"
4365
4366 int main () {
4367   char buf[16];
4368   long double f = 3.141592653;
4369   sprintf (buf, "%Lg", f);
4370   return (strncmp ("3.14159", buf, 7));
4371 }
4372 EOF
4373 if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4374 then
4375   gdb_cv_printf_has_long_double=yes
4376 else
4377   echo "configure: failed program was:" >&5
4378   cat conftest.$ac_ext >&5
4379   rm -fr conftest*
4380   gdb_cv_printf_has_long_double=no
4381 fi
4382 rm -fr conftest*
4383 fi
4384
4385 fi
4386
4387 if test $gdb_cv_printf_has_long_double = yes; then
4388   cat >> confdefs.h <<\EOF
4389 #define PRINTF_HAS_LONG_DOUBLE 1
4390 EOF
4391
4392 fi
4393 echo "$ac_t""$gdb_cv_printf_has_long_double" 1>&6
4394
4395
4396 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
4397 echo "configure:4398: checking for long double support in scanf" >&5
4398 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
4399   echo $ac_n "(cached) $ac_c" 1>&6
4400 else
4401   if test "$cross_compiling" = yes; then
4402   gdb_cv_scanf_has_long_double=no
4403 else
4404   cat > conftest.$ac_ext <<EOF
4405 #line 4406 "configure"
4406 #include "confdefs.h"
4407
4408 int main () {
4409   char *buf = "3.141592653";
4410   long double f = 0;
4411   sscanf (buf, "%Lg", &f);
4412   return !(f > 3.14159 && f < 3.14160);
4413 }
4414 EOF
4415 if { (eval echo configure:4416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4416 then
4417   gdb_cv_scanf_has_long_double=yes
4418 else
4419   echo "configure: failed program was:" >&5
4420   cat conftest.$ac_ext >&5
4421   rm -fr conftest*
4422   gdb_cv_scanf_has_long_double=no
4423 fi
4424 rm -fr conftest*
4425 fi
4426
4427 fi
4428
4429 if test $gdb_cv_scanf_has_long_double = yes; then
4430   cat >> confdefs.h <<\EOF
4431 #define SCANF_HAS_LONG_DOUBLE 1
4432 EOF
4433
4434 fi
4435 echo "$ac_t""$gdb_cv_scanf_has_long_double" 1>&6
4436
4437 for ac_hdr in unistd.h
4438 do
4439 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4440 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4441 echo "configure:4442: checking for $ac_hdr" >&5
4442 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4443   echo $ac_n "(cached) $ac_c" 1>&6
4444 else
4445   cat > conftest.$ac_ext <<EOF
4446 #line 4447 "configure"
4447 #include "confdefs.h"
4448 #include <$ac_hdr>
4449 EOF
4450 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4451 { (eval echo configure:4452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4452 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4453 if test -z "$ac_err"; then
4454   rm -rf conftest*
4455   eval "ac_cv_header_$ac_safe=yes"
4456 else
4457   echo "$ac_err" >&5
4458   echo "configure: failed program was:" >&5
4459   cat conftest.$ac_ext >&5
4460   rm -rf conftest*
4461   eval "ac_cv_header_$ac_safe=no"
4462 fi
4463 rm -f conftest*
4464 fi
4465 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4466   echo "$ac_t""yes" 1>&6
4467     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4468   cat >> confdefs.h <<EOF
4469 #define $ac_tr_hdr 1
4470 EOF
4471  
4472 else
4473   echo "$ac_t""no" 1>&6
4474 fi
4475 done
4476
4477 for ac_func in getpagesize
4478 do
4479 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4480 echo "configure:4481: checking for $ac_func" >&5
4481 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4482   echo $ac_n "(cached) $ac_c" 1>&6
4483 else
4484   cat > conftest.$ac_ext <<EOF
4485 #line 4486 "configure"
4486 #include "confdefs.h"
4487 /* System header to define __stub macros and hopefully few prototypes,
4488     which can conflict with char $ac_func(); below.  */
4489 #include <assert.h>
4490 /* Override any gcc2 internal prototype to avoid an error.  */
4491 /* We use char because int might match the return type of a gcc2
4492     builtin and then its argument prototype would still apply.  */
4493 char $ac_func();
4494
4495 int main() {
4496
4497 /* The GNU C library defines this for functions which it implements
4498     to always fail with ENOSYS.  Some functions are actually named
4499     something starting with __ and the normal name is an alias.  */
4500 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4501 choke me
4502 #else
4503 $ac_func();
4504 #endif
4505
4506 ; return 0; }
4507 EOF
4508 if { (eval echo configure:4509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4509   rm -rf conftest*
4510   eval "ac_cv_func_$ac_func=yes"
4511 else
4512   echo "configure: failed program was:" >&5
4513   cat conftest.$ac_ext >&5
4514   rm -rf conftest*
4515   eval "ac_cv_func_$ac_func=no"
4516 fi
4517 rm -f conftest*
4518 fi
4519
4520 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4521   echo "$ac_t""yes" 1>&6
4522     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4523   cat >> confdefs.h <<EOF
4524 #define $ac_tr_func 1
4525 EOF
4526  
4527 else
4528   echo "$ac_t""no" 1>&6
4529 fi
4530 done
4531
4532 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
4533 echo "configure:4534: checking for working mmap" >&5
4534 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
4535   echo $ac_n "(cached) $ac_c" 1>&6
4536 else
4537   if test "$cross_compiling" = yes; then
4538   ac_cv_func_mmap_fixed_mapped=no
4539 else
4540   cat > conftest.$ac_ext <<EOF
4541 #line 4542 "configure"
4542 #include "confdefs.h"
4543
4544 /* Thanks to Mike Haertel and Jim Avera for this test.
4545    Here is a matrix of mmap possibilities:
4546         mmap private not fixed
4547         mmap private fixed at somewhere currently unmapped
4548         mmap private fixed at somewhere already mapped
4549         mmap shared not fixed
4550         mmap shared fixed at somewhere currently unmapped
4551         mmap shared fixed at somewhere already mapped
4552    For private mappings, we should verify that changes cannot be read()
4553    back from the file, nor mmap's back from the file at a different
4554    address.  (There have been systems where private was not correctly
4555    implemented like the infamous i386 svr4.0, and systems where the
4556    VM page cache was not coherent with the filesystem buffer cache
4557    like early versions of FreeBSD and possibly contemporary NetBSD.)
4558    For shared mappings, we should conversely verify that changes get
4559    propogated back to all the places they're supposed to be.
4560
4561    Grep wants private fixed already mapped.
4562    The main things grep needs to know about mmap are:
4563    * does it exist and is it safe to write into the mmap'd area
4564    * how to use it (BSD variants)  */
4565 #include <sys/types.h>
4566 #include <fcntl.h>
4567 #include <sys/mman.h>
4568
4569 /* This mess was copied from the GNU getpagesize.h.  */
4570 #ifndef HAVE_GETPAGESIZE
4571 # ifdef HAVE_UNISTD_H
4572 #  include <unistd.h>
4573 # endif
4574
4575 /* Assume that all systems that can run configure have sys/param.h.  */
4576 # ifndef HAVE_SYS_PARAM_H
4577 #  define HAVE_SYS_PARAM_H 1
4578 # endif
4579
4580 # ifdef _SC_PAGESIZE
4581 #  define getpagesize() sysconf(_SC_PAGESIZE)
4582 # else /* no _SC_PAGESIZE */
4583 #  ifdef HAVE_SYS_PARAM_H
4584 #   include <sys/param.h>
4585 #   ifdef EXEC_PAGESIZE
4586 #    define getpagesize() EXEC_PAGESIZE
4587 #   else /* no EXEC_PAGESIZE */
4588 #    ifdef NBPG
4589 #     define getpagesize() NBPG * CLSIZE
4590 #     ifndef CLSIZE
4591 #      define CLSIZE 1
4592 #     endif /* no CLSIZE */
4593 #    else /* no NBPG */
4594 #     ifdef NBPC
4595 #      define getpagesize() NBPC
4596 #     else /* no NBPC */
4597 #      ifdef PAGESIZE
4598 #       define getpagesize() PAGESIZE
4599 #      endif /* PAGESIZE */
4600 #     endif /* no NBPC */
4601 #    endif /* no NBPG */
4602 #   endif /* no EXEC_PAGESIZE */
4603 #  else /* no HAVE_SYS_PARAM_H */
4604 #   define getpagesize() 8192   /* punt totally */
4605 #  endif /* no HAVE_SYS_PARAM_H */
4606 # endif /* no _SC_PAGESIZE */
4607
4608 #endif /* no HAVE_GETPAGESIZE */
4609
4610 #ifdef __cplusplus
4611 extern "C" { void *malloc(unsigned); }
4612 #else
4613 char *malloc();
4614 #endif
4615
4616 int
4617 main()
4618 {
4619         char *data, *data2, *data3;
4620         int i, pagesize;
4621         int fd;
4622
4623         pagesize = getpagesize();
4624
4625         /*
4626          * First, make a file with some known garbage in it.
4627          */
4628         data = malloc(pagesize);
4629         if (!data)
4630                 exit(1);
4631         for (i = 0; i < pagesize; ++i)
4632                 *(data + i) = rand();
4633         umask(0);
4634         fd = creat("conftestmmap", 0600);
4635         if (fd < 0)
4636                 exit(1);
4637         if (write(fd, data, pagesize) != pagesize)
4638                 exit(1);
4639         close(fd);
4640
4641         /*
4642          * Next, try to mmap the file at a fixed address which
4643          * already has something else allocated at it.  If we can,
4644          * also make sure that we see the same garbage.
4645          */
4646         fd = open("conftestmmap", O_RDWR);
4647         if (fd < 0)
4648                 exit(1);
4649         data2 = malloc(2 * pagesize);
4650         if (!data2)
4651                 exit(1);
4652         data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
4653         if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
4654             MAP_PRIVATE | MAP_FIXED, fd, 0L))
4655                 exit(1);
4656         for (i = 0; i < pagesize; ++i)
4657                 if (*(data + i) != *(data2 + i))
4658                         exit(1);
4659
4660         /*
4661          * Finally, make sure that changes to the mapped area
4662          * do not percolate back to the file as seen by read().
4663          * (This is a bug on some variants of i386 svr4.0.)
4664          */
4665         for (i = 0; i < pagesize; ++i)
4666                 *(data2 + i) = *(data2 + i) + 1;
4667         data3 = malloc(pagesize);
4668         if (!data3)
4669                 exit(1);
4670         if (read(fd, data3, pagesize) != pagesize)
4671                 exit(1);
4672         for (i = 0; i < pagesize; ++i)
4673                 if (*(data + i) != *(data3 + i))
4674                         exit(1);
4675         close(fd);
4676         unlink("conftestmmap");
4677         exit(0);
4678 }
4679
4680 EOF
4681 if { (eval echo configure:4682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4682 then
4683   ac_cv_func_mmap_fixed_mapped=yes
4684 else
4685   echo "configure: failed program was:" >&5
4686   cat conftest.$ac_ext >&5
4687   rm -fr conftest*
4688   ac_cv_func_mmap_fixed_mapped=no
4689 fi
4690 rm -fr conftest*
4691 fi
4692
4693 fi
4694
4695 echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
4696 if test $ac_cv_func_mmap_fixed_mapped = yes; then
4697   cat >> confdefs.h <<\EOF
4698 #define HAVE_MMAP 1
4699 EOF
4700
4701 fi
4702
4703
4704
4705
4706 if test ${build} = ${host} -a ${host} = ${target} ; then
4707    case ${host_os} in
4708    hpux*)
4709       echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
4710 echo "configure:4711: checking for HPUX/OSF thread support" >&5
4711       if test -f /usr/include/dce/cma_config.h ; then
4712          if test "$GCC" = "yes" ; then
4713             echo "$ac_t""yes" 1>&6
4714             cat >> confdefs.h <<\EOF
4715 #define HAVE_HPUX_THREAD_SUPPORT 1
4716 EOF
4717
4718             CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
4719             CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
4720          else
4721             echo "$ac_t""no (suppressed because you are not using GCC)" 1>&6
4722          fi
4723       else
4724          echo "$ac_t""no" 1>&6
4725       fi
4726       ;;
4727    solaris*)
4728       echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
4729 echo "configure:4730: checking for Solaris thread debugging library" >&5
4730       if test -f /usr/lib/libthread_db.so.1 ; then
4731          echo "$ac_t""yes" 1>&6
4732          cat >> confdefs.h <<\EOF
4733 #define HAVE_THREAD_DB_LIB 1
4734 EOF
4735
4736          CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
4737          CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
4738          echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4739 echo "configure:4740: checking for dlopen in -ldl" >&5
4740 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
4741 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4742   echo $ac_n "(cached) $ac_c" 1>&6
4743 else
4744   ac_save_LIBS="$LIBS"
4745 LIBS="-ldl  $LIBS"
4746 cat > conftest.$ac_ext <<EOF
4747 #line 4748 "configure"
4748 #include "confdefs.h"
4749 /* Override any gcc2 internal prototype to avoid an error.  */
4750 /* We use char because int might match the return type of a gcc2
4751     builtin and then its argument prototype would still apply.  */
4752 char dlopen();
4753
4754 int main() {
4755 dlopen()
4756 ; return 0; }
4757 EOF
4758 if { (eval echo configure:4759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4759   rm -rf conftest*
4760   eval "ac_cv_lib_$ac_lib_var=yes"
4761 else
4762   echo "configure: failed program was:" >&5
4763   cat conftest.$ac_ext >&5
4764   rm -rf conftest*
4765   eval "ac_cv_lib_$ac_lib_var=no"
4766 fi
4767 rm -f conftest*
4768 LIBS="$ac_save_LIBS"
4769
4770 fi
4771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4772   echo "$ac_t""yes" 1>&6
4773     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4774     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4775   cat >> confdefs.h <<EOF
4776 #define $ac_tr_lib 1
4777 EOF
4778
4779   LIBS="-ldl $LIBS"
4780
4781 else
4782   echo "$ac_t""no" 1>&6
4783 fi
4784
4785          if test "$GCC" = "yes" ; then
4786             # The GNU linker requires the -export-dynamic option to make
4787             # all symbols visible in the dynamic symbol table.
4788             hold_ldflags=$LDFLAGS
4789             echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
4790 echo "configure:4791: checking for the ld -export-dynamic flag" >&5
4791             LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
4792             cat > conftest.$ac_ext <<EOF
4793 #line 4794 "configure"
4794 #include "confdefs.h"
4795
4796 int main() {
4797 int i;
4798 ; return 0; }
4799 EOF
4800 if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4801   rm -rf conftest*
4802   found=yes
4803 else
4804   echo "configure: failed program was:" >&5
4805   cat conftest.$ac_ext >&5
4806   rm -rf conftest*
4807   found=no
4808 fi
4809 rm -f conftest*
4810             LDFLAGS=$hold_ldflags
4811             echo "$ac_t""$found" 1>&6
4812             if test $found = yes; then
4813                CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
4814             fi
4815          fi
4816          # Sun randomly tweaked the prototypes in <proc_service.h>
4817          # at one point.
4818          echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
4819 echo "configure:4820: checking if <proc_service.h> is old" >&5
4820          if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
4821   echo $ac_n "(cached) $ac_c" 1>&6
4822 else
4823   
4824             cat > conftest.$ac_ext <<EOF
4825 #line 4826 "configure"
4826 #include "confdefs.h"
4827
4828                 #include <proc_service.h>
4829                 ps_err_e ps_pdwrite
4830                     (struct ps_prochandle*, psaddr_t, const void*, size_t);
4831             
4832 int main() {
4833
4834 ; return 0; }
4835 EOF
4836 if { (eval echo configure:4837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4837   rm -rf conftest*
4838   gdb_cv_proc_service_is_old=no
4839 else
4840   echo "configure: failed program was:" >&5
4841   cat conftest.$ac_ext >&5
4842   rm -rf conftest*
4843   gdb_cv_proc_service_is_old=yes
4844 fi
4845 rm -f conftest*
4846          
4847 fi
4848
4849          echo "$ac_t""$gdb_cv_proc_service_is_old" 1>&6
4850          if test $gdb_cv_proc_service_is_old = yes; then
4851             cat >> confdefs.h <<\EOF
4852 #define PROC_SERVICE_IS_OLD 1
4853 EOF
4854
4855          fi
4856       else
4857          echo "$ac_t""no" 1>&6
4858       fi
4859       ;;
4860    esac
4861    
4862 fi
4863
4864 ENABLE_CFLAGS=
4865
4866 # Check whether --enable-tui or --disable-tui was given.
4867 if test "${enable_tui+set}" = set; then
4868   enableval="$enable_tui"
4869   
4870   case "${enable_tui}" in
4871     yes | no) ;;
4872     "")  enable_tui=yes ;;
4873     *)
4874       { echo "configure: error: Bad value for --enable-tui: ${enableval}" 1>&2; exit 1; }
4875     ;;
4876   esac
4877
4878 fi
4879
4880 case ${enable_tui} in
4881   "yes" )
4882     cat >> confdefs.h <<\EOF
4883 #define TUI 1
4884 EOF
4885
4886     BUILD_TUI=all-tui
4887     TUI_LIBRARY=tui/libtui.a
4888   ;;
4889   * )
4890     BUILD_TUI=
4891     TUI_LIBRARY=
4892   ;;
4893 esac
4894
4895
4896
4897 # Check whether --enable-netrom or --disable-netrom was given.
4898 if test "${enable_netrom+set}" = set; then
4899   enableval="$enable_netrom"
4900   case "${enableval}" in
4901 yes)    enable_netrom=yes ;;
4902 no)     enable_netrom=no ;;
4903 *)      { echo "configure: error: bad value ${enableval} given for netrom option" 1>&2; exit 1; } ;;
4904 esac
4905 fi
4906
4907
4908 if test "${enable_netrom}" = "yes"; then
4909         CONFIG_OBS="${CONFIG_OBS} remote-nrom.o" 
4910         CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
4911 fi
4912
4913 # Check whether --enable-build-warnings or --disable-build-warnings was given.
4914 if test "${enable_build_warnings+set}" = set; then
4915   enableval="$enable_build_warnings"
4916   build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
4917 case "${enableval}" in
4918   yes)  ;;
4919   no)   build_warnings="-w";;
4920   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
4921         build_warnings="${build_warnings} ${t}";;
4922   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
4923         build_warnings="${t} ${build_warnings}";;
4924   *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
4925 esac
4926 else
4927   build_warnings=""
4928 fi
4929
4930 if test "x${build_warnings}" != x -a "x$GCC" = xyes
4931 then
4932    WARN_CFLAGS="${build_warnings}"
4933 else
4934    WARN_CFLAGS=""
4935 fi
4936
4937
4938 MMALLOC_CFLAGS=
4939 MMALLOC=
4940
4941
4942
4943 # Check whether --with-mmalloc or --without-mmalloc was given.
4944 if test "${with_mmalloc+set}" = set; then
4945   withval="$with_mmalloc"
4946   case "${withval}" in
4947   yes)  want_mmalloc=true ;;
4948   no)   want_mmalloc=false;;
4949   *)    { echo "configure: error: bad value ${withval} for GDB with-mmalloc option" 1>&2; exit 1; } ;;
4950 esac
4951 else
4952   want_mmalloc=false
4953 fi
4954
4955 if test x$want_mmalloc = xtrue; then
4956    cat >> confdefs.h <<\EOF
4957 #define USE_MMALLOC 1
4958 EOF
4959
4960    cat >> confdefs.h <<\EOF
4961 #define MMCHECK_FORCE 1
4962 EOF
4963
4964    MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
4965    MMALLOC='../mmalloc/libmmalloc.a'
4966 fi
4967
4968 if test x$gdb_cv_os_cygwin = xyes; then
4969   TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
4970 else
4971   TERM_LIB=
4972   echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4973 echo "configure:4974: checking for tgetent in -lncurses" >&5
4974 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4975 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4976   echo $ac_n "(cached) $ac_c" 1>&6
4977 else
4978   ac_save_LIBS="$LIBS"
4979 LIBS="-lncurses  $LIBS"
4980 cat > conftest.$ac_ext <<EOF
4981 #line 4982 "configure"
4982 #include "confdefs.h"
4983 /* Override any gcc2 internal prototype to avoid an error.  */
4984 /* We use char because int might match the return type of a gcc2
4985     builtin and then its argument prototype would still apply.  */
4986 char tgetent();
4987
4988 int main() {
4989 tgetent()
4990 ; return 0; }
4991 EOF
4992 if { (eval echo configure:4993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4993   rm -rf conftest*
4994   eval "ac_cv_lib_$ac_lib_var=yes"
4995 else
4996   echo "configure: failed program was:" >&5
4997   cat conftest.$ac_ext >&5
4998   rm -rf conftest*
4999   eval "ac_cv_lib_$ac_lib_var=no"
5000 fi
5001 rm -f conftest*
5002 LIBS="$ac_save_LIBS"
5003
5004 fi
5005 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5006   echo "$ac_t""yes" 1>&6
5007   TERM_LIB=-lncurses
5008 else
5009   echo "$ac_t""no" 1>&6
5010 echo $ac_n "checking for tgetent in -lHcurses""... $ac_c" 1>&6
5011 echo "configure:5012: checking for tgetent in -lHcurses" >&5
5012 ac_lib_var=`echo Hcurses'_'tgetent | sed 'y%./+-%__p_%'`
5013 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5014   echo $ac_n "(cached) $ac_c" 1>&6
5015 else
5016   ac_save_LIBS="$LIBS"
5017 LIBS="-lHcurses  $LIBS"
5018 cat > conftest.$ac_ext <<EOF
5019 #line 5020 "configure"
5020 #include "confdefs.h"
5021 /* Override any gcc2 internal prototype to avoid an error.  */
5022 /* We use char because int might match the return type of a gcc2
5023     builtin and then its argument prototype would still apply.  */
5024 char tgetent();
5025
5026 int main() {
5027 tgetent()
5028 ; return 0; }
5029 EOF
5030 if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5031   rm -rf conftest*
5032   eval "ac_cv_lib_$ac_lib_var=yes"
5033 else
5034   echo "configure: failed program was:" >&5
5035   cat conftest.$ac_ext >&5
5036   rm -rf conftest*
5037   eval "ac_cv_lib_$ac_lib_var=no"
5038 fi
5039 rm -f conftest*
5040 LIBS="$ac_save_LIBS"
5041
5042 fi
5043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5044   echo "$ac_t""yes" 1>&6
5045   TERM_LIB=-lHcurses
5046 else
5047   echo "$ac_t""no" 1>&6
5048 echo $ac_n "checking for tgetent in -ltermlib""... $ac_c" 1>&6
5049 echo "configure:5050: checking for tgetent in -ltermlib" >&5
5050 ac_lib_var=`echo termlib'_'tgetent | sed 'y%./+-%__p_%'`
5051 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5052   echo $ac_n "(cached) $ac_c" 1>&6
5053 else
5054   ac_save_LIBS="$LIBS"
5055 LIBS="-ltermlib  $LIBS"
5056 cat > conftest.$ac_ext <<EOF
5057 #line 5058 "configure"
5058 #include "confdefs.h"
5059 /* Override any gcc2 internal prototype to avoid an error.  */
5060 /* We use char because int might match the return type of a gcc2
5061     builtin and then its argument prototype would still apply.  */
5062 char tgetent();
5063
5064 int main() {
5065 tgetent()
5066 ; return 0; }
5067 EOF
5068 if { (eval echo configure:5069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5069   rm -rf conftest*
5070   eval "ac_cv_lib_$ac_lib_var=yes"
5071 else
5072   echo "configure: failed program was:" >&5
5073   cat conftest.$ac_ext >&5
5074   rm -rf conftest*
5075   eval "ac_cv_lib_$ac_lib_var=no"
5076 fi
5077 rm -f conftest*
5078 LIBS="$ac_save_LIBS"
5079
5080 fi
5081 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5082   echo "$ac_t""yes" 1>&6
5083   TERM_LIB=-ltermlib
5084 else
5085   echo "$ac_t""no" 1>&6
5086 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
5087 echo "configure:5088: checking for tgetent in -ltermcap" >&5
5088 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
5089 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5090   echo $ac_n "(cached) $ac_c" 1>&6
5091 else
5092   ac_save_LIBS="$LIBS"
5093 LIBS="-ltermcap  $LIBS"
5094 cat > conftest.$ac_ext <<EOF
5095 #line 5096 "configure"
5096 #include "confdefs.h"
5097 /* Override any gcc2 internal prototype to avoid an error.  */
5098 /* We use char because int might match the return type of a gcc2
5099     builtin and then its argument prototype would still apply.  */
5100 char tgetent();
5101
5102 int main() {
5103 tgetent()
5104 ; return 0; }
5105 EOF
5106 if { (eval echo configure:5107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5107   rm -rf conftest*
5108   eval "ac_cv_lib_$ac_lib_var=yes"
5109 else
5110   echo "configure: failed program was:" >&5
5111   cat conftest.$ac_ext >&5
5112   rm -rf conftest*
5113   eval "ac_cv_lib_$ac_lib_var=no"
5114 fi
5115 rm -f conftest*
5116 LIBS="$ac_save_LIBS"
5117
5118 fi
5119 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5120   echo "$ac_t""yes" 1>&6
5121   TERM_LIB=-ltermcap
5122 else
5123   echo "$ac_t""no" 1>&6
5124 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
5125 echo "configure:5126: checking for tgetent in -lcurses" >&5
5126 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
5127 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5128   echo $ac_n "(cached) $ac_c" 1>&6
5129 else
5130   ac_save_LIBS="$LIBS"
5131 LIBS="-lcurses  $LIBS"
5132 cat > conftest.$ac_ext <<EOF
5133 #line 5134 "configure"
5134 #include "confdefs.h"
5135 /* Override any gcc2 internal prototype to avoid an error.  */
5136 /* We use char because int might match the return type of a gcc2
5137     builtin and then its argument prototype would still apply.  */
5138 char tgetent();
5139
5140 int main() {
5141 tgetent()
5142 ; return 0; }
5143 EOF
5144 if { (eval echo configure:5145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5145   rm -rf conftest*
5146   eval "ac_cv_lib_$ac_lib_var=yes"
5147 else
5148   echo "configure: failed program was:" >&5
5149   cat conftest.$ac_ext >&5
5150   rm -rf conftest*
5151   eval "ac_cv_lib_$ac_lib_var=no"
5152 fi
5153 rm -f conftest*
5154 LIBS="$ac_save_LIBS"
5155
5156 fi
5157 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5158   echo "$ac_t""yes" 1>&6
5159   TERM_LIB=-lcurses
5160 else
5161   echo "$ac_t""no" 1>&6
5162 echo $ac_n "checking for tgetent in -lterminfo""... $ac_c" 1>&6
5163 echo "configure:5164: checking for tgetent in -lterminfo" >&5
5164 ac_lib_var=`echo terminfo'_'tgetent | sed 'y%./+-%__p_%'`
5165 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5166   echo $ac_n "(cached) $ac_c" 1>&6
5167 else
5168   ac_save_LIBS="$LIBS"
5169 LIBS="-lterminfo  $LIBS"
5170 cat > conftest.$ac_ext <<EOF
5171 #line 5172 "configure"
5172 #include "confdefs.h"
5173 /* Override any gcc2 internal prototype to avoid an error.  */
5174 /* We use char because int might match the return type of a gcc2
5175     builtin and then its argument prototype would still apply.  */
5176 char tgetent();
5177
5178 int main() {
5179 tgetent()
5180 ; return 0; }
5181 EOF
5182 if { (eval echo configure:5183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5183   rm -rf conftest*
5184   eval "ac_cv_lib_$ac_lib_var=yes"
5185 else
5186   echo "configure: failed program was:" >&5
5187   cat conftest.$ac_ext >&5
5188   rm -rf conftest*
5189   eval "ac_cv_lib_$ac_lib_var=no"
5190 fi
5191 rm -f conftest*
5192 LIBS="$ac_save_LIBS"
5193
5194 fi
5195 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5196   echo "$ac_t""yes" 1>&6
5197   TERM_LIB=-lterminfo
5198 else
5199   echo "$ac_t""no" 1>&6
5200 fi
5201
5202 fi
5203
5204 fi
5205
5206 fi
5207
5208 fi
5209
5210 fi
5211
5212
5213   if test "x$TERM_LIB" = x
5214   then
5215     { echo "configure: error: Could not find a term library" 1>&2; exit 1; }
5216   fi
5217 fi
5218
5219
5220
5221 # If we find X, set shell vars x_includes and x_libraries to the
5222 # paths, otherwise set no_x=yes.
5223 # Uses ac_ vars as temps to allow command line to override cache and checks.
5224 # --without-x overrides everything else, but does not touch the cache.
5225 echo $ac_n "checking for X""... $ac_c" 1>&6
5226 echo "configure:5227: checking for X" >&5
5227
5228 # Check whether --with-x or --without-x was given.
5229 if test "${with_x+set}" = set; then
5230   withval="$with_x"
5231   :
5232 fi
5233
5234 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
5235 if test "x$with_x" = xno; then
5236   # The user explicitly disabled X.
5237   have_x=disabled
5238 else
5239   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
5240     # Both variables are already set.
5241     have_x=yes
5242   else
5243 if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
5244   echo $ac_n "(cached) $ac_c" 1>&6
5245 else
5246   # One or both of the vars are not set, and there is no cached value.
5247 ac_x_includes=NO ac_x_libraries=NO
5248 rm -fr conftestdir
5249 if mkdir conftestdir; then
5250   cd conftestdir
5251   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
5252   cat > Imakefile <<'EOF'
5253 acfindx:
5254         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
5255 EOF
5256   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5257     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
5258     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
5259     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
5260     for ac_extension in a so sl; do
5261       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
5262         test -f $ac_im_libdir/libX11.$ac_extension; then
5263         ac_im_usrlibdir=$ac_im_libdir; break
5264       fi
5265     done
5266     # Screen out bogus values from the imake configuration.  They are
5267     # bogus both because they are the default anyway, and because
5268     # using them would break gcc on systems where it needs fixed includes.
5269     case "$ac_im_incroot" in
5270         /usr/include) ;;
5271         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
5272     esac
5273     case "$ac_im_usrlibdir" in
5274         /usr/lib | /lib) ;;
5275         *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
5276     esac
5277   fi
5278   cd ..
5279   rm -fr conftestdir
5280 fi
5281
5282 if test "$ac_x_includes" = NO; then
5283   # Guess where to find include files, by looking for this one X11 .h file.
5284   test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
5285
5286   # First, try using that file with no special directory specified.
5287 cat > conftest.$ac_ext <<EOF
5288 #line 5289 "configure"
5289 #include "confdefs.h"
5290 #include <$x_direct_test_include>
5291 EOF
5292 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5293 { (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5294 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5295 if test -z "$ac_err"; then
5296   rm -rf conftest*
5297   # We can compile using X headers with no special include directory.
5298 ac_x_includes=
5299 else
5300   echo "$ac_err" >&5
5301   echo "configure: failed program was:" >&5
5302   cat conftest.$ac_ext >&5
5303   rm -rf conftest*
5304   # Look for the header file in a standard set of common directories.
5305 # Check X11 before X11Rn because it is often a symlink to the current release.
5306   for ac_dir in               \
5307     /usr/X11/include          \
5308     /usr/X11R6/include        \
5309     /usr/X11R5/include        \
5310     /usr/X11R4/include        \
5311                               \
5312     /usr/include/X11          \
5313     /usr/include/X11R6        \
5314     /usr/include/X11R5        \
5315     /usr/include/X11R4        \
5316                               \
5317     /usr/local/X11/include    \
5318     /usr/local/X11R6/include  \
5319     /usr/local/X11R5/include  \
5320     /usr/local/X11R4/include  \
5321                               \
5322     /usr/local/include/X11    \
5323     /usr/local/include/X11R6  \
5324     /usr/local/include/X11R5  \
5325     /usr/local/include/X11R4  \
5326                               \
5327     /usr/X386/include         \
5328     /usr/x386/include         \
5329     /usr/XFree86/include/X11  \
5330                               \
5331     /usr/include              \
5332     /usr/local/include        \
5333     /usr/unsupported/include  \
5334     /usr/athena/include       \
5335     /usr/local/x11r5/include  \
5336     /usr/lpp/Xamples/include  \
5337                               \
5338     /usr/openwin/include      \
5339     /usr/openwin/share/include \
5340     ; \
5341   do
5342     if test -r "$ac_dir/$x_direct_test_include"; then
5343       ac_x_includes=$ac_dir
5344       break
5345     fi
5346   done
5347 fi
5348 rm -f conftest*
5349 fi # $ac_x_includes = NO
5350
5351 if test "$ac_x_libraries" = NO; then
5352   # Check for the libraries.
5353
5354   test -z "$x_direct_test_library" && x_direct_test_library=Xt
5355   test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
5356
5357   # See if we find them without any special options.
5358   # Don't add to $LIBS permanently.
5359   ac_save_LIBS="$LIBS"
5360   LIBS="-l$x_direct_test_library $LIBS"
5361 cat > conftest.$ac_ext <<EOF
5362 #line 5363 "configure"
5363 #include "confdefs.h"
5364
5365 int main() {
5366 ${x_direct_test_function}()
5367 ; return 0; }
5368 EOF
5369 if { (eval echo configure:5370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5370   rm -rf conftest*
5371   LIBS="$ac_save_LIBS"
5372 # We can link X programs with no special library path.
5373 ac_x_libraries=
5374 else
5375   echo "configure: failed program was:" >&5
5376   cat conftest.$ac_ext >&5
5377   rm -rf conftest*
5378   LIBS="$ac_save_LIBS"
5379 # First see if replacing the include by lib works.
5380 # Check X11 before X11Rn because it is often a symlink to the current release.
5381 for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
5382     /usr/X11/lib          \
5383     /usr/X11R6/lib        \
5384     /usr/X11R5/lib        \
5385     /usr/X11R4/lib        \
5386                           \
5387     /usr/lib/X11          \
5388     /usr/lib/X11R6        \
5389     /usr/lib/X11R5        \
5390     /usr/lib/X11R4        \
5391                           \
5392     /usr/local/X11/lib    \
5393     /usr/local/X11R6/lib  \
5394     /usr/local/X11R5/lib  \
5395     /usr/local/X11R4/lib  \
5396                           \
5397     /usr/local/lib/X11    \
5398     /usr/local/lib/X11R6  \
5399     /usr/local/lib/X11R5  \
5400     /usr/local/lib/X11R4  \
5401                           \
5402     /usr/X386/lib         \
5403     /usr/x386/lib         \
5404     /usr/XFree86/lib/X11  \
5405                           \
5406     /usr/lib              \
5407     /usr/local/lib        \
5408     /usr/unsupported/lib  \
5409     /usr/athena/lib       \
5410     /usr/local/x11r5/lib  \
5411     /usr/lpp/Xamples/lib  \
5412     /lib/usr/lib/X11      \
5413                           \
5414     /usr/openwin/lib      \
5415     /usr/openwin/share/lib \
5416     ; \
5417 do
5418   for ac_extension in a so sl; do
5419     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
5420       ac_x_libraries=$ac_dir
5421       break 2
5422     fi
5423   done
5424 done
5425 fi
5426 rm -f conftest*
5427 fi # $ac_x_libraries = NO
5428
5429 if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
5430   # Didn't find X anywhere.  Cache the known absence of X.
5431   ac_cv_have_x="have_x=no"
5432 else
5433   # Record where we found X for the cache.
5434   ac_cv_have_x="have_x=yes \
5435                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5436 fi
5437 fi
5438   fi
5439   eval "$ac_cv_have_x"
5440 fi # $with_x != no
5441
5442 if test "$have_x" != yes; then
5443   echo "$ac_t""$have_x" 1>&6
5444   no_x=yes
5445 else
5446   # If each of the values was on the command line, it overrides each guess.
5447   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
5448   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
5449   # Update the cache value to reflect the command line values.
5450   ac_cv_have_x="have_x=yes \
5451                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5452   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
5453 fi
5454
5455
5456
5457
5458
5459
5460
5461
5462 # Begin stuff to support --enable-shared
5463 # Check whether --enable-shared or --disable-shared was given.
5464 if test "${enable_shared+set}" = set; then
5465   enableval="$enable_shared"
5466   case "${enableval}" in
5467   yes) shared=true ;;
5468   no)  shared=false ;;
5469   *) shared=true ;;
5470 esac
5471 fi
5472
5473 HLDFLAGS=
5474 HLDENV=
5475 # If we have shared libraries, try to set rpath reasonably.
5476 if test "${shared}" = "true"; then
5477   case "${host}" in
5478   *-*-hpux*)
5479     HLDFLAGS='-Wl,+s,+b,$(libdir)'
5480     ;;
5481   *-*-irix5* | *-*-irix6*)
5482     HLDFLAGS='-Wl,-rpath,$(libdir)'
5483     ;;
5484   *-*-linux*aout*)
5485     ;;
5486   *-*-linux* | *-pc-linux-gnu)
5487     HLDFLAGS='-Wl,-rpath,$(libdir)'
5488     ;;
5489   *-*-solaris*)
5490     HLDFLAGS='-R $(libdir)'
5491     ;;
5492   *-*-sysv4*)
5493     HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
5494     ;;
5495   esac
5496 fi
5497
5498 # On SunOS, if the linker supports the -rpath option, use it to
5499 # prevent ../bfd and ../opcodes from being included in the run time
5500 # search path.
5501 case "${host}" in
5502   *-*-sunos*)
5503     echo 'main () { }' > conftest.c
5504     ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
5505     if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
5506       :
5507     elif grep 'No such file' conftest.t >/dev/null 2>&1; then
5508       :
5509     elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
5510       :
5511     elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
5512       :
5513     elif test "${shared}" = "true"; then
5514       HLDFLAGS='-Wl,-rpath=$(libdir)'
5515     else
5516       HLDFLAGS='-Wl,-rpath='
5517     fi
5518     rm -f conftest.t conftest.c conftest
5519     ;;
5520 esac
5521
5522
5523 # End stuff to support --enable-shared
5524
5525 # target_subdir is used by the testsuite to find the target libraries.
5526 target_subdir=
5527 if test "${host}" != "${target}"; then
5528     target_subdir="${target_alias}/"
5529 fi
5530
5531
5532 frags=
5533 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
5534 if test ! -f ${host_makefile_frag}; then
5535 { echo "configure: error: "*** Gdb does not support host ${host}"" 1>&2; exit 1; }
5536 fi
5537 frags="$frags $host_makefile_frag"
5538
5539 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
5540 if test ! -f ${target_makefile_frag}; then
5541 { echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; }
5542 fi
5543 frags="$frags $target_makefile_frag"
5544
5545
5546
5547
5548
5549 hostfile=`sed -n '
5550 s/XM_FILE[      ]*=[    ]*\([^  ]*\)/\1/p
5551 ' ${host_makefile_frag}`
5552
5553 targetfile=`sed -n '
5554 s/TM_FILE[      ]*=[    ]*\([^  ]*\)/\1/p
5555 ' ${target_makefile_frag}`
5556
5557 # these really aren't orthogonal true/false values of the same condition,
5558 # but shells are slow enough that I like to reuse the test conditions
5559 # whenever possible
5560 if test "${target}" = "${host}"; then
5561 nativefile=`sed -n '
5562 s/NAT_FILE[     ]*=[    ]*\([^  ]*\)/\1/p
5563 ' ${host_makefile_frag}`
5564 # else
5565 # GDBserver is only useful in a "native" enviroment
5566 # configdirs=`echo $configdirs | sed 's/gdbserver//'`
5567 fi
5568
5569
5570 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
5571 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
5572 # corresponding links.  But we have to remove the xm.h files and tm.h
5573 # files anyway, e.g. when switching from "configure host" to
5574 # "configure none".
5575
5576 files=
5577 links=
5578 rm -f xm.h
5579 if test "${hostfile}" != ""; then
5580 files="${files} config/${gdb_host_cpu}/${hostfile}"
5581 links="${links} xm.h"
5582 fi
5583 rm -f tm.h
5584 if test "${targetfile}" != ""; then
5585 files="${files} config/${gdb_target_cpu}/${targetfile}"
5586 links="${links} tm.h"
5587 fi
5588 rm -f nm.h
5589 if test "${nativefile}" != ""; then
5590 files="${files} config/${gdb_host_cpu}/${nativefile}"
5591 links="${links} nm.h"
5592 else
5593 # A cross-only configuration.
5594 files="${files} config/nm-empty.h"
5595 links="${links} nm.h"
5596 fi
5597
5598
5599
5600 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
5601 echo "configure:5602: checking for Cygwin environment" >&5
5602 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
5603   echo $ac_n "(cached) $ac_c" 1>&6
5604 else
5605   cat > conftest.$ac_ext <<EOF
5606 #line 5607 "configure"
5607 #include "confdefs.h"
5608
5609 int main() {
5610
5611 #ifndef __CYGWIN__
5612 #define __CYGWIN__ __CYGWIN32__
5613 #endif
5614 return __CYGWIN__;
5615 ; return 0; }
5616 EOF
5617 if { (eval echo configure:5618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5618   rm -rf conftest*
5619   ac_cv_cygwin=yes
5620 else
5621   echo "configure: failed program was:" >&5
5622   cat conftest.$ac_ext >&5
5623   rm -rf conftest*
5624   ac_cv_cygwin=no
5625 fi
5626 rm -f conftest*
5627 rm -f conftest*
5628 fi
5629
5630 echo "$ac_t""$ac_cv_cygwin" 1>&6
5631 CYGWIN=
5632 test "$ac_cv_cygwin" = yes && CYGWIN=yes
5633 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
5634 echo "configure:5635: checking for mingw32 environment" >&5
5635 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
5636   echo $ac_n "(cached) $ac_c" 1>&6
5637 else
5638   cat > conftest.$ac_ext <<EOF
5639 #line 5640 "configure"
5640 #include "confdefs.h"
5641
5642 int main() {
5643 return __MINGW32__;
5644 ; return 0; }
5645 EOF
5646 if { (eval echo configure:5647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5647   rm -rf conftest*
5648   ac_cv_mingw32=yes
5649 else
5650   echo "configure: failed program was:" >&5
5651   cat conftest.$ac_ext >&5
5652   rm -rf conftest*
5653   ac_cv_mingw32=no
5654 fi
5655 rm -f conftest*
5656 rm -f conftest*
5657 fi
5658
5659 echo "$ac_t""$ac_cv_mingw32" 1>&6
5660 MINGW32=
5661 test "$ac_cv_mingw32" = yes && MINGW32=yes
5662
5663
5664 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
5665 echo "configure:5666: checking for executable suffix" >&5
5666 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
5667   echo $ac_n "(cached) $ac_c" 1>&6
5668 else
5669   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
5670   ac_cv_exeext=.exe
5671 else
5672   rm -f conftest*
5673   echo 'int main () { return 0; }' > conftest.$ac_ext
5674   ac_cv_exeext=
5675   if { (eval echo configure:5676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5676     for file in conftest.*; do
5677       case $file in
5678       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
5679       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
5680       esac
5681     done
5682   else
5683     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
5684   fi
5685   rm -f conftest*
5686   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
5687 fi
5688 fi
5689
5690 EXEEXT=""
5691 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
5692 echo "$ac_t""${ac_cv_exeext}" 1>&6
5693 ac_exeext=$EXEEXT
5694
5695
5696 subdirs="$configdirs"
5697
5698 trap '' 1 2 15
5699 cat > confcache <<\EOF
5700 # This file is a shell script that caches the results of configure
5701 # tests run on this system so they can be shared between configure
5702 # scripts and configure runs.  It is not useful on other systems.
5703 # If it contains results you don't want to keep, you may remove or edit it.
5704 #
5705 # By default, configure uses ./config.cache as the cache file,
5706 # creating it if it does not exist already.  You can give configure
5707 # the --cache-file=FILE option to use a different cache file; that is
5708 # what configure does when it calls configure scripts in
5709 # subdirectories, so they share the cache.
5710 # Giving --cache-file=/dev/null disables caching, for debugging configure.
5711 # config.status only pays attention to the cache file if you give it the
5712 # --recheck option to rerun configure.
5713 #
5714 EOF
5715 # The following way of writing the cache mishandles newlines in values,
5716 # but we know of no workaround that is simple, portable, and efficient.
5717 # So, don't put newlines in cache variables' values.
5718 # Ultrix sh set writes to stderr and can't be redirected directly,
5719 # and sets the high bit in the cache file unless we assign to the vars.
5720 (set) 2>&1 |
5721   case `(ac_space=' '; set | grep ac_space) 2>&1` in
5722   *ac_space=\ *)
5723     # `set' does not quote correctly, so add quotes (double-quote substitution
5724     # turns \\\\ into \\, and sed turns \\ into \).
5725     sed -n \
5726       -e "s/'/'\\\\''/g" \
5727       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
5728     ;;
5729   *)
5730     # `set' quotes correctly as required by POSIX, so do not add quotes.
5731     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
5732     ;;
5733   esac >> confcache
5734 if cmp -s $cache_file confcache; then
5735   :
5736 else
5737   if test -w $cache_file; then
5738     echo "updating cache $cache_file"
5739     cat confcache > $cache_file
5740   else
5741     echo "not updating unwritable cache $cache_file"
5742   fi
5743 fi
5744 rm -f confcache
5745
5746 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
5747
5748 test "x$prefix" = xNONE && prefix=$ac_default_prefix
5749 # Let make expand exec_prefix.
5750 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5751
5752 # Any assignment to VPATH causes Sun make to only execute
5753 # the first set of double-colon rules, so remove it if not needed.
5754 # If there is a colon in the path, we need to keep it.
5755 if test "x$srcdir" = x.; then
5756   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
5757 fi
5758
5759 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
5760
5761 DEFS=-DHAVE_CONFIG_H
5762
5763 # Without the "./", some shells look in PATH for config.status.
5764 : ${CONFIG_STATUS=./config.status}
5765
5766 echo creating $CONFIG_STATUS
5767 rm -f $CONFIG_STATUS
5768 cat > $CONFIG_STATUS <<EOF
5769 #! /bin/sh
5770 # Generated automatically by configure.
5771 # Run this file to recreate the current configuration.
5772 # This directory was configured as follows,
5773 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
5774 #
5775 # $0 $ac_configure_args
5776 #
5777 # Compiler output produced by configure, useful for debugging
5778 # configure, is in ./config.log if it exists.
5779
5780 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
5781 for ac_option
5782 do
5783   case "\$ac_option" in
5784   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
5785     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
5786     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
5787   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
5788     echo "$CONFIG_STATUS generated by autoconf version 2.13"
5789     exit 0 ;;
5790   -help | --help | --hel | --he | --h)
5791     echo "\$ac_cs_usage"; exit 0 ;;
5792   *) echo "\$ac_cs_usage"; exit 1 ;;
5793   esac
5794 done
5795
5796 ac_given_srcdir=$srcdir
5797 ac_given_INSTALL="$INSTALL"
5798
5799 trap 'rm -fr `echo "Makefile tui/Makefile .gdbinit:gdbinit.in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
5800 EOF
5801 cat >> $CONFIG_STATUS <<EOF
5802
5803 # Protect against being on the right side of a sed subst in config.status.
5804 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
5805  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5806 $ac_vpsub
5807 $extrasub
5808 s%@SHELL@%$SHELL%g
5809 s%@CFLAGS@%$CFLAGS%g
5810 s%@CPPFLAGS@%$CPPFLAGS%g
5811 s%@CXXFLAGS@%$CXXFLAGS%g
5812 s%@FFLAGS@%$FFLAGS%g
5813 s%@DEFS@%$DEFS%g
5814 s%@LDFLAGS@%$LDFLAGS%g
5815 s%@LIBS@%$LIBS%g
5816 s%@exec_prefix@%$exec_prefix%g
5817 s%@prefix@%$prefix%g
5818 s%@program_transform_name@%$program_transform_name%g
5819 s%@bindir@%$bindir%g
5820 s%@sbindir@%$sbindir%g
5821 s%@libexecdir@%$libexecdir%g
5822 s%@datadir@%$datadir%g
5823 s%@sysconfdir@%$sysconfdir%g
5824 s%@sharedstatedir@%$sharedstatedir%g
5825 s%@localstatedir@%$localstatedir%g
5826 s%@libdir@%$libdir%g
5827 s%@includedir@%$includedir%g
5828 s%@oldincludedir@%$oldincludedir%g
5829 s%@infodir@%$infodir%g
5830 s%@mandir@%$mandir%g
5831 s%@CC@%$CC%g
5832 s%@CPP@%$CPP%g
5833 s%@host@%$host%g
5834 s%@host_alias@%$host_alias%g
5835 s%@host_cpu@%$host_cpu%g
5836 s%@host_vendor@%$host_vendor%g
5837 s%@host_os@%$host_os%g
5838 s%@target@%$target%g
5839 s%@target_alias@%$target_alias%g
5840 s%@target_cpu@%$target_cpu%g
5841 s%@target_vendor@%$target_vendor%g
5842 s%@target_os@%$target_os%g
5843 s%@build@%$build%g
5844 s%@build_alias@%$build_alias%g
5845 s%@build_cpu@%$build_cpu%g
5846 s%@build_vendor@%$build_vendor%g
5847 s%@build_os@%$build_os%g
5848 s%@SET_MAKE@%$SET_MAKE%g
5849 s%@RANLIB@%$RANLIB%g
5850 s%@ALLOCA@%$ALLOCA%g
5851 s%@USE_NLS@%$USE_NLS%g
5852 s%@MSGFMT@%$MSGFMT%g
5853 s%@GMSGFMT@%$GMSGFMT%g
5854 s%@XGETTEXT@%$XGETTEXT%g
5855 s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
5856 s%@CATALOGS@%$CATALOGS%g
5857 s%@CATOBJEXT@%$CATOBJEXT%g
5858 s%@DATADIRNAME@%$DATADIRNAME%g
5859 s%@GMOFILES@%$GMOFILES%g
5860 s%@INSTOBJEXT@%$INSTOBJEXT%g
5861 s%@INTLDEPS@%$INTLDEPS%g
5862 s%@INTLLIBS@%$INTLLIBS%g
5863 s%@INTLOBJS@%$INTLOBJS%g
5864 s%@POFILES@%$POFILES%g
5865 s%@POSUB@%$POSUB%g
5866 s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
5867 s%@GT_NO@%$GT_NO%g
5868 s%@GT_YES@%$GT_YES%g
5869 s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
5870 s%@l@%$l%g
5871 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
5872 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
5873 s%@INSTALL_DATA@%$INSTALL_DATA%g
5874 s%@AR@%$AR%g
5875 s%@YACC@%$YACC%g
5876 s%@CONFIG_LDFLAGS@%$CONFIG_LDFLAGS%g
5877 s%@BUILD_TUI@%$BUILD_TUI%g
5878 s%@TUI_LIBRARY@%$TUI_LIBRARY%g
5879 s%@WARN_CFLAGS@%$WARN_CFLAGS%g
5880 s%@MMALLOC_CFLAGS@%$MMALLOC_CFLAGS%g
5881 s%@MMALLOC@%$MMALLOC%g
5882 s%@TERM_LIB@%$TERM_LIB%g
5883 s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g
5884 s%@CONFIG_OBS@%$CONFIG_OBS%g
5885 s%@CONFIG_DEPS@%$CONFIG_DEPS%g
5886 s%@CONFIG_SRCS@%$CONFIG_SRCS%g
5887 s%@HLDFLAGS@%$HLDFLAGS%g
5888 s%@HLDENV@%$HLDENV%g
5889 s%@target_subdir@%$target_subdir%g
5890 /@host_makefile_frag@/r $host_makefile_frag
5891 s%@host_makefile_frag@%%g
5892 /@target_makefile_frag@/r $target_makefile_frag
5893 s%@target_makefile_frag@%%g
5894 s%@frags@%$frags%g
5895 s%@EXEEXT@%$EXEEXT%g
5896 s%@subdirs@%$subdirs%g
5897
5898 CEOF
5899 EOF
5900
5901 cat >> $CONFIG_STATUS <<\EOF
5902
5903 # Split the substitutions into bite-sized pieces for seds with
5904 # small command number limits, like on Digital OSF/1 and HP-UX.
5905 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
5906 ac_file=1 # Number of current file.
5907 ac_beg=1 # First line for current file.
5908 ac_end=$ac_max_sed_cmds # Line after last line for current file.
5909 ac_more_lines=:
5910 ac_sed_cmds=""
5911 while $ac_more_lines; do
5912   if test $ac_beg -gt 1; then
5913     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
5914   else
5915     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
5916   fi
5917   if test ! -s conftest.s$ac_file; then
5918     ac_more_lines=false
5919     rm -f conftest.s$ac_file
5920   else
5921     if test -z "$ac_sed_cmds"; then
5922       ac_sed_cmds="sed -f conftest.s$ac_file"
5923     else
5924       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
5925     fi
5926     ac_file=`expr $ac_file + 1`
5927     ac_beg=$ac_end
5928     ac_end=`expr $ac_end + $ac_max_sed_cmds`
5929   fi
5930 done
5931 if test -z "$ac_sed_cmds"; then
5932   ac_sed_cmds=cat
5933 fi
5934 EOF
5935
5936 cat >> $CONFIG_STATUS <<EOF
5937
5938 CONFIG_FILES=\${CONFIG_FILES-"Makefile tui/Makefile .gdbinit:gdbinit.in"}
5939 EOF
5940 cat >> $CONFIG_STATUS <<\EOF
5941 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
5942   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
5943   case "$ac_file" in
5944   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
5945        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5946   *) ac_file_in="${ac_file}.in" ;;
5947   esac
5948
5949   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
5950
5951   # Remove last slash and all that follows it.  Not all systems have dirname.
5952   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
5953   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
5954     # The file is in a subdirectory.
5955     test ! -d "$ac_dir" && mkdir "$ac_dir"
5956     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
5957     # A "../" for each directory in $ac_dir_suffix.
5958     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
5959   else
5960     ac_dir_suffix= ac_dots=
5961   fi
5962
5963   case "$ac_given_srcdir" in
5964   .)  srcdir=.
5965       if test -z "$ac_dots"; then top_srcdir=.
5966       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
5967   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
5968   *) # Relative path.
5969     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
5970     top_srcdir="$ac_dots$ac_given_srcdir" ;;
5971   esac
5972
5973   case "$ac_given_INSTALL" in
5974   [/$]*) INSTALL="$ac_given_INSTALL" ;;
5975   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
5976   esac
5977
5978   echo creating "$ac_file"
5979   rm -f "$ac_file"
5980   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
5981   case "$ac_file" in
5982   *Makefile*) ac_comsub="1i\\
5983 # $configure_input" ;;
5984   *) ac_comsub= ;;
5985   esac
5986
5987   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
5988   sed -e "$ac_comsub
5989 s%@configure_input@%$configure_input%g
5990 s%@srcdir@%$srcdir%g
5991 s%@top_srcdir@%$top_srcdir%g
5992 s%@INSTALL@%$INSTALL%g
5993 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
5994 fi; done
5995 rm -f conftest.s*
5996
5997 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
5998 # NAME is the cpp macro being defined and VALUE is the value it is being given.
5999 #
6000 # ac_d sets the value in "#define NAME VALUE" lines.
6001 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
6002 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
6003 ac_dC='\3'
6004 ac_dD='%g'
6005 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
6006 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6007 ac_uB='\([      ]\)%\1#\2define\3'
6008 ac_uC=' '
6009 ac_uD='\4%g'
6010 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
6011 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
6012 ac_eB='$%\1#\2define\3'
6013 ac_eC=' '
6014 ac_eD='%g'
6015
6016 if test "${CONFIG_HEADERS+set}" != set; then
6017 EOF
6018 cat >> $CONFIG_STATUS <<EOF
6019   CONFIG_HEADERS="config.h:config.in"
6020 EOF
6021 cat >> $CONFIG_STATUS <<\EOF
6022 fi
6023 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
6024   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
6025   case "$ac_file" in
6026   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
6027        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6028   *) ac_file_in="${ac_file}.in" ;;
6029   esac
6030
6031   echo creating $ac_file
6032
6033   rm -f conftest.frag conftest.in conftest.out
6034   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
6035   cat $ac_file_inputs > conftest.in
6036
6037 EOF
6038
6039 # Transform confdefs.h into a sed script conftest.vals that substitutes
6040 # the proper values into config.h.in to produce config.h.  And first:
6041 # Protect against being on the right side of a sed subst in config.status.
6042 # Protect against being in an unquoted here document in config.status.
6043 rm -f conftest.vals
6044 cat > conftest.hdr <<\EOF
6045 s/[\\&%]/\\&/g
6046 s%[\\$`]%\\&%g
6047 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
6048 s%ac_d%ac_u%gp
6049 s%ac_u%ac_e%gp
6050 EOF
6051 sed -n -f conftest.hdr confdefs.h > conftest.vals
6052 rm -f conftest.hdr
6053
6054 # This sed command replaces #undef with comments.  This is necessary, for
6055 # example, in the case of _POSIX_SOURCE, which is predefined and required
6056 # on some systems where configure will not decide to define it.
6057 cat >> conftest.vals <<\EOF
6058 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
6059 EOF
6060
6061 # Break up conftest.vals because some shells have a limit on
6062 # the size of here documents, and old seds have small limits too.
6063
6064 rm -f conftest.tail
6065 while :
6066 do
6067   ac_lines=`grep -c . conftest.vals`
6068   # grep -c gives empty output for an empty file on some AIX systems.
6069   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
6070   # Write a limited-size here document to conftest.frag.
6071   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
6072   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
6073   echo 'CEOF
6074   sed -f conftest.frag conftest.in > conftest.out
6075   rm -f conftest.in
6076   mv conftest.out conftest.in
6077 ' >> $CONFIG_STATUS
6078   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
6079   rm -f conftest.vals
6080   mv conftest.tail conftest.vals
6081 done
6082 rm -f conftest.vals
6083
6084 cat >> $CONFIG_STATUS <<\EOF
6085   rm -f conftest.frag conftest.h
6086   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
6087   cat conftest.in >> conftest.h
6088   rm -f conftest.in
6089   if cmp -s $ac_file conftest.h 2>/dev/null; then
6090     echo "$ac_file is unchanged"
6091     rm -f conftest.h
6092   else
6093     # Remove last slash and all that follows it.  Not all systems have dirname.
6094       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
6095       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
6096       # The file is in a subdirectory.
6097       test ! -d "$ac_dir" && mkdir "$ac_dir"
6098     fi
6099     rm -f $ac_file
6100     mv conftest.h $ac_file
6101   fi
6102 fi; done
6103
6104 EOF
6105
6106 cat >> $CONFIG_STATUS <<EOF
6107 ac_sources="$files"
6108 ac_dests="$links"
6109 EOF
6110
6111 cat >> $CONFIG_STATUS <<\EOF
6112 srcdir=$ac_given_srcdir
6113 while test -n "$ac_sources"; do
6114   set $ac_dests; ac_dest=$1; shift; ac_dests=$*
6115   set $ac_sources; ac_source=$1; shift; ac_sources=$*
6116
6117   echo "linking $srcdir/$ac_source to $ac_dest"
6118
6119   if test ! -r $srcdir/$ac_source; then
6120     { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
6121   fi
6122   rm -f $ac_dest
6123
6124   # Make relative symlinks.
6125   # Remove last slash and all that follows it.  Not all systems have dirname.
6126   ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
6127   if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
6128     # The dest file is in a subdirectory.
6129     test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
6130     ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
6131     # A "../" for each directory in $ac_dest_dir_suffix.
6132     ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
6133   else
6134     ac_dest_dir_suffix= ac_dots=
6135   fi
6136
6137   case "$srcdir" in
6138   [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
6139   *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
6140   esac
6141
6142   # Make a symlink if possible; otherwise try a hard link.
6143   if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
6144     ln $srcdir/$ac_source $ac_dest; then :
6145   else
6146     { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
6147   fi
6148 done
6149 EOF
6150 cat >> $CONFIG_STATUS <<EOF
6151
6152 gdb_host_cpu=$gdb_host_cpu
6153 gdb_target_cpu=$gdb_target_cpu
6154 nativefile=$nativefile
6155
6156 EOF
6157 cat >> $CONFIG_STATUS <<\EOF
6158
6159 if test "${nativefile}" = ""; then
6160 sed -e '/^NATDEPFILES[  ]*=[    ]*/s//# NATDEPFILES=/' \
6161         < Makefile > Makefile.tem
6162 mv -f Makefile.tem Makefile
6163 fi
6164
6165 sed -e '/^TM_FILE[      ]*=/s,^TM_FILE[         ]*=[    ]*,&config/'"${gdb_target_cpu}"'/,
6166 /^XM_FILE[      ]*=/s,^XM_FILE[         ]*=[    ]*,&config/'"${gdb_host_cpu}"'/,
6167 /^NAT_FILE[     ]*=/s,^NAT_FILE[        ]*=[    ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
6168 mv -f Makefile.tmp Makefile
6169
6170 case x$CONFIG_HEADERS in
6171 xconfig.h:config.in)
6172 echo > stamp-h ;;
6173 esac
6174
6175 exit 0
6176 EOF
6177 chmod +x $CONFIG_STATUS
6178 rm -fr confdefs* $ac_clean_files
6179 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
6180
6181 if test "$no_recursion" != yes; then
6182
6183   # Remove --cache-file and --srcdir arguments so they do not pile up.
6184   ac_sub_configure_args=
6185   ac_prev=
6186   for ac_arg in $ac_configure_args; do
6187     if test -n "$ac_prev"; then
6188       ac_prev=
6189       continue
6190     fi
6191     case "$ac_arg" in
6192     -cache-file | --cache-file | --cache-fil | --cache-fi \
6193     | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
6194       ac_prev=cache_file ;;
6195     -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
6196     | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
6197       ;;
6198     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
6199       ac_prev=srcdir ;;
6200     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
6201       ;;
6202     *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
6203     esac
6204   done
6205
6206   for ac_config_dir in $configdirs; do
6207
6208     # Do not complain, so a configure script can configure whichever
6209     # parts of a large source tree are present.
6210     if test ! -d $srcdir/$ac_config_dir; then
6211       continue
6212     fi
6213
6214     echo configuring in $ac_config_dir
6215
6216     case "$srcdir" in
6217     .) ;;
6218     *)
6219       if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
6220       else
6221         { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
6222       fi
6223       ;;
6224     esac
6225
6226     ac_popdir=`pwd`
6227     cd $ac_config_dir
6228
6229       # A "../" for each directory in /$ac_config_dir.
6230       ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
6231
6232     case "$srcdir" in
6233     .) # No --srcdir option.  We are building in place.
6234       ac_sub_srcdir=$srcdir ;;
6235     /*) # Absolute path.
6236       ac_sub_srcdir=$srcdir/$ac_config_dir ;;
6237     *) # Relative path.
6238       ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
6239     esac
6240
6241     # Check for guested configure; otherwise get Cygnus style configure.
6242     if test -f $ac_sub_srcdir/configure; then
6243       ac_sub_configure=$ac_sub_srcdir/configure
6244     elif test -f $ac_sub_srcdir/configure.in; then
6245       ac_sub_configure=$ac_configure
6246     else
6247       echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
6248       ac_sub_configure=
6249     fi
6250
6251     # The recursion is here.
6252     if test -n "$ac_sub_configure"; then
6253
6254       # Make the cache file name correct relative to the subdirectory.
6255       case "$cache_file" in
6256       /*) ac_sub_cache_file=$cache_file ;;
6257       *) # Relative path.
6258         ac_sub_cache_file="$ac_dots$cache_file" ;;
6259       esac
6260   case "$ac_given_INSTALL" in
6261         [/$]*) INSTALL="$ac_given_INSTALL" ;;
6262         *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
6263         esac
6264
6265       echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
6266       # The eval makes quoting arguments work.
6267       if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
6268       then :
6269       else
6270         { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
6271       fi
6272     fi
6273
6274     cd $ac_popdir
6275   done
6276 fi
6277
6278
6279 exit 0