Tue Oct 31 16:34:28 1995 David Mosberger-Tang <davidm@azstarnet.com>
[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
833c46e1 7AC_PREREQ(2.3)dnl We only need 2.0, but pre-2.3 loses on some AIX version.
28d3e4a3 8AC_INIT(as.h)dnl
b11fb939 9dnl
318b02b6 10user_bfd_gas=
b11fb939 11AC_ARG_ENABLE(bfd-assembler,
d7b2038f 12[ --enable-bfd-assembler use BFD back end for writing object files],
b11fb939 13[case "${enableval}" in
318b02b6
KR
14 yes) need_bfd=yes user_bfd_gas=yes ;;
15 no) user_bfd_gas=no ;;
b11fb939
KR
16 *) AC_MSG_ERROR(bad value ${enableval} given for bfd-assembler option) ;;
17esac])dnl
e7757ad0
KR
18AC_ARG_ENABLE(targets,
19[ targets alternative target configurations besides the primary],
20[case "${enableval}" in
21 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
22 ;;
23 no) enable_targets= ;;
24 *) enable_targets=$enableval ;;
25esac])dnl
b11fb939
KR
26
27# Generate a header file -- gets more post-processing by Makefile later.
28AC_CONFIG_HEADER(conf)
29
30dnl For recursion to work right, this must be an absolute pathname.
31AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
32AC_CANONICAL_SYSTEM
bf111c9f 33AC_ARG_PROGRAM
7cf4d7ff 34
e7757ad0 35te_file=generic
b678740d 36
b11fb939 37# assign cpu type
5f8a3788 38
b53ccaac
ILT
39# check for architecture variants
40case ${target_cpu} in
1cb0d00d 41 armeb) cpu_type=arm endian=big ;;
a1c7c0f3 42 arm*) cpu_type=arm endian=little ;;
8cac6ca6 43 hppa*) cpu_type=hppa ;;
b11fb939 44changequote(,)dnl
904b6037 45 i[45]86) cpu_type=i386 ;;
82489ea0 46 m680[012346]0) cpu_type=m68k ;;
8cac6ca6
KR
47 m68008) cpu_type=m68k ;;
48 m683??) cpu_type=m68k ;;
b11fb939 49changequote([,])dnl
8cac6ca6 50 m8*) cpu_type=m88k ;;
5f8a3788 51 mips*el) cpu_type=mips endian=little;;
b11fb939 52 mips*) cpu_type=mips endian=big ;;
e7757ad0
KR
53 powerpcle*) cpu_type=ppc endian=little ;;
54 powerpc*) cpu_type=ppc endian=big ;;
1c11ab0e 55 rs6000*) cpu_type=ppc ;;
f2889110
KR
56 sparc64) cpu_type=sparc obj_format=elf
57 AC_DEFINE(sparcv9) ;;
8cac6ca6 58 sparclite*) cpu_type=sparc ;;
7cf4d7ff 59 *) cpu_type=${target_cpu} ;;
b53ccaac
ILT
60esac
61
634233a3
KR
62# do we need the opcodes library?
63case ${cpu_type} in
64 alpha | vax)
634233a3
KR
65 ;;
66 *)
b11fb939 67 OPCODES_LIB="../opcodes/libopcodes.a"
634233a3
KR
68 ;;
69esac
b11fb939 70AC_SUBST(OPCODES_LIB)
634233a3 71
b53ccaac 72gas_target=${cpu_type}
e7757ad0
KR
73this_target=${generic_target}
74
75canon_targets=""
76if test -n "$enable_targets" ; then
77 for t in `echo $enable_targets | sed 's/,/ /g'`; do
78 result=`$ac_config_sub $t 2>/dev/null`
79 if test -n "$result" ; then
80 canon_targets="$canon_targets $result"
81# else
82# # Permit "all", etc. We don't support it yet though.
83# canon_targets="$canon_targets $t"
84 fi
85 done
86 GAS_UNIQ(canon_targets)
87fi
88
89emulations=""
90
91for this_target in $target $canon_targets ; do
92
93 eval `echo $this_target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/cpu=\1 vendor=\2 os=\3/'`
8cac6ca6 94
e7757ad0
KR
95 # check for architecture variants
96 case ${cpu} in
97 hppa*) cpu_type=hppa ;;
98changequote(,)dnl
99 i[45]86) cpu_type=i386 ;;
100 m680[012346]0) cpu_type=m68k ;;
101 m68008) cpu_type=m68k ;;
102 m683??) cpu_type=m68k ;;
103changequote([,])dnl
104 m8*) cpu_type=m88k ;;
105 mips*el) cpu_type=mips endian=little;;
106 mips*) cpu_type=mips endian=big ;;
107 powerpcle*) cpu_type=ppc endian=little ;;
108 powerpc*) cpu_type=ppc endian=big ;;
109 rs6000*) cpu_type=ppc ;;
110 sparc64) cpu_type=sparc obj_format=elf want_sparcv9=true ;;
111 sparclite*) cpu_type=sparc ;;
a1c7c0f3 112 *) cpu_type=${cpu} ;;
e7757ad0
KR
113 esac
114
115 if test ${this_target} = $target ; then
116 target_cpu_type=${cpu_type}
117 elif test ${target_cpu_type} != ${cpu_type} ; then
118 continue
119 fi
120
121 targ=${cpu_type}
122 generic_target=${cpu_type}-$vendor-$os
123 dev=no
124 bfd_gas=no
125 em=generic
7cf4d7ff 126
e7757ad0
KR
127 # assign object format
128 case ${generic_target} in
129 a29k-amd-udi) fmt=coff targ=ebmon29k ;;
130 a29k-amd-ebmon) fmt=coff targ=ebmon29k ;;
131 a29k-*-vxworks*) fmt=coff ;;
132
133 alpha-*-netware*) fmt=ecoff ;;
134 alpha-*-osf*) fmt=ecoff ;;
d7b2038f 135 alpha-*-linux*) fmt=ecoff ;;
816153a3 136
4181c985 137# start-sanitize-arc
e7757ad0 138 arc-*-elf*) fmt=elf bfd_gas=yes ;;
4181c985
KR
139# end-sanitize-arc
140
a1c7c0f3 141 arm-*-riscix*) fmt=aout targ=arm-lit ;;
1cb0d00d
KR
142 arm-*-aout) fmt=aout
143 case "$endian" in
144 big) targ=arm-big ;;
145 *) targ=arm-lit ;;
146 esac
147 ;;
d7b2038f 148 arm-*-coff) fmt=coff ;;
e7757ad0 149 arm-*-riscix*) fmt=aout ;;
1cb0d00d 150 arm-*-pe) fmt=coff targ=armcoff em=pe ;;
e7757ad0
KR
151
152 hppa-*-*elf*) fmt=elf em=hppa ;;
153 hppa-*-lites*) fmt=elf em=hppa ;;
154 hppa-*-osf*) fmt=som em=hppa ;;
155 hppa-*-hpux*) fmt=som em=hppa ;;
156 hppa-*-bsd*) fmt=som em=hppa ;;
157 hppa-*-hiux*) fmt=som em=hppa ;;
158
159 h8300-*-coff) fmt=coff ;;
160
161 i386-ibm-aix*) fmt=coff targ=i386coff
162 em=i386aix ;;
163 i386-*-bsd*) fmt=aout em=386bsd ;;
164 i386-*-netbsd0.8) fmt=aout em=386bsd ;;
165 i386-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes;;
a1c7c0f3 166 i386-*-linux*aout* | i386-*-linuxoldld) fmt=aout em=linux ;;
e7757ad0
KR
167 i386-*-linux*coff*) fmt=coff em=linux
168 targ=i386coff ;;
169 i386-*-linux*) fmt=elf em=linux ;;
170 i386-*-lynxos*) fmt=coff targ=i386coff
171 em=lynx ;;
172 i386-*-sysv4* | i386-*-solaris* | i386-*-elf)
173 fmt=elf ;;
174 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
175 fmt=coff targ=i386coff ;;
176 i386-*-vsta) fmt=aout ;;
177 i386-*-go32) fmt=coff targ=i386coff ;;
6c186c48
SC
178 i386-*-gnu*) fmt=elf ;;
179 i386-*-mach*)
e7757ad0
KR
180 fmt=aout em=mach bfd_gas=yes ;;
181 i386-*-msdos*) fmt=aout ;;
6c186c48 182 i386-*-moss*) fmt=elf ;;
1cb0d00d 183 i386-*-pe) fmt=coff targ=i386coff em=pe ;;
6c186c48 184 i386-*-win32) fmt=coff targ=i386coff em=pe ;;
1cb0d00d 185 i386-*-*nt) fmt=coff targ=i386coff em=pe ;;
e7757ad0
KR
186 i960-*-bout) fmt=bout ;;
187 i960-*-coff) fmt=coff em=ic960 targ=ic960coff ;;
188 i960-*-nindy*) fmt=bout ;;
189 i960-*-vxworks4*) fmt=bout ;;
190 i960-*-vxworks5.0) fmt=bout ;;
191 i960-*-vxworks5.*) fmt=coff em=ic960 targ=ic960coff ;;
192 i960-*-vxworks*) fmt=bout ;;
193
194 m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*)
195 fmt=aout em=sun3 ;;
196 m68k-motorola-sysv) fmt=coff targ=m68kcoff em=delta ;;
197 m68k-bull-sysv3*) fmt=coff targ=m68kcoff em=dpx2 ;;
198 m68k-apollo-*) fmt=coff targ=apollo em=apollo ;;
199 m68k-*-coff | m68k-*-sysv*)
200 fmt=coff targ=m68kcoff ;;
201 m68k-*-elf) fmt=elf ;;
202 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
203 m68k-*-lynxos*) fmt=coff targ=m68kcoff
204 em=lynx ;;
205 m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
206
207 m88k-*-coff*) fmt=coff targ=m88kcoff ;;
208
209 # don't change em like *-*-bsd does
057a4d41 210 mips-dec-netbsd*) fmt=elf targ=mips-lit endian=little ;;
e7757ad0
KR
211 mips-dec-bsd*) fmt=aout targ=mips-lit ;;
212 mips-sony-bsd*) fmt=ecoff targ=mips-big ;;
213 mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;;
70f4dbce 214 mips-*-ultrix*) fmt=ecoff targ=mips-lit endian=little ;;
e7757ad0
KR
215 mips-*-ecoff*) fmt=ecoff
216 case "$endian" in
217 big) targ=mips-big ;;
218 *) targ=mips-lit ;;
219 esac
220 ;;
221 mips-*-ecoff*) fmt=ecoff targ=mips-big ;;
222 mips-*-gnu*) fmt=aout
223 case "$endian" in
224 big) targ=mips-big ;;
225 *) targ=mips-lit ;;
226 esac
227 ;;
228 mips-*-irix5*) fmt=elf targ=mips-big ;;
229 mips-*-irix*) fmt=ecoff targ=mips-big ;;
230 mips-*-riscos*) fmt=ecoff targ=mips-big ;;
231 mips-*-sysv*) fmt=ecoff targ=mips-big ;;
232 mips-*-elf*) fmt=elf
233 case "$endian" in
234 big) targ=mips-big ;;
235 *) targ=mips-lit ;;
236 esac
237 ;;
85cc2190
KK
238 ppc-*-pe) fmt=coff em=pe
239 case "$endian" in
240 big) targ=ppc-big ;;
241 *) targ=ppc-lit ;;
242 esac
243 ;;
244 ppc-*-winnt*) fmt=coff em=pe
245 case "$endian" in
246 big) targ=ppc-big ;;
247 *) targ=ppc-lit ;;
248 esac
249 ;;
e7757ad0
KR
250 ppc-*-aix*) fmt=coff ;;
251 ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*)
252 fmt=elf
253 case "$endian" in
254 big) targ=ppc-big ;;
255 *) targ=ppc-lit ;;
256 esac
257 ;;
258 ppc-*-netware*) fmt=elf em=ppcnw ;;
259
260 sh-*-coff) fmt=coff ;;
816153a3 261
03c4ce2f 262# start-sanitize-rce
e7757ad0 263 rce-*-aout) fmt=aout ;;
03c4ce2f 264# end-sanitize-rce
d94aca1a 265
5f757edc
ILT
266 ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;;
267 ns32k-pc532-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;;
e7757ad0
KR
268
269 sparc-*-sunos4*) fmt=aout em=sun3 ;;
270 sparc-*-aout | sparc*-*-vxworks)
271 fmt=aout ;;
272 sparc-*-coff) fmt=coff ;;
273 sparc-*-lynxos*) fmt=coff em=lynx ;;
274 sparc-fujitsu-none) fmt=aout ;;
275 sparc-*-elf | sparc*-*-solaris*)
276 fmt=elf ;;
277 sparc-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;;
278
279 vax-*-bsd* | vax-*-ultrix*)
280 fmt=aout ;;
281 vax-*-vms) fmt=vms ;;
282
283 z8k-*-coff | z8k-*-sim)
284 fmt=coff ;;
285
286 w65-*-*) fmt=coff ;;
287
288 *-*-aout | *-*-scout)
289 fmt=aout ;;
290 *-*-nindy*)
291 fmt=bout ;;
292 *-*-bsd*)
293 fmt=aout em=sun3 ;;
294 *-*-generic) fmt=generic ;;
295 *-*-xray | *-*-hms) fmt=coff ;;
296 *-*-sim) fmt=coff ;;
297 *-*-elf | *-*-sysv4* | *-*-solaris*)
298 AC_MSG_WARN(GAS support for ELF format is incomplete.)
299 fmt=elf dev=yes ;;
300 *-*-vxworks) fmt=aout ;;
301 *-*-netware) fmt=elf ;;
302 esac
303
304 case ${cpu_type}-${fmt} in
305 arm-*) bfd_gas=yes ;;
306 # not yet
307 # i386-aout) bfd_gas=preferred ;;
308 mips-*) bfd_gas=yes ;;
309 ns32k-*) bfd_gas=yes ;;
310 ppc-*) bfd_gas=yes ;;
311 sparc-*) bfd_gas=yes ;;
312 *-elf) bfd_gas=yes ;;
313 *-ecoff) bfd_gas=yes ;;
314 *-som) bfd_gas=yes ;;
315 *) ;;
316 esac
317
5f757edc
ILT
318# Other random stuff.
319
320 test -n "$want_sparcv9" && AC_DEFINE(sparcv9)
321
322 case ${cpu_type} in
323 m68k) extra_objects="$extra_objects m68k-parse.o" ;;
324 esac
325
e7757ad0
KR
326# See if we really can support this configuration with the emulation code.
327
328 if test $this_target = $target ; then
329 primary_bfd_gas=$bfd_gas
330 obj_format=$fmt
331 gas_target=$targ
332 te_file=$em
333
334 if test $bfd_gas = no ; then
335 # Can't support other configurations this way.
336 break
337 fi
338 elif test $bfd_gas = no ; then
339 # Can't support this configuration.
340 break
341 fi
342
343# From target name and format, produce a list of supported emulations.
344
345 case ${generic_target}-${fmt} in
1cb0d00d 346 mips-*-irix5*-*) emulation="mipsbelf mipslelf mipself mipsbecoff mipslecoff mipsecoff" ;;
e7757ad0 347 mips-*-*-ecoff) case "$endian" in
1cb0d00d
KR
348 big) emulation="mipsbecoff mipslecoff mipsecoff" ;;
349 *) emulation="mipslecoff mipsbecoff mipsecoff" ;;
e7757ad0
KR
350 esac ;;
351 mips-*-*-elf) case "$endian" in
1cb0d00d
KR
352 big) emulation="mipsbelf mipslelf mipself" ;;
353 *) emulation="mipslelf mipsbelf mipself" ;;
e7757ad0
KR
354 esac ;;
355 esac
356
357 emulations="$emulations $emulation"
358
e7757ad0 359done
fecd2382 360
8cac6ca6
KR
361# Assign floating point type. Most processors with FP support
362# IEEE FP. On those that don't support FP at all, usually IEEE
363# is emulated.
b678740d 364case ${target_cpu} in
904b6037 365 vax | tahoe ) atof=${target_cpu} ;;
e7757ad0 366 *) atof=ieee ;;
fecd2382
RP
367esac
368
8cac6ca6 369case "${obj_format}" in
b11fb939 370 "") AC_MSG_ERROR(GAS does not know what format to use for target ${target}) ;;
8cac6ca6 371esac
7cf4d7ff 372
b11fb939
KR
373dnl
374dnl Make sure the desired support files exist.
375dnl
376
bf4bd1fc
ILT
377if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then
378 AC_MSG_ERROR(GAS does not support target CPU ${target_cpu_type})
b11fb939
KR
379fi
380
fb589130 381if test ! -r ${srcdir}/config/obj-${obj_format}.c; then
b11fb939 382 AC_MSG_ERROR(GAS does not have support for object file format ${obj_format})
7cf4d7ff
KR
383fi
384
8a24a37c
SC
385# and target makefile frag
386
b11fb939 387target_frag=${srcdir}/config/${gas_target}.mt
f2889110
KR
388if test ! -r ${target_frag}; then
389 target_frag=/dev/null # ick! but subst_file can't be conditionalized
390fi
b11fb939 391AC_SUBST_FILE(target_frag)
8a24a37c 392
e7757ad0 393case ${user_bfd_gas}-${primary_bfd_gas} in
a8285504 394 yes-yes | no-no)
7cf4d7ff
KR
395 # We didn't override user's choice.
396 ;;
a8285504 397 no-yes)
b11fb939 398 AC_MSG_WARN(Use of BFD is required for ${target}; overriding config options.)
7cf4d7ff 399 ;;
a8285504 400 no-preferred)
e7757ad0 401 primary_bfd_gas=no
a8285504
DZ
402 ;;
403 *-preferred)
e7757ad0 404 primary_bfd_gas=yes
a8285504 405 ;;
f2889110 406 yes-*)
e7757ad0 407 primary_bfd_gas=yes
f2889110 408 ;;
a8285504
DZ
409 -*)
410 # User specified nothing.
411 ;;
7cf4d7ff
KR
412esac
413
e7757ad0
KR
414# Some COFF configurations want these random other flags set.
415case ${obj_format} in
416 coff)
417 case ${target_cpu_type} in
418 i386) AC_DEFINE(I386COFF) ;;
419 m68k) AC_DEFINE(M68KCOFF) ;;
420 m88k) AC_DEFINE(M88KCOFF) ;;
421 esac
422 ;;
423esac
424
425# Getting this done right is going to be a bitch. Each configuration specified
426# with --enable-targets=... should be checked for environment, format, cpu, and
427# bfd_gas setting.
428#
429# For each configuration, the necessary object file support code must be linked
430# in. This might be only one, it might be up to four. The necessary emulation
431# code needs to be provided, too.
432#
433# And then there's "--enable-targets=all"....
434#
435# For now, just always do it for MIPS ELF or ECOFF configurations. Sigh.
436
437formats="${obj_format}"
438emfiles=""
439EMULATIONS=""
440GAS_UNIQ(emulations)
441for em in . $emulations ; do
442 case $em in
443 .) continue ;;
444 mipsbelf | mipslelf)
445 fmt=elf file=mipself ;;
446 mipsbecoff | mipslecoff)
447 fmt=ecoff file=mipsecoff ;;
448 esac
449 formats="$formats $fmt"
450 emfiles="$emfiles e-$file.o"
451 EMULATIONS="$EMULATIONS &$em,"
452done
453GAS_UNIQ(formats)
454GAS_UNIQ(emfiles)
455if test `set . $formats ; shift ; echo $#` -gt 1 ; then
456 for fmt in $formats ; do
457 case $fmt in
458 aout) AC_DEFINE(OBJ_MAYBE_AOUT) ;;
459 bout) AC_DEFINE(OBJ_MAYBE_BOUT) ;;
460 coff) AC_DEFINE(OBJ_MAYBE_COFF) ;;
461 ecoff) AC_DEFINE(OBJ_MAYBE_ECOFF) ;;
462 elf) AC_DEFINE(OBJ_MAYBE_ELF) ;;
463 generic) AC_DEFINE(OBJ_MAYBE_GENERIC) ;;
464 hp300) AC_DEFINE(OBJ_MAYBE_HP300) ;;
465 ieee) AC_DEFINE(OBJ_MAYBE_IEEE) ;;
466 som) AC_DEFINE(OBJ_MAYBE_SOM) ;;
467 vms) AC_DEFINE(OBJ_MAYBE_VMS) ;;
468 esac
469 extra_objects="$extra_objects obj-$fmt.o"
470 done
471 obj_format=multi
472fi
473if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then
474 te_file=multi
475 extra_objects="$extra_objects $emfiles"
476 DEFAULT_EMULATION=`set . $emulations ; echo $2`
477 AC_DEFINE(USE_EMULATIONS)
478fi
479AC_SUBST(extra_objects)
480AC_DEFINE_UNQUOTED(EMULATIONS, $EMULATIONS)
481AC_DEFINE_UNQUOTED(DEFAULT_EMULATION, "$DEFAULT_EMULATION")
482
bf4bd1fc 483files="config/tc-${target_cpu_type}.c config/tc-${target_cpu_type}.h \
e7757ad0
KR
484 config/obj-${obj_format}.h config/obj-${obj_format}.c \
485 config/te-${te_file}.h config/atof-${atof}.c \
486 $extra_files"
487links="targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c \
488 $extra_links"
489
bf4bd1fc 490case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in
318b02b6
KR
491 yes-*-coff) need_bfd=yes ;;
492 no-*-coff) need_bfd=yes
493 AC_DEFINE(MANY_SEGMENTS) ;;
494esac
495
69ecc03f 496reject_dev_configs=yes
8cac6ca6
KR
497
498case ${reject_dev_configs}-${dev} in
499 yes-yes) # Oops.
b11fb939 500 AC_MSG_ERROR(GAS does not support the ${generic_target} configuration.)
8cac6ca6
KR
501 ;;
502esac
503
bf4bd1fc 504AC_SUBST(target_cpu_type)
833c46e1
KR
505AC_SUBST(obj_format)
506AC_SUBST(atof)
e7757ad0 507dnl AC_SUBST(emulation)
833c46e1 508
e7757ad0 509AC_LINK_FILES($files, $links)
8b228fe9 510
e7757ad0 511case "${primary_bfd_gas}" in
b11fb939
KR
512 yes) AC_DEFINE(BFD_ASSEMBLER)
513 need_bfd=yes ;;
4f6f4aa8
KR
514esac
515
b11fb939
KR
516case "${need_bfd}" in
517 yes) BFDLIB=../bfd/libbfd.a
518 ALL_OBJ_DEPS="$ALL_OBJ_DEPS ../bfd/bfd.h"
c92d9ee9 519 ;;
4f6f4aa8 520esac
b11fb939
KR
521AC_SUBST(BFDLIB)
522AC_SUBST(ALL_OBJ_DEPS)
4f6f4aa8 523
b11fb939
KR
524AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}")
525AC_DEFINE_UNQUOTED(TARGET_CANONICAL, "${target}")
526AC_DEFINE_UNQUOTED(TARGET_CPU, "${target_cpu}")
527AC_DEFINE_UNQUOTED(TARGET_VENDOR, "${target_vendor}")
528AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}")
529
b11fb939
KR
530AC_PROG_CC
531AC_PROG_INSTALL
532
b11fb939
KR
533AC_CHECK_HEADERS(string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h)
534
bf111c9f
KR
535# Put this here so that autoconf's "cross-compiling" message doesn't confuse
536# people who are not cross-compiling but are compiling cross-assemblers.
537AC_MSG_CHECKING(whether compiling a cross-assembler)
538if test "${host}" = "${target}"; then
f2889110
KR
539 cross_gas=no
540else
bf111c9f
KR
541 cross_gas=yes
542 AC_DEFINE(CROSS_COMPILE)
bf111c9f
KR
543fi
544AC_MSG_RESULT($cross_gas)
545
b11fb939
KR
546dnl ansidecl.h will deal with const
547dnl AC_CONST
548AC_FUNC_ALLOCA
549AC_C_INLINE
550
f2889110
KR
551# VMS doesn't have unlink.
552AC_CHECK_FUNCS(unlink remove, break)
28d3e4a3 553
e63c594d
FF
554# Some systems don't have sbrk().
555AC_CHECK_FUNCS(sbrk)
556
b11fb939
KR
557# Some non-ANSI preprocessors botch requoting inside strings. That's bad
558# enough, but on some of those systems, the assert macro relies on requoting
559# working properly!
bf111c9f 560GAS_WORKING_ASSERT
b11fb939
KR
561
562# On some systems, the system header files may not declare malloc, realloc,
563# and free. There are places where gas needs these functions to have been
564# declared -- such as when taking their addresses.
bf111c9f 565gas_test_headers="
b11fb939
KR
566#ifdef HAVE_MEMORY_H
567#include <memory.h>
568#endif
569#ifdef HAVE_STRING_H
570#include <string.h>
571#endif
572#ifdef HAVE_STDLIB_H
573#include <stdlib.h>
574#endif
575#ifdef HAVE_UNISTD_H
576#include <unistd.h>
577#endif
bf111c9f
KR
578"
579GAS_CHECK_DECL_NEEDED(malloc, f, char *(*f)(), $gas_test_headers)
5f757edc 580GAS_CHECK_DECL_NEEDED(free, f, void (*f)(), $gas_test_headers)
b11fb939
KR
581
582# Does errno.h declare errno, or do we have to add a separate declaration
583# for it?
bf111c9f 584GAS_CHECK_DECL_NEEDED(errno, f, int f, [
b11fb939
KR
585#ifdef HAVE_ERRNO_H
586#include <errno.h>
587#endif
bf111c9f 588])
b11fb939 589
b11fb939 590dnl This must come last.
28d3e4a3 591AC_OUTPUT(Makefile doc/Makefile .gdbinit:gdbinit.in)
This page took 0.185099 seconds and 4 git commands to generate.