1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
3 dnl Free Software Foundation, Inc.
5 dnl This file is part of GDB.
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2 of the License, or
10 dnl (at your option) any later version.
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 dnl Process this file with autoconf to produce a configure script.
25 AC_CONFIG_HEADER(config.h:config.in)
33 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
36 # FIXME: kettenis/20030102: The AC_PROG_RANLIB from Autoconf 2.13
37 # doesn't support cross-compilation, but the one from Autoconf 2.5x
38 # does. Override RANLIB here (i.e. before running AC_PROG_RANLIB) to
39 # deal with the lossage. Note that CY_GNU_GETTEXT currently calls
40 # AC_PROG_RANLIB. This can be removed when we switch to # Autoconf
42 AC_CHECK_TOOL(RANLIB, ranlib, :)
44 dnl Set up for gettext. PACKAGE is used when we call bindtextdomain.
47 AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
50 dnl List of object files added by configure.
63 AC_CONFIG_SUBDIRS(doc testsuite)
66 . $srcdir/configure.host
68 . $srcdir/configure.tgt
70 # Fetch the default architecture and default target vector from BFD.
71 targ=$target; . $srcdir/../bfd/config.bfd
73 # We only want the first architecture, so strip off the others if
74 # there is more than one.
75 targ_archs=`echo $targ_archs | sed 's/ .*//'`
77 if test "x$targ_archs" != x; then
78 AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, $targ_archs,
79 [Define to BFD's default architecture. ])
81 if test "x$targ_defvec" != x; then
82 AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, $targ_defvec,
83 [Define to BFD's default target vector. ])
88 # The CLI cannot be disabled yet, but may be in the future.
92 [ --disable-gdbcli disable command-line interface (CLI)],
97 AC_MSG_ERROR([the command-line interface cannot be disabled yet]) ;;
99 AC_MSG_ERROR([bad value $enableval for --enable-gdbcli]) ;;
102 if test x"$enable_gdbcli" = xyes; then
103 if test -d $srcdir/cli; then
104 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
105 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
106 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
107 CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_CLI_INITS)"
108 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
109 CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_CLI_ALL)"
110 CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_CLI_CLEAN)"
111 CONFIG_INSTALL="$CONFIG_INSTALL \$(SUBDIR_CLI_INSTALL)"
112 CONFIG_UNINSTALL="$CONFIG_UNINSTALL \$(SUBDIR_CLI_UNINSTALL)"
118 [ --disable-gdbmi disable machine-interface (MI)],
123 AC_MSG_ERROR([bad value $enableval for --enable-gdbmi]) ;;
126 if test x"$enable_gdbmi" = xyes; then
127 if test -d $srcdir/mi; then
128 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
129 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
130 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
131 CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_MI_INITS)"
132 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
133 CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_MI_ALL)"
134 CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_MI_CLEAN)"
135 CONFIG_INSTALL="$CONFIG_INSTALL \$(SUBDIR_MI_INSTALL)"
136 CONFIG_UNINSTALL="$CONFIG_UNINSTALL \$(SUBDIR_MI_UNINSTALL)"
142 [ --enable-tui enable full-screen terminal user interface (TUI)],
147 AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
149 if test x"$enable_tui" = xyes; then
150 if test -d $srcdir/tui; then
151 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
152 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
153 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
154 CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
155 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
156 CONFIG_ALL="$CONFIG_ALL \$(SUBDIR_TUI_ALL)"
157 CONFIG_CLEAN="$CONFIG_CLEAN \$(SUBDIR_TUI_CLEAN)"
158 CONFIG_INSTALL="$CONFIG_INSTALL \$(SUBDIR_TUI_INSTALL)"
159 CONFIG_UNINSTALL="$CONFIG_UNINSTALL \$(SUBDIR_TUI_UNINSTALL)"
164 # --------------------- #
165 # Checks for programs. #
166 # --------------------- #
174 AC_CHECK_TOOL(AR, ar)
175 AC_CHECK_TOOL(DLLTOOL, dlltool)
176 AC_CHECK_TOOL(WINDRES, windres)
178 # Needed for GNU/Hurd.
179 AC_CHECK_TOOL(MIG, mig)
181 # ---------------------- #
182 # Checks for libraries. #
183 # ---------------------- #
185 # We might need to link with -lm; most simulators need it.
186 AC_CHECK_LIB(m, main)
188 # We need to link with -lw to get `wctype' on Solaris before Solaris
189 # 2.6. Solaris 2.6 and beyond have this function in libc, and have a
190 # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
191 # is known to have this problem). Therefore we avoid libw if we can.
192 AC_CHECK_FUNC(wctype, [],
193 [AC_CHECK_LIB(w, wctype)])
195 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
196 AC_SEARCH_LIBS(socketpair, socket)
198 # Since GDB uses Readline, we need termcap functionality, so we need
199 # to find a library that provides that. When GDB is configured with
200 # --enable-tui, we need full curses functionality.
202 # FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
203 # Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
204 # Makefile fragments. That's why we need to have `Hcurses' before
205 # `curses'. I don't see why we should use HP curses if a more
206 # standard curses is available, except that according to HP's
207 # documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
208 # HP-UX 10.10 and 10.20.
210 if test "$need_curses" = yes; then
211 AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
212 [AC_MSG_ERROR([no curses library found])])
217 if test -d $srcdir/libtermcap; then
218 LIBS="../libtermcap/libtermcap.a $LIBS"
219 ac_cv_search_tgetent="../libtermcap/libtermcap.a"
222 # ??? Is this really true?
223 ac_cv_search_tgetent="none required"
226 # Readline prefers curses over termcap on AIX.
228 AC_SEARCH_LIBS(tgetent, [tinfo ncurses curses termcap])
232 # Note: We used to check for libtermlib and libterminfo too, but
233 # Readline doesn't, so I think we're safe with leaving them out.
234 AC_SEARCH_LIBS(tgetent, [termcap tinfo ncurses Hcurses curses])
236 if test "$ac_cv_search_tgetent" = no; then
237 AC_MSG_ERROR([no termcap library found])
240 # ------------------------- #
241 # Checks for header files. #
242 # ------------------------- #
247 AC_CHECK_HEADERS(link.h)
248 AC_CHECK_HEADERS(nlist.h)
249 AC_CHECK_HEADERS(poll.h sys/poll.h)
250 AC_CHECK_HEADERS(proc_service.h thread_db.h)
251 AC_CHECK_HEADERS(stddef.h)
252 AC_CHECK_HEADERS(stdlib.h)
253 AC_CHECK_HEADERS(stdint.h)
254 AC_CHECK_HEADERS(string.h memory.h strings.h)
255 AC_CHECK_HEADERS(sys/fault.h)
256 AC_CHECK_HEADERS(sys/file.h)
257 AC_CHECK_HEADERS(sys/filio.h)
258 AC_CHECK_HEADERS(sys/ioctl.h)
259 AC_CHECK_HEADERS(sys/param.h)
260 AC_CHECK_HEADERS(sys/proc.h)
261 AC_CHECK_HEADERS(sys/procfs.h)
262 AC_CHECK_HEADERS(sys/ptrace.h ptrace.h)
263 AC_CHECK_HEADERS(sys/reg.h sys/debugreg.h)
264 AC_CHECK_HEADERS(sys/select.h)
265 AC_CHECK_HEADERS(sys/syscall.h)
266 AC_CHECK_HEADERS(sys/user.h)
267 AC_CHECK_HEADERS(sys/wait.h wait.h)
268 AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
269 AC_CHECK_HEADERS(unistd.h)
271 # On Solaris 2.[78], we need to define _MSE_INT_H to avoid a clash
272 # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
273 # think that we don't have <curses.h> if we're using GCC.
276 if test "$GCC" = yes; then
277 AC_DEFINE(_MSE_INT_H, 1,
278 [[Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
279 Solaris 2.[78] when using GCC. ]])
282 AC_CHECK_HEADERS(curses.h ncurses.h term.h)
284 # FIXME: kettenis/20030102: In most cases we include these
285 # unconditionally, so what's the point in checking these?
286 AC_CHECK_HEADERS(ctype.h time.h)
288 # ------------------ #
289 # Checks for types. #
290 # ------------------ #
294 # ------------------------------------- #
295 # Checks for compiler characteristics. #
296 # ------------------------------------- #
301 # ------------------------------ #
302 # Checks for library functions. #
303 # ------------------------------ #
308 AC_CHECK_FUNCS(canonicalize_file_name realpath)
311 AC_CHECK_FUNCS(setpgid setpgrp)
312 AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
313 AC_CHECK_FUNCS(socketpair)
315 dnl AC_FUNC_SETPGRP does not work when cross compiling
316 dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
317 if test "$cross_compiling" = no; then
320 AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
324 if (setpgrp(1,1) == -1)
328 ], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
329 if test $ac_cv_func_setpgrp_void = yes; then
330 AC_DEFINE(SETPGRP_VOID, 1)
334 # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
335 # since sigsetjmp might only be defined as a macro.
336 AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
339 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
340 gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
341 if test $gdb_cv_func_sigsetjmp = yes; then
342 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
345 # Assume we'll default to using the included libiberty regex.
346 gdb_use_included_regex=yes
348 # However, if the system regex is GNU regex, then default to *not*
349 # using the included regex.
352 [gdb_cv_have_gnu_regex],
354 [#include <gnu-versions.h>],
355 [#define REGEX_INTERFACE_VERSION 1
356 #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
357 # error "Version mismatch"
359 gdb_cv_have_gnu_regex=yes,
360 gdb_cv_have_gnu_regex=no)])
361 if test $gdb_cv_have_gnu_regex = yes; then
362 gdb_use_included_regex=no
365 AC_ARG_WITH(included-regex,
366 [ --without-included-regex don't use included regex; this is the default
367 on systems with version 2 of the GNU C library
368 (use with caution on other system)],
369 gdb_with_regex=$withval,
370 gdb_with_regex=$gdb_use_included_regex)
371 if test "$gdb_with_regex" = yes; then
372 AC_DEFINE(USE_INCLUDED_REGEX, 1,
373 [Define to 1 if the regex included in libiberty should be used.])
376 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
377 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
378 AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs,
379 [AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;],
380 gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)])
381 if test $gdb_cv_struct_reg_r_fs = yes; then
382 AC_DEFINE(HAVE_STRUCT_REG_R_FS)
384 AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs,
385 [AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;],
386 gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)])
387 if test $gdb_cv_struct_reg_r_gs = yes; then
388 AC_DEFINE(HAVE_STRUCT_REG_R_GS)
391 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
392 AC_MSG_CHECKING(for PTRACE_GETREGS)
393 AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
394 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
396 [gdb_cv_have_ptrace_getregs=yes],
397 [gdb_cv_have_ptrace_getregs=no])])
398 AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
399 if test $gdb_cv_have_ptrace_getregs = yes; then
400 AC_DEFINE(HAVE_PTRACE_GETREGS)
403 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
404 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
405 AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
406 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
407 [PTRACE_GETFPXREGS;],
408 [gdb_cv_have_ptrace_getfpxregs=yes],
409 [gdb_cv_have_ptrace_getfpxregs=no])])
410 AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
411 if test $gdb_cv_have_ptrace_getfpxregs = yes; then
412 AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
415 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
416 AC_MSG_CHECKING(for PT_GETDBREGS)
417 AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
418 [AC_TRY_COMPILE([#include <sys/types.h>
419 #include <sys/ptrace.h>],
421 [gdb_cv_have_pt_getdbregs=yes],
422 [gdb_cv_have_pt_getdbregs=no])])
423 AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
424 if test $gdb_cv_have_pt_getdbregs = yes; then
425 AC_DEFINE(HAVE_PT_GETDBREGS)
428 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
429 AC_MSG_CHECKING(for PT_GETXMMREGS)
430 AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
431 [AC_TRY_COMPILE([#include <sys/types.h>
432 #include <sys/ptrace.h>],
434 [gdb_cv_have_pt_getxmmregs=yes],
435 [gdb_cv_have_pt_getxmmregs=no])])
436 AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
437 if test $gdb_cv_have_pt_getxmmregs = yes; then
438 AC_DEFINE(HAVE_PT_GETXMMREGS)
442 BFD_NEED_DECLARATION(malloc)
443 BFD_NEED_DECLARATION(realloc)
444 BFD_NEED_DECLARATION(free)
445 BFD_NEED_DECLARATION(strerror)
446 BFD_NEED_DECLARATION(strdup)
447 BFD_NEED_DECLARATION(strstr)
448 BFD_NEED_DECLARATION(canonicalize_file_name)
450 # The following save_state_t checkery is only necessary for HPUX
451 # versions earlier than 10.20. When those fade from memory, this
452 # could be expunged. --jsm 1999-03-22
454 AC_MSG_CHECKING(for HPUX save_state structure)
455 AC_EGREP_HEADER(save_state_t, machine/save_state.h,
456 gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
457 AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
458 gdb_cv_hpux_sswide=no)
459 if test $gdb_cv_hpux_savestate = yes
461 AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
463 if test $gdb_cv_hpux_sswide = yes
465 AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
467 AC_MSG_RESULT($gdb_cv_hpux_sswide)
470 # If we are configured native on GNU/Linux, work around problems with
472 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
474 if test "${target}" = "${host}"; then
476 i[[3456]]86-*-linux*)
477 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
478 AC_DEFINE(sys_quotactl)
481 AC_DEFINE(NEW_PROC_API)
483 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
484 AC_DEFINE(NEW_PROC_API)
486 *-*-solaris2.[[678]])
487 AC_DEFINE(NEW_PROC_API)
492 if test "$ac_cv_header_sys_procfs_h" = yes; then
493 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
494 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
495 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
496 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
497 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
498 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
499 BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t)
500 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t)
501 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
502 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
503 BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t)
504 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t)
505 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t)
506 BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t)
509 dnl Check for broken prfpregset_t type
511 dnl For Linux/i386, glibc 2.1.3 was released with a bogus
512 dnl prfpregset_t type (it's a typedef for the pointer to a struct
513 dnl instead of the struct itself). We detect this here, and work
514 dnl around it in gdb_proc_service.h.
516 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
517 AC_MSG_CHECKING(whether prfpregset_t type is broken)
518 AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
519 [AC_TRY_RUN([#include <sys/procfs.h>
522 if (sizeof (prfpregset_t) == sizeof (void *))
526 gdb_cv_prfpregset_t_broken=no,
527 gdb_cv_prfpregset_t_broken=yes,
528 gdb_cv_prfpregset_t_broken=yes)])
529 AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
530 if test $gdb_cv_prfpregset_t_broken = yes; then
531 AC_DEFINE(PRFPREGSET_T_BROKEN)
535 dnl Check for PIOCSET ioctl entry
537 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
538 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
539 [AC_TRY_COMPILE([#include <unistd.h>
540 #include <sys/types.h>
541 #include <sys/procfs.h>
544 dummy = ioctl(0, PIOCSET, &dummy);
546 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
547 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
548 if test $gdb_cv_have_procfs_piocset = yes; then
549 AC_DEFINE(HAVE_PROCFS_PIOCSET)
553 dnl For native ports (host == target), check to see what kind of
554 dnl legacy link.h support is needed. (See solib-legacy.c.)
555 if test ${host} = ${target} ; then
556 dnl Check for struct link_map with l_ members which are indicative
557 dnl of SVR4-like shared libraries
559 AC_MSG_CHECKING(for member l_addr in struct link_map)
560 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members,
561 [AC_TRY_COMPILE([#include <link.h>],
562 [struct link_map lm; (void) lm.l_addr;],
563 gdb_cv_have_struct_link_map_with_l_members=yes,
564 gdb_cv_have_struct_link_map_with_l_members=no)])
565 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members)
566 if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
567 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
570 dnl Check for struct link_map with lm_ members which are indicative
571 dnl of SunOS-like shared libraries
573 AC_MSG_CHECKING(for member lm_addr in struct link_map)
574 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members,
575 [AC_TRY_COMPILE([#include <sys/types.h>
577 [struct link_map lm; (void) lm.lm_addr;],
578 gdb_cv_have_struct_link_map_with_lm_members=yes,
579 gdb_cv_have_struct_link_map_with_lm_members=no)])
580 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members)
581 if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
582 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS)
585 dnl Check for struct so_map with som_ members which are found on
586 dnl some *BSD systems.
588 AC_MSG_CHECKING(for member som_addr in struct so_map)
589 AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members,
590 [AC_TRY_COMPILE([#include <sys/types.h>
595 [struct so_map lm; (void) lm.som_addr;],
596 gdb_cv_have_struct_so_map_with_som_members=yes,
597 gdb_cv_have_struct_so_map_with_som_members=no)])
598 AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members)
599 if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
600 AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS)
603 dnl Check for struct link_map32 type, which allows a 64-bit Solaris
604 dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries.
606 AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
607 AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
608 [AC_TRY_COMPILE([#define _SYSCALL32
609 #include <sys/link.h>], [struct link_map32 l;],
610 gdb_cv_have_struct_link_map32=yes,
611 gdb_cv_have_struct_link_map32=no)])
612 AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
613 if test $gdb_cv_have_struct_link_map32 = yes; then
614 AC_DEFINE(HAVE_STRUCT_LINK_MAP32)
615 AC_DEFINE(_SYSCALL32)
619 dnl See if compiler supports "long long" type.
621 AC_MSG_CHECKING(for long long support in compiler)
622 AC_CACHE_VAL(gdb_cv_c_long_long,
624 extern long long foo;
625 switch (foo & 2) { case 0: return 1; }
627 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
628 AC_MSG_RESULT($gdb_cv_c_long_long)
629 if test $gdb_cv_c_long_long = yes; then
630 AC_DEFINE(CC_HAS_LONG_LONG)
633 dnl See if the compiler and runtime support printing long long
635 AC_MSG_CHECKING(for long long support in printf)
636 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
641 l = (l << 16) + 0x0123;
642 l = (l << 16) + 0x4567;
643 l = (l << 16) + 0x89ab;
644 l = (l << 16) + 0xcdef;
645 sprintf (buf, "0x%016llx", l);
646 return (strcmp ("0x0123456789abcdef", buf));
648 gdb_cv_printf_has_long_long=yes,
649 gdb_cv_printf_has_long_long=no,
650 gdb_cv_printf_has_long_long=no)])
651 if test $gdb_cv_printf_has_long_long = yes; then
652 AC_DEFINE(PRINTF_HAS_LONG_LONG)
654 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
656 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
657 dnl because autoconf complains about cross-compilation issues. However, this
658 dnl code uses the same variables as the macro for compatibility.
660 AC_MSG_CHECKING(for long double support in compiler)
661 AC_CACHE_VAL(ac_cv_c_long_double,
662 [AC_TRY_COMPILE(, [long double foo;],
663 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
664 AC_MSG_RESULT($ac_cv_c_long_double)
665 if test $ac_cv_c_long_double = yes; then
666 AC_DEFINE(HAVE_LONG_DOUBLE)
669 dnl See if the compiler and runtime support printing long doubles
671 AC_MSG_CHECKING(for long double support in printf)
672 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
676 long double f = 3.141592653;
677 sprintf (buf, "%Lg", f);
678 return (strncmp ("3.14159", buf, 7));
680 gdb_cv_printf_has_long_double=yes,
681 gdb_cv_printf_has_long_double=no,
682 gdb_cv_printf_has_long_double=no)])
683 if test $gdb_cv_printf_has_long_double = yes; then
684 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
686 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
688 dnl See if the compiler and runtime support scanning long doubles
690 AC_MSG_CHECKING(for long double support in scanf)
691 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
694 char *buf = "3.141592653";
696 sscanf (buf, "%Lg", &f);
697 return !(f > 3.14159 && f < 3.14160);
699 gdb_cv_scanf_has_long_double=yes,
700 gdb_cv_scanf_has_long_double=no,
701 gdb_cv_scanf_has_long_double=no)])
702 if test $gdb_cv_scanf_has_long_double = yes; then
703 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
705 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
709 AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
710 SAVE_LDFLAGS=$LDFLAGS
713 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
714 *) gdb_cv_bigtoc=-bbigtoc ;;
717 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
718 AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
720 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
725 dnl For certain native configurations, we need to check whether thread
726 dnl support can be built in or not.
728 dnl Note that we only want this if we are both native (host == target),
729 dnl and not doing a canadian cross build (build == host).
731 if test ${build} = ${host} -a ${host} = ${target} ; then
734 AC_MSG_CHECKING(for HPUX/OSF thread support)
735 if test -f /usr/include/dce/cma_config.h ; then
736 if test "$GCC" = "yes" ; then
738 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
739 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} hpux-thread.o"
740 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
742 AC_MSG_RESULT(no (suppressed because you are not using GCC))
749 # See if thread_db library is around for Solaris thread debugging.
750 # Note that we must explicitly test for version 1 of the library
751 # because version 0 (present on Solaris 2.4 or earlier) doesn't have
753 AC_MSG_CHECKING(for Solaris thread debugging library)
754 if test -f /usr/lib/libthread_db.so.1 ; then
756 AC_DEFINE(HAVE_THREAD_DB_LIB)
757 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} sol-thread.o"
758 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
759 AC_CHECK_LIB(dl, dlopen)
760 if test "$GCC" = "yes" ; then
761 # The GNU linker requires the -export-dynamic option to make
762 # all symbols visible in the dynamic symbol table.
763 hold_ldflags=$LDFLAGS
764 AC_MSG_CHECKING(for the ld -export-dynamic flag)
765 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
766 AC_TRY_LINK(, [int i;], found=yes, found=no)
767 LDFLAGS=$hold_ldflags
768 AC_MSG_RESULT($found)
769 if test $found = yes; then
770 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
773 # Sun randomly tweaked the prototypes in <proc_service.h>
775 AC_MSG_CHECKING(if <proc_service.h> is old)
776 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
778 #include <proc_service.h>
780 (struct ps_prochandle*, psaddr_t, const void*, size_t);
781 ],, gdb_cv_proc_service_is_old=no,
782 gdb_cv_proc_service_is_old=yes)
784 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
785 if test $gdb_cv_proc_service_is_old = yes; then
786 AC_DEFINE(PROC_SERVICE_IS_OLD)
793 AC_MSG_CHECKING(for AiX thread debugging library)
794 AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
795 [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
796 [#ifndef PTHDB_VERSION_3
799 gdb_cv_have_aix_thread_debug=yes,
800 gdb_cv_have_aix_thread_debug=no)])
801 AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
802 if test $gdb_cv_have_aix_thread_debug = yes; then
803 CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
804 CONFIG_LIB_OBS="${CONFIG_LIB_OBS} aix-thread.o"
805 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
809 AC_SUBST(CONFIG_LDFLAGS)
812 dnl See if we have a thread_db header file that has TD_NOTALLOC.
813 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
814 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
815 gdb_cv_thread_db_h_has_td_notalloc,
817 [#include <thread_db.h>],
818 [int i = TD_NOTALLOC;],
819 gdb_cv_thread_db_h_has_td_notalloc=yes,
820 gdb_cv_thread_db_h_has_td_notalloc=no
824 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
825 AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
826 [Define if <thread_db.h> has the TD_NOTALLOC error code.])
829 dnl linux-proc.c wants to use pread64, which may require special CFLAGS
830 dnl -D_BSD_SOURCE is normally assumed but we have to specify it because of
831 dnl -D_XOPEN_SOURCE=500.
832 if test $host = $target; then
836 CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
837 AC_TRY_LINK([#include <unistd.h>],
838 [pread64 (0, NULL, 0, 0);],
839 [ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
840 AC_DEFINE(HAVE_PREAD64)], [])
846 dnl Handle optional features that can be enabled.
848 # NOTE: Don't add -Wall or -Wunused, they both include
849 # -Wunused-parameter which reports bogus warnings.
850 # NOTE: If you add to this list, remember to update
851 # gdb/doc/gdbint.texinfo.
852 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
853 -Wformat -Wparentheses -Wpointer-arith -Wuninitialized"
854 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
855 # -Wunused-function -Wunused-label -Wunused-variable -Wunused-value
856 # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
857 # -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
858 # -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
859 # -Woverloaded-virtual -Winline -Werror"
860 AC_ARG_ENABLE(build-warnings,
861 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
862 [case "${enableval}" in
864 no) build_warnings="-w";;
865 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
866 build_warnings="${build_warnings} ${t}";;
867 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
868 build_warnings="${t} ${build_warnings}";;
869 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
871 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
872 echo "Setting compiler warning flags = $build_warnings" 6>&1
874 AC_ARG_ENABLE(gdb-build-warnings,
875 [ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used],
876 [case "${enableval}" in
878 no) build_warnings="-w";;
879 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
880 build_warnings="${build_warnings} ${t}";;
881 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
882 build_warnings="${t} ${build_warnings}";;
883 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
885 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
886 echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
890 if test "x${build_warnings}" != x -a "x$GCC" = xyes
892 AC_MSG_CHECKING(compiler warning flags)
893 # Separate out the -Werror flag as some files just cannot be
894 # compiled with it enabled.
895 for w in ${build_warnings}; do
897 -Werr*) WERROR_CFLAGS=-Werror ;;
898 *) # Check that GCC accepts it
899 saved_CFLAGS="$CFLAGS"
901 AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
902 CFLAGS="$saved_CFLAGS"
905 AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
907 AC_SUBST(WARN_CFLAGS)
908 AC_SUBST(WERROR_CFLAGS)
912 AC_SUBST(MMALLOC_CFLAGS)
916 [ --with-mmalloc Use memory mapped malloc package],
917 [case "${withval}" in
918 yes) want_mmalloc=true ;;
919 no) want_mmalloc=false;;
920 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
921 esac],[want_mmalloc=false])dnl
923 if test x$want_mmalloc = xtrue; then
924 AC_DEFINE(USE_MMALLOC)
925 AC_DEFINE(MMCHECK_FORCE)
926 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
927 MMALLOC='../mmalloc/libmmalloc.a'
930 # In the Cygwin environment, we need some additional flags.
931 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
932 [AC_EGREP_CPP(lose, [
933 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
935 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
938 dnl Figure out which of the many generic ser-*.c files the _host_ supports.
939 SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
941 *go32* ) SER_HARDWIRE=ser-go32.o ;;
942 *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
944 AC_SUBST(SER_HARDWIRE)
946 # libreadline needs libuser32.a in a cygwin environment
948 if test x$gdb_cv_os_cygwin = xyes; then
951 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
957 LIBGUI="../libgui/src/libgui.a"
958 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
960 AC_SUBST(GUI_CFLAGS_X)
963 [ --enable-gdbtk Enable GDBTK GUI front end],
964 [case "${enableval}" in
968 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
971 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
979 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
982 # Default is on for everything but go32 and Cygwin
987 if test -d "${srcdir}/gdbtk" ; then
1001 if test "${enable_gdbtk}" = "yes"; then
1003 # Gdbtk must have an absolute path to srcdir in order to run
1004 # properly when not installed.
1010 CY_AC_PATH_TCLCONFIG
1011 if test -z "${no_tcl}"; then
1012 CY_AC_LOAD_TCLCONFIG
1015 # now look for Tcl library stuff
1026 TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
1028 # If $no_tk is nonempty, then we can't do Tk, and there is no
1029 # point to doing Tcl.
1030 if test -z "${no_tk}"; then
1038 # now look for Tk library stuff
1049 TK_DEPS="${tkdir}${TK_LIB_FILE}"
1051 # now look for Itcl library stuff
1053 CY_AC_PATH_ITCLCONFIG
1054 if test -z "${no_itcl}"; then
1055 CY_AC_LOAD_ITCLCONFIG
1057 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
1058 ITCL_DEPS="${ITCL_LIB_FULL_PATH}"
1062 # now look for Itk library stuff
1063 CY_AC_PATH_ITKCONFIG
1064 if test -z "${no_itcl}"; then
1065 CY_AC_LOAD_ITKCONFIG
1067 ITKLIB="${ITK_BUILD_LIB_SPEC}"
1068 ITK_DEPS="${ITK_LIB_FULL_PATH}"
1071 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
1072 # Tcl/Tk 8.1 require -fwritable strings. I don't
1073 # know whether 8.2 will or not, but I bet it will.
1074 # I don't have to worry about 7.x since we don't support it.
1076 if test "$GCC" = "yes"; then
1077 if test "$TCL_VERSION" != "8.0" ; then
1078 GDBTK_CFLAGS="-fwritable-strings"
1082 # Include some libraries that Tcl and Tk want.
1083 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
1084 # Yes, the ordering seems wrong here. But it isn't.
1085 # TK_LIBS is the list of libraries that need to be linked
1086 # after Tcl/Tk. Note that this isn't put into LIBS. If it
1087 # were in LIBS then any link tests after this point would
1088 # try to include things like `$(LIBGUI)', which wouldn't work.
1089 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
1091 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
1092 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
1093 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
1094 CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_GDBTK_INITS)"
1095 CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_GDBTK_ALL)"
1096 CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_GDBTK_CLEAN)"
1097 CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
1098 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
1100 if test x$gdb_cv_os_cygwin = xyes; then
1101 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
1102 WIN32LDAPP="-Wl,--subsystem,console"
1103 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
1108 configdirs="${configdirs} gdbtk"
1121 AC_SUBST(GDBTK_CFLAGS)
1122 AC_SUBST(GDBTK_SRC_DIR)
1127 # Unlike the sim directory, whether a simulator is linked is controlled by
1128 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
1129 # This code just checks for a few cases where we'd like to ignore those
1130 # definitions, even when they're present in the '.mt' file. These cases
1131 # are when --disable-sim is specified, or if the simulator directory is
1132 # not part of the source tree.
1135 [ --enable-sim Link gdb with simulator],
1136 [echo "enable_sim = $enable_sim";
1137 echo "enableval = ${enableval}";
1138 case "${enableval}" in
1139 yes) ignore_sim=false ;;
1140 no) ignore_sim=true ;;
1141 *) ignore_sim=false ;;
1145 if test ! -d "${srcdir}/../sim"; then
1149 if test "${ignore_sim}" = "true"; then
1151 IGNORE_SIM_OBS="SIM_OBS="
1157 AC_SUBST(IGNORE_SIM)
1158 AC_SUBST(IGNORE_SIM_OBS)
1160 AC_SUBST(ENABLE_CFLAGS)
1162 AC_SUBST(CONFIG_OBS)
1163 AC_SUBST(CONFIG_LIB_OBS)
1164 AC_SUBST(CONFIG_DEPS)
1165 AC_SUBST(CONFIG_SRCS)
1166 AC_SUBST(CONFIG_INITS)
1167 AC_SUBST(CONFIG_ALL)
1168 AC_SUBST(CONFIG_CLEAN)
1169 AC_SUBST(CONFIG_INSTALL)
1170 AC_SUBST(CONFIG_UNINSTALL)
1172 # Begin stuff to support --enable-shared
1173 AC_ARG_ENABLE(shared,
1174 [ --enable-shared Use shared libraries],
1175 [case "${enableval}" in
1183 # If we have shared libraries, try to set rpath reasonably.
1184 if test "${shared}" = "true"; then
1187 HLDFLAGS='-Wl,+s,+b,$(libdir)'
1189 *-*-irix5* | *-*-irix6*)
1190 HLDFLAGS='-Wl,-rpath,$(libdir)'
1194 *-*-linux* | *-pc-linux-gnu*)
1195 HLDFLAGS='-Wl,-rpath,$(libdir)'
1198 HLDFLAGS='-R $(libdir)'
1201 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;'
1206 # On SunOS, if the linker supports the -rpath option, use it to
1207 # prevent ../bfd and ../opcodes from being included in the run time
1211 echo 'main () { }' > conftest.c
1212 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
1213 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
1215 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
1217 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
1219 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
1221 elif test "${shared}" = "true"; then
1222 HLDFLAGS='-Wl,-rpath=$(libdir)'
1224 HLDFLAGS='-Wl,-rpath='
1226 rm -f conftest.t conftest.c conftest
1231 # End stuff to support --enable-shared
1233 # target_subdir is used by the testsuite to find the target libraries.
1235 if test "${host}" != "${target}"; then
1236 target_subdir="${target_alias}/"
1238 AC_SUBST(target_subdir)
1241 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
1242 if test ! -f ${host_makefile_frag}; then
1243 # When building a native debuger the .mh file containing things
1244 # like NATDEPFILES is needed. Cross debuggers don't need .mh
1245 # since it no longer contains anything useful.
1246 if test "${target}" = "${host}"; then
1247 AC_MSG_ERROR("*** Gdb does not support native target ${host}")
1249 host_makefile_frag=/dev/null
1252 frags="$frags $host_makefile_frag"
1254 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
1255 if test ! -f ${target_makefile_frag}; then
1256 AC_MSG_ERROR("*** Gdb does not support target ${target}")
1258 frags="$frags $target_makefile_frag"
1260 AC_SUBST_FILE(host_makefile_frag)
1261 AC_SUBST_FILE(target_makefile_frag)
1266 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1267 ' ${host_makefile_frag}`
1269 targetfile=`sed -n '
1270 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1271 ' ${target_makefile_frag}`
1273 GDB_MULTI_ARCH=`sed -n '
1274 s/GDB_MULTI_ARCH[ ]*=[ ]*\([^ ]*\)[ ]*/\1/p
1275 ' ${target_makefile_frag}`
1277 if test "${target}" = "${host}"; then
1278 # We pick this up from the host configuration file (.mh) because we
1279 # do not have a native configuration Makefile fragment.
1280 nativefile=`sed -n '
1281 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1282 ' ${host_makefile_frag}`
1286 # New targets should just set gdb_multi_arch=yes in configure.tgt.
1287 # Old targets being converted can either do that or set GDB_MULTI_ARCH
1288 # in the target specific makefile frag. Eventually gdb_multi_arch=yes
1289 # will be the default.
1290 if test x"${GDB_MULTI_ARCH}" = x ; then
1291 case "${gdb_multi_arch}" in
1292 yes ) GDB_MULTI_ARCH=GDB_MULTI_ARCH_PURE ;;
1293 no ) GDB_MULTI_ARCH=0 ;;
1294 0|1|2 ) GDB_MULTI_ARCH=${gdb_multi_arch} ;;
1297 if test x"${GDB_MULTI_ARCH}" != x ; then
1298 AC_DEFINE_UNQUOTED(GDB_MULTI_ARCH, ${GDB_MULTI_ARCH})
1300 # Warn the user when they use an old practice
1301 case "${GDB_MULTI_ARCH}" in
1303 0 | GDB_MULTI_ARCH_PARTIAL | 1 | GDB_MULTI_ARCH_TM | 2 )
1304 AC_MSG_WARN("GDB: Target is not pure multi-arch") ;;
1305 GDB_MULTI_ARCH_PURE )
1306 if test x"${targetfile}" != x ; then
1307 AC_MSG_WARN("GDB: Ignoring TM_FILE in ${target_makefile_frag}")
1310 *) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
1313 # Enable multi-ice-gdb-server.
1314 AC_ARG_ENABLE(multi-ice,
1315 [ --enable-multi-ice build the multi-ice-gdb-server],
1319 *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;;
1321 if test "x$enable_multi_ice" = xyes; then
1322 configdirs="$configdirs multi-ice"
1325 # We only build gdbserver automatically if host and target are the same.
1326 if test "x$target" = "x$host"; then
1327 AC_MSG_CHECKING(whether gdbserver is supported on this host)
1328 if test "x$build_gdbserver" = xyes; then
1329 configdirs="$configdirs gdbserver"
1336 AC_CONFIG_SUBDIRS($configdirs)
1340 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
1341 # (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
1349 if test "${hostfile}" != ""; then
1351 GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}"
1352 files="${files} ${GDB_XM_FILE}"
1353 links="${links} xm.h"
1354 AC_DEFINE_UNQUOTED(GDB_XM_FILE, ${GDB_XM_FILE})
1360 if test "${targetfile}" != ""; then
1362 GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}"
1363 files="${files} ${GDB_TM_FILE}"
1364 links="${links} tm.h"
1365 AC_DEFINE_UNQUOTED(GDB_TM_FILE, ${GDB_TM_FILE})
1371 if test "${nativefile}" != ""; then
1373 GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}"
1374 files="${files} ${GDB_NM_FILE}"
1375 links="${links} nm.h"
1376 AC_DEFINE_UNQUOTED(GDB_NM_FILE, ${GDB_NM_FILE})
1380 AC_LINK_FILES($files, $links)
1382 dnl Check for exe extension set on certain hosts (e.g. Win32)
1385 dnl Detect the character set used by this host.
1387 dnl At the moment, we just assume it's ISO-8859-1 (which is a
1388 dnl superset of ASCII containing the characters needed for French,
1389 dnl German, Spanish, Italian, and possibly others), but if were
1390 dnl *were* to support any host character sets other than ISO-8859-1,
1391 dnl here's where we'd detect it.
1392 AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO-8859-1",
1393 [Define to be a string naming the default host character set.])
1397 AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
1399 dnl Autoconf doesn't provide a mechanism for modifying definitions
1400 dnl provided by makefile fragments.
1402 if test "${nativefile}" = ""; then
1404 sed -e '/^NATDEPFILES[[ ]]*=.*\\$/,/[[^\\]]$/s/^/# /' \
1405 -e '/^NATDEPFILES[[ ]]*=/s/^/# /' \
1406 | sed -e '/^\(NATDEPFILES[[ ]]*[[+]]=[[ ]]*\)/s//# \1/' \
1408 mv -f Makefile.tem Makefile
1412 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
1413 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
1414 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
1415 mv -f Makefile.tmp Makefile
1419 case x$CONFIG_HEADERS in
1420 xconfig.h:config.in)
1425 gdb_host_cpu=$gdb_host_cpu
1426 gdb_target_cpu=$gdb_target_cpu
1427 nativefile=$nativefile