fe54e0ce9452abce7f71ce0e302205e8abb0df39
[external/binutils.git] / gdb / configure.in
1 configdirs="doc testsuite"
2 srcname="GDB"
3 srctrigger=main.c
4
5 # per-host:
6
7 # Map host cpu into the config cpu subdirectory name.
8 # The default is $host_cpu.
9
10 case "${host_cpu}" in
11
12 c[12])                  gdb_host_cpu=convex ;;
13 hppa*)                  gdb_host_cpu=pa ;;
14 i[34]86)                gdb_host_cpu=i386 ;;
15 m68*)                   gdb_host_cpu=m68k ;;
16 np1)                    gdb_host_cpu=gould ;;
17 pyramid)                gdb_host_cpu=pyr ;;
18 *)                      gdb_host_cpu=$host_cpu ;;
19
20 esac
21
22 # map host info into gdb names.
23
24 case "${host}" in
25
26 a29k-*-*)               gdb_host=ultra3 ;;
27
28 alpha-*-osf*)           gdb_host=alpha-osf1 ;;
29
30 arm-*-*)                gdb_host=arm ;;
31
32 c[12]-*-*)              gdb_host=convex ;;
33
34 hppa*-hp-bsd*)          gdb_host=hppabsd ;;
35 hppa*-hp-hpux*)         gdb_host=hppahpux ;;
36
37 i[34]86-ncr-*)          gdb_host=ncr3000 ;;
38 i[34]86-sequent-*)      gdb_host=symmetry ;;
39
40 i[34]86-*-bsd*)         gdb_host=i386bsd ;;
41 i[34]86-*-go32)         gdb_host=go32 ;;
42 i[34]86-*-linux)        gdb_host=linux ;;
43 i[34]86-*-mach)         gdb_host=i386mach ;;
44 i[34]86-*-sco3.2v4*)    gdb_host=i386sco4 ;;
45 i[34]86-*-sco*)         gdb_host=i386sco ;;
46 i[34]86-*-solaris*)     gdb_host=i386sol2 ;;
47 i[34]86-*-sunos*)       gdb_host=sun386 ;;
48 i[34]86-*-sysv3.2)      gdb_host=i386v32 ;;
49 i[34]86-*-sysv4*)       gdb_host=i386v4 ;;
50 i[34]86-*-sysv*)        gdb_host=i386v ;;
51 i[34]86-*-isc*)         gdb_host=i386v32 ;;
52
53 m680[01]0-sun-sunos3*)  gdb_host=sun2os3 ;;
54 m680[01]0-sun-sunos4*)  gdb_host=sun2os4 ;;
55 m68030-sony-*)          gdb_host=news1000 ;;
56
57 m68*-altos-*)           gdb_host=altos ;;
58 m68*-apollo*-sysv*)     gdb_host=apollo68v ;;
59 m68*-apollo*-bsd*)      gdb_host=apollo68b ;;
60 m68*-att-*)             gdb_host=3b1 ;;
61 m68*-cbm-sysv4*)        gdb_host=amix ;;
62 m68*-hp-bsd*)           gdb_host=hp300bsd ;;
63 m68*-hp-hpux*)          gdb_host=hp300hpux ;;
64 m68*-isi-*)             gdb_host=isi ;;
65 m68*-sony-*)            gdb_host=news ;;
66 m68*-sun-sunos3*)       gdb_host=sun3os3 ;;
67 m68*-sun-sunos4*)       gdb_host=sun3os4 ;;
68 m68*-sun-*)             gdb_host=sun3os4 ;;
69
70 m88k-motorola-*)        gdb_host=delta88 ;;
71 m88k-*-*)               gdb_host=m88k ;;
72
73 mips-dec-*)             gdb_host=decstation ;;
74 mips-little-*)          gdb_host=littlemips ;;
75 mips-sgi-irix3)         gdb_host=irix3 ;;
76 mips-sgi-irix4*)        gdb_host=irix4 ;;
77 mips-sony-*)            gdb_host=news-mips ;;
78
79 none-*-*)               gdb_host=none ;;
80
81 np1-*-*)                gdb_host=np1 ;;
82
83 ns32k-umax-*)           gdb_host=umax ;;
84 ns32k-utek-sysv)        gdb_host=merlin ;;
85
86 pn-*-*)                 gdb_host=pn ;;
87
88 pyramid-*-*)            gdb_host=pyramid ;;
89
90 romp-*-*)               gdb_host=rtbsd ;;
91
92 rs6000-*-*)             gdb_host=rs6000 ;;
93
94 sparc-*-solaris2*)      gdb_host=sun4sol2 ;;
95 sparc-*-sunos4*)        gdb_host=sun4os4 ;;
96 sparc-*-*)              gdb_host=sun4os4 ;;
97
98 tahoe-*-*)              gdb_host=tahoe ;;
99
100 vax-*-bsd*)             gdb_host=vaxbsd ;;
101 vax-*-ultrix2*)         gdb_host=vaxult2 ;;
102 vax-*-ultrix*)          gdb_host=vaxult ;;
103
104 esac
105
106
107 if [ ! -f ${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh ]; then
108         echo '***' "Gdb does not support host ${host}" 1>&2
109         exit 1
110 fi
111
112 #  We really shouldn't depend on there being a space after XM_FILE= ...
113 hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh`
114
115 # per-target:
116
117 # Map target cpu into the config cpu subdirectory name.
118 # The default is $target_cpu.
119
120 case "${target_cpu}" in
121
122 c[12])                  gdb_target_cpu=convex ;;
123 hppa*)                  gdb_target_cpu=pa ;;
124 i[34]86)                gdb_target_cpu=i386 ;;
125 m68*)                   gdb_target_cpu=m68k ;;
126 np1)                    gdb_target_cpu=gould ;;
127 pn)                     gdb_target_cpu=gould ;;
128 pyramid)                gdb_target_cpu=pyr ;;
129 sparclite)              gdb_target_cpu=sparc
130                         configdirs="${configdirs} sparclite"
131                         ;;
132 sparc*)                 gdb_target_cpu=sparc ;;
133 *)                      gdb_target_cpu=$target_cpu ;;
134
135 esac
136
137 # map target info into gdb names.
138
139 case "${target}" in
140
141 a29k-*-aout)            gdb_target=a29k ;;
142 a29k-*-coff)            gdb_target=a29k ;;
143 a29k-*-elf)             gdb_target=a29k ;;
144 a29k-*-ebmon)           gdb_target=a29k ;;
145 a29k-*-kern)            gdb_target=a29k-kern ;;
146 a29k-*-none)            gdb_target=a29k ;;
147 a29k-*-sym1)            gdb_target=ultra3 ;;
148 a29k-*-udi)             gdb_target=a29k-udi ;;
149
150 arm-*-*)                gdb_target=arm ;;
151
152 c1-*-*)                 gdb_target=convex ;;
153 c2-*-*)                 gdb_target=convex ;;
154
155 h8300-*-*)              gdb_target=h8300hms ;;
156 h8500-*-*)              gdb_target=h8500hms ;;
157
158 sh-*-*)                 gdb_target=sh ;;
159
160 hppa*-*-bsd*)           gdb_target=hppabsd ;;
161 hppa*-*-hpux*)          gdb_target=hppahpux ;;
162
163 i[34]86-sequent-*)      gdb_target=symmetry ;;
164 i[34]86-ncr-*)          gdb_target=ncr3000 ;;
165
166 i[34]86-*-aout)         gdb_target=i386aout ;;
167 i[34]86-*-coff)         gdb_target=i386v ;;
168 i[34]86-*-elf)          gdb_target=i386v ;;
169
170 i[34]86-*-bsd*)         gdb_target=i386bsd ;;
171 i[34]86-*-go32)         gdb_target=i386aout ;;
172 i[34]86-*-lynxos*)      gdb_target=i386lynx
173                         configdirs="${configdirs} gdbserver"
174                         ;;
175 i[34]86-*-solaris*)     gdb_target=i386sol2 ;;
176 i[34]86-*-sunos*)       gdb_target=sun386 ;;
177 i[34]86-*-sysv4*)       gdb_target=i386v4 ;;
178 i[34]86-*-sco*)         gdb_target=i386v ;;
179 i[34]86-*-sysv*)        gdb_target=i386v ;;
180 i[34]86-*-linux*)       gdb_target=linux ;;
181 i[34]86-*-isc*)         gdb_target=i386v ;;
182
183 i960-*-bout)            gdb_target=vxworks960 ;;
184 i960-*-coff)            gdb_target=nindy960 ;;
185 i960-*-elf)             gdb_target=nindy960 ;;
186
187 i960-*-nindy)           gdb_target=nindy960 ;;
188 i960-*-vxworks)         gdb_target=vxworks960 ;;
189
190 m68000-*-aout)          gdb_target=m68k-nofp ;;
191 m68000-*-coff)          gdb_target=m68k-nofp ;;
192 m68000-*-elf)           gdb_target=m68k-nofp ;;
193 m68000-*-sunos3*)       gdb_target=sun2os3 ;;
194 m68000-*-sunos4*)       gdb_target=sun2os4 ;;
195
196 m68*-cbm-sysv4*)        gdb_target=amix ;;
197 m68*-hp-bsd*)           gdb_target=hp300bsd ;;
198 m68*-hp-hpux*)          gdb_target=hp300hpux ;;
199
200 m68*-altos-*)           gdb_target=altos ;;
201 m68*-att-*)             gdb_target=3b1 ;;
202 m68*-ericsson-*)        gdb_target=es1800 ;;
203 m68*-isi-*)             gdb_target=isi ;;
204 m68*-netx-*)            gdb_target=vxworks68 ;;
205 m68*-sony-*)            gdb_target=news ;;
206 m68*-tandem-*)          gdb_target=st2000 ;;
207
208 m68*-rom68k-*)          gdb_target=monitor ;;
209 m68*-*bug-*)            gdb_target=monitor ;;
210 m68*-monitor-*)         gdb_target=monitor ;;
211
212 m68*-*-aout)            gdb_target=m68k-fp ;;
213 m68*-*-coff)            gdb_target=m68k-fp ;;
214 m68*-*-elf)             gdb_target=m68k-fp ;;
215 m68*-*-os68k)           gdb_target=os68k ;;
216 m68*-*-sunos3*)         gdb_target=sun3os3 ;;
217 m68*-*-sunos4*)         gdb_target=sun3os4 ;;
218 m68*-*-vxworks*)        gdb_target=vxworks68 ;;
219
220 m88k-motorola-*)        gdb_target=delta88 ;;
221 m88k-*-*)               gdb_target=m88k ;;
222
223 mips-big-*)             gdb_target=bigmips ;;
224 mips-dec-*)             gdb_target=decstation ;;
225 mips-idt-ecoffl*)       gdb_target=idtl ;;
226 mips-idt-ecoff*)        gdb_target=idt ;;
227 mips-little-*)          gdb_target=littlemips ;;
228 mips-sgi-*)             gdb_target=irix3 ;;
229 mips-sony-*)            gdb_target=bigmips ;;
230
231 none-*-*)               gdb_target=none ;;
232
233 np1-*-*)                gdb_target=np1 ;;
234
235 ns32k-utek-sysv)        gdb_target=merlin ;;
236 ns32k-utek-*)           gdb_target=umax ;;
237
238 pn-*-*)                 gdb_target=pn ;;
239
240 pyramid-*-*)            gdb_target=pyramid ;;
241
242 rs6000-*-*)             gdb_target=rs6000 ;;
243
244 sparc-*-aout)           gdb_target=sparc-em ;;
245 sparc-*-coff)           gdb_target=sparc-em ;;
246 sparc-*-elf)            gdb_target=sparc-em ;;
247 sparc-*-solaris2*)      gdb_target=sun4sol2 ;;
248 sparc-*-sunos4*)        gdb_target=sun4os4 ;;
249 sparc-*-vxworks*)       gdb_target=vxsparc ;;
250 sparc-*-*)              gdb_target=sun4os4 ;;
251 sparclite*-*-*)         gdb_target=sparclite ;;
252
253 tahoe-*-*)              gdb_target=tahoe ;;
254 vax-*-*)                gdb_target=vax ;;
255
256 z8k-*-sim)              gdb_target=z8ksim ;;
257 esac
258
259 if [ ! -f ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt ]; then
260         echo '***' "Gdb does not support target ${target}" 1>&2
261         exit 1
262 fi
263
264 if [ -z "${removing}" ] ; then
265         cat ${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt | awk '$1 == "#msg" {
266                 print substr($0,6)}'
267 fi
268
269 #  We really shouldn't depend on there being a space after TM_FILE= ...
270 targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt`
271
272 if [ "${target}" = "${host}" ] ; then
273         nativefile=`awk '$1 == "NAT_FILE=" { print $2 }' <${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh`
274 fi
275
276 host_makefile_frag=config/${gdb_host_cpu}/${gdb_host}.mh
277 target_makefile_frag=config/${gdb_target_cpu}/${gdb_target}.mt
278
279 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
280 # (NAT_FILE) is not set in the ?config/* file, we don't make the
281 # corresponding links.  But we have to remove the xm.h files and tm.h
282 # files anyway, e.g. when switching from "configure host" to
283 # "configure none".
284
285 files=
286 links=
287 rm -f xm.h
288 if [ "${hostfile}" != "" ]; then
289         if [ -f ${srcdir}/config/${hostfile} ]; then
290                 files="${files} config/${hostfile}"
291         else
292                 files="${files} config/${gdb_host_cpu}/${hostfile}"
293         fi
294         links="${links} xm.h"
295 fi
296 rm -f tm.h
297 if [ "${targetfile}" != "" ]; then
298         if [ -f ${srcdir}/config/${targetfile} ]; then
299                 files="${files} config/${targetfile}"
300         else
301                 files="${files} config/${gdb_target_cpu}/${targetfile}"
302         fi
303         links="${links} tm.h"
304 fi
305 rm -f nm.h
306 if [ "${nativefile}" != "" ]; then
307         if [ -f ${srcdir}/config/${nativefile} ]; then
308                 files="${files} config/${nativefile}"
309         else
310                 files="${files} config/${gdb_host_cpu}/${nativefile}"
311         fi
312         links="${links} nm.h"
313 # temporary scaffolding until all hosts have the host/target/native
314 # split in place.
315 else
316         files="${files} config/nm-trash.h"
317         links="${links} nm.h"
318 fi
319
320 # post-target:
321
322 case ${srcdir} in
323   .)
324     ;;
325   *)
326     grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \
327       echo "source ${srcdir}/.gdbinit" >> .gdbinit
328 esac
329
330 if [ "${nativefile}" = "" ] ; then
331         sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
332                 < Makefile > Makefile.tem
333         mv -f Makefile.tem Makefile
334 fi
335
336 cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile