1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
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)
34 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
37 # FIXME: kettenis/20030102: The AC_PROG_RANLIB from Autoconf 2.13
38 # doesn't support cross-compilation, but the one from Autoconf 2.5x
39 # does. Override RANLIB here (i.e. before running AC_PROG_RANLIB) to
40 # deal with the lossage. Note that CY_GNU_GETTEXT currently calls
41 # AC_PROG_RANLIB. This can be removed when we switch to Autoconf
43 AC_CHECK_TOOL(RANLIB, ranlib, :)
45 dnl Set up for gettext. PACKAGE is used when we call bindtextdomain.
48 AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
50 debugdir=${libdir}/debug
52 AC_ARG_WITH(separate-debug-dir,
53 [ --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]],
54 [debugdir="${withval}"])
56 AC_DEFINE_DIR(DEBUGDIR, debugdir,
57 [Global directory for separate debug files. ])
58 #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
60 dnl List of object files added by configure.
71 AC_CONFIG_SUBDIRS(doc testsuite)
74 . $srcdir/configure.host
76 . $srcdir/configure.tgt
78 # Fetch the default architecture and default target vector from BFD.
79 targ=$target; . $srcdir/../bfd/config.bfd
81 # We only want the first architecture, so strip off the others if
82 # there is more than one.
83 targ_archs=`echo $targ_archs | sed 's/ .*//'`
85 if test "x$targ_archs" != x; then
86 AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, $targ_archs,
87 [Define to BFD's default architecture. ])
89 if test "x$targ_defvec" != x; then
90 AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, $targ_defvec,
91 [Define to BFD's default target vector. ])
96 # The CLI cannot be disabled yet, but may be in the future.
100 [ --disable-gdbcli disable command-line interface (CLI)],
105 AC_MSG_ERROR([the command-line interface cannot be disabled yet]) ;;
107 AC_MSG_ERROR([bad value $enableval for --enable-gdbcli]) ;;
110 if test x"$enable_gdbcli" = xyes; then
111 if test -d $srcdir/cli; then
112 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
113 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
114 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
115 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
121 [ --disable-gdbmi disable machine-interface (MI)],
126 AC_MSG_ERROR([bad value $enableval for --enable-gdbmi]) ;;
129 if test x"$enable_gdbmi" = xyes; then
130 if test -d $srcdir/mi; then
131 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
132 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
133 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
134 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
138 # FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
139 # Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
140 # Makefile fragments. That's why we need to have `Hcurses' before
141 # `curses'. I don't see why we should use HP curses if a more
142 # standard curses is available, except that according to HP's
143 # documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
144 # HP-UX 10.10 and 10.20.
146 AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [],
147 [AC_MSG_WARN([no curses library found])])
149 # Check whether the wborder function is provided by the curses
150 # library detected above. In certain implementations such as
151 # the HP/UX Hcurses for instance, this function is provided by an
152 # additional library. So if we did not find this function inside
153 # the curses library, try some alternate libraries we know might
155 AC_CHECK_FUNC(wborder, [wborder_available=yes],
156 [AC_SEARCH_LIBS(wborder, [cur_colr], [wborder_available=yes],
157 [AC_MSG_WARN([no wborder function found])])])
161 [ --enable-tui enable full-screen terminal user interface (TUI)],
166 AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
167 esac],enable_tui=yes)
168 if test x"$enable_tui" = xyes; then
169 if test -d $srcdir/tui; then
170 if test "$ac_cv_search_initscr" != no -a "$wborder_available" = "yes"; then
171 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
172 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
173 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
174 CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
175 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
176 CONFIG_ALL="${CONFIG_ALL} all-tui"
177 CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
178 CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
179 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
186 [ --enable-gdbtk enable gdbtk graphical user interface (GUI)],
191 AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
193 [if test -d $srcdir/gdbtk; then
198 # We unconditionally disable gdbtk tests on selected platforms.
201 AC_MSG_WARN([gdbtk isn't supported on $host; disabling])
206 AC_ARG_WITH(libunwind,
207 [ --with-libunwind Use libunwind frame unwinding support],
208 [case "${withval}" in
209 yes) enable_libunwind=yes ;;
210 no) enable_libunwind=no ;;
211 *) AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;;
213 AC_CHECK_HEADERS(libunwind.h)
214 AC_CHECK_HEADERS(libunwind-ia64.h)
215 if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
216 enable_libunwind=yes;
220 if test x"$enable_libunwind" = xyes; then
221 AC_CHECK_HEADERS(libunwind.h)
222 AC_CHECK_HEADERS(libunwind-ia64.h)
223 AC_DEFINE(HAVE_LIBUNWIND, 1)
224 CONFIG_OBS="$CONFIG_OBS libunwind-frame.o"
225 CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o"
226 CONFIG_SRCS="$CONFIG_SRCS libunwind-frame.c"
230 AC_ARG_ENABLE(profiling,
231 [ --enable-profiling enable profiling of GDB],
236 AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
238 [enable_profiling=no])
240 AC_CHECK_FUNCS(monstartup _mcleanup)
241 AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
246 [free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
247 if test $ac_cv_var__etext = yes; then
248 AC_DEFINE(HAVE__ETEXT, 1,
249 [Define to 1 if your system has the _etext variable. ])
251 if test "$enable_profiling" = yes ; then
252 if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
253 AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
257 CFLAGS="$CFLAGS $PROFILE_CFLAGS"
259 AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
260 [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
261 ac_cv_cc_supports_pg=no)])
263 if test $ac_cv_cc_supports_pg = no; then
264 AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
270 # --------------------- #
271 # Checks for programs. #
272 # --------------------- #
280 AC_CHECK_TOOL(AR, ar)
281 AC_CHECK_TOOL(DLLTOOL, dlltool)
282 AC_CHECK_TOOL(WINDRES, windres)
284 # Needed for GNU/Hurd.
285 AC_CHECK_TOOL(MIG, mig)
287 # ---------------------- #
288 # Checks for libraries. #
289 # ---------------------- #
291 # We might need to link with -lm; most simulators need it.
292 AC_CHECK_LIB(m, main)
294 # We need to link with -lw to get `wctype' on Solaris before Solaris
295 # 2.6. Solaris 2.6 and beyond have this function in libc, and have a
296 # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
297 # is known to have this problem). Therefore we avoid libw if we can.
298 AC_CHECK_FUNC(wctype, [],
299 [AC_CHECK_LIB(w, wctype)])
301 # Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
302 AC_SEARCH_LIBS(gethostbyname, nsl)
304 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
305 AC_SEARCH_LIBS(socketpair, socket)
307 # Since GDB uses Readline, we need termcap functionality, so we need
308 # to find a library that provides that. When GDB is configured with
309 # the TUI, we need full curses functionality.
313 if test -d $srcdir/libtermcap; then
314 LIBS="../libtermcap/libtermcap.a $LIBS"
315 ac_cv_search_tgetent="../libtermcap/libtermcap.a"
318 ac_cv_search_tgetent="none required"
321 # Readline prefers curses over termcap on AIX.
323 AC_SEARCH_LIBS(tgetent, [tinfo ncurses curses termcap])
327 # Note: We used to check for libtermlib and libterminfo too, but
328 # Readline doesn't, so I think we're safe with leaving them out.
329 AC_SEARCH_LIBS(tgetent, [termcap tinfo ncurses Hcurses curses])
331 if test "$ac_cv_search_tgetent" = no; then
332 AC_MSG_ERROR([no termcap library found])
335 # ------------------------- #
336 # Checks for header files. #
337 # ------------------------- #
342 AC_CHECK_HEADERS(link.h)
343 AC_CHECK_HEADERS(machine/reg.h)
344 AC_CHECK_HEADERS(nlist.h)
345 AC_CHECK_HEADERS(poll.h sys/poll.h)
346 AC_CHECK_HEADERS(proc_service.h thread_db.h)
347 AC_CHECK_HEADERS(stddef.h)
348 AC_CHECK_HEADERS(stdlib.h)
349 AC_CHECK_HEADERS(stdint.h)
350 AC_CHECK_HEADERS(string.h memory.h strings.h)
351 AC_CHECK_HEADERS(sys/fault.h)
352 AC_CHECK_HEADERS(sys/file.h)
353 AC_CHECK_HEADERS(sys/filio.h)
354 AC_CHECK_HEADERS(sys/ioctl.h)
355 AC_CHECK_HEADERS(sys/param.h)
356 AC_CHECK_HEADERS(sys/proc.h)
357 AC_CHECK_HEADERS(sys/procfs.h)
358 AC_CHECK_HEADERS(sys/ptrace.h ptrace.h)
359 AC_CHECK_HEADERS(sys/reg.h sys/debugreg.h)
360 AC_CHECK_HEADERS(sys/select.h)
361 AC_CHECK_HEADERS(sys/syscall.h)
362 AC_CHECK_HEADERS(sys/user.h)
363 AC_CHECK_HEADERS(sys/wait.h wait.h)
364 AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
365 AC_CHECK_HEADERS(unistd.h)
367 # On Solaris 2.[78], we need to define _MSE_INT_H to avoid a clash
368 # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
369 # think that we don't have <curses.h> if we're using GCC.
372 if test "$GCC" = yes; then
373 AC_DEFINE(_MSE_INT_H, 1,
374 [[Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
375 Solaris 2.[78] when using GCC. ]])
378 AC_CHECK_HEADERS(curses.h ncurses.h term.h)
380 # FIXME: kettenis/20030102: In most cases we include these
381 # unconditionally, so what's the point in checking these?
382 AC_CHECK_HEADERS(ctype.h time.h)
384 dnl Check for struct stat with an st_blocks member
385 AC_MSG_CHECKING(for member st_blocks in struct stat)
386 AC_CACHE_VAL(gdb_cv_have_struct_stat_with_st_blocks_member,
387 [AC_TRY_COMPILE([#include <sys/types.h>
388 #include <sys/stat.h>],
389 [struct stat st; (void) st.st_blocks;],
390 gdb_cv_have_struct_stat_with_st_blocks_member=yes,
391 gdb_cv_have_struct_stat_with_st_blocks_member=no)])
392 AC_MSG_RESULT($gdb_cv_have_struct_stat_with_st_blocks_member)
393 if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then
394 AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
396 # ------------------------- #
397 # Checks for declarations. #
398 # ------------------------- #
400 gcc_AC_CHECK_DECLS(getopt)
402 # ------------------ #
403 # Checks for types. #
404 # ------------------ #
408 # ------------------------------------- #
409 # Checks for compiler characteristics. #
410 # ------------------------------------- #
415 # ------------------------------ #
416 # Checks for library functions. #
417 # ------------------------------ #
422 AC_CHECK_FUNCS(canonicalize_file_name realpath)
424 AC_CHECK_FUNCS(pread64)
426 AC_CHECK_FUNCS(setpgid setpgrp)
427 AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
428 AC_CHECK_FUNCS(socketpair)
429 AC_CHECK_FUNCS(syscall)
431 dnl AC_FUNC_SETPGRP does not work when cross compiling
432 dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
433 if test "$cross_compiling" = no; then
436 AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
440 if (setpgrp(1,1) == -1)
444 ], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
445 if test $ac_cv_func_setpgrp_void = yes; then
446 AC_DEFINE(SETPGRP_VOID, 1)
450 # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
451 # since sigsetjmp might only be defined as a macro.
452 AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
455 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
456 gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
457 if test $gdb_cv_func_sigsetjmp = yes; then
458 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
461 # Assume we'll default to using the included libiberty regex.
462 gdb_use_included_regex=yes
464 # However, if the system regex is GNU regex, then default to *not*
465 # using the included regex.
468 [gdb_cv_have_gnu_regex],
470 [#include <gnu-versions.h>],
471 [#define REGEX_INTERFACE_VERSION 1
472 #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
473 # error "Version mismatch"
475 gdb_cv_have_gnu_regex=yes,
476 gdb_cv_have_gnu_regex=no)])
477 if test $gdb_cv_have_gnu_regex = yes; then
478 gdb_use_included_regex=no
481 AC_ARG_WITH(included-regex,
482 [ --without-included-regex don't use included regex; this is the default
483 on systems with version 2 of the GNU C library
484 (use with caution on other system)],
485 gdb_with_regex=$withval,
486 gdb_with_regex=$gdb_use_included_regex)
487 if test "$gdb_with_regex" = yes; then
488 AC_DEFINE(USE_INCLUDED_REGEX, 1,
489 [Define to 1 if the regex included in libiberty should be used.])
492 # See if <machine/reg.h> degines `struct reg'.
493 AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg,
494 [AC_TRY_COMPILE([#include <sys/types.h>
495 #include <machine/reg.h>], [struct reg r;],
496 gdb_cv_struct_reg=yes, gdb_cv_struct_reg=no)])
497 if test $gdb_cv_struct_reg = yes; then
498 AC_DEFINE(HAVE_STRUCT_REG, 1,
499 [Define to 1 if your system has struct reg in <machine/reg.h>.])
502 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
503 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
504 AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_reg_r_fs,
505 [AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;],
506 gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)])
507 if test $gdb_cv_struct_reg_r_fs = yes; then
508 AC_DEFINE(HAVE_STRUCT_REG_R_FS)
510 AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs,
511 [AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;],
512 gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)])
513 if test $gdb_cv_struct_reg_r_gs = yes; then
514 AC_DEFINE(HAVE_STRUCT_REG_R_GS)
517 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
518 AC_MSG_CHECKING(for PTRACE_GETREGS)
519 AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
520 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
522 [gdb_cv_have_ptrace_getregs=yes],
523 [gdb_cv_have_ptrace_getregs=no])])
524 AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
525 if test $gdb_cv_have_ptrace_getregs = yes; then
526 AC_DEFINE(HAVE_PTRACE_GETREGS)
529 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
530 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
531 AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
532 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
533 [PTRACE_GETFPXREGS;],
534 [gdb_cv_have_ptrace_getfpxregs=yes],
535 [gdb_cv_have_ptrace_getfpxregs=no])])
536 AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
537 if test $gdb_cv_have_ptrace_getfpxregs = yes; then
538 AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
541 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
542 AC_MSG_CHECKING(for PT_GETDBREGS)
543 AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
544 [AC_TRY_COMPILE([#include <sys/types.h>
545 #include <sys/ptrace.h>],
547 [gdb_cv_have_pt_getdbregs=yes],
548 [gdb_cv_have_pt_getdbregs=no])])
549 AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
550 if test $gdb_cv_have_pt_getdbregs = yes; then
551 AC_DEFINE(HAVE_PT_GETDBREGS)
554 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
555 AC_MSG_CHECKING(for PT_GETXMMREGS)
556 AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
557 [AC_TRY_COMPILE([#include <sys/types.h>
558 #include <sys/ptrace.h>],
560 [gdb_cv_have_pt_getxmmregs=yes],
561 [gdb_cv_have_pt_getxmmregs=no])])
562 AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
563 if test $gdb_cv_have_pt_getxmmregs = yes; then
564 AC_DEFINE(HAVE_PT_GETXMMREGS)
567 # See if stdint.h provides the uintptr_t type.
568 # Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
569 AC_CACHE_CHECK([for uintptr_t in stdint.h], gdb_cv_have_uintptr_t,
571 [#include <stdint.h>],
572 [uintptr_t foo = 0;],
573 gdb_cv_have_uintptr_t=yes,
574 gdb_cv_have_uintptr_t=no)])
575 if test $gdb_cv_have_uintptr_t = yes; then
576 AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.])
579 BFD_NEED_DECLARATION(malloc)
580 BFD_NEED_DECLARATION(realloc)
581 BFD_NEED_DECLARATION(free)
582 BFD_NEED_DECLARATION(strerror)
583 BFD_NEED_DECLARATION(strdup)
584 BFD_NEED_DECLARATION(strstr)
585 BFD_NEED_DECLARATION(canonicalize_file_name)
587 # The following save_state_t checkery is only necessary for HPUX
588 # versions earlier than 10.20. When those fade from memory, this
589 # could be expunged. --jsm 1999-03-22
591 AC_MSG_CHECKING(for HPUX save_state structure)
592 AC_EGREP_HEADER(save_state_t, machine/save_state.h,
593 gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
594 AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
595 gdb_cv_hpux_sswide=no)
596 if test $gdb_cv_hpux_savestate = yes
598 AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
600 if test $gdb_cv_hpux_sswide = yes
602 AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
604 AC_MSG_RESULT($gdb_cv_hpux_sswide)
607 # If we are configured native on GNU/Linux, work around problems with
609 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
611 if test "${target}" = "${host}"; then
613 i[[3456]]86-*-linux*)
614 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
615 AC_DEFINE(sys_quotactl)
618 AC_DEFINE(NEW_PROC_API)
620 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
621 AC_DEFINE(NEW_PROC_API)
623 *-*-solaris2.[[6789]])
624 AC_DEFINE(NEW_PROC_API)
629 if test "$ac_cv_header_sys_procfs_h" = yes; then
630 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
631 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
632 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
633 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
634 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
635 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
636 BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t)
637 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t)
638 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
639 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
640 BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t)
641 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t)
642 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t)
643 BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t)
646 dnl Check for broken prfpregset_t type
648 dnl For Linux/i386, glibc 2.1.3 was released with a bogus
649 dnl prfpregset_t type (it's a typedef for the pointer to a struct
650 dnl instead of the struct itself). We detect this here, and work
651 dnl around it in gdb_proc_service.h.
653 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
654 AC_MSG_CHECKING(whether prfpregset_t type is broken)
655 AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
656 [AC_TRY_RUN([#include <sys/procfs.h>
659 if (sizeof (prfpregset_t) == sizeof (void *))
663 gdb_cv_prfpregset_t_broken=no,
664 gdb_cv_prfpregset_t_broken=yes,
665 gdb_cv_prfpregset_t_broken=yes)])
666 AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
667 if test $gdb_cv_prfpregset_t_broken = yes; then
668 AC_DEFINE(PRFPREGSET_T_BROKEN)
672 dnl Check for PIOCSET ioctl entry
674 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
675 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
676 [AC_TRY_COMPILE([#include <unistd.h>
677 #include <sys/types.h>
678 #include <sys/procfs.h>
681 dummy = ioctl(0, PIOCSET, &dummy);
683 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
684 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
685 if test $gdb_cv_have_procfs_piocset = yes; then
686 AC_DEFINE(HAVE_PROCFS_PIOCSET)
690 dnl For native ports (host == target), check to see what kind of
691 dnl legacy link.h support is needed. (See solib-legacy.c.)
692 if test ${host} = ${target} ; then
693 dnl Check for struct link_map with l_ members which are indicative
694 dnl of SVR4-like shared libraries
696 AC_MSG_CHECKING(for member l_addr in struct link_map)
697 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members,
698 [AC_TRY_COMPILE([#include <link.h>],
699 [struct link_map lm; (void) lm.l_addr;],
700 gdb_cv_have_struct_link_map_with_l_members=yes,
701 gdb_cv_have_struct_link_map_with_l_members=no)])
702 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members)
703 if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
704 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS)
707 dnl Check for struct link_map with lm_ members which are indicative
708 dnl of SunOS-like shared libraries
710 AC_MSG_CHECKING(for member lm_addr in struct link_map)
711 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members,
712 [AC_TRY_COMPILE([#include <sys/types.h>
714 [struct link_map lm; (void) lm.lm_addr;],
715 gdb_cv_have_struct_link_map_with_lm_members=yes,
716 gdb_cv_have_struct_link_map_with_lm_members=no)])
717 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members)
718 if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
719 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS)
722 dnl Check for struct so_map with som_ members which are found on
723 dnl some *BSD systems.
725 AC_MSG_CHECKING(for member som_addr in struct so_map)
726 AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members,
727 [AC_TRY_COMPILE([#include <sys/types.h>
732 [struct so_map lm; (void) lm.som_addr;],
733 gdb_cv_have_struct_so_map_with_som_members=yes,
734 gdb_cv_have_struct_so_map_with_som_members=no)])
735 AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members)
736 if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
737 AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS)
740 dnl Check for struct link_map32 type, which allows a 64-bit Solaris
741 dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries.
743 AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
744 AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
745 [AC_TRY_COMPILE([#define _SYSCALL32
746 #include <sys/link.h>], [struct link_map32 l;],
747 gdb_cv_have_struct_link_map32=yes,
748 gdb_cv_have_struct_link_map32=no)])
749 AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
750 if test $gdb_cv_have_struct_link_map32 = yes; then
751 AC_DEFINE(HAVE_STRUCT_LINK_MAP32)
752 AC_DEFINE(_SYSCALL32)
756 dnl See if compiler supports "long long" type.
758 AC_MSG_CHECKING(for long long support in compiler)
759 AC_CACHE_VAL(gdb_cv_c_long_long,
761 extern long long foo;
762 switch (foo & 2) { case 0: return 1; }
764 gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
765 AC_MSG_RESULT($gdb_cv_c_long_long)
766 if test $gdb_cv_c_long_long = yes; then
767 AC_DEFINE(CC_HAS_LONG_LONG)
770 dnl See if the compiler and runtime support printing long long
772 AC_MSG_CHECKING(for long long support in printf)
773 AC_CACHE_VAL(gdb_cv_printf_has_long_long,
778 l = (l << 16) + 0x0123;
779 l = (l << 16) + 0x4567;
780 l = (l << 16) + 0x89ab;
781 l = (l << 16) + 0xcdef;
782 sprintf (buf, "0x%016llx", l);
783 return (strcmp ("0x0123456789abcdef", buf));
785 gdb_cv_printf_has_long_long=yes,
786 gdb_cv_printf_has_long_long=no,
787 gdb_cv_printf_has_long_long=no)])
788 if test $gdb_cv_printf_has_long_long = yes; then
789 AC_DEFINE(PRINTF_HAS_LONG_LONG)
791 AC_MSG_RESULT($gdb_cv_printf_has_long_long)
793 dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
794 dnl because autoconf complains about cross-compilation issues. However, this
795 dnl code uses the same variables as the macro for compatibility.
797 AC_MSG_CHECKING(for long double support in compiler)
798 AC_CACHE_VAL(ac_cv_c_long_double,
799 [AC_TRY_COMPILE(, [long double foo;],
800 ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
801 AC_MSG_RESULT($ac_cv_c_long_double)
802 if test $ac_cv_c_long_double = yes; then
803 AC_DEFINE(HAVE_LONG_DOUBLE)
806 dnl See if the compiler and runtime support printing long doubles
808 AC_MSG_CHECKING(for long double support in printf)
809 AC_CACHE_VAL(gdb_cv_printf_has_long_double,
813 long double f = 3.141592653;
814 sprintf (buf, "%Lg", f);
815 return (strncmp ("3.14159", buf, 7));
817 gdb_cv_printf_has_long_double=yes,
818 gdb_cv_printf_has_long_double=no,
819 gdb_cv_printf_has_long_double=no)])
820 if test $gdb_cv_printf_has_long_double = yes; then
821 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
823 AC_MSG_RESULT($gdb_cv_printf_has_long_double)
825 dnl See if the compiler and runtime support scanning long doubles
827 AC_MSG_CHECKING(for long double support in scanf)
828 AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
831 char *buf = "3.141592653";
833 sscanf (buf, "%Lg", &f);
834 return !(f > 3.14159 && f < 3.14160);
836 gdb_cv_scanf_has_long_double=yes,
837 gdb_cv_scanf_has_long_double=no,
838 gdb_cv_scanf_has_long_double=no)])
839 if test $gdb_cv_scanf_has_long_double = yes; then
840 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
842 AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
846 AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
847 SAVE_LDFLAGS=$LDFLAGS
850 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
851 *) gdb_cv_bigtoc=-bbigtoc ;;
854 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
855 AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
857 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
862 dnl For certain native configurations, we need to check whether thread
863 dnl support can be built in or not.
865 dnl Note that we only want this if we are both native (host == target),
866 dnl and not doing a canadian cross build (build == host).
868 if test ${build} = ${host} -a ${host} = ${target} ; then
871 AC_MSG_CHECKING(for HPUX/OSF thread support)
872 if test -f /usr/include/dce/cma_config.h ; then
873 if test "$GCC" = "yes" ; then
875 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
876 CONFIG_OBS="${CONFIG_OBS} hpux-thread.o"
877 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
879 AC_MSG_RESULT(no (suppressed because you are not using GCC))
886 # See if thread_db library is around for Solaris thread debugging.
887 # Note that we must explicitly test for version 1 of the library
888 # because version 0 (present on Solaris 2.4 or earlier) doesn't have
890 AC_MSG_CHECKING(for Solaris thread debugging library)
891 if test -f /usr/lib/libthread_db.so.1 ; then
893 AC_DEFINE(HAVE_THREAD_DB_LIB)
894 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
895 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
896 AC_CHECK_LIB(dl, dlopen)
897 if test "$GCC" = "yes" ; then
898 # The GNU linker requires the -export-dynamic option to make
899 # all symbols visible in the dynamic symbol table.
900 hold_ldflags=$LDFLAGS
901 AC_MSG_CHECKING(for the ld -export-dynamic flag)
902 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
903 AC_TRY_LINK(, [int i;], found=yes, found=no)
904 LDFLAGS=$hold_ldflags
905 AC_MSG_RESULT($found)
906 if test $found = yes; then
907 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
910 # Sun randomly tweaked the prototypes in <proc_service.h>
912 AC_MSG_CHECKING(if <proc_service.h> is old)
913 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
915 #include <proc_service.h>
917 (struct ps_prochandle*, psaddr_t, const void*, size_t);
918 ],, gdb_cv_proc_service_is_old=no,
919 gdb_cv_proc_service_is_old=yes)
921 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
922 if test $gdb_cv_proc_service_is_old = yes; then
923 AC_DEFINE(PROC_SERVICE_IS_OLD)
930 AC_MSG_CHECKING(for AiX thread debugging library)
931 AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
932 [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
933 [#ifndef PTHDB_VERSION_3
936 gdb_cv_have_aix_thread_debug=yes,
937 gdb_cv_have_aix_thread_debug=no)])
938 AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
939 if test $gdb_cv_have_aix_thread_debug = yes; then
940 CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
941 CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
942 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
946 AC_SUBST(CONFIG_LDFLAGS)
949 dnl See if we have a thread_db header file that has TD_NOTALLOC.
950 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
951 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
952 gdb_cv_thread_db_h_has_td_notalloc,
954 [#include <thread_db.h>],
955 [int i = TD_NOTALLOC;],
956 gdb_cv_thread_db_h_has_td_notalloc=yes,
957 gdb_cv_thread_db_h_has_td_notalloc=no
961 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
962 AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
963 [Define if <thread_db.h> has the TD_NOTALLOC error code.])
966 dnl See if we have a sys/syscall header file that has __NR_tkill.
967 if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
968 AC_CACHE_CHECK([whether <sys/syscall.h> has __NR_tkill],
969 gdb_cv_sys_syscall_h_has_tkill,
971 [#include <sys/syscall.h>],
972 [int i = __NR_tkill;],
973 gdb_cv_sys_syscall_h_has_tkill=yes,
974 gdb_cv_sys_syscall_h_has_tkill=no
978 dnl See if we can issue tkill syscall.
979 if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then
980 AC_DEFINE(HAVE_TKILL_SYSCALL, 1,
981 [Define if we can use the tkill syscall.])
984 dnl Handle optional features that can be enabled.
987 [ --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
989 case ${with_sysroot} in
990 yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
991 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
994 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
996 if test "x$exec_prefix" = xNONE; then
997 if test "x$prefix" = xNONE; then
998 test_prefix=/usr/local
1003 test_prefix=$exec_prefix
1005 case ${TARGET_SYSTEM_ROOT} in
1006 "${test_prefix}"|"${test_prefix}/"*|\
1007 '${exec_prefix}'|'${exec_prefix}/'*)
1008 t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
1009 TARGET_SYSTEM_ROOT_DEFINE="$t"
1014 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
1016 AC_SUBST(TARGET_SYSTEM_ROOT)
1017 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
1019 # NOTE: Don't add -Wall or -Wunused, they both include
1020 # -Wunused-parameter which reports bogus warnings.
1021 # NOTE: If you add to this list, remember to update
1022 # gdb/doc/gdbint.texinfo.
1023 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
1024 -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
1025 -Wunused-label -Wunused-function"
1026 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
1027 # -Wunused-function -Wunused-variable -Wunused-value
1028 # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
1029 # -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes
1030 # -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls
1031 # -Woverloaded-virtual -Winline -Werror"
1032 AC_ARG_ENABLE(build-warnings,
1033 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
1034 [case "${enableval}" in
1036 no) build_warnings="-w";;
1037 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1038 build_warnings="${build_warnings} ${t}";;
1039 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1040 build_warnings="${t} ${build_warnings}";;
1041 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1043 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
1044 echo "Setting compiler warning flags = $build_warnings" 6>&1
1046 AC_ARG_ENABLE(gdb-build-warnings,
1047 [ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used],
1048 [case "${enableval}" in
1050 no) build_warnings="-w";;
1051 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1052 build_warnings="${build_warnings} ${t}";;
1053 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1054 build_warnings="${t} ${build_warnings}";;
1055 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1057 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
1058 echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
1062 if test "x${build_warnings}" != x -a "x$GCC" = xyes
1064 AC_MSG_CHECKING(compiler warning flags)
1065 # Separate out the -Werror flag as some files just cannot be
1066 # compiled with it enabled.
1067 for w in ${build_warnings}; do
1069 -Werr*) WERROR_CFLAGS=-Werror ;;
1070 *) # Check that GCC accepts it
1071 saved_CFLAGS="$CFLAGS"
1073 AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
1074 CFLAGS="$saved_CFLAGS"
1077 AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS})
1079 AC_SUBST(WARN_CFLAGS)
1080 AC_SUBST(WERROR_CFLAGS)
1082 # In the Cygwin environment, we need some additional flags.
1083 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
1084 [AC_EGREP_CPP(lose, [
1085 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
1087 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
1090 dnl Figure out which of the many generic ser-*.c files the _host_ supports.
1091 SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
1093 *go32* ) SER_HARDWIRE=ser-go32.o ;;
1094 *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
1096 AC_SUBST(SER_HARDWIRE)
1098 # libreadline needs libuser32.a in a cygwin environment
1100 if test x$gdb_cv_os_cygwin = xyes; then
1101 WIN32LIBS="-luser32"
1103 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
1109 LIBGUI="../libgui/src/libgui.a"
1110 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
1112 AC_SUBST(GUI_CFLAGS_X)
1116 AC_SUBST(WIN32LDAPP)
1121 if test "${enable_gdbtk}" = "yes"; then
1123 # Gdbtk must have an absolute path to srcdir in order to run
1124 # properly when not installed.
1130 CY_AC_PATH_TCLCONFIG
1131 if test -z "${no_tcl}"; then
1132 CY_AC_LOAD_TCLCONFIG
1135 # now look for Tcl library stuff
1146 TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
1148 # If $no_tk is nonempty, then we can't do Tk, and there is no
1149 # point to doing Tcl.
1150 if test -z "${no_tk}"; then
1158 # now look for Tk library stuff
1169 TK_DEPS="${tkdir}${TK_LIB_FILE}"
1171 # now look for Itcl library stuff
1173 CY_AC_PATH_ITCLCONFIG
1174 if test -z "${no_itcl}"; then
1175 CY_AC_LOAD_ITCLCONFIG
1177 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
1178 ITCL_DEPS="${ITCL_LIB_FULL_PATH}"
1182 # now look for Itk library stuff
1183 CY_AC_PATH_ITKCONFIG
1184 if test -z "${no_itcl}"; then
1185 CY_AC_LOAD_ITKCONFIG
1187 ITKLIB="${ITK_BUILD_LIB_SPEC}"
1188 ITK_DEPS="${ITK_LIB_FULL_PATH}"
1191 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
1192 # Tcl/Tk 8.1 require -fwritable strings. I don't
1193 # know whether 8.2 will or not, but I bet it will.
1194 # I don't have to worry about 7.x since we don't support it.
1196 if test "$GCC" = "yes"; then
1197 if test "$TCL_VERSION" != "8.0" ; then
1198 GDBTK_CFLAGS="-fwritable-strings"
1202 # Include some libraries that Tcl and Tk want.
1203 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
1204 # Yes, the ordering seems wrong here. But it isn't.
1205 # TK_LIBS is the list of libraries that need to be linked
1206 # after Tcl/Tk. Note that this isn't put into LIBS. If it
1207 # were in LIBS then any link tests after this point would
1208 # try to include things like `$(LIBGUI)', which wouldn't work.
1209 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
1211 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
1212 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
1213 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
1214 CONFIG_ALL="${CONFIG_ALL} all-gdbtk"
1215 CONFIG_CLEAN="${CONFIG_CLEAN} clean-gdbtk"
1216 CONFIG_INSTALL="${CONFIG_INSTALL} install-gdbtk"
1217 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-gdbtk"
1219 if test x$gdb_cv_os_cygwin = xyes; then
1220 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
1221 WIN32LDAPP="-Wl,--subsystem,console"
1222 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
1227 configdirs="${configdirs} gdbtk"
1240 AC_SUBST(GDBTK_CFLAGS)
1241 AC_SUBST(GDBTK_SRC_DIR)
1246 # Unlike the sim directory, whether a simulator is linked is controlled by
1247 # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
1248 # This code just checks for a few cases where we'd like to ignore those
1249 # definitions, even when they're present in the '.mt' file. These cases
1250 # are when --disable-sim is specified, or if the simulator directory is
1251 # not part of the source tree.
1254 [ --enable-sim Link gdb with simulator],
1255 [echo "enable_sim = $enable_sim";
1256 echo "enableval = ${enableval}";
1257 case "${enableval}" in
1258 yes) ignore_sim=false ;;
1259 no) ignore_sim=true ;;
1260 *) ignore_sim=false ;;
1264 if test ! -d "${srcdir}/../sim"; then
1268 if test "${ignore_sim}" = "true"; then
1270 IGNORE_SIM_OBS="SIM_OBS="
1276 AC_SUBST(IGNORE_SIM)
1277 AC_SUBST(IGNORE_SIM_OBS)
1279 AC_SUBST(ENABLE_CFLAGS)
1280 AC_SUBST(PROFILE_CFLAGS)
1282 AC_SUBST(CONFIG_OBS)
1283 AC_SUBST(CONFIG_DEPS)
1284 AC_SUBST(CONFIG_SRCS)
1285 AC_SUBST(CONFIG_ALL)
1286 AC_SUBST(CONFIG_CLEAN)
1287 AC_SUBST(CONFIG_INSTALL)
1288 AC_SUBST(CONFIG_UNINSTALL)
1290 # target_subdir is used by the testsuite to find the target libraries.
1292 if test "${host}" != "${target}"; then
1293 target_subdir="${target_alias}/"
1295 AC_SUBST(target_subdir)
1298 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
1299 if test ! -f ${host_makefile_frag}; then
1300 # When building a native debuger the .mh file containing things
1301 # like NATDEPFILES is needed. Cross debuggers don't need .mh
1302 # since it no longer contains anything useful.
1303 if test "${target}" = "${host}"; then
1304 AC_MSG_ERROR("*** Gdb does not support native target ${host}")
1306 host_makefile_frag=/dev/null
1309 frags="$frags $host_makefile_frag"
1311 target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
1312 if test ! -f ${target_makefile_frag}; then
1313 AC_MSG_ERROR("*** Gdb does not support target ${target}")
1315 frags="$frags $target_makefile_frag"
1317 AC_SUBST_FILE(host_makefile_frag)
1318 AC_SUBST_FILE(target_makefile_frag)
1323 s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1324 ' ${host_makefile_frag}`
1326 targetfile=`sed -n '
1327 s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1328 ' ${target_makefile_frag}`
1330 if test "${target}" = "${host}"; then
1331 # We pick this up from the host configuration file (.mh) because we
1332 # do not have a native configuration Makefile fragment.
1333 nativefile=`sed -n '
1334 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1335 ' ${host_makefile_frag}`
1339 if test x"${gdb_osabi}" != x ; then
1340 AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
1341 [Define to the default OS ABI for this configuration.])
1344 # Enable multi-ice-gdb-server.
1345 AC_ARG_ENABLE(multi-ice,
1346 [ --enable-multi-ice build the multi-ice-gdb-server],
1350 *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;;
1352 if test "x$enable_multi_ice" = xyes; then
1353 configdirs="$configdirs multi-ice"
1356 # We only build gdbserver automatically if host and target are the same.
1357 if test "x$target" = "x$host"; then
1358 AC_MSG_CHECKING(whether gdbserver is supported on this host)
1359 if test "x$build_gdbserver" = xyes; then
1360 configdirs="$configdirs gdbserver"
1367 AC_CONFIG_SUBDIRS($configdirs)
1369 # If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
1370 # (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
1378 if test "${hostfile}" != ""; then
1380 GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}"
1381 files="${files} ${GDB_XM_FILE}"
1382 links="${links} xm.h"
1383 AC_DEFINE_UNQUOTED(GDB_XM_FILE, ${GDB_XM_FILE})
1389 if test "${targetfile}" != ""; then
1391 GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}"
1392 files="${files} ${GDB_TM_FILE}"
1393 links="${links} tm.h"
1394 AC_DEFINE_UNQUOTED(GDB_TM_FILE, ${GDB_TM_FILE})
1400 if test "${nativefile}" != ""; then
1402 GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}"
1403 files="${files} ${GDB_NM_FILE}"
1404 links="${links} nm.h"
1405 AC_DEFINE_UNQUOTED(GDB_NM_FILE, ${GDB_NM_FILE})
1409 AC_LINK_FILES($files, $links)
1411 dnl Check for exe extension set on certain hosts (e.g. Win32)
1414 dnl Detect the character set used by this host.
1416 dnl At the moment, we just assume it's ISO-8859-1 (which is a
1417 dnl superset of ASCII containing the characters needed for French,
1418 dnl German, Spanish, Italian, and possibly others), but if were
1419 dnl *were* to support any host character sets other than ISO-8859-1,
1420 dnl here's where we'd detect it.
1421 AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO-8859-1",
1422 [Define to be a string naming the default host character set.])
1426 AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
1428 dnl Autoconf doesn't provide a mechanism for modifying definitions
1429 dnl provided by makefile fragments.
1431 if test "${nativefile}" = ""; then
1433 sed -e '/^NATDEPFILES[[ ]]*=.*\\$/,/[[^\\]]$/s/^/# /' \
1434 -e '/^NATDEPFILES[[ ]]*=/s/^/# /' \
1435 | sed -e '/^\(NATDEPFILES[[ ]]*[[+]]=[[ ]]*\)/s//# \1/' \
1437 mv -f Makefile.tem Makefile
1441 sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
1442 /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
1443 /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
1444 mv -f Makefile.tmp Makefile
1448 case x$CONFIG_HEADERS in
1449 xconfig.h:config.in)
1454 gdb_host_cpu=$gdb_host_cpu
1455 gdb_target_cpu=$gdb_target_cpu
1456 nativefile=$nativefile