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