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