]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/gdb/gdb/configure.in
Import GDB in its full glory (all 25mb). We'll put it on a diet once it's
[FreeBSD/FreeBSD.git] / contrib / gdb / gdb / configure.in
1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996 Free Software Foundation, Inc.
3 dnl
4 dnl This file is part of GDB.
5 dnl 
6 dnl This program is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2 of the License, or
9 dnl (at your option) any later version.
10 dnl 
11 dnl This program is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl 
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with this program; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 dnl Process this file with autoconf to produce a configure script.
21
22 AC_PREREQ(2.3)dnl
23 AC_INIT(main.c)
24 AC_CONFIG_HEADER(config.h:config.in)
25
26 AC_PROG_CC
27 AC_AIX
28 AC_MINIX
29 AC_ISC_POSIX
30
31 AC_PROG_INSTALL
32 AC_CHECK_TOOL(AR, ar)
33 AC_CHECK_TOOL(RANLIB, ranlib, :)
34 AC_PROG_YACC
35 AC_PROG_AWK
36
37 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
38 AC_CANONICAL_SYSTEM
39 AC_ARG_PROGRAM
40
41 AC_HEADER_STDC
42 AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h)
43 AC_HEADER_STAT
44
45 AC_CHECK_FUNCS(setpgid sbrk)
46
47 AC_MSG_CHECKING([for gregset_t type])
48 AC_CACHE_VAL(gdb_cv_have_gregset_t,
49 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
50 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
51 AC_MSG_RESULT($gdb_cv_have_gregset_t)
52 if test $gdb_cv_have_gregset_t = yes; then
53   AC_DEFINE(HAVE_GREGSET_T)
54 fi
55
56 AC_MSG_CHECKING([for fpregset_t type])
57 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
58 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
59 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
60 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
61 if test $gdb_cv_have_fpregset_t = yes; then
62   AC_DEFINE(HAVE_FPREGSET_T)
63 fi
64
65 dnl See if compiler supports "long double" type.  Can't use AC_C_LONG_DOUBLE
66 dnl because autoconf complains about cross-compilation issues.  However, this
67 dnl code uses the same variables as the macro for compatibility.
68
69 AC_MSG_CHECKING(for long double support in compiler)
70 AC_CACHE_VAL(ac_cv_c_long_double,
71 [AC_TRY_COMPILE(, [long double foo;],
72 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
73 AC_MSG_RESULT($ac_cv_c_long_double)
74 if test $ac_cv_c_long_double = yes; then
75   AC_DEFINE(HAVE_LONG_DOUBLE)
76 fi
77
78 dnl See if the compiler and runtime support printing long doubles
79
80 AC_MSG_CHECKING(for long double support in printf)
81 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
82 [AC_TRY_RUN([
83 int main () {
84   char buf[16];
85   long double f = 3.141592653;
86   sprintf (buf, "%Lg", f);
87   return (strncmp ("3.14159", buf, 7));
88 }],
89 gdb_cv_printf_has_long_double=yes,
90 gdb_cv_printf_has_long_double=no,
91 gdb_cv_printf_has_long_double=no)])
92 if test $gdb_cv_printf_has_long_double = yes; then
93   AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
94 fi
95 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
96
97 AC_FUNC_MMAP
98
99 dnl Handle optional features that can be enabled.
100 ENABLE_CFLAGS=
101 ENABLE_CLIBS=
102 ENABLE_OBS=
103
104 AC_ARG_ENABLE(netrom,
105 [  --enable-netrom ],
106 [case "${enableval}" in
107 yes)    enable_netrom=yes ;;
108 no)     enable_netrom=no ;;
109 *)      AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
110 esac])
111
112 if test "${enable_netrom}" = "yes"; then
113         ENABLE_OBS="${ENABLE_OBS} remote-nrom.o" 
114 fi
115
116
117 AC_ARG_ENABLE(sim-powerpc,
118 [  --enable-sim-powerpc ],
119 [case "${enableval}" in
120 yes)    powerpc_sim=yes ;;
121 no)     powerpc_sim=no ;;
122 *)      AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
123 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
124
125
126 AC_SUBST(ENABLE_CFLAGS)
127 AC_SUBST(ENABLE_CLIBS)
128 AC_SUBST(ENABLE_OBS)
129
130 # target_subdir is used by the testsuite to find the target libraries.
131 target_subdir=
132 if test "${host}" != "${target}"; then
133     target_subdir="${target_alias}/"
134 fi
135 AC_SUBST(target_subdir)
136
137 configdirs="doc testsuite"
138
139 dnl
140 changequote(,)dnl
141
142 # Map host cpu into the config cpu subdirectory name.
143 # The default is $host_cpu.
144
145 case "${host_cpu}" in
146
147 c[12])                  gdb_host_cpu=convex ;;
148 hppa*)                  gdb_host_cpu=pa ;;
149 i[3456]86)              gdb_host_cpu=i386 ;;
150 m68*)                   gdb_host_cpu=m68k ;;
151 m88*)                   gdb_host_cpu=m88k ;;
152 np1)                    gdb_host_cpu=gould ;;
153 pyramid)                gdb_host_cpu=pyr ;;
154 powerpc*)               gdb_host_cpu=powerpc ;;
155 sparc64)                gdb_host_cpu=sparc ;;
156 *)                      gdb_host_cpu=$host_cpu ;;
157
158 esac
159
160 # map host info into gdb names.
161
162 case "${host}" in
163
164 a29k-*-*)               gdb_host=ultra3 ;;
165
166 alpha-*-osf1*)          gdb_host=alpha-osf1 ;;
167 alpha-*-osf2*)          gdb_host=alpha-osf2 ;;
168 alpha-*-osf[3456789]*)  gdb_host=alpha-osf3 ;;
169
170 arm-*-*)                gdb_host=arm ;;
171
172 c[12]-*-*)              gdb_host=convex ;;
173
174 hppa*-*-bsd*)           gdb_host=hppabsd ;;
175 hppa*-*-hiux*)          gdb_host=hppahpux ;;
176 hppa*-*-hpux*)          gdb_host=hppahpux ;;
177 hppa*-*-osf*)           gdb_host=hppaosf ;;
178
179 i[3456]86-ncr-*)        gdb_host=ncr3000 ;;
180 i[3456]86-sequent-bsd*) gdb_host=symmetry ;;  # dynix
181 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
182 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
183 i[3456]86-*-aix*)       gdb_host=i386aix ;;
184 i[3456]86-*-bsd*)       gdb_host=i386bsd ;;
185 i[3456]86-*-dgux*)      gdb_host=i386dgux ;;
186 i[3456]86-*-freebsd*)   gdb_host=fbsd ;;
187 i[3456]86-*-netbsd*)    gdb_host=nbsd ;;
188 i[3456]86-*-go32*)      gdb_host=go32 ;;
189 i[3456]86-*-linux*)     gdb_host=linux ;;
190 i[3456]86-*-lynxos*)    gdb_host=i386lynx ;;
191 i[3456]86-*-mach3*)     gdb_host=i386m3 ;;
192 i[3456]86-*-mach*)      gdb_host=i386mach ;;
193 i[3456]86-*-gnu*)       gdb_host=i386gnu ;;
194 i[3456]86-*-osf1mk*)    gdb_host=osf1mk ;;
195 i[3456]86-*-sco3.2v5*)  gdb_host=i386sco5 ;;
196 i[3456]86-*-sco3.2v4*)  gdb_host=i386sco4 ;;
197 i[3456]86-*-sco*)       gdb_host=i386sco ;;
198 i[3456]86-*-solaris*)   gdb_host=i386sol2 ;;
199 i[3456]86-*-sunos*)     gdb_host=sun386 ;;
200 i[3456]86-*-sysv3.2*)   gdb_host=i386v32 ;;
201 i[3456]86-*-sysv32*)    gdb_host=i386v32 ;;
202 i[3456]86-*-sysv4*)     gdb_host=i386v4 ;;
203 i[3456]86-*-unixware)   gdb_host=i386v4 ;;
204 i[3456]86-*-sysv*)      gdb_host=i386v ;;
205 i[3456]86-*-isc*)       gdb_host=i386v32 ;;
206 i[3456]86-*-os9k)       gdb_host=i386os9k ;;
207 i[3456]86-*-cygwin32)   gdb_host=cygwin32 ;;
208 m680[01]0-sun-sunos3*)  gdb_host=sun2os3 ;;
209 m680[01]0-sun-sunos4*)  gdb_host=sun2os4 ;;
210 m68030-sony-*)          gdb_host=news1000 ;;
211
212 m68*-altos-*)           gdb_host=altos ;;
213 m68*-apollo*-sysv*)     gdb_host=apollo68v ;;
214 m68*-apollo*-bsd*)      gdb_host=apollo68b ;;
215 m68*-att-*)             gdb_host=3b1 ;;
216 m68*-bull*-sysv*)       gdb_host=dpx2 ;;
217 m68*-hp-bsd*)           gdb_host=hp300bsd ;;
218 m68*-hp-hpux*)          gdb_host=hp300hpux ;;
219 m68*-isi-*)             gdb_host=isi ;;
220 m68*-*-lynxos*)         gdb_host=m68klynx ;;
221 m68*-*-netbsd*)         gdb_host=nbsd ;;
222 m68*-*-sysv4*)          gdb_host=m68kv4 ;;
223 m68*-motorola-*)        gdb_host=delta68 ;;
224 m68*-sony-*)            gdb_host=news ;;
225 m68*-sun-sunos3*)       gdb_host=sun3os3 ;;
226 m68*-sun-sunos4*)       gdb_host=sun3os4 ;;
227 m68*-sun-*)             gdb_host=sun3os4 ;;
228
229 m88*-harris-cxux*)      gdb_host=cxux ;;
230 m88*-motorola-sysv4*)   gdb_host=delta88v4 ;;
231 m88*-motorola-sysv*)    gdb_host=delta88 ;;
232 m88*-*-mach3*)          gdb_host=mach3 ;;
233 m88*-*-*)               gdb_host=m88k ;;
234
235 mips-dec-mach3*)        gdb_host=mach3 ;;
236 mips-dec-*)             gdb_host=decstation ;;
237 mips-little-*)          gdb_host=littlemips ;;
238 mips-sgi-irix3*)        gdb_host=irix3 ;;
239 mips-sgi-irix4*)        gdb_host=irix4 ;;
240 mips-sgi-irix5*)        gdb_host=irix5 ;;
241 mips-sony-*)            gdb_host=news-mips ;;
242 mips-*-mach3*)          gdb_host=mach3 ;;
243 mips-*-sysv4*)          gdb_host=mipsv4 ;;
244 mips-*-sysv*)           gdb_host=riscos ;;
245 mips-*-riscos*)         gdb_host=riscos ;;
246
247 none-*-*)               gdb_host=none ;;
248
249 np1-*-*)                gdb_host=np1 ;;
250
251 ns32k-*-mach3*)         gdb_host=mach3 ;;
252 ns32k-*-netbsd*)        gdb_host=nbsd ;;
253 ns32k-umax-*)           gdb_host=umax ;;
254 ns32k-utek-sysv*)       gdb_host=merlin ;;
255
256 powerpc-*-aix*)         gdb_host=aix ;;
257 powerpcle-*-cygwin32)   gdb_host=cygwin32 ;;
258 pn-*-*)                 gdb_host=pn ;;
259
260 pyramid-*-*)            gdb_host=pyramid ;;
261
262 romp-*-*)               gdb_host=rtbsd ;;
263
264 rs6000-*-lynxos*)       gdb_host=rs6000lynx ;;
265 rs6000-*-aix4*)         gdb_host=aix4 ;;
266 rs6000-*-*)             gdb_host=rs6000 ;;
267
268 sparc-*-lynxos*)        gdb_host=sparclynx ;;
269 sparc-*-netbsd*)        gdb_host=nbsd ;;
270 sparc-*-solaris2*)      gdb_host=sun4sol2 ;;
271 sparc-*-sunos4*)        gdb_host=sun4os4 ;;
272 sparc-*-sunos5*)        gdb_host=sun4sol2 ;;
273 sparc-*-*)              gdb_host=sun4os4 ;;
274 sparc64-*-*)            gdb_host=sun4sol2 ;;
275
276 tahoe-*-*)              gdb_host=tahoe ;;
277
278 vax-*-bsd*)             gdb_host=vaxbsd ;;
279 vax-*-ultrix2*)         gdb_host=vaxult2 ;;
280 vax-*-ultrix*)          gdb_host=vaxult ;;
281
282 w65-*-*)                gdb_host=w65 ;;
283
284 esac
285
286
287 # Map target cpu into the config cpu subdirectory name.
288 # The default is $target_cpu.
289
290 case "${target_cpu}" in
291
292 alpha)                  gdb_target_cpu=alpha ;;
293 c[12])                  gdb_target_cpu=convex ;;
294 hppa*)                  gdb_target_cpu=pa ;;
295 i[3456]86)              gdb_target_cpu=i386 ;;
296 m68*)                   gdb_target_cpu=m68k ;;
297 m88*)                   gdb_target_cpu=m88k ;;
298 mips*)                  gdb_target_cpu=mips ;;
299 np1)                    gdb_target_cpu=gould ;;
300 powerpc*)               gdb_target_cpu=powerpc ;;
301 pn)                     gdb_target_cpu=gould ;;
302 pyramid)                gdb_target_cpu=pyr ;;
303 sparc*)                 gdb_target_cpu=sparc ;;
304 *)                      gdb_target_cpu=$target_cpu ;;
305
306 esac
307
308 # map target info into gdb names.
309
310 case "${target}" in
311
312 a29k-*-aout*)           gdb_target=a29k ;;
313 a29k-*-coff*)           gdb_target=a29k ;;
314 a29k-*-elf*)            gdb_target=a29k ;;
315 a29k-*-ebmon*)          gdb_target=a29k ;;
316 a29k-*-kern*)           gdb_target=a29k-kern ;;
317 a29k-*-none*)           gdb_target=a29k ;;
318 a29k-*-sym1*)           gdb_target=ultra3 ;;
319 a29k-*-udi*)            gdb_target=a29k-udi ;;
320 a29k-*-vxworks*)        gdb_target=vx29k ;;
321
322 alpha-*-osf*)           gdb_target=alpha-osf1 ;;
323
324
325 arm-*-*)                gdb_target=arm ;;
326
327 c1-*-*)                 gdb_target=convex ;;
328 c2-*-*)                 gdb_target=convex ;;
329
330 h8300-*-*)              gdb_target=h8300 ;;
331 h8500-*-*)              gdb_target=h8500 ;;
332
333 sh-*-*)                 gdb_target=sh ;;
334
335
336 hppa*-*-bsd*)           gdb_target=hppabsd ;;
337 hppa*-*-pro*)           gdb_target=hppapro ;;
338 hppa*-*-hpux*)          gdb_target=hppahpux ;;
339 hppa*-*-hiux*)          gdb_target=hppahpux ;;
340 hppa*-*-osf*)           gdb_target=hppaosf ;;
341
342 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
343 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
344 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
345 i[3456]86-ncr-*)        gdb_target=ncr3000 ;;
346 i[3456]86-*-aout*)      gdb_target=i386aout ;;
347 i[3456]86-*-coff*)      gdb_target=i386v ;;
348 i[3456]86-*-elf*)       gdb_target=i386v ;;
349 i[3456]86-*-aix*)       gdb_target=i386aix ;;
350 i[3456]86-*-bsd*)       gdb_target=i386bsd ;;
351 i[3456]86-*-freebsd*)   gdb_target=fbsd ;;
352 i[3456]86-*-netbsd*)    gdb_target=nbsd ;;
353 i[3456]86-*-os9k)       gdb_target=i386os9k ;;
354 i[3456]86-*-go32*)      gdb_target=i386aout ;;
355 i[3456]86-*-lynxos*)    gdb_target=i386lynx
356                 configdirs="${configdirs} gdbserver" ;;
357 i[3456]86-*-solaris*)   gdb_target=i386sol2 ;;
358 i[3456]86-*-sunos*)     gdb_target=sun386 ;;
359 i[3456]86-*-sysv4*)     gdb_target=i386v4 ;;
360 i[3456]86-*-sco*)       gdb_target=i386v ;;
361 i[3456]86-*-sysv*)      gdb_target=i386v ;;
362 i[3456]86-*-linux*)     gdb_target=linux
363                 configdirs="${configdirs} gdbserver" ;;
364 i[3456]86-*-isc*)       gdb_target=i386v ;;
365 i[3456]86-*-mach3*)     gdb_target=i386m3 ;;
366 i[3456]86-*-mach*)      gdb_target=i386mach ;;
367 i[3456]86-*-gnu*)       gdb_target=i386gnu ;;
368 i[3456]86-*-netware*)   gdb_target=i386nw
369                 configdirs="${configdirs} nlm" ;;
370 i[3456]86-*-osf1mk*)    gdb_target=i386mk ;;
371 i[3456]86-*-cygwin32)   gdb_target=cygwin32  ;;
372 i960-*-bout*)           gdb_target=vxworks960 ;;
373 i960-nindy-coff*)       gdb_target=nindy960 ;;
374 i960-*-coff*)           gdb_target=mon960 ;;
375 i960-nindy-elf*)        gdb_target=nindy960 ;;
376 i960-*-elf*)            gdb_target=mon960 ;;
377
378 i960-*-nindy*)          gdb_target=nindy960 ;;
379 i960-*-vxworks*)        gdb_target=vxworks960 ;;
380
381 m68000-*-sunos3*)       gdb_target=sun2os3 ;;
382 m68000-*-sunos4*)       gdb_target=sun2os4 ;;
383
384 m68*-apollo*-bsd*)      gdb_target=apollo68b ;;
385 m68*-bull-sysv*)        gdb_target=dpx2 ;;
386 m68*-hp-bsd*)           gdb_target=hp300bsd ;;
387 m68*-hp-hpux*)          gdb_target=hp300hpux ;;
388 m68*-altos-*)           gdb_target=altos ;;
389 m68*-att-*)             gdb_target=3b1 ;;
390 m68*-cisco*-*)          gdb_target=cisco ;;
391 m68*-ericsson-*)        gdb_target=es1800 ;;
392 m68*-isi-*)             gdb_target=isi ;;
393 m68*-motorola-*)        gdb_target=delta68 ;;
394 m68*-netx-*)            gdb_target=vxworks68 ;;
395 m68*-sony-*)            gdb_target=news ;;
396 m68*-tandem-*)          gdb_target=st2000 ;;
397 m68*-rom68k-*)          gdb_target=monitor ;;
398 m68*-*bug-*)            gdb_target=monitor ;;
399 m68*-monitor-*)         gdb_target=monitor ;;
400 m68*-est-*)             gdb_target=monitor ;;
401 m68*-*-aout*)           gdb_target=monitor ;;
402 m68*-*-coff*)           gdb_target=monitor ;;
403 m68*-*-elf*)            gdb_target=monitor ;;
404 m68*-*-lynxos*)         gdb_target=m68klynx
405                 configdirs="${configdirs} gdbserver" ;;
406 m68*-*-netbsd*)         gdb_target=nbsd ;;
407 m68*-*-os68k*)          gdb_target=os68k ;;
408 m68*-*-sunos3*)         gdb_target=sun3os3 ;;
409 m68*-*-sunos4*)         gdb_target=sun3os4 ;;
410 m68*-*-sysv4*)          gdb_target=m68kv4 ;;
411 m68*-*-vxworks*)        gdb_target=vxworks68 ;;
412
413 m88*-harris-cxux*)      gdb_target=cxux ;;
414 m88*-motorola-sysv4*)   gdb_target=delta88v4 ;;
415 m88*-*-mach3*)          gdb_target=mach3 ;;
416 m88*-motorola-*)        gdb_target=delta88 ;;
417 m88*-*-*)               gdb_target=m88k ;;
418
419 mips64*-big-*)          gdb_target=bigmips64 ;;
420 mips*-big-*)            gdb_target=bigmips ;;
421 mips*-dec-mach3*)       gdb_target=mach3 ;;
422 mips*-dec-*)            gdb_target=decstation ;;
423 mips64*el-*-ecoff*)     gdb_target=embedl64 ;;
424 mips64*-*-ecoff*)       gdb_target=embed64 ;;
425 mips64*vr4300*el-*-elf*)        gdb_target=vr4300el ;;
426 mips64*vr4300*-*-elf*)  gdb_target=vr4300 ;;
427 mips64*el-*-elf*)       gdb_target=embedl64 ;;
428 mips64*-*-elf*)         gdb_target=embed64 ;;
429 mips*el-*-ecoff*)       gdb_target=embedl ;;
430 mips*-*-ecoff*)         gdb_target=embed ;;
431 mips*el-*-elf*)         gdb_target=embedl ;;
432 mips*-*-elf*)           gdb_target=embed ;;
433 mips*-little-*)         gdb_target=littlemips ;;
434 mips*-sgi-irix5*)       gdb_target=irix5 ;;
435 mips*-sgi-*)            gdb_target=irix3 ;;
436 mips*-sony-*)           gdb_target=bigmips ;;
437 mips*-*-mach3*)         gdb_target=mach3 ;;
438 mips*-*-sysv4*)         gdb_target=mipsv4 ;;
439 mips*-*-sysv*)          gdb_target=bigmips ;;
440 mips*-*-riscos*)        gdb_target=bigmips ;;
441 mips*-*-vxworks*)       gdb_target=vxmips ;;
442
443 none-*-*)               gdb_target=none ;;
444
445 np1-*-*)                gdb_target=np1 ;;
446
447 ns32k-*-mach3*)         gdb_target=mach3 ;;
448 ns32k-*-netbsd*)        gdb_target=nbsd ;;
449 ns32k-utek-sysv*)       gdb_target=merlin ;;
450 ns32k-utek-*)           gdb_target=umax ;;
451
452 pn-*-*)                 gdb_target=pn ;;
453 powerpc-*-macos*)       gdb_target=macos ;;
454 powerpc-*-netware*)     gdb_target=ppc-nw
455                         configdirs="${configdirs} nlm" ;;
456
457 powerpc-*-aix4*)        gdb_target=aix4 ;;
458 powerpc-*-aix*)         gdb_target=aix ;;
459 powerpcle-*-cygwin32)   gdb_target=cygwin32 ;;
460 powerpc-*-eabi*)        if test x"$powerpc_sim" = x"yes"; then
461                           gdb_target=ppc-sim
462                         else
463                           gdb_target=ppc-eabi
464                         fi ;;
465 powerpcle-*-eabi*)      if test x"$powerpc_sim" = x"yes"; then
466                           gdb_target=ppcle-sim
467                         else
468                           gdb_target=ppcle-eabi
469                         fi ;;
470
471 pyramid-*-*)            gdb_target=pyramid ;;
472
473 rs6000-*-lynxos*)       gdb_target=rs6000lynx ;;
474 rs6000-*-aix4*)         gdb_target=aix4 ;;
475 rs6000-*-*)             gdb_target=rs6000 ;;
476
477 sparc-*-aout*)          gdb_target=sparc-em ;;
478 sparc-*-coff*)          gdb_target=sparc-em ;;
479 sparc-*-elf*)           gdb_target=sparc-em ;;
480 sparc-*-lynxos*)        gdb_target=sparclynx
481                 configdirs="${configdirs} gdbserver" ;;
482 sparc-*-netbsd*)        gdb_target=nbsd ;;
483 sparc-*-solaris2*)      gdb_target=sun4sol2 ;;
484 sparc-*-sunos4*)        gdb_target=sun4os4 ;;
485 sparc-*-sunos5*)        gdb_target=sun4sol2 ;;
486 sparc-*-vxworks*)       gdb_target=vxsparc ;;
487 sparc-*-*)              gdb_target=sun4os4 ;;
488 # Use sparc-em for sparclet for now.
489 sparclet-*-*)           gdb_target=sparc-em ;;
490 sparclite*-*-*)         gdb_target=sparclite ;;
491 sparc64-*-solaris2*)    gdb_target=sp64sol2 ;;
492 sparc64-*-*)            gdb_target=sp64 ;;
493
494 tahoe-*-*)              gdb_target=tahoe ;;
495
496 vax-*-*)                gdb_target=vax ;;
497
498 w65-*-*)                gdb_target=w65 ;;
499
500 z8k-*-coff*)            gdb_target=z8k ;;
501
502 esac
503
504 dnl
505 changequote([,])dnl
506
507 frags=
508 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
509 if test ! -f ${host_makefile_frag}; then
510 AC_MSG_ERROR("*** Gdb does not support host ${host}")
511 fi
512 frags="$frags $host_makefile_frag"
513
514 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
515 if test ! -f ${target_makefile_frag}; then
516 AC_MSG_ERROR("*** Gdb does not support target ${target}")
517 fi
518 frags="$frags $target_makefile_frag"
519
520 AC_SUBST_FILE(host_makefile_frag)
521 AC_SUBST_FILE(target_makefile_frag)
522 AC_SUBST(frags)
523
524 changequote(,)dnl
525 hostfile=`sed -n '
526 s/XM_FILE[      ]*=[    ]*\([^  ]*\)/\1/p
527 ' ${host_makefile_frag}`
528
529 targetfile=`sed -n '
530 s/TM_FILE[      ]*=[    ]*\([^  ]*\)/\1/p
531 ' ${target_makefile_frag}`
532
533 # these really aren't orthogonal true/false values of the same condition,
534 # but shells are slow enough that I like to reuse the test conditions
535 # whenever possible
536 if test "${target}" = "${host}"; then
537 nativefile=`sed -n '
538 s/NAT_FILE[     ]*=[    ]*\([^  ]*\)/\1/p
539 ' ${host_makefile_frag}`
540 else
541 # GDBserver is only useful in a "native" enviroment
542 configdirs=`echo $configdirs | sed 's/gdbserver//'`
543 fi
544 changequote([,])
545
546 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
547 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
548 # corresponding links.  But we have to remove the xm.h files and tm.h
549 # files anyway, e.g. when switching from "configure host" to
550 # "configure none".
551
552 files=
553 links=
554 rm -f xm.h
555 if test "${hostfile}" != ""; then
556 files="${files} config/${gdb_host_cpu}/${hostfile}"
557 links="${links} xm.h"
558 fi
559 rm -f tm.h
560 if test "${targetfile}" != ""; then
561 files="${files} config/${gdb_target_cpu}/${targetfile}"
562 links="${links} tm.h"
563 fi
564 rm -f nm.h
565 if test "${nativefile}" != ""; then
566 files="${files} config/${gdb_host_cpu}/${nativefile}"
567 links="${links} nm.h"
568 else
569 # A cross-only configuration.
570 files="${files} config/nm-empty.h"
571 links="${links} nm.h"
572 fi
573
574 AC_LINK_FILES($files, $links)
575
576 AC_CONFIG_SUBDIRS($configdirs)
577 AC_OUTPUT(Makefile, 
578 [
579 dnl Autoconf doesn't provide a mechanism for modifying definitions 
580 dnl provided by makefile fragments.
581 dnl
582 if test "${nativefile}" = ""; then
583 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
584         < Makefile > Makefile.tem
585 mv -f Makefile.tem Makefile
586 fi
587
588 changequote(,)dnl
589 sed -e '/^TM_FILE[      ]*=/s,^TM_FILE[         ]*=[    ]*,&config/'"${gdb_target_cpu}"'/,
590 /^XM_FILE[      ]*=/s,^XM_FILE[         ]*=[    ]*,&config/'"${gdb_host_cpu}"'/,
591 /^NAT_FILE[     ]*=/s,^NAT_FILE[        ]*=[    ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
592 mv -f Makefile.tmp Makefile
593 changequote([,])dnl
594
595 case ${srcdir} in
596 .)
597 ;;
598 *)
599 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
600 echo "source ${srcdir}/.gdbinit" >> .gdbinit
601 esac
602
603 case x$CONFIG_HEADERS in
604 xconfig.h:config.in)
605 echo > stamp-h ;;
606 esac
607 ],
608 [
609 gdb_host_cpu=$gdb_host_cpu
610 gdb_target_cpu=$gdb_target_cpu
611 nativefile=$nativefile
612 ])
613
614 exit 0
615