* config/powerpc/(cygwin32.mh, cygwin32.mt, tm-cygwin32.h,
[binutils-gdb.git] / 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
25 AC_PROG_CC
26 AC_AIX
27 AC_MINIX
28 AC_ISC_POSIX
29
30 AC_PROG_INSTALL
31 AC_PROG_RANLIB
32 AC_PROG_YACC
33
34 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
35 AC_CANONICAL_SYSTEM
36 AC_ARG_PROGRAM
37
38 AC_HEADER_STDC
39 AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h)
40 AC_HEADER_STAT
41
42 AC_MSG_CHECKING([for gregset_t type])
43 AC_CACHE_VAL(gdb_have_gregset_t,
44 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
45 gdb_have_gregset_t=yes, gdb_have_gregset_t=no)])
46 AC_MSG_RESULT($gdb_have_gregset_t)
47 if test $gdb_have_gregset_t = yes; then
48 AC_DEFINE(HAVE_GREGSET_T)
49 fi
50
51 AC_MSG_CHECKING([for fpregset_t type])
52 AC_CACHE_VAL(gdb_have_fpregset_t,
53 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
54 gdb_have_fpregset_t=yes, gdb_have_fpregset_t=no)])
55 AC_MSG_RESULT($gdb_have_fpregset_t)
56 if test $gdb_have_fpregset_t = yes; then
57 AC_DEFINE(HAVE_FPREGSET_T)
58 fi
59
60 AC_FUNC_MMAP
61
62 dnl Handle optional features that can be enabled.
63 ENABLE_CFLAGS=
64 ENABLE_CLIBS=
65 ENABLE_OBS=
66
67 AC_ARG_ENABLE(netrom,
68 [ --enable-netrom ],
69 [case "${enableval}" in
70 yes) enable_netrom=yes ;;
71 no) enable_netrom=no ;;
72 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
73 esac])
74
75 if test "${enable_netrom}" = "yes"; then
76 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
77 fi
78
79 # start-sanitize-gm
80 ENABLE_GM=
81
82 AC_ARG_ENABLE(gm,
83 [ --enable-gm ],
84 [case "${enableval}" in
85 yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
86 ENABLE_CFLAGS=-DGENERAL_MAGIC
87 ;;
88 no) ;;
89 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
90 esac])
91
92 # end-sanitize-gm
93
94 AC_ARG_ENABLE(sim-powerpc,
95 [ --enable-sim-powerpc ],
96 [case "${enableval}" in
97 yes) powerpc_sim=yes ;;
98 no) powerpc_sim=no ;;
99 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
100 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
101
102 # start-sanitize-gdbtk
103 ENABLE_GDBTK=
104
105 AC_ARG_ENABLE(gdbtk,
106 [ --enable-gdbtk ],
107 [case "${enableval}" in
108 yes)
109 case "$host" in
110 *go32*)
111 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
112 enable_gdbtk=no ;;
113 *)
114 enable_gdbtk=yes ;;
115 esac ;;
116 no)
117 enable_gdbtk=no ;;
118 *)
119 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
120 esac],
121 [
122 # Default is on for everything but go32
123 case "$host" in
124 *go32*)
125 ;;
126 *)
127 enable_gdbtk=yes ;;
128 esac
129 ])
130
131 if test "${enable_gdbtk}" = "yes"; then
132
133 AC_PATH_X
134 AC_PATH_XTRA
135
136 CY_AC_PATH_TCL
137 CY_AC_PATH_TK
138
139 # Look for dynamic linking libraries that Tcl might need. This is
140 # only done for Tcl 7.5 and greater. It would be good to look for and
141 # use the "configInfo" file that Tcl generates, but for now that is
142 # beyond us.
143 if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then
144 AC_CHECK_LIB(dl, main, , AC_CHECK_LIB(dld, main))
145 fi
146
147 ENABLE_GDBTK=1
148
149 if test "x$no_x" != "xyes"; then
150 if test "x$x_includes" != "x" ;
151 then
152 X_CFLAGS="-I$x_includes"
153 else
154 X_CFLAGS=""
155 fi
156
157 if test "x$x_libraries" != "x" ;
158 then
159 X_LDFLAGS="-L$x_libraries"
160 else
161 X_LDFLAGS=""
162 fi
163
164 case "$host" in
165 #
166 # gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
167 #
168 sparc*-sun-solaris2*)
169 if test "x$GCC" = "xyes";
170 then
171 X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw"
172 else
173 if test "x$x_libraries" != "x" ;
174 then
175 X_LDFLAGS="$X_LDFLAGS -R$x_libraries"
176 fi
177 X_LIBS="-lX11 -lXext -lX11"
178 fi ;;
179 #
180 # gdb linked statically w/ SunOS or HPUX
181 #
182 m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*)
183 if test "x$x_libraries" != "x" ;
184 then
185 X_LIBS="$x_libraries/libX11.a"
186 else
187 X_LIBS="/usr/lib/libX11.a"
188 fi ;;
189 #
190 # default is to link dynamically
191 #
192 *)
193 X_LIBS="-lX11" ;;
194 esac
195 else
196 X_LDLAGS=""
197 X_CFLAGS=""
198 X_LIBS=""
199 AC_MSG_WARN([No X based programs will be built])
200 fi
201
202 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
203 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm"
204 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
205 fi
206
207 AC_SUBST(ENABLE_GDBTK)
208 AC_SUBST(X_CFLAGS)
209 AC_SUBST(X_LDFLAGS)
210 AC_SUBST(X_LIBS)
211 # end-sanitize-gdbtk
212
213 AC_SUBST(ENABLE_CFLAGS)
214 AC_SUBST(ENABLE_CLIBS)
215 AC_SUBST(ENABLE_OBS)
216
217 # target_subdir is used by the testsuite to find the target libraries.
218 target_subdir=
219 if test "${host}" != "${target}"; then
220 target_subdir="${target_alias}/"
221 fi
222 AC_SUBST(target_subdir)
223
224 configdirs="doc testsuite"
225
226 dnl
227 changequote(,)dnl
228
229 # Map host cpu into the config cpu subdirectory name.
230 # The default is $host_cpu.
231
232 case "${host_cpu}" in
233
234 c[12]) gdb_host_cpu=convex ;;
235 hppa*) gdb_host_cpu=pa ;;
236 i[3456]86) gdb_host_cpu=i386 ;;
237 m68*) gdb_host_cpu=m68k ;;
238 m88*) gdb_host_cpu=m88k ;;
239 np1) gdb_host_cpu=gould ;;
240 pyramid) gdb_host_cpu=pyr ;;
241 powerpc*) gdb_host_cpu=powerpc ;;
242 sparc64) gdb_host_cpu=sparc ;;
243 *) gdb_host_cpu=$host_cpu ;;
244
245 esac
246
247 # map host info into gdb names.
248
249 case "${host}" in
250
251 a29k-*-*) gdb_host=ultra3 ;;
252
253 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
254 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
255 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
256
257 arm-*-*) gdb_host=arm ;;
258
259 c[12]-*-*) gdb_host=convex ;;
260
261 hppa*-*-bsd*) gdb_host=hppabsd ;;
262 hppa*-*-hiux*) gdb_host=hppahpux ;;
263 hppa*-*-hpux*) gdb_host=hppahpux ;;
264 hppa*-*-osf*) gdb_host=hppaosf ;;
265
266 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
267 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
268 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
269 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
270 i[3456]86-*-aix*) gdb_host=i386aix ;;
271 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
272 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
273 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
274 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
275 i[3456]86-*-go32*) gdb_host=go32 ;;
276 i[3456]86-*-linux*) gdb_host=linux ;;
277 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
278 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
279 i[3456]86-*-mach*) gdb_host=i386mach ;;
280 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
281 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
282 i[3456]86-*-sco*) gdb_host=i386sco ;;
283 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
284 i[3456]86-*-sunos*) gdb_host=sun386 ;;
285 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
286 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
287 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
288 i[3456]86-*-unixware) gdb_host=i386v4 ;;
289 i[3456]86-*-sysv*) gdb_host=i386v ;;
290 i[3456]86-*-isc*) gdb_host=i386v32 ;;
291 i[3456]86-*-os9k) gdb_host=i386os9k ;;
292 i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
293 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
294 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
295 m68030-sony-*) gdb_host=news1000 ;;
296
297 m68*-altos-*) gdb_host=altos ;;
298 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
299 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
300 m68*-att-*) gdb_host=3b1 ;;
301 m68*-bull*-sysv*) gdb_host=dpx2 ;;
302 m68*-hp-bsd*) gdb_host=hp300bsd ;;
303 m68*-hp-hpux*) gdb_host=hp300hpux ;;
304 m68*-isi-*) gdb_host=isi ;;
305 m68*-*-lynxos*) gdb_host=m68klynx ;;
306 m68*-*-sysv4*) gdb_host=m68kv4 ;;
307 m68*-motorola-*) gdb_host=delta68 ;;
308 m68*-sony-*) gdb_host=news ;;
309 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
310 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
311 m68*-sun-*) gdb_host=sun3os4 ;;
312
313 m88*-harris-cxux*) gdb_host=cxux ;;
314 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
315 m88*-motorola-sysv*) gdb_host=delta88 ;;
316 m88*-*-mach3*) gdb_host=mach3 ;;
317 m88*-*-*) gdb_host=m88k ;;
318
319 mips-dec-mach3*) gdb_host=mach3 ;;
320 mips-dec-*) gdb_host=decstation ;;
321 mips-little-*) gdb_host=littlemips ;;
322 mips-sgi-irix3*) gdb_host=irix3 ;;
323 mips-sgi-irix4*) gdb_host=irix4 ;;
324 mips-sgi-irix5*) gdb_host=irix5 ;;
325 mips-sony-*) gdb_host=news-mips ;;
326 mips-*-mach3*) gdb_host=mach3 ;;
327 mips-*-sysv4*) gdb_host=mipsv4 ;;
328 mips-*-sysv*) gdb_host=riscos ;;
329 mips-*-riscos*) gdb_host=riscos ;;
330
331 none-*-*) gdb_host=none ;;
332
333 np1-*-*) gdb_host=np1 ;;
334
335 ns32k-*-mach3*) gdb_host=mach3 ;;
336 ns32k-*-netbsd*) gdb_host=nbsd ;;
337 ns32k-umax-*) gdb_host=umax ;;
338 ns32k-utek-sysv*) gdb_host=merlin ;;
339
340 powerpc-*-aix*) gdb_host=aix ;;
341 powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
342 pn-*-*) gdb_host=pn ;;
343
344 pyramid-*-*) gdb_host=pyramid ;;
345
346 romp-*-*) gdb_host=rtbsd ;;
347
348 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
349 rs6000-*-aix4*) gdb_host=aix4 ;;
350 rs6000-*-*) gdb_host=rs6000 ;;
351
352 sparc-*-lynxos*) gdb_host=sparclynx ;;
353 sparc-*-netbsd*) gdb_host=nbsd ;;
354 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
355 sparc-*-sunos4*) gdb_host=sun4os4 ;;
356 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
357 sparc-*-*) gdb_host=sun4os4 ;;
358 sparc64-*-*) gdb_host=sun4sol2 ;;
359
360 tahoe-*-*) gdb_host=tahoe ;;
361
362 vax-*-bsd*) gdb_host=vaxbsd ;;
363 vax-*-ultrix2*) gdb_host=vaxult2 ;;
364 vax-*-ultrix*) gdb_host=vaxult ;;
365
366 w65-*-*) gdb_host=w65 ;;
367
368 esac
369
370
371 # Map target cpu into the config cpu subdirectory name.
372 # The default is $target_cpu.
373
374 case "${target_cpu}" in
375
376 alpha) gdb_target_cpu=alpha ;;
377 c[12]) gdb_target_cpu=convex ;;
378 hppa*) gdb_target_cpu=pa ;;
379 i[3456]86) gdb_target_cpu=i386 ;;
380 m68*) gdb_target_cpu=m68k ;;
381 m88*) gdb_target_cpu=m88k ;;
382 mips*) gdb_target_cpu=mips ;;
383 np1) gdb_target_cpu=gould ;;
384 powerpc*) gdb_target_cpu=powerpc ;;
385 pn) gdb_target_cpu=gould ;;
386 pyramid) gdb_target_cpu=pyr ;;
387 sparc*) gdb_target_cpu=sparc ;;
388 *) gdb_target_cpu=$target_cpu ;;
389
390 esac
391
392 # map target info into gdb names.
393
394 case "${target}" in
395
396 a29k-*-aout*) gdb_target=a29k ;;
397 a29k-*-coff*) gdb_target=a29k ;;
398 a29k-*-elf*) gdb_target=a29k ;;
399 a29k-*-ebmon*) gdb_target=a29k ;;
400 a29k-*-kern*) gdb_target=a29k-kern ;;
401 a29k-*-none*) gdb_target=a29k ;;
402 a29k-*-sym1*) gdb_target=ultra3 ;;
403 a29k-*-udi*) gdb_target=a29k-udi ;;
404 a29k-*-vxworks*) gdb_target=vx29k ;;
405
406 alpha-*-osf*) gdb_target=alpha-osf1 ;;
407
408 # start-sanitize-arc
409 arc-*-*) gdb_target=arc ;;
410 # end-sanitize-arc
411
412 arm-*-*) gdb_target=arm ;;
413
414 c1-*-*) gdb_target=convex ;;
415 c2-*-*) gdb_target=convex ;;
416
417 h8300-*-*) gdb_target=h8300 ;;
418 h8500-*-*) gdb_target=h8500 ;;
419
420 sh-*-*) gdb_target=sh ;;
421
422 # start-sanitize-r16
423 r16-*-*) gdb_target=r16 ;;
424 # end-sanitize-r16
425
426 hppa*-*-bsd*) gdb_target=hppabsd ;;
427 hppa*-*-pro*) gdb_target=hppapro ;;
428 hppa*-*-hpux*) gdb_target=hppahpux ;;
429 hppa*-*-hiux*) gdb_target=hppahpux ;;
430 hppa*-*-osf*) gdb_target=hppaosf ;;
431
432 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
433 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
434 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
435 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
436 i[3456]86-*-aout*) gdb_target=i386aout ;;
437 i[3456]86-*-coff*) gdb_target=i386v ;;
438 i[3456]86-*-elf*) gdb_target=i386v ;;
439 i[3456]86-*-aix*) gdb_target=i386aix ;;
440 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
441 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
442 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
443 i[3456]86-*-os9k) gdb_target=i386os9k ;;
444 i[3456]86-*-go32*) gdb_target=i386aout ;;
445 i[3456]86-*-lynxos*) gdb_target=i386lynx
446 configdirs="${configdirs} gdbserver" ;;
447 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
448 i[3456]86-*-sunos*) gdb_target=sun386 ;;
449 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
450 i[3456]86-*-sco*) gdb_target=i386v ;;
451 i[3456]86-*-sysv*) gdb_target=i386v ;;
452 i[3456]86-*-linux*) gdb_target=linux ;;
453 i[3456]86-*-isc*) gdb_target=i386v ;;
454 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
455 i[3456]86-*-mach*) gdb_target=i386mach ;;
456 i[3456]86-*-netware*) gdb_target=i386nw
457 configdirs="${configdirs} nlm" ;;
458 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
459 i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
460 i960-*-bout*) gdb_target=vxworks960 ;;
461 i960-*-coff*) gdb_target=nindy960 ;;
462 i960-*-elf*) gdb_target=nindy960 ;;
463
464 i960-*-nindy*) gdb_target=nindy960 ;;
465 i960-*-vxworks*) gdb_target=vxworks960 ;;
466
467 m68000-*-sunos3*) gdb_target=sun2os3 ;;
468 m68000-*-sunos4*) gdb_target=sun2os4 ;;
469
470 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
471 m68*-bull-sysv*) gdb_target=dpx2 ;;
472 m68*-hp-bsd*) gdb_target=hp300bsd ;;
473 m68*-hp-hpux*) gdb_target=hp300hpux ;;
474 m68*-altos-*) gdb_target=altos ;;
475 m68*-att-*) gdb_target=3b1 ;;
476 m68*-cisco*-*) gdb_target=cisco ;;
477 m68*-ericsson-*) gdb_target=es1800 ;;
478 m68*-isi-*) gdb_target=isi ;;
479 m68*-motorola-*) gdb_target=delta68 ;;
480 m68*-netx-*) gdb_target=vxworks68 ;;
481 m68*-sony-*) gdb_target=news ;;
482 m68*-tandem-*) gdb_target=st2000 ;;
483 m68*-rom68k-*) gdb_target=monitor ;;
484 m68*-*bug-*) gdb_target=monitor ;;
485 m68*-monitor-*) gdb_target=monitor ;;
486 m68*-est-*) gdb_target=monitor ;;
487 m68*-*-aout*) gdb_target=monitor ;;
488 m68*-*-coff*) gdb_target=monitor ;;
489 m68*-*-elf*) gdb_target=monitor ;;
490 m68*-*-lynxos*) gdb_target=m68klynx
491 configdirs="${configdirs} gdbserver" ;;
492 m68*-*-os68k*) gdb_target=os68k ;;
493 m68*-*-sunos3*) gdb_target=sun3os3 ;;
494 m68*-*-sunos4*) gdb_target=sun3os4 ;;
495 m68*-*-sysv4*) gdb_target=m68kv4 ;;
496 m68*-*-vxworks*) gdb_target=vxworks68 ;;
497
498 m88*-harris-cxux*) gdb_target=cxux ;;
499 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
500 m88*-*-mach3*) gdb_target=mach3 ;;
501 m88*-motorola-*) gdb_target=delta88 ;;
502 m88*-*-*) gdb_target=m88k ;;
503
504 mips64*-big-*) gdb_target=bigmips64 ;;
505 mips*-big-*) gdb_target=bigmips ;;
506 mips*-dec-mach3*) gdb_target=mach3 ;;
507 mips*-dec-*) gdb_target=decstation ;;
508 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
509 mips64*-*-ecoff*) gdb_target=embed64 ;;
510 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
511 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
512 mips64*el-*-elf*) gdb_target=embedl64 ;;
513 mips64*-*-elf*) gdb_target=embed64 ;;
514 mips*el-*-ecoff*) gdb_target=embedl ;;
515 mips*-*-ecoff*) gdb_target=embed ;;
516 # start-sanitize-gm
517 mips*-*-magic*) gdb_target=embed ;;
518 # end-sanitize-gm
519 mips*el-*-elf*) gdb_target=embedl ;;
520 mips*-*-elf*) gdb_target=embed ;;
521 mips*-little-*) gdb_target=littlemips ;;
522 mips*-sgi-irix5*) gdb_target=irix5 ;;
523 mips*-sgi-*) gdb_target=irix3 ;;
524 mips*-sony-*) gdb_target=bigmips ;;
525 mips*-*-mach3*) gdb_target=mach3 ;;
526 mips*-*-sysv4*) gdb_target=mipsv4 ;;
527 mips*-*-sysv*) gdb_target=bigmips ;;
528 mips*-*-riscos*) gdb_target=bigmips ;;
529
530 none-*-*) gdb_target=none ;;
531
532 np1-*-*) gdb_target=np1 ;;
533
534 ns32k-*-mach3*) gdb_target=mach3 ;;
535 ns32k-*-netbsd*) gdb_target=nbsd ;;
536 ns32k-utek-sysv*) gdb_target=merlin ;;
537 ns32k-utek-*) gdb_target=umax ;;
538
539 pn-*-*) gdb_target=pn ;;
540 powerpc-*-macos*) gdb_target=macos ;;
541 powerpc-*-netware*) gdb_target=ppc-nw
542 configdirs="${configdirs} nlm" ;;
543
544 powerpc-*-aix4*) gdb_target=aix4 ;;
545 powerpc-*-aix*) gdb_target=aix ;;
546 powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
547 powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
548 gdb_target=ppc-sim
549 else
550 gdb_target=ppc-eabi
551 fi ;;
552 powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then
553 gdb_target=ppcle-sim
554 else
555 gdb_target=ppcle-eabi
556 fi ;;
557
558 pyramid-*-*) gdb_target=pyramid ;;
559
560 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
561 rs6000-*-aix4*) gdb_target=aix4 ;;
562 rs6000-*-*) gdb_target=rs6000 ;;
563
564 sparc-*-aout*) gdb_target=sparc-em ;;
565 sparc-*-coff*) gdb_target=sparc-em ;;
566 sparc-*-elf*) gdb_target=sparc-em ;;
567 sparc-*-lynxos*) gdb_target=sparclynx
568 configdirs="${configdirs} gdbserver" ;;
569 sparc-*-netbsd*) gdb_target=nbsd ;;
570 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
571 sparc-*-sunos4*) gdb_target=sun4os4 ;;
572 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
573 sparc-*-vxworks*) gdb_target=vxsparc ;;
574 sparc-*-*) gdb_target=sun4os4 ;;
575 sparclite*-*-*) gdb_target=sparclite ;;
576 sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
577 sparc64-*-*) gdb_target=sp64 ;;
578
579 tahoe-*-*) gdb_target=tahoe ;;
580
581 vax-*-*) gdb_target=vax ;;
582
583 w65-*-*) gdb_target=w65 ;;
584
585 z8k-*-coff*) gdb_target=z8k ;;
586
587 esac
588
589 dnl
590 changequote([,])dnl
591
592 frags=
593 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
594 if test ! -f ${host_makefile_frag}; then
595 AC_MSG_ERROR("*** Gdb does not support host ${host}")
596 fi
597 frags="$frags $host_makefile_frag"
598
599 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
600 if test ! -f ${target_makefile_frag}; then
601 AC_MSG_ERROR("*** Gdb does not support target ${target}")
602 fi
603 frags="$frags $target_makefile_frag"
604
605 AC_SUBST_FILE(host_makefile_frag)
606 AC_SUBST_FILE(target_makefile_frag)
607 AC_SUBST(frags)
608
609 changequote(,)dnl
610 hostfile=`sed -n '
611 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
612 ' ${host_makefile_frag}`
613
614 targetfile=`sed -n '
615 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
616 ' ${target_makefile_frag}`
617
618 # these really aren't orthogonal true/false values of the same condition,
619 # but shells are slow enough that I like to reuse the test conditions
620 # whenever possible
621 if test "${target}" = "${host}"; then
622 nativefile=`sed -n '
623 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
624 ' ${host_makefile_frag}`
625 else
626 # GDBserver is only useful in a "native" enviroment
627 configdirs=`echo $configdirs | sed 's/gdbserver//'`
628 fi
629 changequote([,])
630
631 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
632 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
633 # corresponding links. But we have to remove the xm.h files and tm.h
634 # files anyway, e.g. when switching from "configure host" to
635 # "configure none".
636
637 files=
638 links=
639 rm -f xm.h
640 if test "${hostfile}" != ""; then
641 files="${files} config/${gdb_host_cpu}/${hostfile}"
642 links="${links} xm.h"
643 fi
644 rm -f tm.h
645 if test "${targetfile}" != ""; then
646 files="${files} config/${gdb_target_cpu}/${targetfile}"
647 links="${links} tm.h"
648 fi
649 rm -f nm.h
650 if test "${nativefile}" != ""; then
651 files="${files} config/${gdb_host_cpu}/${nativefile}"
652 links="${links} nm.h"
653 else
654 # A cross-only configuration.
655 files="${files} config/nm-empty.h"
656 links="${links} nm.h"
657 fi
658 # start-sanitize-gdbtk
659
660 # Make it possible to use the GUI without doing a full install
661 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
662 files="${files} gdbtk.tcl"
663 links="${links} gdbtk.tcl"
664 fi
665 # end-sanitize-gdbtk
666
667 AC_LINK_FILES($files, $links)
668
669 AC_CONFIG_SUBDIRS($configdirs)
670 AC_OUTPUT(Makefile,
671 [
672 dnl Autoconf doesn't provide a mechanism for modifying definitions
673 dnl provided by makefile fragments.
674 dnl
675 if test "${nativefile}" = ""; then
676 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
677 < Makefile > Makefile.tem
678 mv -f Makefile.tem Makefile
679 fi
680
681 changequote(,)dnl
682 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
683 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
684 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
685 mv -f Makefile.tmp Makefile
686 changequote([,])dnl
687
688 case ${srcdir} in
689 .)
690 ;;
691 *)
692 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
693 echo "source ${srcdir}/.gdbinit" >> .gdbinit
694 esac
695 ],
696 [
697 gdb_host_cpu=$gdb_host_cpu
698 gdb_target_cpu=$gdb_target_cpu
699 nativefile=$nativefile
700 ])
701
702 exit 0