Add little endian PowerPC support.
[deliverable/binutils-gdb.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 AC_PREREQ(2.3)dnl We only need 2.0, but pre-2.3 loses on some AIX version.
8 AC_INIT(as.h)dnl
9 dnl
10 bfd_gas=no
11 user_bfd_gas=
12 AC_ARG_ENABLE(bfd-assembler,
13 [ bfd-assembler use BFD back end for writing object files],
14 [case "${enableval}" in
15 yes) need_bfd=yes user_bfd_gas=yes ;;
16 no) user_bfd_gas=no ;;
17 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
18 esac])dnl
19
20 # Generate a header file -- gets more post-processing by Makefile later.
21 AC_CONFIG_HEADER(conf)
22
23 dnl For recursion to work right, this must be an absolute pathname.
24 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
25 AC_CANONICAL_SYSTEM
26 AC_ARG_PROGRAM
27
28 emulation=generic
29
30 # assign cpu type
31
32 # check for architecture variants
33 case ${target_cpu} in
34 hppa*) cpu_type=hppa ;;
35 changequote(,)dnl
36 i[45]86) cpu_type=i386 ;;
37 m680[012346]0) cpu_type=m68k ;;
38 m68008) cpu_type=m68k ;;
39 m683??) cpu_type=m68k ;;
40 changequote([,])dnl
41 m8*) cpu_type=m88k ;;
42 mips*el) cpu_type=mips endian=little;;
43 mips*) cpu_type=mips endian=big ;;
44 powerpcle*) cpu_type=ppc endian=little;;
45 powerpc*) cpu_type=ppc endian=big;;
46 rs6000*) cpu_type=ppc ;;
47 sparc64) cpu_type=sparc obj_format=elf
48 AC_DEFINE(sparcv9) ;;
49 sparclite*) cpu_type=sparc ;;
50 *) cpu_type=${target_cpu} ;;
51 esac
52
53 # do we need the opcodes library?
54 case ${cpu_type} in
55 alpha | vax)
56 ;;
57 *)
58 OPCODES_LIB="../opcodes/libopcodes.a"
59 ;;
60 esac
61 AC_SUBST(OPCODES_LIB)
62
63 gas_target=${cpu_type}
64 generic_target=${cpu_type}-${target_vendor}-${target_os}
65 dev=no
66
67 # assign object format
68 case ${generic_target} in
69 a29k-amd-udi) obj_format=coff gas_target=ebmon29k ;;
70 a29k-amd-ebmon) obj_format=coff gas_target=ebmon29k ;;
71 a29k-*-vxworks*) obj_format=coff ;;
72
73 alpha-*-netware*) obj_format=ecoff ;;
74 alpha-*-osf*) obj_format=ecoff ;;
75
76 # start-sanitize-arc
77 arc-*-elf*) obj_format=elf bfd_gas=yes ;;
78 # end-sanitize-arc
79
80 arm-*-riscix*) obj_format=aout ;;
81
82 hppa-*-*elf*) obj_format=elf emulation=hppa ;;
83 hppa-*-lites*) obj_format=elf emulation=hppa ;;
84 hppa-*-osf*) obj_format=som emulation=hppa ;;
85 hppa-*-hpux*) obj_format=som emulation=hppa ;;
86 hppa-*-bsd*) obj_format=som emulation=hppa ;;
87 hppa-*-hiux*) obj_format=som emulation=hppa ;;
88
89 h8300-*-coff) obj_format=coff ;;
90
91 i386-ibm-aix*) obj_format=coff gas_target=i386coff
92 emulation=i386aix ;;
93 i386-*-bsd*) obj_format=aout emulation=386bsd ;;
94 i386-*-netbsd0.8) obj_format=aout emulation=386bsd ;;
95 i386-*-netbsd*) obj_format=aout emulation=nbsd bfd_gas=yes;;
96 i386-*-linux*aout*) obj_format=aout emulation=linux ;;
97 i386-*-linux*coff*) obj_format=coff emulation=linux
98 gas_target=i386coff ;;
99 i386-*-linux*) obj_format=elf emulation=linux ;;
100 i386-*-lynxos*) obj_format=coff gas_target=i386coff
101 emulation=lynx ;;
102 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
103 obj_format=elf ;;
104 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
105 obj_format=coff gas_target=i386coff ;;
106 i386-*-vsta) obj_format=aout ;;
107 i386-*-go32) obj_format=coff gas_target=i386coff ;;
108 i386-*-gnu*elf*) obj_format=elf ;;
109 i386-*-mach* | i386-*-gnu*)
110 obj_format=aout emulation=mach bfd_gas=yes ;;
111 i386-*-msdos*) obj_format=aout ;;
112
113 i960-*-bout) obj_format=bout ;;
114 i960-*-coff) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
115 i960-*-nindy*) obj_format=bout ;;
116 i960-*-vxworks4*) obj_format=bout ;;
117 i960-*-vxworks5.0) obj_format=bout ;;
118 i960-*-vxworks5.*) obj_format=coff emulation=ic960 gas_target=ic960coff ;;
119 i960-*-vxworks*) obj_format=bout ;;
120
121 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
122 obj_format=aout emulation=sun3 ;;
123 m68k-motorola-sysv) obj_format=coff gas_target=m68kcoff emulation=delta ;;
124 m68k-bull-sysv3*) obj_format=coff gas_target=m68kcoff emulation=dpx2 ;;
125 m68k-apollo-*) obj_format=coff gas_target=apollo emulation=apollo ;;
126 m68k-*-coff | m68k-*-sysv*)
127 obj_format=coff gas_target=m68kcoff ;;
128 m68k-*-elf) obj_format=elf ;;
129 m68k-*-hpux*) obj_format=hp300 emulation=hp300 ;;
130 m68k-*-lynxos*) obj_format=coff gas_target=m68kcoff
131 emulation=lynx ;;
132 m68k-*-netbsd*) obj_format=aout emulation=nbsd bfd_gas=yes ;;
133
134 m88k-*-coff*) obj_format=coff gas_target=m88kcoff ;;
135
136 # don't change emulation like *-*-bsd does
137 mips-dec-bsd*) obj_format=aout gas_target=mips-lit ;;
138 mips-sony-bsd*) obj_format=ecoff gas_target=mips-big ;;
139 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
140 mips-*-ultrix*) obj_format=ecoff gas_target=mips-lit ;;
141 mips-*-ecoff*) obj_format=ecoff
142 case "$endian" in
143 big) gas_target=mips-big ;;
144 *) gas_target=mips-lit ;;
145 esac
146 ;;
147 mips-*-ecoff*) obj_format=ecoff gas_target=mips-big ;;
148 mips-*-gnu*) obj_format=aout
149 case "$endian" in
150 big) gas_target=mips-big ;;
151 *) gas_target=mips-lit ;;
152 esac
153 ;;
154 mips-*-irix5*) obj_format=elf gas_target=mips-big ;;
155 mips-*-irix*) obj_format=ecoff gas_target=mips-big ;;
156 mips-*-riscos*) obj_format=ecoff gas_target=mips-big ;;
157 mips-*-sysv*) obj_format=ecoff gas_target=mips-big ;;
158 mips-*-elf*) obj_format=elf
159 case "$endian" in
160 big) gas_target=mips-big ;;
161 *) gas_target=mips-lit ;;
162 esac
163 ;;
164 ppc-*-aix*) obj_format=coff ;;
165 ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
166 obj_format=elf
167 case "$endian" in
168 big) gas_target=ppc-big ;;
169 *) gas_target=ppc-lit ;;
170 esac
171 ;;
172 ppc-*-netware*) obj_format=elf emulation=ppcnw ;;
173
174 sh-*-coff) obj_format=coff ;;
175
176 # start-sanitize-rce
177 rce-*-aout) obj_format=aout ;;
178 # end-sanitize-rce
179
180 ns32k-pc532-mach*) obj_format=aout emulation=pc532mach ;;
181 ns32k-pc532-netbsd*) obj_format=aout emulation=nbsd532 ;;
182
183 sparc-*-sunos4*) obj_format=aout emulation=sun3 ;;
184 sparc-*-aout | sparc*-*-vxworks)
185 obj_format=aout ;;
186 sparc-*-coff) obj_format=coff ;;
187 sparc-*-lynxos*) obj_format=coff emulation=lynx ;;
188 sparc-fujitsu-none) obj_format=aout ;;
189 sparc-*-elf | sparc*-*-solaris*)
190 obj_format=elf ;;
191 sparc-*-netbsd*) obj_format=aout emulation=nbsd bfd_gas=yes ;;
192
193 vax-*-bsd* | vax-*-ultrix*)
194 obj_format=aout ;;
195 vax-*-vms) obj_format=vms ;;
196
197 z8k-*-coff | z8k-*-sim)
198 obj_format=coff ;;
199
200 w65-*-*) obj_format=coff ;;
201
202 *-*-aout | *-*-scout)
203 obj_format=aout ;;
204 *-*-nindy*)
205 obj_format=bout ;;
206 *-*-bsd*)
207 obj_format=aout emulation=sun3 ;;
208 *-*-generic) obj_format=generic ;;
209 *-*-xray | *-*-hms) obj_format=coff ;;
210 *-*-sim) obj_format=coff ;;
211 *-*-elf | *-*-sysv4* | *-*-solaris*)
212 AC_MSG_WARN(GAS support for ELF format is incomplete)
213 obj_format=elf dev=yes ;;
214 *-*-vxworks) obj_format=aout ;;
215 *-*-netware) obj_format=elf ;;
216 esac
217
218 # Assign floating point type. Most processors with FP support
219 # IEEE FP. On those that don't support FP at all, usually IEEE
220 # is emulated.
221 case ${target_cpu} in
222 vax | tahoe ) atof=${target_cpu} ;;
223 *) atof=ieee ;;
224 esac
225
226 case "${obj_format}" in
227 "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
228 esac
229
230 dnl
231 dnl Make sure the desired support files exist.
232 dnl
233
234 if test ! -r ${srcdir}/config/tc-${cpu_type}.c; then
235 AC_MSG_ERROR(GAS does not support target CPU ${cpu_type})
236 fi
237
238 if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
239 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
240 fi
241
242 # and target makefile frag
243
244 target_frag=${srcdir}/config/${gas_target}.mt
245 if test ! -r ${target_frag}; then
246 target_frag=/dev/null # ick! but subst_file can't be conditionalized
247 fi
248 AC_SUBST_FILE(target_frag)
249
250 case ${cpu_type}-${obj_format} in
251 arm-*) bfd_gas=yes ;;
252 # not yet
253 # i386-aout) bfd_gas=preferred ;;
254 mips-*) bfd_gas=yes ;;
255 ns32k-*) bfd_gas=yes ;;
256 ppc-*) bfd_gas=yes ;;
257 sparc-*) bfd_gas=yes ;;
258 *-elf) bfd_gas=yes ;;
259 *-ecoff) bfd_gas=yes ;;
260 *-som) bfd_gas=yes ;;
261 *) ;;
262 esac
263
264 case ${user_bfd_gas}-${bfd_gas} in
265 yes-yes | no-no)
266 # We didn't override user's choice.
267 ;;
268 no-yes)
269 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
270 ;;
271 no-preferred)
272 bfd_gas=no
273 ;;
274 *-preferred)
275 bfd_gas=yes
276 ;;
277 yes-*)
278 bfd_gas=yes
279 ;;
280 -*)
281 # User specified nothing.
282 ;;
283 esac
284
285 case ${bfd_gas}-${cpu_type}-${obj_format} in
286 yes-*-coff) need_bfd=yes ;;
287 no-*-coff) need_bfd=yes
288 AC_DEFINE(MANY_SEGMENTS) ;;
289 esac
290
291 reject_dev_configs=yes
292
293 case ${reject_dev_configs}-${dev} in
294 yes-yes) # Oops.
295 AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
296 ;;
297 esac
298
299 AC_SUBST(cpu_type)
300 AC_SUBST(obj_format)
301 AC_SUBST(atof)
302 AC_SUBST(emulation)
303
304 AC_LINK_FILES(config/tc-${cpu_type}.c config/tc-${cpu_type}.h \
305 config/obj-${obj_format}.h config/obj-${obj_format}.c \
306 config/te-${emulation}.h config/atof-${atof}.c,
307 targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c)
308
309 case "${bfd_gas}" in
310 yes) AC_DEFINE(BFD_ASSEMBLER)
311 need_bfd=yes ;;
312 esac
313
314 case "${need_bfd}" in
315 yes) BFDLIB=../bfd/libbfd.a
316 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
317 ;;
318 esac
319 AC_SUBST(BFDLIB)
320 AC_SUBST(ALL_OBJ_DEPS)
321
322 AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
323 AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
324 AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
325 AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
326 AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
327
328 AC_PROG_CC
329 AC_PROG_INSTALL
330
331 AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
332
333 # Put this here so that autoconf's "cross-compiling" message doesn't confuse
334 # people who are not cross-compiling but are compiling cross-assemblers.
335 AC_MSG_CHECKING(whether compiling a cross-assembler)
336 if test "${host}" = "${target}"; then
337 cross_gas=no
338 else
339 cross_gas=yes
340 AC_DEFINE(CROSS_COMPILE)
341 fi
342 AC_MSG_RESULT($cross_gas)
343
344 dnl ansidecl.h will deal with const
345 dnl AC_CONST
346 AC_FUNC_ALLOCA
347 AC_C_INLINE
348
349 # VMS doesn't have unlink.
350 AC_CHECK_FUNCS(unlink remove, break)
351
352 # Some non-ANSI preprocessors botch requoting inside strings. That's bad
353 # enough, but on some of those systems, the assert macro relies on requoting
354 # working properly!
355 GAS_WORKING_ASSERT
356
357 # On some systems, the system header files may not declare malloc, realloc,
358 # and free. There are places where gas needs these functions to have been
359 # declared -- such as when taking their addresses.
360 gas_test_headers="
361 #ifdef HAVE_MEMORY_H
362 #include <memory.h>
363 #endif
364 #ifdef HAVE_STRING_H
365 #include <string.h>
366 #endif
367 #ifdef HAVE_STDLIB_H
368 #include <stdlib.h>
369 #endif
370 #ifdef HAVE_UNISTD_H
371 #include <unistd.h>
372 #endif
373 "
374 GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
375 GAS_CHECK_DECL_NEEDED(free, f, int f, $gas_test_headers)
376
377 # Does errno.h declare errno, or do we have to add a separate declaration
378 # for it?
379 GAS_CHECK_DECL_NEEDED(errno, f, int f, [
380 #ifdef HAVE_ERRNO_H
381 #include <errno.h>
382 #endif
383 ])
384
385 AC_CONFIG_SUBDIRS(testsuite)
386
387 dnl This must come last.
388 AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in)
This page took 0.042274 seconds and 5 git commands to generate.