1 dnl Autoconf configure script for GDB, the GNU debugger.
2 dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 dnl 2005, 2006, 2007, 2008, 2009
4 dnl Free Software Foundation, Inc.
6 dnl This file is part of GDB.
8 dnl This program is free software; you can redistribute it and/or modify
9 dnl it under the terms of the GNU General Public License as published by
10 dnl the Free Software Foundation; either version 3 of the License, or
11 dnl (at your option) any later version.
13 dnl This program is distributed in the hope that it will be useful,
14 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 dnl GNU General Public License for more details.
18 dnl You should have received a copy of the GNU General Public License
19 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
21 dnl Process this file with autoconf to produce a configure script.
25 AC_CONFIG_HEADER(config.h:config.in)
38 # Dependency checking.
40 ZW_PROG_COMPILER_DEPENDENCIES([CC])
42 # Check for the 'make' the user wants to use.
43 AC_CHECK_PROGS(MAKE, make)
45 case "`$MAKE --version 2>&1 | sed 1q`" in
50 AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes)
53 dnl List of object files and targets accumulated by configure.
65 dnl Set up for gettext.
66 ZW_GNU_GETTEXT_SISTER_DIR
68 localedir='${datadir}/locale'
71 if test x"$USE_NLS" = xyes; then
72 CONFIG_ALL="$CONFIG_ALL all-po"
73 CONFIG_CLEAN="$CONFIG_CLEAN clean-po"
74 CONFIG_INSTALL="$CONFIG_INSTALL install-po"
75 CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-po"
80 # For Makefile dependencies.
82 if test x"$STDINT_H" != x; then
83 GNULIB_STDINT_H=gnulib/$STDINT_H
85 AC_SUBST(GNULIB_STDINT_H)
88 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
91 # GDB does not use automake, but gnulib does. This line lets us
92 # generate its Makefile.in.
93 AM_INIT_AUTOMAKE(gdb, UNUSED-VERSION, [no-define])
95 debugdir=${libdir}/debug
97 AC_ARG_WITH(separate-debug-dir,
98 AC_HELP_STRING([--with-separate-debug-dir=PATH], [look for global separate debug info in this path [LIBDIR/debug]]),
99 [debugdir="${withval}"])
101 AC_DEFINE_DIR(DEBUGDIR, debugdir,
102 [Global directory for separate debug files. ])
103 #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
105 if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
106 if test "x$prefix" = xNONE; then
107 test_prefix=/usr/local
112 test_prefix=$exec_prefix
115 "${test_prefix}"|"${test_prefix}/"*|\
116 '${exec_prefix}'|'${exec_prefix}/'*)
117 AC_DEFINE(DEBUGDIR_RELOCATABLE, 1, [Define if the debug directory should be relocated when GDB is moved.])
121 AC_ARG_WITH(relocated-sources,
122 AC_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this path for source files]),
123 [reloc_srcdir="${withval}"
124 AC_DEFINE_DIR(RELOC_SRCDIR, reloc_srcdir,
125 [Relocated directory for source files. ])
128 AC_CONFIG_SUBDIRS(doc testsuite)
130 # Check whether to support alternative target configurations
131 AC_ARG_ENABLE(targets,
132 AC_HELP_STRING([--enable-targets=TARGETS], [alternative target configurations]),
133 [case "${enableval}" in
134 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
136 no) enable_targets= ;;
137 *) enable_targets=$enableval ;;
140 # Check whether to enable 64-bit support on 32-bit hosts
141 AC_ARG_ENABLE(64-bit-bfd,
142 AC_HELP_STRING([--enable-64-bit-bfd], [64-bit support (on hosts with narrower word sizes)]),
143 [case "${enableval}" in
146 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
147 esac],[want64=false])dnl
149 # Provide defaults for some variables set by the per-host and per-target
151 gdb_host_obs=posix-hdep.o
153 if test "${target}" = "${host}"; then
159 . $srcdir/configure.host
161 # Accumulate some settings from configure.tgt over all enabled targets
166 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
168 if test "$targ_alias" = "all"; then
171 # Canonicalize the secondary target names.
172 result=`$ac_config_sub $targ_alias 2>/dev/null`
173 if test -n "$result"; then
179 . ${srcdir}/configure.tgt
181 # Target-specific object files
182 for i in ${gdb_target_obs}; do
183 case " $TARGET_OBS " in
186 TARGET_OBS="$TARGET_OBS ${i}"
191 # Check whether this target needs 64-bit CORE_ADDR
192 if test x${want64} = xfalse; then
193 . ${srcdir}/../bfd/config.bfd
198 if test x${all_targets} = xtrue; then
200 # We want all 64-bit targets if we either:
201 # - run on a 64-bit host or
202 # - already require 64-bit support for some other target or
203 # - the --enable-64-bit-bfd option was supplied
204 # Otherwise we only support all 32-bit targets.
206 # NOTE: This test must be in sync with the corresponding
209 if test x${want64} = xfalse; then
210 AC_CHECK_SIZEOF(long)
211 if test "x${ac_cv_sizeof_long}" = "x8"; then
215 if test x${want64} = xtrue; then
216 TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
218 TARGET_OBS='$(ALL_TARGET_OBS)'
224 # For other settings, only the main target counts.
228 targ=$target; . ${srcdir}/configure.tgt
230 # Fetch the default architecture and default target vector from BFD.
231 targ=$target; . $srcdir/../bfd/config.bfd
233 # We only want the first architecture, so strip off the others if
234 # there is more than one.
235 targ_archs=`echo $targ_archs | sed 's/ .*//'`
237 if test "x$targ_archs" != x; then
238 AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, $targ_archs,
239 [Define to BFD's default architecture. ])
241 if test "x$targ_defvec" != x; then
242 AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, $targ_defvec,
243 [Define to BFD's default target vector. ])
246 # The CLI cannot be disabled yet, but may be in the future.
249 AC_ARG_ENABLE(gdbcli,
250 AC_HELP_STRING([--disable-gdbcli], [disable command-line interface (CLI)]),
255 AC_MSG_ERROR([the command-line interface cannot be disabled yet]) ;;
257 AC_MSG_ERROR([bad value $enableval for --enable-gdbcli]) ;;
260 if test x"$enable_gdbcli" = xyes; then
261 if test -d $srcdir/cli; then
262 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)"
263 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)"
264 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)"
265 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
271 AC_HELP_STRING([--disable-gdbmi], [disable machine-interface (MI)]),
276 AC_MSG_ERROR([bad value $enableval for --enable-gdbmi]) ;;
279 if test x"$enable_gdbmi" = xyes; then
280 if test -d $srcdir/mi; then
281 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)"
282 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)"
283 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)"
284 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
290 AC_HELP_STRING([--enable-tui], [enable full-screen terminal user interface (TUI)]),
295 AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
296 esac],enable_tui=auto)
300 AC_HELP_STRING([--enable-gdbtk], [enable gdbtk graphical user interface (GUI)]),
305 AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
307 [if test -d $srcdir/gdbtk; then
312 # We unconditionally disable gdbtk tests on selected platforms.
315 AC_MSG_WARN([gdbtk isn't supported on $host; disabling])
320 AC_ARG_WITH(libunwind,
321 AC_HELP_STRING([--with-libunwind], [use libunwind frame unwinding support]),
322 [case "${withval}" in
323 yes) enable_libunwind=yes ;;
324 no) enable_libunwind=no ;;
325 *) AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;;
327 AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
328 if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
329 enable_libunwind=yes;
333 if test x"$enable_libunwind" = xyes; then
334 AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
335 AC_DEFINE(HAVE_LIBUNWIND, 1, [Define if libunwind library is being used.])
336 CONFIG_OBS="$CONFIG_OBS libunwind-frame.o"
337 CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o"
338 CONFIG_SRCS="$CONFIG_SRCS libunwind-frame.c"
342 AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
345 if test "$opt_curses" = "yes"; then
350 AC_ARG_ENABLE(profiling,
351 AC_HELP_STRING([--enable-profiling], [enable profiling of GDB]),
356 AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
358 [enable_profiling=no])
360 AC_CHECK_FUNCS(monstartup _mcleanup)
361 AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
366 [free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
367 if test $ac_cv_var__etext = yes; then
368 AC_DEFINE(HAVE__ETEXT, 1,
369 [Define to 1 if your system has the _etext variable. ])
371 AC_CACHE_CHECK([for etext], ac_cv_var_etext,
376 [free (&etext);], ac_cv_var_etext=yes, ac_cv_var_etext=no)])
377 if test $ac_cv_var_etext = yes; then
378 AC_DEFINE(HAVE_ETEXT, 1,
379 [Define to 1 if your system has the etext variable. ])
381 if test "$enable_profiling" = yes ; then
382 if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
383 AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
387 CFLAGS="$CFLAGS $PROFILE_CFLAGS"
389 AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
390 [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
391 ac_cv_cc_supports_pg=no)])
393 if test $ac_cv_cc_supports_pg = no; then
394 AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
400 ACX_PKGVERSION([GDB])
401 ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
402 AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
403 AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
405 # --------------------- #
406 # Checks for programs. #
407 # --------------------- #
415 AC_CHECK_TOOL(AR, ar)
416 AC_CHECK_TOOL(DLLTOOL, dlltool)
417 AC_CHECK_TOOL(WINDRES, windres)
419 # Needed for GNU/Hurd.
420 AC_CHECK_TOOL(MIG, mig)
422 # ---------------------- #
423 # Checks for libraries. #
424 # ---------------------- #
426 # We might need to link with -lm; most simulators need it.
427 AC_CHECK_LIB(m, main)
429 # We need to link with -lw to get `wctype' on Solaris before Solaris
430 # 2.6. Solaris 2.6 and beyond have this function in libc, and have a
431 # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
432 # is known to have this problem). Therefore we avoid libw if we can.
433 AC_CHECK_FUNC(wctype, [],
434 [AC_CHECK_LIB(w, wctype)])
436 # Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
437 AC_SEARCH_LIBS(gethostbyname, nsl)
439 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
440 AC_SEARCH_LIBS(socketpair, socket)
442 # Link in zlib if we can. This allows us to read compressed debug sections.
443 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
445 # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
446 AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
450 # On alpha-osf, it appears that libtermcap and libcurses are not compatible.
451 # There is a very specific comment in /usr/include/curses.h explaining that
452 # termcap routines built into libcurses must not be used.
454 # The symptoms we observed so far is GDB unexpectedly changing
455 # the terminal settings when tgetent is called - this is particularly
456 # visible as the output is missing carriage returns, and so rapidly
457 # becomes very hard to read.
459 # The readline configure script has already decided that libtermcap
460 # was enough for its purposes, and so decided to build readline using
461 # libtermcap. Since the TUI mode requires curses, building GDB with
462 # TUI enabled results in both libraries to be used at the same time,
463 # which is not allowed. This basically means that GDB with TUI is
464 # broken on alpha-osf.
468 if "$enable_tui" = "yes"; then
469 AC_MSG_ERROR([Building GDB with TUI mode is not supported on this host])
471 if "$enable_tui" = "auto"; then
477 # For the TUI, we need enhanced curses functionality.
478 if test x"$enable_tui" != xno; then
483 if test x"$prefer_curses" = xyes; then
484 # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied
485 # curses library because the latter might not provide all the
486 # functionality we need. However, this leads to problems on systems
487 # where the linker searches /usr/local/lib, but the compiler doesn't
488 # search /usr/local/include, if ncurses is installed in /usr/local. A
489 # default installation of ncurses on alpha*-dec-osf* will lead to such
491 AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
493 if test "$ac_cv_search_waddstr" != no; then
498 # Check whether we should enable the TUI, but only do so if we really
500 if test x"$enable_tui" != xno; then
501 if test -d $srcdir/tui; then
502 if test "$curses_found" != no; then
503 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
504 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
505 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
506 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
507 CONFIG_ALL="${CONFIG_ALL} all-tui"
508 CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui"
509 CONFIG_INSTALL="${CONFIG_INSTALL} install-tui"
510 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui"
512 if test x"$enable_tui" = xyes; then
513 AC_MSG_ERROR([no enhanced curses library found; disable TUI])
515 AC_MSG_WARN([no enhanced curses library found; disabling TUI])
521 # Since GDB uses Readline, we need termcap functionality. In many
522 # cases this will be provided by the curses library, but some systems
523 # have a seperate termcap library, or no curses library at all.
527 if test -d $srcdir/libtermcap; then
528 LIBS="../libtermcap/libtermcap.a $LIBS"
529 ac_cv_search_tgetent="../libtermcap/libtermcap.a"
532 ac_cv_search_tgetent="none required"
535 ac_cv_search_tgetent="none required"
536 CONFIG_OBS="$CONFIG_OBS windows-termcap.o"
540 # These are the libraries checked by Readline.
541 AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
543 if test "$ac_cv_search_tgetent" = no; then
544 AC_MSG_ERROR([no termcap library found])
547 AC_ARG_WITH([system-readline],
548 [AS_HELP_STRING([--with-system-readline],
549 [use installed readline library])])
551 if test "$with_system_readline" = yes; then
556 READLINE='$(READLINE_DIR)/libreadline.a'
557 READLINE_DEPS='$(READLINE)'
558 READLINE_CFLAGS='-I$(READLINE_SRC)/..'
561 AC_SUBST(READLINE_DEPS)
562 AC_SUBST(READLINE_CFLAGS)
565 AS_HELP_STRING([--with-expat], [include expat support (auto/yes/no)]),
566 [], [with_expat=auto])
567 AC_MSG_CHECKING([whether to use expat])
568 AC_MSG_RESULT([$with_expat])
570 if test "${with_expat}" = no; then
571 AC_MSG_WARN([expat support disabled; some features may be unavailable.])
574 AC_LIB_HAVE_LINKFLAGS([expat], [], [#include "expat.h"],
575 [XML_Parser p = XML_ParserCreate (0);])
576 if test "$HAVE_LIBEXPAT" != yes; then
577 if test "$with_expat" = yes; then
578 AC_MSG_ERROR([expat is missing or unusable])
580 AC_MSG_WARN([expat is missing or unusable; some features may be unavailable.])
584 LIBS="$LIBS $LIBEXPAT"
585 AC_CHECK_FUNCS(XML_StopParser)
590 dnl Utility to simplify finding libpython.
591 AC_DEFUN([AC_TRY_LIBPYTHON],
594 define([have_libpython_var],$2)
595 define([VERSION],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
596 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
598 AC_MSG_CHECKING([for ${version}])
600 LIBS="$LIBS -l${version}"
601 AC_LINK_IFELSE(AC_LANG_PROGRAM([[#include "${version}/Python.h"]],
602 [[Py_Initialize ();]]),
603 [[HAVE_LIB]VERSION=yes
604 have_libpython_var=yes],
606 AC_MSG_RESULT([$[HAVE_LIB]VERSION])
610 AS_HELP_STRING([--with-python], [include python support (auto/yes/no/<path>)]),
611 [], [with_python=auto])
612 AC_MSG_CHECKING([whether to use python])
613 AC_MSG_RESULT([$with_python])
615 if test "${with_python}" = no; then
616 AC_MSG_WARN([python support disabled; some features may be unavailable.])
619 case "${with_python}" in
621 # Leave as empty, use defaults.
626 python_includes="-I${with_python}/include"
627 python_libs="-L${with_python}/lib"
630 AC_ERROR(invalid value for --with-python)
634 save_CPPFLAGS=$CPPFLAGS
635 CPPFLAGS="$CPPFLAGS ${python_includes}"
637 LIBS="$LIBS ${python_libs}"
639 if test "${have_libpython}" = no; then
640 AC_TRY_LIBPYTHON(python2.6, have_libpython)
641 if test "${HAVE_LIBPYTHON2_6}" = yes; then
642 AC_DEFINE(HAVE_LIBPYTHON2_6, 1, [Define if Python 2.6 is being used.])
645 if test ${have_libpython} = no; then
646 AC_TRY_LIBPYTHON(python2.5, have_libpython)
647 if test "${HAVE_LIBPYTHON2_5}" = yes; then
648 AC_DEFINE(HAVE_LIBPYTHON2_5, 1, [Define if Python 2.5 is being used.])
651 if test ${have_libpython} = no; then
652 AC_TRY_LIBPYTHON(python2.4, have_libpython)
653 if test "${HAVE_LIBPYTHON2_4}" = yes; then
654 AC_DEFINE(HAVE_LIBPYTHON2_4, 1, [Define if Python 2.4 is being used.])
657 if test ${have_libpython} = no; then
658 case "${with_python}" in
660 AC_MSG_ERROR([python is missing or unusable])
663 AC_MSG_WARN([python is missing or unusable; some features may be unavailable.])
666 AC_MSG_ERROR([no usable python found at ${with_python}])
669 CPPFLAGS=$save_CPPFLAGS
674 if test "${have_libpython}" = yes; then
675 AC_DEFINE(HAVE_PYTHON, 1, [Define if Python interpreter is being linked in.])
676 CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_PYTHON_OBS)"
677 CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)"
678 CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)"
679 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)"
681 # Flags needed to compile Python code (taken from python-config --cflags).
682 # We cannot call python-config directly because it will output whatever was
683 # used when compiling the Python interpreter itself, including flags which
684 # would make the python-related objects be compiled differently from the
685 # rest of GDB (e.g., -O2 and -fPIC).
686 if test "${GCC}" = yes; then
687 tentative_python_cflags="-fno-strict-aliasing -DNDEBUG -fwrapv"
690 if test "x${tentative_python_cflags}" != x; then
691 AC_MSG_CHECKING(compiler flags for python code)
692 for flag in ${tentative_python_cflags}; do
693 # Check that the compiler accepts it
694 saved_CFLAGS="$CFLAGS"
695 CFLAGS="$CFLAGS $flag"
696 AC_TRY_COMPILE([],[],PYTHON_CFLAGS="${PYTHON_CFLAGS} $flag",)
697 CFLAGS="$saved_CFLAGS"
699 AC_MSG_RESULT(${PYTHON_CFLAGS})
702 # Even if Python support is not compiled in, we need to have these files
703 # included in order to recognize the GDB command "python".
704 CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
705 CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
707 AC_SUBST(PYTHON_CFLAGS)
709 # ------------------------- #
710 # Checks for header files. #
711 # ------------------------- #
716 # elf_hp.h is for HP/UX 64-bit shared library support.
717 # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
718 # unconditionally, so what's the point in checking these?
719 AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
720 thread_db.h gnu/libc-version.h signal.h stddef.h \
721 stdlib.h string.h memory.h strings.h sys/fault.h \
722 sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
723 sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
724 sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
725 sys/types.h sys/wait.h wait.h termios.h termio.h \
726 sgtty.h unistd.h elf_hp.h ctype.h time.h locale.h])
727 AC_CHECK_HEADERS(link.h, [], [],
728 [#if HAVE_SYS_TYPES_H
729 # include <sys/types.h>
735 AC_CHECK_HEADERS(sys/proc.h, [], [],
736 [#if HAVE_SYS_PARAM_H
737 # include <sys/param.h>
740 AC_CHECK_HEADERS(sys/user.h, [], [],
741 [#if HAVE_SYS_PARAM_H
742 # include <sys/param.h>
746 # On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash
747 # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
748 # think that we don't have <curses.h> if we're using GCC.
751 if test "$GCC" = yes; then
752 AC_DEFINE(_MSE_INT_H, 1,
753 [Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
754 Solaris 2.[789] when using GCC. ])
757 AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h)
758 AC_CHECK_HEADERS(term.h, [], [],
764 # ------------------------- #
765 # Checks for declarations. #
766 # ------------------------- #
768 AC_CHECK_DECLS([free, malloc, realloc, strerror, strstr, getopt,
769 snprintf, vsnprintf])
772 # ----------------------- #
773 # Checks for structures. #
774 # ----------------------- #
776 AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
778 # ------------------ #
779 # Checks for types. #
780 # ------------------ #
783 AC_CHECK_TYPES(socklen_t, [], [],
784 [#include <sys/types.h>
785 #include <sys/socket.h>
788 # ------------------------------------- #
789 # Checks for compiler characteristics. #
790 # ------------------------------------- #
796 # ------------------------------ #
797 # Checks for library functions. #
798 # ------------------------------ #
803 AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \
804 getgid poll pread64 sbrk setpgid setpgrp setsid \
805 sigaction sigprocmask sigsetmask socketpair syscall \
806 ttrace wborder setlocale iconvlist libiconvlist btowc])
809 # Check the return and argument types of ptrace. No canned test for
810 # this, so roll our own.
813 # include <sys/types.h>
815 #if HAVE_SYS_PTRACE_H
816 # include <sys/ptrace.h>
822 # There is no point in checking if we don't have a prototype.
823 AC_CHECK_DECLS(ptrace, [], [
824 : ${gdb_cv_func_ptrace_ret='int'}
825 : ${gdb_cv_func_ptrace_args='int,int,long,long'}
826 ], $gdb_ptrace_headers)
827 # Check return type. Varargs (used on GNU/Linux) conflict with the
828 # empty argument list, so check for that explicitly.
829 AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret,
830 AC_TRY_COMPILE($gdb_ptrace_headers,
831 [extern long ptrace (enum __ptrace_request, ...);],
832 gdb_cv_func_ptrace_ret='long',
833 AC_TRY_COMPILE($gdb_ptrace_headers,
834 [extern int ptrace ();],
835 gdb_cv_func_ptrace_ret='int',
836 gdb_cv_func_ptrace_ret='long')))
837 AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret,
838 [Define as the return type of ptrace.])
839 # Check argument types.
840 AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [
841 AC_TRY_COMPILE($gdb_ptrace_headers,
842 [extern long ptrace (enum __ptrace_request, ...);],
843 [gdb_cv_func_ptrace_args='int,int,long,long'],[
844 for gdb_arg1 in 'int' 'long'; do
845 for gdb_arg2 in 'pid_t' 'int' 'long'; do
846 for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
847 for gdb_arg4 in 'int' 'long'; do
848 AC_TRY_COMPILE($gdb_ptrace_headers, [
849 extern $gdb_cv_func_ptrace_ret
850 ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4);
851 ], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4";
853 for gdb_arg5 in 'int *' 'int' 'long'; do
854 AC_TRY_COMPILE($gdb_ptrace_headers, [
855 extern $gdb_cv_func_ptrace_ret
856 ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
858 gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
865 # Provide a safe default value.
866 : ${gdb_cv_func_ptrace_args='int,int,long,long'}
868 ac_save_IFS=$IFS; IFS=','
869 set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
872 AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3],
873 [Define to the type of arg 3 for ptrace.])
874 if test -n "$[5]"; then
875 AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5],
876 [Define to the type of arg 5 for ptrace.])
879 dnl AC_FUNC_SETPGRP does not work when cross compiling
880 dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
881 if test "$cross_compiling" = no; then
884 AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
888 if (setpgrp(1,1) == -1)
892 ], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
893 if test $ac_cv_func_setpgrp_void = yes; then
894 AC_DEFINE(SETPGRP_VOID, 1)
898 # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
899 # since sigsetjmp might only be defined as a macro.
900 AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
903 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
904 gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
905 if test $gdb_cv_func_sigsetjmp = yes; then
906 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
909 # Assume we'll default to using the included libiberty regex.
910 gdb_use_included_regex=yes
912 # However, if the system regex is GNU regex, then default to *not*
913 # using the included regex.
916 [gdb_cv_have_gnu_regex],
918 [#include <gnu-versions.h>],
919 [#define REGEX_INTERFACE_VERSION 1
920 #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
921 # error "Version mismatch"
923 gdb_cv_have_gnu_regex=yes,
924 gdb_cv_have_gnu_regex=no)])
925 if test $gdb_cv_have_gnu_regex = yes; then
926 gdb_use_included_regex=no
929 AC_ARG_WITH(included-regex,
930 AC_HELP_STRING([--without-included-regex], [don't use included regex; this is the default on systems with version 2 of the GNU C library (use with caution on other system)]),
931 gdb_with_regex=$withval,
932 gdb_with_regex=$gdb_use_included_regex)
933 if test "$gdb_with_regex" = yes; then
934 AC_DEFINE(USE_INCLUDED_REGEX, 1,
935 [Define to 1 if the regex included in libiberty should be used.])
938 # Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
939 AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
940 [#include <sys/param.h>
941 #include <sys/proc.h>
944 # See if <sys/lwp.h> defines `struct lwp`.
945 AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
946 [AC_TRY_COMPILE([#include <sys/param.h>
947 #include <sys/lwp.h>], [struct lwp l;],
948 gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)])
949 if test $gdb_cv_struct_lwp = yes; then
950 AC_DEFINE(HAVE_STRUCT_LWP, 1,
951 [Define to 1 if your system has struct lwp.])
954 # See if <machine/reg.h> degines `struct reg'.
955 AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg,
956 [AC_TRY_COMPILE([#include <sys/types.h>
957 #include <machine/reg.h>], [struct reg r;],
958 gdb_cv_struct_reg=yes, gdb_cv_struct_reg=no)])
959 if test $gdb_cv_struct_reg = yes; then
960 AC_DEFINE(HAVE_STRUCT_REG, 1,
961 [Define to 1 if your system has struct reg in <machine/reg.h>.])
964 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
965 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
966 AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [],
967 [#include <machine/reg.h>])
969 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
970 AC_MSG_CHECKING(for PTRACE_GETREGS)
971 AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
972 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
974 [gdb_cv_have_ptrace_getregs=yes],
975 [gdb_cv_have_ptrace_getregs=no])])
976 AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
977 if test $gdb_cv_have_ptrace_getregs = yes; then
978 AC_DEFINE(HAVE_PTRACE_GETREGS, 1,
979 [Define if sys/ptrace.h defines the PTRACE_GETREGS request.])
982 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
983 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
984 AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
985 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
986 [PTRACE_GETFPXREGS;],
987 [gdb_cv_have_ptrace_getfpxregs=yes],
988 [gdb_cv_have_ptrace_getfpxregs=no])])
989 AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
990 if test $gdb_cv_have_ptrace_getfpxregs = yes; then
991 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
992 [Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request.])
995 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
996 AC_MSG_CHECKING(for PT_GETDBREGS)
997 AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
998 [AC_TRY_COMPILE([#include <sys/types.h>
999 #include <sys/ptrace.h>],
1001 [gdb_cv_have_pt_getdbregs=yes],
1002 [gdb_cv_have_pt_getdbregs=no])])
1003 AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
1004 if test $gdb_cv_have_pt_getdbregs = yes; then
1005 AC_DEFINE(HAVE_PT_GETDBREGS, 1,
1006 [Define if sys/ptrace.h defines the PT_GETDBREGS request.])
1009 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
1010 AC_MSG_CHECKING(for PT_GETXMMREGS)
1011 AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
1012 [AC_TRY_COMPILE([#include <sys/types.h>
1013 #include <sys/ptrace.h>],
1015 [gdb_cv_have_pt_getxmmregs=yes],
1016 [gdb_cv_have_pt_getxmmregs=no])])
1017 AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
1018 if test $gdb_cv_have_pt_getxmmregs = yes; then
1019 AC_DEFINE(HAVE_PT_GETXMMREGS, 1,
1020 [Define if sys/ptrace.h defines the PT_GETXMMREGS request.])
1023 # Detect which type of /proc is in use, such as for Unixware or Solaris.
1025 if test "${target}" = "${host}"; then
1027 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
1028 AC_DEFINE(NEW_PROC_API, 1,
1029 [Define if you want to use new multi-fd /proc interface
1030 (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
1032 *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]]*)
1033 AC_DEFINE(NEW_PROC_API, 1,
1034 [Define if you want to use new multi-fd /proc interface
1035 (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
1038 # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5.
1039 AC_DEFINE([_KMEMUSER], 1,
1040 [Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
1041 around a <sys/proc.h> problem on IRIX 5.])
1046 if test "$ac_cv_header_sys_procfs_h" = yes; then
1047 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
1048 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
1049 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
1050 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
1051 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
1052 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
1053 BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t)
1054 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t)
1055 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
1056 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
1057 BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t)
1058 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t)
1059 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t)
1060 BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t)
1063 dnl Check for broken prfpregset_t type
1065 dnl For Linux/i386, glibc 2.1.3 was released with a bogus
1066 dnl prfpregset_t type (it's a typedef for the pointer to a struct
1067 dnl instead of the struct itself). We detect this here, and work
1068 dnl around it in gdb_proc_service.h.
1070 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
1071 AC_MSG_CHECKING(whether prfpregset_t type is broken)
1072 AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
1073 [AC_TRY_RUN([#include <sys/procfs.h>
1076 if (sizeof (prfpregset_t) == sizeof (void *))
1080 gdb_cv_prfpregset_t_broken=no,
1081 gdb_cv_prfpregset_t_broken=yes,
1082 gdb_cv_prfpregset_t_broken=yes)])
1083 AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
1084 if test $gdb_cv_prfpregset_t_broken = yes; then
1085 AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
1086 [Define if the prfpregset_t type is broken.])
1090 dnl Check for PIOCSET ioctl entry
1092 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
1093 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
1094 [AC_TRY_COMPILE([#include <unistd.h>
1095 #include <sys/types.h>
1096 #include <sys/procfs.h>
1099 dummy = ioctl(0, PIOCSET, &dummy);
1101 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
1102 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
1103 if test $gdb_cv_have_procfs_piocset = yes; then
1104 AC_DEFINE(HAVE_PROCFS_PIOCSET, 1,
1105 [Define if ioctl argument PIOCSET is available.])
1109 dnl For native ports (host == target), check to see what kind of
1110 dnl legacy link.h support is needed. (See solib-legacy.c.)
1111 if test ${host} = ${target} ; then
1112 dnl Check for struct link_map with l_ members which are indicative
1113 dnl of SVR4-like shared libraries
1115 AC_MSG_CHECKING(for member l_addr in struct link_map)
1116 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members,
1117 [AC_TRY_COMPILE([#include <link.h>],
1118 [struct link_map lm; (void) lm.l_addr;],
1119 gdb_cv_have_struct_link_map_with_l_members=yes,
1120 gdb_cv_have_struct_link_map_with_l_members=no)])
1121 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members)
1122 if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
1123 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS,1,
1124 [Define if <link.h> exists and defines struct link_map which has
1125 members with an ``l_'' prefix. (For Solaris, SVR4, and
1126 SVR4-like systems.)])
1129 dnl Check for struct link_map with lm_ members which are indicative
1130 dnl of SunOS-like shared libraries
1132 AC_MSG_CHECKING(for member lm_addr in struct link_map)
1133 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members,
1134 [AC_TRY_COMPILE([#include <sys/types.h>
1136 [struct link_map lm; (void) lm.lm_addr;],
1137 gdb_cv_have_struct_link_map_with_lm_members=yes,
1138 gdb_cv_have_struct_link_map_with_lm_members=no)])
1139 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members)
1140 if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
1141 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS, 1,
1142 [Define if <link.h> exists and defines struct link_map which has
1143 members with an ``lm_'' prefix. (For SunOS.)])
1146 dnl Check for struct so_map with som_ members which are found on
1147 dnl some *BSD systems.
1149 AC_MSG_CHECKING(for member som_addr in struct so_map)
1150 AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members,
1151 [AC_TRY_COMPILE([#include <sys/types.h>
1156 [struct so_map lm; (void) lm.som_addr;],
1157 gdb_cv_have_struct_so_map_with_som_members=yes,
1158 gdb_cv_have_struct_so_map_with_som_members=no)])
1159 AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members)
1160 if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
1161 AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS, 1,
1162 [Define if <link.h> exists and defines a struct so_map which has
1163 members with an ``som_'' prefix. (Found on older *BSD systems.)])
1166 dnl Check for struct link_map32 type, which allows a 64-bit Solaris
1167 dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries.
1169 AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
1170 AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
1171 [AC_TRY_COMPILE([#define _SYSCALL32
1172 #include <sys/link.h>], [struct link_map32 l;],
1173 gdb_cv_have_struct_link_map32=yes,
1174 gdb_cv_have_struct_link_map32=no)])
1175 AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
1176 if test $gdb_cv_have_struct_link_map32 = yes; then
1177 AC_DEFINE(HAVE_STRUCT_LINK_MAP32, 1,
1178 [Define if <sys/link.h> has struct link_map32])
1179 AC_DEFINE(_SYSCALL32, 1,
1180 [Define if <sys/link.h> has link_map32 (solaris sparc-64 target)])
1184 # Check if the compiler supports the `long long' type.
1186 AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long,
1187 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1188 [[extern long long foo;]],
1189 [[switch (foo & 2) { case 0: return 1; }]])],
1190 gdb_cv_c_long_long=yes,
1191 gdb_cv_c_long_long=no)])
1192 if test $gdb_cv_c_long_long = yes; then
1193 AC_DEFINE(CC_HAS_LONG_LONG, 1,
1194 [Define to 1 if the compiler supports long long.])
1197 # Check if the compiler and runtime support printing long longs.
1199 AC_CACHE_CHECK([for long long support in printf],
1200 gdb_cv_printf_has_long_long,
1201 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1204 l = (l << 16) + 0x0123;
1205 l = (l << 16) + 0x4567;
1206 l = (l << 16) + 0x89ab;
1207 l = (l << 16) + 0xcdef;
1208 sprintf (buf, "0x%016llx", l);
1209 return (strcmp ("0x0123456789abcdef", buf));]])],
1210 gdb_cv_printf_has_long_long=yes,
1211 gdb_cv_printf_has_long_long=no,
1212 gdb_cv_printf_has_long_long=no)])
1213 if test $gdb_cv_printf_has_long_long = yes; then
1214 AC_DEFINE(PRINTF_HAS_LONG_LONG, 1,
1215 [Define to 1 if the "%ll" format works to print long longs.])
1218 # Check if the compiler and runtime support printing decfloats.
1220 AC_CACHE_CHECK([for decfloat support in printf],
1221 gdb_cv_printf_has_decfloat,
1222 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1224 _Decimal32 d32 = 1.2345df;
1225 _Decimal64 d64 = 1.2345dd;
1226 _Decimal128 d128 = 1.2345dl;
1227 sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128);
1228 return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf));]])],
1229 gdb_cv_printf_has_decfloat=yes,
1230 gdb_cv_printf_has_decfloat=no,
1231 gdb_cv_printf_has_decfloat=no)])
1232 if test $gdb_cv_printf_has_decfloat = yes; then
1233 AC_DEFINE(PRINTF_HAS_DECFLOAT, 1,
1234 [Define to 1 if the "%H, %D and %DD" formats work to print decfloats.])
1237 # Check if the compiler supports the `long double' type. We can't use
1238 # AC_C_LONG_DOUBLE because that one does additional checks on the
1239 # constants defined in <float.h> that fail on some systems,
1240 # e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
1242 AC_CACHE_CHECK([for long double support in compiler], gdb_cv_c_long_double,
1243 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long double foo;]])],
1244 gdb_cv_c_long_double=yes,
1245 gdb_cv_c_long_double=no)])
1246 if test $gdb_cv_c_long_double = yes; then
1247 AC_DEFINE(HAVE_LONG_DOUBLE, 1,
1248 [Define to 1 if the compiler supports long double.])
1251 # Check if the compiler and runtime support printing long doubles.
1253 AC_CACHE_CHECK([for long double support in printf],
1254 gdb_cv_printf_has_long_double,
1255 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1257 long double f = 3.141592653;
1258 sprintf (buf, "%Lg", f);
1259 return (strncmp ("3.14159", buf, 7));]])],
1260 gdb_cv_printf_has_long_double=yes,
1261 gdb_cv_printf_has_long_double=no,
1262 gdb_cv_printf_has_long_double=no)])
1263 if test $gdb_cv_printf_has_long_double = yes; then
1264 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE, 1,
1265 [Define to 1 if the "%Lg" format works to print long doubles.])
1268 # Check if the compiler and runtime support scanning long doubles.
1270 AC_CACHE_CHECK([for long double support in scanf],
1271 gdb_cv_scanf_has_long_double,
1272 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
1273 [[#include <stdio.h>]],
1274 [[char *buf = "3.141592653";
1276 sscanf (buf, "%Lg", &f);
1277 return !(f > 3.14159 && f < 3.14160);]])],
1278 gdb_cv_scanf_has_long_double=yes,
1279 gdb_cv_scanf_has_long_double=no,
1280 gdb_cv_scanf_has_long_double=no)])
1281 if test $gdb_cv_scanf_has_long_double = yes; then
1282 AC_DEFINE(SCANF_HAS_LONG_DOUBLE, 1,
1283 [Define to 1 if the "%Lg" format works to scan long doubles.])
1288 AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
1289 SAVE_LDFLAGS=$LDFLAGS
1292 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
1293 *) gdb_cv_bigtoc=-bbigtoc ;;
1296 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
1297 AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
1298 LDFLAGS="${SAVE_LDFLAGS}"
1300 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
1305 dnl For certain native configurations, we need to check whether thread
1306 dnl support can be built in or not.
1308 dnl Note that we only want this if we are both native (host == target),
1309 dnl and not doing a canadian cross build (build == host).
1311 if test ${build} = ${host} -a ${host} = ${target} ; then
1314 AC_MSG_CHECKING(for HPUX/OSF thread support)
1315 if test -f /usr/include/dce/cma_config.h ; then
1316 if test "$GCC" = "yes" ; then
1318 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT, 1,
1319 [Define if you have HPUX threads])
1320 CONFIG_OBS="${CONFIG_OBS} hpux-thread.o"
1321 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
1323 AC_MSG_RESULT(no (suppressed because you are not using GCC))
1330 # See if thread_db library is around for Solaris thread debugging.
1331 # Note that we must explicitly test for version 1 of the library
1332 # because version 0 (present on Solaris 2.4 or earlier) doesn't have
1334 AC_MSG_CHECKING(for Solaris thread debugging library)
1335 if test -f /usr/lib/libthread_db.so.1 ; then
1337 AC_DEFINE(HAVE_THREAD_DB_LIB, 1,
1338 [Define if using Solaris thread debugging.])
1339 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
1340 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
1341 AC_CHECK_LIB(dl, dlopen)
1342 if test "$GCC" = "yes" ; then
1343 # The GNU linker requires the -export-dynamic option to make
1344 # all symbols visible in the dynamic symbol table.
1345 hold_ldflags=$LDFLAGS
1346 AC_MSG_CHECKING(for the ld -export-dynamic flag)
1347 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1348 AC_TRY_LINK(, [int i;], found=yes, found=no)
1349 LDFLAGS=$hold_ldflags
1350 AC_MSG_RESULT($found)
1351 if test $found = yes; then
1352 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
1355 # Sun randomly tweaked the prototypes in <proc_service.h>
1357 AC_MSG_CHECKING(if <proc_service.h> is old)
1358 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
1360 #include <proc_service.h>
1362 (struct ps_prochandle*, psaddr_t, const void*, size_t);
1363 ],, gdb_cv_proc_service_is_old=no,
1364 gdb_cv_proc_service_is_old=yes)
1366 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
1367 if test $gdb_cv_proc_service_is_old = yes; then
1368 AC_DEFINE(PROC_SERVICE_IS_OLD, 1,
1369 [Define if <proc_service.h> on solaris uses int instead of
1370 size_t, and assorted other type changes.])
1377 AC_MSG_CHECKING(for AiX thread debugging library)
1378 AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
1379 [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
1380 [#ifndef PTHDB_VERSION_3
1383 gdb_cv_have_aix_thread_debug=yes,
1384 gdb_cv_have_aix_thread_debug=no)])
1385 AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
1386 if test $gdb_cv_have_aix_thread_debug = yes; then
1387 CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
1388 CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
1389 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
1393 AC_SUBST(CONFIG_LDFLAGS)
1396 dnl See if we have a thread_db header file that has TD_NOTALLOC and
1397 dnl other error codes.
1398 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
1399 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
1400 gdb_cv_thread_db_h_has_td_notalloc,
1402 [#include <thread_db.h>],
1403 [int i = TD_NOTALLOC;],
1404 gdb_cv_thread_db_h_has_td_notalloc=yes,
1405 gdb_cv_thread_db_h_has_td_notalloc=no
1408 AC_CACHE_CHECK([whether <thread_db.h> has TD_VERSION],
1409 gdb_cv_thread_db_h_has_td_version,
1411 [#include <thread_db.h>],
1412 [int i = TD_VERSION;],
1413 gdb_cv_thread_db_h_has_td_version=yes,
1414 gdb_cv_thread_db_h_has_td_version=no
1417 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTLS],
1418 gdb_cv_thread_db_h_has_td_notls,
1420 [#include <thread_db.h>],
1421 [int i = TD_NOTLS;],
1422 gdb_cv_thread_db_h_has_td_notls=yes,
1423 gdb_cv_thread_db_h_has_td_notls=no
1427 if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
1428 AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
1429 [Define if <thread_db.h> has the TD_NOTALLOC error code.])
1431 if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
1432 AC_DEFINE(THREAD_DB_HAS_TD_VERSION, 1,
1433 [Define if <thread_db.h> has the TD_VERSION error code.])
1435 if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
1436 AC_DEFINE(THREAD_DB_HAS_TD_NOTLS, 1,
1437 [Define if <thread_db.h> has the TD_NOTLS error code.])
1440 dnl See if we have a sys/syscall header file that has __NR_tkill.
1441 if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
1442 AC_CACHE_CHECK([whether <sys/syscall.h> has __NR_tkill],
1443 gdb_cv_sys_syscall_h_has_tkill,
1445 [#include <sys/syscall.h>],
1446 [int i = __NR_tkill;],
1447 gdb_cv_sys_syscall_h_has_tkill=yes,
1448 gdb_cv_sys_syscall_h_has_tkill=no
1452 dnl See if we can issue tkill syscall.
1453 if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then
1454 AC_DEFINE(HAVE_TKILL_SYSCALL, 1, [Define if you support the tkill syscall.])
1457 dnl Check if we can disable the virtual address space randomization.
1458 dnl The functionality of setarch -R.
1459 AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>])
1460 define([PERSONALITY_TEST], [AC_LANG_PROGRAM([#include <sys/personality.h>], [
1461 # if !HAVE_DECL_ADDR_NO_RANDOMIZE
1462 # define ADDR_NO_RANDOMIZE 0x0040000
1464 /* Test the flag could be set and stays set. */
1465 personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
1466 if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
1468 AC_RUN_IFELSE([PERSONALITY_TEST],
1469 [have_personality=true],
1470 [have_personality=false],
1471 [AC_LINK_IFELSE([PERSONALITY_TEST],
1472 [have_personality=true],
1473 [have_personality=false])])
1474 if $have_personality
1476 AC_DEFINE([HAVE_PERSONALITY], 1,
1477 [Define if you support the personality syscall.])
1480 dnl Handle optional features that can be enabled.
1482 AC_ARG_WITH(sysroot,
1483 AC_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [search for usr/lib et al within DIR]),
1485 case ${with_sysroot} in
1486 yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
1487 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
1490 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
1492 if test "x$prefix" = xNONE; then
1493 test_prefix=/usr/local
1497 if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
1498 test_exec_prefix=$test_prefix
1500 test_exec_prefix=$exec_prefix
1502 case ${TARGET_SYSTEM_ROOT} in
1503 "${test_prefix}"|"${test_prefix}/"*|\
1504 "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
1505 '${prefix}'|'${prefix}/'*|\
1506 '${exec_prefix}'|'${exec_prefix}/'*)
1507 t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
1508 TARGET_SYSTEM_ROOT_DEFINE="$t"
1513 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
1515 AC_SUBST(TARGET_SYSTEM_ROOT)
1516 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
1519 AC_ARG_WITH(system-gdbinit,
1520 AC_HELP_STRING([--with-system-gdbinit=FILE], [automatically load a system-wide gdbinit file]),
1521 [system_gdbinit=${withval}])
1523 AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
1524 [System-wide gdbinit file.])
1526 if test "x$prefix" = xNONE; then
1527 test_prefix=$ac_default_prefix
1531 if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
1532 test_exec_prefix=$test_prefix
1534 test_exec_prefix=$exec_prefix
1536 case ${system_gdbinit} in
1537 "${test_prefix}"|"${test_prefix}/"*|\
1538 "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
1539 '${prefix}'|'${prefix}/'*|\
1540 '${exec_prefix}'|'${exec_prefix}/'*)
1541 AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
1542 [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
1546 AC_ARG_ENABLE(werror,
1547 AC_HELP_STRING([--enable-werror], [treat compile warnings as errors]),
1548 [case "${enableval}" in
1549 yes | y) ERROR_ON_WARNING="yes" ;;
1550 no | n) ERROR_ON_WARNING="no" ;;
1551 *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
1554 # Enable -Werror by default when using gcc
1555 if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
1556 ERROR_ON_WARNING=yes
1560 if test "${ERROR_ON_WARNING}" = yes ; then
1561 WERROR_CFLAGS="-Werror"
1564 # The entries after -Wno-pointer-sign are disabled warnings which may
1565 # be enabled in the future, which can not currently be used to build
1567 # NOTE: If you change this list, remember to update
1568 # gdb/doc/gdbint.texinfo.
1569 build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
1570 -Wformat-nonliteral -Wno-pointer-sign \
1571 -Wno-unused -Wno-switch -Wno-char-subscripts"
1573 # Enable -Wno-format by default when using gcc on mingw since many
1574 # GCC versions complain about %I64.
1576 *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;;
1579 AC_ARG_ENABLE(build-warnings,
1580 AC_HELP_STRING([--enable-build-warnings], [enable build-time compiler warnings if gcc is used]),
1581 [case "${enableval}" in
1583 no) build_warnings="-w";;
1584 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1585 build_warnings="${build_warnings} ${t}";;
1586 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1587 build_warnings="${t} ${build_warnings}";;
1588 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1590 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
1591 echo "Setting compiler warning flags = $build_warnings" 6>&1
1593 AC_ARG_ENABLE(gdb-build-warnings,
1594 AC_HELP_STRING([--enable-gdb-build-warnings], [enable GDB specific build-time compiler warnings if gcc is used]),
1595 [case "${enableval}" in
1597 no) build_warnings="-w";;
1598 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1599 build_warnings="${build_warnings} ${t}";;
1600 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1601 build_warnings="${t} ${build_warnings}";;
1602 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1604 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
1605 echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
1608 if test "x${build_warnings}" != x -a "x$GCC" = xyes
1610 AC_MSG_CHECKING(compiler warning flags)
1611 # Separate out the -Werror flag as some files just cannot be
1612 # compiled with it enabled.
1613 for w in ${build_warnings}; do
1615 -Werr*) WERROR_CFLAGS=-Werror ;;
1616 *) # Check that GCC accepts it
1617 saved_CFLAGS="$CFLAGS"
1619 AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
1620 CFLAGS="$saved_CFLAGS"
1623 AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS})
1625 AC_SUBST(WARN_CFLAGS)
1626 AC_SUBST(WERROR_CFLAGS)
1628 # In the Cygwin environment, we need some additional flags.
1629 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
1630 [AC_EGREP_CPP(lose, [
1631 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
1633 #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
1636 dnl Figure out which of the many generic ser-*.c files the _host_ supports.
1637 SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
1639 *go32* ) SER_HARDWIRE=ser-go32.o ;;
1640 *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
1641 *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
1643 AC_SUBST(SER_HARDWIRE)
1645 # libreadline needs libuser32.a in a cygwin environment
1647 if test x$gdb_cv_os_cygwin = xyes; then
1648 WIN32LIBS="-luser32"
1650 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
1655 # The ser-tcp.c module requires sockets.
1658 AC_DEFINE(USE_WIN32API, 1,
1659 [Define if we should use the Windows API, instead of the
1660 POSIX API. On Windows, we use the Windows API when
1661 building for MinGW, but the POSIX API when building
1663 WIN32LIBS="$WIN32LIBS -lws2_32"
1668 # Add ELF support to GDB, but only if BFD includes ELF support.
1670 OLD_LDFLAGS=$LDFLAGS
1672 CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
1673 LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
1674 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
1675 LIBS="-lbfd -liberty $intl $LIBS"
1676 AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf,
1678 [#include <stdlib.h>
1680 #include "elf-bfd.h"
1682 [bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd); ],
1683 gdb_cv_var_elf=yes, gdb_cv_var_elf=no)])
1684 if test $gdb_cv_var_elf = yes; then
1685 CONFIG_OBS="$CONFIG_OBS elfread.o"
1686 AC_DEFINE(HAVE_ELF, 1,
1687 [Define if ELF support should be included.])
1690 LDFLAGS=$OLD_LDFLAGS
1693 # Add any host-specific objects to GDB.
1694 CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
1696 LIBGUI="../libgui/src/libgui.a"
1697 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
1699 AC_SUBST(GUI_CFLAGS_X)
1703 AC_SUBST(WIN32LDAPP)
1706 *-*-cygwin* | *-*-mingw* )
1715 if test "${enable_gdbtk}" = "yes"; then
1717 # Gdbtk must have an absolute path to srcdir in order to run
1718 # properly when not installed.
1726 # If $no_tk is nonempty, then we can't do Tk, and there is no
1727 # point to doing Tcl.
1730 if test -z "${no_tcl}" -a -z "${no_tk}"; then
1733 # Check for in-tree tcl
1740 if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
1744 # Find Tcl private headers
1745 if test x"${intree}" = xno; then
1746 CY_AC_TCL_PRIVATE_HEADERS
1747 TCL_INCLUDE="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
1748 TCL_LIBRARY="${TCL_LIB_SPEC}"
1751 # If building tcl in the same src tree, private headers
1752 # are not needed, but we need to be sure to use the right
1754 TCL_INCLUDE="-I${TCL_SRC_DIR}/generic"
1755 TCL_LIBRARY="${TCL_BUILD_LIB_SPEC}"
1756 TCL_DEPS="../tcl/${configdir}${TCL_LIB_FILE}"
1758 AC_SUBST(TCL_INCLUDE)
1759 AC_SUBST(TCL_LIBRARY)
1764 # Check for in-tree Tk
1766 if test "${TK_SRC_DIR}" = "${topdir}/tk"; then
1770 # Find Tk private headers
1771 if test x"${intree}" = xno; then
1772 CY_AC_TK_PRIVATE_HEADERS
1773 TK_INCLUDE="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
1774 TK_LIBRARY=${TK_LIB_SPEC}
1777 TK_INCLUDE="-I${TK_SRC_DIR}/generic"
1778 TK_LIBRARY="${TK_BUILD_LIB_SPEC}"
1779 TK_DEPS="../tk/${configdir}/${TK_LIB_FILE}"
1781 AC_SUBST(TK_INCLUDE)
1782 AC_SUBST(TK_LIBRARY)
1784 AC_SUBST(TK_XINCLUDES)
1786 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
1788 # Include some libraries that Tcl and Tk want.
1789 TCL_LIBS='$(LIBGUI) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
1790 # Yes, the ordering seems wrong here. But it isn't.
1791 # TK_LIBS is the list of libraries that need to be linked
1792 # after Tcl/Tk. Note that this isn't put into LIBS. If it
1793 # were in LIBS then any link tests after this point would
1794 # try to include things like `$(LIBGUI)', which wouldn't work.
1795 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
1797 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
1798 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
1799 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
1800 CONFIG_ALL="${CONFIG_ALL} all-gdbtk"
1801 CONFIG_CLEAN="${CONFIG_CLEAN} clean-gdbtk"
1802 CONFIG_INSTALL="${CONFIG_INSTALL} install-gdbtk"
1803 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-gdbtk"
1805 if test x$gdb_cv_os_cygwin = xyes; then
1806 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
1807 WIN32LDAPP="-Wl,--subsystem,console"
1808 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
1811 AC_CONFIG_SUBDIRS(gdbtk)
1819 AC_SUBST(GDBTK_CFLAGS)
1820 AC_SUBST(GDBTK_SRC_DIR)
1824 # Unlike the sim directory, whether a simulator is linked is controlled by
1825 # presence of a gdb_sim definition in the target configure.tgt entry.
1826 # This code just checks for a few cases where we'd like to ignore those
1827 # definitions, even when they're present in the '.mt' file. These cases
1828 # are when --disable-sim is specified, or if the simulator directory is
1829 # not part of the source tree.
1832 AC_HELP_STRING([--enable-sim], [link gdb with simulator]),
1833 [echo "enable_sim = $enable_sim";
1834 echo "enableval = ${enableval}";
1835 case "${enableval}" in
1836 yes) ignore_sim=false ;;
1837 no) ignore_sim=true ;;
1838 *) ignore_sim=false ;;
1842 if test ! -d "${srcdir}/../sim"; then
1848 if test "${ignore_sim}" = "false"; then
1849 if test x"${gdb_sim}" != x ; then
1851 SIM_OBS="remote-sim.o"
1852 AC_DEFINE(WITH_SIM, 1, [Define if the simulator is being linked in.])
1858 AC_SUBST(ENABLE_CFLAGS)
1859 AC_SUBST(PROFILE_CFLAGS)
1861 AC_SUBST(CONFIG_OBS)
1862 AC_SUBST(CONFIG_DEPS)
1863 AC_SUBST(CONFIG_SRCS)
1864 AC_SUBST(CONFIG_ALL)
1865 AC_SUBST(CONFIG_CLEAN)
1866 AC_SUBST(CONFIG_INSTALL)
1867 AC_SUBST(CONFIG_UNINSTALL)
1869 # List of host floatformats.
1870 AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat])
1871 AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat])
1872 AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat])
1874 # target_subdir is used by the testsuite to find the target libraries.
1876 if test "${host}" != "${target}"; then
1877 target_subdir="${target_alias}/"
1879 AC_SUBST(target_subdir)
1882 if test "${gdb_native}" = "yes"; then
1883 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
1884 if test ! -f ${host_makefile_frag}; then
1885 AC_MSG_ERROR("*** Gdb does not support native target ${host}")
1887 frags="$frags $host_makefile_frag"
1889 host_makefile_frag=/dev/null
1892 AC_SUBST_FILE(host_makefile_frag)
1896 if test "${gdb_native}" = "yes"; then
1897 # We pick this up from the host configuration file (.mh) because we
1898 # do not have a native configuration Makefile fragment.
1899 nativefile=`sed -n '
1900 s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1901 ' ${host_makefile_frag}`
1905 if test x"${gdb_osabi}" != x ; then
1906 AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
1907 [Define to the default OS ABI for this configuration.])
1910 # Enable multi-ice-gdb-server.
1911 AC_ARG_ENABLE(multi-ice,
1912 AC_HELP_STRING([--enable-multi-ice], [build the multi-ice-gdb-server]),
1916 *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;;
1918 if test "x$enable_multi_ice" = xyes; then
1919 AC_CONFIG_SUBDIRS(multi-ice)
1922 # We only build gdbserver automatically in a native configuration.
1923 if test "$gdb_native" = "yes"; then
1924 AC_MSG_CHECKING(whether gdbserver is supported on this host)
1925 if test "x$build_gdbserver" = xyes; then
1927 AC_CONFIG_SUBDIRS(gdbserver)
1933 # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
1934 # to an empty version.
1940 if test "${nativefile}" != ""; then
1941 case "${nativefile}" in
1942 nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
1943 * ) GDB_NM_FILE="${nativefile}"
1945 files="${files} ${GDB_NM_FILE}"
1946 links="${links} nm.h"
1947 AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile])
1949 AC_SUBST(GDB_NM_FILE)
1951 AC_LINK_FILES($files, $links)
1953 dnl Check for exe extension set on certain hosts (e.g. Win32)
1956 dnl Detect the character set used by this host.
1957 dnl At the moment, we just assume it's UTF-8.
1958 AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
1959 [Define to be a string naming the default host character set.])
1961 # Flags needed to enable html installing and building
1962 AC_ARG_WITH(datarootdir,
1963 AC_HELP_STRING([--with-datarootdir], [use datarootdir as the data root directory.]),
1964 [datarootdir="\${prefix}/${withval}"],
1965 [datarootdir="\${prefix}/share"])
1968 AC_HELP_STRING([--with-docdir], [install documentation in this directory.]),
1969 [docdir="\${prefix}/${withval}"],
1970 [docdir="\${datarootdir}/doc"])
1973 AC_HELP_STRING([--with-pdfdir], [install pdf in this directory.]),
1974 [pdfdir="\${prefix}/${withval}"],
1975 [pdfdir="\${docdir}"])
1977 AC_ARG_WITH(htmldir,
1978 AC_HELP_STRING([--with-htmldir], [install html in this directory.]),
1979 [htmldir="\${prefix}/${withval}"],
1980 [htmldir="\${docdir}"])
1982 AC_SUBST(datarootdir)
1987 AC_OUTPUT(Makefile .gdbinit:gdbinit.in gnulib/Makefile,
1989 case x$CONFIG_HEADERS in
1990 xconfig.h:config.in)