1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996 Free Software Foundation, Inc.
4 dnl This file is part of GDB.
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.
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.
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.
20 dnl Process this file with autoconf to produce a configure script.
24 AC_CONFIG_HEADER(config.h:config.in)
33 AC_CHECK_TOOL(RANLIB, ranlib, :)
37 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
42 AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h stdlib.h sys/procfs.h link.h endian.h)
47 AC_CHECK_FUNCS(setpgid sbrk)
49 AC_MSG_CHECKING([for gregset_t type])
50 AC_CACHE_VAL(gdb_cv_have_gregset_t,
51 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
52 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
53 AC_MSG_RESULT($gdb_cv_have_gregset_t)
54 if test $gdb_cv_have_gregset_t = yes; then
55 AC_DEFINE(HAVE_GREGSET_T)
58 AC_MSG_CHECKING([for fpregset_t type])
59 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
60 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
61 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
62 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
63 if test $gdb_cv_have_fpregset_t = yes; then
64 AC_DEFINE(HAVE_FPREGSET_T)
67 dnl See if compiler supports "long long" type.
69 AC_MSG_CHECKING(for long long support in compiler)
70 AC_CACHE_VAL(gdb_cv_c_long_long,
75 switch (foo & 2) { case 0: return; }
77 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
78 AC_MSG_RESULT($gdb_cv_c_long_long)
79 if test $gdb_cv_c_long_long = yes; then
80 AC_DEFINE(CC_HAS_LONG_LONG)
83 dnl See if the compiler and runtime support printing long long
85 AC_MSG_CHECKING(for long long support in printf)
86 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
90 long long l = 0x12345;
91 sprintf (buf, "%llx", l);
92 return (strcmp ("12345", buf));
94 gdb_cv_printf_has_long_long=yes,
95 gdb_cv_printf_has_long_long=no,
96 gdb_cv_printf_has_long_long=no)])
97 if test $gdb_cv_printf_has_long_long = yes; then
98 AC_DEFINE(PRINTF_HAS_LONG_LONG)
100 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
102 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
103 dnl because autoconf complains about cross-compilation issues. However, this
104 dnl code uses the same variables as the macro for compatibility.
106 AC_MSG_CHECKING(for long double support in compiler)
107 AC_CACHE_VAL(ac_cv_c_long_double,
108 [AC_TRY_COMPILE(, [long double foo;],
109 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
110 AC_MSG_RESULT($ac_cv_c_long_double)
111 if test $ac_cv_c_long_double = yes; then
112 AC_DEFINE(HAVE_LONG_DOUBLE)
115 dnl See if the compiler and runtime support printing long doubles
117 AC_MSG_CHECKING(for long double support in printf)
118 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
122 long double f = 3.141592653;
123 sprintf (buf, "%Lg", f);
124 return (strncmp ("3.14159", buf, 7));
126 gdb_cv_printf_has_long_double=yes,
127 gdb_cv_printf_has_long_double=no,
128 gdb_cv_printf_has_long_double=no)])
129 if test $gdb_cv_printf_has_long_double = yes; then
130 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
132 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
136 BFD_NEED_DECLARATION(malloc)
137 BFD_NEED_DECLARATION(realloc)
138 BFD_NEED_DECLARATION(free)
140 dnl See if thread_db library is around for Solaris thread debugging. Note that
141 dnl we must explicitly test for version 1 of the library because version 0
142 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
144 dnl Note that we only want this if we are both native (host == target), and
145 dnl not doing a canadian cross build (build == host).
147 if test ${build} = ${host} -a ${host} = ${target} ; then
148 AC_MSG_CHECKING(for Solaris thread debugging library)
149 if test -f /usr/lib/libthread_db.so.1 ; then
151 THREAD_DB_OBS=sol-thread.o
152 AC_DEFINE(HAVE_THREAD_DB_LIB)
153 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Xlinker -export-dynamic"
157 AC_SUBST(THREAD_DB_OBS)
158 AC_SUBST(CONFIG_LDFLAGS)
161 dnl Handle optional features that can be enabled.
166 AC_ARG_ENABLE(netrom,
168 [case "${enableval}" in
169 yes) enable_netrom=yes ;;
170 no) enable_netrom=no ;;
171 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
174 if test "${enable_netrom}" = "yes"; then
175 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
183 [case "${enableval}" in
184 yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
185 ENABLE_CFLAGS=-DGENERAL_MAGIC
188 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
193 AC_ARG_ENABLE(sim-powerpc,
194 [ --enable-sim-powerpc ],
195 [case "${enableval}" in
196 yes) powerpc_sim=yes ;;
197 no) powerpc_sim=no ;;
198 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
199 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
201 # start-sanitize-gdbtk
206 [case "${enableval}" in
210 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
213 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
221 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
224 # Default is on for everything but go32 and cygwin32
235 if test "${enable_gdbtk}" = "yes"; then
241 # If $no_tk is nonempty, then we can't do Tk, and there is no
242 # point to doing Tcl.
243 if test -z "${no_tk}"; then
248 # Include some libraries that Tcl and Tk want.
249 LIBS="$LIBS $TK_LIBS"
253 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
254 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS}"
255 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
259 AC_SUBST(ENABLE_GDBTK)
265 AC_SUBST(ENABLE_CFLAGS)
266 AC_SUBST(ENABLE_CLIBS)
269 # target_subdir is used by the testsuite to find the target libraries.
271 if test "${host}" != "${target}"; then
272 target_subdir="${target_alias}/"
274 AC_SUBST(target_subdir)
276 configdirs="doc testsuite"
281 # Map host cpu into the config cpu subdirectory name.
282 # The default is $host_cpu.
284 case "${host_cpu}" in
286 c[12]) gdb_host_cpu=convex ;;
287 hppa*) gdb_host_cpu=pa ;;
288 i[3456]86) gdb_host_cpu=i386 ;;
289 m68*) gdb_host_cpu=m68k ;;
290 m88*) gdb_host_cpu=m88k ;;
291 np1) gdb_host_cpu=gould ;;
292 pyramid) gdb_host_cpu=pyr ;;
293 powerpc*) gdb_host_cpu=powerpc ;;
294 sparc64) gdb_host_cpu=sparc ;;
295 *) gdb_host_cpu=$host_cpu ;;
299 # map host info into gdb names.
303 a29k-*-*) gdb_host=ultra3 ;;
305 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
306 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
307 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
308 alpha-*-linux*) gdb_host=alpha-linux ;;
310 arm-*-*) gdb_host=arm ;;
312 c[12]-*-*) gdb_host=convex ;;
314 hppa*-*-bsd*) gdb_host=hppabsd ;;
315 hppa*-*-hiux*) gdb_host=hppahpux ;;
316 hppa*-*-hpux*) gdb_host=hppahpux ;;
317 hppa*-*-osf*) gdb_host=hppaosf ;;
319 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
320 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
321 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
322 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
323 i[3456]86-*-aix*) gdb_host=i386aix ;;
324 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
325 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
326 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
327 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
328 i[3456]86-*-go32*) gdb_host=go32 ;;
329 i[3456]86-*-linux*) gdb_host=linux ;;
330 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
331 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
332 i[3456]86-*-mach*) gdb_host=i386mach ;;
333 i[3456]86-*-gnu*) gdb_host=i386gnu ;;
334 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
335 i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
336 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
337 i[3456]86-*-sco*) gdb_host=i386sco ;;
338 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
339 i[3456]86-*-sunos*) gdb_host=sun386 ;;
340 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
341 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
342 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
343 i[3456]86-*-unixware) gdb_host=i386v4 ;;
344 i[3456]86-*-sysv*) gdb_host=i386v ;;
345 i[3456]86-*-isc*) gdb_host=i386v32 ;;
346 i[3456]86-*-os9k) gdb_host=i386os9k ;;
347 i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
348 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
349 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
350 m68030-sony-*) gdb_host=news1000 ;;
352 m68*-altos-*) gdb_host=altos ;;
353 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
354 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
355 m68*-att-*) gdb_host=3b1 ;;
356 m68*-bull*-sysv*) gdb_host=dpx2 ;;
357 m68*-hp-bsd*) gdb_host=hp300bsd ;;
358 m68*-hp-hpux*) gdb_host=hp300hpux ;;
359 m68*-isi-*) gdb_host=isi ;;
360 m68*-*-lynxos*) gdb_host=m68klynx ;;
361 m68*-*-netbsd*) gdb_host=nbsd ;;
362 m68*-*-sysv4*) gdb_host=m68kv4 ;;
363 m68*-motorola-*) gdb_host=delta68 ;;
364 m68*-sony-*) gdb_host=news ;;
365 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
366 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
367 m68*-sun-*) gdb_host=sun3os4 ;;
369 m88*-harris-cxux*) gdb_host=cxux ;;
370 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
371 m88*-motorola-sysv*) gdb_host=delta88 ;;
372 m88*-*-mach3*) gdb_host=mach3 ;;
373 m88*-*-*) gdb_host=m88k ;;
375 mips-dec-mach3*) gdb_host=mach3 ;;
376 mips-dec-*) gdb_host=decstation ;;
377 mips-little-*) gdb_host=littlemips ;;
378 mips-sgi-irix3*) gdb_host=irix3 ;;
379 mips-sgi-irix4*) gdb_host=irix4 ;;
380 mips-sgi-irix5*) gdb_host=irix5 ;;
381 mips-sony-*) gdb_host=news-mips ;;
382 mips-*-mach3*) gdb_host=mach3 ;;
383 mips-*-sysv4*) gdb_host=mipsv4 ;;
384 mips-*-sysv*) gdb_host=riscos ;;
385 mips-*-riscos*) gdb_host=riscos ;;
387 none-*-*) gdb_host=none ;;
389 np1-*-*) gdb_host=np1 ;;
391 ns32k-*-mach3*) gdb_host=mach3 ;;
392 ns32k-*-netbsd*) gdb_host=nbsd ;;
393 ns32k-umax-*) gdb_host=umax ;;
394 ns32k-utek-sysv*) gdb_host=merlin ;;
396 powerpc-*-aix*) gdb_host=aix ;;
397 powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
398 powerpcle-*-solaris*) gdb_host=solaris ;;
399 powerpc-*-linux*) gdb_host=linux ;;
400 pn-*-*) gdb_host=pn ;;
402 pyramid-*-*) gdb_host=pyramid ;;
404 romp-*-*) gdb_host=rtbsd ;;
406 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
407 rs6000-*-aix4*) gdb_host=aix4 ;;
408 rs6000-*-*) gdb_host=rs6000 ;;
410 sparc-*-lynxos*) gdb_host=sparclynx ;;
411 sparc-*-netbsd*) gdb_host=nbsd ;;
412 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
413 sparc-*-sunos4*) gdb_host=sun4os4 ;;
414 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
415 sparc-*-*) gdb_host=sun4os4 ;;
416 sparc64-*-*) gdb_host=sun4sol2 ;;
418 tahoe-*-*) gdb_host=tahoe ;;
420 vax-*-bsd*) gdb_host=vaxbsd ;;
421 vax-*-ultrix2*) gdb_host=vaxult2 ;;
422 vax-*-ultrix*) gdb_host=vaxult ;;
424 w65-*-*) gdb_host=w65 ;;
429 # Map target cpu into the config cpu subdirectory name.
430 # The default is $target_cpu.
432 case "${target_cpu}" in
434 alpha) gdb_target_cpu=alpha ;;
435 c[12]) gdb_target_cpu=convex ;;
436 hppa*) gdb_target_cpu=pa ;;
437 i[3456]86) gdb_target_cpu=i386 ;;
438 m68*) gdb_target_cpu=m68k ;;
439 m88*) gdb_target_cpu=m88k ;;
440 mips*) gdb_target_cpu=mips ;;
441 np1) gdb_target_cpu=gould ;;
442 powerpc*) gdb_target_cpu=powerpc ;;
443 pn) gdb_target_cpu=gould ;;
444 pyramid) gdb_target_cpu=pyr ;;
445 sparc*) gdb_target_cpu=sparc ;;
446 *) gdb_target_cpu=$target_cpu ;;
450 # map target info into gdb names.
454 a29k-*-aout*) gdb_target=a29k ;;
455 a29k-*-coff*) gdb_target=a29k ;;
456 a29k-*-elf*) gdb_target=a29k ;;
457 a29k-*-ebmon*) gdb_target=a29k ;;
458 a29k-*-kern*) gdb_target=a29k-kern ;;
459 a29k-*-none*) gdb_target=a29k ;;
460 a29k-*-sym1*) gdb_target=ultra3 ;;
461 a29k-*-udi*) gdb_target=a29k-udi ;;
462 a29k-*-vxworks*) gdb_target=vx29k ;;
464 alpha-*-osf*) gdb_target=alpha-osf1 ;;
465 alpha-*-linux*) gdb_target=alpha-linux ;;
468 arc-*-*) gdb_target=arc ;;
471 arm-*-*) gdb_target=arm ;;
473 c1-*-*) gdb_target=convex ;;
474 c2-*-*) gdb_target=convex ;;
476 h8300-*-*) gdb_target=h8300 ;;
477 h8500-*-*) gdb_target=h8500 ;;
479 sh-*-*) gdb_target=sh ;;
481 hppa*-*-bsd*) gdb_target=hppabsd ;;
482 hppa*-*-pro*) gdb_target=hppapro ;;
483 hppa*-*-hpux*) gdb_target=hppahpux ;;
484 hppa*-*-hiux*) gdb_target=hppahpux ;;
485 hppa*-*-osf*) gdb_target=hppaosf ;;
487 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
488 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
489 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
490 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
491 i[3456]86-*-aout*) gdb_target=i386aout ;;
492 i[3456]86-*-coff*) gdb_target=i386v ;;
493 i[3456]86-*-elf*) gdb_target=i386v ;;
494 i[3456]86-*-aix*) gdb_target=i386aix ;;
495 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
496 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
497 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
498 i[3456]86-*-os9k) gdb_target=i386os9k ;;
499 i[3456]86-*-go32*) gdb_target=i386aout ;;
500 i[3456]86-*-lynxos*) gdb_target=i386lynx
501 configdirs="${configdirs} gdbserver" ;;
502 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
503 i[3456]86-*-sunos*) gdb_target=sun386 ;;
504 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
505 i[3456]86-*-sco*) gdb_target=i386v ;;
506 i[3456]86-*-sysv*) gdb_target=i386v ;;
507 i[3456]86-*-linux*) gdb_target=linux
508 configdirs="${configdirs} gdbserver" ;;
509 i[3456]86-*-isc*) gdb_target=i386v ;;
510 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
511 i[3456]86-*-mach*) gdb_target=i386mach ;;
512 i[3456]86-*-gnu*) gdb_target=i386gnu ;;
513 i[3456]86-*-netware*) gdb_target=i386nw
514 configdirs="${configdirs} nlm" ;;
515 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
516 i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
517 i960-*-bout*) gdb_target=vxworks960 ;;
518 i960-nindy-coff*) gdb_target=nindy960 ;;
519 i960-*-coff*) gdb_target=mon960 ;;
520 i960-nindy-elf*) gdb_target=nindy960 ;;
521 i960-*-elf*) gdb_target=mon960 ;;
523 i960-*-nindy*) gdb_target=nindy960 ;;
524 i960-*-vxworks*) gdb_target=vxworks960 ;;
526 m68000-*-sunos3*) gdb_target=sun2os3 ;;
527 m68000-*-sunos4*) gdb_target=sun2os4 ;;
529 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
530 m68*-bull-sysv*) gdb_target=dpx2 ;;
531 m68*-hp-bsd*) gdb_target=hp300bsd ;;
532 m68*-hp-hpux*) gdb_target=hp300hpux ;;
533 m68*-altos-*) gdb_target=altos ;;
534 m68*-att-*) gdb_target=3b1 ;;
535 m68*-cisco*-*) gdb_target=cisco ;;
536 m68*-ericsson-*) gdb_target=es1800 ;;
537 m68*-isi-*) gdb_target=isi ;;
538 m68*-motorola-*) gdb_target=delta68 ;;
539 m68*-netx-*) gdb_target=vxworks68 ;;
540 m68*-sony-*) gdb_target=news ;;
541 m68*-tandem-*) gdb_target=st2000 ;;
542 m68*-rom68k-*) gdb_target=monitor ;;
543 m68*-*bug-*) gdb_target=monitor ;;
544 m68*-monitor-*) gdb_target=monitor ;;
545 m68*-est-*) gdb_target=monitor ;;
546 m68*-*-aout*) gdb_target=monitor ;;
547 m68*-*-coff*) gdb_target=monitor ;;
548 m68*-*-elf*) gdb_target=monitor ;;
549 m68*-*-lynxos*) gdb_target=m68klynx
550 configdirs="${configdirs} gdbserver" ;;
551 m68*-*-netbsd*) gdb_target=nbsd ;;
552 m68*-*-os68k*) gdb_target=os68k ;;
553 m68*-*-sunos3*) gdb_target=sun3os3 ;;
554 m68*-*-sunos4*) gdb_target=sun3os4 ;;
555 m68*-*-sysv4*) gdb_target=m68kv4 ;;
556 m68*-*-vxworks*) gdb_target=vxworks68 ;;
558 m88*-harris-cxux*) gdb_target=cxux ;;
559 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
560 m88*-*-mach3*) gdb_target=mach3 ;;
561 m88*-motorola-*) gdb_target=delta88 ;;
562 m88*-*-*) gdb_target=m88k ;;
564 mips64*-big-*) gdb_target=bigmips64 ;;
565 mips*-big-*) gdb_target=bigmips ;;
566 mips*-dec-mach3*) gdb_target=mach3 ;;
567 mips*-dec-*) gdb_target=decstation ;;
568 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
569 mips64*-*-ecoff*) gdb_target=embed64 ;;
570 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
571 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
572 mips64*vr4100*el-*-elf*) gdb_target=vr4300el ;;
573 mips64*vr4100*-*-elf*) gdb_target=vr4300 ;;
574 mips64*el-*-elf*) gdb_target=embedl64 ;;
575 mips64*-*-elf*) gdb_target=embed64 ;;
576 mips*el-*-ecoff*) gdb_target=embedl ;;
577 mips*-*-ecoff*) gdb_target=embed ;;
579 mips*-*-magic*) gdb_target=embed ;;
581 mips*el-*-elf*) gdb_target=embedl ;;
582 mips*-*-elf*) gdb_target=embed ;;
583 mips*-little-*) gdb_target=littlemips ;;
584 mips*-sgi-irix5*) gdb_target=irix5 ;;
585 mips*-sgi-*) gdb_target=irix3 ;;
586 mips*-sony-*) gdb_target=bigmips ;;
587 mips*-*-mach3*) gdb_target=mach3 ;;
588 mips*-*-sysv4*) gdb_target=mipsv4 ;;
589 mips*-*-sysv*) gdb_target=bigmips ;;
590 mips*-*-riscos*) gdb_target=bigmips ;;
591 mips*-*-vxworks*) gdb_target=vxmips ;;
593 none-*-*) gdb_target=none ;;
595 np1-*-*) gdb_target=np1 ;;
597 ns32k-*-mach3*) gdb_target=mach3 ;;
598 ns32k-*-netbsd*) gdb_target=nbsd ;;
599 ns32k-utek-sysv*) gdb_target=merlin ;;
600 ns32k-utek-*) gdb_target=umax ;;
602 pn-*-*) gdb_target=pn ;;
603 powerpc-*-macos*) gdb_target=macos ;;
604 powerpc-*-netware*) gdb_target=ppc-nw
605 configdirs="${configdirs} nlm" ;;
607 powerpc-*-aix4*) gdb_target=aix4 ;;
608 powerpc-*-aix*) gdb_target=aix ;;
609 powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
610 powerpcle-*-solaris*) gdb_target=solaris ;;
611 powerpc-*-eabi* | powerpc-*-linux* | powerpc-*-sysv* | powerpc-*-elf*)
612 if test x"$powerpc_sim" = x"yes"; then
617 powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*)
618 if test x"$powerpc_sim" = x"yes"; then
621 gdb_target=ppcle-eabi
624 pyramid-*-*) gdb_target=pyramid ;;
626 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
627 rs6000-*-aix4*) gdb_target=aix4 ;;
628 rs6000-*-*) gdb_target=rs6000 ;;
630 sparc-*-aout*) gdb_target=sparc-em ;;
631 sparc-*-coff*) gdb_target=sparc-em ;;
632 sparc-*-elf*) gdb_target=sparc-em ;;
633 sparc-*-lynxos*) gdb_target=sparclynx
634 configdirs="${configdirs} gdbserver" ;;
635 sparc-*-netbsd*) gdb_target=nbsd ;;
636 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
637 sparc-*-sunos4*) gdb_target=sun4os4 ;;
638 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
639 sparc-*-vxworks*) gdb_target=vxsparc ;;
640 sparc-*-*) gdb_target=sun4os4 ;;
641 sparclet-*-*) gdb_target=sparclet;;
642 sparclite*-*-*) gdb_target=sparclite ;;
643 # It's not clear what the right solution for "v8plus" systems is yet.
644 # For now, stick with sparc-sun-solaris2 since that's what config.guess
645 # should return. Work is still needed to get gdb to print the 64 bit
646 # regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
647 # deleted though presumably it should be eventually.
648 #sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
649 sparc64-*-*) gdb_target=sp64 ;;
651 tahoe-*-*) gdb_target=tahoe ;;
653 vax-*-*) gdb_target=vax ;;
655 w65-*-*) gdb_target=w65 ;;
657 z8k-*-coff*) gdb_target=z8k ;;
665 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
666 if test ! -f ${host_makefile_frag}; then
667 AC_MSG_ERROR("*** Gdb does not support host ${host}")
669 frags="$frags $host_makefile_frag"
671 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
672 if test ! -f ${target_makefile_frag}; then
673 AC_MSG_ERROR("*** Gdb does not support target ${target}")
675 frags="$frags $target_makefile_frag"
677 AC_SUBST_FILE(host_makefile_frag)
678 AC_SUBST_FILE(target_makefile_frag)
683 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
684 ' ${host_makefile_frag}`
687 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
688 ' ${target_makefile_frag}`
690 # these really aren't orthogonal true/false values of the same condition,
691 # but shells are slow enough that I like to reuse the test conditions
693 if test "${target}" = "${host}"; then
695 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
696 ' ${host_makefile_frag}`
698 # GDBserver is only useful in a "native" enviroment
699 configdirs=`echo $configdirs | sed 's/gdbserver//'`
703 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
704 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
705 # corresponding links. But we have to remove the xm.h files and tm.h
706 # files anyway, e.g. when switching from "configure host" to
712 if test "${hostfile}" != ""; then
713 files="${files} config/${gdb_host_cpu}/${hostfile}"
714 links="${links} xm.h"
717 if test "${targetfile}" != ""; then
718 files="${files} config/${gdb_target_cpu}/${targetfile}"
719 links="${links} tm.h"
722 if test "${nativefile}" != ""; then
723 files="${files} config/${gdb_host_cpu}/${nativefile}"
724 links="${links} nm.h"
726 # A cross-only configuration.
727 files="${files} config/nm-empty.h"
728 links="${links} nm.h"
730 # start-sanitize-gdbtk
732 # Make it possible to use the GUI without doing a full install
733 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
734 files="${files} gdbtk.tcl"
735 links="${links} gdbtk.tcl"
739 AC_LINK_FILES($files, $links)
741 AC_CONFIG_SUBDIRS($configdirs)
744 dnl Autoconf doesn't provide a mechanism for modifying definitions
745 dnl provided by makefile fragments.
747 if test "${nativefile}" = ""; then
748 sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \
749 < Makefile > Makefile.tem
750 mv -f Makefile.tem Makefile
754 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
755 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
756 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
757 mv -f Makefile.tmp Makefile
764 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
765 echo "source ${srcdir}/.gdbinit" >> .gdbinit
768 case x$CONFIG_HEADERS in
774 gdb_host_cpu=$gdb_host_cpu
775 gdb_target_cpu=$gdb_target_cpu
776 nativefile=$nativefile