]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/configure
* coff-i386.c (coff_i386_is_local_label_name): New static function
[thirdparty/binutils-gdb.git] / gas / configure
CommitLineData
833c46e1 1#! /bin/sh
fb589130 2
b11fb939 3# Guess values for system-dependent variables and create Makefiles.
c6c7035c 4# Generated automatically using autoconf version 2.12
df586de2 5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
b11fb939 6#
f2889110
KR
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
b11fb939 9
f2889110 10# Defaults:
b11fb939 11ac_help=
f2889110
KR
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
28d3e4a3 14ac_help="$ac_help
d7b2038f 15 --enable-bfd-assembler use BFD back end for writing object files"
e7757ad0
KR
16ac_help="$ac_help
17 targets alternative target configurations besides the primary"
1c9dbb83
ILT
18ac_help="$ac_help
19 --enable-shared build shared BFD library"
2e013bb7
ILT
20ac_help="$ac_help
21 --enable-commonbfdlib build shared BFD/opcodes/libiberty library"
b11fb939 22
b11fb939
KR
23# Initialize some variables set by options.
24# The variables have the same names as the options, with
25# dashes changed to underlines.
26build=NONE
27cache_file=./config.cache
28exec_prefix=NONE
29host=NONE
30no_create=
31nonopt=NONE
bf111c9f 32no_recursion=
b11fb939 33prefix=NONE
bf111c9f
KR
34program_prefix=NONE
35program_suffix=NONE
ba49e48d 36program_transform_name=s,x,x,
b11fb939 37silent=
f2889110 38site=
b11fb939
KR
39srcdir=
40target=NONE
41verbose=
42x_includes=NONE
43x_libraries=NONE
1c9dbb83
ILT
44bindir='${exec_prefix}/bin'
45sbindir='${exec_prefix}/sbin'
46libexecdir='${exec_prefix}/libexec'
47datadir='${prefix}/share'
48sysconfdir='${prefix}/etc'
49sharedstatedir='${prefix}/com'
50localstatedir='${prefix}/var'
51libdir='${exec_prefix}/lib'
52includedir='${prefix}/include'
53oldincludedir='/usr/include'
54infodir='${prefix}/info'
55mandir='${prefix}/man'
b11fb939
KR
56
57# Initialize some other variables.
58subdirs=
1c9dbb83 59MFLAGS= MAKEFLAGS=
c6c7035c
MM
60# Maximum number of lines to put in a shell here document.
61ac_max_here_lines=12
b11fb939
KR
62
63ac_prev=
64for ac_option
65do
66
67 # If the previous option needs an argument, assign it.
68 if test -n "$ac_prev"; then
69 eval "$ac_prev=\$ac_option"
70 ac_prev=
71 continue
72 fi
73
74 case "$ac_option" in
75 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
76 *) ac_optarg= ;;
77 esac
78
bf111c9f 79 # Accept the important Cygnus configure options, so we can diagnose typos.
b11fb939
KR
80
81 case "$ac_option" in
82
1c9dbb83
ILT
83 -bindir | --bindir | --bindi | --bind | --bin | --bi)
84 ac_prev=bindir ;;
85 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
86 bindir="$ac_optarg" ;;
87
88 -build | --build | --buil | --bui | --bu)
b11fb939 89 ac_prev=build ;;
1c9dbb83 90 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
b11fb939
KR
91 build="$ac_optarg" ;;
92
93 -cache-file | --cache-file | --cache-fil | --cache-fi \
94 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
95 ac_prev=cache_file ;;
96 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
97 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
98 cache_file="$ac_optarg" ;;
99
1c9dbb83
ILT
100 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
101 ac_prev=datadir ;;
102 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
103 | --da=*)
104 datadir="$ac_optarg" ;;
105
b11fb939
KR
106 -disable-* | --disable-*)
107 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
108 # Reject names that are not valid shell variable names.
109 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
ba49e48d 110 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
b11fb939
KR
111 fi
112 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
113 eval "enable_${ac_feature}=no" ;;
114
115 -enable-* | --enable-*)
116 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
117 # Reject names that are not valid shell variable names.
118 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
ba49e48d 119 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
b11fb939
KR
120 fi
121 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
122 case "$ac_option" in
123 *=*) ;;
124 *) ac_optarg=yes ;;
125 esac
126 eval "enable_${ac_feature}='$ac_optarg'" ;;
127
128 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
129 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
130 | --exec | --exe | --ex)
131 ac_prev=exec_prefix ;;
132 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
133 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
134 | --exec=* | --exe=* | --ex=*)
135 exec_prefix="$ac_optarg" ;;
136
137 -gas | --gas | --ga | --g)
138 # Obsolete; use --with-gas.
139 with_gas=yes ;;
140
141 -help | --help | --hel | --he)
f1698cb7
KR
142 # Omit some internal or obsolete options to make the list less imposing.
143 # This message is too long to be a string in the A/UX 3.1 sh.
b11fb939 144 cat << EOF
f1698cb7
KR
145Usage: configure [options] [host]
146Options: [defaults in brackets after descriptions]
147Configuration:
148 --cache-file=FILE cache test results in FILE
149 --help print this message
150 --no-create do not create output files
151 --quiet, --silent do not print \`checking...' messages
152 --version print the version of autoconf that created configure
153Directory and file names:
154 --prefix=PREFIX install architecture-independent files in PREFIX
155 [$ac_default_prefix]
1c9dbb83 156 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
f1698cb7 157 [same as prefix]
1c9dbb83
ILT
158 --bindir=DIR user executables in DIR [EPREFIX/bin]
159 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
160 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
161 --datadir=DIR read-only architecture-independent data in DIR
162 [PREFIX/share]
163 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
164 --sharedstatedir=DIR modifiable architecture-independent data in DIR
165 [PREFIX/com]
166 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
167 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
168 --includedir=DIR C header files in DIR [PREFIX/include]
169 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
170 --infodir=DIR info documentation in DIR [PREFIX/info]
171 --mandir=DIR man documentation in DIR [PREFIX/man]
f1698cb7
KR
172 --srcdir=DIR find the sources in DIR [configure dir or ..]
173 --program-prefix=PREFIX prepend PREFIX to installed program names
174 --program-suffix=SUFFIX append SUFFIX to installed program names
1c9dbb83
ILT
175 --program-transform-name=PROGRAM
176 run sed PROGRAM on installed program names
177EOF
178 cat << EOF
f1698cb7
KR
179Host type:
180 --build=BUILD configure for building on BUILD [BUILD=HOST]
181 --host=HOST configure for HOST [guessed]
182 --target=TARGET configure for TARGET [TARGET=HOST]
183Features and packages:
184 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
185 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
186 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
187 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
188 --x-includes=DIR X include files are in DIR
189 --x-libraries=DIR X library files are in DIR
b11fb939 190EOF
1c9dbb83
ILT
191 if test -n "$ac_help"; then
192 echo "--enable and --with options recognized:$ac_help"
193 fi
b11fb939
KR
194 exit 0 ;;
195
196 -host | --host | --hos | --ho)
197 ac_prev=host ;;
198 -host=* | --host=* | --hos=* | --ho=*)
199 host="$ac_optarg" ;;
200
1c9dbb83
ILT
201 -includedir | --includedir | --includedi | --included | --include \
202 | --includ | --inclu | --incl | --inc)
203 ac_prev=includedir ;;
204 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
205 | --includ=* | --inclu=* | --incl=* | --inc=*)
206 includedir="$ac_optarg" ;;
207
208 -infodir | --infodir | --infodi | --infod | --info | --inf)
209 ac_prev=infodir ;;
210 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
211 infodir="$ac_optarg" ;;
212
213 -libdir | --libdir | --libdi | --libd)
214 ac_prev=libdir ;;
215 -libdir=* | --libdir=* | --libdi=* | --libd=*)
216 libdir="$ac_optarg" ;;
217
218 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
219 | --libexe | --libex | --libe)
220 ac_prev=libexecdir ;;
221 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
222 | --libexe=* | --libex=* | --libe=*)
223 libexecdir="$ac_optarg" ;;
224
225 -localstatedir | --localstatedir | --localstatedi | --localstated \
226 | --localstate | --localstat | --localsta | --localst \
227 | --locals | --local | --loca | --loc | --lo)
228 ac_prev=localstatedir ;;
229 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
230 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
231 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
232 localstatedir="$ac_optarg" ;;
233
234 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
235 ac_prev=mandir ;;
236 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
237 mandir="$ac_optarg" ;;
238
b11fb939
KR
239 -nfp | --nfp | --nf)
240 # Obsolete; use --without-fp.
241 with_fp=no ;;
242
243 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
244 | --no-cr | --no-c)
245 no_create=yes ;;
246
bf111c9f
KR
247 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
248 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
249 no_recursion=yes ;;
b11fb939 250
1c9dbb83
ILT
251 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
252 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
253 | --oldin | --oldi | --old | --ol | --o)
254 ac_prev=oldincludedir ;;
255 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
256 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
257 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
258 oldincludedir="$ac_optarg" ;;
259
b11fb939
KR
260 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
261 ac_prev=prefix ;;
262 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
263 prefix="$ac_optarg" ;;
264
265 -program-prefix | --program-prefix | --program-prefi | --program-pref \
266 | --program-pre | --program-pr | --program-p)
267 ac_prev=program_prefix ;;
268 -program-prefix=* | --program-prefix=* | --program-prefi=* \
269 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
270 program_prefix="$ac_optarg" ;;
271
272 -program-suffix | --program-suffix | --program-suffi | --program-suff \
273 | --program-suf | --program-su | --program-s)
274 ac_prev=program_suffix ;;
275 -program-suffix=* | --program-suffix=* | --program-suffi=* \
276 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
277 program_suffix="$ac_optarg" ;;
278
279 -program-transform-name | --program-transform-name \
280 | --program-transform-nam | --program-transform-na \
281 | --program-transform-n | --program-transform- \
282 | --program-transform | --program-transfor \
283 | --program-transfo | --program-transf \
284 | --program-trans | --program-tran \
285 | --progr-tra | --program-tr | --program-t)
286 ac_prev=program_transform_name ;;
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=*)
bf111c9f 294 program_transform_name="$ac_optarg" ;;
b11fb939
KR
295
296 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
297 | -silent | --silent | --silen | --sile | --sil)
298 silent=yes ;;
299
1c9dbb83
ILT
300 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
301 ac_prev=sbindir ;;
302 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
303 | --sbi=* | --sb=*)
304 sbindir="$ac_optarg" ;;
305
306 -sharedstatedir | --sharedstatedir | --sharedstatedi \
307 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
308 | --sharedst | --shareds | --shared | --share | --shar \
309 | --sha | --sh)
310 ac_prev=sharedstatedir ;;
311 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
312 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
313 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
314 | --sha=* | --sh=*)
315 sharedstatedir="$ac_optarg" ;;
316
f2889110
KR
317 -site | --site | --sit)
318 ac_prev=site ;;
319 -site=* | --site=* | --sit=*)
320 site="$ac_optarg" ;;
321
b11fb939
KR
322 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
323 ac_prev=srcdir ;;
324 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
325 srcdir="$ac_optarg" ;;
326
1c9dbb83
ILT
327 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
328 | --syscon | --sysco | --sysc | --sys | --sy)
329 ac_prev=sysconfdir ;;
330 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
331 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
332 sysconfdir="$ac_optarg" ;;
333
b11fb939
KR
334 -target | --target | --targe | --targ | --tar | --ta | --t)
335 ac_prev=target ;;
336 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
337 target="$ac_optarg" ;;
338
339 -v | -verbose | --verbose | --verbos | --verbo | --verb)
340 verbose=yes ;;
341
342 -version | --version | --versio | --versi | --vers)
c6c7035c 343 echo "configure generated by autoconf version 2.12"
b11fb939
KR
344 exit 0 ;;
345
346 -with-* | --with-*)
347 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
348 # Reject names that are not valid shell variable names.
349 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
ba49e48d 350 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
b11fb939
KR
351 fi
352 ac_package=`echo $ac_package| sed 's/-/_/g'`
353 case "$ac_option" in
354 *=*) ;;
355 *) ac_optarg=yes ;;
356 esac
357 eval "with_${ac_package}='$ac_optarg'" ;;
358
359 -without-* | --without-*)
360 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
361 # Reject names that are not valid shell variable names.
362 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
ba49e48d 363 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
b11fb939
KR
364 fi
365 ac_package=`echo $ac_package| sed 's/-/_/g'`
366 eval "with_${ac_package}=no" ;;
367
368 --x)
369 # Obsolete; use --with-x.
370 with_x=yes ;;
371
372 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
373 | --x-incl | --x-inc | --x-in | --x-i)
374 ac_prev=x_includes ;;
375 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
376 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
377 x_includes="$ac_optarg" ;;
378
379 -x-libraries | --x-libraries | --x-librarie | --x-librari \
380 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
381 ac_prev=x_libraries ;;
382 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
383 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
384 x_libraries="$ac_optarg" ;;
385
ba49e48d 386 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
b11fb939
KR
387 ;;
388
1c9dbb83 389 *)
b11fb939
KR
390 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
391 echo "configure: warning: $ac_option: invalid host type" 1>&2
392 fi
393 if test "x$nonopt" != xNONE; then
ba49e48d 394 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
b11fb939
KR
395 fi
396 nonopt="$ac_option"
397 ;;
398
399 esac
400done
401
402if test -n "$ac_prev"; then
ba49e48d 403 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
b11fb939
KR
404fi
405
833c46e1 406trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
b11fb939
KR
407
408# File descriptor usage:
833c46e1 409# 0 standard input
b11fb939
KR
410# 1 file creation
411# 2 errors and warnings
833c46e1
KR
412# 3 some systems may open it to /dev/tty
413# 4 used on the Kubota Titan
414# 6 checking for... messages and results
b11fb939
KR
415# 5 compiler messages saved in config.log
416if test "$silent" = yes; then
833c46e1 417 exec 6>/dev/null
b11fb939 418else
833c46e1 419 exec 6>&1
b11fb939
KR
420fi
421exec 5>./config.log
422
423echo "\
424This file contains any messages produced by compilers while
425running configure, to aid debugging if configure makes a mistake.
426" 1>&5
427
bf111c9f 428# Strip out --no-create and --no-recursion so they do not pile up.
e23b25ec
KR
429# Also quote any args containing shell metacharacters.
430ac_configure_args=
431for ac_arg
432do
b11fb939
KR
433 case "$ac_arg" in
434 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
435 | --no-cr | --no-c) ;;
bf111c9f
KR
436 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
437 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
e23b25ec
KR
438 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
439 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
440 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
b11fb939
KR
441 esac
442done
443
444# NLS nuisances.
c6c7035c
MM
445# Only set these to C if already set. These must not be set unconditionally
446# because not all systems understand e.g. LANG=C (notably SCO).
447# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
448# Non-C LC_CTYPE values break the ctype check.
7d0f8249 449if test "${LANG+set}" = set; then LANG=C; export LANG; fi
c6c7035c
MM
450if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
451if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
452if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
b11fb939
KR
453
454# confdefs.h avoids OS command line length limits that DEFS can exceed.
455rm -rf conftest* confdefs.h
456# AIX cpp loses on an empty file, so make sure it contains at least a newline.
457echo > confdefs.h
458
459# A filename unique to this package, relative to the directory that
460# configure is in, which we can look for to find out if srcdir is correct.
461ac_unique_file=as.h
462
463# Find the source files, if location was not specified.
464if test -z "$srcdir"; then
465 ac_srcdir_defaulted=yes
466 # Try the directory containing this script, then its parent.
467 ac_prog=$0
468 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
469 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
470 srcdir=$ac_confdir
471 if test ! -r $srcdir/$ac_unique_file; then
472 srcdir=..
473 fi
474else
475 ac_srcdir_defaulted=no
476fi
477if test ! -r $srcdir/$ac_unique_file; then
478 if test "$ac_srcdir_defaulted" = yes; then
ba49e48d 479 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
b11fb939 480 else
ba49e48d 481 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
b11fb939
KR
482 fi
483fi
f2889110 484srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
b11fb939
KR
485
486# Prefer explicitly selected file to automatically selected ones.
bf111c9f 487if test -z "$CONFIG_SITE"; then
b11fb939 488 if test "x$prefix" != xNONE; then
f2889110 489 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
b11fb939 490 else
f2889110 491 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
b11fb939
KR
492 fi
493fi
494for ac_site_file in $CONFIG_SITE; do
495 if test -r "$ac_site_file"; then
496 echo "loading site script $ac_site_file"
497 . "$ac_site_file"
498 fi
499done
500
501if test -r "$cache_file"; then
502 echo "loading cache $cache_file"
503 . $cache_file
504else
505 echo "creating cache $cache_file"
506 > $cache_file
507fi
508
509ac_ext=c
510# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
d0352cbb
DE
511ac_cpp='$CPP $CPPFLAGS'
512ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
513ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
c6c7035c 514cross_compiling=$ac_cv_prog_cc_cross
b11fb939 515
bf111c9f
KR
516if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
517 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
518 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
519 ac_n= ac_c='
520' ac_t=' '
521 else
522 ac_n=-n ac_c= ac_t=
523 fi
524else
525 ac_n= ac_c='\c' ac_t=
526fi
527
318b02b6 528user_bfd_gas=
b11fb939 529# Check whether --enable-bfd-assembler or --disable-bfd-assembler was given.
1c9dbb83
ILT
530if test "${enable_bfd_assembler+set}" = set; then
531 enableval="$enable_bfd_assembler"
b11fb939 532 case "${enableval}" in
318b02b6
KR
533 yes) need_bfd=yes user_bfd_gas=yes ;;
534 no) user_bfd_gas=no ;;
ba49e48d 535 *) { echo "configure: error: bad value ${enableval} given for bfd-assembler option" 1>&2; exit 1; } ;;
b11fb939
KR
536esac
537fi
e7757ad0 538# Check whether --enable-targets or --disable-targets was given.
1c9dbb83
ILT
539if test "${enable_targets+set}" = set; then
540 enableval="$enable_targets"
e7757ad0
KR
541 case "${enableval}" in
542 yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; }
543 ;;
544 no) enable_targets= ;;
545 *) enable_targets=$enableval ;;
546esac
547fi
1c9dbb83
ILT
548# Check whether --enable-shared or --disable-shared was given.
549if test "${enable_shared+set}" = set; then
550 enableval="$enable_shared"
551 case "${enableval}" in
159e6ef8 552 yes) shared=true shared_bfd=true shared_opcodes=true ;;
1c9dbb83 553 no) shared=false ;;
159e6ef8
MM
554 *bfd*opcodes*) shared=true shared_bfd=true shared_opcodes=true ;;
555 *opcodes*bfd*) shared=true shared_bfd=true shared_opcodes=true ;;
556 *bfd*) shared=true shared_bfd=true ;;
557 *opcodes*) shared=true shared_opcodes=true ;;
558 *) shared=false ;;
1c9dbb83
ILT
559esac
560fi
2e013bb7
ILT
561# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given.
562if test "${enable_commonbfdlib+set}" = set; then
563 enableval="$enable_commonbfdlib"
564 case "${enableval}" in
565 yes) commonbfdlib=true ;;
566 no) commonbfdlib=false ;;
567 *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;;
568esac
569fi
b11fb939
KR
570
571# Generate a header file -- gets more post-processing by Makefile later.
572
573
574ac_aux_dir=
28d3e4a3 575for ac_dir in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/..; do
e23b25ec
KR
576 if test -f $ac_dir/install-sh; then
577 ac_aux_dir=$ac_dir
28d3e4a3 578 ac_install_sh="$ac_aux_dir/install-sh -c"
e23b25ec
KR
579 break
580 elif test -f $ac_dir/install.sh; then
581 ac_aux_dir=$ac_dir
28d3e4a3 582 ac_install_sh="$ac_aux_dir/install.sh -c"
e23b25ec 583 break
b11fb939
KR
584 fi
585done
586if test -z "$ac_aux_dir"; then
ba49e48d 587 { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/.. $srcdir/`cd $srcdir;pwd`/.." 1>&2; exit 1; }
b11fb939 588fi
28d3e4a3
KR
589ac_config_guess=$ac_aux_dir/config.guess
590ac_config_sub=$ac_aux_dir/config.sub
591ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
b11fb939 592
fb589130 593
b11fb939
KR
594# Do some error checking and defaulting for the host and target type.
595# The inputs are:
596# configure --host=HOST --target=TARGET --build=BUILD NONOPT
597#
598# The rules are:
599# 1. You are not allowed to specify --host, --target, and nonopt at the
1c9dbb83 600# same time.
b11fb939
KR
601# 2. Host defaults to nonopt.
602# 3. If nonopt is not specified, then host defaults to the current host,
603# as determined by config.guess.
f2889110
KR
604# 4. Target and build default to nonopt.
605# 5. If nonopt is not specified, then target and build default to host.
b11fb939
KR
606
607# The aliases save the names the user supplied, while $host etc.
608# will get canonicalized.
609case $host---$target---$nonopt in
610NONE---*---* | *---NONE---* | *---*---NONE) ;;
ba49e48d 611*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
b11fb939
KR
612esac
613
e23b25ec 614
b11fb939 615# Make sure we can run config.sub.
28d3e4a3 616if $ac_config_sub sun4 >/dev/null 2>&1; then :
ba49e48d 617else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
b11fb939
KR
618fi
619
833c46e1 620echo $ac_n "checking host system type""... $ac_c" 1>&6
2e013bb7 621echo "configure:622: checking host system type" >&5
b11fb939
KR
622
623host_alias=$host
28d3e4a3 624case "$host_alias" in
b11fb939
KR
625NONE)
626 case $nonopt in
627 NONE)
28d3e4a3 628 if host_alias=`$ac_config_guess`; then :
ba49e48d 629 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
b11fb939
KR
630 fi ;;
631 *) host_alias=$nonopt ;;
632 esac ;;
633esac
634
28d3e4a3 635host=`$ac_config_sub $host_alias`
c6c7035c
MM
636host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
637host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
638host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
833c46e1 639echo "$ac_t""$host" 1>&6
b11fb939 640
833c46e1 641echo $ac_n "checking target system type""... $ac_c" 1>&6
2e013bb7 642echo "configure:643: checking target system type" >&5
b11fb939
KR
643
644target_alias=$target
28d3e4a3 645case "$target_alias" in
b11fb939
KR
646NONE)
647 case $nonopt in
648 NONE) target_alias=$host_alias ;;
649 *) target_alias=$nonopt ;;
650 esac ;;
651esac
652
28d3e4a3 653target=`$ac_config_sub $target_alias`
c6c7035c
MM
654target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
655target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
656target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
833c46e1 657echo "$ac_t""$target" 1>&6
b11fb939 658
833c46e1 659echo $ac_n "checking build system type""... $ac_c" 1>&6
2e013bb7 660echo "configure:661: checking build system type" >&5
b11fb939
KR
661
662build_alias=$build
28d3e4a3 663case "$build_alias" in
f2889110
KR
664NONE)
665 case $nonopt in
666 NONE) build_alias=$host_alias ;;
667 *) build_alias=$nonopt ;;
668 esac ;;
669esac
670
28d3e4a3 671build=`$ac_config_sub $build_alias`
c6c7035c
MM
672build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
673build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
674build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
833c46e1 675echo "$ac_t""$build" 1>&6
b11fb939 676
28d3e4a3
KR
677test "$host_alias" != "$target_alias" &&
678 test "$program_prefix$program_suffix$program_transform_name" = \
833c46e1
KR
679 NONENONEs,x,x, &&
680 program_prefix=${target_alias}-
b11fb939 681
ba49e48d
KR
682if test "$program_transform_name" = s,x,x,; then
683 program_transform_name=
684else
1c9dbb83
ILT
685 # Double any \ or $. echo might interpret backslashes.
686 cat <<\EOF_SED > conftestsed
687s,\\,\\\\,g; s,\$,$$,g
688EOF_SED
28d3e4a3 689 program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
bf111c9f 690 rm -f conftestsed
318b02b6 691fi
28d3e4a3
KR
692test "$program_prefix" != NONE &&
693 program_transform_name="s,^,${program_prefix},; $program_transform_name"
bf111c9f 694# Use a double $ so make ignores it.
28d3e4a3
KR
695test "$program_suffix" != NONE &&
696 program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
318b02b6 697
bf111c9f 698# sed with no file args requires a program.
28d3e4a3 699test "$program_transform_name" = "" && program_transform_name="s,x,x,"
318b02b6 700
b11fb939 701
e7757ad0 702te_file=generic
b11fb939 703
e7757ad0
KR
704canon_targets=""
705if test -n "$enable_targets" ; then
706 for t in `echo $enable_targets | sed 's/,/ /g'`; do
ec2f730d 707 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null`
e7757ad0
KR
708 if test -n "$result" ; then
709 canon_targets="$canon_targets $result"
710# else
711# # Permit "all", etc. We don't support it yet though.
712# canon_targets="$canon_targets $t"
713 fi
714 done
715 _gas_uniq_list="$canon_targets"
716_gas_uniq_newlist=""
717for _gas_uniq_i in _gas_uniq_dummy $_gas_uniq_list ; do
718 case $_gas_uniq_i in
719 _gas_uniq_dummy) ;;
720 *) case " $_gas_uniq_newlist " in
721 *" $_gas_uniq_i "*) ;;
722 *) _gas_uniq_newlist="$_gas_uniq_newlist $_gas_uniq_i" ;;
723 esac ;;
724 esac
725done
726canon_targets=$_gas_uniq_newlist
b11fb939 727
e7757ad0 728fi
b11fb939 729
e7757ad0
KR
730emulations=""
731
732for this_target in $target $canon_targets ; do
733
64556643 734 eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
e7757ad0
KR
735
736 # check for architecture variants
737 case ${cpu} in
ae09d880
ILT
738 armeb) cpu_type=arm endian=big ;;
739 arm*) cpu_type=arm endian=little ;;
e7757ad0 740 hppa*) cpu_type=hppa ;;
7c2fadd1 741 i[456]86) cpu_type=i386 ;;
e7757ad0
KR
742 m680[012346]0) cpu_type=m68k ;;
743 m68008) cpu_type=m68k ;;
744 m683??) cpu_type=m68k ;;
745 m8*) cpu_type=m88k ;;
e16b9537 746 mips*el) cpu_type=mips endian=little ;;
e7757ad0
KR
747 mips*) cpu_type=mips endian=big ;;
748 powerpcle*) cpu_type=ppc endian=little ;;
749 powerpc*) cpu_type=ppc endian=big ;;
750 rs6000*) cpu_type=ppc ;;
6df07e7f 751 sparc64) cpu_type=sparc want_sparc_v9=true ;;
63e4edb5 752 sparc*) cpu_type=sparc ;;
a1c7c0f3 753 *) cpu_type=${cpu} ;;
e7757ad0
KR
754 esac
755
756 if test ${this_target} = $target ; then
757 target_cpu_type=${cpu_type}
758 elif test ${target_cpu_type} != ${cpu_type} ; then
759 continue
760 fi
761
762 targ=${cpu_type}
763 generic_target=${cpu_type}-$vendor-$os
764 dev=no
765 bfd_gas=no
766 em=generic
767
768 # assign object format
769 case ${generic_target} in
805e36ab 770 a29k-*-coff) fmt=coff targ=ebmon29k ;;
e7757ad0
KR
771 a29k-amd-udi) fmt=coff targ=ebmon29k ;;
772 a29k-amd-ebmon) fmt=coff targ=ebmon29k ;;
880b7429 773 a29k-nyu-sym1) fmt=coff targ=ebmon29k ;;
e7757ad0
KR
774 a29k-*-vxworks*) fmt=coff ;;
775
c6aa56bc 776 alpha-*-*vms*) fmt=evax ;;
e7757ad0 777 alpha-*-netware*) fmt=ecoff ;;
894cca25 778 alpha-*-openbsd*) fmt=ecoff ;;
e7757ad0 779 alpha-*-osf*) fmt=ecoff ;;
df586de2
ILT
780 alpha-*-linuxecoff*) fmt=ecoff ;;
781 alpha-*-linux*) fmt=elf em=linux ;;
b11fb939 782
4181c985 783# start-sanitize-arc
e7757ad0 784 arc-*-elf*) fmt=elf bfd_gas=yes ;;
4181c985
KR
785# end-sanitize-arc
786
7be9a312 787 arm-*-riscix*) fmt=aout targ=arm-lit em=riscix ;;
1cb0d00d
KR
788 arm-*-aout) fmt=aout
789 case "$endian" in
790 big) targ=arm-big ;;
791 *) targ=arm-lit ;;
792 esac
793 ;;
8de16e56 794 arm-*-coff) fmt=coff ;;
e7757ad0 795 arm-*-riscix*) fmt=aout ;;
1cb0d00d 796 arm-*-pe) fmt=coff targ=armcoff em=pe ;;
e7757ad0 797
cbe7dccb 798 d10v-*-*) fmt=elf bfd_gas=yes ;;
7d0f8249
MH
799# start-sanitize-d30v
800 d30v-*-*) fmt=elf bfd_gas=yes ;;
801# end-sanitize-d30v
7be9a312 802
e7757ad0
KR
803 hppa-*-*elf*) fmt=elf em=hppa ;;
804 hppa-*-lites*) fmt=elf em=hppa ;;
805 hppa-*-osf*) fmt=som em=hppa ;;
332d5c49 806 hppa-*-rtems*) fmt=elf em=hppa ;;
e7757ad0
KR
807 hppa-*-hpux*) fmt=som em=hppa ;;
808 hppa-*-bsd*) fmt=som em=hppa ;;
809 hppa-*-hiux*) fmt=som em=hppa ;;
810
811 h8300-*-coff) fmt=coff ;;
812
813 i386-ibm-aix*) fmt=coff targ=i386coff
814 em=i386aix ;;
7d0f8249 815 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
e7757ad0
KR
816 i386-*-bsd*) fmt=aout em=386bsd ;;
817 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
818 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
a1c7c0f3 819 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
e7757ad0
KR
820 i386-*-linux*coff*) fmt=coff em=linux
821 targ=i386coff ;;
822 i386-*-linux*) fmt=elf em=linux ;;
823 i386-*-lynxos*) fmt=coff targ=i386coff
824 em=lynx ;;
2ae5f50b 825 i386-*-sysv4* | i386-*-solaris* | i386-*-elf | i386-*-freebsdelf*)
e7757ad0 826 fmt=elf ;;
66b935da 827 i386-*-sco*elf*) fmt=elf targ=sco5 ;;
e7757ad0
KR
828 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
829 fmt=coff targ=i386coff ;;
830 i386-*-vsta) fmt=aout ;;
831 i386-*-go32) fmt=coff targ=i386coff ;;
7be9a312 832 i386-*-rtems*) fmt=coff targ=i386coff ;;
6c186c48
SC
833 i386-*-gnu*) fmt=elf ;;
834 i386-*-mach*)
e7757ad0
KR
835 fmt=aout em=mach bfd_gas=yes ;;
836 i386-*-msdos*) fmt=aout ;;
6c186c48 837 i386-*-moss*) fmt=elf ;;
d0352cbb
DE
838 i386-*-pe) fmt=coff targ=i386coff em=pe ;;
839 i386-*-cygwin32) fmt=coff targ=i386coff em=pe ;;
840 i386-*-*nt) fmt=coff targ=i386coff em=pe ;;
e7757ad0
KR
841 i960-*-bout) fmt=bout ;;
842 i960-*-coff) fmt=coff em=ic960 targ=ic960coff ;;
7be9a312 843 i960-*-rtems*) fmt=coff em=ic960 targ=ic960coff ;;
e7757ad0
KR
844 i960-*-nindy*) fmt=bout ;;
845 i960-*-vxworks4*) fmt=bout ;;
846 i960-*-vxworks5.0) fmt=bout ;;
847 i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;;
848 i960-*-vxworks*) fmt=bout ;;
849
374bdac7
DE
850 m32r-*-*) fmt=elf bfd_gas=yes ;;
851
e7757ad0
KR
852 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
853 fmt=aout em=sun3 ;;
880b7429 854 m68k-motorola-sysv*) fmt=coff targ=m68kcoff em=delta ;;
e7757ad0
KR
855 m68k-bull-sysv3*) fmt=coff targ=m68kcoff em=dpx2 ;;
856 m68k-apollo-*) fmt=coff targ=apollo em=apollo ;;
fee3e248
ILT
857 m68k-*-sysv4*) # must be before -sysv*
858 fmt=elf em=svr4 ;;
859 m68k-*-elf*) fmt=elf ;;
7be9a312 860 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
e7757ad0 861 fmt=coff targ=m68kcoff ;;
e7757ad0 862 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
535cfd0f
ILT
863 m68k-*-linux*aout*) fmt=aout em=linux ;;
864 m68k-*-linux*) fmt=elf em=linux ;;
e7757ad0
KR
865 m68k-*-lynxos*) fmt=coff targ=m68kcoff
866 em=lynx ;;
867 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
2b37714a
ILT
868 m68k-apple-aux*) fmt=coff targ=m68kcoff em=aux ;;
869 m68k-*-psos*) fmt=elf em=psos;;
e7757ad0 870
880b7429 871 m88k-motorola-sysv3*) fmt=coff targ=m88kcoff em=delt88 ;;
e7757ad0
KR
872 m88k-*-coff*) fmt=coff targ=m88kcoff ;;
873
874 # don't change em like *-*-bsd does
4cbbec31 875 mips-dec-netbsd*) fmt=elf targ=mips-lit endian=little ;;
e7757ad0
KR
876 mips-dec-bsd*) fmt=aout targ=mips-lit ;;
877 mips-sony-bsd*) fmt=ecoff targ=mips-big ;;
878 mips-*-bsd*) { echo "configure: error: Unknown vendor for mips-bsd configuration." 1>&2; exit 1; } ;;
70f4dbce 879 mips-*-ultrix*) fmt=ecoff targ=mips-lit endian=little ;;
7be9a312 880 mips-*-osf*) fmt=ecoff targ=mips-lit endian=little ;;
e7757ad0
KR
881 mips-*-ecoff*) fmt=ecoff
882 case "$endian" in
883 big) targ=mips-big ;;
884 *) targ=mips-lit ;;
885 esac
886 ;;
887 mips-*-ecoff*) fmt=ecoff targ=mips-big ;;
cbe7dccb 888 mips-*-irix6*) fmt=elf targ=mips-big ;;
e7757ad0
KR
889 mips-*-irix5*) fmt=elf targ=mips-big ;;
890 mips-*-irix*) fmt=ecoff targ=mips-big ;;
515c7142 891 mips-*-lnews*) fmt=ecoff targ=mips-lit em=lnews ;;
e7757ad0
KR
892 mips-*-riscos*) fmt=ecoff targ=mips-big ;;
893 mips-*-sysv*) fmt=ecoff targ=mips-big ;;
fc984eb0 894 mips-*-elf* | mips-*-rtems* | mips-*-linux* | mips-*-gnu* | mips-*-openbsd*)
fed13a5e 895 fmt=elf
e7757ad0
KR
896 case "$endian" in
897 big) targ=mips-big ;;
898 *) targ=mips-lit ;;
899 esac
900 ;;
ae1b99e4
JL
901 mn10200-*-*) fmt=elf bfd_gas=yes ;;
902 mn10300-*-*) fmt=elf bfd_gas=yes ;;
0ff513d9
SC
903 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
904 fmt=coff em=pe
85cc2190
KK
905 case "$endian" in
906 big) targ=ppc-big ;;
907 *) targ=ppc-lit ;;
908 esac
909 ;;
e7757ad0 910 ppc-*-aix*) fmt=coff ;;
515c7142 911 ppc-*-beos*) fmt=coff ;;
e7757ad0
KR
912 ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
913 fmt=elf
914 case "$endian" in
915 big) targ=ppc-big ;;
916 *) targ=ppc-lit ;;
917 esac
918 ;;
159e6ef8
MM
919 ppc-*-linux*) fmt=elf
920 case "$endian" in
921 big) targ=ppc-big ;;
922 *) { echo "configure: error: Linux must be configured big endian" 1>&2; exit 1; } ;;
923 esac
924 ;;
925 ppc-*-solaris*) fmt=elf
926 case "$endian" in
927 big) { echo "configure: error: Solaris must be configured little endian" 1>&2; exit 1; } ;;
928 *) targ=ppc-sol ;;
929 esac
930 ;;
7be9a312
MH
931 ppc-*-rtems*)
932 fmt=elf
933 case "$endian" in
934 big) targ=ppc-big ;;
935 *) targ=ppc-lit ;;
936 esac
937 ;;
880b7429
KR
938 ppc-*-macos* | ppc-*-mpw*)
939 fmt=coff em=macos ;;
e7757ad0
KR
940 ppc-*-netware*) fmt=elf em=ppcnw ;;
941
df4021c1
DE
942 sh-*-elf*) fmt=elf ;;
943 sh-*-coff*) fmt=coff ;;
b11fb939 944
5f757edc
ILT
945 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
946 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
e7757ad0 947
7be9a312 948 sparc-*-rtems*) fmt=aout ;;
e7757ad0 949 sparc-*-sunos4*) fmt=aout em=sun3 ;;
df586de2 950 sparc-*-aout | sparc*-*-vxworks*)
df4021c1 951 fmt=aout em=sparcaout ;;
e7757ad0 952 sparc-*-coff) fmt=coff ;;
2e013bb7
ILT
953 sparc-*-linux*aout*) fmt=aout em=linux ;;
954 sparc-*-linux*) fmt=elf em=linux ;;
e7757ad0
KR
955 sparc-*-lynxos*) fmt=coff em=lynx ;;
956 sparc-fujitsu-none) fmt=aout ;;
0b27ea39 957 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
e7757ad0
KR
958 fmt=elf ;;
959 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
960
64556643 961# start-sanitize-tic80
7d0f8249 962 tic80-*-*) fmt=coff targ=tic80coff;;
64556643 963# end-sanitize-tic80
ec2f730d 964# start-sanitize-v850
c6aa56bc
C
965 v850-*-*) fmt=elf bfd_gas=yes ;;
966
ec2f730d 967# end-sanitize-v850
e7757ad0
KR
968 vax-*-bsd* | vax-*-ultrix*)
969 fmt=aout ;;
970 vax-*-vms) fmt=vms ;;
971
972 z8k-*-coff | z8k-*-sim)
973 fmt=coff ;;
974
975 w65-*-*) fmt=coff ;;
976
977 *-*-aout | *-*-scout)
978 fmt=aout ;;
979 *-*-nindy*)
980 fmt=bout ;;
981 *-*-bsd*)
982 fmt=aout em=sun3 ;;
983 *-*-generic) fmt=generic ;;
984 *-*-xray | *-*-hms) fmt=coff ;;
985 *-*-sim) fmt=coff ;;
986 *-*-elf | *-*-sysv4* | *-*-solaris*)
6df07e7f 987 echo "configure: warning: GAS support for ${generic_target} is incomplete." 1>&2
e7757ad0
KR
988 fmt=elf dev=yes ;;
989 *-*-vxworks) fmt=aout ;;
990 *-*-netware) fmt=elf ;;
991 esac
992
993 case ${cpu_type}-${fmt} in
df586de2 994 alpha-*) bfd_gas=yes ;;
e7757ad0
KR
995 arm-*) bfd_gas=yes ;;
996 # not yet
997 # i386-aout) bfd_gas=preferred ;;
998 mips-*) bfd_gas=yes ;;
999 ns32k-*) bfd_gas=yes ;;
1000 ppc-*) bfd_gas=yes ;;
1001 sparc-*) bfd_gas=yes ;;
1002 *-elf) bfd_gas=yes ;;
1003 *-ecoff) bfd_gas=yes ;;
1004 *-som) bfd_gas=yes ;;
1005 *) ;;
1006 esac
1007
5f757edc
ILT
1008# Other random stuff.
1009
ae09d880
ILT
1010 # do we need the opcodes library?
1011 case ${cpu_type} in
df586de2 1012 vax | i386)
7c2fadd1
ILT
1013 ;;
1014 *)
1015 need_opcodes=yes
159e6ef8 1016 if test "${shared_opcodes}" = "true"; then
7c2fadd1
ILT
1017 # A shared libopcodes must be linked against libbfd.
1018 need_bfd=yes
1019 fi
1020 ;;
ae09d880
ILT
1021 esac
1022
6df07e7f
DE
1023 test -n "$want_sparc_v9" && cat >> confdefs.h <<\EOF
1024#define SPARC_V9 1
5f757edc
ILT
1025EOF
1026
1027
6df07e7f
DE
1028 case ${cpu}-${vendor}-${os} in
1029 sparc64-*-elf*) cat >> confdefs.h <<\EOF
1030#define SPARC_ARCH64 1
1031EOF
1032 ;;
1033 esac
1034
5f757edc 1035 case ${cpu_type} in
374bdac7
DE
1036 m32r)
1037 case ${extra_objects} in
1038 *cgen.o*) ;;
1039 *) extra_objects="$extra_objects cgen.o"
374bdac7
DE
1040 cat >> confdefs.h <<\EOF
1041#define USING_CGEN 1
1042EOF
1043
1044 ;;
1045 esac
1046 ;;
1047
1c9dbb83
ILT
1048 m68k)
1049 case ${extra_objects} in
1050 *m68k-parse.o*) ;;
1051 *) extra_objects="$extra_objects m68k-parse.o" ;;
1052 esac
1053 ;;
efec4a28
DP
1054
1055 mips)
1056 echo ${extra_objects} | grep -s "itbl-parse.o"
1057 if test $? -ne 0 ; then
515c7142 1058 extra_objects="$extra_objects itbl-parse.o"
efec4a28
DP
1059 fi
1060
1061 echo ${extra_objects} | grep -s "itbl-lex.o"
1062 if test $? -ne 0 ; then
515c7142 1063 extra_objects="$extra_objects itbl-lex.o"
efec4a28
DP
1064 fi
1065
1066 echo ${extra_objects} | grep -s "itbl-ops.o"
1067 if test $? -ne 0 ; then
515c7142 1068 extra_objects="$extra_objects itbl-ops.o"
efec4a28
DP
1069 fi
1070 ;;
1071
1072 *)
1073 ;;
5f757edc
ILT
1074 esac
1075
e7757ad0
KR
1076# See if we really can support this configuration with the emulation code.
1077
1078 if test $this_target = $target ; then
1079 primary_bfd_gas=$bfd_gas
1080 obj_format=$fmt
1081 gas_target=$targ
1082 te_file=$em
1083
1084 if test $bfd_gas = no ; then
1085 # Can't support other configurations this way.
1086 break
1087 fi
1088 elif test $bfd_gas = no ; then
1089 # Can't support this configuration.
1090 break
1091 fi
1092
1093# From target name and format, produce a list of supported emulations.
1094
1095 case ${generic_target}-${fmt} in
1cb0d00d 1096 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
515c7142
ILT
1097 mips-*-linux*-*) case "$endian" in
1098 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
1099 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
1100 esac ;;
1101 mips-*-lnews*-ecoff) ;;
e7757ad0 1102 mips-*-*-ecoff) case "$endian" in
1cb0d00d
KR
1103 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
1104 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
e7757ad0
KR
1105 esac ;;
1106 mips-*-*-elf) case "$endian" in
1cb0d00d
KR
1107 big) emulation="mipsbelf mipslelf mipself" ;;
1108 *) emulation="mipslelf mipsbelf mipself" ;;
515c7142
ILT
1109 # Uncommenting the next line will turn on support for i386 COFF
1110 # in any i386 ELF configuration. This probably doesn't work
1111 # correctly.
1112 # i386-*-*-elf) emulation="i386coff i386elf" ;;
e7757ad0
KR
1113 esac ;;
1114 esac
1115
1116 emulations="$emulations $emulation"
1117
e7757ad0 1118done
b11fb939
KR
1119
1120# Assign floating point type. Most processors with FP support
1121# IEEE FP. On those that don't support FP at all, usually IEEE
1122# is emulated.
1123case ${target_cpu} in
1124 vax | tahoe ) atof=${target_cpu} ;;
e7757ad0 1125 *) atof=ieee ;;
b11fb939
KR
1126esac
1127
1128case "${obj_format}" in
ba49e48d 1129 "") { echo "configure: error: GAS does not know what format to use for target ${target}" 1>&2; exit 1; } ;;
b11fb939
KR
1130esac
1131
1132
bf4bd1fc
ILT
1133if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
1134 { echo "configure: error: GAS does not support target CPU ${target_cpu_type}" 1>&2; exit 1; }
b11fb939
KR
1135fi
1136
fb589130 1137if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
ba49e48d 1138 { echo "configure: error: GAS does not have support for object file format ${obj_format}" 1>&2; exit 1; }
b11fb939
KR
1139fi
1140
b11fb939
KR
1141# and target makefile frag
1142
1143target_frag=${srcdir}/config/${gas_target}.mt
f2889110
KR
1144if test ! -r ${target_frag}; then
1145 target_frag=/dev/null # ick! but subst_file can't be conditionalized
1146fi
b11fb939 1147
4cbbec31 1148
e7757ad0 1149case ${user_bfd_gas}-${primary_bfd_gas} in
b11fb939
KR
1150 yes-yes | no-no)
1151 # We didn't override user's choice.
1152 ;;
1153 no-yes)
1154 echo "configure: warning: Use of BFD is required for ${target}; overriding config options." 1>&2
1155 ;;
1156 no-preferred)
e7757ad0 1157 primary_bfd_gas=no
b11fb939
KR
1158 ;;
1159 *-preferred)
e7757ad0 1160 primary_bfd_gas=yes
b11fb939 1161 ;;
ba49e48d 1162 yes-*)
e7757ad0 1163 primary_bfd_gas=yes
ba49e48d 1164 ;;
b11fb939
KR
1165 -*)
1166 # User specified nothing.
1167 ;;
1168esac
1169
e7757ad0
KR
1170# Some COFF configurations want these random other flags set.
1171case ${obj_format} in
1172 coff)
1173 case ${target_cpu_type} in
1174 i386) cat >> confdefs.h <<\EOF
1175#define I386COFF 1
1176EOF
1177 ;;
1178 m68k) cat >> confdefs.h <<\EOF
1179#define M68KCOFF 1
1180EOF
1181 ;;
1182 m88k) cat >> confdefs.h <<\EOF
1183#define M88KCOFF 1
1184EOF
1185 ;;
1186 esac
1187 ;;
1188esac
1189
1190# Getting this done right is going to be a bitch. Each configuration specified
1191# with --enable-targets=... should be checked for environment, format, cpu, and
1192# bfd_gas setting.
1193#
1194# For each configuration, the necessary object file support code must be linked
1195# in. This might be only one, it might be up to four. The necessary emulation
1196# code needs to be provided, too.
1197#
1198# And then there's "--enable-targets=all"....
1199#
1200# For now, just always do it for MIPS ELF or ECOFF configurations. Sigh.
1201
1202formats="${obj_format}"
1203emfiles=""
1204EMULATIONS=""
1205_gas_uniq_list="$emulations"
1206_gas_uniq_newlist=""
1207for _gas_uniq_i in _gas_uniq_dummy $_gas_uniq_list ; do
1208 case $_gas_uniq_i in
1209 _gas_uniq_dummy) ;;
1210 *) case " $_gas_uniq_newlist " in
1211 *" $_gas_uniq_i "*) ;;
1212 *) _gas_uniq_newlist="$_gas_uniq_newlist $_gas_uniq_i" ;;
1213 esac ;;
1214 esac
1215done
1216emulations=$_gas_uniq_newlist
1217
1218for em in . $emulations ; do
1219 case $em in
1220 .) continue ;;
1221 mipsbelf | mipslelf)
1222 fmt=elf file=mipself ;;
1223 mipsbecoff | mipslecoff)
1224 fmt=ecoff file=mipsecoff ;;
515c7142
ILT
1225 i386coff)
1226 fmt=coff file=i386coff ;;
1227 i386elf)
1228 fmt=elf file=i386elf ;;
e7757ad0
KR
1229 esac
1230 formats="$formats $fmt"
1231 emfiles="$emfiles e-$file.o"
1232 EMULATIONS="$EMULATIONS &$em,"
1233done
1234_gas_uniq_list="$formats"
1235_gas_uniq_newlist=""
1236for _gas_uniq_i in _gas_uniq_dummy $_gas_uniq_list ; do
1237 case $_gas_uniq_i in
1238 _gas_uniq_dummy) ;;
1239 *) case " $_gas_uniq_newlist " in
1240 *" $_gas_uniq_i "*) ;;
1241 *) _gas_uniq_newlist="$_gas_uniq_newlist $_gas_uniq_i" ;;
1242 esac ;;
1243 esac
1244done
1245formats=$_gas_uniq_newlist
1246
1247_gas_uniq_list="$emfiles"
1248_gas_uniq_newlist=""
1249for _gas_uniq_i in _gas_uniq_dummy $_gas_uniq_list ; do
1250 case $_gas_uniq_i in
1251 _gas_uniq_dummy) ;;
1252 *) case " $_gas_uniq_newlist " in
1253 *" $_gas_uniq_i "*) ;;
1254 *) _gas_uniq_newlist="$_gas_uniq_newlist $_gas_uniq_i" ;;
1255 esac ;;
1256 esac
1257done
1258emfiles=$_gas_uniq_newlist
1259
1260if test `set . $formats ; shift ; echo $#` -gt 1 ; then
1261 for fmt in $formats ; do
1262 case $fmt in
1263 aout) cat >> confdefs.h <<\EOF
1264#define OBJ_MAYBE_AOUT 1
1265EOF
1266 ;;
1267 bout) cat >> confdefs.h <<\EOF
1268#define OBJ_MAYBE_BOUT 1
1269EOF
1270 ;;
1271 coff) cat >> confdefs.h <<\EOF
1272#define OBJ_MAYBE_COFF 1
1273EOF
1274 ;;
1275 ecoff) cat >> confdefs.h <<\EOF
1276#define OBJ_MAYBE_ECOFF 1
1277EOF
1278 ;;
1279 elf) cat >> confdefs.h <<\EOF
1280#define OBJ_MAYBE_ELF 1
1281EOF
1282 ;;
1283 generic) cat >> confdefs.h <<\EOF
1284#define OBJ_MAYBE_GENERIC 1
1285EOF
1286 ;;
1287 hp300) cat >> confdefs.h <<\EOF
1288#define OBJ_MAYBE_HP300 1
1289EOF
1290 ;;
1291 ieee) cat >> confdefs.h <<\EOF
1292#define OBJ_MAYBE_IEEE 1
1293EOF
1294 ;;
1295 som) cat >> confdefs.h <<\EOF
1296#define OBJ_MAYBE_SOM 1
1297EOF
1298 ;;
1299 vms) cat >> confdefs.h <<\EOF
1300#define OBJ_MAYBE_VMS 1
1301EOF
1302 ;;
1303 esac
1304 extra_objects="$extra_objects obj-$fmt.o"
1305 done
1306 obj_format=multi
1307fi
1308if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
1309 te_file=multi
1310 extra_objects="$extra_objects $emfiles"
1311 DEFAULT_EMULATION=`set . $emulations ; echo $2`
1312 cat >> confdefs.h <<\EOF
1313#define USE_EMULATIONS 1
1314EOF
1315
1316fi
1317
1318cat >> confdefs.h <<EOF
1319#define EMULATIONS $EMULATIONS
1320EOF
1321
1322cat >> confdefs.h <<EOF
1323#define DEFAULT_EMULATION "$DEFAULT_EMULATION"
1324EOF
1325
1326
bf4bd1fc 1327case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
318b02b6
KR
1328 yes-*-coff) need_bfd=yes ;;
1329 no-*-coff) need_bfd=yes
1330 cat >> confdefs.h <<\EOF
1331#define MANY_SEGMENTS 1
1332EOF
1333 ;;
1334esac
1335
b11fb939
KR
1336reject_dev_configs=yes
1337
1338case ${reject_dev_configs}-${dev} in
1339 yes-yes) # Oops.
ba49e48d 1340 { echo "configure: error: GAS does not support the ${generic_target} configuration." 1>&2; exit 1; }
b11fb939
KR
1341 ;;
1342esac
1343
b11fb939
KR
1344
1345
833c46e1
KR
1346
1347
1348
e7757ad0 1349case "${primary_bfd_gas}" in
b11fb939
KR
1350 yes) cat >> confdefs.h <<\EOF
1351#define BFD_ASSEMBLER 1
1352EOF
1353
1354 need_bfd=yes ;;
1355esac
1356
ae09d880
ILT
1357# do we need the opcodes library?
1358case "${need_opcodes}" in
7be9a312
MH
1359yes)
1360 OPCODES_DEP=../opcodes/libopcodes.a
1361 OPCODES_LIB='-L../opcodes -lopcodes'
ae09d880 1362
7be9a312
MH
1363 # We need to handle some special cases for shared libraries.
1364 case "${host}" in
1365 *-*-sunos*)
1366 # On SunOS, we must link against the name we are going to install,
1367 # not -lbfd, since SunOS does not support SONAME.
159e6ef8 1368 if test "${shared_opcodes}" = "true"; then
ae09d880 1369 OPCODES_LIB='-L../opcodes -l`echo opcodes | sed '"'"'$(program_transform_name)'"'"'`'
ae09d880
ILT
1370 fi
1371 ;;
7be9a312
MH
1372 alpha*-*-osf*)
1373 # On Alpha OSF/1, the native linker searches all the -L
1374 # directories for any LIB.so files, and only then searches for any
1375 # LIB.a files. That means that if there is an installed
1376 # libbfd.so, but this build is not done with --enable-shared, the
1377 # link will wind up being against the install libbfd.so rather
1378 # than the newly built libbfd. To avoid this, we must explicitly
1379 # link against libbfd.a when --enable-shared is not used.
1380 if test "${shared_opcodes}" != "true"; then
1381 OPCODES_LIB='../opcodes/libopcodes.a'
1382 fi
1383 ;;
1384 esac
1385 ;;
ae09d880
ILT
1386esac
1387
b11fb939 1388case "${need_bfd}" in
7be9a312
MH
1389yes)
1390 BFDDEP=../bfd/libbfd.a
1391 BFDLIB='-L../bfd -lbfd'
1392 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
ae09d880 1393
7be9a312
MH
1394 # We need to handle some special cases for shared libraries
1395 case "${host}" in
1396 *-*-sunos*)
1397 # On SunOS, we must link against the name we are going to install,
1398 # not -lbfd, since SunOS does not support SONAME.
159e6ef8 1399 if test "${shared_bfd}" = "true"; then
7be9a312
MH
1400 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
1401 fi
1402 ;;
1403 alpha*-*-osf*)
1404 # On Alpha OSF/1, the native linker searches all the -L
1405 # directories for any LIB.so files, and only then searches for any
1406 # LIB.a files. That means that if there is an installed
1407 # libbfd.so, but this build is not done with --enable-shared, the
1408 # link will wind up being against the install libbfd.so rather
1409 # than the newly built libbfd. To avoid this, we must explicitly
1410 # link against libbfd.a when --enable-shared is not used.
1411 if test "${shared_bfd}" != "true"; then
1412 BFDLIB='../bfd/libbfd.a'
ae09d880
ILT
1413 fi
1414 ;;
7be9a312 1415 esac
2e013bb7
ILT
1416
1417 if test "${commonbfdlib}" = "true"; then
1418 # when a shared libbfd is built with --enable-commonbfdlib,
1419 # all of libopcodes is available in libbfd.so
1420 OPCODES_LIB=
1421 fi
7be9a312 1422 ;;
b11fb939
KR
1423esac
1424
1425
1426
1c9dbb83 1427
2e013bb7
ILT
1428
1429
1430
1431
b11fb939
KR
1432cat >> confdefs.h <<EOF
1433#define TARGET_ALIAS "${target_alias}"
1434EOF
1435
1436cat >> confdefs.h <<EOF
1437#define TARGET_CANONICAL "${target}"
1438EOF
1439
1440cat >> confdefs.h <<EOF
1441#define TARGET_CPU "${target_cpu}"
1442EOF
1443
1444cat >> confdefs.h <<EOF
1445#define TARGET_VENDOR "${target_vendor}"
1446EOF
1447
1448cat >> confdefs.h <<EOF
1449#define TARGET_OS "${target_os}"
1450EOF
1451
1452
330add8a
ILT
1453# Extract the first word of "gcc", so it can be a program name with args.
1454set dummy gcc; ac_word=$2
1455echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
894cca25 1456echo "configure:1457: checking for $ac_word" >&5
330add8a
ILT
1457if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1458 echo $ac_n "(cached) $ac_c" 1>&6
1459else
1460 if test -n "$CC"; then
1461 ac_cv_prog_CC="$CC" # Let the user override the test.
1462else
1463 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1464 for ac_dir in $PATH; do
1465 test -z "$ac_dir" && ac_dir=.
1466 if test -f $ac_dir/$ac_word; then
1467 ac_cv_prog_CC="gcc"
1468 break
1469 fi
1470 done
1471 IFS="$ac_save_ifs"
330add8a
ILT
1472fi
1473fi
1474CC="$ac_cv_prog_CC"
1475if test -n "$CC"; then
1476 echo "$ac_t""$CC" 1>&6
1477else
1478 echo "$ac_t""no" 1>&6
1479fi
1480
d0352cbb
DE
1481if test -z "$CC"; then
1482 # Extract the first word of "cc", so it can be a program name with args.
1483set dummy cc; ac_word=$2
1484echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
894cca25 1485echo "configure:1486: checking for $ac_word" >&5
d0352cbb
DE
1486if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1487 echo $ac_n "(cached) $ac_c" 1>&6
1488else
1489 if test -n "$CC"; then
1490 ac_cv_prog_CC="$CC" # Let the user override the test.
1491else
1492 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1493 ac_prog_rejected=no
1494 for ac_dir in $PATH; do
1495 test -z "$ac_dir" && ac_dir=.
1496 if test -f $ac_dir/$ac_word; then
1497 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1498 ac_prog_rejected=yes
1499 continue
1500 fi
1501 ac_cv_prog_CC="cc"
1502 break
1503 fi
1504 done
1505 IFS="$ac_save_ifs"
1506if test $ac_prog_rejected = yes; then
1507 # We found a bogon in the path, so make sure we never use it.
1508 set dummy $ac_cv_prog_CC
1509 shift
1510 if test $# -gt 0; then
1511 # We chose a different compiler from the bogus one.
1512 # However, it has the same basename, so the bogon will be chosen
1513 # first if we set CC to just the basename; use the full file name.
1514 shift
1515 set dummy "$ac_dir/$ac_word" "$@"
1516 shift
1517 ac_cv_prog_CC="$@"
1518 fi
1519fi
1520fi
1521fi
1522CC="$ac_cv_prog_CC"
1523if test -n "$CC"; then
1524 echo "$ac_t""$CC" 1>&6
1525else
1526 echo "$ac_t""no" 1>&6
1527fi
1528
1529 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1530fi
b11fb939 1531
c6c7035c 1532echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
894cca25 1533echo "configure:1534: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
c6c7035c
MM
1534
1535ac_ext=c
1536# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1537ac_cpp='$CPP $CPPFLAGS'
1538ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1539ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1540cross_compiling=$ac_cv_prog_cc_cross
1541
1542cat > conftest.$ac_ext <<EOF
894cca25 1543#line 1544 "configure"
c6c7035c
MM
1544#include "confdefs.h"
1545main(){return(0);}
1546EOF
894cca25 1547if { (eval echo configure:1548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
c6c7035c
MM
1548 ac_cv_prog_cc_works=yes
1549 # If we can't run a trivial program, we are probably using a cross compiler.
1550 if (./conftest; exit) 2>/dev/null; then
1551 ac_cv_prog_cc_cross=no
1552 else
1553 ac_cv_prog_cc_cross=yes
1554 fi
1555else
1556 echo "configure: failed program was:" >&5
1557 cat conftest.$ac_ext >&5
1558 ac_cv_prog_cc_works=no
1559fi
1560rm -fr conftest*
1561
1562echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1563if test $ac_cv_prog_cc_works = no; then
1564 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1565fi
1566echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
894cca25 1567echo "configure:1568: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
c6c7035c
MM
1568echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1569cross_compiling=$ac_cv_prog_cc_cross
1570
330add8a 1571echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
894cca25 1572echo "configure:1573: checking whether we are using GNU C" >&5
330add8a
ILT
1573if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1574 echo $ac_n "(cached) $ac_c" 1>&6
1575else
1576 cat > conftest.c <<EOF
b11fb939 1577#ifdef __GNUC__
330add8a 1578 yes;
b11fb939
KR
1579#endif
1580EOF
894cca25 1581if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
330add8a
ILT
1582 ac_cv_prog_gcc=yes
1583else
1584 ac_cv_prog_gcc=no
1585fi
1586fi
1c9dbb83 1587
330add8a 1588echo "$ac_t""$ac_cv_prog_gcc" 1>&6
c6c7035c 1589
330add8a 1590if test $ac_cv_prog_gcc = yes; then
b11fb939 1591 GCC=yes
c6c7035c
MM
1592 ac_test_CFLAGS="${CFLAGS+set}"
1593 ac_save_CFLAGS="$CFLAGS"
1594 CFLAGS=
1595 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
894cca25 1596echo "configure:1597: checking whether ${CC-cc} accepts -g" >&5
c6c7035c 1597if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
330add8a 1598 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1599else
330add8a
ILT
1600 echo 'void f(){}' > conftest.c
1601if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
c6c7035c 1602 ac_cv_prog_cc_g=yes
330add8a 1603else
c6c7035c 1604 ac_cv_prog_cc_g=no
b11fb939
KR
1605fi
1606rm -f conftest*
1607
330add8a 1608fi
1c9dbb83 1609
c6c7035c
MM
1610echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
1611 if test "$ac_test_CFLAGS" = set; then
1612 CFLAGS="$ac_save_CFLAGS"
1613 elif test $ac_cv_prog_cc_g = yes; then
1614 CFLAGS="-g -O2"
1615 else
1616 CFLAGS="-O2"
330add8a
ILT
1617 fi
1618else
1619 GCC=
1620 test "${CFLAGS+set}" = set || CFLAGS="-g"
1621fi
1622
bf111c9f
KR
1623# Find a good install program. We prefer a C program (faster),
1624# so one script is as good as another. But avoid the broken or
1625# incompatible versions:
b11fb939
KR
1626# SysV /etc/install, /usr/sbin/install
1627# SunOS /usr/etc/install
1628# IRIX /sbin/install
1629# AIX /bin/install
1630# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1631# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1632# ./install, which can be erroneously created by make from ./install.sh.
833c46e1 1633echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
894cca25 1634echo "configure:1635: checking for a BSD compatible install" >&5
28d3e4a3 1635if test -z "$INSTALL"; then
833c46e1
KR
1636if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1637 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1638else
c6c7035c 1639 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
b11fb939 1640 for ac_dir in $PATH; do
833c46e1
KR
1641 # Account for people who put trailing slashes in PATH elements.
1642 case "$ac_dir/" in
1643 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
b11fb939
KR
1644 *)
1645 # OSF1 and SCO ODT 3.0 have their own names for install.
1646 for ac_prog in ginstall installbsd scoinst install; do
1647 if test -f $ac_dir/$ac_prog; then
1648 if test $ac_prog = install &&
1649 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1650 # AIX install. It has an incompatible calling convention.
1651 # OSF/1 installbsd also uses dspmsg, but is usable.
1652 :
1653 else
1654 ac_cv_path_install="$ac_dir/$ac_prog -c"
1655 break 2
1656 fi
1657 fi
1658 done
1659 ;;
1660 esac
1661 done
c6c7035c 1662 IFS="$ac_save_IFS"
1c9dbb83 1663
b11fb939 1664fi
1c9dbb83
ILT
1665 if test "${ac_cv_path_install+set}" = set; then
1666 INSTALL="$ac_cv_path_install"
1667 else
1668 # As a last resort, use the slow shell script. We don't cache a
1669 # path for INSTALL within a source directory, because that will
1670 # break other packages using the cache if that directory is
1671 # removed, or if the path is relative.
1672 INSTALL="$ac_install_sh"
1673 fi
b11fb939 1674fi
833c46e1 1675echo "$ac_t""$INSTALL" 1>&6
b11fb939
KR
1676
1677# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1678# It thinks the first close brace ends the variable substitution.
1679test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1680
1681test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1682
1683
833c46e1 1684echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
894cca25 1685echo "configure:1686: checking how to run the C preprocessor" >&5
b11fb939
KR
1686# On Suns, sometimes $CPP names a directory.
1687if test -n "$CPP" && test -d "$CPP"; then
1688 CPP=
1689fi
1690if test -z "$CPP"; then
833c46e1
KR
1691if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1692 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939
KR
1693else
1694 # This must be in double quotes, not single quotes, because CPP may get
1695 # substituted into the Makefile and "${CC-cc}" will confuse make.
1696 CPP="${CC-cc} -E"
1697 # On the NeXT, cc -E runs the code through the compiler's parser,
1698 # not just through cpp.
28d3e4a3 1699 cat > conftest.$ac_ext <<EOF
894cca25 1700#line 1701 "configure"
b11fb939 1701#include "confdefs.h"
f2889110 1702#include <assert.h>
b11fb939
KR
1703Syntax Error
1704EOF
d0352cbb 1705ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
894cca25 1706{ (eval echo configure:1707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
bf111c9f 1707ac_err=`grep -v '^ *+' conftest.out`
b11fb939
KR
1708if test -z "$ac_err"; then
1709 :
1710else
fb589130 1711 echo "$ac_err" >&5
c6c7035c
MM
1712 echo "configure: failed program was:" >&5
1713 cat conftest.$ac_ext >&5
b11fb939
KR
1714 rm -rf conftest*
1715 CPP="${CC-cc} -E -traditional-cpp"
28d3e4a3 1716 cat > conftest.$ac_ext <<EOF
894cca25 1717#line 1718 "configure"
b11fb939 1718#include "confdefs.h"
f2889110 1719#include <assert.h>
b11fb939
KR
1720Syntax Error
1721EOF
d0352cbb 1722ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
894cca25 1723{ (eval echo configure:1724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
bf111c9f 1724ac_err=`grep -v '^ *+' conftest.out`
b11fb939
KR
1725if test -z "$ac_err"; then
1726 :
1727else
fb589130 1728 echo "$ac_err" >&5
c6c7035c
MM
1729 echo "configure: failed program was:" >&5
1730 cat conftest.$ac_ext >&5
b11fb939
KR
1731 rm -rf conftest*
1732 CPP=/lib/cpp
1733fi
1734rm -f conftest*
1735fi
1736rm -f conftest*
1737 ac_cv_prog_CPP="$CPP"
1738fi
e63c594d
FF
1739 CPP="$ac_cv_prog_CPP"
1740else
1741 ac_cv_prog_CPP="$CPP"
b11fb939 1742fi
833c46e1 1743echo "$ac_t""$CPP" 1>&6
fb589130
KR
1744
1745for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h
1746do
c6c7035c 1747ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
833c46e1 1748echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
894cca25 1749echo "configure:1750: checking for $ac_hdr" >&5
833c46e1
KR
1750if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1751 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1752else
28d3e4a3 1753 cat > conftest.$ac_ext <<EOF
894cca25 1754#line 1755 "configure"
b11fb939 1755#include "confdefs.h"
28d3e4a3 1756#include <$ac_hdr>
b11fb939 1757EOF
d0352cbb 1758ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
894cca25 1759{ (eval echo configure:1760: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
bf111c9f 1760ac_err=`grep -v '^ *+' conftest.out`
b11fb939
KR
1761if test -z "$ac_err"; then
1762 rm -rf conftest*
fb589130 1763 eval "ac_cv_header_$ac_safe=yes"
b11fb939 1764else
fb589130 1765 echo "$ac_err" >&5
c6c7035c
MM
1766 echo "configure: failed program was:" >&5
1767 cat conftest.$ac_ext >&5
b11fb939 1768 rm -rf conftest*
fb589130 1769 eval "ac_cv_header_$ac_safe=no"
b11fb939
KR
1770fi
1771rm -f conftest*
b11fb939 1772fi
fb589130 1773if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
833c46e1 1774 echo "$ac_t""yes" 1>&6
c6c7035c 1775 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
fb589130 1776 cat >> confdefs.h <<EOF
28d3e4a3 1777#define $ac_tr_hdr 1
b11fb939 1778EOF
fb589130 1779
b11fb939 1780else
833c46e1 1781 echo "$ac_t""no" 1>&6
b11fb939 1782fi
fb589130 1783done
b11fb939 1784
b11fb939 1785
bf111c9f
KR
1786# Put this here so that autoconf's "cross-compiling" message doesn't confuse
1787# people who are not cross-compiling but are compiling cross-assemblers.
833c46e1 1788echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6
894cca25 1789echo "configure:1790: checking whether compiling a cross-assembler" >&5
bf111c9f 1790if test "${host}" = "${target}"; then
ba49e48d
KR
1791 cross_gas=no
1792else
bf111c9f
KR
1793 cross_gas=yes
1794 cat >> confdefs.h <<\EOF
1795#define CROSS_COMPILE 1
1796EOF
1797
bf111c9f 1798fi
833c46e1 1799echo "$ac_t""$cross_gas" 1>&6
bf111c9f 1800
b11fb939
KR
1801# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
1802# for constant arguments. Useless!
833c46e1 1803echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
894cca25 1804echo "configure:1805: checking for working alloca.h" >&5
833c46e1
KR
1805if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
1806 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1807else
28d3e4a3 1808 cat > conftest.$ac_ext <<EOF
894cca25 1809#line 1810 "configure"
b11fb939
KR
1810#include "confdefs.h"
1811#include <alloca.h>
c6c7035c 1812int main() {
b11fb939
KR
1813char *p = alloca(2 * sizeof(int));
1814; return 0; }
1815EOF
894cca25 1816if { (eval echo configure:1817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
b11fb939
KR
1817 rm -rf conftest*
1818 ac_cv_header_alloca_h=yes
1819else
c6c7035c
MM
1820 echo "configure: failed program was:" >&5
1821 cat conftest.$ac_ext >&5
b11fb939
KR
1822 rm -rf conftest*
1823 ac_cv_header_alloca_h=no
1824fi
1825rm -f conftest*
b11fb939 1826fi
1c9dbb83 1827
833c46e1 1828echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
b11fb939
KR
1829if test $ac_cv_header_alloca_h = yes; then
1830 cat >> confdefs.h <<\EOF
1831#define HAVE_ALLOCA_H 1
1832EOF
1833
1834fi
1835
833c46e1 1836echo $ac_n "checking for alloca""... $ac_c" 1>&6
894cca25 1837echo "configure:1838: checking for alloca" >&5
c6c7035c 1838if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
833c46e1 1839 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1840else
28d3e4a3 1841 cat > conftest.$ac_ext <<EOF
894cca25 1842#line 1843 "configure"
b11fb939
KR
1843#include "confdefs.h"
1844
1845#ifdef __GNUC__
1846# define alloca __builtin_alloca
1847#else
1848# if HAVE_ALLOCA_H
1849# include <alloca.h>
1850# else
1851# ifdef _AIX
1852 #pragma alloca
1853# else
1854# ifndef alloca /* predefined by HP cc +Olibcalls */
1855char *alloca ();
1856# endif
1857# endif
1858# endif
1859#endif
1860
c6c7035c 1861int main() {
b11fb939
KR
1862char *p = (char *) alloca(1);
1863; return 0; }
1864EOF
894cca25 1865if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
b11fb939 1866 rm -rf conftest*
c6c7035c 1867 ac_cv_func_alloca_works=yes
b11fb939 1868else
c6c7035c
MM
1869 echo "configure: failed program was:" >&5
1870 cat conftest.$ac_ext >&5
b11fb939 1871 rm -rf conftest*
c6c7035c 1872 ac_cv_func_alloca_works=no
b11fb939
KR
1873fi
1874rm -f conftest*
b11fb939 1875fi
1c9dbb83 1876
c6c7035c
MM
1877echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
1878if test $ac_cv_func_alloca_works = yes; then
b11fb939
KR
1879 cat >> confdefs.h <<\EOF
1880#define HAVE_ALLOCA 1
1881EOF
1882
1883fi
1884
c6c7035c 1885if test $ac_cv_func_alloca_works = no; then
b11fb939
KR
1886 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
1887 # that cause trouble. Some versions do not even contain alloca or
1888 # contain a buggy version. If you still want to use their alloca,
1889 # use ar to extract alloca.o from them instead of compiling alloca.c.
1890 ALLOCA=alloca.o
1891 cat >> confdefs.h <<\EOF
1892#define C_ALLOCA 1
1893EOF
1894
1895
833c46e1 1896echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
894cca25 1897echo "configure:1898: checking whether alloca needs Cray hooks" >&5
833c46e1
KR
1898if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
1899 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1900else
28d3e4a3 1901 cat > conftest.$ac_ext <<EOF
894cca25 1902#line 1903 "configure"
b11fb939
KR
1903#include "confdefs.h"
1904#if defined(CRAY) && ! defined(CRAY2)
1905webecray
1906#else
1907wenotbecray
1908#endif
1909
1910EOF
28d3e4a3 1911if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
fb589130 1912 egrep "webecray" >/dev/null 2>&1; then
b11fb939
KR
1913 rm -rf conftest*
1914 ac_cv_os_cray=yes
1915else
1916 rm -rf conftest*
1917 ac_cv_os_cray=no
1918fi
1919rm -f conftest*
1920
1921fi
1c9dbb83 1922
833c46e1 1923echo "$ac_t""$ac_cv_os_cray" 1>&6
b11fb939 1924if test $ac_cv_os_cray = yes; then
833c46e1
KR
1925for ac_func in _getb67 GETB67 getb67; do
1926 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
894cca25 1927echo "configure:1928: checking for $ac_func" >&5
833c46e1
KR
1928if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1929 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 1930else
28d3e4a3 1931 cat > conftest.$ac_ext <<EOF
894cca25 1932#line 1933 "configure"
b11fb939 1933#include "confdefs.h"
833c46e1
KR
1934/* System header to define __stub macros and hopefully few prototypes,
1935 which can conflict with char $ac_func(); below. */
1936#include <assert.h>
f1698cb7 1937/* Override any gcc2 internal prototype to avoid an error. */
df586de2
ILT
1938/* We use char because int might match the return type of a gcc2
1939 builtin and then its argument prototype would still apply. */
1c9dbb83 1940char $ac_func();
f1698cb7 1941
c6c7035c 1942int main() {
b11fb939
KR
1943
1944/* The GNU C library defines this for functions which it implements
1945 to always fail with ENOSYS. Some functions are actually named
1946 something starting with __ and the normal name is an alias. */
833c46e1 1947#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
b11fb939
KR
1948choke me
1949#else
833c46e1 1950$ac_func();
b11fb939
KR
1951#endif
1952
1953; return 0; }
1954EOF
894cca25 1955if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
b11fb939 1956 rm -rf conftest*
833c46e1 1957 eval "ac_cv_func_$ac_func=yes"
b11fb939 1958else
c6c7035c
MM
1959 echo "configure: failed program was:" >&5
1960 cat conftest.$ac_ext >&5
b11fb939 1961 rm -rf conftest*
833c46e1 1962 eval "ac_cv_func_$ac_func=no"
b11fb939
KR
1963fi
1964rm -f conftest*
7d0f8249 1965fi
c6c7035c 1966
833c46e1
KR
1967if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1968 echo "$ac_t""yes" 1>&6
1969 cat >> confdefs.h <<EOF
1970#define CRAY_STACKSEG_END $ac_func
b11fb939
KR
1971EOF
1972
833c46e1 1973 break
b11fb939 1974else
833c46e1 1975 echo "$ac_t""no" 1>&6
b11fb939
KR
1976fi
1977
833c46e1 1978done
b11fb939
KR
1979fi
1980
833c46e1 1981echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
894cca25 1982echo "configure:1983: checking stack direction for C alloca" >&5
833c46e1
KR
1983if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
1984 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939
KR
1985else
1986 if test "$cross_compiling" = yes; then
bf111c9f 1987 ac_cv_c_stack_direction=0
b11fb939 1988else
c6c7035c 1989 cat > conftest.$ac_ext <<EOF
894cca25 1990#line 1991 "configure"
b11fb939
KR
1991#include "confdefs.h"
1992find_stack_direction ()
1993{
1994 static char *addr = 0;
1995 auto char dummy;
1996 if (addr == 0)
1997 {
1998 addr = &dummy;
1999 return find_stack_direction ();
2000 }
2001 else
2002 return (&dummy > addr) ? 1 : -1;
2003}
2004main ()
2005{
2006 exit (find_stack_direction() < 0);
2007}
2008EOF
894cca25 2009if { (eval echo configure:2010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
c6c7035c 2010then
b11fb939
KR
2011 ac_cv_c_stack_direction=1
2012else
c6c7035c
MM
2013 echo "configure: failed program was:" >&5
2014 cat conftest.$ac_ext >&5
2015 rm -fr conftest*
b11fb939
KR
2016 ac_cv_c_stack_direction=-1
2017fi
7d0f8249 2018rm -fr conftest*
64556643
FF
2019fi
2020
c6c7035c
MM
2021fi
2022
833c46e1 2023echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
b11fb939
KR
2024cat >> confdefs.h <<EOF
2025#define STACK_DIRECTION $ac_cv_c_stack_direction
2026EOF
2027
2028fi
2029
833c46e1 2030echo $ac_n "checking for inline""... $ac_c" 1>&6
894cca25 2031echo "configure:2032: checking for inline" >&5
833c46e1
KR
2032if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
2033 echo $ac_n "(cached) $ac_c" 1>&6
b11fb939 2034else
833c46e1
KR
2035 ac_cv_c_inline=no
2036for ac_kw in inline __inline__ __inline; do
2037 cat > conftest.$ac_ext <<EOF
894cca25 2038#line 2039 "configure"
b11fb939
KR
2039#include "confdefs.h"
2040
c6c7035c 2041int main() {
833c46e1 2042} $ac_kw foo() {
b11fb939
KR
2043; return 0; }
2044EOF
894cca25 2045if { (eval echo configure:2046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
b11fb939 2046 rm -rf conftest*
833c46e1 2047 ac_cv_c_inline=$ac_kw; break
c6c7035c
MM
2048else
2049 echo "configure: failed program was:" >&5
2050 cat conftest.$ac_ext >&5
b11fb939
KR
2051fi
2052rm -f conftest*
833c46e1 2053done
b11fb939
KR
2054
2055fi
1c9dbb83 2056
833c46e1
KR
2057echo "$ac_t""$ac_cv_c_inline" 1>&6
2058case "$ac_cv_c_inline" in
2059 inline | yes) ;;
2060 no) cat >> confdefs.h <<\EOF
2061#define inline
2062EOF
2063 ;;
2064 *) cat >> confdefs.h <<EOF
2065#define inline $ac_cv_c_inline
2066EOF
2067 ;;
2068esac
b11fb939
KR
2069
2070
ba49e48d
KR
2071# VMS doesn't have unlink.
2072for ac_func in unlink remove
b9419dd2 2073do
833c46e1 2074echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
894cca25 2075echo "configure:2076: checking for $ac_func" >&5
833c46e1
KR
2076if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2077 echo $ac_n "(cached) $ac_c" 1>&6
28d3e4a3
KR
2078else
2079 cat > conftest.$ac_ext <<EOF
894cca25 2080#line 2081 "configure"
28d3e4a3 2081#include "confdefs.h"
833c46e1
KR
2082/* System header to define __stub macros and hopefully few prototypes,
2083 which can conflict with char $ac_func(); below. */
2084#include <assert.h>
f1698cb7 2085/* Override any gcc2 internal prototype to avoid an error. */
df586de2
ILT
2086/* We use char because int might match the return type of a gcc2
2087 builtin and then its argument prototype would still apply. */
1c9dbb83 2088char $ac_func();
f1698cb7 2089
c6c7035c 2090int main() {
28d3e4a3
KR
2091
2092/* The GNU C library defines this for functions which it implements
2093 to always fail with ENOSYS. Some functions are actually named
2094 something starting with __ and the normal name is an alias. */
b9419dd2 2095#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
28d3e4a3
KR
2096choke me
2097#else
f1698cb7 2098$ac_func();
28d3e4a3
KR
2099#endif
2100
2101; return 0; }
2102EOF
894cca25 2103if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
28d3e4a3 2104 rm -rf conftest*
b9419dd2 2105 eval "ac_cv_func_$ac_func=yes"
28d3e4a3 2106else
c6c7035c
MM
2107 echo "configure: failed program was:" >&5
2108 cat conftest.$ac_ext >&5
28d3e4a3 2109 rm -rf conftest*
b9419dd2 2110 eval "ac_cv_func_$ac_func=no"
28d3e4a3
KR
2111fi
2112rm -f conftest*
7d0f8249 2113fi
c6c7035c 2114
b9419dd2 2115if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
833c46e1 2116 echo "$ac_t""yes" 1>&6
1c9dbb83 2117 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
b9419dd2
KR
2118 cat >> confdefs.h <<EOF
2119#define $ac_tr_func 1
28d3e4a3 2120EOF
b9419dd2 2121 break
28d3e4a3 2122else
833c46e1 2123 echo "$ac_t""no" 1>&6
28d3e4a3 2124fi
b9419dd2 2125done
28d3e4a3
KR
2126
2127
e63c594d
FF
2128# Some systems don't have sbrk().
2129for ac_func in sbrk
2130do
2131echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
894cca25 2132echo "configure:2133: checking for $ac_func" >&5
e63c594d
FF
2133if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2134 echo $ac_n "(cached) $ac_c" 1>&6
2135else
2136 cat > conftest.$ac_ext <<EOF
894cca25 2137#line 2138 "configure"
e63c594d
FF
2138#include "confdefs.h"
2139/* System header to define __stub macros and hopefully few prototypes,
2140 which can conflict with char $ac_func(); below. */
2141#include <assert.h>
2142/* Override any gcc2 internal prototype to avoid an error. */
df586de2
ILT
2143/* We use char because int might match the return type of a gcc2
2144 builtin and then its argument prototype would still apply. */
1c9dbb83 2145char $ac_func();
e63c594d 2146
c6c7035c 2147int main() {
e63c594d
FF
2148
2149/* The GNU C library defines this for functions which it implements
2150 to always fail with ENOSYS. Some functions are actually named
2151 something starting with __ and the normal name is an alias. */
2152#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2153choke me
2154#else
2155$ac_func();
2156#endif
2157
2158; return 0; }
2159EOF
894cca25 2160if { (eval echo configure:2161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
e63c594d
FF
2161 rm -rf conftest*
2162 eval "ac_cv_func_$ac_func=yes"
2163else
c6c7035c
MM
2164 echo "configure: failed program was:" >&5
2165 cat conftest.$ac_ext >&5
e63c594d
FF
2166 rm -rf conftest*
2167 eval "ac_cv_func_$ac_func=no"
2168fi
2169rm -f conftest*
7d0f8249 2170fi
c6c7035c 2171
e63c594d
FF
2172if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2173 echo "$ac_t""yes" 1>&6
1c9dbb83 2174 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
e63c594d
FF
2175 cat >> confdefs.h <<EOF
2176#define $ac_tr_func 1
2177EOF
2178
2179else
2180 echo "$ac_t""no" 1>&6
2181fi
2182done
2183
2184
b11fb939
KR
2185# Some non-ANSI preprocessors botch requoting inside strings. That's bad
2186# enough, but on some of those systems, the assert macro relies on requoting
2187# working properly!
833c46e1 2188echo $ac_n "checking for working assert macro""... $ac_c" 1>&6
894cca25 2189echo "configure:2190: checking for working assert macro" >&5
833c46e1
KR
2190if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then
2191 echo $ac_n "(cached) $ac_c" 1>&6
fb589130 2192else
28d3e4a3 2193 cat > conftest.$ac_ext <<EOF
894cca25 2194#line 2195 "configure"
b11fb939
KR
2195#include "confdefs.h"
2196#include <assert.h>
2197#include <stdio.h>
c6c7035c 2198int main() {
b11fb939
KR
2199
2200/* check for requoting problems */
2201static int a, b, c, d;
2202static char *s;
2203assert (!strcmp(s, "foo bar baz quux"));
2204/* check for newline handling */
2205assert (a == b
2206 || c == d);
2207
2208; return 0; }
2209EOF
894cca25 2210if { (eval echo configure:2211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fb589130
KR
2211 rm -rf conftest*
2212 gas_cv_assert_ok=yes
b11fb939 2213else
c6c7035c
MM
2214 echo "configure: failed program was:" >&5
2215 cat conftest.$ac_ext >&5
b11fb939 2216 rm -rf conftest*
fb589130 2217 gas_cv_assert_ok=no
b11fb939
KR
2218fi
2219rm -f conftest*
fb589130 2220fi
833c46e1 2221echo "$ac_t""$gas_cv_assert_ok" 1>&6
fb589130
KR
2222test $gas_cv_assert_ok = yes || cat >> confdefs.h <<\EOF
2223#define BROKEN_ASSERT 1
2224EOF
2225
b11fb939 2226
bf111c9f 2227
b11fb939
KR
2228# On some systems, the system header files may not declare malloc, realloc,
2229# and free. There are places where gas needs these functions to have been
2230# declared -- such as when taking their addresses.
bf111c9f 2231gas_test_headers="
b11fb939
KR
2232#ifdef HAVE_MEMORY_H
2233#include <memory.h>
2234#endif
2235#ifdef HAVE_STRING_H
2236#include <string.h>
5cece526
ILT
2237#else
2238#ifdef HAVE_STRINGS_H
2239#include <strings.h>
2240#endif
b11fb939
KR
2241#endif
2242#ifdef HAVE_STDLIB_H
2243#include <stdlib.h>
2244#endif
2245#ifdef HAVE_UNISTD_H
2246#include <unistd.h>
2247#endif
bf111c9f 2248"
b11fb939 2249
5cece526 2250echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6
894cca25 2251echo "configure:2252: checking whether declaration is required for strstr" >&5
5cece526
ILT
2252if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then
2253 echo $ac_n "(cached) $ac_c" 1>&6
2254else
2255 cat > conftest.$ac_ext <<EOF
894cca25 2256#line 2257 "configure"
5cece526
ILT
2257#include "confdefs.h"
2258$gas_test_headers
c6c7035c 2259int main() {
5cece526
ILT
2260
2261typedef char *(*f)();
2262f x;
2263x = (f) strstr;
2264
2265; return 0; }
2266EOF
894cca25 2267if { (eval echo configure:2268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5cece526
ILT
2268 rm -rf conftest*
2269 gas_cv_decl_needed_strstr=no
2270else
c6c7035c
MM
2271 echo "configure: failed program was:" >&5
2272 cat conftest.$ac_ext >&5
5cece526
ILT
2273 rm -rf conftest*
2274 gas_cv_decl_needed_strstr=yes
2275fi
2276rm -f conftest*
5cece526
ILT
2277fi
2278echo "$ac_t""$gas_cv_decl_needed_strstr" 1>&6
2279test $gas_cv_decl_needed_strstr = no || {
2280 cat >> confdefs.h <<\EOF
2281#define NEED_DECLARATION_STRSTR 1
2282EOF
2283
2284}
2285
2286
833c46e1 2287echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6
894cca25 2288echo "configure:2289: checking whether declaration is required for malloc" >&5
833c46e1
KR
2289if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then
2290 echo $ac_n "(cached) $ac_c" 1>&6
bf111c9f 2291else
28d3e4a3 2292 cat > conftest.$ac_ext <<EOF
894cca25 2293#line 2294 "configure"
bf111c9f
KR
2294#include "confdefs.h"
2295$gas_test_headers
c6c7035c 2296int main() {
b11fb939 2297
bf111c9f
KR
2298typedef char *(*f)();
2299f x;
2300x = (f) malloc;
b11fb939
KR
2301
2302; return 0; }
2303EOF
894cca25 2304if { (eval echo configure:2305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fb589130 2305 rm -rf conftest*
bf111c9f 2306 gas_cv_decl_needed_malloc=no
b11fb939 2307else
c6c7035c
MM
2308 echo "configure: failed program was:" >&5
2309 cat conftest.$ac_ext >&5
b11fb939 2310 rm -rf conftest*
bf111c9f 2311 gas_cv_decl_needed_malloc=yes
fb589130
KR
2312fi
2313rm -f conftest*
fb589130 2314fi
833c46e1 2315echo "$ac_t""$gas_cv_decl_needed_malloc" 1>&6
bf111c9f
KR
2316test $gas_cv_decl_needed_malloc = no || {
2317 cat >> confdefs.h <<\EOF
2318#define NEED_DECLARATION_MALLOC 1
b11fb939
KR
2319EOF
2320
bf111c9f
KR
2321}
2322
b11fb939 2323
833c46e1 2324echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6
894cca25 2325echo "configure:2326: checking whether declaration is required for free" >&5
833c46e1
KR
2326if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then
2327 echo $ac_n "(cached) $ac_c" 1>&6
fb589130 2328else
28d3e4a3 2329 cat > conftest.$ac_ext <<EOF
894cca25 2330#line 2331 "configure"
b11fb939 2331#include "confdefs.h"
bf111c9f 2332$gas_test_headers
c6c7035c 2333int main() {
b11fb939 2334
5f757edc 2335typedef void (*f)();
bf111c9f
KR
2336f x;
2337x = (f) free;
b11fb939
KR
2338
2339; return 0; }
2340EOF
894cca25 2341if { (eval echo configure:2342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fb589130 2342 rm -rf conftest*
bf111c9f 2343 gas_cv_decl_needed_free=no
b11fb939 2344else
c6c7035c
MM
2345 echo "configure: failed program was:" >&5
2346 cat conftest.$ac_ext >&5
b11fb939 2347 rm -rf conftest*
bf111c9f 2348 gas_cv_decl_needed_free=yes
b11fb939
KR
2349fi
2350rm -f conftest*
fb589130 2351fi
833c46e1 2352echo "$ac_t""$gas_cv_decl_needed_free" 1>&6
bf111c9f
KR
2353test $gas_cv_decl_needed_free = no || {
2354 cat >> confdefs.h <<\EOF
2355#define NEED_DECLARATION_FREE 1
fb589130
KR
2356EOF
2357
bf111c9f
KR
2358}
2359
b11fb939 2360
5cece526 2361echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6
894cca25 2362echo "configure:2363: checking whether declaration is required for sbrk" >&5
5cece526
ILT
2363if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then
2364 echo $ac_n "(cached) $ac_c" 1>&6
2365else
2366 cat > conftest.$ac_ext <<EOF
894cca25 2367#line 2368 "configure"
5cece526
ILT
2368#include "confdefs.h"
2369$gas_test_headers
c6c7035c 2370int main() {
5cece526
ILT
2371
2372typedef char *(*f)();
2373f x;
2374x = (f) sbrk;
2375
2376; return 0; }
2377EOF
894cca25 2378if { (eval echo configure:2379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
5cece526
ILT
2379 rm -rf conftest*
2380 gas_cv_decl_needed_sbrk=no
2381else
c6c7035c
MM
2382 echo "configure: failed program was:" >&5
2383 cat conftest.$ac_ext >&5
5cece526
ILT
2384 rm -rf conftest*
2385 gas_cv_decl_needed_sbrk=yes
2386fi
2387rm -f conftest*
5cece526
ILT
2388fi
2389echo "$ac_t""$gas_cv_decl_needed_sbrk" 1>&6
2390test $gas_cv_decl_needed_sbrk = no || {
2391 cat >> confdefs.h <<\EOF
2392#define NEED_DECLARATION_SBRK 1
2393EOF
2394
2395}
2396
2397
b11fb939
KR
2398# Does errno.h declare errno, or do we have to add a separate declaration
2399# for it?
bf111c9f 2400
833c46e1 2401echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6
894cca25 2402echo "configure:2403: checking whether declaration is required for errno" >&5
833c46e1
KR
2403if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then
2404 echo $ac_n "(cached) $ac_c" 1>&6
fb589130 2405else
28d3e4a3 2406 cat > conftest.$ac_ext <<EOF
894cca25 2407#line 2408 "configure"
b11fb939
KR
2408#include "confdefs.h"
2409
2410#ifdef HAVE_ERRNO_H
2411#include <errno.h>
2412#endif
2413
c6c7035c 2414int main() {
b11fb939 2415
bf111c9f
KR
2416typedef int f;
2417f x;
2418x = (f) errno;
b11fb939
KR
2419
2420; return 0; }
2421EOF
894cca25 2422if { (eval echo configure:2423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
fb589130 2423 rm -rf conftest*
bf111c9f 2424 gas_cv_decl_needed_errno=no
b11fb939 2425else
c6c7035c
MM
2426 echo "configure: failed program was:" >&5
2427 cat conftest.$ac_ext >&5
b11fb939 2428 rm -rf conftest*
bf111c9f 2429 gas_cv_decl_needed_errno=yes
b11fb939
KR
2430fi
2431rm -f conftest*
fb589130 2432fi
833c46e1 2433echo "$ac_t""$gas_cv_decl_needed_errno" 1>&6
bf111c9f
KR
2434test $gas_cv_decl_needed_errno = no || {
2435 cat >> confdefs.h <<\EOF
2436#define NEED_DECLARATION_ERRNO 1
fb589130
KR
2437EOF
2438
bf111c9f
KR
2439}
2440
b11fb939 2441
1c9dbb83 2442HLDFLAGS=
df4021c1 2443HLDENV=
1a2f3c3f 2444RPATH_ENVVAR=LD_LIBRARY_PATH
1c9dbb83
ILT
2445# If we have shared libraries, try to set rpath reasonably.
2446if test "${shared}" = "true"; then
2447 case "${host}" in
56f9773f
ILT
2448 *-*-hpux*)
2449 HLDFLAGS='-Wl,+s,+b,$(libdir)'
1a2f3c3f 2450 RPATH_ENVVAR=SHLIB_PATH
56f9773f 2451 ;;
cbe7dccb 2452 *-*-irix5* | *-*-irix6*)
1c9dbb83
ILT
2453 HLDFLAGS='-Wl,-rpath,$(libdir)'
2454 ;;
2455 *-*-linux*aout*)
2456 ;;
2457 *-*-linux*)
2458 HLDFLAGS='-Wl,-rpath,$(libdir)'
2459 ;;
df4021c1 2460 *-*-solaris*)
1c9dbb83
ILT
2461 HLDFLAGS='-R $(libdir)'
2462 ;;
df4021c1
DE
2463 *-*-sysv4*)
2464 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
2465 ;;
1c9dbb83
ILT
2466 esac
2467fi
2468
2469# On SunOS, if the linker supports the -rpath option, use it to
2470# prevent ../bfd and ../opcodes from being included in the run time
2471# search path.
2472case "${host}" in
2473 *-*-sunos*)
2474 echo 'main () { }' > conftest.c
2475 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
2476 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
2477 :
2478 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
2479 :
7925f4d4
ILT
2480 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
2481 :
1c9dbb83
ILT
2482 elif test "${shared}" = "true"; then
2483 HLDFLAGS='-Wl,-rpath=$(libdir)'
2484 else
2485 HLDFLAGS='-Wl,-rpath='
2486 fi
2487 rm -f conftest.t conftest.c conftest
2488 ;;
2489esac
2490
2491
1a2f3c3f 2492
df4021c1 2493
515c7142
ILT
2494
2495
ba49e48d 2496trap '' 1 2 15
833c46e1 2497cat > confcache <<\EOF
b11fb939
KR
2498# This file is a shell script that caches the results of configure
2499# tests run on this system so they can be shared between configure
2500# scripts and configure runs. It is not useful on other systems.
bf111c9f 2501# If it contains results you don't want to keep, you may remove or edit it.
b11fb939
KR
2502#
2503# By default, configure uses ./config.cache as the cache file,
2504# creating it if it does not exist already. You can give configure
2505# the --cache-file=FILE option to use a different cache file; that is
2506# what configure does when it calls configure scripts in
2507# subdirectories, so they share the cache.
2508# Giving --cache-file=/dev/null disables caching, for debugging configure.
2509# config.status only pays attention to the cache file if you give it the
2510# --recheck option to rerun configure.
e23b25ec 2511#
b11fb939 2512EOF
c6c7035c
MM
2513# The following way of writing the cache mishandles newlines in values,
2514# but we know of no workaround that is simple, portable, and efficient.
2515# So, don't put newlines in cache variables' values.
833c46e1
KR
2516# Ultrix sh set writes to stderr and can't be redirected directly,
2517# and sets the high bit in the cache file unless we assign to the vars.
e23b25ec 2518(set) 2>&1 |
c6c7035c
MM
2519 case `(ac_space=' '; set) 2>&1` in
2520 *ac_space=\ *)
2521 # `set' does not quote correctly, so add quotes (double-quote substitution
2522 # turns \\\\ into \\, and sed turns \\ into \).
2523 sed -n \
2524 -e "s/'/'\\\\''/g" \
2525 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
2526 ;;
2527 *)
2528 # `set' quotes correctly as required by POSIX, so do not add quotes.
2529 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
2530 ;;
2531 esac >> confcache
833c46e1
KR
2532if cmp -s $cache_file confcache; then
2533 :
b11fb939 2534else
833c46e1
KR
2535 if test -w $cache_file; then
2536 echo "updating cache $cache_file"
2537 cat confcache > $cache_file
2538 else
2539 echo "not updating unwritable cache $cache_file"
2540 fi
b11fb939 2541fi
833c46e1 2542rm -f confcache
b11fb939 2543
833c46e1 2544trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
b11fb939 2545
f2889110 2546test "x$prefix" = xNONE && prefix=$ac_default_prefix
b11fb939
KR
2547# Let make expand exec_prefix.
2548test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
2549
2550# Any assignment to VPATH causes Sun make to only execute
2551# the first set of double-colon rules, so remove it if not needed.
2552# If there is a colon in the path, we need to keep it.
2553if test "x$srcdir" = x.; then
2554 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
2555fi
2556
2557trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
2558
2559DEFS=-DHAVE_CONFIG_H
2560
2561# Without the "./", some shells look in PATH for config.status.
2562: ${CONFIG_STATUS=./config.status}
2563
28d3e4a3
KR
2564echo creating $CONFIG_STATUS
2565rm -f $CONFIG_STATUS
2566cat > $CONFIG_STATUS <<EOF
833c46e1 2567#! /bin/sh
b11fb939
KR
2568# Generated automatically by configure.
2569# Run this file to recreate the current configuration.
2570# This directory was configured as follows,
2571# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
2572#
e23b25ec 2573# $0 $ac_configure_args
b11fb939
KR
2574#
2575# Compiler output produced by configure, useful for debugging
2576# configure, is in ./config.log if it exists.
2577
28d3e4a3 2578ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
b11fb939
KR
2579for ac_option
2580do
2581 case "\$ac_option" in
2582 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
e23b25ec
KR
2583 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
2584 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
b11fb939 2585 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
c6c7035c 2586 echo "$CONFIG_STATUS generated by autoconf version 2.12"
b11fb939
KR
2587 exit 0 ;;
2588 -help | --help | --hel | --he | --h)
2589 echo "\$ac_cs_usage"; exit 0 ;;
2590 *) echo "\$ac_cs_usage"; exit 1 ;;
2591 esac
2592done
2593
2594ac_given_srcdir=$srcdir
2595ac_given_INSTALL="$INSTALL"
2596
833c46e1 2597trap 'rm -fr `echo "Makefile doc/Makefile .gdbinit:gdbinit.in conf" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
1c9dbb83
ILT
2598EOF
2599cat >> $CONFIG_STATUS <<EOF
b11fb939 2600
1c9dbb83
ILT
2601# Protect against being on the right side of a sed subst in config.status.
2602sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
2603 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
b11fb939
KR
2604$ac_vpsub
2605$extrasub
b11fb939 2606s%@CFLAGS@%$CFLAGS%g
b11fb939 2607s%@CPPFLAGS@%$CPPFLAGS%g
bf111c9f
KR
2608s%@CXXFLAGS@%$CXXFLAGS%g
2609s%@DEFS@%$DEFS%g
b11fb939 2610s%@LDFLAGS@%$LDFLAGS%g
bf111c9f
KR
2611s%@LIBS@%$LIBS%g
2612s%@exec_prefix@%$exec_prefix%g
2613s%@prefix@%$prefix%g
ba49e48d 2614s%@program_transform_name@%$program_transform_name%g
1c9dbb83
ILT
2615s%@bindir@%$bindir%g
2616s%@sbindir@%$sbindir%g
2617s%@libexecdir@%$libexecdir%g
2618s%@datadir@%$datadir%g
2619s%@sysconfdir@%$sysconfdir%g
2620s%@sharedstatedir@%$sharedstatedir%g
2621s%@localstatedir@%$localstatedir%g
2622s%@libdir@%$libdir%g
2623s%@includedir@%$includedir%g
2624s%@oldincludedir@%$oldincludedir%g
2625s%@infodir@%$infodir%g
2626s%@mandir@%$mandir%g
b11fb939
KR
2627s%@host@%$host%g
2628s%@host_alias@%$host_alias%g
2629s%@host_cpu@%$host_cpu%g
2630s%@host_vendor@%$host_vendor%g
2631s%@host_os@%$host_os%g
2632s%@target@%$target%g
2633s%@target_alias@%$target_alias%g
2634s%@target_cpu@%$target_cpu%g
2635s%@target_vendor@%$target_vendor%g
2636s%@target_os@%$target_os%g
2637s%@build@%$build%g
2638s%@build_alias@%$build_alias%g
2639s%@build_cpu@%$build_cpu%g
2640s%@build_vendor@%$build_vendor%g
2641s%@build_os@%$build_os%g
b11fb939
KR
2642/@target_frag@/r $target_frag
2643s%@target_frag@%%g
e7757ad0 2644s%@extra_objects@%$extra_objects%g
bf4bd1fc 2645s%@target_cpu_type@%$target_cpu_type%g
833c46e1 2646s%@obj_format@%$obj_format%g
515c7142 2647s%@te_file@%$te_file%g
833c46e1 2648s%@atof@%$atof%g
1c9dbb83 2649s%@BFDDEP@%$BFDDEP%g
b11fb939 2650s%@BFDLIB@%$BFDLIB%g
2e013bb7
ILT
2651s%@OPCODES_DEP@%$OPCODES_DEP%g
2652s%@OPCODES_LIB@%$OPCODES_LIB%g
b11fb939
KR
2653s%@ALL_OBJ_DEPS@%$ALL_OBJ_DEPS%g
2654s%@CC@%$CC%g
2655s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
2656s%@INSTALL_DATA@%$INSTALL_DATA%g
2657s%@CPP@%$CPP%g
2658s%@ALLOCA@%$ALLOCA%g
1c9dbb83 2659s%@HLDFLAGS@%$HLDFLAGS%g
df4021c1 2660s%@HLDENV@%$HLDENV%g
1a2f3c3f 2661s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
b11fb939
KR
2662
2663CEOF
2664EOF
c6c7035c
MM
2665
2666cat >> $CONFIG_STATUS <<\EOF
2667
2668# Split the substitutions into bite-sized pieces for seds with
2669# small command number limits, like on Digital OSF/1 and HP-UX.
2670ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
2671ac_file=1 # Number of current file.
2672ac_beg=1 # First line for current file.
2673ac_end=$ac_max_sed_cmds # Line after last line for current file.
2674ac_more_lines=:
2675ac_sed_cmds=""
2676while $ac_more_lines; do
2677 if test $ac_beg -gt 1; then
2678 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
2679 else
2680 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
2681 fi
2682 if test ! -s conftest.s$ac_file; then
2683 ac_more_lines=false
2684 rm -f conftest.s$ac_file
2685 else
2686 if test -z "$ac_sed_cmds"; then
2687 ac_sed_cmds="sed -f conftest.s$ac_file"
2688 else
2689 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
2690 fi
2691 ac_file=`expr $ac_file + 1`
2692 ac_beg=$ac_end
2693 ac_end=`expr $ac_end + $ac_max_sed_cmds`
2694 fi
2695done
2696if test -z "$ac_sed_cmds"; then
2697 ac_sed_cmds=cat
2698fi
2699EOF
2700
28d3e4a3 2701cat >> $CONFIG_STATUS <<EOF
b11fb939 2702
28d3e4a3 2703CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile .gdbinit:gdbinit.in"}
bf111c9f 2704EOF
28d3e4a3
KR
2705cat >> $CONFIG_STATUS <<\EOF
2706for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
c6c7035c 2707 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
b11fb939 2708 case "$ac_file" in
c6c7035c 2709 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
b11fb939
KR
2710 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2711 *) ac_file_in="${ac_file}.in" ;;
2712 esac
2713
c6c7035c 2714 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
b11fb939
KR
2715
2716 # Remove last slash and all that follows it. Not all systems have dirname.
2717 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2718 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2719 # The file is in a subdirectory.
2720 test ! -d "$ac_dir" && mkdir "$ac_dir"
833c46e1 2721 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
b11fb939
KR
2722 # A "../" for each directory in $ac_dir_suffix.
2723 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
2724 else
2725 ac_dir_suffix= ac_dots=
2726 fi
2727
2728 case "$ac_given_srcdir" in
2729 .) srcdir=.
2730 if test -z "$ac_dots"; then top_srcdir=.
2731 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
2732 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
2733 *) # Relative path.
2734 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
2735 top_srcdir="$ac_dots$ac_given_srcdir" ;;
2736 esac
2737
2738 case "$ac_given_INSTALL" in
2739 [/$]*) INSTALL="$ac_given_INSTALL" ;;
28d3e4a3 2740 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
b11fb939 2741 esac
c6c7035c 2742
b11fb939
KR
2743 echo creating "$ac_file"
2744 rm -f "$ac_file"
28d3e4a3 2745 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
ba49e48d
KR
2746 case "$ac_file" in
2747 *Makefile*) ac_comsub="1i\\
2748# $configure_input" ;;
2749 *) ac_comsub= ;;
2750 esac
c6c7035c
MM
2751
2752 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
ba49e48d 2753 sed -e "$ac_comsub
28d3e4a3 2754s%@configure_input@%$configure_input%g
b11fb939
KR
2755s%@srcdir@%$srcdir%g
2756s%@top_srcdir@%$top_srcdir%g
2757s%@INSTALL@%$INSTALL%g
c6c7035c 2758" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
b11fb939 2759fi; done
c6c7035c 2760rm -f conftest.s*
b11fb939
KR
2761
2762# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
2763# NAME is the cpp macro being defined and VALUE is the value it is being given.
2764#
2765# ac_d sets the value in "#define NAME VALUE" lines.
2766ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
2767ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
2768ac_dC='\3'
2769ac_dD='%g'
2770# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
2771ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2772ac_uB='\([ ]\)%\1#\2define\3'
2773ac_uC=' '
2774ac_uD='\4%g'
2775# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
2776ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
2777ac_eB='$%\1#\2define\3'
2778ac_eC=' '
2779ac_eD='%g'
2780
c6c7035c
MM
2781if test "${CONFIG_HEADERS+set}" != set; then
2782EOF
2783cat >> $CONFIG_STATUS <<EOF
2784 CONFIG_HEADERS="conf"
2785EOF
2786cat >> $CONFIG_STATUS <<\EOF
2787fi
28d3e4a3 2788for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
c6c7035c 2789 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
b11fb939 2790 case "$ac_file" in
c6c7035c 2791 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
b11fb939
KR
2792 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2793 *) ac_file_in="${ac_file}.in" ;;
2794 esac
2795
2796 echo creating $ac_file
2797
2798 rm -f conftest.frag conftest.in conftest.out
c6c7035c
MM
2799 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
2800 cat $ac_file_inputs > conftest.in
b11fb939
KR
2801
2802EOF
2803
2804# Transform confdefs.h into a sed script conftest.vals that substitutes
fb589130 2805# the proper values into config.h.in to produce config.h. And first:
1c9dbb83 2806# Protect against being on the right side of a sed subst in config.status.
fb589130 2807# Protect against being in an unquoted here document in config.status.
b11fb939
KR
2808rm -f conftest.vals
2809cat > conftest.hdr <<\EOF
b11fb939 2810s/[\\&%]/\\&/g
b11fb939 2811s%[\\$`]%\\&%g
df586de2 2812s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
b11fb939
KR
2813s%ac_d%ac_u%gp
2814s%ac_u%ac_e%gp
2815EOF
2816sed -n -f conftest.hdr confdefs.h > conftest.vals
2817rm -f conftest.hdr
2818
2819# This sed command replaces #undef with comments. This is necessary, for
2820# example, in the case of _POSIX_SOURCE, which is predefined and required
2821# on some systems where configure will not decide to define it.
2822cat >> conftest.vals <<\EOF
2823s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
2824EOF
2825
2826# Break up conftest.vals because some shells have a limit on
2827# the size of here documents, and old seds have small limits too.
b11fb939
KR
2828
2829rm -f conftest.tail
2830while :
2831do
2832 ac_lines=`grep -c . conftest.vals`
2833 # grep -c gives empty output for an empty file on some AIX systems.
2834 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
2835 # Write a limited-size here document to conftest.frag.
28d3e4a3
KR
2836 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
2837 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
b11fb939
KR
2838 echo 'CEOF
2839 sed -f conftest.frag conftest.in > conftest.out
2840 rm -f conftest.in
2841 mv conftest.out conftest.in
28d3e4a3 2842' >> $CONFIG_STATUS
b11fb939
KR
2843 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
2844 rm -f conftest.vals
2845 mv conftest.tail conftest.vals
2846done
2847rm -f conftest.vals
2848
28d3e4a3 2849cat >> $CONFIG_STATUS <<\EOF
b11fb939
KR
2850 rm -f conftest.frag conftest.h
2851 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
2852 cat conftest.in >> conftest.h
2853 rm -f conftest.in
2854 if cmp -s $ac_file conftest.h 2>/dev/null; then
2855 echo "$ac_file is unchanged"
2856 rm -f conftest.h
2857 else
df586de2
ILT
2858 # Remove last slash and all that follows it. Not all systems have dirname.
2859 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
2860 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
2861 # The file is in a subdirectory.
2862 test ! -d "$ac_dir" && mkdir "$ac_dir"
2863 fi
b11fb939
KR
2864 rm -f $ac_file
2865 mv conftest.h $ac_file
2866 fi
2867fi; done
2868
c6c7035c
MM
2869EOF
2870cat >> $CONFIG_STATUS <<EOF
515c7142
ILT
2871target_cpu_type=${target_cpu_type}
2872 obj_format=${obj_format}
2873 te_file=${te_file}
c6c7035c
MM
2874EOF
2875cat >> $CONFIG_STATUS <<\EOF
515c7142
ILT
2876rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
2877 echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
2878 echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
2879 echo '#include "te-'"${te_file}"'.h"' > targ-env.h
2880 echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
39ffbb4d
DE
2881 case ${target_cpu_type} in
2882 m32r) echo '#include "opcodes/'"${target_cpu_type}"'-opc.h"' > cgen-opc.h ;;
2883 esac
36e889af 2884exit 0
b11fb939 2885EOF
28d3e4a3 2886chmod +x $CONFIG_STATUS
bf111c9f 2887rm -fr confdefs* $ac_clean_files
833c46e1 2888test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
b11fb939 2889