Sun Oct 4 20:57:43 1998 Alan Modra <alan@spri.levels.unisa.edu.au>
[deliverable/binutils-gdb.git] / gas / configure.in
CommitLineData
b11fb939
KR
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
b11fb939 6dnl
e2b4bd2a
ILT
7dnl v2.5 needed for --bindir et al
8AC_PREREQ(2.5)
9AC_INIT(as.h)
10
11AC_CANONICAL_SYSTEM
12
921d7728 13AM_INIT_AUTOMAKE(gas, 2.9.4)
e2b4bd2a
ILT
14
15AM_PROG_LIBTOOL
16
318b02b6 17user_bfd_gas=
b11fb939 18AC_ARG_ENABLE(bfd-assembler,
d7b2038f 19[ --enable-bfd-assembler use BFD back end for writing object files],
b11fb939 20[case "${enableval}" in
318b02b6
KR
21 yes) need_bfd=yes user_bfd_gas=yes ;;
22 no) user_bfd_gas=no ;;
b11fb939
KR
23 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
24esac])dnl
e7757ad0
KR
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
2e013bb7
ILT
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
b11fb939 40
e2b4bd2a
ILT
41# Generate a header file
42AM_CONFIG_HEADER(config.h:config.in)
7cf4d7ff 43
e7757ad0 44te_file=generic
b678740d 45
603e9cf1
CM
46# Makefile target for installing gas in $(tooldir)/bin.
47install_tooldir=install-exec-tooldir
48
e7757ad0
KR
49canon_targets=""
50if test -n "$enable_targets" ; then
51 for t in `echo $enable_targets | sed 's/,/ /g'`; do
ec2f730d 52 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $t 2>/dev/null`
e7757ad0
KR
53 if test -n "$result" ; then
54 canon_targets="$canon_targets $result"
55# else
56# # Permit "all", etc. We don't support it yet though.
57# canon_targets="$canon_targets $t"
58 fi
59 done
60 GAS_UNIQ(canon_targets)
61fi
62
63emulations=""
64
65for this_target in $target $canon_targets ; do
66
64556643
FF
67changequote(,)dnl
68 eval `echo $this_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
69changequote([,])dnl
8cac6ca6 70
e7757ad0 71 # check for architecture variants
2b09622a 72 arch=
6ff87ead 73 endian=
e7757ad0 74 case ${cpu} in
0170f1c3 75 alpha*) cpu_type=alpha ;;
ae09d880
ILT
76 armeb) cpu_type=arm endian=big ;;
77 arm*) cpu_type=arm endian=little ;;
76fb6d2f 78 thumb*) cpu_type=arm endian=little ;;
e7757ad0
KR
79 hppa*) cpu_type=hppa ;;
80changequote(,)dnl
7c2fadd1 81 i[456]86) cpu_type=i386 ;;
e7757ad0 82 m680[012346]0) cpu_type=m68k ;;
921d7728 83changequote([,])dnl
e7757ad0
KR
84 m68008) cpu_type=m68k ;;
85 m683??) cpu_type=m68k ;;
921d7728 86 m5200) cpu_type=m68k ;;
e7757ad0 87 m8*) cpu_type=m88k ;;
e16b9537 88 mips*el) cpu_type=mips endian=little ;;
01c655cc 89# start-sanitize-r5900
9587640a 90 mips*5900*) cpu_type=mips endian=little ;;
01c655cc 91# end-sanitize-r5900
e7757ad0
KR
92 mips*) cpu_type=mips endian=big ;;
93 powerpcle*) cpu_type=ppc endian=little ;;
94 powerpc*) cpu_type=ppc endian=big ;;
95 rs6000*) cpu_type=ppc ;;
2b09622a
DE
96 sparclite*) cpu_type=sparc arch=sparclite ;;
97 sparclet*) cpu_type=sparc arch=sparclet ;;
70ee7782 98 sparc64*) cpu_type=sparc arch=v9-64 ;;
307edcc0 99 sparc86x*) cpu_type=sparc arch=sparc86x ;;
2b09622a 100 sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c.
756adc97 101 v850*) cpu_type=v850 ;;
a1c7c0f3 102 *) cpu_type=${cpu} ;;
e7757ad0
KR
103 esac
104
105 if test ${this_target} = $target ; then
106 target_cpu_type=${cpu_type}
6ff87ead
NC
107 if test x${endian} = xbig; then
108 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 1)
109 elif test x${endian} = xlittle; then
110 AC_DEFINE(TARGET_BYTES_BIG_ENDIAN, 0)
111 fi
e7757ad0
KR
112 elif test ${target_cpu_type} != ${cpu_type} ; then
113 continue
114 fi
115
e7757ad0
KR
116 generic_target=${cpu_type}-$vendor-$os
117 dev=no
118 bfd_gas=no
119 em=generic
7cf4d7ff 120
e7757ad0
KR
121 # assign object format
122 case ${generic_target} in
6ff87ead
NC
123 a29k-*-coff) fmt=coff ;;
124 a29k-amd-udi) fmt=coff ;;
125 a29k-amd-ebmon) fmt=coff ;;
126 a29k-nyu-sym1) fmt=coff ;;
e7757ad0
KR
127 a29k-*-vxworks*) fmt=coff ;;
128
0170f1c3
RH
129 alpha*-*-*vms*) fmt=evax ;;
130 alpha*-*-netware*) fmt=ecoff ;;
131 alpha*-*-openbsd*) fmt=ecoff ;;
132 alpha*-*-osf*) fmt=ecoff ;;
133 alpha*-*-linuxecoff*) fmt=ecoff ;;
22d3fbd6
NC
134 alpha*-*-linux-gnu*) fmt=elf em=linux ;;
135 alpha*-*-netbsd*) fmt=elf em=nbsd ;;
816153a3 136
e7757ad0 137 arc-*-elf*) fmt=elf bfd_gas=yes ;;
4181c985 138
6ff87ead
NC
139 arm-*-riscix*) fmt=aout em=riscix ;;
140 arm-*-aout) fmt=aout ;;
76fb6d2f 141 arm-*-coff | thumb-*-coff) fmt=coff ;;
603e9cf1 142 arm-*-elf | thumb-*-elf) fmt=elf ;;
e7757ad0 143 arm-*-riscix*) fmt=aout ;;
22d3fbd6 144 arm-*-pe | thumb-*-pe) fmt=coff em=pe ;;
e7757ad0 145
05a8bf33 146 d10v-*-*) fmt=elf bfd_gas=yes ;;
7d0f8249 147 d30v-*-*) fmt=elf bfd_gas=yes ;;
7be9a312 148
603e9cf1
CM
149# start-sanitize-sky
150 dvp-*-*) fmt=elf bfd_gas=yes install_tooldir= ;;
151# end-sanitize-sky
152
e7757ad0
KR
153 hppa-*-*elf*) fmt=elf em=hppa ;;
154 hppa-*-lites*) fmt=elf em=hppa ;;
155 hppa-*-osf*) fmt=som em=hppa ;;
332d5c49 156 hppa-*-rtems*) fmt=elf em=hppa ;;
e7757ad0
KR
157 hppa-*-hpux*) fmt=som em=hppa ;;
158 hppa-*-bsd*) fmt=som em=hppa ;;
159 hppa-*-hiux*) fmt=som em=hppa ;;
160
161 h8300-*-coff) fmt=coff ;;
162
6ff87ead 163 i386-ibm-aix*) fmt=coff em=i386aix ;;
7d0f8249 164 i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;;
cc88a106
ILT
165dnl start-sanitize-beos
166 i386-*-beospe*) fmt=coff em=pe bfd_gas=yes ;;
a1624e3f 167 i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;;
cc88a106 168dnl end-sanitize-beos
e7757ad0
KR
169 i386-*-bsd*) fmt=aout em=386bsd ;;
170 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
171 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
76fb6d2f 172 i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;;
a1c7c0f3 173 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
6ff87ead 174 i386-*-linux*coff*) fmt=coff em=linux ;;
a1624e3f 175 i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
6ff87ead 176 i386-*-lynxos*) fmt=coff em=lynx ;;
15ddb4c9 177 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
a1624e3f
RH
178 fmt=elf bfd_gas=yes ;;
179 i386-*-freebsdelf*) fmt=elf bfd_gas=yes ;;
15ddb4c9 180 i386-*-freebsd*) fmt=aout em=386bsd ;;
6cc7a938
ILT
181 i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*)
182 fmt=coff ;;
183 i386-*-sco3.2v5*) fmt=elf
6ff87ead
NC
184 if test ${this_target} = $target; then
185 AC_DEFINE(SCO_ELF)
186 fi
187 ;;
6cc7a938 188 i386-*-sco3.2*) fmt=coff ;;
e7757ad0 189 i386-*-vsta) fmt=aout ;;
60dc9fb2 190 i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*)
6ff87ead
NC
191 fmt=coff em=go32;;
192 i386-*-rtems*) fmt=coff ;;
6c186c48
SC
193 i386-*-gnu*) fmt=elf ;;
194 i386-*-mach*)
e7757ad0
KR
195 fmt=aout em=mach bfd_gas=yes ;;
196 i386-*-msdos*) fmt=aout ;;
6c186c48 197 i386-*-moss*) fmt=elf ;;
6ff87ead 198 i386-*-pe) fmt=coff em=pe ;;
0040c1e9
ILT
199 i386-*-cygwin32*) fmt=coff em=pe bfd_gas=yes ;;
200 i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;;
201 i386-*-*nt*) fmt=coff em=pe ;;
e7757ad0 202 i960-*-bout) fmt=bout ;;
6ff87ead
NC
203 i960-*-coff) fmt=coff em=ic960 ;;
204 i960-*-rtems*) fmt=coff em=ic960 ;;
e7757ad0
KR
205 i960-*-nindy*) fmt=bout ;;
206 i960-*-vxworks4*) fmt=bout ;;
207 i960-*-vxworks5.0) fmt=bout ;;
6ff87ead 208 i960-*-vxworks5.*) fmt=coff em=ic960 ;;
e7757ad0
KR
209 i960-*-vxworks*) fmt=bout ;;
210
374bdac7
DE
211 m32r-*-*) fmt=elf bfd_gas=yes ;;
212
e7757ad0
KR
213 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
214 fmt=aout em=sun3 ;;
6ff87ead
NC
215 m68k-motorola-sysv*) fmt=coff em=delta ;;
216 m68k-bull-sysv3*) fmt=coff em=dpx2 ;;
217 m68k-apollo-*) fmt=coff em=apollo ;;
fee3e248
ILT
218 m68k-*-sysv4*) # must be before -sysv*
219 fmt=elf em=svr4 ;;
220 m68k-*-elf*) fmt=elf ;;
1c94de4d 221 m68k-*-coff | m68k-*-sysv* | m68k-*-rtems*)
6ff87ead 222 fmt=coff ;;
e7757ad0 223 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
535cfd0f 224 m68k-*-linux*aout*) fmt=aout em=linux ;;
22d3fbd6 225 m68k-*-linux-gnu*) fmt=elf em=linux ;;
6ff87ead 226 m68k-*-lynxos*) fmt=coff em=lynx ;;
e7757ad0 227 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
76fb6d2f 228 m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
6ff87ead 229 m68k-apple-aux*) fmt=coff em=aux ;;
8a6f53e9 230 m68k-*-psos*) fmt=elf em=psos;;
e7757ad0 231
6ff87ead
NC
232 m88k-motorola-sysv3*) fmt=coff em=delt88 ;;
233 m88k-*-coff*) fmt=coff ;;
e7757ad0
KR
234
235 # don't change em like *-*-bsd does
6ff87ead
NC
236 mips-dec-netbsd*) fmt=elf endian=little ;;
237 mips-dec-openbsd*) fmt=elf endian=little ;;
238 mips-dec-bsd*) fmt=aout ;;
239 mips-sony-bsd*) fmt=ecoff ;;
e7757ad0 240 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
6ff87ead
NC
241 mips-*-ultrix*) fmt=ecoff endian=little ;;
242 mips-*-osf*) fmt=ecoff endian=little ;;
243 mips-*-ecoff*) fmt=ecoff ;;
244 mips-*-ecoff*) fmt=ecoff ;;
245 mips-*-irix6*) fmt=elf ;;
246 mips-*-irix5*) fmt=elf ;;
247 mips-*-irix*) fmt=ecoff ;;
248 mips-*-lnews*) fmt=ecoff em=lnews ;;
249 mips-*-riscos*) fmt=ecoff ;;
250 mips-*-sysv*) fmt=ecoff ;;
22d3fbd6 251 mips-*-elf* | mips-*-rtems* | mips-*-linux-gnu* | mips-*-gnu* | mips-*-openbsd*)
6ff87ead 252 fmt=elf ;;
ae1b99e4
JL
253 mn10200-*-*) fmt=elf bfd_gas=yes ;;
254 mn10300-*-*) fmt=elf bfd_gas=yes ;;
0ff513d9 255 ppc-*-pe | ppc-*-cygwin32 | ppc-*-winnt*)
6ff87ead 256 fmt=coff em=pe ;;
e7757ad0 257 ppc-*-aix*) fmt=coff ;;
515c7142 258 ppc-*-beos*) fmt=coff ;;
76fb6d2f 259 ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
6ff87ead 260 fmt=elf ;;
22d3fbd6 261 ppc-*-linux-gnu*) fmt=elf
159e6ef8 262 case "$endian" in
6ff87ead 263 big) ;;
22d3fbd6 264 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
159e6ef8
MM
265 esac
266 ;;
267 ppc-*-solaris*) fmt=elf
6ff87ead
NC
268 if test ${this_target} = $target; then
269 AC_DEFINE(TARGET_SOLARIS_COMMENT)
270 fi
271 if test x${endian} = xbig; then
272 AC_MSG_ERROR(Solaris must be configured little endian)
273 fi
1c94de4d 274 ;;
6ff87ead 275 ppc-*-rtems*) fmt=elf ;;
880b7429
KR
276 ppc-*-macos* | ppc-*-mpw*)
277 fmt=coff em=macos ;;
e7757ad0
KR
278 ppc-*-netware*) fmt=elf em=ppcnw ;;
279
fed13a5e
ILT
280 sh-*-elf*) fmt=elf ;;
281 sh-*-coff*) fmt=coff ;;
f3aa01e2 282 sh-*-rtems*) fmt=coff ;;
816153a3 283
5f757edc
ILT
284 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
285 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
76fb6d2f 286 ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;;
e7757ad0 287
1c94de4d 288 sparc-*-rtems*) fmt=aout ;;
e7757ad0 289 sparc-*-sunos4*) fmt=aout em=sun3 ;;
df586de2 290 sparc-*-aout | sparc*-*-vxworks*)
fed13a5e 291 fmt=aout em=sparcaout ;;
e7757ad0 292 sparc-*-coff) fmt=coff ;;
2e013bb7 293 sparc-*-linux*aout*) fmt=aout em=linux ;;
22d3fbd6 294 sparc-*-linux-gnu*) fmt=elf em=linux ;;
e7757ad0
KR
295 sparc-*-lynxos*) fmt=coff em=lynx ;;
296 sparc-fujitsu-none) fmt=aout ;;
0b27ea39 297 sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*)
e7757ad0 298 fmt=elf ;;
a1624e3f
RH
299 sparc-*-netbsd*) fmt=aout em=nbsd ;;
300 sparc-*-openbsd*) fmt=aout em=nbsd ;;
c6aa56bc 301
0e034c77
ILT
302 tic30-*-*aout*) fmt=aout bfd_gas=yes ;;
303 tic30-*-*coff*) fmt=coff bfd_gas=yes ;;
64556643 304# start-sanitize-tic80
6ff87ead 305 tic80-*-*) fmt=coff ;;
64556643 306# end-sanitize-tic80
103dd764 307
c6aa56bc 308 v850-*-*) fmt=elf bfd_gas=yes ;;
e7757ad0 309
6ff87ead
NC
310# start-sanitize-v850e
311 v850e-*-*) fmt=elf bfd_gas=yes ;;
60dc9fb2 312 v850ea-*-*) fmt=elf bfd_gas=yes ;;
5e4e4739 313# end-sanitize-v850e
e7757ad0
KR
314 vax-*-bsd* | vax-*-ultrix*)
315 fmt=aout ;;
316 vax-*-vms) fmt=vms ;;
317
318 z8k-*-coff | z8k-*-sim)
319 fmt=coff ;;
320
321 w65-*-*) fmt=coff ;;
322
323 *-*-aout | *-*-scout)
324 fmt=aout ;;
325 *-*-nindy*)
326 fmt=bout ;;
327 *-*-bsd*)
328 fmt=aout em=sun3 ;;
329 *-*-generic) fmt=generic ;;
330 *-*-xray | *-*-hms) fmt=coff ;;
331 *-*-sim) fmt=coff ;;
332 *-*-elf | *-*-sysv4* | *-*-solaris*)
6df07e7f 333 AC_MSG_WARN(GAS support for ${generic_target} is incomplete.)
e7757ad0
KR
334 fmt=elf dev=yes ;;
335 *-*-vxworks) fmt=aout ;;
336 *-*-netware) fmt=elf ;;
337 esac
338
339 case ${cpu_type}-${fmt} in
0170f1c3 340 alpha*-*) bfd_gas=yes ;;
e7757ad0
KR
341 arm-*) bfd_gas=yes ;;
342 # not yet
343 # i386-aout) bfd_gas=preferred ;;
344 mips-*) bfd_gas=yes ;;
345 ns32k-*) bfd_gas=yes ;;
346 ppc-*) bfd_gas=yes ;;
347 sparc-*) bfd_gas=yes ;;
348 *-elf) bfd_gas=yes ;;
349 *-ecoff) bfd_gas=yes ;;
350 *-som) bfd_gas=yes ;;
351 *) ;;
352 esac
353
5f757edc
ILT
354# Other random stuff.
355
ae09d880
ILT
356 # do we need the opcodes library?
357 case ${cpu_type} in
0e034c77 358 vax | i386 | tic30)
7c2fadd1
ILT
359 ;;
360 *)
361 need_opcodes=yes
f2e272e0
ILT
362
363 case "${enable_shared}" in
364 yes) shared_opcodes=true ;;
365 *opcodes*) shared_opcodes=true ;;
366 *) shared_opcodes=false ;;
367 esac
159e6ef8 368 if test "${shared_opcodes}" = "true"; then
7c2fadd1
ILT
369 # A shared libopcodes must be linked against libbfd.
370 need_bfd=yes
371 fi
372 ;;
ae09d880
ILT
373 esac
374
5f757edc 375 case ${cpu_type} in
374bdac7 376 m32r)
7c269afb 377 case "x${extra_objects}" in
374bdac7
DE
378 *cgen.o*) ;;
379 *) extra_objects="$extra_objects cgen.o"
374bdac7
DE
380 AC_DEFINE(USING_CGEN)
381 ;;
382 esac
383 ;;
384
1c9dbb83
ILT
385 m68k)
386 case ${extra_objects} in
387 *m68k-parse.o*) ;;
388 *) extra_objects="$extra_objects m68k-parse.o" ;;
389 esac
390 ;;
efec4a28
DP
391
392 mips)
515c7142 393 echo ${extra_objects} | grep -s "itbl-parse.o"
efec4a28 394 if test $? -ne 0 ; then
515c7142 395 extra_objects="$extra_objects itbl-parse.o"
efec4a28
DP
396 fi
397
515c7142 398 echo ${extra_objects} | grep -s "itbl-lex.o"
efec4a28 399 if test $? -ne 0 ; then
515c7142 400 extra_objects="$extra_objects itbl-lex.o"
efec4a28
DP
401 fi
402
515c7142 403 echo ${extra_objects} | grep -s "itbl-ops.o"
efec4a28 404 if test $? -ne 0 ; then
515c7142 405 extra_objects="$extra_objects itbl-ops.o"
efec4a28
DP
406 fi
407 ;;
408
2b09622a 409 sparc)
e01e18a8
DE
410 if test $this_target = $target ; then
411 AC_DEFINE_UNQUOTED(DEFAULT_ARCH, "${arch}")
412 fi
2b09622a
DE
413 ;;
414
efec4a28
DP
415 *)
416 ;;
5f757edc
ILT
417 esac
418
e7757ad0
KR
419# See if we really can support this configuration with the emulation code.
420
421 if test $this_target = $target ; then
422 primary_bfd_gas=$bfd_gas
423 obj_format=$fmt
e7757ad0
KR
424 te_file=$em
425
426 if test $bfd_gas = no ; then
427 # Can't support other configurations this way.
428 break
429 fi
430 elif test $bfd_gas = no ; then
431 # Can't support this configuration.
432 break
433 fi
434
435# From target name and format, produce a list of supported emulations.
436
437 case ${generic_target}-${fmt} in
1cb0d00d 438 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
22d3fbd6 439 mips-*-linux-gnu*-*) case "$endian" in
515c7142
ILT
440 big) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
441 *) emulation="mipslelf mipsbelf mipself mipslecoff mipsbecoff mipsecoff" ;;
442 esac ;;
443 mips-*-lnews*-ecoff) ;;
e7757ad0 444 mips-*-*-ecoff) case "$endian" in
1cb0d00d
KR
445 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
446 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
e7757ad0
KR
447 esac ;;
448 mips-*-*-elf) case "$endian" in
1cb0d00d
KR
449 big) emulation="mipsbelf mipslelf mipself" ;;
450 *) emulation="mipslelf mipsbelf mipself" ;;
515c7142
ILT
451 # Uncommenting the next line will turn on support for i386 COFF
452 # in any i386 ELF configuration. This probably doesn't work
453 # correctly.
454 # i386-*-*-elf) emulation="i386coff i386elf" ;;
e7757ad0
KR
455 esac ;;
456 esac
457
458 emulations="$emulations $emulation"
459
e7757ad0 460done
fecd2382 461
8cac6ca6
KR
462# Assign floating point type. Most processors with FP support
463# IEEE FP. On those that don't support FP at all, usually IEEE
464# is emulated.
b678740d 465case ${target_cpu} in
904b6037 466 vax | tahoe ) atof=${target_cpu} ;;
e7757ad0 467 *) atof=ieee ;;
fecd2382
RP
468esac
469
8cac6ca6 470case "${obj_format}" in
b11fb939 471 "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
8cac6ca6 472esac
7cf4d7ff 473
7c269afb
DE
474# Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU).
475cgen_cpu_prefix=""
476case "x${extra_objects}" in
477 *cgen.o*)
478 case ${target_cpu} in
479 *) cgen_cpu_prefix=${target_cpu} ;;
480 esac
481 ;;
482esac
483AC_SUBST(cgen_cpu_prefix)
484
b11fb939
KR
485dnl
486dnl Make sure the desired support files exist.
487dnl
488
bf4bd1fc
ILT
489if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
490 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
b11fb939
KR
491fi
492
fb589130 493if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
b11fb939 494 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
7cf4d7ff
KR
495fi
496
e7757ad0 497case ${user_bfd_gas}-${primary_bfd_gas} in
a8285504 498 yes-yes | no-no)
7cf4d7ff
KR
499 # We didn't override user's choice.
500 ;;
a8285504 501 no-yes)
b11fb939 502 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
7cf4d7ff 503 ;;
a8285504 504 no-preferred)
e7757ad0 505 primary_bfd_gas=no
a8285504
DZ
506 ;;
507 *-preferred)
e7757ad0 508 primary_bfd_gas=yes
a8285504 509 ;;
f2889110 510 yes-*)
e7757ad0 511 primary_bfd_gas=yes
f2889110 512 ;;
a8285504
DZ
513 -*)
514 # User specified nothing.
515 ;;
7cf4d7ff
KR
516esac
517
e7757ad0
KR
518# Some COFF configurations want these random other flags set.
519case ${obj_format} in
520 coff)
521 case ${target_cpu_type} in
522 i386) AC_DEFINE(I386COFF) ;;
523 m68k) AC_DEFINE(M68KCOFF) ;;
524 m88k) AC_DEFINE(M88KCOFF) ;;
525 esac
526 ;;
527esac
528
529# Getting this done right is going to be a bitch. Each configuration specified
530# with --enable-targets=... should be checked for environment, format, cpu, and
531# bfd_gas setting.
532#
533# For each configuration, the necessary object file support code must be linked
534# in. This might be only one, it might be up to four. The necessary emulation
535# code needs to be provided, too.
536#
537# And then there's "--enable-targets=all"....
538#
539# For now, just always do it for MIPS ELF or ECOFF configurations. Sigh.
540
541formats="${obj_format}"
542emfiles=""
543EMULATIONS=""
544GAS_UNIQ(emulations)
545for em in . $emulations ; do
546 case $em in
547 .) continue ;;
548 mipsbelf | mipslelf)
549 fmt=elf file=mipself ;;
550 mipsbecoff | mipslecoff)
551 fmt=ecoff file=mipsecoff ;;
515c7142
ILT
552 i386coff)
553 fmt=coff file=i386coff ;;
554 i386elf)
555 fmt=elf file=i386elf ;;
e7757ad0
KR
556 esac
557 formats="$formats $fmt"
558 emfiles="$emfiles e-$file.o"
559 EMULATIONS="$EMULATIONS &$em,"
560done
561GAS_UNIQ(formats)
562GAS_UNIQ(emfiles)
563if test `set . $formats ; shift ; echo $#` -gt 1 ; then
564 for fmt in $formats ; do
565 case $fmt in
566 aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;;
567 bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;;
568 coff) AC_DEFINE(OBJ_MAYBE_COFF) ;;
569 ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;;
570 elf) AC_DEFINE(OBJ_MAYBE_ELF) ;;
571 generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;;
572 hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;;
573 ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;;
574 som) AC_DEFINE(OBJ_MAYBE_SOM) ;;
575 vms) AC_DEFINE(OBJ_MAYBE_VMS) ;;
576 esac
577 extra_objects="$extra_objects obj-$fmt.o"
578 done
579 obj_format=multi
580fi
581if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
582 te_file=multi
583 extra_objects="$extra_objects $emfiles"
584 DEFAULT_EMULATION=`set . $emulations ; echo $2`
585 AC_DEFINE(USE_EMULATIONS)
586fi
587AC_SUBST(extra_objects)
588AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS)
589AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
590
bf4bd1fc 591case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
318b02b6
KR
592 yes-*-coff) need_bfd=yes ;;
593 no-*-coff) need_bfd=yes
594 AC_DEFINE(MANY_SEGMENTS) ;;
595esac
596
69ecc03f 597reject_dev_configs=yes
8cac6ca6
KR
598
599case ${reject_dev_configs}-${dev} in
600 yes-yes) # Oops.
b11fb939 601 AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
8cac6ca6
KR
602 ;;
603esac
604
bf4bd1fc 605AC_SUBST(target_cpu_type)
833c46e1 606AC_SUBST(obj_format)
515c7142 607AC_SUBST(te_file)
603e9cf1 608AC_SUBST(install_tooldir)
833c46e1 609AC_SUBST(atof)
e7757ad0 610dnl AC_SUBST(emulation)
833c46e1 611
e7757ad0 612case "${primary_bfd_gas}" in
b11fb939
KR
613 yes) AC_DEFINE(BFD_ASSEMBLER)
614 need_bfd=yes ;;
4f6f4aa8
KR
615esac
616
ae09d880
ILT
617# do we need the opcodes library?
618case "${need_opcodes}" in
1c94de4d 619yes)
e2b4bd2a 620 OPCODES_LIB=../opcodes/libopcodes.la
1c94de4d 621 ;;
ae09d880 622esac
ae09d880 623
b11fb939 624case "${need_bfd}" in
1c94de4d 625yes)
e2b4bd2a 626 BFDLIB=../bfd/libbfd.la
1c94de4d 627 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
1c94de4d 628 ;;
4f6f4aa8 629esac
2e013bb7 630
b11fb939 631AC_SUBST(BFDLIB)
2e013bb7
ILT
632AC_SUBST(OPCODES_LIB)
633
b11fb939 634AC_SUBST(ALL_OBJ_DEPS)
4f6f4aa8 635
b11fb939
KR
636AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
637AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
638AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
639AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
640AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
641
b11fb939 642AC_PROG_CC
b11fb939 643
e2b4bd2a 644AC_PROG_YACC
b2bb41f6 645AM_PROG_LEX
e2b4bd2a 646
48401fcf
TT
647ALL_LINGUAS=
648CY_GNU_GETTEXT
649
e2b4bd2a
ILT
650AM_MAINTAINER_MODE
651AM_CYGWIN32
652AM_EXEEXT
653
b11fb939
KR
654AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
655
bf111c9f
KR
656# Put this here so that autoconf's "cross-compiling" message doesn't confuse
657# people who are not cross-compiling but are compiling cross-assemblers.
658AC_MSG_CHECKING(whether compiling a cross-assembler)
659if test "${host}" = "${target}"; then
f2889110
KR
660 cross_gas=no
661else
bf111c9f
KR
662 cross_gas=yes
663 AC_DEFINE(CROSS_COMPILE)
bf111c9f
KR
664fi
665AC_MSG_RESULT($cross_gas)
666
b11fb939
KR
667dnl ansidecl.h will deal with const
668dnl AC_CONST
669AC_FUNC_ALLOCA
670AC_C_INLINE
671
f2889110
KR
672# VMS doesn't have unlink.
673AC_CHECK_FUNCS(unlink remove, break)
28d3e4a3 674
e63c594d
FF
675# Some systems don't have sbrk().
676AC_CHECK_FUNCS(sbrk)
677
b11fb939
KR
678# Some non-ANSI preprocessors botch requoting inside strings. That's bad
679# enough, but on some of those systems, the assert macro relies on requoting
680# working properly!
bf111c9f 681GAS_WORKING_ASSERT
b11fb939
KR
682
683# On some systems, the system header files may not declare malloc, realloc,
684# and free. There are places where gas needs these functions to have been
685# declared -- such as when taking their addresses.
bf111c9f 686gas_test_headers="
b11fb939
KR
687#ifdef HAVE_MEMORY_H
688#include <memory.h>
689#endif
690#ifdef HAVE_STRING_H
691#include <string.h>
5cece526
ILT
692#else
693#ifdef HAVE_STRINGS_H
694#include <strings.h>
695#endif
b11fb939
KR
696#endif
697#ifdef HAVE_STDLIB_H
698#include <stdlib.h>
699#endif
700#ifdef HAVE_UNISTD_H
701#include <unistd.h>
702#endif
bf111c9f 703"
5cece526 704GAS_CHECK_DECL_NEEDED(strstr, f, char *(*f)(), $gas_test_headers)
bf111c9f 705GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
5f757edc 706GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
5cece526 707GAS_CHECK_DECL_NEEDED(sbrk, f, char *(*f)(), $gas_test_headers)
b11fb939
KR
708
709# Does errno.h declare errno, or do we have to add a separate declaration
710# for it?
bf111c9f 711GAS_CHECK_DECL_NEEDED(errno, f, int f, [
b11fb939
KR
712#ifdef HAVE_ERRNO_H
713#include <errno.h>
714#endif
bf111c9f 715])
b11fb939 716
b11fb939 717dnl This must come last.
515c7142
ILT
718
719dnl We used to make symlinks to files in the source directory, but now
720dnl we just use the right name for .c files, and create .h files in
721dnl the build directory which include the right .h file. Make sure
722dnl the old symlinks don't exist, so that a reconfigure in an existing
723dnl directory behaves reasonably.
724
48401fcf 725AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in po/Makefile.in:po/Make-in,
515c7142
ILT
726[rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h
727 echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h
728 echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h
729 echo '#include "te-'"${te_file}"'.h"' > targ-env.h
39ffbb4d
DE
730 echo '#include "itbl-'"${target_cpu_type}"'.h"' > itbl-cpu.h
731 case ${target_cpu_type} in
732 m32r) echo '#include "opcodes/'"${target_cpu_type}"'-opc.h"' > cgen-opc.h ;;
48401fcf
TT
733 esac
734
735 sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile],
515c7142
ILT
736[target_cpu_type=${target_cpu_type}
737 obj_format=${obj_format}
738 te_file=${te_file}])
This page took 0.281018 seconds and 4 git commands to generate.