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