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