* configure.in (crisv32): Recognize. AC_DEFINE_UNQUOTED
[external/binutils.git] / gas / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 dnl And be careful when changing it!  If you must add tests with square
4 dnl brackets, be sure changequote invocations surround it.
5 dnl
6 dnl
7 dnl v2.5 needed for --bindir et al
8 AC_PREREQ(2.57)
9 AC_INIT(as.h)
10
11 dnl Autoconf 2.57 will find the aux dir without this.  However, unless
12 dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in
13 dnl gas/ instead of gas/../.
14 AC_CONFIG_AUX_DIR(..)
15 AC_CANONICAL_SYSTEM
16 AC_ISC_POSIX
17
18 changequote(,)dnl
19 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[         ]*\([^  ]*\)[   ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
20 changequote([,])dnl
21 AM_INIT_AUTOMAKE(gas, ${BFD_VERSION})
22
23 AM_PROG_LIBTOOL
24
25 user_bfd_gas=
26 AC_ARG_ENABLE(bfd-assembler,
27 [  --enable-bfd-assembler  use BFD back end for writing object files],
28 [case "${enableval}" in
29   yes) need_bfd=yes user_bfd_gas=yes ;;
30   no)  user_bfd_gas=no ;;
31   *)   AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
32 esac])dnl
33 AC_ARG_ENABLE(targets,
34 [    targets            alternative target configurations besides the primary],
35 [case "${enableval}" in
36   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
37             ;;
38   no)       enable_targets= ;;
39   *)        enable_targets=$enableval ;;
40 esac])dnl
41 AC_ARG_ENABLE(commonbfdlib,
42 [  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
43 [case "${enableval}" in
44   yes) commonbfdlib=true ;;
45   no)  commonbfdlib=false ;;
46   *)   AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
47 esac])dnl
48
49 using_cgen=no
50
51 build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
52 AC_ARG_ENABLE(build-warnings,
53 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
54 [case "${enableval}" in
55   yes)  ;;
56   no)   build_warnings="-w";;
57   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
58         build_warnings="${build_warnings} ${t}";;
59   *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
60         build_warnings="${t} ${build_warnings}";;
61   *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
62 esac
63 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
64   echo "Setting warning flags = $build_warnings" 6>&1
65 fi])dnl
66 WARN_CFLAGS=""
67 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
68     WARN_CFLAGS="${build_warnings}"
69 fi
70 AC_SUBST(WARN_CFLAGS)
71
72 # Generate a header file
73 AM_CONFIG_HEADER(config.h:config.in)
74
75 # If we are on a DOS filesystem, we must use gdb.ini rather than
76 # .gdbinit.
77 case "${host}" in
78   *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*)
79     GDBINIT="gdb.ini"
80     AC_CONFIG_FILES(gdb.ini:gdbinit.in)
81     ;;
82   *)
83     GDBINIT=".gdbinit"
84     AC_CONFIG_FILES(.gdbinit:gdbinit.in)
85     ;;
86 esac
87 AC_SUBST(GDBINIT)
88
89 te_file=generic
90
91 # Makefile target for installing gas in $(tooldir)/bin.
92 install_tooldir=install-exec-tooldir
93
94 canon_targets=""
95 all_targets=no
96 if test -n "$enable_targets" ; then
97   for t in `echo $enable_targets | sed 's/,/ /g'`; do
98     if test $t = "all"; then
99       all_targets=yes
100       continue
101     fi
102     result=`$ac_config_sub $t 2>/dev/null`
103     if test -n "$result" ; then
104       canon_targets="$canon_targets $result"
105 #    else
106 #      # Permit "all", etc.  We don't support it yet though.
107 #      canon_targets="$canon_targets $t"
108     fi
109   done
110   GAS_UNIQ(canon_targets)
111 fi
112
113 emulations=""
114
115 for this_target in $target $canon_targets ; do
116
117 changequote(,)dnl
118     eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
119 changequote([,])dnl
120
121     # Check for architecture variants.
122     # Note: This table is alpha-sorted, please try to keep it that way.
123     arch=
124     endian=
125     case ${cpu} in
126       am33_2.0)         cpu_type=mn10300 endian=little ;;
127       alpha*)           cpu_type=alpha ;;
128       arm*be|xscale*be|strongarm*be | \
129       arm*b|xscale*b|strongarm*b) cpu_type=arm endian=big ;;
130       arm*|xscale*|strongarm*)    cpu_type=arm endian=little ;;
131       c4x*)             cpu_type=tic4x ;;
132       crisv32)          cpu_type=cris arch=crisv32
133                         AC_DEFINE_UNQUOTED(DEFAULT_CRIS_ARCH, $arch,
134                                            [Default CRIS architecture.])
135                         ;;
136       crx*)             cpu_type=crx endian=little ;;
137       hppa*)            cpu_type=hppa ;;
138 changequote(,)dnl
139       i[3-7]86)         cpu_type=i386 arch=i386;;
140       ia64)             cpu_type=ia64 ;;
141       ip2k)             cpu_type=ip2k endian=big ;; 
142       iq2000)           cpu_type=iq2000 endian=big ;; 
143       m32r)             cpu_type=m32r target_cpu=m32r endian=big ;;
144       m32rle)           cpu_type=m32r target_cpu=m32r endian=little ;;
145       m6811|m6812|m68hc12) cpu_type=m68hc11 ;;
146       m680[012346]0)    cpu_type=m68k ;;
147 changequote([,])dnl
148       m68008)           cpu_type=m68k ;;
149       m683??)           cpu_type=m68k ;;
150       m5200)            cpu_type=m68k ;;
151       m8*)              cpu_type=m88k ;;
152       mips*el)          cpu_type=mips endian=little ;;
153       mips*)            cpu_type=mips endian=big ;;
154       or32*)            cpu_type=or32 endian=big ;;
155       pjl*)             cpu_type=pj endian=little ;;
156       pj*)              cpu_type=pj endian=big ;;
157       powerpc*le*)      cpu_type=ppc endian=little ;;
158       powerpc*)         cpu_type=ppc endian=big ;;
159       rs6000*)          cpu_type=ppc ;;
160       s390x*)           cpu_type=s390 arch=s390x ;;
161       s390*)            cpu_type=s390 arch=s390 ;;
162       sh5*)             cpu_type=sh64 endian=big ;;
163       sh5le*)           cpu_type=sh64 endian=little ;;
164       sh64*)            cpu_type=sh64 endian=big ;;
165       sh64le*)          cpu_type=sh64 endian=little ;;
166       sh*le)            cpu_type=sh endian=little ;;
167       sh*)              cpu_type=sh endian=big ;;
168       sparclite*)       cpu_type=sparc arch=sparclite ;;
169       sparclet*)        cpu_type=sparc arch=sparclet ;;
170       sparc64*)         cpu_type=sparc arch=v9-64 ;;
171       sparc86x*)        cpu_type=sparc arch=sparc86x  ;;
172       sparc*)           cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c.
173       v850*)            cpu_type=v850 ;;
174       x86_64)           cpu_type=i386 arch=x86_64;;
175       xtensa*)          cpu_type=xtensa arch=xtensa ;;
176       *)                cpu_type=${cpu} ;;
177     esac
178
179     if test ${this_target} = $target ; then
180       target_cpu_type=${cpu_type}
181     elif test ${target_cpu_type} != ${cpu_type} ; then
182       continue
183     fi
184
185     generic_target=${cpu_type}-$vendor-$os
186     dev=no
187     bfd_gas=no
188     em=generic
189
190     # Assign object format.
191     # Note: This table is alpha-sorted, please try to keep it that way.
192     case ${generic_target} in
193       a29k-*-coff)                      fmt=coff ;;
194       a29k-amd-udi)                     fmt=coff ;;
195       a29k-amd-ebmon)                   fmt=coff ;;
196       a29k-nyu-sym1)                    fmt=coff ;;
197       a29k-*-rtems*)                    fmt=coff ;;
198       a29k-*-vxworks*)                  fmt=coff ;;
199
200       alpha*-*-*vms*)                   fmt=evax ;;
201       alpha*-*-osf*)                    fmt=ecoff ;;
202       alpha*-*-linuxecoff*)             fmt=ecoff ;;
203       alpha*-*-linux-gnu*)              fmt=elf em=linux ;;
204       alpha*-*-netbsd*)                 fmt=elf em=nbsd ;;
205       alpha*-*-openbsd*)                fmt=elf em=obsd ;;
206
207       arc-*-elf*)                       fmt=elf ;;
208
209       arm-*-aout)                       fmt=aout ;;
210       arm-*-coff | thumb-*-coff)        fmt=coff ;;
211       arm-*-rtems* | thumb-*-rtems*)    fmt=elf ;;
212       arm-*-elf | thumb-*-elf)          fmt=elf ;;
213       arm*-*-eabi*)                     fmt=elf ;;
214       arm*-*-symbianelf*)               fmt=elf em=symbian ;;
215       arm-*-kaos*)                      fmt=elf ;;
216       arm*-*-conix*)                    fmt=elf ;;
217       arm-*-linux*aout*)                fmt=aout em=linux ;;
218       arm*-*-linux-gnu*)                fmt=elf  em=linux ;;
219       arm*-*-uclinux*)                  fmt=elf  em=linux ;;
220       arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
221       arm-*-*n*bsd*)                    fmt=aout em=nbsd ;;
222       arm-**-nto*)                      fmt=elf ;;
223       arm-*-oabi | thumb-*-oabi)        fmt=elf ;;
224       arm-epoc-pe | thumb-epoc-pe)      fmt=coff em=epoc-pe ;;
225       arm-wince-pe | arm-*-wince)       fmt=coff em=wince-pe ;;
226       arm-*-pe | thumb-*-pe)            fmt=coff em=pe ;;
227       arm-*-riscix*)                    fmt=aout em=riscix ;;
228
229       avr-*-*)                          fmt=elf ;;
230
231       cris-*-linux-gnu* | crisv32-*-linux-gnu*)
232                                         fmt=multi bfd_gas=yes em=linux ;;
233       cris-*-* | crisv32-*-*)           fmt=multi bfd_gas=yes ;;
234
235       crx-*-elf*)                       fmt=elf ;;
236
237       d10v-*-*)                         fmt=elf ;;
238       d30v-*-*)                         fmt=elf ;;
239       dlx-*-*)                          fmt=elf ;;
240
241       fr30-*-*)                         fmt=elf ;;
242       frv-*-*linux*)                    fmt=elf em=linux;;
243       frv-*-*)                          fmt=elf ;;
244
245       hppa-*-linux*)    case ${cpu} in
246                             hppa*64*)   fmt=elf em=hppalinux64;;
247                             hppa*)      fmt=elf em=linux;;
248                         esac ;;
249       hppa-*-*elf*)                     fmt=elf em=hppa ;;
250       hppa-*-lites*)                    fmt=elf em=hppa ;;
251       hppa-*-netbsd*)                   fmt=elf em=nbsd ;;
252       hppa-*-openbsd*)                  fmt=elf em=hppa ;;
253       hppa-*-osf*)                      fmt=som em=hppa ;;
254       hppa-*-rtems*)                    fmt=elf em=hppa ;;
255       hppa-*-hpux11*)   case ${cpu} in
256                             hppa*64*)   fmt=elf em=hppa64 ;;
257                             hppa*)      fmt=som em=hppa ;;
258                         esac ;;
259       hppa-*-hpux*)                     fmt=som em=hppa ;;
260       hppa-*-mpeix*)                    fmt=som em=hppa ;;
261       hppa-*-bsd*)                      fmt=som em=hppa ;;
262       hppa-*-hiux*)                     fmt=som em=hppa ;;
263
264       h8300-*-rtems*)                   fmt=coff ;;
265       h8300-*-coff)                     fmt=coff ;;
266       h8300-*-elf)                      fmt=elf ;;
267       h8500-*-rtems*)                   fmt=coff ;;
268       h8500-*-coff)                     fmt=coff ;;
269
270       i370-*-elf* | i370-*-linux*)      fmt=elf ;;
271       i386-ibm-aix*)                    fmt=coff em=i386aix ;;
272       i386-sequent-bsd*)                fmt=aout em=dynix ;;
273       i386-*-beospe*)                   fmt=coff em=pe ;;
274       i386-*-beos*)                     fmt=elf ;;
275       i386-*-coff)                      fmt=coff ;;
276       i386-*-elf)                       fmt=elf ;;
277       i386-*-kaos*)                     fmt=elf ;;
278       i386-*-bsd*)                      fmt=aout em=386bsd ;;
279       i386-*-netbsd0.8)                 fmt=aout em=386bsd ;;
280       i386-*-netbsdpe*)                 fmt=coff em=pe ;;
281       i386-*-netbsd*-gnu* | \
282       i386-*-knetbsd*-gnu | \
283       i386-*-netbsdelf*)                fmt=elf em=nbsd ;;
284       i386-*-*n*bsd*)   case ${cpu} in
285                             x86_64)     fmt=elf em=nbsd ;;
286                             *)          fmt=aout em=nbsd ;;
287                         esac ;;
288       i386-*-linux*aout*)               fmt=aout em=linux ;;
289       i386-*-linux*oldld)               fmt=aout em=linux ;;
290       i386-*-linux*coff*)               fmt=coff em=linux ;;
291       i386-*-linux-gnu*)                fmt=elf em=linux ;;
292       x86_64-*-linux-gnu*)              fmt=elf em=linux ;;
293       i386-*-lynxos*)                   fmt=elf em=lynx bfd_gas=yes ;;
294 changequote(,)dnl
295       i386-*-sysv[45]*)                 fmt=elf ;;
296       i386-*-solaris*)                  fmt=elf ;;
297       i386-*-freebsdaout*)              fmt=aout em=386bsd ;;
298       i386-*-freebsd[12].*)             fmt=aout em=386bsd ;;
299       i386-*-freebsd[12])               fmt=aout em=386bsd ;;
300 changequote([,])dnl
301       i386-*-freebsd* | i386-*-kfreebsd*-gnu)
302                                         fmt=elf em=freebsd ;;
303       i386-*-sysv*)                     fmt=coff ;;
304       i386-*-sco3.2v5*coff)             fmt=coff ;;
305       i386-*-isc*)                      fmt=coff ;;
306       i386-*-sco3.2v5*)                 fmt=elf
307           if test ${this_target} = $target; then
308             AC_DEFINE(SCO_ELF, 1, [Define if defaulting to ELF on SCO 5.])
309           fi ;;
310       i386-*-sco3.2*)                   fmt=coff ;;
311       i386-*-vsta)                      fmt=aout ;;
312       i386-*-msdosdjgpp* \
313       | i386-*-go32* \
314       | i386-go32-rtems*)               fmt=coff em=go32
315             AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?]) ;;
316       i386-*-rtemself*)                 fmt=elf ;;
317       i386-*-rtemscoff*)                fmt=coff ;;
318       i386-*-rtems*)                    fmt=elf ;;
319       i386-*-gnu*)                      fmt=elf ;;
320       i386-*-mach*)                     fmt=aout em=mach ;;
321       i386-*-msdos*)                    fmt=aout ;;
322       i386-*-moss*)                     fmt=elf ;;
323       i386-*-pe)                        fmt=coff em=pe ;;
324       i386-*-cygwin*)                   fmt=coff em=pe ;;
325       i386-*-interix*)                  fmt=coff em=interix ;;
326       i386-*-mingw32*)                  fmt=coff em=pe ;;
327       i386-*-nto-qnx*)                  fmt=elf ;;
328       i386-*-*nt*)                      fmt=coff em=pe ;;
329       i386-*-chaos)                     fmt=elf ;;
330
331       i860-*-*)                         fmt=elf endian=little
332                 AC_MSG_WARN(GAS support for ${generic_target} is preliminary and a work in progress) ;;
333       i960-*-bout)                      fmt=bout ;;
334       i960-*-coff)                      fmt=coff em=ic960 ;;
335       i960-*-rtems*)                    fmt=coff em=ic960 ;;
336       i960-*-nindy*)                    fmt=bout ;;
337       i960-*-vxworks5.0)                fmt=bout ;;
338       i960-*-vxworks5.*)                fmt=coff em=ic960 ;;
339       i960-*-vxworks*)                  fmt=bout ;;
340       i960-*-elf*)                      fmt=elf ;;
341
342       ia64-*-elf*)                      fmt=elf ;;
343       ia64-*-aix*)                      fmt=elf em=ia64aix ;;
344       ia64-*-linux-gnu*)                fmt=elf em=linux ;;
345       ia64-*-hpux*)                     fmt=elf em=hpux ;;
346       ia64-*-netbsd*)                   fmt=elf em=nbsd ;;
347
348       ip2k-*-*)                         fmt=elf ;;
349
350       iq2000-*-elf)                     fmt=elf bfd_gas=yes ;;
351
352       m32r-*-elf*)                      fmt=elf ;;
353       m32r-*-linux*)                    fmt=elf em=linux;;
354
355       m68hc11-*-* | m6811-*-*)          fmt=elf ;;
356       m68hc12-*-* | m6812-*-*)          fmt=elf ;;
357
358       m68k-*-vxworks*)                  fmt=aout em=sun3 ;;
359       m68k-ericsson-ose)                fmt=aout em=sun3 ;;
360       m68k-*-sunos*)                    fmt=aout em=sun3 ;;
361       m68k-motorola-sysv*)              fmt=coff em=delta ;;
362       m68k-bull-sysv3*)                 fmt=coff em=dpx2 ;;
363       m68k-apollo-*)                    fmt=coff em=apollo ;;
364       m68k-*-elf*)                      fmt=elf ;;
365       m68k-*-sysv4*)                    fmt=elf em=svr4 ;;
366       m68k-*-sysv*)                     fmt=coff ;;
367       m68k-*-coff | m68k-*-rtemscoff*)  fmt=coff ;;
368       m68k-*-rtems*)                    fmt=elf ;;
369       m68k-*-hpux*)                     fmt=hp300 em=hp300 ;;
370       m68k-*-linux*aout*)               fmt=aout em=linux ;;
371       m68k-*-linux-gnu*)                fmt=elf em=linux ;;
372       m68k-*-uclinux*)                  fmt=elf ;;
373       m68k-*-gnu*)                      fmt=elf ;;
374       m68k-*-lynxos*)                   fmt=coff em=lynx ;;
375       m68k-*-netbsdelf*)                fmt=elf em=nbsd ;;
376       m68k-*-netbsd*)                   fmt=aout em=nbsd bfd_gas=yes ;;
377       m68k-*-openbsd*)                  fmt=aout em=nbsd bfd_gas=yes ;;
378       m68k-apple-aux*)                  fmt=coff em=aux ;;
379       m68k-*-psos*)                     fmt=elf em=psos;;
380
381       m88k-motorola-sysv3*)             fmt=coff em=delt88 ;;
382       m88k-*-coff*)                     fmt=coff ;;
383
384       mcore-*-elf)                      fmt=elf ;;
385       mcore-*-pe)                       fmt=coff em=pe bfd_gas=yes ;;
386
387       # don't change em like *-*-bsd does
388       mips-dec-openbsd*)                fmt=elf endian=little ;;
389       mips-sony-bsd*)                   fmt=ecoff ;;
390       mips-*-bsd*)
391             AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
392       mips-*-ultrix*)                   fmt=ecoff endian=little ;;
393       mips-*-osf*)                      fmt=ecoff endian=little ;;
394       mips-*-ecoff*)                    fmt=ecoff ;;
395       mips-*-pe*)                       fmt=coff endian=little em=pe ;;
396       mips-*-irix6*)                    fmt=elf em=irix ;;
397       mips-*-irix5*)                    fmt=elf em=irix ;;
398       mips-*-irix*)                     fmt=ecoff em=irix ;;
399       mips-*-lnews*)                    fmt=ecoff em=lnews ;;
400       mips-*-riscos*)                   fmt=ecoff ;;
401       mips*-*-linux*)                   fmt=elf em=tmips ;;
402       mips-*-sysv4*MP* | mips-*-gnu*)   fmt=elf em=tmips ;;
403       mips-*-sysv*)                     fmt=ecoff ;;
404       mips-*-elf* | mips-*-rtems*)      fmt=elf ;;
405       mips-*-netbsd*)                   fmt=elf ;;
406       mips-*-openbsd*)                  fmt=elf ;;
407
408       mmix-*-*)                         fmt=elf ;;
409       mn10200-*-*)                      fmt=elf ;;
410       # cpu_type for am33_2.0 is set to mn10300
411       mn10300-*-linux*)                 fmt=elf bfd_gas=yes em=linux ;;
412       mn10300-*-*)                      fmt=elf ;;
413
414       msp430-*-*)                       fmt=elf ;;
415
416       ns32k-pc532-mach*)                fmt=aout em=pc532mach ;;
417       ns32k-pc532-ux*)                  fmt=aout em=pc532mach ;;
418       ns32k-pc532-lites*)               fmt=aout em=nbsd532 ;;
419       ns32k-*-*n*bsd*)                  fmt=aout em=nbsd532 ;;
420
421       openrisc-*-*)                     fmt=elf ;;
422       or32-*-rtems*)                    fmt=elf ;;
423       or32-*-coff)                      fmt=coff ;;
424       or32-*-elf)                       fmt=elf ;;
425
426       pj*)                              fmt=elf ;;
427
428       ppc-*-pe | ppc-*-cygwin*)         fmt=coff em=pe ;;
429       ppc-*-winnt*)                     fmt=coff em=pe ;;
430 changequote(,)dnl
431       ppc-*-aix5.[01])                  fmt=coff em=aix5 ;;
432 changequote([,])dnl
433       ppc-*-aix5.*)                     fmt=coff em=aix5
434         AC_DEFINE(AIX_WEAK_SUPPORT, 1,
435                   [Define if using AIX 5.2 value for C_WEAKEXT.])
436       ;;
437       ppc-*-aix*)                       fmt=coff ;;
438       ppc-*-beos*)                      fmt=coff ;;
439       ppc-*-*n*bsd* | ppc-*-elf*)       fmt=elf ;;
440       ppc-*-eabi* | ppc-*-sysv4*)       fmt=elf ;;
441       ppc-*-linux-gnu*)                 fmt=elf em=linux
442             case "$endian" in
443                 big)  ;;
444                 *)    AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
445             esac ;;
446       ppc-*-solaris*)                   fmt=elf
447             if test ${this_target} = $target; then
448                 AC_DEFINE(TARGET_SOLARIS_COMMENT, 1,
449                           [Define if default target is PowerPC Solaris.])
450             fi
451             if test x${endian} = xbig; then
452                 AC_MSG_ERROR(Solaris must be configured little endian)
453             fi ;;
454       ppc-*-rtems*)                     fmt=elf ;;
455       ppc-*-macos*)                     fmt=coff em=macos ;;
456       ppc-*-nto*)                       fmt=elf ;;
457       ppc-*-kaos*)                      fmt=elf ;;
458       ppc-*-lynxos*)                    fmt=elf em=lynx bfd_gas=yes ;;
459
460       s390x-*-linux-gnu*)               fmt=elf em=linux ;;
461       s390-*-linux-gnu*)                fmt=elf em=linux ;;
462
463       sh*-*-linux*)                     fmt=elf em=linux
464             case ${cpu} in
465                 sh*eb)  endian=big ;;
466                 *)      endian=little ;;
467             esac ;;
468       sh5*-*-netbsd*)                   fmt=elf em=nbsd ;;
469       sh64*-*-netbsd*)                  fmt=elf em=nbsd ;;
470       sh*-*-netbsdelf*)                 fmt=elf em=nbsd ;;
471       sh*-*-symbianelf*)                fmt=elf endian=little
472                 AC_DEFINE(TARGET_SYMBIAN, 1, [Define if target is Symbian OS.])
473                 ;;
474       sh-*-elf*)                        fmt=elf ;;
475       sh-*-coff*)                       fmt=coff ;;
476       sh-*-nto*)                        fmt=elf ;;
477       sh-*-pe*)                         fmt=coff em=pe bfd_gas=yes endian=little ;;
478       sh-*-rtemscoff*)                  fmt=coff ;;
479       sh-*-rtems*)                      fmt=elf ;;
480       sh-*-kaos*)                       fmt=elf ;;
481       shle*-*-kaos*)                    fmt=elf ;;
482       sh64-*-elf*)                      fmt=elf ;;
483
484       sparc-*-rtemsaout*)               fmt=aout ;;
485       sparc-*-rtemself*)                fmt=elf ;;
486       sparc-*-rtems*)                   fmt=elf ;;
487       sparc-*-sunos4*)                  fmt=aout em=sun3 ;;
488       sparc-*-aout | sparc*-*-vxworks*) fmt=aout em=sparcaout ;;
489       sparc-*-coff)                     fmt=coff ;;
490       sparc-*-linux*aout*)              fmt=aout em=linux ;;
491       sparc-*-linux-gnu*)               fmt=elf em=linux ;;
492       sparc-*-lynxos*)                  fmt=coff em=lynx ;;
493       sparc-fujitsu-none)               fmt=aout ;;
494       sparc-*-elf)                      fmt=elf ;;
495       sparc-*-sysv4*)                   fmt=elf ;;
496       sparc-*-solaris*)                 fmt=elf ;;
497       sparc-*-netbsdelf*)               fmt=elf em=nbsd ;;
498       sparc-*-*n*bsd*)  case ${cpu} in
499                             sparc64)    fmt=elf em=nbsd ;;
500                             *)          fmt=aout em=nbsd ;;
501                         esac ;;
502       strongarm-*-coff)                 fmt=coff ;;
503       strongarm-*-elf)                  fmt=elf ;;
504       strongarm-*-kaos*)                fmt=elf ;;
505
506       tic30-*-*aout*)                   fmt=aout bfd_gas=yes ;;
507       tic30-*-*coff*)                   fmt=coff bfd_gas=yes ;;
508       tic4x-*-* | c4x-*-*)              fmt=coff bfd_gas=yes ;;
509       tic54x-*-* | c54x*-*-*)           fmt=coff bfd_gas=yes need_libm=yes;;
510       tic80-*-*)                        fmt=coff ;;
511
512       v850-*-*)                         fmt=elf ;;
513       v850e-*-*)                        fmt=elf ;;
514       v850ea-*-*)                       fmt=elf ;;
515
516       vax-*-netbsdelf*)                 fmt=elf em=nbsd ;;
517       vax-*-netbsd*)                    fmt=aout em=nbsd ;;
518       vax-*-bsd* | vax-*-ultrix*)       fmt=aout ;;
519       vax-*-linux-gnu*)                 fmt=elf em=linux bfd_gas=yes ;;
520       vax-*-vms)                        fmt=vms ;;
521
522       w65-*-*)                          fmt=coff ;;
523
524       xscale-*-coff)                    fmt=coff ;;
525       xscale-*-elf)                     fmt=elf ;;
526
527       xstormy16-*-*)                    fmt=elf ;;
528
529       xtensa-*-*)                       fmt=elf ;;
530
531       z8k-*-coff | z8k-*-sim)           fmt=coff ;;
532
533       *-*-aout | *-*-scout)             fmt=aout ;;
534       *-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;;
535       *-*-nindy*)                       fmt=bout ;;
536       *-*-bsd*)                         fmt=aout em=sun3 ;;
537       *-*-generic)                      fmt=generic ;;
538       *-*-xray | *-*-hms)               fmt=coff ;;
539       *-*-sim)                          fmt=coff ;;
540       *-*-elf | *-*-sysv4* | *-*-solaris*) fmt=elf dev=yes ;;
541       *-*-aros*)                        fmt=elf em=linux bfd_gas=yes ;;
542       *-*-vxworks | *-*-windiss)        fmt=elf ;;
543       *-*-netware)                      fmt=elf em=netware ;;
544     esac
545
546     if test ${this_target} = $target ; then
547       endian_def=
548       if test x${endian} = xbig; then
549         endian_def=1
550       elif test x${endian} = xlittle; then
551         endian_def=0
552       fi
553       if test x${endian_def} != x; then
554         AC_DEFINE_UNQUOTED(TARGET_BYTES_BIG_ENDIAN, $endian_def,
555                            [Define as 1 if big endian.])
556       fi
557     fi
558
559     case ${cpu_type}-${fmt} in
560         alpha*-* | arm-* | i386-* | ia64*-* | mips-* | ns32k-* \
561                 | pdp11-* | ppc-* | sparc-* | strongarm-* | xscale-* \
562                 | *-elf | *-ecoff | *-som)
563             bfd_gas=yes ;;
564     esac
565
566 # Other random stuff.
567
568     case ${cpu_type} in
569       mips)
570         # Set mips_cpu to the name of the default CPU.
571         case ${target_cpu} in
572           mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el)
573             mips_cpu=from-abi
574             ;;
575           mipsisa32 | mipsisa32el)
576             mips_cpu=mips32
577             ;;
578           mipsisa32r2 | mipsisa32r2el)
579             mips_cpu=mips32r2
580             ;;
581           mipsisa64 | mipsisa64el)
582             mips_cpu=mips64
583             ;;
584           mipsisa64r2 | mipsisa64r2el)
585             mips_cpu=mips64r2
586             ;;
587           mipstx39 | mipstx39el)
588             mips_cpu=r3900
589             ;;
590           mips64vr | mips64vrel)
591             mips_cpu=vr4100
592             ;;
593           mipsisa32r2* | mipsisa64r2*)
594 changequote(,)dnl
595             mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'`
596 changequote([,])dnl
597             ;;
598           mips64* | mipsisa64* | mipsisa32*)
599 changequote(,)dnl
600             mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'`
601 changequote([,])dnl
602             ;;
603           *)
604             AC_ERROR($target_cpu isn't a supported MIPS CPU name)
605             ;;
606         esac
607         # See whether it's appropriate to set E_MIPS_ABI_O32 for o32
608         # binaries.  It's a GNU extension that some OSes don't understand.
609         # The value only matters on ELF targets.
610         case ${target} in
611           *-*-irix*)
612             use_e_mips_abi_o32=0
613             ;;
614           *)
615             use_e_mips_abi_o32=1
616             ;;
617         esac
618         # Decide whether to generate 32-bit or 64-bit code by default.
619         # Used to resolve -march=from-abi when an embedded ABI is selected.
620         case ${target} in
621           mips64*-*-* | mipsisa64*-*-*)
622             mips_default_64bit=1
623             ;;
624           *)
625             mips_default_64bit=0
626             ;;
627         esac
628         # Decide which ABI to target by default.
629         case ${target} in
630           mips64*-linux* | mips-sgi-irix6*)
631             mips_default_abi=N32_ABI
632             ;;
633           mips*-linux*)
634             mips_default_abi=O32_ABI
635             ;;
636           *)
637             mips_default_abi=NO_ABI
638             ;;
639         esac
640         AC_DEFINE_UNQUOTED(MIPS_CPU_STRING_DEFAULT, "$mips_cpu",
641                            [Default CPU for MIPS targets. ])
642         AC_DEFINE_UNQUOTED(USE_E_MIPS_ABI_O32, $use_e_mips_abi_o32,
643                            [Allow use of E_MIPS_ABI_O32 on MIPS targets. ])
644         AC_DEFINE_UNQUOTED(MIPS_DEFAULT_64BIT, $mips_default_64bit,
645                            [Generate 64-bit code by default on MIPS targets. ])
646         AC_DEFINE_UNQUOTED(MIPS_DEFAULT_ABI, $mips_default_abi,
647                            [Choose a default ABI for MIPS targets. ])
648         ;;
649     esac
650
651     # Do we need the opcodes library?
652     case ${cpu_type} in
653       vax | i386 | tic30)
654         ;;
655
656       *)
657         need_opcodes=yes
658
659         case "${enable_shared}" in
660         yes) shared_opcodes=true ;;
661         *opcodes*) shared_opcodes=true ;;
662         *) shared_opcodes=false ;;
663         esac
664         if test "${shared_opcodes}" = "true"; then
665           # A shared libopcodes must be linked against libbfd.
666           need_bfd=yes
667         fi
668         ;;
669     esac
670
671     # Any other special object files needed ?
672     case ${cpu_type} in
673       fr30 | ip2k | iq2000 | m32r | openrisc)
674         using_cgen=yes
675         ;;
676
677       frv)
678         using_cgen=yes
679         ;;
680       m68k)
681         case ${extra_objects} in
682         *m68k-parse.o*) ;;
683         *) extra_objects="$extra_objects m68k-parse.o" ;;
684         esac
685         ;;
686
687       mips)
688         echo ${extra_objects} | grep -s "itbl-parse.o" 
689         if test $? -ne 0 ; then
690           extra_objects="$extra_objects itbl-parse.o"
691         fi
692
693         echo ${extra_objects} | grep -s "itbl-lex.o" 
694         if test $? -ne 0 ; then
695           extra_objects="$extra_objects itbl-lex.o"
696         fi
697
698         echo ${extra_objects} | grep -s "itbl-ops.o" 
699         if test $? -ne 0 ; then
700           extra_objects="$extra_objects itbl-ops.o"
701         fi
702         ;;
703
704       i386 | s390 | sparc)
705         if test $this_target = $target ; then
706           AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}", [Default architecture.])
707         fi
708         ;;
709
710       xstormy16)
711         using_cgen=yes
712         ;;
713
714       xtensa)
715         echo ${extra_objects} | grep -s "xtensa-relax.o"
716         if test $? -ne 0 ; then
717           extra_objects="$extra_objects xtensa-relax.o"
718         fi
719         ;;
720
721       *)
722         ;;
723     esac
724
725     if test $using_cgen = yes ; then
726         case "x${extra_objects}" in
727         *cgen.o*) ;;
728         *) extra_objects="$extra_objects cgen.o" ;;
729         esac
730     fi
731
732 # See if we really can support this configuration with the emulation code.
733
734     if test $this_target = $target ; then
735       primary_bfd_gas=$bfd_gas
736       obj_format=$fmt
737       te_file=$em
738
739       if test $bfd_gas = no ; then
740         # Can't support other configurations this way.
741         break
742       fi
743     elif test $bfd_gas = no ; then
744       # Can't support this configuration.
745       break
746     fi
747
748 # From target name and format, produce a list of supported emulations.
749
750     case ${generic_target}-${fmt} in
751       mips-*-irix5*-*)  emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
752       mips*-*-linux*-*) case "$endian" in
753                         big)    emulation="mipsbelf mipslelf mipself" ;;
754                         *)      emulation="mipslelf mipsbelf mipself" ;;
755                         esac ;;
756       mips-*-lnews*-ecoff) ;;
757       mips-*-*-ecoff)   case "$endian" in
758                         big)    emulation="mipsbecoff mipslecoff mipsecoff" ;;
759                         *)      emulation="mipslecoff mipsbecoff mipsecoff" ;;
760                         esac ;;
761       mips-*-*-elf)     case "$endian" in
762                         big)    emulation="mipsbelf mipslelf mipself" ;;
763                         *)      emulation="mipslelf mipsbelf mipself" ;;
764                         esac ;;
765       mips-*-sysv4*MP*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
766       # i386-pc-pe-coff != i386-pc-coff.
767       i386-*-pe-coff)   ;;
768       # Uncommenting the next line will turn on support for i386 AOUT
769       # for the default linux configuration
770       # i386-*-linux*-elf) emulation="i386elf i386aout" ;;
771       #
772       i386-*-aout)      emulation="i386aout" ;;
773       i386-*-coff)      emulation="i386coff" ;;
774       i386-*-elf)       emulation="i386elf" ;;
775
776       # Always all formats.  The first stated emulation becomes the default.
777       cris-*-*aout*)    emulation="crisaout criself" ;;
778       cris-*-*)         emulation="criself crisaout" ;;
779     esac
780
781     emulations="$emulations $emulation"
782
783 done
784
785 # Turn on all targets if possible
786 if test ${all_targets} = "yes"; then
787   case ${target_cpu_type} in
788   i386)
789     case ${obj_format} in
790     aout)
791       emulations="$emulations i386coff i386elf"
792       ;;
793     coff)
794       emulations="$emulations i386aout i386elf"
795     ;;
796     elf)
797       emulations="$emulations i386aout i386coff"
798       ;;
799     esac
800   ;;
801   esac
802 fi
803
804 # Assign floating point type.  Most processors with FP support
805 # IEEE FP.  On those that don't support FP at all, usually IEEE
806 # is emulated.
807 case ${target_cpu} in
808   vax | tahoe ) atof=${target_cpu} ;;
809   pdp11)        atof=vax ;;
810   *)            atof=ieee ;;
811 esac
812
813 case "${obj_format}" in
814   "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
815 esac
816
817 # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU).
818 cgen_cpu_prefix=""
819 if test $using_cgen = yes ; then
820   case ${target_cpu} in
821     *) cgen_cpu_prefix=${target_cpu} ;;
822   esac
823   AC_SUBST(cgen_cpu_prefix)
824   AC_DEFINE(USING_CGEN, 1, [Using cgen code?])
825 fi
826
827 dnl
828 dnl Make sure the desired support files exist.
829 dnl
830
831 if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
832   AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
833 fi
834
835 if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
836   AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
837 fi
838
839 case ${user_bfd_gas}-${primary_bfd_gas} in
840   yes-yes | no-no)
841     # We didn't override user's choice.
842     ;;
843   no-yes)
844     AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
845     ;;
846   no-preferred)
847     primary_bfd_gas=no
848     ;;
849   *-preferred)
850     primary_bfd_gas=yes
851     ;;
852   yes-*)
853     primary_bfd_gas=yes
854     ;;
855   -*)
856     # User specified nothing.
857     ;;
858 esac
859
860 # Some COFF configurations want these random other flags set.
861 case ${obj_format} in
862   coff)
863     case ${target_cpu_type} in
864       i386) AC_DEFINE(I386COFF, 1, [Using i386 COFF?]) ;;
865       m68k) AC_DEFINE(M68KCOFF, 1, [Using m68k COFF?]) ;;
866       m88k) AC_DEFINE(M88KCOFF, 1, [Using m88k COFF?]) ;;
867     esac
868     ;;
869 esac
870
871 # Getting this done right is going to be a bitch.  Each configuration specified
872 # with --enable-targets=... should be checked for environment, format, cpu, and
873 # bfd_gas setting.
874 #
875 # For each configuration, the necessary object file support code must be linked
876 # in.  This might be only one, it might be up to four.  The necessary emulation
877 # code needs to be provided, too.
878 #
879 # And then there's "--enable-targets=all"....
880 #
881 # For now, just always do it for MIPS ELF or ECOFF configurations.  Sigh.
882
883 formats="${obj_format}"
884 emfiles=""
885 EMULATIONS=""
886 GAS_UNIQ(emulations)
887 for em in . $emulations ; do
888   case $em in
889     .)  continue ;;
890     mipsbelf | mipslelf | mipself)
891         fmt=elf   file=mipself ;;
892     mipsbecoff | mipslecoff | mipsecoff)
893         fmt=ecoff file=mipsecoff ;;
894     *coff)
895         fmt=coff  file=$em ;;
896     *aout)
897         fmt=aout file=$em ;;
898     *elf)
899         fmt=elf file=$em ;;
900   esac
901   formats="$formats $fmt"
902   emfiles="$emfiles e-$file.o"
903   EMULATIONS="$EMULATIONS &$em,"
904 done
905 GAS_UNIQ(formats)
906 GAS_UNIQ(emfiles)
907 if test `set . $formats ; shift ; echo $#` -gt 1 ; then
908   for fmt in $formats ; do
909     case $fmt in
910       aout)     AC_DEFINE(OBJ_MAYBE_AOUT, 1,    [a.out support?])   ;;
911       bout)     AC_DEFINE(OBJ_MAYBE_BOUT, 1,    [b.out support?])   ;;
912       coff)     AC_DEFINE(OBJ_MAYBE_COFF, 1,    [COFF support?])    ;;
913       ecoff)    AC_DEFINE(OBJ_MAYBE_ECOFF, 1,   [ECOFF support?])   ;;
914       elf)      AC_DEFINE(OBJ_MAYBE_ELF, 1,     [ELF support?])     ;;
915       generic)  AC_DEFINE(OBJ_MAYBE_GENERIC, 1, [generic support?]) ;;
916       hp300)    AC_DEFINE(OBJ_MAYBE_HP300, 1,   [HP300 support?])   ;;
917       ieee)     AC_DEFINE(OBJ_MAYBE_IEEE, 1,    [IEEE support?])    ;;
918       som)      AC_DEFINE(OBJ_MAYBE_SOM, 1,     [SOM support?])     ;;
919       vms)      AC_DEFINE(OBJ_MAYBE_VMS, 1,     [VMS support?])     ;;
920     esac
921     extra_objects="$extra_objects obj-$fmt.o"
922   done
923   obj_format=multi
924 fi
925 if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
926   DEFAULT_EMULATION=`set . $emulations ; echo $2`
927   # e-mips* has more than one emulation per file, e-i386* has just one at the
928   # moment.  If only one emulation is specified, then don't define
929   # USE_EMULATIONS or include any of the e-files as they will only be bloat.
930   case "${obj_format}${emfiles}" in
931     multi* | *mips*)
932       extra_objects="$extra_objects $emfiles"
933       AC_DEFINE(USE_EMULATIONS, 1, [Use emulation support?]) ;;
934   esac
935 fi
936 AC_SUBST(extra_objects)
937 AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS, [Supported emulations.])
938 AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION",
939                    [Default emulation.])
940
941 case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
942   yes-*-coff)   need_bfd=yes ;;
943   no-*-coff)    need_bfd=yes
944                 AC_DEFINE(MANY_SEGMENTS, 1, [old COFF support?]) ;;
945 esac
946
947 reject_dev_configs=yes
948
949 case ${reject_dev_configs}-${dev} in
950   yes-yes) # Oops.
951     AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
952     ;;
953 esac
954
955 AC_SUBST(target_cpu_type)
956 AC_SUBST(obj_format)
957 AC_SUBST(te_file)
958 AC_SUBST(install_tooldir)
959 AC_SUBST(atof)
960 dnl AC_SUBST(emulation)
961
962 case "${primary_bfd_gas}" in
963   yes)  AC_DEFINE(BFD_ASSEMBLER, 1, [Use BFD interface?])
964         need_bfd=yes ;;
965 esac
966
967 # do we need the opcodes library?
968 case "${need_opcodes}" in
969 yes)
970   OPCODES_LIB=../opcodes/libopcodes.la
971   ;;
972 esac
973
974 case "${need_bfd}" in
975 yes)
976   BFDLIB=../bfd/libbfd.la
977   BFDVER_H=../bfd/bfdver.h
978   ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h'
979   ;;
980 esac
981
982 AC_SUBST(BFDLIB)
983 AC_SUBST(OPCODES_LIB)
984
985 AC_SUBST(BFDVER_H)
986 AC_SUBST(ALL_OBJ_DEPS)
987
988 AC_DEFINE_UNQUOTED(TARGET_ALIAS,        "${target_alias}", [Target alias.])
989 AC_DEFINE_UNQUOTED(TARGET_CANONICAL,    "${target}",       [Canonical target.])
990 AC_DEFINE_UNQUOTED(TARGET_CPU,          "${target_cpu}",   [Target CPU.])
991 AC_DEFINE_UNQUOTED(TARGET_VENDOR,       "${target_vendor}", [Target vendor.])
992 AC_DEFINE_UNQUOTED(TARGET_OS,           "${target_os}",    [Target OS.])
993
994 AC_PROG_CC
995
996 AC_PROG_YACC
997 AM_PROG_LEX
998
999 ALL_LINGUAS="fr tr es"
1000 CY_GNU_GETTEXT
1001
1002 AM_MAINTAINER_MODE
1003 AC_EXEEXT
1004
1005 AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
1006
1007 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
1008 # people who are not cross-compiling but are compiling cross-assemblers.
1009 AC_MSG_CHECKING(whether compiling a cross-assembler)
1010 if test "${host}" = "${target}"; then
1011   cross_gas=no
1012 else
1013   cross_gas=yes
1014   AC_DEFINE(CROSS_COMPILE, 1, [Compiling cross-assembler?])
1015 fi
1016 AC_MSG_RESULT($cross_gas)
1017
1018 dnl ansidecl.h will deal with const
1019 dnl AC_CONST
1020 AC_FUNC_ALLOCA
1021 AC_C_INLINE
1022
1023 # VMS doesn't have unlink.
1024 AC_CHECK_FUNCS(unlink remove, break)
1025
1026 # Some systems don't have sbrk().
1027 AC_CHECK_FUNCS(sbrk)
1028
1029 # do we need the math library?
1030 case "${need_libm}" in
1031 yes) 
1032   AC_CHECK_LIBM
1033   AC_SUBST(LIBM)
1034   ;;
1035 esac
1036
1037 # Some non-ANSI preprocessors botch requoting inside strings.  That's bad
1038 # enough, but on some of those systems, the assert macro relies on requoting
1039 # working properly!
1040 GAS_WORKING_ASSERT
1041
1042 # On some systems, the system header files may not declare malloc, realloc,
1043 # and free.  There are places where gas needs these functions to have been
1044 # declared -- such as when taking their addresses.
1045 gas_test_headers="
1046 #ifdef HAVE_MEMORY_H
1047 #include <memory.h>
1048 #endif
1049 #ifdef HAVE_STRING_H
1050 #include <string.h>
1051 #else
1052 #ifdef HAVE_STRINGS_H
1053 #include <strings.h>
1054 #endif
1055 #endif
1056 #ifdef HAVE_STDLIB_H
1057 #include <stdlib.h>
1058 #endif
1059 #ifdef HAVE_UNISTD_H
1060 #include <unistd.h>
1061 #endif
1062 "
1063 GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
1064 GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
1065 GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
1066 GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
1067 GAS_CHECK_DECL_NEEDED(environ, f, char **f, $gas_test_headers)
1068
1069 # Does errno.h declare errno, or do we have to add a separate declaration
1070 # for it?
1071 GAS_CHECK_DECL_NEEDED(errno, f, int f, [
1072 #ifdef HAVE_ERRNO_H
1073 #include <errno.h>
1074 #endif
1075 ])
1076
1077 dnl This must come last.
1078
1079 dnl We used to make symlinks to files in the source directory, but now
1080 dnl we just use the right name for .c files, and create .h files in
1081 dnl the build directory which include the right .h file.  Make sure
1082 dnl the old symlinks don't exist, so that a reconfigure in an existing
1083 dnl directory behaves reasonably.
1084
1085 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
1086 AC_CONFIG_COMMANDS([default],
1087 [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
1088  echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
1089  echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
1090  echo '#include "te-'"${te_file}"'.h"' > targ-env.h
1091  echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
1092  if test "x$cgen_cpu_prefix" != x ; then
1093    echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h
1094  fi
1095
1096  sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile],
1097 [target_cpu_type=${target_cpu_type}
1098  cgen_cpu_prefix=${cgen_cpu_prefix}
1099  obj_format=${obj_format}
1100  te_file=${te_file}])
1101
1102 AC_OUTPUT