put CROSS definition into the Makefile
[deliverable/binutils-gdb.git] / gas / configure.in
1 # This file is configure.in
2 #
3 # Copyright (C) 1987-1992 Free Software Foundation, Inc.
4 #
5 # This file is part of GAS, the GNU Assembler.
6 #
7 # GAS is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11 #
12 # GAS is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GAS; see the file COPYING. If not, write to
19 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #
21
22 # This file was written, and is maintained by K. Richard Pixley
23 # <rich@cygnus.com>.
24
25 # This file is a shell script that supplies the information necessary
26 # to tailor a template configure script into the configure script
27 # appropriate for this directory. For more information, check any
28 # existing configure script.
29
30 srctrigger=as.c
31 srcname="gas"
32 need_bfd=no
33 bfd_gas=no
34 configdirs="doc testsuite"
35
36 # per-host:
37
38 gas_host=generic
39
40 case "${host}" in
41 a29k-*-*) gas_host=a29k ;;
42
43 alpha-*-osf*) gas_host=ansi ;;
44
45 hppa*-hp-hpux*) gas_host=hpux ;;
46 hppa*-hp-bsd*) gas_host=hppabsd ;;
47 hppa*-hp-osf*) gas_host=hppaosf ;;
48
49 i[34]86-ibm-aix*) gas_host=i386aix ;;
50 i[34]86-*-isc*) gas_host=sysv ;;
51 i386-sun-sunos*) gas_host=sun386 ;;
52
53 m68k-sun-sunos*) gas_host=sun3 ;;
54 m68*-*-hpux) gas_host=hpux ;;
55
56 mips-dec-ultrix*) gas_host=decstatn ;;
57 mips-*-bsd*) gas_host=mipsbsd ;;
58 mips-sgi-irix*) gas_host=irix ;;
59
60 rs6000-*-*) gas_host=rs6000 ;;
61
62 sparc-sun-sunos*) gas_host=sun4 ;;
63 sparc-sun-solaris2*) gas_host=sysv ;;
64
65 vax-*-vms*) gas_host=vms ;;
66 vax-*-bsd*) gas_host=vax ;;
67
68 *-*-ansi | *-*-ultrix | *-*-hpux | *-*-sysv*)
69 gas_host=${host_os} ;;
70
71 esac
72
73 if [ ! -r ${srcdir}/config/ho-${gas_host}.h ]; then
74 echo '*** GAS does not support host' ${host} 1>&2
75 exit 1
76 fi
77
78 # per-target:
79
80 case ${with_bfd_assembler} in
81 yes)
82 echo "*** Warning: GAS BFD configuration option not yet fully supported" 1>&2
83 need_bfd=yes
84 bfd_gas=yes
85 ;;
86 no | "")
87 ;;
88 *)
89 echo "*** Bad value \"${with_bfd_assembler}\" for --with-bfd-assembler option" 1>&2
90 exit 1
91 ;;
92 esac
93
94 # assign cpu type
95 emulation=generic
96
97 # check for architecture variants
98 case ${target_cpu} in
99 sparclite*) cpu_type=sparc ;;
100 sparc64) cpu_type=sparc64 obj_format=elf ;; # v9
101 m680[01234]0) cpu_type=m68k ;;
102 m683??) cpu_type=m68k ;;
103 i486) cpu_type=i386 ;;
104 # Actually we've only got support for the 1.1, so we shouldn't generalize,
105 # but this is what the support files are named...
106 hppa1.1) cpu_type=hppa ;;
107 *) cpu_type=${target_cpu} ;;
108 esac
109
110 gas_target=${cpu_type}
111
112 generic_target=${cpu_type}-${target_vendor}-${target_os}
113
114 # assign object format
115 case ${generic_target} in
116 a29k-amd-udi) obj_format=coffbfd gas_target=ebmon29k ;;
117 a29k-amd-ebmon) obj_format=coffbfd gas_target=ebmon29k ;;
118 a29k-amd-ebmonold) obj_format=coff gas_target=ebmon29k ;;
119
120 hppa-*-osf) obj_format=elf emulation=hppa ;;
121 hppa-*-hpux*) obj_format=som emulation=hppa ;;
122
123 h8300-*-coff) obj_format=coffbfd ;;
124
125 i386-ibm-aix*) obj_format=coffbfd gas_target=i386coff
126 emulation=i386aix ;;
127 i386-*-bsd*) obj_format=aout emulation=386bsd ;;
128 i386-*-linux*) obj_format=aout emulation=linux ;;
129 i386-*-coff | i386-*-sysv* | i386-*-sco* | i386-*-isc*)
130 obj_format=coffbfd gas_target=i386coff ;;
131 i386-*-go32) obj_format=aout ;;
132
133 i960-wrs-vxworks) obj_format=bout ;;
134 i960-*-coff) obj_format=coff emulation=ic960 ;;
135
136 m68k-wrs-vxworks) obj_format=aout emulation=sun3 ;;
137 m68k-ericsson-[Oo][Ss][Ee])
138 obj_format=aout emulation=sun3 ;;
139 m68k-*-coff | m68*-*-sysv*)
140 obj_format=coffbfd gas_target=m68kcoff ;;
141 m68k-*-hpux) obj_format=hp300 emulation=hp300 ;;
142
143 # don't change emulation like *-*-bsd does
144 mips-*-bsd*) bfd_gas=yes obj_format=aout gas_target=mips-lit ;;
145 mips-*-ultrix*) obj_format=ecoff gas_target=mips-lit ;;
146 mips-*-ecoffl*) obj_format=ecoff gas_target=mips-lit ;;
147 mips-*-ecoff*) obj_format=ecoff gas_target=mips-big ;;
148 mips-*-irix*) obj_format=ecoff gas_target=mips-big emulation=irix ;;
149
150 sparc*-*-sunos4*) bfd_gas=preferred obj_format=aout emulation=sun3 ;;
151
152 sparc*-fujitsu-none)
153 obj_format=aout ;;
154
155 *-*-aout | *-*-scout | *-*-linux)
156 obj_format=aout ;;
157 *-*-bout* | *-*-nindy*)
158 obj_format=bout ;;
159 *-*-bsd* | *-*-sunos*)
160 obj_format=aout emulation=sun3 ;;
161 *-*-generic) obj_format=generic ;;
162 *-*-xray | *-*-hms) obj_format=coffbfd ;;
163 *-*-sysv32) obj_format=coff emulation=sysv32 ;;
164 *-*-sim) obj_format=coffbfd ;;
165 *-*-coff* | *-sysv* | *-*-sco*)
166 obj_format=coff
167 case ${target_vendor} in
168 bull) emulation=dpx2 ;;
169 sun) emulation=sun3 ;;
170 esac
171 ;;
172 *-*-vxworks) obj_format=aout ;;
173 *-*-coff) obj_format=coff ;;
174 *-*-elf | *-*-solaris*)
175 echo '*** Warning: GAS support for ELF format is incomplete' 1>&2
176 obj_format=elf ;;
177 *-*-vms) obj_format=vms ;;
178 esac
179
180 # assign floating point type
181 case ${target_cpu} in
182 ns32k | vax | tahoe ) atof=${target_cpu} ;;
183 *) atof=ieee ;;
184 esac
185
186 if [ ! -r ${srcdir}/config/tc-${cpu_type}.c ]; then
187 echo '*** GAS does not support target CPU' ${cpu_type} 1>&2
188 exit 1
189 fi
190
191 if [ x${obj_format} = x ]; then
192 echo "*** GAS doesn't know what format to use for target" ${target} 1>&2
193 exit 1
194 fi
195
196 if [ ! -r ${srcdir}/config/obj-${obj_format}.c ]; then
197 echo '*** GAS does not have support for object file format' ${obj_format} 1>&2
198 exit 1
199 fi
200
201 # and target makefile frag
202
203 target_makefile_frag=config/${gas_target}.mt
204
205 case ${bfd_gas}-${obj_format} in
206 yes-coffbfd) obj_format=coff ;;
207 no-coffbfd) need_bfd=yes ;;
208 *-elf) bfd_gas=yes ;;
209 *-ecoff) bfd_gas=yes ;;
210 *) ;;
211 esac
212
213 case ${with_bfd_assembler}-${bfd_gas} in
214 yes-yes | no-no)
215 # We didn't override user's choice.
216 ;;
217 no-yes)
218 echo '*** Use of BFD is required for ${target}; overriding config options'\
219 1>&2
220 ;;
221 no-preferred)
222 bfd_gas=no
223 ;;
224 *-preferred)
225 bfd_gas=yes
226 ;;
227 -*)
228 # User specified nothing.
229 ;;
230 esac
231
232 files="config/ho-${gas_host}.h config/tc-${cpu_type}.c \
233 config/tc-${cpu_type}.h config/te-${emulation}.h \
234 config/obj-${obj_format}.h config/obj-${obj_format}.c \
235 config/atof-${atof}.c"
236
237 links="host.h targ-cpu.c targ-cpu.h targ-env.h obj-format.h obj-format.c atof-targ.c"
238
239 # post-target:
240
241 case ${bfd_gas} in
242 yes)
243 rm -f Makefile.tem
244 mv Makefile Makefile.tem
245 echo BFDDEF=-DBFD_ASSEMBLER > Makefile
246 cat Makefile.tem >> Makefile
247 rm -f Makefile.tem
248 need_bfd=yes
249 ;;
250 *)
251 ;;
252 esac
253
254 case ${need_bfd} in
255 yes)
256 rm -f Makefile.tem
257 mv Makefile Makefile.tem
258 echo BFDLIB=../bfd/libbfd.a > Makefile
259 cat Makefile.tem >> Makefile
260 rm -f Makefile.tem
261 ;;
262 *)
263 ;;
264 esac
265
266 if [ x${host} != x${target} ] ; then
267 rm -f Makefile.tem
268 mv Makefile Makefile.tem
269 echo CROSS=-DCROSS_COMPILE > Makefile
270 cat Makefile.tem >> Makefile
271 rm -f Makefile.tem
272 else
273 true
274 fi
275
276 # end of gas/configure.in
This page took 0.036991 seconds and 5 git commands to generate.