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