* gdb.c++/misc.exp: Add note to message for
[deliverable/binutils-gdb.git] / gdb / configure
CommitLineData
5436fc65
C
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
3dedc867 4# Generated automatically using autoconf version 2.8
5436fc65
C
5# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
10# Defaults:
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)
3dedc867 351 echo "configure generated by autoconf version 2.8"
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
5436fc65
C
534# Extract the first word of "gcc", so it can be a program name with args.
535set dummy gcc; ac_word=$2
536echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
537if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
538 echo $ac_n "(cached) $ac_c" 1>&6
539else
540 if test -n "$CC"; then
541 ac_cv_prog_CC="$CC" # Let the user override the test.
542else
543 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
da3d57e3 544 for ac_dir in $PATH; do
5436fc65
C
545 test -z "$ac_dir" && ac_dir=.
546 if test -f $ac_dir/$ac_word; then
547 ac_cv_prog_CC="gcc"
548 break
549 fi
550 done
551 IFS="$ac_save_ifs"
5436fc65
C
552fi
553fi
554CC="$ac_cv_prog_CC"
555if test -n "$CC"; then
556 echo "$ac_t""$CC" 1>&6
557else
558 echo "$ac_t""no" 1>&6
559fi
560
3dedc867
FF
561if test -z "$CC"; then
562 # Extract the first word of "cc", so it can be a program name with args.
563set dummy cc; ac_word=$2
564echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
565if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
566 echo $ac_n "(cached) $ac_c" 1>&6
567else
568 if test -n "$CC"; then
569 ac_cv_prog_CC="$CC" # Let the user override the test.
570else
571 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
572 ac_prog_rejected=no
573 for ac_dir in $PATH; do
574 test -z "$ac_dir" && ac_dir=.
575 if test -f $ac_dir/$ac_word; then
576 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
577 ac_prog_rejected=yes
578 continue
579 fi
580 ac_cv_prog_CC="cc"
581 break
582 fi
583 done
584 IFS="$ac_save_ifs"
585if test $ac_prog_rejected = yes; then
586 # We found a bogon in the path, so make sure we never use it.
587 set dummy $ac_cv_prog_CC
588 shift
589 if test $# -gt 0; then
590 # We chose a different compiler from the bogus one.
591 # However, it has the same basename, so the bogon will be chosen
592 # first if we set CC to just the basename; use the full file name.
593 shift
594 set dummy "$ac_dir/$ac_word" "$@"
595 shift
596 ac_cv_prog_CC="$@"
597 fi
598fi
599fi
600fi
601CC="$ac_cv_prog_CC"
602if test -n "$CC"; then
603 echo "$ac_t""$CC" 1>&6
604else
605 echo "$ac_t""no" 1>&6
606fi
607
608 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
609fi
5436fc65
C
610
611echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
612if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
613 echo $ac_n "(cached) $ac_c" 1>&6
614else
615 cat > conftest.c <<EOF
616#ifdef __GNUC__
617 yes;
618#endif
619EOF
3dedc867 620if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
5436fc65
C
621 ac_cv_prog_gcc=yes
622else
623 ac_cv_prog_gcc=no
624fi
625fi
229b2c87 626
5436fc65
C
627echo "$ac_t""$ac_cv_prog_gcc" 1>&6
628if test $ac_cv_prog_gcc = yes; then
629 GCC=yes
630 if test "${CFLAGS+set}" != set; then
631 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
632if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then
633 echo $ac_n "(cached) $ac_c" 1>&6
634else
635 echo 'void f(){}' > conftest.c
636if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
637 ac_cv_prog_gcc_g=yes
638else
639 ac_cv_prog_gcc_g=no
640fi
641rm -f conftest*
642
643fi
229b2c87
DE
644
645echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6
5436fc65
C
646 if test $ac_cv_prog_gcc_g = yes; then
647 CFLAGS="-g -O"
648 else
649 CFLAGS="-O"
650 fi
651 fi
652else
653 GCC=
654 test "${CFLAGS+set}" = set || CFLAGS="-g"
655fi
656
657echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
658# On Suns, sometimes $CPP names a directory.
659if test -n "$CPP" && test -d "$CPP"; then
660 CPP=
661fi
662if test -z "$CPP"; then
663if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
664 echo $ac_n "(cached) $ac_c" 1>&6
665else
666 # This must be in double quotes, not single quotes, because CPP may get
667 # substituted into the Makefile and "${CC-cc}" will confuse make.
668 CPP="${CC-cc} -E"
669 # On the NeXT, cc -E runs the code through the compiler's parser,
670 # not just through cpp.
671 cat > conftest.$ac_ext <<EOF
3dedc867 672#line 673 "configure"
5436fc65
C
673#include "confdefs.h"
674#include <assert.h>
675Syntax Error
676EOF
3dedc867
FF
677ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
678{ (eval echo configure:679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
679ac_err=`grep -v '^ *+' conftest.out`
680if test -z "$ac_err"; then
681 :
682else
683 echo "$ac_err" >&5
684 rm -rf conftest*
685 CPP="${CC-cc} -E -traditional-cpp"
686 cat > conftest.$ac_ext <<EOF
3dedc867 687#line 688 "configure"
5436fc65
C
688#include "confdefs.h"
689#include <assert.h>
690Syntax Error
691EOF
3dedc867
FF
692ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
693{ (eval echo configure:694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
694ac_err=`grep -v '^ *+' conftest.out`
695if test -z "$ac_err"; then
696 :
697else
698 echo "$ac_err" >&5
699 rm -rf conftest*
700 CPP=/lib/cpp
701fi
702rm -f conftest*
703fi
704rm -f conftest*
705 ac_cv_prog_CPP="$CPP"
706fi
dedcc91d
SC
707 CPP="$ac_cv_prog_CPP"
708else
709 ac_cv_prog_CPP="$CPP"
5436fc65 710fi
5436fc65
C
711echo "$ac_t""$CPP" 1>&6
712
713echo $ac_n "checking for AIX""... $ac_c" 1>&6
714cat > conftest.$ac_ext <<EOF
3dedc867 715#line 716 "configure"
5436fc65
C
716#include "confdefs.h"
717#ifdef _AIX
718 yes
719#endif
720
721EOF
722if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
723 egrep "yes" >/dev/null 2>&1; then
724 rm -rf conftest*
725 echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
726#define _ALL_SOURCE 1
727EOF
728
729else
730 rm -rf conftest*
731 echo "$ac_t""no" 1>&6
732fi
733rm -f conftest*
734
735
736ac_safe=`echo "minix/config.h" | tr './\055' '___'`
737echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
738if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
739 echo $ac_n "(cached) $ac_c" 1>&6
740else
741 cat > conftest.$ac_ext <<EOF
3dedc867 742#line 743 "configure"
5436fc65
C
743#include "confdefs.h"
744#include <minix/config.h>
745EOF
3dedc867
FF
746ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
747{ (eval echo configure:748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
748ac_err=`grep -v '^ *+' conftest.out`
749if test -z "$ac_err"; then
750 rm -rf conftest*
751 eval "ac_cv_header_$ac_safe=yes"
752else
753 echo "$ac_err" >&5
754 rm -rf conftest*
755 eval "ac_cv_header_$ac_safe=no"
756fi
757rm -f conftest*
758fi
759if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
760 echo "$ac_t""yes" 1>&6
761 MINIX=yes
762else
763 echo "$ac_t""no" 1>&6
764MINIX=
765fi
766
767if test "$MINIX" = yes; then
768 cat >> confdefs.h <<\EOF
769#define _POSIX_SOURCE 1
770EOF
771
772 cat >> confdefs.h <<\EOF
773#define _POSIX_1_SOURCE 2
774EOF
775
776 cat >> confdefs.h <<\EOF
777#define _MINIX 1
778EOF
779
780fi
781
782echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
783if test -d /etc/conf/kconfig.d &&
784 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
785then
786 echo "$ac_t""yes" 1>&6
787 ISC=yes # If later tests want to check for ISC.
788 cat >> confdefs.h <<\EOF
789#define _POSIX_SOURCE 1
790EOF
791
792 if test "$GCC" = yes; then
793 CC="$CC -posix"
794 else
795 CC="$CC -Xp"
796 fi
797else
798 echo "$ac_t""no" 1>&6
799 ISC=
800fi
801
802
803ac_aux_dir=
804for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
805 if test -f $ac_dir/install-sh; then
806 ac_aux_dir=$ac_dir
807 ac_install_sh="$ac_aux_dir/install-sh -c"
808 break
809 elif test -f $ac_dir/install.sh; then
810 ac_aux_dir=$ac_dir
811 ac_install_sh="$ac_aux_dir/install.sh -c"
812 break
813 fi
814done
815if test -z "$ac_aux_dir"; then
816 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
817fi
818ac_config_guess=$ac_aux_dir/config.guess
819ac_config_sub=$ac_aux_dir/config.sub
820ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
821
822# Find a good install program. We prefer a C program (faster),
823# so one script is as good as another. But avoid the broken or
824# incompatible versions:
825# SysV /etc/install, /usr/sbin/install
826# SunOS /usr/etc/install
827# IRIX /sbin/install
828# AIX /bin/install
829# AFS /usr/afsws/bin/install, which mishandles nonexistent args
830# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
831# ./install, which can be erroneously created by make from ./install.sh.
832echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
833if test -z "$INSTALL"; then
834if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
835 echo $ac_n "(cached) $ac_c" 1>&6
836else
837 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
838 for ac_dir in $PATH; do
839 # Account for people who put trailing slashes in PATH elements.
840 case "$ac_dir/" in
841 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
842 *)
843 # OSF1 and SCO ODT 3.0 have their own names for install.
844 for ac_prog in ginstall installbsd scoinst install; do
845 if test -f $ac_dir/$ac_prog; then
846 if test $ac_prog = install &&
847 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
848 # AIX install. It has an incompatible calling convention.
849 # OSF/1 installbsd also uses dspmsg, but is usable.
850 :
851 else
852 ac_cv_path_install="$ac_dir/$ac_prog -c"
853 break 2
854 fi
855 fi
856 done
857 ;;
858 esac
859 done
860 IFS="$ac_save_ifs"
229b2c87 861
5436fc65 862fi
229b2c87
DE
863 if test "${ac_cv_path_install+set}" = set; then
864 INSTALL="$ac_cv_path_install"
865 else
866 # As a last resort, use the slow shell script. We don't cache a
867 # path for INSTALL within a source directory, because that will
868 # break other packages using the cache if that directory is
869 # removed, or if the path is relative.
870 INSTALL="$ac_install_sh"
871 fi
5436fc65
C
872fi
873echo "$ac_t""$INSTALL" 1>&6
874
875# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
876# It thinks the first close brace ends the variable substitution.
877test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
878
879test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
880
881# Extract the first word of "ranlib", so it can be a program name with args.
882set dummy ranlib; ac_word=$2
883echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
884if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
885 echo $ac_n "(cached) $ac_c" 1>&6
886else
887 if test -n "$RANLIB"; then
888 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
889else
890 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
da3d57e3 891 for ac_dir in $PATH; do
5436fc65
C
892 test -z "$ac_dir" && ac_dir=.
893 if test -f $ac_dir/$ac_word; then
894 ac_cv_prog_RANLIB="ranlib"
895 break
896 fi
897 done
898 IFS="$ac_save_ifs"
899 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
900fi
901fi
902RANLIB="$ac_cv_prog_RANLIB"
903if test -n "$RANLIB"; then
904 echo "$ac_t""$RANLIB" 1>&6
905else
906 echo "$ac_t""no" 1>&6
907fi
908
204c8825
FF
909for ac_prog in 'bison -y' byacc
910do
911# Extract the first word of "$ac_prog", so it can be a program name with args.
912set dummy $ac_prog; ac_word=$2
913echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
914if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
915 echo $ac_n "(cached) $ac_c" 1>&6
916else
917 if test -n "$YACC"; then
918 ac_cv_prog_YACC="$YACC" # Let the user override the test.
919else
920 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
921 for ac_dir in $PATH; do
922 test -z "$ac_dir" && ac_dir=.
923 if test -f $ac_dir/$ac_word; then
924 ac_cv_prog_YACC="$ac_prog"
925 break
926 fi
927 done
928 IFS="$ac_save_ifs"
929fi
930fi
931YACC="$ac_cv_prog_YACC"
932if test -n "$YACC"; then
933 echo "$ac_t""$YACC" 1>&6
934else
935 echo "$ac_t""no" 1>&6
936fi
937
938test -n "$YACC" && break
939done
940test -n "$YACC" || YACC="yacc"
941
5436fc65
C
942
943ac_aux_dir=
944for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
945 if test -f $ac_dir/install-sh; then
946 ac_aux_dir=$ac_dir
947 ac_install_sh="$ac_aux_dir/install-sh -c"
948 break
949 elif test -f $ac_dir/install.sh; then
950 ac_aux_dir=$ac_dir
951 ac_install_sh="$ac_aux_dir/install.sh -c"
952 break
953 fi
954done
955if test -z "$ac_aux_dir"; then
956 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/.." 1>&2; exit 1; }
957fi
958ac_config_guess=$ac_aux_dir/config.guess
959ac_config_sub=$ac_aux_dir/config.sub
960ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
961
962
963# Do some error checking and defaulting for the host and target type.
964# The inputs are:
965# configure --host=HOST --target=TARGET --build=BUILD NONOPT
966#
967# The rules are:
968# 1. You are not allowed to specify --host, --target, and nonopt at the
229b2c87 969# same time.
5436fc65
C
970# 2. Host defaults to nonopt.
971# 3. If nonopt is not specified, then host defaults to the current host,
972# as determined by config.guess.
973# 4. Target and build default to nonopt.
974# 5. If nonopt is not specified, then target and build default to host.
975
976# The aliases save the names the user supplied, while $host etc.
977# will get canonicalized.
978case $host---$target---$nonopt in
979NONE---*---* | *---NONE---* | *---*---NONE) ;;
980*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
981esac
982
983
984# Make sure we can run config.sub.
985if $ac_config_sub sun4 >/dev/null 2>&1; then :
986else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
987fi
988
989echo $ac_n "checking host system type""... $ac_c" 1>&6
990
991host_alias=$host
992case "$host_alias" in
993NONE)
994 case $nonopt in
995 NONE)
996 if host_alias=`$ac_config_guess`; then :
997 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
998 fi ;;
999 *) host_alias=$nonopt ;;
1000 esac ;;
1001esac
1002
1003host=`$ac_config_sub $host_alias`
1004host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
1005host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
1006host_os=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
1007echo "$ac_t""$host" 1>&6
1008
1009echo $ac_n "checking target system type""... $ac_c" 1>&6
1010
1011target_alias=$target
1012case "$target_alias" in
1013NONE)
1014 case $nonopt in
1015 NONE) target_alias=$host_alias ;;
1016 *) target_alias=$nonopt ;;
1017 esac ;;
1018esac
1019
1020target=`$ac_config_sub $target_alias`
1021target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
1022target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
1023target_os=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
1024echo "$ac_t""$target" 1>&6
1025
1026echo $ac_n "checking build system type""... $ac_c" 1>&6
1027
1028build_alias=$build
1029case "$build_alias" in
1030NONE)
1031 case $nonopt in
1032 NONE) build_alias=$host_alias ;;
1033 *) build_alias=$nonopt ;;
1034 esac ;;
1035esac
1036
1037build=`$ac_config_sub $build_alias`
1038build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
1039build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
1040build_os=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`
1041echo "$ac_t""$build" 1>&6
1042
1043test "$host_alias" != "$target_alias" &&
1044 test "$program_prefix$program_suffix$program_transform_name" = \
1045 NONENONEs,x,x, &&
1046 program_prefix=${target_alias}-
1047
1048if test "$program_transform_name" = s,x,x,; then
1049 program_transform_name=
1050else
229b2c87
DE
1051 # Double any \ or $. echo might interpret backslashes.
1052 cat <<\EOF_SED > conftestsed
1053s,\\,\\\\,g; s,\$,$$,g
1054EOF_SED
5436fc65
C
1055 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
1056 rm -f conftestsed
1057fi
1058test "$program_prefix" != NONE &&
1059 program_transform_name="s,^,${program_prefix},; $program_transform_name"
1060# Use a double $ so make ignores it.
1061test "$program_suffix" != NONE &&
1062 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
1063
1064# sed with no file args requires a program.
1065test "$program_transform_name" = "" && program_transform_name="s,x,x,"
1066
1067
2b576293
C
1068# If we cannot run a trivial program, we must be cross compiling.
1069echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
1070if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
1071 echo $ac_n "(cached) $ac_c" 1>&6
1072else
1073 if test "$cross_compiling" = yes; then
1074 ac_cv_c_cross=yes
1075else
1076cat > conftest.$ac_ext <<EOF
3dedc867 1077#line 1078 "configure"
2b576293
C
1078#include "confdefs.h"
1079main(){return(0);}
1080EOF
3dedc867 1081{ (eval echo configure:1082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
2b576293
C
1082if test -s conftest && (./conftest; exit) 2>/dev/null; then
1083 ac_cv_c_cross=no
1084else
1085 ac_cv_c_cross=yes
1086fi
1087fi
1088rm -fr conftest*
1089fi
229b2c87 1090
3d78f532 1091echo "$ac_t""$ac_cv_c_cross" 1>&6
229b2c87 1092cross_compiling=$ac_cv_c_cross
2b576293
C
1093
1094echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1095if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1096 echo $ac_n "(cached) $ac_c" 1>&6
1097else
1098 cat > conftest.$ac_ext <<EOF
3dedc867 1099#line 1100 "configure"
2b576293
C
1100#include "confdefs.h"
1101#include <stdlib.h>
1102#include <stdarg.h>
1103#include <string.h>
1104#include <float.h>
1105EOF
3dedc867
FF
1106ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1107{ (eval echo configure:1108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2b576293
C
1108ac_err=`grep -v '^ *+' conftest.out`
1109if test -z "$ac_err"; then
1110 rm -rf conftest*
1111 ac_cv_header_stdc=yes
1112else
1113 echo "$ac_err" >&5
1114 rm -rf conftest*
1115 ac_cv_header_stdc=no
1116fi
1117rm -f conftest*
1118
1119if test $ac_cv_header_stdc = yes; then
1120 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1121cat > conftest.$ac_ext <<EOF
3dedc867 1122#line 1123 "configure"
2b576293
C
1123#include "confdefs.h"
1124#include <string.h>
1125EOF
1126if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1127 egrep "memchr" >/dev/null 2>&1; then
1128 :
1129else
1130 rm -rf conftest*
1131 ac_cv_header_stdc=no
1132fi
1133rm -f conftest*
1134
1135fi
1136
1137if test $ac_cv_header_stdc = yes; then
1138 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1139cat > conftest.$ac_ext <<EOF
3dedc867 1140#line 1141 "configure"
2b576293
C
1141#include "confdefs.h"
1142#include <stdlib.h>
1143EOF
1144if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1145 egrep "free" >/dev/null 2>&1; then
1146 :
1147else
1148 rm -rf conftest*
1149 ac_cv_header_stdc=no
1150fi
1151rm -f conftest*
1152
1153fi
1154
1155if test $ac_cv_header_stdc = yes; then
1156 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1157if test "$cross_compiling" = yes; then
229b2c87 1158 :
2b576293
C
1159else
1160cat > conftest.$ac_ext <<EOF
3dedc867 1161#line 1162 "configure"
2b576293
C
1162#include "confdefs.h"
1163#include <ctype.h>
1164#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1165#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1166#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1167int main () { int i; for (i = 0; i < 256; i++)
1168if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1169exit (0); }
1170
1171EOF
3dedc867 1172{ (eval echo configure:1173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
2b576293
C
1173if test -s conftest && (./conftest; exit) 2>/dev/null; then
1174 :
1175else
1176 ac_cv_header_stdc=no
1177fi
1178fi
1179rm -fr conftest*
1180fi
1181fi
229b2c87 1182
2b576293
C
1183echo "$ac_t""$ac_cv_header_stdc" 1>&6
1184if test $ac_cv_header_stdc = yes; then
1185 cat >> confdefs.h <<\EOF
1186#define STDC_HEADERS 1
1187EOF
1188
1189fi
1190
b7f3b6d5 1191for ac_hdr in limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h
1a494973
C
1192do
1193ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
1194echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1195if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1196 echo $ac_n "(cached) $ac_c" 1>&6
1197else
1198 cat > conftest.$ac_ext <<EOF
3dedc867 1199#line 1200 "configure"
1a494973
C
1200#include "confdefs.h"
1201#include <$ac_hdr>
1202EOF
3dedc867
FF
1203ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1204{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1a494973
C
1205ac_err=`grep -v '^ *+' conftest.out`
1206if test -z "$ac_err"; then
1207 rm -rf conftest*
1208 eval "ac_cv_header_$ac_safe=yes"
1209else
1210 echo "$ac_err" >&5
1211 rm -rf conftest*
1212 eval "ac_cv_header_$ac_safe=no"
1213fi
1214rm -f conftest*
1215fi
1216if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1217 echo "$ac_t""yes" 1>&6
229b2c87 1218 ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
1a494973
C
1219 cat >> confdefs.h <<EOF
1220#define $ac_tr_hdr 1
1221EOF
1222
1223else
1224 echo "$ac_t""no" 1>&6
1225fi
1226done
1227
2b576293
C
1228echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
1229if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
1230 echo $ac_n "(cached) $ac_c" 1>&6
1231else
1232 cat > conftest.$ac_ext <<EOF
3dedc867 1233#line 1234 "configure"
2b576293
C
1234#include "confdefs.h"
1235#include <sys/types.h>
1236#include <sys/stat.h>
1237
1238#if defined(S_ISBLK) && defined(S_IFDIR)
1239# if S_ISBLK (S_IFDIR)
1240You lose.
1241# endif
1242#endif
1243
1244#if defined(S_ISBLK) && defined(S_IFCHR)
1245# if S_ISBLK (S_IFCHR)
1246You lose.
1247# endif
1248#endif
1249
1250#if defined(S_ISLNK) && defined(S_IFREG)
1251# if S_ISLNK (S_IFREG)
1252You lose.
1253# endif
1254#endif
1255
1256#if defined(S_ISSOCK) && defined(S_IFREG)
1257# if S_ISSOCK (S_IFREG)
1258You lose.
1259# endif
1260#endif
1261
1262EOF
1263if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1264 egrep "You lose" >/dev/null 2>&1; then
1265 rm -rf conftest*
1266 ac_cv_header_stat_broken=yes
1267else
1268 rm -rf conftest*
1269 ac_cv_header_stat_broken=no
1270fi
1271rm -f conftest*
1272
1273fi
229b2c87 1274
2b576293
C
1275echo "$ac_t""$ac_cv_header_stat_broken" 1>&6
1276if test $ac_cv_header_stat_broken = yes; then
1277 cat >> confdefs.h <<\EOF
1278#define STAT_MACROS_BROKEN 1
1279EOF
1280
1281fi
1282
1283
4708ac65
FF
1284echo $ac_n "checking for gregset_t type""... $ac_c" 1>&6
1285if eval "test \"`echo '$''{'gdb_have_gregset_t'+set}'`\" = set"; then
1286 echo $ac_n "(cached) $ac_c" 1>&6
1287else
1288 cat > conftest.$ac_ext <<EOF
3dedc867 1289#line 1290 "configure"
4708ac65
FF
1290#include "confdefs.h"
1291#include <sys/procfs.h>
1292int main() { return 0; }
1293int t() {
1294gregset_t *gregsetp = 0
1295; return 0; }
1296EOF
3dedc867 1297if { (eval echo configure:1298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4708ac65
FF
1298 rm -rf conftest*
1299 gdb_have_gregset_t=yes
1300else
1301 rm -rf conftest*
1302 gdb_have_gregset_t=no
1303fi
1304rm -f conftest*
1305
1306fi
1307
1308echo "$ac_t""$gdb_have_gregset_t" 1>&6
1309if test $gdb_have_gregset_t = yes; then
1310 cat >> confdefs.h <<\EOF
1311#define HAVE_GREGSET_T 1
1312EOF
1313
1314fi
1315
1316echo $ac_n "checking for fpregset_t type""... $ac_c" 1>&6
1317if eval "test \"`echo '$''{'gdb_have_fpregset_t'+set}'`\" = set"; then
1318 echo $ac_n "(cached) $ac_c" 1>&6
1319else
1320 cat > conftest.$ac_ext <<EOF
3dedc867 1321#line 1322 "configure"
4708ac65
FF
1322#include "confdefs.h"
1323#include <sys/procfs.h>
1324int main() { return 0; }
1325int t() {
1326fpregset_t *fpregsetp = 0
1327; return 0; }
1328EOF
3dedc867 1329if { (eval echo configure:1330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
4708ac65
FF
1330 rm -rf conftest*
1331 gdb_have_fpregset_t=yes
1332else
1333 rm -rf conftest*
1334 gdb_have_fpregset_t=no
1335fi
1336rm -f conftest*
1337
1338fi
1339
1340echo "$ac_t""$gdb_have_fpregset_t" 1>&6
1341if test $gdb_have_fpregset_t = yes; then
1342 cat >> confdefs.h <<\EOF
1343#define HAVE_FPREGSET_T 1
1344EOF
1345
1346fi
1347
aa220473
SG
1348
1349echo $ac_n "checking for long double""... $ac_c" 1>&6
1350if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
1351 echo $ac_n "(cached) $ac_c" 1>&6
1352else
1353 cat > conftest.$ac_ext <<EOF
3dedc867 1354#line 1355 "configure"
aa220473
SG
1355#include "confdefs.h"
1356
1357int main() { return 0; }
1358int t() {
1359long double foo;
1360; return 0; }
1361EOF
3dedc867 1362if { (eval echo configure:1363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
aa220473
SG
1363 rm -rf conftest*
1364 ac_cv_c_long_double=yes
1365else
1366 rm -rf conftest*
1367 ac_cv_c_long_double=no
1368fi
1369rm -f conftest*
1370
1371fi
1372
1373echo "$ac_t""$ac_cv_c_long_double" 1>&6
1374if test $ac_cv_c_long_double = yes; then
1375 cat >> confdefs.h <<\EOF
1376#define HAVE_LONG_DOUBLE 1
1377EOF
1378
1379fi
1380
229b2c87
DE
1381for ac_func in valloc getpagesize
1382do
1383echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1384if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1385 echo $ac_n "(cached) $ac_c" 1>&6
1386else
1387 cat > conftest.$ac_ext <<EOF
3dedc867 1388#line 1389 "configure"
229b2c87
DE
1389#include "confdefs.h"
1390/* System header to define __stub macros and hopefully few prototypes,
1391 which can conflict with char $ac_func(); below. */
1392#include <assert.h>
1393/* Override any gcc2 internal prototype to avoid an error. */
1394char $ac_func();
1395
1396int main() { return 0; }
1397int t() {
1398
1399/* The GNU C library defines this for functions which it implements
1400 to always fail with ENOSYS. Some functions are actually named
1401 something starting with __ and the normal name is an alias. */
1402#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1403choke me
1404#else
1405$ac_func();
1406#endif
1407
1408; return 0; }
1409EOF
3dedc867 1410if { (eval echo configure:1411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
229b2c87
DE
1411 rm -rf conftest*
1412 eval "ac_cv_func_$ac_func=yes"
1413else
1414 rm -rf conftest*
1415 eval "ac_cv_func_$ac_func=no"
1416fi
1417rm -f conftest*
1418
1419fi
1420if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1421 echo "$ac_t""yes" 1>&6
1422 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1423 cat >> confdefs.h <<EOF
1424#define $ac_tr_func 1
1425EOF
1426
1427else
1428 echo "$ac_t""no" 1>&6
1429fi
1430done
1431
2b576293
C
1432echo $ac_n "checking for working mmap""... $ac_c" 1>&6
1433if eval "test \"`echo '$''{'ac_cv_func_mmap'+set}'`\" = set"; then
1434 echo $ac_n "(cached) $ac_c" 1>&6
1435else
1436 if test "$cross_compiling" = yes; then
1437 ac_cv_func_mmap=no
1438else
1439cat > conftest.$ac_ext <<EOF
3dedc867 1440#line 1441 "configure"
2b576293
C
1441#include "confdefs.h"
1442
1443/* Thanks to Mike Haertel and Jim Avera for this test. */
1444#include <sys/types.h>
1445#include <fcntl.h>
1446#include <sys/mman.h>
1447
2b576293
C
1448#ifndef HAVE_GETPAGESIZE
1449# include <sys/param.h>
1450# ifdef EXEC_PAGESIZE
1451# define getpagesize() EXEC_PAGESIZE
1452# else
1453# ifdef NBPG
1454# define getpagesize() NBPG * CLSIZE
1455# ifndef CLSIZE
1456# define CLSIZE 1
1457# endif
1458# else
1459# ifdef NBPC
1460# define getpagesize() NBPC
1461# else
1462# define getpagesize() PAGESIZE /* SVR4 */
1463# endif
1464# endif
1465# endif
1466#endif
1467
229b2c87 1468#ifndef HAVE_VALLOC
2b576293
C
1469# define valloc malloc
1470#endif
1471
1472#ifdef __cplusplus
1473extern "C" { void *valloc(unsigned), *malloc(unsigned); }
1474#else
1475char *valloc(), *malloc();
1476#endif
1477
1478int
1479main()
1480{
1481 char *buf1, *buf2, *buf3;
1482 int i = getpagesize(), j;
229b2c87 1483 int i2 = i * 2;
2b576293
C
1484 int fd;
1485
1486 buf1 = (char *)valloc(i2);
1487 buf2 = (char *)valloc(i);
1488 buf3 = (char *)malloc(i2);
1489 for (j = 0; j < i2; ++j)
1490 *(buf1 + j) = rand();
1491 fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
1492 write(fd, buf1, i2);
1493 mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
1494 for (j = 0; j < i; ++j)
1495 if (*(buf1 + j) != *(buf2 + j))
1496 exit(1);
1497 lseek(fd, (long)i, 0);
1498 read(fd, buf2, i); /* read into mapped memory -- file should not change */
1499 /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
1500 lseek(fd, (long)0, 0);
1501 read(fd, buf3, i2);
1502 for (j = 0; j < i2; ++j)
1503 if (*(buf1 + j) != *(buf3 + j))
1504 exit(1);
1505 exit(0);
1506}
1507
1508EOF
3dedc867 1509{ (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
2b576293
C
1510if test -s conftest && (./conftest; exit) 2>/dev/null; then
1511 ac_cv_func_mmap=yes
1512else
1513 ac_cv_func_mmap=no
1514fi
1515fi
1516rm -fr conftest*
1517fi
229b2c87 1518
2b576293
C
1519echo "$ac_t""$ac_cv_func_mmap" 1>&6
1520if test $ac_cv_func_mmap = yes; then
1521 cat >> confdefs.h <<\EOF
1522#define HAVE_MMAP 1
1523EOF
1524
1525fi
1526
5436fc65
C
1527
1528ENABLE_CFLAGS=
1529ENABLE_CLIBS=
1530ENABLE_OBS=
1531
1532# Check whether --enable-netrom or --disable-netrom was given.
229b2c87
DE
1533if test "${enable_netrom+set}" = set; then
1534 enableval="$enable_netrom"
5436fc65
C
1535 case "${enableval}" in
1536yes) enable_netrom=yes ;;
1537no) enable_netrom=no ;;
1538*) { echo "configure: error: bad value ${enableval} given for netrom option" 1>&2; exit 1; } ;;
1539esac
1540fi
1541
1542
1543if test "${enable_netrom}" = "yes"; then
1544 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
1545fi
1546
188c635f
SG
1547# start-sanitize-gm
1548ENABLE_GM=
1549
1550# Check whether --enable-gm or --disable-gm was given.
229b2c87
DE
1551if test "${enable_gm+set}" = set; then
1552 enableval="$enable_gm"
188c635f 1553 case "${enableval}" in
1a57cd09 1554yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
188c635f
SG
1555 ENABLE_CFLAGS=-DGENERAL_MAGIC
1556 ;;
1557no) ;;
1558*) { echo "configure: error: bad value ${enableval} given for gm option" 1>&2; exit 1; } ;;
1559esac
1560fi
1561
1562
1563# end-sanitize-gm
1564
3c0bf315 1565# Check whether --enable-sim-powerpc or --disable-sim-powerpc was given.
229b2c87
DE
1566if test "${enable_sim_powerpc+set}" = set; then
1567 enableval="$enable_sim_powerpc"
3c0bf315
MM
1568 case "${enableval}" in
1569yes) powerpc_sim=yes ;;
1570no) powerpc_sim=no ;;
1571*) { echo "configure: error: bad value ${enableval} given for sim-powerpc option" 1>&2; exit 1; } ;;
1572esac
1573else
1574 if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi
1575fi
1576
1577
5436fc65
C
1578# start-sanitize-gdbtk
1579ENABLE_GDBTK=
1580
1581# Check whether --enable-gdbtk or --disable-gdbtk was given.
229b2c87
DE
1582if test "${enable_gdbtk+set}" = set; then
1583 enableval="$enable_gdbtk"
5436fc65 1584 case "${enableval}" in
0fe1522a
SG
1585 yes)
1586 case "$host" in
1587 *go32*)
1588 echo "configure: warning: GDB does not support GDBtk on host ${host}. GDBtk will be disabled." 1>&2
1589 enable_gdbtk=no ;;
1590 *)
1591 enable_gdbtk=yes ;;
1592 esac ;;
1593 no)
1594 enable_gdbtk=no ;;
1595 *)
1596 { echo "configure: error: bad value ${enableval} given for gdbtk option" 1>&2; exit 1; } ;;
5436fc65 1597esac
0fe1522a
SG
1598else
1599
1600# Default is on for everything but go32
1601case "$host" in
1602 *go32*)
1603 ;;
1604 *)
1605 enable_gdbtk=yes ;;
1606 esac
1607
5436fc65
C
1608fi
1609
1610
1611if test "${enable_gdbtk}" = "yes"; then
0fe1522a 1612
a2b63bbd 1613 # If we find X, set shell vars x_includes and x_libraries to the
5436fc65
C
1614# paths, otherwise set no_x=yes.
1615# Uses ac_ vars as temps to allow command line to override cache and checks.
1616# --without-x overrides everything else, but does not touch the cache.
1617echo $ac_n "checking for X""... $ac_c" 1>&6
1618
1619# Check whether --with-x or --without-x was given.
229b2c87
DE
1620if test "${with_x+set}" = set; then
1621 withval="$with_x"
5436fc65
C
1622 :
1623fi
1624
3dedc867 1625# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
5436fc65 1626if test "x$with_x" = xno; then
3dedc867
FF
1627 # The user explicitly disabled X.
1628 have_x=disabled
5436fc65
C
1629else
1630 if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
3dedc867
FF
1631 # Both variables are already set.
1632 have_x=yes
5436fc65 1633 else
3dedc867 1634if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
5436fc65
C
1635 echo $ac_n "(cached) $ac_c" 1>&6
1636else
1637 # One or both of the vars are not set, and there is no cached value.
3dedc867 1638ac_x_includes=NO ac_x_libraries=NO
5436fc65
C
1639rm -fr conftestdir
1640if mkdir conftestdir; then
1641 cd conftestdir
1642 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
1643 cat > Imakefile <<'EOF'
1644acfindx:
1645 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
1646EOF
1647 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
5436fc65 1648 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
229b2c87 1649 eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
5436fc65 1650 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
dedcc91d
SC
1651 for ac_extension in a so sl; do
1652 if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
1653 test -f $ac_im_libdir/libX11.$ac_extension; then
1654 ac_im_usrlibdir=$ac_im_libdir; break
1655 fi
1656 done
5436fc65
C
1657 # Screen out bogus values from the imake configuration.
1658 case "$ac_im_incroot" in
1659 /usr/include) ;;
1660 *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
1661 esac
1662 case "$ac_im_usrlibdir" in
1663 /usr/lib | /lib) ;;
1664 *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
1665 esac
1666 fi
1667 cd ..
1668 rm -fr conftestdir
1669fi
1670
3dedc867
FF
1671if test "$ac_x_includes" = NO; then
1672 # Guess where to find include files, by looking for this one X11 .h file.
1673 test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
1674
1675 # First, try using that file with no special directory specified.
5436fc65 1676cat > conftest.$ac_ext <<EOF
3dedc867 1677#line 1678 "configure"
5436fc65
C
1678#include "confdefs.h"
1679#include <$x_direct_test_include>
1680EOF
3dedc867
FF
1681ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1682{ (eval echo configure:1683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
1683ac_err=`grep -v '^ *+' conftest.out`
1684if test -z "$ac_err"; then
1685 rm -rf conftest*
3dedc867
FF
1686 # We can compile using X headers with no special include directory.
1687ac_x_includes=
5436fc65
C
1688else
1689 echo "$ac_err" >&5
1690 rm -rf conftest*
3dedc867
FF
1691 # Look for the header file in a standard set of common directories.
1692 for ac_dir in \
5436fc65
C
1693 /usr/X11R6/include \
1694 /usr/X11R5/include \
1695 /usr/X11R4/include \
1696 \
1697 /usr/include/X11R6 \
1698 /usr/include/X11R5 \
1699 /usr/include/X11R4 \
1700 \
1701 /usr/local/X11R6/include \
1702 /usr/local/X11R5/include \
1703 /usr/local/X11R4/include \
1704 \
1705 /usr/local/include/X11R6 \
1706 /usr/local/include/X11R5 \
1707 /usr/local/include/X11R4 \
1708 \
1709 /usr/X11/include \
1710 /usr/include/X11 \
1711 /usr/local/X11/include \
1712 /usr/local/include/X11 \
1713 \
1714 /usr/X386/include \
1715 /usr/x386/include \
1716 /usr/XFree86/include/X11 \
1717 \
1718 /usr/include \
1719 /usr/local/include \
1720 /usr/unsupported/include \
1721 /usr/athena/include \
1722 /usr/local/x11r5/include \
1723 /usr/lpp/Xamples/include \
1724 \
1725 /usr/openwin/include \
1726 /usr/openwin/share/include \
1727 ; \
1728 do
1729 if test -r "$ac_dir/$x_direct_test_include"; then
3dedc867 1730 ac_x_includes=$ac_dir
5436fc65
C
1731 break
1732 fi
1733 done
1734fi
1735rm -f conftest*
3dedc867 1736fi # $ac_x_includes = NO
5436fc65 1737
3dedc867
FF
1738if test "$ac_x_libraries" = NO; then
1739 # Check for the libraries.
1740
1741 test -z "$x_direct_test_library" && x_direct_test_library=Xt
1742 test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
1743
1744 # See if we find them without any special options.
1745 # Don't add to $LIBS permanently.
1746 ac_save_LIBS="$LIBS"
1747 LIBS="-l$x_direct_test_library $LIBS"
5436fc65 1748cat > conftest.$ac_ext <<EOF
3dedc867 1749#line 1750 "configure"
5436fc65
C
1750#include "confdefs.h"
1751
1752int main() { return 0; }
1753int t() {
1754${x_direct_test_function}()
1755; return 0; }
1756EOF
3dedc867 1757if { (eval echo configure:1758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 1758 rm -rf conftest*
3dedc867
FF
1759 LIBS="$ac_save_LIBS"
1760# We can link X programs with no special library path.
1761ac_x_libraries=
5436fc65
C
1762else
1763 rm -rf conftest*
1764 LIBS="$ac_save_LIBS"
1765# First see if replacing the include by lib works.
1766for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
1767 /usr/X11R6/lib \
1768 /usr/X11R5/lib \
1769 /usr/X11R4/lib \
1770 \
1771 /usr/lib/X11R6 \
1772 /usr/lib/X11R5 \
1773 /usr/lib/X11R4 \
1774 \
1775 /usr/local/X11R6/lib \
1776 /usr/local/X11R5/lib \
1777 /usr/local/X11R4/lib \
1778 \
1779 /usr/local/lib/X11R6 \
1780 /usr/local/lib/X11R5 \
1781 /usr/local/lib/X11R4 \
1782 \
1783 /usr/X11/lib \
1784 /usr/lib/X11 \
1785 /usr/local/X11/lib \
1786 /usr/local/lib/X11 \
1787 \
1788 /usr/X386/lib \
1789 /usr/x386/lib \
1790 /usr/XFree86/lib/X11 \
1791 \
1792 /usr/lib \
1793 /usr/local/lib \
1794 /usr/unsupported/lib \
1795 /usr/athena/lib \
1796 /usr/local/x11r5/lib \
1797 /usr/lpp/Xamples/lib \
1798 \
1799 /usr/openwin/lib \
1800 /usr/openwin/share/lib \
1801 ; \
1802do
1803 for ac_extension in a so sl; do
1804 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
3dedc867 1805 ac_x_libraries=$ac_dir
5436fc65
C
1806 break 2
1807 fi
1808 done
1809done
1810fi
1811rm -f conftest*
1812
3dedc867
FF
1813fi # $ac_x_libraries = NO
1814
1815if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
1816 # Didn't find X anywhere. Cache the known absence of X.
1817 ac_cv_have_x="have_x=no"
5436fc65 1818else
3dedc867
FF
1819 # Record where we found X for the cache.
1820 ac_cv_have_x="have_x=yes \
1821 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
5436fc65
C
1822fi
1823fi
1824 fi
3dedc867 1825 eval "$ac_cv_have_x"
5436fc65
C
1826fi # $with_x != no
1827
3dedc867
FF
1828if test "$have_x" != yes; then
1829 echo "$ac_t""$have_x" 1>&6
1830 no_x=yes
5436fc65 1831else
3dedc867 1832 # If each of the values was on the command line, it overrides each guess.
5436fc65
C
1833 test "x$x_includes" = xNONE && x_includes=$ac_x_includes
1834 test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
3dedc867
FF
1835 # Update the cache value to reflect the command line values.
1836 ac_cv_have_x="have_x=yes \
1837 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
5436fc65
C
1838 echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
1839fi
1840
3dedc867 1841 if test "$no_x" = yes; then
5436fc65
C
1842 # Not all programs may use this symbol, but it does not hurt to define it.
1843 X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING"
1844else
1845 if test -n "$x_includes"; then
1846 X_CFLAGS="$X_CFLAGS -I$x_includes"
1847 fi
1848
1849 # It would be nice to have a more robust check for the -R ld option than
1850 # just checking for Solaris.
1851 # It would also be nice to do this for all -L options, not just this one.
1852 if test -n "$x_libraries"; then
1853 X_LIBS="$X_LIBS -L$x_libraries"
1854 if test "`(uname) 2>/dev/null`" = SunOS &&
1855 uname -r | grep '^5' >/dev/null; then
229b2c87 1856 X_LIBS="$X_LIBS -R $x_libraries"
5436fc65
C
1857 fi
1858 fi
1859
1860 # Check for libraries that X11R6 Xt/Xaw programs need.
1861
1862 ac_save_LDFLAGS="$LDFLAGS"
1863 LDFLAGS="$LDFLAGS -L$x_libraries"
1864 # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
1865 # check for ICE first), but we must link in the order -lSM -lICE or
1866 # we get undefined symbols. So assume we have SM if we have ICE.
1867 # These have to be linked with before -lX11, unlike the other
1868 # libraries we check for below, so use a different variable.
1869 # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
1870 echo $ac_n "checking for -lICE""... $ac_c" 1>&6
3dedc867 1871ac_lib_var=`echo ICE_IceConnectionNumber | tr '.-/+' '___p'`
229b2c87 1872if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5436fc65
C
1873 echo $ac_n "(cached) $ac_c" 1>&6
1874else
1875 ac_save_LIBS="$LIBS"
1876LIBS="-lICE $LIBS"
1877cat > conftest.$ac_ext <<EOF
3dedc867 1878#line 1879 "configure"
5436fc65
C
1879#include "confdefs.h"
1880
1881int main() { return 0; }
1882int t() {
1883IceConnectionNumber()
1884; return 0; }
1885EOF
3dedc867 1886if { (eval echo configure:1887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 1887 rm -rf conftest*
229b2c87 1888 eval "ac_cv_lib_$ac_lib_var=yes"
5436fc65
C
1889else
1890 rm -rf conftest*
229b2c87 1891 eval "ac_cv_lib_$ac_lib_var=no"
5436fc65
C
1892fi
1893rm -f conftest*
1894LIBS="$ac_save_LIBS"
1895
1896fi
229b2c87 1897if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5436fc65
C
1898 echo "$ac_t""yes" 1>&6
1899 X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
1900else
1901 echo "$ac_t""no" 1>&6
1902fi
1903
1904 LDFLAGS="$ac_save_LDFLAGS"
1905
1906 # Check for system-dependent libraries X programs must link with.
1907
1908 if test "$ISC" = yes; then
1909 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
1910 else
1911 # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
1912 # libraries were built with DECnet support. And karl@cs.umb.edu says
1913 # the Alpha needs dnet_stub (dnet does not exist).
1914 echo $ac_n "checking for -ldnet""... $ac_c" 1>&6
3dedc867 1915ac_lib_var=`echo dnet_dnet_ntoa | tr '.-/+' '___p'`
229b2c87 1916if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5436fc65
C
1917 echo $ac_n "(cached) $ac_c" 1>&6
1918else
1919 ac_save_LIBS="$LIBS"
1920LIBS="-ldnet $LIBS"
1921cat > conftest.$ac_ext <<EOF
3dedc867 1922#line 1923 "configure"
5436fc65
C
1923#include "confdefs.h"
1924
1925int main() { return 0; }
1926int t() {
1927dnet_ntoa()
1928; return 0; }
1929EOF
3dedc867 1930if { (eval echo configure:1931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 1931 rm -rf conftest*
229b2c87 1932 eval "ac_cv_lib_$ac_lib_var=yes"
5436fc65
C
1933else
1934 rm -rf conftest*
229b2c87 1935 eval "ac_cv_lib_$ac_lib_var=no"
5436fc65
C
1936fi
1937rm -f conftest*
1938LIBS="$ac_save_LIBS"
1939
1940fi
229b2c87 1941if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5436fc65
C
1942 echo "$ac_t""yes" 1>&6
1943 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
1944else
1945 echo "$ac_t""no" 1>&6
1946fi
1947
1948 if test $ac_cv_lib_dnet = no; then
1949 echo $ac_n "checking for -ldnet_stub""... $ac_c" 1>&6
3dedc867 1950ac_lib_var=`echo dnet_stub_dnet_ntoa | tr '.-/+' '___p'`
229b2c87 1951if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5436fc65
C
1952 echo $ac_n "(cached) $ac_c" 1>&6
1953else
1954 ac_save_LIBS="$LIBS"
1955LIBS="-ldnet_stub $LIBS"
1956cat > conftest.$ac_ext <<EOF
3dedc867 1957#line 1958 "configure"
5436fc65
C
1958#include "confdefs.h"
1959
1960int main() { return 0; }
1961int t() {
1962dnet_ntoa()
1963; return 0; }
1964EOF
3dedc867 1965if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 1966 rm -rf conftest*
229b2c87 1967 eval "ac_cv_lib_$ac_lib_var=yes"
5436fc65
C
1968else
1969 rm -rf conftest*
229b2c87 1970 eval "ac_cv_lib_$ac_lib_var=no"
5436fc65
C
1971fi
1972rm -f conftest*
1973LIBS="$ac_save_LIBS"
1974
1975fi
229b2c87 1976if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5436fc65
C
1977 echo "$ac_t""yes" 1>&6
1978 X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
1979else
1980 echo "$ac_t""no" 1>&6
1981fi
1982
1983 fi
1984
1985 # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
1986 # to get the SysV transport functions.
1987 # Not sure which flavor of 386 UNIX this is, but it seems harmless to
1988 # check for it.
1989 echo $ac_n "checking for -lnsl""... $ac_c" 1>&6
3dedc867 1990ac_lib_var=`echo nsl_t_accept | tr '.-/+' '___p'`
229b2c87 1991if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5436fc65
C
1992 echo $ac_n "(cached) $ac_c" 1>&6
1993else
1994 ac_save_LIBS="$LIBS"
1995LIBS="-lnsl $LIBS"
1996cat > conftest.$ac_ext <<EOF
3dedc867 1997#line 1998 "configure"
5436fc65
C
1998#include "confdefs.h"
1999
2000int main() { return 0; }
2001int t() {
2002t_accept()
2003; return 0; }
2004EOF
3dedc867 2005if { (eval echo configure:2006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 2006 rm -rf conftest*
229b2c87 2007 eval "ac_cv_lib_$ac_lib_var=yes"
5436fc65
C
2008else
2009 rm -rf conftest*
229b2c87 2010 eval "ac_cv_lib_$ac_lib_var=no"
5436fc65
C
2011fi
2012rm -f conftest*
2013LIBS="$ac_save_LIBS"
2014
2015fi
229b2c87 2016if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5436fc65
C
2017 echo "$ac_t""yes" 1>&6
2018 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
2019else
2020 echo "$ac_t""no" 1>&6
2021fi
2022
2023
2024 # lieder@skyler.mavd.honeywell.com says without -lsocket,
2025 # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
2026 # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
2027 if test "`(uname) 2>/dev/null`" != IRIX; then
2028 echo $ac_n "checking for -lsocket""... $ac_c" 1>&6
3dedc867 2029ac_lib_var=`echo socket_socket | tr '.-/+' '___p'`
229b2c87 2030if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5436fc65
C
2031 echo $ac_n "(cached) $ac_c" 1>&6
2032else
2033 ac_save_LIBS="$LIBS"
2034LIBS="-lsocket $LIBS"
2035cat > conftest.$ac_ext <<EOF
3dedc867 2036#line 2037 "configure"
5436fc65
C
2037#include "confdefs.h"
2038
2039int main() { return 0; }
2040int t() {
2041socket()
2042; return 0; }
2043EOF
3dedc867 2044if { (eval echo configure:2045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
5436fc65 2045 rm -rf conftest*
229b2c87 2046 eval "ac_cv_lib_$ac_lib_var=yes"
5436fc65
C
2047else
2048 rm -rf conftest*
229b2c87 2049 eval "ac_cv_lib_$ac_lib_var=no"
5436fc65
C
2050fi
2051rm -f conftest*
2052LIBS="$ac_save_LIBS"
2053
2054fi
229b2c87 2055if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5436fc65
C
2056 echo "$ac_t""yes" 1>&6
2057 X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"
2058else
2059 echo "$ac_t""no" 1>&6
2060fi
2061
2062 fi
2063 fi
2064fi
2065
2066
a2b63bbd 2067
4e327047 2068
5436fc65 2069#
4e327047
TT
2070# Ok, lets find the tcl source trees so we can use the headers
2071# Warning: transition of version 9 to 10 will break this algorithm
2072# because 10 sorts before 9. We also look for just tcl. We have to
2073# be careful that we don't match stuff like tclX by accident.
2074# the alternative search directory is involked by --with-tclinclude
5436fc65 2075#
4e327047
TT
2076no_tcl=true
2077echo $ac_n "checking for Tcl private headers""... $ac_c" 1>&6
2078# Check whether --with-tclinclude or --without-tclinclude was given.
229b2c87
DE
2079if test "${with_tclinclude+set}" = set; then
2080 withval="$with_tclinclude"
4e327047
TT
2081 with_tclinclude=${withval}
2082fi
2083
2084if eval "test \"`echo '$''{'ac_cv_c_tclh'+set}'`\" = set"; then
2085 echo $ac_n "(cached) $ac_c" 1>&6
2086else
2087
2088# first check to see if --with-tclinclude was specified
2089if test x"${with_tclinclude}" != x ; then
2090 if test -f ${with_tclinclude}/tclInt.h ; then
2091 ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
5436fc65 2092 else
4e327047
TT
2093 { echo "configure: error: ${with_tclinclude} directory doesn't contain private headers" 1>&2; exit 1; }
2094 fi
2095fi
2096# next check in private source directory
2097#
2098# since ls returns lowest version numbers first, reverse its output
2099if test x"${ac_cv_c_tclh}" = x ; then
2100 for i in \
2101 ${srcdir}/../tcl \
2102 `ls -dr ${srcdir}/../tcl[0-9]* 2>/dev/null` \
2103 ${srcdir}/../../tcl \
2104 `ls -dr ${srcdir}/../../tcl[0-9]* 2>/dev/null` \
2105 ${srcdir}/../../../tcl \
2106 `ls -dr ${srcdir}/../../../tcl[0-9]* 2>/dev/null ` ; do
2107 if test -f $i/tclInt.h ; then
2108 ac_cv_c_tclh=`(cd $i; pwd)`
2109 break
2110 fi
2111 # Tcl 7.5 and greater puts headers in subdirectory.
2112 if test -f $i/generic/tclInt.h ; then
2113 ac_cv_c_tclh=`(cd $i; pwd)`/generic
2114 fi
2115 done
2116fi
2117# finally check in a few common install locations
2118#
2119# since ls returns lowest version numbers first, reverse its output
2120if test x"${ac_cv_c_tclh}" = x ; then
2121 for i in \
2122 `ls -dr /usr/local/src/tcl[0-9]* 2>/dev/null` \
2123 `ls -dr /usr/local/lib/tcl[0-9]* 2>/dev/null` \
2124 /usr/local/src/tcl \
2125 /usr/local/lib/tcl \
2126 ${prefix}/include ; do
2127 if test -f $i/tclInt.h ; then
2128 ac_cv_c_tclh=`(cd $i; pwd)`
2129 break
2130 fi
2131 done
2132fi
2133# see if one is installed
2134if test x"${ac_cv_c_tclh}" = x ; then
2135 ac_safe=`echo "tclInt.h" | tr './\055' '___'`
2136echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
5436fc65
C
2137if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2138 echo $ac_n "(cached) $ac_c" 1>&6
2139else
2140 cat > conftest.$ac_ext <<EOF
3dedc867 2141#line 2142 "configure"
5436fc65 2142#include "confdefs.h"
4e327047 2143#include <tclInt.h>
5436fc65 2144EOF
3dedc867
FF
2145ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2146{ (eval echo configure:2147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
2147ac_err=`grep -v '^ *+' conftest.out`
2148if test -z "$ac_err"; then
2149 rm -rf conftest*
2150 eval "ac_cv_header_$ac_safe=yes"
2151else
2152 echo "$ac_err" >&5
2153 rm -rf conftest*
2154 eval "ac_cv_header_$ac_safe=no"
2155fi
2156rm -f conftest*
2157fi
2158if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2159 echo "$ac_t""yes" 1>&6
4e327047 2160 ac_cv_c_tclh=installed
5436fc65
C
2161else
2162 echo "$ac_t""no" 1>&6
4e327047 2163ac_cv_c_tclh=""
5436fc65
C
2164fi
2165
4e327047
TT
2166fi
2167
2168fi
2169
2170if test x"${ac_cv_c_tclh}" = x ; then
2171 TCLHDIR="# no Tcl private headers found"
2172 { echo "configure: error: Can't find Tcl private headers" 1>&2; exit 1; }
2173fi
2174if test x"${ac_cv_c_tclh}" != x ; then
2175 no_tcl=""
2176 if test x"${ac_cv_c_tkh}" = x"installed" ; then
2177 echo "$ac_t""is installed" 1>&6
2178 TCLHDIR=""
2179 else
2180 echo "$ac_t""found in ${ac_cv_c_tclh}" 1>&6
2181 # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
2182 TCLHDIR="-I${ac_cv_c_tclh}"
5436fc65 2183 fi
5436fc65 2184fi
4e327047
TT
2185
2186echo $ac_n "checking Tcl version""... $ac_c" 1>&6
2187rm -rf tclmajor tclminor
2188orig_includes="$CPPFLAGS"
2189
2190if test x"${TCLHDIR}" != x ; then
2191 CPPFLAGS="$CPPFLAGS $TCLHDIR"
2192fi
2193
2194if test "$cross_compiling" = yes; then
2195 { echo "configure: error: can't be cross compiled" 1>&2; exit 1; }
2196
2197else
2198cat > conftest.$ac_ext <<EOF
3dedc867 2199#line 2200 "configure"
4e327047
TT
2200#include "confdefs.h"
2201
2202#include <stdio.h>
2203#include "tcl.h"
2204main() {
2205 FILE *maj = fopen("tclmajor","w");
2206 FILE *min = fopen("tclminor","w");
2207 fprintf(maj,"%d",TCL_MAJOR_VERSION);
2208 fprintf(min,"%d",TCL_MINOR_VERSION);
2209 fclose(maj);
2210 fclose(min);
2211 return 0;
2212}
2213EOF
3dedc867 2214{ (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
4e327047
TT
2215if test -s conftest && (./conftest; exit) 2>/dev/null; then
2216 tclmajor=`cat tclmajor`
2217 tclminor=`cat tclminor`
2218 tclversion=$tclmajor.$tclminor
2219 echo "$ac_t""$tclversion" 1>&6
2220 rm -f tclmajor tclminor
2221
2222else
2223 echo "$ac_t""can't happen" 1>&6
2224
2225fi
5436fc65 2226fi
4e327047
TT
2227rm -fr conftest*
2228CPPFLAGS="${orig_includes}"
2229
5436fc65 2230
4e327047
TT
2231
2232
2233
5436fc65 2234#
4e327047 2235# Ok, lets find the tcl library
5436fc65 2236# First, look for one uninstalled.
4e327047 2237# the alternative search directory is invoked by --with-tcllib
5436fc65 2238#
4e327047
TT
2239
2240if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then
2241 installedtcllibroot=tcl$tclversion
2242else
2243 installedtcllibroot=tcl
2244fi
2245
2246if test x"${no_tcl}" = x ; then
2247 # we reset no_tcl incase something fails here
2248 no_tcl=true
2249 # Check whether --with-tcllib or --without-tcllib was given.
229b2c87
DE
2250if test "${with_tcllib+set}" = set; then
2251 withval="$with_tcllib"
4e327047
TT
2252 with_tcllib=${withval}
2253fi
2254
2255 echo $ac_n "checking for Tcl library""... $ac_c" 1>&6
2256 if eval "test \"`echo '$''{'ac_cv_c_tcllib'+set}'`\" = set"; then
2257 echo $ac_n "(cached) $ac_c" 1>&6
2258else
2259
2260 # First check to see if --with-tcllib was specified.
2261 # This requires checking for both the installed and uninstalled name-styles
2262 # since we have no idea if it's installed or not.
2263 if test x"${with_tcllib}" != x ; then
2264 if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then
2265 ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so
2266 elif test -f "${with_tcllib}/libtcl.so" ; then
2267 ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so
2268 # then look for a freshly built statically linked library
2269 # if Makefile exists we assume its configured and libtcl will be built first.
2270 elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then
2271 ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a
2272 elif test -f "${with_tcllib}/libtcl.a" ; then
2273 ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a
2274 else
2275 { echo "configure: error: ${with_tcllib} directory doesn't contain libraries" 1>&2; exit 1; }
2276 fi
5436fc65 2277 fi
4e327047
TT
2278 # then check for a private Tcl library
2279 # Since these are uninstalled, use the simple lib name root.
2280 if test x"${ac_cv_c_tcllib}" = x ; then
2281 for i in \
2282 ../tcl \
2283 `ls -dr ../tcl[0-9]* 2>/dev/null` \
2284 ../../tcl \
2285 `ls -dr ../../tcl[0-9]* 2>/dev/null` \
2286 ../../../tcl \
2287 `ls -dr ../../../tcl[0-9]* 2>/dev/null` ; do
2288 # Tcl 7.5 and greater puts library in subdir. Look there first.
2289 if test -f "$i/unix/libtcl.so" ; then
2290 ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
2291 break
2292 elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
2293 ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
2294 break
2295 # look for a freshly built dynamically linked library
2296 elif test -f "$i/libtcl.so" ; then
2297 ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
2298 break
2299
2300 # then look for a freshly built statically linked library
2301 # if Makefile exists we assume its configured and libtcl will be
2302 # built first.
2303 elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
2304 ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
2305 break
2306 fi
2307 done
5436fc65 2308 fi
4e327047
TT
2309 # check in a few common install locations
2310 if test x"${ac_cv_c_tcllib}" = x ; then
2311 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
2312 # first look for a freshly built dynamically linked library
2313 if test -f "$i/lib$installedtcllibroot.so" ; then
2314 ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so
2315 break
2316 # then look for a freshly built statically linked library
2317 # if Makefile exists we assume its configured and libtcl will be built first.
2318 elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then
2319 ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a
2320 break
2321 fi
2322 done
5436fc65 2323 fi
4e327047
TT
2324 # check in a few other private locations
2325 if test x"${ac_cv_c_tcllib}" = x ; then
2326 for i in \
2327 ${srcdir}/../tcl \
2328 `ls -dr ${srcdir}/../tcl[0-9]* 2>/dev/null` ; do
2329 # Tcl 7.5 and greater puts library in subdir. Look there first.
2330 if test -f "$i/unix/libtcl.so" ; then
2331 ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
2332 break
2333 elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
2334 ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
2335 break
2336 # look for a freshly built dynamically linked library
2337 elif test -f "$i/libtcl.so" ; then
2338 ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
2339 break
2340
2341 # then look for a freshly built statically linked library
2342 # if Makefile exists we assume its configured and libtcl will be
2343 # built first.
2344 elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
2345 ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
2346 break
2347 fi
2348 done
2349 fi
2350
2351 # see if one is conveniently installed with the compiler
2352 if test x"${ac_cv_c_tcllib}" = x ; then
2353 orig_libs="$LIBS"
2354 LIBS="$LIBS -l$installedtcllibroot -lm"
2355 if test "$cross_compiling" = yes; then
2356 ac_cv_c_tclib="-l$installedtcllibroot"
2357else
2358cat > conftest.$ac_ext <<EOF
3dedc867 2359#line 2360 "configure"
4e327047
TT
2360#include "confdefs.h"
2361
2362 Tcl_AppInit()
2363 { exit(0); }
2364EOF
3dedc867 2365{ (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
4e327047
TT
2366if test -s conftest && (./conftest; exit) 2>/dev/null; then
2367 ac_cv_c_tcllib="-l$installedtcllibroot"
2368else
2369 ac_cv_c_tcllib=""
2370
2371fi
2372fi
2373rm -fr conftest*
2374 LIBS="${orig_libs}"
2375 fi
2376
5436fc65
C
2377fi
2378
4e327047
TT
2379 if test x"${ac_cv_c_tcllib}" = x ; then
2380 TCLLIB="# no Tcl library found"
2381 echo "configure: warning: Can't find Tcl library" 1>&2
2382 else
2383 TCLLIB=${ac_cv_c_tcllib}
2384 echo "$ac_t""found $TCLLIB" 1>&6
2385 no_tcl=
5436fc65 2386 fi
5436fc65
C
2387fi
2388
5436fc65
C
2389
2390
2391
2392
a2b63bbd 2393
4e327047 2394
5436fc65 2395#
4e327047
TT
2396# Ok, lets find the tk source trees so we can use the headers
2397# If the directory (presumably symlink) named "tk" exists, use that one
2398# in preference to any others. Same logic is used when choosing library
2399# and again with Tcl. The search order is the best place to look first, then in
2400# decreasing significance. The loop breaks if the trigger file is found.
2401# Note the gross little conversion here of srcdir by cd'ing to the found
2402# directory. This converts the path from a relative to an absolute, so
2403# recursive cache variables for the path will work right. We check all
2404# the possible paths in one loop rather than many seperate loops to speed
2405# things up.
2406# the alternative search directory is invoked by --with-tkinclude
5436fc65 2407#
4e327047
TT
2408echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
2409# Check whether --with-tkinclude or --without-tkinclude was given.
229b2c87
DE
2410if test "${with_tkinclude+set}" = set; then
2411 withval="$with_tkinclude"
4e327047
TT
2412 with_tkinclude=${withval}
2413fi
2414
2415no_tk=true
2416if eval "test \"`echo '$''{'ac_cv_c_tkh'+set}'`\" = set"; then
2417 echo $ac_n "(cached) $ac_c" 1>&6
2418else
2419
2420# first check to see if --with-tkinclude was specified
2421if test x"${with_tkinclude}" != x ; then
2422 if test -f ${with_tkinclude}/tk.h ; then
2423 ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
5436fc65 2424 else
4e327047
TT
2425 { echo "configure: error: ${with_tkinclude} directory doesn't contain private headers" 1>&2; exit 1; }
2426 fi
2427fi
2428# next check in private source directory
2429#
2430# since ls returns lowest version numbers first, reverse the entire list
2431# and search for the worst fit, overwriting it with better fits as we find them
2432if test x"${ac_cv_c_tkh}" = x ; then
2433 for i in \
2434 ${srcdir}/../tk \
2435 `ls -dr ${srcdir}/../tk[0-9]* 2>/dev/null` \
2436 ${srcdir}/../../tk \
2437 `ls -dr ${srcdir}/../../tk[0-9]* 2>/dev/null` \
2438 ${srcdir}/../../../tk \
2439 `ls -dr ${srcdir}/../../../tk[0-9]* 2>/dev/null ` ; do
2440 if test -f $i/tk.h ; then
2441 ac_cv_c_tkh=`(cd $i; pwd)`
2442 break
2443 fi
2444 # Tk 4.1 and greater puts this in a subdir.
2445 if test -f $i/generic/tk.h; then
2446 ac_cv_c_tkh=`(cd $i; pwd)`/generic
2447 fi
2448 done
2449fi
2450# finally check in a few common install locations
2451#
2452# since ls returns lowest version numbers first, reverse the entire list
2453# and search for the worst fit, overwriting it with better fits as we find them
2454if test x"${ac_cv_c_tkh}" = x ; then
2455 for i in \
2456 `ls -dr /usr/local/src/tk[0-9]* 2>/dev/null` \
2457 `ls -dr /usr/local/lib/tk[0-9]* 2>/dev/null` \
2458 /usr/local/src/tk \
2459 /usr/local/lib/tk \
2460 ${prefix}/include ; do
2461 if test -f $i/tk.h ; then
2462 ac_cv_c_tkh=`(cd $i; pwd)`
2463 break
2464 fi
2465 done
2466fi
2467# see if one is installed
2468if test x"${ac_cv_c_tkh}" = x ; then
2469 ac_safe=`echo "tk.h" | tr './\055' '___'`
2470echo $ac_n "checking for tk.h""... $ac_c" 1>&6
5436fc65
C
2471if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2472 echo $ac_n "(cached) $ac_c" 1>&6
2473else
2474 cat > conftest.$ac_ext <<EOF
3dedc867 2475#line 2476 "configure"
5436fc65 2476#include "confdefs.h"
4e327047 2477#include <tk.h>
5436fc65 2478EOF
3dedc867
FF
2479ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2480{ (eval echo configure:2481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5436fc65
C
2481ac_err=`grep -v '^ *+' conftest.out`
2482if test -z "$ac_err"; then
2483 rm -rf conftest*
2484 eval "ac_cv_header_$ac_safe=yes"
2485else
2486 echo "$ac_err" >&5
2487 rm -rf conftest*
2488 eval "ac_cv_header_$ac_safe=no"
2489fi
2490rm -f conftest*
2491fi
2492if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2493 echo "$ac_t""yes" 1>&6
4e327047 2494 ac_cv_c_tkh=installed
5436fc65
C
2495else
2496 echo "$ac_t""no" 1>&6
2497fi
2498
4e327047
TT
2499fi
2500
2501fi
2502
2503if test x"${ac_cv_c_tkh}" != x ; then
2504 no_tk=""
2505 if test x"${ac_cv_c_tkh}" = x"installed" ; then
2506 echo "$ac_t""is installed" 1>&6
2507 TKHDIR=""
2508 else
2509 echo "$ac_t""found in $ac_cv_c_tkh" 1>&6
2510 # this hack is cause the TKHDIR won't print if there is a "-I" in it.
2511 TKHDIR="-I${ac_cv_c_tkh}"
5436fc65
C
2512 fi
2513else
4e327047
TT
2514 TKHDIR="# no Tk directory found"
2515 echo "configure: warning: Can't find Tk private headers" 1>&2
2516 no_tk=true
5436fc65
C
2517fi
2518
4e327047
TT
2519# if Tk is installed, extract the major/minor version
2520if test x"${no_tk}" = x ; then
2521echo $ac_n "checking Tk version""... $ac_c" 1>&6
2522rm -rf tkmajor tkminor
2523orig_includes="$CPPFLAGS"
2524
2525if test x"${TCLHDIR}" != x ; then
2526 CPPFLAGS="$CPPFLAGS $TCLHDIR"
2527fi
2528if test x"${TKHDIR}" != x ; then
2529 CPPFLAGS="$CPPFLAGS $TKHDIR"
2530fi
2531if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then
2532 CPPFLAGS="$CPPFLAGS -I$x_includes"
2533fi
2534
2535if test "$cross_compiling" = yes; then
2536 { echo "configure: error: can't be cross compiled" 1>&2; exit 1; }
2537
2538else
2539cat > conftest.$ac_ext <<EOF
3dedc867 2540#line 2541 "configure"
4e327047
TT
2541#include "confdefs.h"
2542
2543#include <stdio.h>
2544#include "tk.h"
2545 main() {
2546 FILE *maj = fopen("tkmajor","w");
2547 FILE *min = fopen("tkminor","w");
2548 fprintf(maj,"%d",TK_MAJOR_VERSION);
2549 fprintf(min,"%d",TK_MINOR_VERSION);
2550 fclose(maj);
2551 fclose(min);
2552 return 0;
2553}
2554EOF
3dedc867 2555{ (eval echo configure:2556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
4e327047
TT
2556if test -s conftest && (./conftest; exit) 2>/dev/null; then
2557 tkmajor=`cat tkmajor`
2558 tkminor=`cat tkminor`
2559 tkversion=$tkmajor.$tkminor
2560 echo "$ac_t""$tkversion" 1>&6
2561 rm -f tkmajor tkminor
2562
2563else
2564 { echo "configure: error:
2565cannot compile a simple X program - suspect your xmkmf is
2566misconfigured and is incorrectly reporting the location of your X
2567include or libraries - report this to your system admin" 1>&2; exit 1; }
2568fi
2569fi
2570rm -fr conftest*
2571CPPFLAGS="${orig_includes}"
2572fi
2573
2574
2575
2576
2577
2578
5436fc65 2579#
4e327047
TT
2580# Ok, lets find the tk library
2581# First, look for the latest private (uninstalled) copy
2582# Notice that the destinations in backwards priority since the tests have
2583# no break.
2584# Then we look for either .a, .so, or Makefile. A Makefile is acceptable
2585# is it indicates the target has been configured and will (probably)
2586# soon be built. This allows an entire tree of Tcl software to be
2587# configured at once and then built.
2588# the alternative search directory is invoked by --with-tklib
5436fc65 2589#
4e327047
TT
2590
2591if test x"${no_tk}" = x ; then
2592 # reset no_tk incase something fails here
2593 no_tk="true"
2594
2595 if test $tkmajor -ge 4 ; then
2596 installedtklibroot=tk$tkversion
2597 else
2598 installedtkllibroot=tk
5436fc65 2599 fi
4e327047
TT
2600
2601 # Check whether --with-tklib or --without-tklib was given.
229b2c87
DE
2602if test "${with_tklib+set}" = set; then
2603 withval="$with_tklib"
4e327047 2604 with_tklib=${withval}
5436fc65 2605fi
4e327047
TT
2606
2607 echo $ac_n "checking for Tk library""... $ac_c" 1>&6
2608 if eval "test \"`echo '$''{'ac_cv_c_tklib'+set}'`\" = set"; then
2609 echo $ac_n "(cached) $ac_c" 1>&6
2610else
2611
2612 # first check to see if --with-tklib was specified
2613 # This requires checking for both the installed and uninstalled name-styles
2614 # since we have no idea if it's installed or not.
2615 if test x"${with_tklib}" != x ; then
2616 if test -f "${with_tklib}/lib$installedtklibroot.so" ; then
2617 ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so
2618 no_tk=""
2619 elif test -f "${with_tklib}/libtk.so" ; then
2620 ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so
2621 no_tk=""
2622 # then look for a freshly built statically linked library
2623 # if Makefile exists we assume its configured and libtk will be built
2624 elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then
2625 ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a
2626 no_tk=""
2627 elif test -f "${with_tklib}/libtk.a" ; then
2628 ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a
2629 no_tk=""
2630 else
2631 { echo "configure: error: ${with_tklib} directory doesn't contain libraries" 1>&2; exit 1; }
2632 fi
5436fc65 2633 fi
4e327047
TT
2634 # then check for a private Tk library
2635 # Since these are uninstalled, use the simple lib name root.
2636 if test x"${ac_cv_c_tklib}" = x ; then
2637 for i in \
2638 ../tk \
2639 `ls -dr ../tk[0-9]* 2>/dev/null` \
2640 ../../tk \
2641 `ls -dr ../../tk[0-9]* 2>/dev/null` \
2642 ../../../tk \
2643 `ls -dr ../../../tk[0-9]* 2>/dev/null` ; do
2644 # Tk 4.1 and greater puts things in subdirs. Check these first.
2645 if test -f "$i/unix/libtk.so" ; then
2646 ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
2647 no_tk=
2648 break
2649 elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
2650 ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a
2651 no_tk=
2652 break
2653 # look for a freshly built dynamically linked library
2654 elif test -f "$i/libtk.so" ; then
2655 ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
2656 no_tk=
2657 break
2658 # then look for a freshly built statically linked library
2659 # if Makefile exists we assume its configured and libtk will be built
2660 elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
2661 ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
2662 no_tk=""
2663 break
2664 fi
2665 done
2666 fi
2667 # finally check in a few common install locations
2668 if test x"${ac_cv_c_tklib}" = x ; then
2669 for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
2670 # first look for a freshly built dynamically linked library
2671 if test -f "$i/lib$installedtklibroot.so" ; then
2672 ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so
2673 no_tk=""
2674 break
2675 # then look for a freshly built statically linked library
2676 # if Makefile exists, we assume it's configured and libtcl will be built
2677 elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then
2678 ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a
2679 no_tk=""
2680 break
2681 fi
2682 done
2683 fi
2684 # check in a few other private locations
2685 if test x"${ac_cv_c_tklib}" = x ; then
2686 for i in \
2687 ${srcdir}/../tk \
2688 `ls -dr ${srcdir}/../tk[0-9]* 2>/dev/null` ; do
2689 # Tk 4.1 and greater puts things in subdirs. Check these first.
2690 if test -f "$i/unix/libtk.so" ; then
2691 ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
2692 no_tk=
2693 break
2694 elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
2695 ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a
2696 no_tk=
2697 break
2698 # look for a freshly built dynamically linked library
2699 elif test -f "$i/libtk.so" ; then
2700 ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
2701 no_tk=""
2702 break
2703 # then look for a freshly built statically linked library
2704 # if Makefile exists, we assume it's configured and libtcl will be built
2705 elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
2706 ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
2707 no_tk=""
2708 break
2709 fi
2710 done
2711 fi
2712 # see if one is conveniently installed with the compiler
2713 if test x"${ac_cv_c_tklib}" = x ; then
2714
2715 orig_libs="$LIBS"
2716 LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm"
2717 if test "$cross_compiling" = yes; then
2718 ac_cv_c_tklib="-l$installedtklibroot"
2719else
2720cat > conftest.$ac_ext <<EOF
3dedc867 2721#line 2722 "configure"
4e327047 2722#include "confdefs.h"
5436fc65 2723
4e327047
TT
2724 Tcl_AppInit()
2725 { exit(0); }
2726EOF
3dedc867 2727{ (eval echo configure:2728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
4e327047
TT
2728if test -s conftest && (./conftest; exit) 2>/dev/null; then
2729 ac_cv_c_tklib="-l$installedtklibroot"
5436fc65 2730else
4e327047
TT
2731 ac_cv_c_tklib=""
2732
2733fi
2734fi
2735rm -fr conftest*
2736 LIBS="${orig_libs}"
2737 fi
2738
2739fi
2740
2741 if test x"${ac_cv_c_tklib}" = x ; then
2742 TKLIB="# no Tk library found"
2743 echo "configure: warning: Can't find Tk library" 1>&2
2744 else
2745 TKLIB=$ac_cv_c_tklib
2746 echo "$ac_t""found $TKLIB" 1>&6
2747 no_tk=
2748 fi
5436fc65
C
2749fi
2750
2751
2752
2753
2754
1a57cd09
TT
2755 # Look for dynamic linking libraries that Tcl might need. This is
2756 # only done for Tcl 7.5 and greater. It would be good to look for and
2757 # use the "configInfo" file that Tcl generates, but for now that is
2758 # beyond us.
2759 if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then
2760 echo $ac_n "checking for -ldl""... $ac_c" 1>&6
3dedc867 2761ac_lib_var=`echo dl_main | tr '.-/+' '___p'`
229b2c87 2762if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1a57cd09
TT
2763 echo $ac_n "(cached) $ac_c" 1>&6
2764else
2765 ac_save_LIBS="$LIBS"
2766LIBS="-ldl $LIBS"
2767cat > conftest.$ac_ext <<EOF
3dedc867 2768#line 2769 "configure"
1a57cd09
TT
2769#include "confdefs.h"
2770
2771int main() { return 0; }
2772int t() {
2773main()
2774; return 0; }
2775EOF
3dedc867 2776if { (eval echo configure:2777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1a57cd09 2777 rm -rf conftest*
229b2c87 2778 eval "ac_cv_lib_$ac_lib_var=yes"
1a57cd09
TT
2779else
2780 rm -rf conftest*
229b2c87 2781 eval "ac_cv_lib_$ac_lib_var=no"
1a57cd09
TT
2782fi
2783rm -f conftest*
2784LIBS="$ac_save_LIBS"
2785
2786fi
229b2c87 2787if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1a57cd09 2788 echo "$ac_t""yes" 1>&6
229b2c87 2789 ac_tr_lib=HAVE_LIB`echo dl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1a57cd09
TT
2790 cat >> confdefs.h <<EOF
2791#define $ac_tr_lib 1
2792EOF
2793
2794 LIBS="-ldl $LIBS"
2795
2796else
2797 echo "$ac_t""no" 1>&6
2798echo $ac_n "checking for -ldld""... $ac_c" 1>&6
3dedc867 2799ac_lib_var=`echo dld_main | tr '.-/+' '___p'`
229b2c87 2800if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1a57cd09
TT
2801 echo $ac_n "(cached) $ac_c" 1>&6
2802else
2803 ac_save_LIBS="$LIBS"
2804LIBS="-ldld $LIBS"
2805cat > conftest.$ac_ext <<EOF
3dedc867 2806#line 2807 "configure"
1a57cd09
TT
2807#include "confdefs.h"
2808
2809int main() { return 0; }
2810int t() {
2811main()
2812; return 0; }
2813EOF
3dedc867 2814if { (eval echo configure:2815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
1a57cd09 2815 rm -rf conftest*
229b2c87 2816 eval "ac_cv_lib_$ac_lib_var=yes"
1a57cd09
TT
2817else
2818 rm -rf conftest*
229b2c87 2819 eval "ac_cv_lib_$ac_lib_var=no"
1a57cd09
TT
2820fi
2821rm -f conftest*
2822LIBS="$ac_save_LIBS"
2823
2824fi
229b2c87 2825if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1a57cd09 2826 echo "$ac_t""yes" 1>&6
229b2c87 2827 ac_tr_lib=HAVE_LIB`echo dld | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1a57cd09
TT
2828 cat >> confdefs.h <<EOF
2829#define $ac_tr_lib 1
2830EOF
2831
2832 LIBS="-ldld $LIBS"
2833
2834else
2835 echo "$ac_t""no" 1>&6
2836fi
2837
2838fi
2839
2840 fi
2841
a2b63bbd 2842 ENABLE_GDBTK=1
66efdff9 2843
a2b63bbd
JM
2844 if test "x$no_x" != "xyes"; then
2845 if test "x$x_includes" != "x" ;
2846 then
2847 X_CFLAGS="-I$x_includes"
2848 else
2849 X_CFLAGS=""
2850 fi
2851
2852 if test "x$x_libraries" != "x" ;
2853 then
2854 X_LDFLAGS="-L$x_libraries"
2855 else
2856 X_LDFLAGS=""
2857 fi
2858
2859 case "$host" in
2860#
2861# gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
2862#
146ee7db 2863 sparc*-sun-solaris2*)
a2b63bbd
JM
2864 if test "x$GCC" = "xyes";
2865 then
127841e4 2866 X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw"
a2b63bbd
JM
2867 else
2868 if test "x$x_libraries" != "x" ;
2869 then
2870 X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
2871 fi
2872 X_LIBS="-lX11 -lXext -lX11"
2873 fi ;;
2874#
2875# gdb linked statically w/ SunOS or HPUX
2876#
2877 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
2878 if test "x$x_libraries" != "x" ;
2879 then
2880 X_LIBS="$x_libraries/libX11.a"
2881 else
2882 X_LIBS="/usr/lib/libX11.a"
2883 fi ;;
2884#
2885# default is to link dynamically
2886#
2887 *)
2888 X_LIBS="-lX11" ;;
2889 esac
2890 else
2891 X_LDLAGS=""
2892 X_CFLAGS=""
2893 X_LIBS=""
2894 echo "configure: warning: No X based programs will be built" 1>&2
2895 fi
2896
2897 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
2898 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
2899 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
2900fi
66efdff9 2901
66efdff9 2902
5436fc65 2903
66efdff9
JM
2904
2905
5436fc65
C
2906# end-sanitize-gdbtk
2907
2908
2909
2910
2911
7c40dd08
DE
2912# target_subdir is used by the testsuite to find the target libraries.
2913target_subdir=
2914if test "${host}" != "${target}"; then
2915 target_subdir="${target_alias}/"
2916fi
2917
5436fc65
C
2918
2919configdirs="doc testsuite"
2920
2921
2922# Map host cpu into the config cpu subdirectory name.
2923# The default is $host_cpu.
2924
2925case "${host_cpu}" in
2926
2927c[12]) gdb_host_cpu=convex ;;
2928hppa*) gdb_host_cpu=pa ;;
3222ff2e 2929i[3456]86) gdb_host_cpu=i386 ;;
5436fc65
C
2930m68*) gdb_host_cpu=m68k ;;
2931m88*) gdb_host_cpu=m88k ;;
2932np1) gdb_host_cpu=gould ;;
2933pyramid) gdb_host_cpu=pyr ;;
2934powerpc*) gdb_host_cpu=powerpc ;;
146ee7db 2935sparc64) gdb_host_cpu=sparc ;;
5436fc65
C
2936*) gdb_host_cpu=$host_cpu ;;
2937
2938esac
2939
2940# map host info into gdb names.
2941
2942case "${host}" in
2943
2944a29k-*-*) gdb_host=ultra3 ;;
2945
2946alpha-*-osf1*) gdb_host=alpha-osf1 ;;
b8ea4fec
PS
2947alpha-*-osf2*) gdb_host=alpha-osf2 ;;
2948alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
5436fc65
C
2949
2950arm-*-*) gdb_host=arm ;;
2951
2952c[12]-*-*) gdb_host=convex ;;
2953
2954hppa*-*-bsd*) gdb_host=hppabsd ;;
2955hppa*-*-hiux*) gdb_host=hppahpux ;;
2956hppa*-*-hpux*) gdb_host=hppahpux ;;
2957hppa*-*-osf*) gdb_host=hppaosf ;;
2958
3222ff2e
MM
2959i[3456]86-ncr-*) gdb_host=ncr3000 ;;
2960i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
2961i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
2962i[3456]86-sequent-sysv*) gdb_host=ptx ;;
2963i[3456]86-*-aix*) gdb_host=i386aix ;;
2964i[3456]86-*-bsd*) gdb_host=i386bsd ;;
2965i[3456]86-*-dgux*) gdb_host=i386dgux ;;
2966i[3456]86-*-freebsd*) gdb_host=fbsd ;;
2967i[3456]86-*-netbsd*) gdb_host=nbsd ;;
2968i[3456]86-*-go32*) gdb_host=go32 ;;
2969i[3456]86-*-linux*) gdb_host=linux ;;
2970i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
2971i[3456]86-*-mach3*) gdb_host=i386m3 ;;
2972i[3456]86-*-mach*) gdb_host=i386mach ;;
2973i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
2974i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
2975i[3456]86-*-sco*) gdb_host=i386sco ;;
2976i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
2977i[3456]86-*-sunos*) gdb_host=sun386 ;;
2978i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
2979i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
2980i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
2981i[3456]86-*-unixware) gdb_host=i386v4 ;;
2982i[3456]86-*-sysv*) gdb_host=i386v ;;
2983i[3456]86-*-isc*) gdb_host=i386v32 ;;
2984i[3456]86-*-os9k) gdb_host=i386os9k ;;
3d78f532 2985i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
5436fc65
C
2986m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
2987m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
2988m68030-sony-*) gdb_host=news1000 ;;
2989
2990m68*-altos-*) gdb_host=altos ;;
2991m68*-apollo*-sysv*) gdb_host=apollo68v ;;
2992m68*-apollo*-bsd*) gdb_host=apollo68b ;;
2993m68*-att-*) gdb_host=3b1 ;;
2994m68*-bull*-sysv*) gdb_host=dpx2 ;;
2995m68*-hp-bsd*) gdb_host=hp300bsd ;;
2996m68*-hp-hpux*) gdb_host=hp300hpux ;;
2997m68*-isi-*) gdb_host=isi ;;
2998m68*-*-lynxos*) gdb_host=m68klynx ;;
b7f3b6d5 2999m68*-*-netbsd*) gdb_host=nbsd ;;
5436fc65
C
3000m68*-*-sysv4*) gdb_host=m68kv4 ;;
3001m68*-motorola-*) gdb_host=delta68 ;;
3002m68*-sony-*) gdb_host=news ;;
3003m68*-sun-sunos3*) gdb_host=sun3os3 ;;
3004m68*-sun-sunos4*) gdb_host=sun3os4 ;;
3005m68*-sun-*) gdb_host=sun3os4 ;;
3006
3007m88*-harris-cxux*) gdb_host=cxux ;;
3008m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
3009m88*-motorola-sysv*) gdb_host=delta88 ;;
3010m88*-*-mach3*) gdb_host=mach3 ;;
3011m88*-*-*) gdb_host=m88k ;;
3012
3013mips-dec-mach3*) gdb_host=mach3 ;;
3014mips-dec-*) gdb_host=decstation ;;
3015mips-little-*) gdb_host=littlemips ;;
3016mips-sgi-irix3*) gdb_host=irix3 ;;
3017mips-sgi-irix4*) gdb_host=irix4 ;;
3018mips-sgi-irix5*) gdb_host=irix5 ;;
3019mips-sony-*) gdb_host=news-mips ;;
3020mips-*-mach3*) gdb_host=mach3 ;;
3021mips-*-sysv4*) gdb_host=mipsv4 ;;
3022mips-*-sysv*) gdb_host=riscos ;;
3023mips-*-riscos*) gdb_host=riscos ;;
3024
3025none-*-*) gdb_host=none ;;
3026
3027np1-*-*) gdb_host=np1 ;;
3028
3029ns32k-*-mach3*) gdb_host=mach3 ;;
3030ns32k-*-netbsd*) gdb_host=nbsd ;;
3031ns32k-umax-*) gdb_host=umax ;;
3032ns32k-utek-sysv*) gdb_host=merlin ;;
3033
fbc3f191 3034powerpc-*-aix*) gdb_host=aix ;;
3d78f532 3035powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
5436fc65
C
3036pn-*-*) gdb_host=pn ;;
3037
3038pyramid-*-*) gdb_host=pyramid ;;
3039
3040romp-*-*) gdb_host=rtbsd ;;
3041
3042rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
a1956677 3043rs6000-*-aix4*) gdb_host=aix4 ;;
5436fc65
C
3044rs6000-*-*) gdb_host=rs6000 ;;
3045
3046sparc-*-lynxos*) gdb_host=sparclynx ;;
3047sparc-*-netbsd*) gdb_host=nbsd ;;
3048sparc-*-solaris2*) gdb_host=sun4sol2 ;;
3049sparc-*-sunos4*) gdb_host=sun4os4 ;;
3050sparc-*-sunos5*) gdb_host=sun4sol2 ;;
3051sparc-*-*) gdb_host=sun4os4 ;;
146ee7db 3052sparc64-*-*) gdb_host=sun4sol2 ;;
5436fc65
C
3053
3054tahoe-*-*) gdb_host=tahoe ;;
3055
3056vax-*-bsd*) gdb_host=vaxbsd ;;
3057vax-*-ultrix2*) gdb_host=vaxult2 ;;
3058vax-*-ultrix*) gdb_host=vaxult ;;
3059
3060w65-*-*) gdb_host=w65 ;;
3061
3062esac
3063
3064
3065# Map target cpu into the config cpu subdirectory name.
3066# The default is $target_cpu.
3067
3068case "${target_cpu}" in
3069
3070alpha) gdb_target_cpu=alpha ;;
3071c[12]) gdb_target_cpu=convex ;;
3072hppa*) gdb_target_cpu=pa ;;
3222ff2e 3073i[3456]86) gdb_target_cpu=i386 ;;
5436fc65
C
3074m68*) gdb_target_cpu=m68k ;;
3075m88*) gdb_target_cpu=m88k ;;
3076mips*) gdb_target_cpu=mips ;;
3077np1) gdb_target_cpu=gould ;;
3078powerpc*) gdb_target_cpu=powerpc ;;
3079pn) gdb_target_cpu=gould ;;
3080pyramid) gdb_target_cpu=pyr ;;
5436fc65
C
3081sparc*) gdb_target_cpu=sparc ;;
3082*) gdb_target_cpu=$target_cpu ;;
3083
3084esac
3085
3086# map target info into gdb names.
3087
3088case "${target}" in
3089
3090a29k-*-aout*) gdb_target=a29k ;;
3091a29k-*-coff*) gdb_target=a29k ;;
3092a29k-*-elf*) gdb_target=a29k ;;
3093a29k-*-ebmon*) gdb_target=a29k ;;
3094a29k-*-kern*) gdb_target=a29k-kern ;;
3095a29k-*-none*) gdb_target=a29k ;;
3096a29k-*-sym1*) gdb_target=ultra3 ;;
3097a29k-*-udi*) gdb_target=a29k-udi ;;
3098a29k-*-vxworks*) gdb_target=vx29k ;;
3099
3100alpha-*-osf*) gdb_target=alpha-osf1 ;;
3101
3102# start-sanitize-arc
3103arc-*-*) gdb_target=arc ;;
3104# end-sanitize-arc
3105
3106arm-*-*) gdb_target=arm ;;
3107
3108c1-*-*) gdb_target=convex ;;
3109c2-*-*) gdb_target=convex ;;
3110
fb506180
SS
3111h8300-*-*) gdb_target=h8300 ;;
3112h8500-*-*) gdb_target=h8500 ;;
5436fc65
C
3113
3114sh-*-*) gdb_target=sh ;;
3115
3116# start-sanitize-r16
3117r16-*-*) gdb_target=r16 ;;
3118# end-sanitize-r16
3119
3120hppa*-*-bsd*) gdb_target=hppabsd ;;
3121hppa*-*-pro*) gdb_target=hppapro ;;
3122hppa*-*-hpux*) gdb_target=hppahpux ;;
3123hppa*-*-hiux*) gdb_target=hppahpux ;;
3124hppa*-*-osf*) gdb_target=hppaosf ;;
3125
3222ff2e
MM
3126i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
3127i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
3128i[3456]86-sequent-sysv*) gdb_target=ptx ;;
3129i[3456]86-ncr-*) gdb_target=ncr3000 ;;
3130i[3456]86-*-aout*) gdb_target=i386aout ;;
3131i[3456]86-*-coff*) gdb_target=i386v ;;
3132i[3456]86-*-elf*) gdb_target=i386v ;;
3133i[3456]86-*-aix*) gdb_target=i386aix ;;
3134i[3456]86-*-bsd*) gdb_target=i386bsd ;;
3135i[3456]86-*-freebsd*) gdb_target=fbsd ;;
3136i[3456]86-*-netbsd*) gdb_target=nbsd ;;
3137i[3456]86-*-os9k) gdb_target=i386os9k ;;
3138i[3456]86-*-go32*) gdb_target=i386aout ;;
3139i[3456]86-*-lynxos*) gdb_target=i386lynx
5436fc65 3140 configdirs="${configdirs} gdbserver" ;;
3222ff2e
MM
3141i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
3142i[3456]86-*-sunos*) gdb_target=sun386 ;;
3143i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
3144i[3456]86-*-sco*) gdb_target=i386v ;;
3145i[3456]86-*-sysv*) gdb_target=i386v ;;
3dedc867
FF
3146i[3456]86-*-linux*) gdb_target=linux
3147 configdirs="${configdirs} gdbserver" ;;
3222ff2e
MM
3148i[3456]86-*-isc*) gdb_target=i386v ;;
3149i[3456]86-*-mach3*) gdb_target=i386m3 ;;
3150i[3456]86-*-mach*) gdb_target=i386mach ;;
3151i[3456]86-*-netware*) gdb_target=i386nw
5436fc65 3152 configdirs="${configdirs} nlm" ;;
3222ff2e 3153i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
3d78f532 3154i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
5436fc65 3155i960-*-bout*) gdb_target=vxworks960 ;;
2e665cd3
DP
3156i960-nindy-coff*) gdb_target=nindy960 ;;
3157i960-*-coff*) gdb_target=mon960 ;;
3158i960-nindy-elf*) gdb_target=nindy960 ;;
3159i960-*-elf*) gdb_target=mon960 ;;
5436fc65
C
3160
3161i960-*-nindy*) gdb_target=nindy960 ;;
3162i960-*-vxworks*) gdb_target=vxworks960 ;;
3163
3164m68000-*-sunos3*) gdb_target=sun2os3 ;;
3165m68000-*-sunos4*) gdb_target=sun2os4 ;;
3166
3167m68*-apollo*-bsd*) gdb_target=apollo68b ;;
3168m68*-bull-sysv*) gdb_target=dpx2 ;;
3169m68*-hp-bsd*) gdb_target=hp300bsd ;;
3170m68*-hp-hpux*) gdb_target=hp300hpux ;;
3171m68*-altos-*) gdb_target=altos ;;
3172m68*-att-*) gdb_target=3b1 ;;
3173m68*-cisco*-*) gdb_target=cisco ;;
3174m68*-ericsson-*) gdb_target=es1800 ;;
3175m68*-isi-*) gdb_target=isi ;;
3176m68*-motorola-*) gdb_target=delta68 ;;
3177m68*-netx-*) gdb_target=vxworks68 ;;
3178m68*-sony-*) gdb_target=news ;;
3179m68*-tandem-*) gdb_target=st2000 ;;
3180m68*-rom68k-*) gdb_target=monitor ;;
3181m68*-*bug-*) gdb_target=monitor ;;
3182m68*-monitor-*) gdb_target=monitor ;;
949e2bbf 3183m68*-est-*) gdb_target=monitor ;;
5436fc65
C
3184m68*-*-aout*) gdb_target=monitor ;;
3185m68*-*-coff*) gdb_target=monitor ;;
3186m68*-*-elf*) gdb_target=monitor ;;
3187m68*-*-lynxos*) gdb_target=m68klynx
3188 configdirs="${configdirs} gdbserver" ;;
b7f3b6d5 3189m68*-*-netbsd*) gdb_target=nbsd ;;
5436fc65
C
3190m68*-*-os68k*) gdb_target=os68k ;;
3191m68*-*-sunos3*) gdb_target=sun3os3 ;;
3192m68*-*-sunos4*) gdb_target=sun3os4 ;;
3193m68*-*-sysv4*) gdb_target=m68kv4 ;;
3194m68*-*-vxworks*) gdb_target=vxworks68 ;;
3195
3196m88*-harris-cxux*) gdb_target=cxux ;;
3197m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
3198m88*-*-mach3*) gdb_target=mach3 ;;
3199m88*-motorola-*) gdb_target=delta88 ;;
3200m88*-*-*) gdb_target=m88k ;;
3201
3202mips64*-big-*) gdb_target=bigmips64 ;;
3203mips*-big-*) gdb_target=bigmips ;;
3204mips*-dec-mach3*) gdb_target=mach3 ;;
3205mips*-dec-*) gdb_target=decstation ;;
7bb5e831
RS
3206mips64*el-*-ecoff*) gdb_target=embedl64 ;;
3207mips64*-*-ecoff*) gdb_target=embed64 ;;
0e3a4b1e
JSC
3208mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
3209mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
7bb5e831
RS
3210mips64*el-*-elf*) gdb_target=embedl64 ;;
3211mips64*-*-elf*) gdb_target=embed64 ;;
3212mips*el-*-ecoff*) gdb_target=embedl ;;
3213mips*-*-ecoff*) gdb_target=embed ;;
cd10c7e3 3214# start-sanitize-gm
7bb5e831 3215mips*-*-magic*) gdb_target=embed ;;
cd10c7e3 3216# end-sanitize-gm
7bb5e831
RS
3217mips*el-*-elf*) gdb_target=embedl ;;
3218mips*-*-elf*) gdb_target=embed ;;
5436fc65
C
3219mips*-little-*) gdb_target=littlemips ;;
3220mips*-sgi-irix5*) gdb_target=irix5 ;;
3221mips*-sgi-*) gdb_target=irix3 ;;
3222mips*-sony-*) gdb_target=bigmips ;;
3223mips*-*-mach3*) gdb_target=mach3 ;;
3224mips*-*-sysv4*) gdb_target=mipsv4 ;;
3225mips*-*-sysv*) gdb_target=bigmips ;;
3226mips*-*-riscos*) gdb_target=bigmips ;;
3dedc867 3227mips*-*-vxworks*) gdb_target=vxmips ;;
5436fc65
C
3228
3229none-*-*) gdb_target=none ;;
3230
3231np1-*-*) gdb_target=np1 ;;
3232
3233ns32k-*-mach3*) gdb_target=mach3 ;;
3234ns32k-*-netbsd*) gdb_target=nbsd ;;
3235ns32k-utek-sysv*) gdb_target=merlin ;;
3236ns32k-utek-*) gdb_target=umax ;;
3237
3238pn-*-*) gdb_target=pn ;;
c148ab3c 3239powerpc-*-macos*) gdb_target=macos ;;
5436fc65
C
3240powerpc-*-netware*) gdb_target=ppc-nw
3241 configdirs="${configdirs} nlm" ;;
3242
65eaea27 3243powerpc-*-aix4*) gdb_target=aix4 ;;
fbc3f191 3244powerpc-*-aix*) gdb_target=aix ;;
3d78f532 3245powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
3c0bf315
MM
3246powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
3247 gdb_target=ppc-sim
3248 else
3249 gdb_target=ppc-eabi
3250 fi ;;
3251powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
3252 gdb_target=ppcle-sim
3253 else
3254 gdb_target=ppcle-eabi
3255 fi ;;
5436fc65
C
3256
3257pyramid-*-*) gdb_target=pyramid ;;
3258
3259rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
65eaea27 3260rs6000-*-aix4*) gdb_target=aix4 ;;
5436fc65
C
3261rs6000-*-*) gdb_target=rs6000 ;;
3262
3263sparc-*-aout*) gdb_target=sparc-em ;;
3264sparc-*-coff*) gdb_target=sparc-em ;;
3265sparc-*-elf*) gdb_target=sparc-em ;;
3266sparc-*-lynxos*) gdb_target=sparclynx
3267 configdirs="${configdirs} gdbserver" ;;
3268sparc-*-netbsd*) gdb_target=nbsd ;;
3269sparc-*-solaris2*) gdb_target=sun4sol2 ;;
3270sparc-*-sunos4*) gdb_target=sun4os4 ;;
3271sparc-*-sunos5*) gdb_target=sun4sol2 ;;
3272sparc-*-vxworks*) gdb_target=vxsparc ;;
3273sparc-*-*) gdb_target=sun4os4 ;;
229b2c87
DE
3274# Use sparc-em for sparclet for now.
3275sparclet-*-*) gdb_target=sparc-em ;;
5436fc65 3276sparclite*-*-*) gdb_target=sparclite ;;
146ee7db 3277sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
5436fc65
C
3278sparc64-*-*) gdb_target=sp64 ;;
3279
3280tahoe-*-*) gdb_target=tahoe ;;
3281
3282vax-*-*) gdb_target=vax ;;
3283
3284w65-*-*) gdb_target=w65 ;;
3285
fb506180 3286z8k-*-coff*) gdb_target=z8k ;;
5436fc65
C
3287
3288esac
3289
3290
5f107900 3291frags=
5436fc65
C
3292host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
3293if test ! -f ${host_makefile_frag}; then
3294{ echo "configure: error: "*** Gdb does not support host ${host}"" 1>&2; exit 1; }
3295fi
5f107900 3296frags="$frags $host_makefile_frag"
5436fc65
C
3297
3298target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
3299if test ! -f ${target_makefile_frag}; then
3300{ echo "configure: error: "*** Gdb does not support target ${target}"" 1>&2; exit 1; }
3301fi
5f107900 3302frags="$frags $target_makefile_frag"
5436fc65
C
3303
3304
3305
3306
3307
094fd4ae
C
3308hostfile=`sed -n '
3309s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
3310' ${host_makefile_frag}`
5436fc65 3311
094fd4ae
C
3312targetfile=`sed -n '
3313s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
3314' ${target_makefile_frag}`
5436fc65
C
3315
3316# these really aren't orthogonal true/false values of the same condition,
3317# but shells are slow enough that I like to reuse the test conditions
3318# whenever possible
3319if test "${target}" = "${host}"; then
094fd4ae
C
3320nativefile=`sed -n '
3321s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
3322' ${host_makefile_frag}`
5436fc65
C
3323else
3324# GDBserver is only useful in a "native" enviroment
3325configdirs=`echo $configdirs | sed 's/gdbserver//'`
3326fi
3327
094fd4ae 3328
5436fc65
C
3329# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
3330# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
3331# corresponding links. But we have to remove the xm.h files and tm.h
3332# files anyway, e.g. when switching from "configure host" to
3333# "configure none".
3334
3335files=
3336links=
3337rm -f xm.h
3338if test "${hostfile}" != ""; then
3339files="${files} config/${gdb_host_cpu}/${hostfile}"
3340links="${links} xm.h"
3341fi
3342rm -f tm.h
3343if test "${targetfile}" != ""; then
3344files="${files} config/${gdb_target_cpu}/${targetfile}"
3345links="${links} tm.h"
3346fi
3347rm -f nm.h
3348if test "${nativefile}" != ""; then
3349files="${files} config/${gdb_host_cpu}/${nativefile}"
3350links="${links} nm.h"
3351else
3352# A cross-only configuration.
3353files="${files} config/nm-empty.h"
3354links="${links} nm.h"
3355fi
3356# start-sanitize-gdbtk
3357
3358# Make it possible to use the GUI without doing a full install
3359if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
3360files="${files} gdbtk.tcl"
3361links="${links} gdbtk.tcl"
3362fi
3363# end-sanitize-gdbtk
3364
3365
3366
3367subdirs="$configdirs"
3368
3369trap '' 1 2 15
3370cat > confcache <<\EOF
3371# This file is a shell script that caches the results of configure
3372# tests run on this system so they can be shared between configure
3373# scripts and configure runs. It is not useful on other systems.
3374# If it contains results you don't want to keep, you may remove or edit it.
3375#
3376# By default, configure uses ./config.cache as the cache file,
3377# creating it if it does not exist already. You can give configure
3378# the --cache-file=FILE option to use a different cache file; that is
3379# what configure does when it calls configure scripts in
3380# subdirectories, so they share the cache.
3381# Giving --cache-file=/dev/null disables caching, for debugging configure.
3382# config.status only pays attention to the cache file if you give it the
3383# --recheck option to rerun configure.
3384#
3385EOF
3386# Ultrix sh set writes to stderr and can't be redirected directly,
3387# and sets the high bit in the cache file unless we assign to the vars.
3388(set) 2>&1 |
3389 sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
3390 >> confcache
3391if cmp -s $cache_file confcache; then
3392 :
3393else
3394 if test -w $cache_file; then
3395 echo "updating cache $cache_file"
3396 cat confcache > $cache_file
3397 else
3398 echo "not updating unwritable cache $cache_file"
3399 fi
3400fi
3401rm -f confcache
3402
3403trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3404
3405test "x$prefix" = xNONE && prefix=$ac_default_prefix
3406# Let make expand exec_prefix.
3407test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3408
3409# Any assignment to VPATH causes Sun make to only execute
3410# the first set of double-colon rules, so remove it if not needed.
3411# If there is a colon in the path, we need to keep it.
3412if test "x$srcdir" = x.; then
3413 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
3414fi
3415
3416trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3417
3418# Transform confdefs.h into DEFS.
3419# Protect against shell expansion while executing Makefile rules.
3420# Protect against Makefile macro expansion.
3421cat > conftest.defs <<\EOF
3dedc867 3422s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
5436fc65
C
3423s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
3424s%\[%\\&%g
3425s%\]%\\&%g
3426s%\$%$$%g
3427EOF
3428DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
3429rm -f conftest.defs
3430
3431
3432# Without the "./", some shells look in PATH for config.status.
3433: ${CONFIG_STATUS=./config.status}
3434
3435echo creating $CONFIG_STATUS
3436rm -f $CONFIG_STATUS
3437cat > $CONFIG_STATUS <<EOF
3438#! /bin/sh
3439# Generated automatically by configure.
3440# Run this file to recreate the current configuration.
3441# This directory was configured as follows,
3442# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3443#
3444# $0 $ac_configure_args
3445#
3446# Compiler output produced by configure, useful for debugging
3447# configure, is in ./config.log if it exists.
3448
3449ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3450for ac_option
3451do
3452 case "\$ac_option" in
3453 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3454 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3455 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3456 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3dedc867 3457 echo "$CONFIG_STATUS generated by autoconf version 2.8"
5436fc65
C
3458 exit 0 ;;
3459 -help | --help | --hel | --he | --h)
3460 echo "\$ac_cs_usage"; exit 0 ;;
3461 *) echo "\$ac_cs_usage"; exit 1 ;;
3462 esac
3463done
3464
3465ac_given_srcdir=$srcdir
3466ac_given_INSTALL="$INSTALL"
3467
3468trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
229b2c87
DE
3469EOF
3470cat >> $CONFIG_STATUS <<EOF
5436fc65 3471
229b2c87
DE
3472# Protect against being on the right side of a sed subst in config.status.
3473sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3474 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
5436fc65
C
3475$ac_vpsub
3476$extrasub
3477s%@CFLAGS@%$CFLAGS%g
3478s%@CPPFLAGS@%$CPPFLAGS%g
3479s%@CXXFLAGS@%$CXXFLAGS%g
3480s%@DEFS@%$DEFS%g
3481s%@LDFLAGS@%$LDFLAGS%g
3482s%@LIBS@%$LIBS%g
3483s%@exec_prefix@%$exec_prefix%g
3484s%@prefix@%$prefix%g
3485s%@program_transform_name@%$program_transform_name%g
229b2c87
DE
3486s%@bindir@%$bindir%g
3487s%@sbindir@%$sbindir%g
3488s%@libexecdir@%$libexecdir%g
3489s%@datadir@%$datadir%g
3490s%@sysconfdir@%$sysconfdir%g
3491s%@sharedstatedir@%$sharedstatedir%g
3492s%@localstatedir@%$localstatedir%g
3493s%@libdir@%$libdir%g
3494s%@includedir@%$includedir%g
3495s%@oldincludedir@%$oldincludedir%g
3496s%@infodir@%$infodir%g
3497s%@mandir@%$mandir%g
5436fc65
C
3498s%@CC@%$CC%g
3499s%@CPP@%$CPP%g
3500s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3501s%@INSTALL_DATA@%$INSTALL_DATA%g
3502s%@RANLIB@%$RANLIB%g
204c8825 3503s%@YACC@%$YACC%g
5436fc65
C
3504s%@host@%$host%g
3505s%@host_alias@%$host_alias%g
3506s%@host_cpu@%$host_cpu%g
3507s%@host_vendor@%$host_vendor%g
3508s%@host_os@%$host_os%g
3509s%@target@%$target%g
3510s%@target_alias@%$target_alias%g
3511s%@target_cpu@%$target_cpu%g
3512s%@target_vendor@%$target_vendor%g
3513s%@target_os@%$target_os%g
3514s%@build@%$build%g
3515s%@build_alias@%$build_alias%g
3516s%@build_cpu@%$build_cpu%g
3517s%@build_vendor@%$build_vendor%g
3518s%@build_os@%$build_os%g
3519s%@X_CFLAGS@%$X_CFLAGS%g
3520s%@X_PRE_LIBS@%$X_PRE_LIBS%g
3521s%@X_LIBS@%$X_LIBS%g
3522s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
5436fc65
C
3523s%@TCLHDIR@%$TCLHDIR%g
3524s%@TCLLIB@%$TCLLIB%g
4e327047
TT
3525s%@TKHDIR@%$TKHDIR%g
3526s%@TKLIB@%$TKLIB%g
5436fc65 3527s%@ENABLE_GDBTK@%$ENABLE_GDBTK%g
a2b63bbd 3528s%@X_LDFLAGS@%$X_LDFLAGS%g
5436fc65
C
3529s%@ENABLE_CFLAGS@%$ENABLE_CFLAGS%g
3530s%@ENABLE_CLIBS@%$ENABLE_CLIBS%g
3531s%@ENABLE_OBS@%$ENABLE_OBS%g
7c40dd08 3532s%@target_subdir@%$target_subdir%g
5436fc65
C
3533/@host_makefile_frag@/r $host_makefile_frag
3534s%@host_makefile_frag@%%g
3535/@target_makefile_frag@/r $target_makefile_frag
3536s%@target_makefile_frag@%%g
5f107900 3537s%@frags@%$frags%g
5436fc65
C
3538s%@subdirs@%$subdirs%g
3539
3540CEOF
3541EOF
3542cat >> $CONFIG_STATUS <<EOF
3543
3544CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
3545EOF
3546cat >> $CONFIG_STATUS <<\EOF
3547for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3548 # Support "outfile[:infile]", defaulting infile="outfile.in".
3549 case "$ac_file" in
3550 *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
3551 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3552 *) ac_file_in="${ac_file}.in" ;;
3553 esac
3554
3555 # Adjust relative srcdir, etc. for subdirectories.
3556
3557 # Remove last slash and all that follows it. Not all systems have dirname.
3558 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3559 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3560 # The file is in a subdirectory.
3561 test ! -d "$ac_dir" && mkdir "$ac_dir"
3562 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3563 # A "../" for each directory in $ac_dir_suffix.
3564 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3565 else
3566 ac_dir_suffix= ac_dots=
3567 fi
3568
3569 case "$ac_given_srcdir" in
3570 .) srcdir=.
3571 if test -z "$ac_dots"; then top_srcdir=.
3572 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3573 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3574 *) # Relative path.
3575 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3576 top_srcdir="$ac_dots$ac_given_srcdir" ;;
3577 esac
3578
3579 case "$ac_given_INSTALL" in
3580 [/$]*) INSTALL="$ac_given_INSTALL" ;;
3581 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3582 esac
3583 echo creating "$ac_file"
3584 rm -f "$ac_file"
3585 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3586 case "$ac_file" in
3587 *Makefile*) ac_comsub="1i\\
3588# $configure_input" ;;
3589 *) ac_comsub= ;;
3590 esac
3591 sed -e "$ac_comsub
3592s%@configure_input@%$configure_input%g
3593s%@srcdir@%$srcdir%g
3594s%@top_srcdir@%$top_srcdir%g
3595s%@INSTALL@%$INSTALL%g
3596" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
3597fi; done
3598rm -f conftest.subs
3599
3600EOF
3601
3602cat >> $CONFIG_STATUS <<EOF
3603ac_sources="$files"
3604ac_dests="$links"
3605EOF
3606
3607cat >> $CONFIG_STATUS <<\EOF
3608srcdir=$ac_given_srcdir
3609while test -n "$ac_sources"; do
3610 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
3611 set $ac_sources; ac_source=$1; shift; ac_sources=$*
3612
3613 echo "linking $srcdir/$ac_source to $ac_dest"
3614
3615 if test ! -r $srcdir/$ac_source; then
3616 { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
3617 fi
3618 rm -f $ac_dest
3619
3620 # Make relative symlinks.
3621 # Remove last slash and all that follows it. Not all systems have dirname.
3622 ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
3623 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
3624 # The dest file is in a subdirectory.
3625 test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
3626 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
3627 # A "../" for each directory in $ac_dest_dir_suffix.
3628 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
3629 else
3630 ac_dest_dir_suffix= ac_dots=
3631 fi
3632
3633 case "$srcdir" in
3634 [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
3635 *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
3636 esac
3637
3638 # Make a symlink if possible; otherwise try a hard link.
3639 if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
3640 ln $srcdir/$ac_source $ac_dest; then :
3641 else
3642 { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
3643 fi
3644done
0a5a1821
C
3645EOF
3646cat >> $CONFIG_STATUS <<EOF
5436fc65 3647
0a5a1821
C
3648gdb_host_cpu=$gdb_host_cpu
3649gdb_target_cpu=$gdb_target_cpu
3650nativefile=$nativefile
3651
3652EOF
3653cat >> $CONFIG_STATUS <<\EOF
5436fc65
C
3654
3655if test "${nativefile}" = ""; then
3656sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
3657 < Makefile > Makefile.tem
3658mv -f Makefile.tem Makefile
3659fi
3660
3661sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
3662/^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
3663/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
3664mv -f Makefile.tmp Makefile
3665
3666case ${srcdir} in
3667.)
3668;;
3669*)
3670grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
3671echo "source ${srcdir}/.gdbinit" >> .gdbinit
3672esac
3673
3674exit 0
3675EOF
3676chmod +x $CONFIG_STATUS
3677rm -fr confdefs* $ac_clean_files
3678test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3679
3680if test "$no_recursion" != yes; then
3681
3682 # Remove --cache-file and --srcdir arguments so they do not pile up.
3683 ac_sub_configure_args=
3684 ac_prev=
3685 for ac_arg in $ac_configure_args; do
3686 if test -n "$ac_prev"; then
3687 ac_prev=
3688 continue
3689 fi
3690 case "$ac_arg" in
3691 -cache-file | --cache-file | --cache-fil | --cache-fi \
3692 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
3693 ac_prev=cache_file ;;
3694 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
3695 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
3696 ;;
3697 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
3698 ac_prev=srcdir ;;
3699 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
3700 ;;
3701 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
3702 esac
3703 done
3704
3705 for ac_config_dir in $configdirs; do
3706
3707 # Do not complain, so a configure script can configure whichever
3708 # parts of a large source tree are present.
3709 if test ! -d $srcdir/$ac_config_dir; then
3710 continue
3711 fi
3712
3713 echo configuring in $ac_config_dir
3714
3715 case "$srcdir" in
3716 .) ;;
3717 *)
3718 if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
3719 else
3720 { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
3721 fi
3722 ;;
3723 esac
3724
3725 ac_popdir=`pwd`
3726 cd $ac_config_dir
3727
3728 case "$srcdir" in
3729 .) # No --srcdir option. We are building in place.
3730 ac_sub_srcdir=$srcdir ;;
3731 /*) # Absolute path.
3732 ac_sub_srcdir=$srcdir/$ac_config_dir ;;
3733 *) # Relative path.
3734 ac_sub_srcdir=../$srcdir/$ac_config_dir ;;
3735 esac
3736
3737 # Check for guested configure; otherwise get Cygnus style configure.
3738 if test -f $ac_sub_srcdir/configure; then
3739 ac_sub_configure=$ac_sub_srcdir/configure
3740 elif test -f $ac_sub_srcdir/configure.in; then
3741 ac_sub_configure=$ac_configure
3742 else
3743 echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
3744 ac_sub_configure=
3745 fi
3746
3747 # The recursion is here.
3748 if test -n "$ac_sub_configure"; then
3749
3750 # Make the cache file name correct relative to the subdirectory.
3751 # A "../" for each directory in /$ac_config_dir.
3752 ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
3753 case "$cache_file" in
3754 /*) ac_sub_cache_file=$cache_file ;;
3755 *) # Relative path.
3756 ac_sub_cache_file="$ac_dots$cache_file" ;;
3757 esac
3758 case "$ac_given_INSTALL" in
3759 [/$]*) INSTALL="$ac_given_INSTALL" ;;
3760 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3761 esac
3762
3763 echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
3764 # The eval makes quoting arguments work.
3765 if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
3766 then :
3767 else
3768 { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
3769 fi
3770 fi
3771
3772 cd $ac_popdir
3773 done
3774fi
3775
5e711e7f
PS
3776
3777exit 0
b7f3b6d5 3778
This page took 0.217635 seconds and 4 git commands to generate.