1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl And be careful when changing it! If you must add tests with square
4dnl brackets, be sure changequote invocations surround it.
5dnl
6dnl
7dnl v2.5 needed for --bindir et al
8AC_PREREQ(2.5)
9AC_INIT(as.h)
10
11AC_CANONICAL_SYSTEM
12
13AM_INIT_AUTOMAKE(gas, 2.9.1)
14
15AM_PROG_LIBTOOL
16
17user_bfd_gas=
18AC_ARG_ENABLE(bfd-assembler,
19[ --enable-bfd-assembler use BFD back end for writing object files],
20[case "${enableval}" in
21 yes) need_bfd=yes user_bfd_gas=yes ;;
22 no) user_bfd_gas=no ;;
23 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
24esac])dnl
25AC_ARG_ENABLE(targets,
26[ targets alternative target configurations besides the primary],
27[case "${enableval}" in
28 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
29 ;;
30 no) enable_targets= ;;
31 *) enable_targets=$enableval ;;
32esac])dnl
33AC_ARG_ENABLE(commonbfdlib,
34[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
35[case "${enableval}" in
36 yes) commonbfdlib=true ;;
37 no) commonbfdlib=false ;;
38 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
39esac])dnl
40
41# Generate a header file
42AM_CONFIG_HEADER(config.h:config.in)
43
44te_file=generic
45
46canon_targets=""
47if test -n "$enable_targets" ; then
48 for t in `echo $enable_targets | sed 's/,/ /g'`; do
49 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null`
50 if test -n "$result" ; then
51 canon_targets="$canon_targets $result"
--- 9 unchanged lines hidden (view full) ---
61
62for this_target in $target $canon_targets ; do
63
64changequote(,)dnl
65 eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
66changequote([,])dnl
67
68 # check for architecture variants
69 arch=
70 endian=
71 case ${cpu} in
72 alpha*) cpu_type=alpha ;;
73 armeb) cpu_type=arm endian=big ;;
74 arm*) cpu_type=arm endian=little ;;
75 thumb*) cpu_type=arm endian=little ;;
76 hppa*) cpu_type=hppa ;;
77changequote(,)dnl
78 i[456]86) cpu_type=i386 ;;
79 m680[012346]0) cpu_type=m68k ;;
80 m68008) cpu_type=m68k ;;
81 m683??) cpu_type=m68k ;;
82changequote([,])dnl
83 m8*) cpu_type=m88k ;;
84 mips*el) cpu_type=mips endian=little ;;
85 mips*) cpu_type=mips endian=big ;;
86 powerpcle*) cpu_type=ppc endian=little ;;
87 powerpc*) cpu_type=ppc endian=big ;;
88 rs6000*) cpu_type=ppc ;;
89 sparclite*) cpu_type=sparc arch=sparclite ;;
90 sparclet*) cpu_type=sparc arch=sparclet ;;
91 sparc64*) cpu_type=sparc arch=v9-64 ;;
92 sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c.
93 v850*) cpu_type=v850 ;;
94 *) cpu_type=${cpu} ;;
95 esac
96
97 if test ${this_target} = $target ; then
98 target_cpu_type=${cpu_type}
99 if test x${endian} = xbig; then
100 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 1)
101 elif test x${endian} = xlittle; then
102 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 0)
103 fi
104 elif test ${target_cpu_type} != ${cpu_type} ; then
105 continue
106 fi
107
108 generic_target=${cpu_type}-$vendor-$os
109 dev=no
110 bfd_gas=no
111 em=generic
112
113 # assign object format
114 case ${generic_target} in
115 a29k-*-coff) fmt=coff ;;
116 a29k-amd-udi) fmt=coff ;;
117 a29k-amd-ebmon) fmt=coff ;;
118 a29k-nyu-sym1) fmt=coff ;;
119 a29k-*-vxworks*) fmt=coff ;;
120
121 alpha*-*-*vms*) fmt=evax ;;
122 alpha*-*-netware*) fmt=ecoff ;;
123 alpha*-*-openbsd*) fmt=ecoff ;;
124 alpha*-*-osf*) fmt=ecoff ;;
125 alpha*-*-linuxecoff*) fmt=ecoff ;;
126 alpha*-*-linux-gnu*) fmt=elf em=linux ;;
127 alpha*-*-netbsd*) fmt=elf em=nbsd ;;
128
129 arc-*-elf*) fmt=elf bfd_gas=yes ;;
130
131 arm-*-riscix*) fmt=aout em=riscix ;;
132 arm-*-aout) fmt=aout ;;
133 arm-*-coff | thumb-*-coff) fmt=coff ;;
134 arm-*-riscix*) fmt=aout ;;
135 arm-*-pe | thumb-*-pe) fmt=coff em=pe ;;
136
137 d10v-*-*) fmt=elf bfd_gas=yes ;;
138
139 hppa-*-*elf*) fmt=elf em=hppa ;;
140 hppa-*-lites*) fmt=elf em=hppa ;;
141 hppa-*-osf*) fmt=som em=hppa ;;
142 hppa-*-rtems*) fmt=elf em=hppa ;;
143 hppa-*-hpux*) fmt=som em=hppa ;;
144 hppa-*-bsd*) fmt=som em=hppa ;;
145 hppa-*-hiux*) fmt=som em=hppa ;;
146
147 h8300-*-coff) fmt=coff ;;
148
149 i386-ibm-aix*) fmt=coff em=i386aix ;;
150 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
151 i386-*-bsd*) fmt=aout em=386bsd ;;
152 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
153 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
154 i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
155 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
156 i386-*-linux*coff*) fmt=coff em=linux ;;
157 i386-*-linux-gnu*) fmt=elf em=linux ;;
158 i386-*-lynxos*) fmt=coff em=lynx ;;
159 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
160 fmt=elf ;;
161 i386-*-freebsdelf*) fmt=elf em=freebsd;;
162 i386-*-freebsd*) fmt=aout em=freebsd bfd_gas=yes ;;
163 i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
164 fmt=coff ;;
165 i386-*-sco3.2v5*) fmt=elf
166 if test ${this_target} = $target; then
167 AC_DEFINE(SCO_ELF)
168 fi
169 ;;
170 i386-*-sco3.2*) fmt=coff ;;
171 i386-*-vsta) fmt=aout ;;
172 i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
173 fmt=coff em=go32;;
174 i386-*-rtems*) fmt=coff ;;
175 i386-*-gnu*) fmt=elf ;;
176 i386-*-mach*)
177 fmt=aout em=mach bfd_gas=yes ;;
178 i386-*-msdos*) fmt=aout ;;
179 i386-*-moss*) fmt=elf ;;
180 i386-*-pe) fmt=coff em=pe ;;
181 i386-*-cygwin32*) fmt=coff em=pe bfd_gas=yes ;;
182 i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;;
183 i386-*-*nt*) fmt=coff em=pe ;;
184 i960-*-bout) fmt=bout ;;
185 i960-*-coff) fmt=coff em=ic960 ;;
186 i960-*-rtems*) fmt=coff em=ic960 ;;
187 i960-*-nindy*) fmt=bout ;;
188 i960-*-vxworks4*) fmt=bout ;;
189 i960-*-vxworks5.0) fmt=bout ;;
190 i960-*-vxworks5.*) fmt=coff em=ic960 ;;
191 i960-*-vxworks*) fmt=bout ;;
192
193 m32r-*-*) fmt=elf bfd_gas=yes ;;
194
195 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
196 fmt=aout em=sun3 ;;
197 m68k-motorola-sysv*) fmt=coff em=delta ;;
198 m68k-bull-sysv3*) fmt=coff em=dpx2 ;;
199 m68k-apollo-*) fmt=coff em=apollo ;;
200 m68k-*-sysv4*) # must be before -sysv*
201 fmt=elf em=svr4 ;;
202 m68k-*-elf*) fmt=elf ;;
203 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
204 fmt=coff ;;
205 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
206 m68k-*-linux*aout*) fmt=aout em=linux ;;
207 m68k-*-linux-gnu*) fmt=elf em=linux ;;
208 m68k-*-lynxos*) fmt=coff em=lynx ;;
209 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
210 m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
211 m68k-apple-aux*) fmt=coff em=aux ;;
212 m68k-*-psos*) fmt=elf em=psos;;
213
214 m88k-motorola-sysv3*) fmt=coff em=delt88 ;;
215 m88k-*-coff*) fmt=coff ;;
216
217 # don't change em like *-*-bsd does
218 mips-dec-netbsd*) fmt=elf endian=little ;;
219 mips-dec-openbsd*) fmt=elf endian=little ;;
220 mips-dec-bsd*) fmt=aout ;;
221 mips-sony-bsd*) fmt=ecoff ;;
222 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
223 mips-*-ultrix*) fmt=ecoff endian=little ;;
224 mips-*-osf*) fmt=ecoff endian=little ;;
225 mips-*-ecoff*) fmt=ecoff ;;
226 mips-*-ecoff*) fmt=ecoff ;;
227 mips-*-irix6*) fmt=elf ;;
228 mips-*-irix5*) fmt=elf ;;
229 mips-*-irix*) fmt=ecoff ;;
230 mips-*-lnews*) fmt=ecoff em=lnews ;;
231 mips-*-riscos*) fmt=ecoff ;;
232 mips-*-sysv*) fmt=ecoff ;;
233 mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*)
234 fmt=elf ;;
235 mn10200-*-*) fmt=elf bfd_gas=yes ;;
236 mn10300-*-*) fmt=elf bfd_gas=yes ;;
237 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
238 fmt=coff em=pe ;;
239 ppc-*-aix*) fmt=coff ;;
240 ppc-*-beos*) fmt=coff ;;
241 ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
242 fmt=elf ;;
243 ppc-*-linux-gnu*) fmt=elf
244 case "$endian" in
245 big) ;;
246 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
247 esac
248 ;;
249 ppc-*-solaris*) fmt=elf
250 if test ${this_target} = $target; then
251 AC_DEFINE(TARGET_SOLARIS_COMMENT)
252 fi
253 if test x${endian} = xbig; then
254 AC_MSG_ERROR(Solaris must be configured little endian)
255 fi
256 ;;
257 ppc-*-rtems*) fmt=elf ;;
258 ppc-*-macos* | ppc-*-mpw*)
259 fmt=coff em=macos ;;
260 ppc-*-netware*) fmt=elf em=ppcnw ;;
261
262 sh-*-elf*) fmt=elf ;;
263 sh-*-coff*) fmt=coff ;;
264 sh-*-rtems*) fmt=coff ;;
265
266 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
267 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
268 ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;;
269
270 sparc-*-rtems*) fmt=aout ;;
271 sparc-*-sunos4*) fmt=aout em=sun3 ;;
272 sparc-*-aout | sparc*-*-vxworks*)
273 fmt=aout em=sparcaout ;;
274 sparc-*-coff) fmt=coff ;;
275 sparc-*-linux*aout*) fmt=aout em=linux ;;
276 sparc-*-linux-gnu*) fmt=elf em=linux ;;
277 sparc-*-lynxos*) fmt=coff em=lynx ;;
278 sparc-fujitsu-none) fmt=aout ;;
279 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
280 fmt=elf ;;
281 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
282 sparc-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
283
284 tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
285 tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
286
287
288 v850-*-*) fmt=elf bfd_gas=yes ;;
289
290 vax-*-bsd* | vax-*-ultrix*)
291 fmt=aout ;;
292 vax-*-vms) fmt=vms ;;
293
294 z8k-*-coff | z8k-*-sim)
295 fmt=coff ;;
296
297 w65-*-*) fmt=coff ;;
--- 10 unchanged lines hidden (view full) ---
308 *-*-elf | *-*-sysv4* | *-*-solaris*)
309 AC_MSG_WARN(GAS support for ${generic_target} is incomplete.)
310 fmt=elf dev=yes ;;
311 *-*-vxworks) fmt=aout ;;
312 *-*-netware) fmt=elf ;;
313 esac
314
315 case ${cpu_type}-${fmt} in
316 alpha*-*) bfd_gas=yes ;;
317 arm-*) bfd_gas=yes ;;
318 # not yet
319 # i386-aout) bfd_gas=preferred ;;
320 mips-*) bfd_gas=yes ;;
321 ns32k-*) bfd_gas=yes ;;
322 ppc-*) bfd_gas=yes ;;
323 sparc-*) bfd_gas=yes ;;
324 *-elf) bfd_gas=yes ;;
325 *-ecoff) bfd_gas=yes ;;
326 *-som) bfd_gas=yes ;;
327 *) ;;
328 esac
329
330# Other random stuff.
331
332 # do we need the opcodes library?
333 case ${cpu_type} in
334 vax | i386 | tic30)
335 ;;
336 *)
337 need_opcodes=yes
338
339 case "${enable_shared}" in
340 yes) shared_opcodes=true ;;
341 *opcodes*) shared_opcodes=true ;;
342 *) shared_opcodes=false ;;
343 esac
344 if test "${shared_opcodes}" = "true"; then
345 # A shared libopcodes must be linked against libbfd.
346 need_bfd=yes
347 fi
348 ;;
349 esac
350
351 case ${cpu_type} in
352 m32r)
353 case ${extra_objects} in
354 *cgen.o*) ;;
355 *) extra_objects="$extra_objects cgen.o"
356 AC_DEFINE(USING_CGEN)
357 ;;
358 esac
--- 18 unchanged lines hidden (view full) ---
377 fi
378
379 echo ${extra_objects} | grep -s "itbl-ops.o"
380 if test $? -ne 0 ; then
381 extra_objects="$extra_objects itbl-ops.o"
382 fi
383 ;;
384
385 sparc)
386 if test $this_target = $target ; then
387 AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}")
388 fi
389 ;;
390
391 *)
392 ;;
393 esac
394
395# See if we really can support this configuration with the emulation code.
396
397 if test $this_target = $target ; then
398 primary_bfd_gas=$bfd_gas
399 obj_format=$fmt
400 te_file=$em
401
402 if test $bfd_gas = no ; then
403 # Can't support other configurations this way.
404 break
405 fi
406 elif test $bfd_gas = no ; then
407 # Can't support this configuration.
408 break
409 fi
410
411# From target name and format, produce a list of supported emulations.
412
413 case ${generic_target}-${fmt} in
414 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
415 mips-*-linux-gnu*-*) case "$endian" in
416 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
417 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
418 esac ;;
419 mips-*-lnews*-ecoff) ;;
420 mips-*-*-ecoff) case "$endian" in
421 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
422 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
423 esac ;;
--- 30 unchanged lines hidden (view full) ---
454if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
455 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
456fi
457
458if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
459 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
460fi
461
462case ${user_bfd_gas}-${primary_bfd_gas} in
463 yes-yes | no-no)
464 # We didn't override user's choice.
465 ;;
466 no-yes)
467 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
468 ;;
469 no-preferred)
--- 106 unchanged lines hidden (view full) ---
576case "${primary_bfd_gas}" in
577 yes) AC_DEFINE(BFD_ASSEMBLER)
578 need_bfd=yes ;;
579esac
580
581# do we need the opcodes library?
582case "${need_opcodes}" in
583yes)
584 OPCODES_LIB=../opcodes/libopcodes.la
585 ;;
586esac
587
588case "${need_bfd}" in
589yes)
590 BFDLIB=../bfd/libbfd.la
591 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
592 ;;
593esac
594
595AC_SUBST(BFDLIB)
596AC_SUBST(OPCODES_LIB)
597
598AC_SUBST(ALL_OBJ_DEPS)
599
600AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
601AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
602AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
603AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
604AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
605
606AC_PROG_CC
607
608AC_PROG_YACC
609AC_PROG_LEX
610AC_DECL_YYTEXT
611
612AM_MAINTAINER_MODE
613AM_CYGWIN32
614AM_EXEEXT
615
616AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
617
618# Put this here so that autoconf's "cross-compiling" message doesn't confuse
619# people who are not cross-compiling but are compiling cross-assemblers.
620AC_MSG_CHECKING(whether compiling a cross-assembler)
621if test "${host}" = "${target}"; then
622 cross_gas=no
623else
--- 47 unchanged lines hidden (view full) ---
671# Does errno.h declare errno, or do we have to add a separate declaration
672# for it?
673GAS_CHECK_DECL_NEEDED(errno, f, int f, [
674#ifdef HAVE_ERRNO_H
675#include <errno.h>
676#endif
677])
678
679dnl This must come last.
680
681dnl We used to make symlinks to files in the source directory, but now
682dnl we just use the right name for .c files, and create .h files in
683dnl the build directory which include the right .h file. Make sure
684dnl the old symlinks don't exist, so that a reconfigure in an existing
685dnl directory behaves reasonably.
686
--- 12 unchanged lines hidden ---
2dnl
3dnl And be careful when changing it! If you must add tests with square
4dnl brackets, be sure changequote invocations surround it.
5dnl
6dnl
7dnl v2.5 needed for --bindir et al
8AC_PREREQ(2.5)
9AC_INIT(as.h)
10
11AC_CANONICAL_SYSTEM
12
13AM_INIT_AUTOMAKE(gas, 2.9.1)
14
15AM_PROG_LIBTOOL
16
17user_bfd_gas=
18AC_ARG_ENABLE(bfd-assembler,
19[ --enable-bfd-assembler use BFD back end for writing object files],
20[case "${enableval}" in
21 yes) need_bfd=yes user_bfd_gas=yes ;;
22 no) user_bfd_gas=no ;;
23 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
24esac])dnl
25AC_ARG_ENABLE(targets,
26[ targets alternative target configurations besides the primary],
27[case "${enableval}" in
28 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
29 ;;
30 no) enable_targets= ;;
31 *) enable_targets=$enableval ;;
32esac])dnl
33AC_ARG_ENABLE(commonbfdlib,
34[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
35[case "${enableval}" in
36 yes) commonbfdlib=true ;;
37 no) commonbfdlib=false ;;
38 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
39esac])dnl
40
41# Generate a header file
42AM_CONFIG_HEADER(config.h:config.in)
43
44te_file=generic
45
46canon_targets=""
47if test -n "$enable_targets" ; then
48 for t in `echo $enable_targets | sed 's/,/ /g'`; do
49 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null`
50 if test -n "$result" ; then
51 canon_targets="$canon_targets $result"
--- 9 unchanged lines hidden (view full) ---
61
62for this_target in $target $canon_targets ; do
63
64changequote(,)dnl
65 eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
66changequote([,])dnl
67
68 # check for architecture variants
69 arch=
70 endian=
71 case ${cpu} in
72 alpha*) cpu_type=alpha ;;
73 armeb) cpu_type=arm endian=big ;;
74 arm*) cpu_type=arm endian=little ;;
75 thumb*) cpu_type=arm endian=little ;;
76 hppa*) cpu_type=hppa ;;
77changequote(,)dnl
78 i[456]86) cpu_type=i386 ;;
79 m680[012346]0) cpu_type=m68k ;;
80 m68008) cpu_type=m68k ;;
81 m683??) cpu_type=m68k ;;
82changequote([,])dnl
83 m8*) cpu_type=m88k ;;
84 mips*el) cpu_type=mips endian=little ;;
85 mips*) cpu_type=mips endian=big ;;
86 powerpcle*) cpu_type=ppc endian=little ;;
87 powerpc*) cpu_type=ppc endian=big ;;
88 rs6000*) cpu_type=ppc ;;
89 sparclite*) cpu_type=sparc arch=sparclite ;;
90 sparclet*) cpu_type=sparc arch=sparclet ;;
91 sparc64*) cpu_type=sparc arch=v9-64 ;;
92 sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c.
93 v850*) cpu_type=v850 ;;
94 *) cpu_type=${cpu} ;;
95 esac
96
97 if test ${this_target} = $target ; then
98 target_cpu_type=${cpu_type}
99 if test x${endian} = xbig; then
100 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 1)
101 elif test x${endian} = xlittle; then
102 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 0)
103 fi
104 elif test ${target_cpu_type} != ${cpu_type} ; then
105 continue
106 fi
107
108 generic_target=${cpu_type}-$vendor-$os
109 dev=no
110 bfd_gas=no
111 em=generic
112
113 # assign object format
114 case ${generic_target} in
115 a29k-*-coff) fmt=coff ;;
116 a29k-amd-udi) fmt=coff ;;
117 a29k-amd-ebmon) fmt=coff ;;
118 a29k-nyu-sym1) fmt=coff ;;
119 a29k-*-vxworks*) fmt=coff ;;
120
121 alpha*-*-*vms*) fmt=evax ;;
122 alpha*-*-netware*) fmt=ecoff ;;
123 alpha*-*-openbsd*) fmt=ecoff ;;
124 alpha*-*-osf*) fmt=ecoff ;;
125 alpha*-*-linuxecoff*) fmt=ecoff ;;
126 alpha*-*-linux-gnu*) fmt=elf em=linux ;;
127 alpha*-*-netbsd*) fmt=elf em=nbsd ;;
128
129 arc-*-elf*) fmt=elf bfd_gas=yes ;;
130
131 arm-*-riscix*) fmt=aout em=riscix ;;
132 arm-*-aout) fmt=aout ;;
133 arm-*-coff | thumb-*-coff) fmt=coff ;;
134 arm-*-riscix*) fmt=aout ;;
135 arm-*-pe | thumb-*-pe) fmt=coff em=pe ;;
136
137 d10v-*-*) fmt=elf bfd_gas=yes ;;
138
139 hppa-*-*elf*) fmt=elf em=hppa ;;
140 hppa-*-lites*) fmt=elf em=hppa ;;
141 hppa-*-osf*) fmt=som em=hppa ;;
142 hppa-*-rtems*) fmt=elf em=hppa ;;
143 hppa-*-hpux*) fmt=som em=hppa ;;
144 hppa-*-bsd*) fmt=som em=hppa ;;
145 hppa-*-hiux*) fmt=som em=hppa ;;
146
147 h8300-*-coff) fmt=coff ;;
148
149 i386-ibm-aix*) fmt=coff em=i386aix ;;
150 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
151 i386-*-bsd*) fmt=aout em=386bsd ;;
152 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
153 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
154 i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
155 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
156 i386-*-linux*coff*) fmt=coff em=linux ;;
157 i386-*-linux-gnu*) fmt=elf em=linux ;;
158 i386-*-lynxos*) fmt=coff em=lynx ;;
159 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
160 fmt=elf ;;
161 i386-*-freebsdelf*) fmt=elf em=freebsd;;
162 i386-*-freebsd*) fmt=aout em=freebsd bfd_gas=yes ;;
163 i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
164 fmt=coff ;;
165 i386-*-sco3.2v5*) fmt=elf
166 if test ${this_target} = $target; then
167 AC_DEFINE(SCO_ELF)
168 fi
169 ;;
170 i386-*-sco3.2*) fmt=coff ;;
171 i386-*-vsta) fmt=aout ;;
172 i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
173 fmt=coff em=go32;;
174 i386-*-rtems*) fmt=coff ;;
175 i386-*-gnu*) fmt=elf ;;
176 i386-*-mach*)
177 fmt=aout em=mach bfd_gas=yes ;;
178 i386-*-msdos*) fmt=aout ;;
179 i386-*-moss*) fmt=elf ;;
180 i386-*-pe) fmt=coff em=pe ;;
181 i386-*-cygwin32*) fmt=coff em=pe bfd_gas=yes ;;
182 i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;;
183 i386-*-*nt*) fmt=coff em=pe ;;
184 i960-*-bout) fmt=bout ;;
185 i960-*-coff) fmt=coff em=ic960 ;;
186 i960-*-rtems*) fmt=coff em=ic960 ;;
187 i960-*-nindy*) fmt=bout ;;
188 i960-*-vxworks4*) fmt=bout ;;
189 i960-*-vxworks5.0) fmt=bout ;;
190 i960-*-vxworks5.*) fmt=coff em=ic960 ;;
191 i960-*-vxworks*) fmt=bout ;;
192
193 m32r-*-*) fmt=elf bfd_gas=yes ;;
194
195 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
196 fmt=aout em=sun3 ;;
197 m68k-motorola-sysv*) fmt=coff em=delta ;;
198 m68k-bull-sysv3*) fmt=coff em=dpx2 ;;
199 m68k-apollo-*) fmt=coff em=apollo ;;
200 m68k-*-sysv4*) # must be before -sysv*
201 fmt=elf em=svr4 ;;
202 m68k-*-elf*) fmt=elf ;;
203 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
204 fmt=coff ;;
205 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
206 m68k-*-linux*aout*) fmt=aout em=linux ;;
207 m68k-*-linux-gnu*) fmt=elf em=linux ;;
208 m68k-*-lynxos*) fmt=coff em=lynx ;;
209 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
210 m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
211 m68k-apple-aux*) fmt=coff em=aux ;;
212 m68k-*-psos*) fmt=elf em=psos;;
213
214 m88k-motorola-sysv3*) fmt=coff em=delt88 ;;
215 m88k-*-coff*) fmt=coff ;;
216
217 # don't change em like *-*-bsd does
218 mips-dec-netbsd*) fmt=elf endian=little ;;
219 mips-dec-openbsd*) fmt=elf endian=little ;;
220 mips-dec-bsd*) fmt=aout ;;
221 mips-sony-bsd*) fmt=ecoff ;;
222 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
223 mips-*-ultrix*) fmt=ecoff endian=little ;;
224 mips-*-osf*) fmt=ecoff endian=little ;;
225 mips-*-ecoff*) fmt=ecoff ;;
226 mips-*-ecoff*) fmt=ecoff ;;
227 mips-*-irix6*) fmt=elf ;;
228 mips-*-irix5*) fmt=elf ;;
229 mips-*-irix*) fmt=ecoff ;;
230 mips-*-lnews*) fmt=ecoff em=lnews ;;
231 mips-*-riscos*) fmt=ecoff ;;
232 mips-*-sysv*) fmt=ecoff ;;
233 mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*)
234 fmt=elf ;;
235 mn10200-*-*) fmt=elf bfd_gas=yes ;;
236 mn10300-*-*) fmt=elf bfd_gas=yes ;;
237 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
238 fmt=coff em=pe ;;
239 ppc-*-aix*) fmt=coff ;;
240 ppc-*-beos*) fmt=coff ;;
241 ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
242 fmt=elf ;;
243 ppc-*-linux-gnu*) fmt=elf
244 case "$endian" in
245 big) ;;
246 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
247 esac
248 ;;
249 ppc-*-solaris*) fmt=elf
250 if test ${this_target} = $target; then
251 AC_DEFINE(TARGET_SOLARIS_COMMENT)
252 fi
253 if test x${endian} = xbig; then
254 AC_MSG_ERROR(Solaris must be configured little endian)
255 fi
256 ;;
257 ppc-*-rtems*) fmt=elf ;;
258 ppc-*-macos* | ppc-*-mpw*)
259 fmt=coff em=macos ;;
260 ppc-*-netware*) fmt=elf em=ppcnw ;;
261
262 sh-*-elf*) fmt=elf ;;
263 sh-*-coff*) fmt=coff ;;
264 sh-*-rtems*) fmt=coff ;;
265
266 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
267 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
268 ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;;
269
270 sparc-*-rtems*) fmt=aout ;;
271 sparc-*-sunos4*) fmt=aout em=sun3 ;;
272 sparc-*-aout | sparc*-*-vxworks*)
273 fmt=aout em=sparcaout ;;
274 sparc-*-coff) fmt=coff ;;
275 sparc-*-linux*aout*) fmt=aout em=linux ;;
276 sparc-*-linux-gnu*) fmt=elf em=linux ;;
277 sparc-*-lynxos*) fmt=coff em=lynx ;;
278 sparc-fujitsu-none) fmt=aout ;;
279 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
280 fmt=elf ;;
281 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
282 sparc-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
283
284 tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
285 tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
286
287
288 v850-*-*) fmt=elf bfd_gas=yes ;;
289
290 vax-*-bsd* | vax-*-ultrix*)
291 fmt=aout ;;
292 vax-*-vms) fmt=vms ;;
293
294 z8k-*-coff | z8k-*-sim)
295 fmt=coff ;;
296
297 w65-*-*) fmt=coff ;;
--- 10 unchanged lines hidden (view full) ---
308 *-*-elf | *-*-sysv4* | *-*-solaris*)
309 AC_MSG_WARN(GAS support for ${generic_target} is incomplete.)
310 fmt=elf dev=yes ;;
311 *-*-vxworks) fmt=aout ;;
312 *-*-netware) fmt=elf ;;
313 esac
314
315 case ${cpu_type}-${fmt} in
316 alpha*-*) bfd_gas=yes ;;
317 arm-*) bfd_gas=yes ;;
318 # not yet
319 # i386-aout) bfd_gas=preferred ;;
320 mips-*) bfd_gas=yes ;;
321 ns32k-*) bfd_gas=yes ;;
322 ppc-*) bfd_gas=yes ;;
323 sparc-*) bfd_gas=yes ;;
324 *-elf) bfd_gas=yes ;;
325 *-ecoff) bfd_gas=yes ;;
326 *-som) bfd_gas=yes ;;
327 *) ;;
328 esac
329
330# Other random stuff.
331
332 # do we need the opcodes library?
333 case ${cpu_type} in
334 vax | i386 | tic30)
335 ;;
336 *)
337 need_opcodes=yes
338
339 case "${enable_shared}" in
340 yes) shared_opcodes=true ;;
341 *opcodes*) shared_opcodes=true ;;
342 *) shared_opcodes=false ;;
343 esac
344 if test "${shared_opcodes}" = "true"; then
345 # A shared libopcodes must be linked against libbfd.
346 need_bfd=yes
347 fi
348 ;;
349 esac
350
351 case ${cpu_type} in
352 m32r)
353 case ${extra_objects} in
354 *cgen.o*) ;;
355 *) extra_objects="$extra_objects cgen.o"
356 AC_DEFINE(USING_CGEN)
357 ;;
358 esac
--- 18 unchanged lines hidden (view full) ---
377 fi
378
379 echo ${extra_objects} | grep -s "itbl-ops.o"
380 if test $? -ne 0 ; then
381 extra_objects="$extra_objects itbl-ops.o"
382 fi
383 ;;
384
385 sparc)
386 if test $this_target = $target ; then
387 AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}")
388 fi
389 ;;
390
391 *)
392 ;;
393 esac
394
395# See if we really can support this configuration with the emulation code.
396
397 if test $this_target = $target ; then
398 primary_bfd_gas=$bfd_gas
399 obj_format=$fmt
400 te_file=$em
401
402 if test $bfd_gas = no ; then
403 # Can't support other configurations this way.
404 break
405 fi
406 elif test $bfd_gas = no ; then
407 # Can't support this configuration.
408 break
409 fi
410
411# From target name and format, produce a list of supported emulations.
412
413 case ${generic_target}-${fmt} in
414 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
415 mips-*-linux-gnu*-*) case "$endian" in
416 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
417 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
418 esac ;;
419 mips-*-lnews*-ecoff) ;;
420 mips-*-*-ecoff) case "$endian" in
421 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
422 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
423 esac ;;
--- 30 unchanged lines hidden (view full) ---
454if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
455 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
456fi
457
458if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
459 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
460fi
461
462case ${user_bfd_gas}-${primary_bfd_gas} in
463 yes-yes | no-no)
464 # We didn't override user's choice.
465 ;;
466 no-yes)
467 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
468 ;;
469 no-preferred)
--- 106 unchanged lines hidden (view full) ---
576case "${primary_bfd_gas}" in
577 yes) AC_DEFINE(BFD_ASSEMBLER)
578 need_bfd=yes ;;
579esac
580
581# do we need the opcodes library?
582case "${need_opcodes}" in
583yes)
584 OPCODES_LIB=../opcodes/libopcodes.la
585 ;;
586esac
587
588case "${need_bfd}" in
589yes)
590 BFDLIB=../bfd/libbfd.la
591 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
592 ;;
593esac
594
595AC_SUBST(BFDLIB)
596AC_SUBST(OPCODES_LIB)
597
598AC_SUBST(ALL_OBJ_DEPS)
599
600AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
601AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
602AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
603AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
604AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
605
606AC_PROG_CC
607
608AC_PROG_YACC
609AC_PROG_LEX
610AC_DECL_YYTEXT
611
612AM_MAINTAINER_MODE
613AM_CYGWIN32
614AM_EXEEXT
615
616AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
617
618# Put this here so that autoconf's "cross-compiling" message doesn't confuse
619# people who are not cross-compiling but are compiling cross-assemblers.
620AC_MSG_CHECKING(whether compiling a cross-assembler)
621if test "${host}" = "${target}"; then
622 cross_gas=no
623else
--- 47 unchanged lines hidden (view full) ---
671# Does errno.h declare errno, or do we have to add a separate declaration
672# for it?
673GAS_CHECK_DECL_NEEDED(errno, f, int f, [
674#ifdef HAVE_ERRNO_H
675#include <errno.h>
676#endif
677])
678
679dnl This must come last.
680
681dnl We used to make symlinks to files in the source directory, but now
682dnl we just use the right name for .c files, and create .h files in
683dnl the build directory which include the right .h file. Make sure
684dnl the old symlinks don't exist, so that a reconfigure in an existing
685dnl directory behaves reasonably.
686
--- 12 unchanged lines hidden ---