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)
35 AC_CHECK_TOOL(RANLIB, ranlib, :)
39 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
43 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)
48 AC_CHECK_FUNCS(setpgid sbrk)
50 AC_MSG_CHECKING([for gregset_t type])
51 AC_CACHE_VAL(gdb_cv_have_gregset_t,
52 [AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
53 gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
54 AC_MSG_RESULT($gdb_cv_have_gregset_t)
55 if test $gdb_cv_have_gregset_t = yes; then
56 AC_DEFINE(HAVE_GREGSET_T)
59 AC_MSG_CHECKING([for fpregset_t type])
60 AC_CACHE_VAL(gdb_cv_have_fpregset_t,
61 [AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
62 gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
63 AC_MSG_RESULT($gdb_cv_have_fpregset_t)
64 if test $gdb_cv_have_fpregset_t = yes; then
65 AC_DEFINE(HAVE_FPREGSET_T)
68 dnl See if compiler supports "long long" type.
70 AC_MSG_CHECKING(for long long support in compiler)
71 AC_CACHE_VAL(gdb_cv_c_long_long,
74 switch (foo & 2) { case 0: return 1; }
76 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
77 AC_MSG_RESULT($gdb_cv_c_long_long)
78 if test $gdb_cv_c_long_long = yes; then
79 AC_DEFINE(CC_HAS_LONG_LONG)
82 dnl See if the compiler and runtime support printing long long
84 AC_MSG_CHECKING(for long long support in printf)
85 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
89 long long l = 0x12345;
90 sprintf (buf, "%llx", l);
91 return (strcmp ("12345", buf));
93 gdb_cv_printf_has_long_long=yes,
94 gdb_cv_printf_has_long_long=no,
95 gdb_cv_printf_has_long_long=no)])
96 if test $gdb_cv_printf_has_long_long = yes; then
97 AC_DEFINE(PRINTF_HAS_LONG_LONG)
99 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
101 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
102 dnl because autoconf complains about cross-compilation issues. However, this
103 dnl code uses the same variables as the macro for compatibility.
105 AC_MSG_CHECKING(for long double support in compiler)
106 AC_CACHE_VAL(ac_cv_c_long_double,
107 [AC_TRY_COMPILE(, [long double foo;],
108 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
109 AC_MSG_RESULT($ac_cv_c_long_double)
110 if test $ac_cv_c_long_double = yes; then
111 AC_DEFINE(HAVE_LONG_DOUBLE)
114 dnl See if the compiler and runtime support printing long doubles
116 AC_MSG_CHECKING(for long double support in printf)
117 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
121 long double f = 3.141592653;
122 sprintf (buf, "%Lg", f);
123 return (strncmp ("3.14159", buf, 7));
125 gdb_cv_printf_has_long_double=yes,
126 gdb_cv_printf_has_long_double=no,
127 gdb_cv_printf_has_long_double=no)])
128 if test $gdb_cv_printf_has_long_double = yes; then
129 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
131 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
135 BFD_NEED_DECLARATION(malloc)
136 BFD_NEED_DECLARATION(realloc)
137 BFD_NEED_DECLARATION(free)
139 dnl See if thread_db library is around for Solaris thread debugging. Note that
140 dnl we must explicitly test for version 1 of the library because version 0
141 dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
143 dnl Note that we only want this if we are both native (host == target), and
144 dnl not doing a canadian cross build (build == host).
146 if test ${build} = ${host} -a ${host} = ${target} ; then
147 AC_MSG_CHECKING(for Solaris thread debugging library)
148 if test -f /usr/lib/libthread_db.so.1 ; then
150 THREAD_DB_OBS=sol-thread.o
151 AC_DEFINE(HAVE_THREAD_DB_LIB)
152 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Xlinker -export-dynamic"
156 AC_SUBST(THREAD_DB_OBS)
157 AC_SUBST(CONFIG_LDFLAGS)
160 dnl Handle optional features that can be enabled.
165 AC_ARG_ENABLE(netrom,
167 [case "${enableval}" in
168 yes) enable_netrom=yes ;;
169 no) enable_netrom=no ;;
170 *) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
173 if test "${enable_netrom}" = "yes"; then
174 ENABLE_OBS="${ENABLE_OBS} remote-nrom.o"
182 [case "${enableval}" in
183 yes) ENABLE_OBS="${ENABLE_OBS} gmagic.o"
184 ENABLE_CFLAGS=-DGENERAL_MAGIC
187 *) AC_MSG_ERROR(bad value ${enableval} given for gm option) ;;
192 AC_ARG_ENABLE(sim-powerpc,
193 [ --enable-sim-powerpc ],
194 [case "${enableval}" in
195 yes) powerpc_sim=yes ;;
196 no) powerpc_sim=no ;;
197 *) AC_MSG_ERROR(bad value ${enableval} given for sim-powerpc option) ;;
198 esac],[if test x"$GCC" != x""; then powerpc_sim=yes; else powerpc_sim=no; fi])
200 # start-sanitize-gdbtk
205 [case "${enableval}" in
209 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
211 *cygwin32* | *windows*)
212 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
220 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
223 # Default is on for everything but go32 and cygwin32
225 *go32* | *cygwin32* | *windows*)
232 if test "${enable_gdbtk}" = "yes"; then
235 if test -z "${no_tcl}"; then
239 # If $no_tk is nonempty, then we can't do Tk, and there is no
240 # point to doing Tcl.
241 if test -z "${no_tk}"; then
246 # Include some libraries that Tcl and Tk want.
247 LIBS="$LIBS $TK_LIBS"
251 TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)'
252 ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS}"
253 ENABLE_OBS="${ENABLE_OBS} gdbtk.o"
258 AC_SUBST(ENABLE_GDBTK)
264 AC_SUBST(ENABLE_CFLAGS)
265 AC_SUBST(ENABLE_CLIBS)
268 # Begin stuff to support --enable-shared
269 AC_ARG_ENABLE(shared,
270 [ --enable-shared use shared libraries],
271 [case "${enableval}" in
279 # If we have shared libraries, try to set rpath reasonably.
280 if test "${shared}" = "true"; then
283 HLDFLAGS='-Wl,+s,+b,$(libdir)'
285 *-*-irix5* | *-*-irix6*)
286 HLDFLAGS='-Wl,-rpath,$(libdir)'
291 HLDFLAGS='-Wl,-rpath,$(libdir)'
294 HLDFLAGS='-R $(libdir)'
297 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
302 # On SunOS, if the linker supports the -rpath option, use it to
303 # prevent ../bfd and ../opcodes from being included in the run time
307 echo 'main () { }' > conftest.c
308 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
309 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
311 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
313 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
315 elif test "${shared}" = "true"; then
316 HLDFLAGS='-Wl,-rpath=$(libdir)'
318 HLDFLAGS='-Wl,-rpath='
320 rm -f conftest.t conftest.c conftest
325 # End stuff to support --enable-shared
327 # target_subdir is used by the testsuite to find the target libraries.
329 if test "${host}" != "${target}"; then
330 target_subdir="${target_alias}/"
332 AC_SUBST(target_subdir)
334 configdirs="doc testsuite"
339 # Map host cpu into the config cpu subdirectory name.
340 # The default is $host_cpu.
342 case "${host_cpu}" in
344 c[12]) gdb_host_cpu=convex ;;
345 hppa*) gdb_host_cpu=pa ;;
346 i[3456]86) gdb_host_cpu=i386 ;;
347 m68*) gdb_host_cpu=m68k ;;
348 m88*) gdb_host_cpu=m88k ;;
349 np1) gdb_host_cpu=gould ;;
350 pyramid) gdb_host_cpu=pyr ;;
351 powerpc*) gdb_host_cpu=powerpc ;;
352 sparc64) gdb_host_cpu=sparc ;;
353 *) gdb_host_cpu=$host_cpu ;;
357 # map host info into gdb names.
361 a29k-*-*) gdb_host=ultra3 ;;
363 alpha-*-osf1*) gdb_host=alpha-osf1 ;;
364 alpha-*-osf2*) gdb_host=alpha-osf2 ;;
365 alpha-*-osf[3456789]*) gdb_host=alpha-osf3 ;;
366 alpha-*-linux*) gdb_host=alpha-linux ;;
368 arm-*-*) gdb_host=arm ;;
370 c[12]-*-*) gdb_host=convex ;;
372 hppa*-*-bsd*) gdb_host=hppabsd ;;
373 hppa*-*-hiux*) gdb_host=hppahpux ;;
374 hppa*-*-hpux*) gdb_host=hppahpux ;;
375 hppa*-*-osf*) gdb_host=hppaosf ;;
377 i[3456]86-ncr-*) gdb_host=ncr3000 ;;
378 i[3456]86-sequent-bsd*) gdb_host=symmetry ;; # dynix
379 i[3456]86-sequent-sysv4*) gdb_host=ptx4 ;;
380 i[3456]86-sequent-sysv*) gdb_host=ptx ;;
381 i[3456]86-*-aix*) gdb_host=i386aix ;;
382 i[3456]86-*-bsd*) gdb_host=i386bsd ;;
383 i[3456]86-*-dgux*) gdb_host=i386dgux ;;
384 i[3456]86-*-freebsd*) gdb_host=fbsd ;;
385 i[3456]86-*-netbsd*) gdb_host=nbsd ;;
386 i[3456]86-*-go32*) gdb_host=go32 ;;
387 i[3456]86-*-linux*) gdb_host=linux ;;
388 i[3456]86-*-lynxos*) gdb_host=i386lynx ;;
389 i[3456]86-*-mach3*) gdb_host=i386m3 ;;
390 i[3456]86-*-mach*) gdb_host=i386mach ;;
391 i[3456]86-*-gnu*) gdb_host=i386gnu ;;
392 i[3456]86-*-osf1mk*) gdb_host=osf1mk ;;
393 i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
394 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
395 i[3456]86-*-sco*) gdb_host=i386sco ;;
396 i[3456]86-*-solaris*) gdb_host=i386sol2 ;;
397 i[3456]86-*-sunos*) gdb_host=sun386 ;;
398 i[3456]86-*-sysv3.2*) gdb_host=i386v32 ;;
399 i[3456]86-*-sysv32*) gdb_host=i386v32 ;;
400 i[3456]86-*-sysv4*) gdb_host=i386v4 ;;
401 i[3456]86-*-unixware) gdb_host=i386v4 ;;
402 i[3456]86-*-sysv*) gdb_host=i386v ;;
403 i[3456]86-*-isc*) gdb_host=i386v32 ;;
404 i[3456]86-*-os9k) gdb_host=i386os9k ;;
405 i[3456]86-*-cygwin32) gdb_host=cygwin32 ;;
406 i[3456]86-*-windows) gdb_host=windows
407 configdirs="${configdirs} mswin" ;;
408 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
409 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
410 m68030-sony-*) gdb_host=news1000 ;;
412 m68*-altos-*) gdb_host=altos ;;
413 m68*-apollo*-sysv*) gdb_host=apollo68v ;;
414 m68*-apollo*-bsd*) gdb_host=apollo68b ;;
415 m68*-att-*) gdb_host=3b1 ;;
416 m68*-bull*-sysv*) gdb_host=dpx2 ;;
417 m68*-hp-bsd*) gdb_host=hp300bsd ;;
418 m68*-hp-hpux*) gdb_host=hp300hpux ;;
419 m68*-isi-*) gdb_host=isi ;;
420 m68*-*-lynxos*) gdb_host=m68klynx ;;
421 m68*-*-netbsd*) gdb_host=nbsd ;;
422 m68*-*-sysv4*) gdb_host=m68kv4 ;;
423 m68*-motorola-*) gdb_host=delta68 ;;
424 m68*-sony-*) gdb_host=news ;;
425 m68*-sun-sunos3*) gdb_host=sun3os3 ;;
426 m68*-sun-sunos4*) gdb_host=sun3os4 ;;
427 m68*-sun-*) gdb_host=sun3os4 ;;
429 m88*-harris-cxux*) gdb_host=cxux ;;
430 m88*-motorola-sysv4*) gdb_host=delta88v4 ;;
431 m88*-motorola-sysv*) gdb_host=delta88 ;;
432 m88*-*-mach3*) gdb_host=mach3 ;;
433 m88*-*-*) gdb_host=m88k ;;
435 mips-dec-mach3*) gdb_host=mach3 ;;
436 mips-dec-*) gdb_host=decstation ;;
437 mips-little-*) gdb_host=littlemips ;;
438 mips-sgi-irix3*) gdb_host=irix3 ;;
439 mips-sgi-irix4*) gdb_host=irix4 ;;
440 mips-sgi-irix5*) gdb_host=irix5 ;;
441 mips-sony-*) gdb_host=news-mips ;;
442 mips-*-mach3*) gdb_host=mach3 ;;
443 mips-*-sysv4*) gdb_host=mipsv4 ;;
444 mips-*-sysv*) gdb_host=riscos ;;
445 mips-*-riscos*) gdb_host=riscos ;;
447 none-*-*) gdb_host=none ;;
449 np1-*-*) gdb_host=np1 ;;
451 ns32k-*-mach3*) gdb_host=mach3 ;;
452 ns32k-*-netbsd*) gdb_host=nbsd ;;
453 ns32k-umax-*) gdb_host=umax ;;
454 ns32k-utek-sysv*) gdb_host=merlin ;;
456 powerpc-*-aix*) gdb_host=aix ;;
457 powerpcle-*-cygwin32) gdb_host=cygwin32 ;;
458 powerpcle-*-solaris*) gdb_host=solaris ;;
459 powerpc-*-linux*) gdb_host=linux ;;
460 pn-*-*) gdb_host=pn ;;
462 pyramid-*-*) gdb_host=pyramid ;;
464 romp-*-*) gdb_host=rtbsd ;;
466 rs6000-*-lynxos*) gdb_host=rs6000lynx ;;
467 rs6000-*-aix4*) gdb_host=aix4 ;;
468 rs6000-*-*) gdb_host=rs6000 ;;
470 sparc-*-lynxos*) gdb_host=sparclynx ;;
471 sparc-*-netbsd*) gdb_host=nbsd ;;
472 sparc-*-solaris2*) gdb_host=sun4sol2 ;;
473 sparc-*-sunos4*) gdb_host=sun4os4 ;;
474 sparc-*-sunos5*) gdb_host=sun4sol2 ;;
475 sparc-*-*) gdb_host=sun4os4 ;;
476 sparc64-*-*) gdb_host=sun4sol2 ;;
478 tahoe-*-*) gdb_host=tahoe ;;
480 vax-*-bsd*) gdb_host=vaxbsd ;;
481 vax-*-ultrix2*) gdb_host=vaxult2 ;;
482 vax-*-ultrix*) gdb_host=vaxult ;;
484 w65-*-*) gdb_host=w65 ;;
489 # Map target cpu into the config cpu subdirectory name.
490 # The default is $target_cpu.
492 case "${target_cpu}" in
494 alpha) gdb_target_cpu=alpha ;;
495 c[12]) gdb_target_cpu=convex ;;
496 hppa*) gdb_target_cpu=pa ;;
497 i[3456]86) gdb_target_cpu=i386 ;;
498 m68*) gdb_target_cpu=m68k ;;
499 m88*) gdb_target_cpu=m88k ;;
500 mips*) gdb_target_cpu=mips ;;
501 np1) gdb_target_cpu=gould ;;
502 powerpc*) gdb_target_cpu=powerpc ;;
503 pn) gdb_target_cpu=gould ;;
504 pyramid) gdb_target_cpu=pyr ;;
505 sparc*) gdb_target_cpu=sparc ;;
506 *) gdb_target_cpu=$target_cpu ;;
510 # map target info into gdb names.
514 a29k-*-aout*) gdb_target=a29k ;;
515 a29k-*-coff*) gdb_target=a29k ;;
516 a29k-*-elf*) gdb_target=a29k ;;
517 a29k-*-ebmon*) gdb_target=a29k ;;
518 a29k-*-kern*) gdb_target=a29k-kern ;;
519 a29k-*-none*) gdb_target=a29k ;;
520 a29k-*-sym1*) gdb_target=ultra3 ;;
521 a29k-*-udi*) gdb_target=a29k-udi ;;
522 a29k-*-vxworks*) gdb_target=vx29k ;;
524 alpha-*-osf*) gdb_target=alpha-osf1 ;;
525 alpha-*-linux*) gdb_target=alpha-linux ;;
528 arc-*-*) gdb_target=arc ;;
531 arm-*-*) gdb_target=arm ;;
533 c1-*-*) gdb_target=convex ;;
534 c2-*-*) gdb_target=convex ;;
536 # start-sanitize-d10v
537 d10v-*-*) gdb_target=d10v ;;
540 h8300-*-*) gdb_target=h8300 ;;
541 h8500-*-*) gdb_target=h8500 ;;
543 sh-*-*) gdb_target=sh ;;
545 hppa*-*-bsd*) gdb_target=hppabsd ;;
546 hppa*-*-pro*) gdb_target=hppapro ;;
547 hppa*-*-hpux*) gdb_target=hppahpux ;;
548 hppa*-*-hiux*) gdb_target=hppahpux ;;
549 hppa*-*-osf*) gdb_target=hppaosf ;;
551 i[3456]86-sequent-bsd*) gdb_target=symmetry ;;
552 i[3456]86-sequent-sysv4*) gdb_target=ptx4 ;;
553 i[3456]86-sequent-sysv*) gdb_target=ptx ;;
554 i[3456]86-ncr-*) gdb_target=ncr3000 ;;
555 i[3456]86-*-aout*) gdb_target=i386aout ;;
556 i[3456]86-*-coff*) gdb_target=i386v ;;
557 i[3456]86-*-elf*) gdb_target=i386v ;;
558 i[3456]86-*-aix*) gdb_target=i386aix ;;
559 i[3456]86-*-bsd*) gdb_target=i386bsd ;;
560 i[3456]86-*-freebsd*) gdb_target=fbsd ;;
561 i[3456]86-*-netbsd*) gdb_target=nbsd ;;
562 i[3456]86-*-os9k) gdb_target=i386os9k ;;
563 i[3456]86-*-go32*) gdb_target=i386aout ;;
564 i[3456]86-*-lynxos*) gdb_target=i386lynx
565 configdirs="${configdirs} gdbserver" ;;
566 i[3456]86-*-solaris*) gdb_target=i386sol2 ;;
567 i[3456]86-*-sunos*) gdb_target=sun386 ;;
568 i[3456]86-*-sysv4*) gdb_target=i386v4 ;;
569 i[3456]86-*-sco*) gdb_target=i386v ;;
570 i[3456]86-*-sysv*) gdb_target=i386v ;;
571 i[3456]86-*-linux*) gdb_target=linux
572 configdirs="${configdirs} gdbserver" ;;
573 i[3456]86-*-isc*) gdb_target=i386v ;;
574 i[3456]86-*-mach3*) gdb_target=i386m3 ;;
575 i[3456]86-*-mach*) gdb_target=i386mach ;;
576 i[3456]86-*-gnu*) gdb_target=i386gnu ;;
577 i[3456]86-*-netware*) gdb_target=i386nw
578 configdirs="${configdirs} nlm" ;;
579 i[3456]86-*-osf1mk*) gdb_target=i386mk ;;
580 i[3456]86-*-cygwin32) gdb_target=cygwin32 ;;
581 i960-*-bout*) gdb_target=vxworks960 ;;
582 i960-nindy-coff*) gdb_target=nindy960 ;;
583 i960-*-coff*) gdb_target=mon960 ;;
584 i960-nindy-elf*) gdb_target=nindy960 ;;
585 i960-*-elf*) gdb_target=mon960 ;;
587 i960-*-nindy*) gdb_target=nindy960 ;;
588 i960-*-vxworks*) gdb_target=vxworks960 ;;
590 m68000-*-sunos3*) gdb_target=sun2os3 ;;
591 m68000-*-sunos4*) gdb_target=sun2os4 ;;
593 m68*-apollo*-bsd*) gdb_target=apollo68b ;;
594 m68*-bull-sysv*) gdb_target=dpx2 ;;
595 m68*-hp-bsd*) gdb_target=hp300bsd ;;
596 m68*-hp-hpux*) gdb_target=hp300hpux ;;
597 m68*-altos-*) gdb_target=altos ;;
598 m68*-att-*) gdb_target=3b1 ;;
599 m68*-cisco*-*) gdb_target=cisco ;;
600 m68*-ericsson-*) gdb_target=es1800 ;;
601 m68*-isi-*) gdb_target=isi ;;
602 m68*-motorola-*) gdb_target=delta68 ;;
603 m68*-netx-*) gdb_target=vxworks68 ;;
604 m68*-sony-*) gdb_target=news ;;
605 m68*-tandem-*) gdb_target=st2000 ;;
606 m68*-rom68k-*) gdb_target=monitor ;;
607 m68*-*bug-*) gdb_target=monitor ;;
608 m68*-monitor-*) gdb_target=monitor ;;
609 m68*-est-*) gdb_target=monitor ;;
610 m68*-*-aout*) gdb_target=monitor ;;
611 m68*-*-coff*) gdb_target=monitor ;;
612 m68*-*-elf*) gdb_target=monitor ;;
613 m68*-*-lynxos*) gdb_target=m68klynx
614 configdirs="${configdirs} gdbserver" ;;
615 m68*-*-netbsd*) gdb_target=nbsd ;;
616 m68*-*-os68k*) gdb_target=os68k ;;
617 m68*-*-sunos3*) gdb_target=sun3os3 ;;
618 m68*-*-sunos4*) gdb_target=sun3os4 ;;
619 m68*-*-sysv4*) gdb_target=m68kv4 ;;
620 m68*-*-vxworks*) gdb_target=vxworks68 ;;
622 m88*-harris-cxux*) gdb_target=cxux ;;
623 m88*-motorola-sysv4*) gdb_target=delta88v4 ;;
624 m88*-*-mach3*) gdb_target=mach3 ;;
625 m88*-motorola-*) gdb_target=delta88 ;;
626 m88*-*-*) gdb_target=m88k ;;
628 mips64*-big-*) gdb_target=bigmips64 ;;
629 mips*-big-*) gdb_target=bigmips ;;
630 mips*-dec-mach3*) gdb_target=mach3 ;;
631 mips*-dec-*) gdb_target=decstation ;;
632 mips64*el-*-ecoff*) gdb_target=embedl64 ;;
633 mips64*-*-ecoff*) gdb_target=embed64 ;;
634 mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;;
635 mips64*vr4300*-*-elf*) gdb_target=vr4300 ;;
636 mips64*vr4100*el-*-elf*) gdb_target=vr4300el ;;
637 mips64*vr4100*-*-elf*) gdb_target=vr4300 ;;
638 mips64*el-*-elf*) gdb_target=embedl64 ;;
639 mips64*-*-elf*) gdb_target=embed64 ;;
640 mips*el-*-ecoff*) gdb_target=embedl ;;
641 mips*-*-ecoff*) gdb_target=embed ;;
643 mips*-*-magic*) gdb_target=embed ;;
645 mips*el-*-elf*) gdb_target=embedl ;;
646 mips*-*-elf*) gdb_target=embed ;;
647 mips*-little-*) gdb_target=littlemips ;;
648 mips*-sgi-irix5*) gdb_target=irix5 ;;
649 mips*-sgi-*) gdb_target=irix3 ;;
650 mips*-sony-*) gdb_target=bigmips ;;
651 mips*-*-mach3*) gdb_target=mach3 ;;
652 mips*-*-sysv4*) gdb_target=mipsv4 ;;
653 mips*-*-sysv*) gdb_target=bigmips ;;
654 mips*-*-riscos*) gdb_target=bigmips ;;
655 mips*-*-vxworks*) gdb_target=vxmips ;;
657 none-*-*) gdb_target=none ;;
659 np1-*-*) gdb_target=np1 ;;
661 ns32k-*-mach3*) gdb_target=mach3 ;;
662 ns32k-*-netbsd*) gdb_target=nbsd ;;
663 ns32k-utek-sysv*) gdb_target=merlin ;;
664 ns32k-utek-*) gdb_target=umax ;;
666 pn-*-*) gdb_target=pn ;;
667 powerpc-*-macos*) gdb_target=macos ;;
668 powerpc-*-netware*) gdb_target=ppc-nw
669 configdirs="${configdirs} nlm" ;;
671 powerpc-*-aix4*) gdb_target=aix4 ;;
672 powerpc-*-aix*) gdb_target=aix ;;
673 powerpcle-*-cygwin32) gdb_target=cygwin32 ;;
674 powerpcle-*-solaris*) gdb_target=solaris ;;
675 powerpc-*-eabi* | powerpc-*-linux* | powerpc-*-sysv* | powerpc-*-elf*)
676 if test x"$powerpc_sim" = x"yes"; then
681 powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*)
682 if test x"$powerpc_sim" = x"yes"; then
685 gdb_target=ppcle-eabi
688 pyramid-*-*) gdb_target=pyramid ;;
690 rs6000-*-lynxos*) gdb_target=rs6000lynx ;;
691 rs6000-*-aix4*) gdb_target=aix4 ;;
692 rs6000-*-*) gdb_target=rs6000 ;;
694 sparc-*-aout*) gdb_target=sparc-em ;;
695 sparc-*-coff*) gdb_target=sparc-em ;;
696 sparc-*-elf*) gdb_target=sparc-em ;;
697 sparc-*-lynxos*) gdb_target=sparclynx
698 configdirs="${configdirs} gdbserver" ;;
699 sparc-*-netbsd*) gdb_target=nbsd ;;
700 sparc-*-solaris2*) gdb_target=sun4sol2 ;;
701 sparc-*-sunos4*) gdb_target=sun4os4 ;;
702 sparc-*-sunos5*) gdb_target=sun4sol2 ;;
703 sparc-*-vxworks*) gdb_target=vxsparc ;;
704 sparc-*-*) gdb_target=sun4os4 ;;
705 sparclet-*-*) gdb_target=sparclet;;
706 sparclite*-*-*) gdb_target=sparclite ;;
707 # It's not clear what the right solution for "v8plus" systems is yet.
708 # For now, stick with sparc-sun-solaris2 since that's what config.guess
709 # should return. Work is still needed to get gdb to print the 64 bit
710 # regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
711 # deleted though presumably it should be eventually.
712 #sparc64-*-solaris2*) gdb_target=sp64sol2 ;;
713 sparc64-*-*) gdb_target=sp64 ;;
715 tahoe-*-*) gdb_target=tahoe ;;
717 vax-*-*) gdb_target=vax ;;
719 w65-*-*) gdb_target=w65 ;;
721 z8k-*-coff*) gdb_target=z8k ;;
729 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
730 if test ! -f ${host_makefile_frag}; then
731 AC_MSG_ERROR("*** Gdb does not support host ${host}")
733 frags="$frags $host_makefile_frag"
735 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
736 if test ! -f ${target_makefile_frag}; then
737 AC_MSG_ERROR("*** Gdb does not support target ${target}")
739 frags="$frags $target_makefile_frag"
741 AC_SUBST_FILE(host_makefile_frag)
742 AC_SUBST_FILE(target_makefile_frag)
747 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
748 ' ${host_makefile_frag}`
751 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
752 ' ${target_makefile_frag}`
754 # these really aren't orthogonal true/false values of the same condition,
755 # but shells are slow enough that I like to reuse the test conditions
757 if test "${target}" = "${host}"; then
759 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
760 ' ${host_makefile_frag}`
762 # GDBserver is only useful in a "native" enviroment
763 configdirs=`echo $configdirs | sed 's/gdbserver//'`
767 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
768 # (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
769 # corresponding links. But we have to remove the xm.h files and tm.h
770 # files anyway, e.g. when switching from "configure host" to
776 if test "${hostfile}" != ""; then
777 files="${files} config/${gdb_host_cpu}/${hostfile}"
778 links="${links} xm.h"
781 if test "${targetfile}" != ""; then
782 files="${files} config/${gdb_target_cpu}/${targetfile}"
783 links="${links} tm.h"
786 if test "${nativefile}" != ""; then
787 files="${files} config/${gdb_host_cpu}/${nativefile}"
788 links="${links} nm.h"
790 # A cross-only configuration.
791 files="${files} config/nm-empty.h"
792 links="${links} nm.h"
794 # start-sanitize-gdbtk
796 # Make it possible to use the GUI without doing a full install
797 if test "${enable_gdbtk}" = "yes" -a ! -f gdbtk.tcl ; then
798 files="${files} gdbtk.tcl"
799 links="${links} gdbtk.tcl"
803 AC_LINK_FILES($files, $links)
805 AC_CONFIG_SUBDIRS($configdirs)
808 dnl Autoconf doesn't provide a mechanism for modifying definitions
809 dnl provided by makefile fragments.
811 if test "${nativefile}" = ""; then
812 sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
813 < Makefile > Makefile.tem
814 mv -f Makefile.tem Makefile
818 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
819 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
820 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
821 mv -f Makefile.tmp Makefile
828 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
829 echo "source ${srcdir}/.gdbinit" >> .gdbinit
832 case x$CONFIG_HEADERS in
838 gdb_host_cpu=$gdb_host_cpu
839 gdb_target_cpu=$gdb_target_cpu
840 nativefile=$nativefile