ARI fix: remove "%p".
[deliverable/binutils-gdb.git] / gdb / configure.ac
CommitLineData
c906108c 1dnl Autoconf configure script for GDB, the GNU debugger.
0ea3f30e 2dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6c7a06a3 3dnl 2005, 2006, 2007, 2008, 2009
b6ba6518 4dnl Free Software Foundation, Inc.
c906108c
SS
5dnl
6dnl This file is part of GDB.
7dnl
8dnl This program is free software; you can redistribute it and/or modify
9dnl it under the terms of the GNU General Public License as published by
5a0e3bd0 10dnl the Free Software Foundation; either version 3 of the License, or
c906108c 11dnl (at your option) any later version.
5a0e3bd0 12dnl
c906108c
SS
13dnl This program is distributed in the hope that it will be useful,
14dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
15dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16dnl GNU General Public License for more details.
5a0e3bd0 17dnl
c906108c 18dnl You should have received a copy of the GNU General Public License
5a0e3bd0 19dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
20
21dnl Process this file with autoconf to produce a configure script.
22
bec39cab 23AC_PREREQ(2.59)dnl
c906108c
SS
24AC_INIT(main.c)
25AC_CONFIG_HEADER(config.h:config.in)
413ccac7 26AM_MAINTAINER_MODE
c906108c
SS
27
28AC_PROG_CC
14abd0fb 29AC_GNU_SOURCE
c906108c
SS
30AC_AIX
31AC_ISC_POSIX
e28b3332 32gl_EARLY
c906108c
SS
33AM_PROG_CC_STDC
34
e28b3332 35AC_CONFIG_AUX_DIR(..)
c906108c
SS
36AC_CANONICAL_SYSTEM
37
a417dc56
RW
38# Dependency checking.
39ZW_CREATE_DEPDIR
40ZW_PROG_COMPILER_DEPENDENCIES([CC])
41
42# Check for the 'make' the user wants to use.
43AC_CHECK_PROGS(MAKE, make)
44MAKE_IS_GNU=
45case "`$MAKE --version 2>&1 | sed 1q`" in
46 *GNU*)
47 MAKE_IS_GNU=yes
48 ;;
49esac
50AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes)
51AC_PROG_MAKE_SET
52
ddc9cd0f
AC
53dnl List of object files and targets accumulated by configure.
54
55CONFIG_OBS=
56CONFIG_DEPS=
57CONFIG_SRCS=
58ENABLE_CFLAGS=
59
60CONFIG_ALL=
61CONFIG_CLEAN=
62CONFIG_INSTALL=
63CONFIG_UNINSTALL=
64
20e95c23
DJ
65dnl Set up for gettext.
66ZW_GNU_GETTEXT_SISTER_DIR
ddc9cd0f
AC
67
68localedir='${datadir}/locale'
69AC_SUBST(localedir)
70
20e95c23 71if test x"$USE_NLS" = xyes; then
ddc9cd0f
AC
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"
76fi
77
e28b3332
DJ
78gl_INIT
79
d5af19ba
DJ
80# For Makefile dependencies.
81GNULIB_STDINT_H=
82if test x"$STDINT_H" != x; then
83 GNULIB_STDINT_H=gnulib/$STDINT_H
84fi
85AC_SUBST(GNULIB_STDINT_H)
86
ddc9cd0f
AC
87PACKAGE=gdb
88AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
89AC_SUBST(PACKAGE)
0fbb3da7 90
e28b3332
DJ
91# GDB does not use automake, but gnulib does. This line lets us
92# generate its Makefile.in.
93AM_INIT_AUTOMAKE(gdb, UNUSED-VERSION, [no-define])
94
5b5d99cf
JB
95debugdir=${libdir}/debug
96
97AC_ARG_WITH(separate-debug-dir,
98[ --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]],
99[debugdir="${withval}"])
100
101AC_DEFINE_DIR(DEBUGDIR, debugdir,
102 [Global directory for separate debug files. ])
103#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
c906108c 104
aa28a74e
DJ
105if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
106 if test "x$prefix" = xNONE; then
107 test_prefix=/usr/local
108 else
109 test_prefix=$prefix
110 fi
111else
112 test_prefix=$exec_prefix
113fi
114case ${debugdir} in
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.])
118 ;;
119esac
120
29b0e8a2
JM
121AC_ARG_WITH(relocated-sources,
122AC_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. ])
126])
127
8dcde887 128AC_CONFIG_SUBDIRS(doc testsuite)
96baa820 129
d0c678e6
UW
130# Check whether to support alternative target configurations
131AC_ARG_ENABLE(targets,
132[ --enable-targets alternative target configurations],
133[case "${enableval}" in
134 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
135 ;;
136 no) enable_targets= ;;
137 *) enable_targets=$enableval ;;
138esac])
139
c0993dbe
UW
140# Check whether to enable 64-bit support on 32-bit hosts
141AC_ARG_ENABLE(64-bit-bfd,
142[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
143[case "${enableval}" in
144 yes) want64=true ;;
145 no) want64=false ;;
146 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
147esac],[want64=false])dnl
148
121ce6e5
DJ
149# Provide defaults for some variables set by the per-host and per-target
150# configuration.
151gdb_host_obs=posix-hdep.o
152
771b4502
UW
153if test "${target}" = "${host}"; then
154 gdb_native=yes
155else
156 gdb_native=no
157fi
158
27e9bf90 159. $srcdir/configure.host
c906108c 160
d0c678e6
UW
161# Accumulate some settings from configure.tgt over all enabled targets
162
163TARGET_OBS=
164all_targets=
165
166for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
167do
168 if test "$targ_alias" = "all"; then
169 all_targets=true
170 else
171 # Canonicalize the secondary target names.
172 result=`$ac_config_sub $targ_alias 2>/dev/null`
173 if test -n "$result"; then
174 targ=$result
175 else
176 targ=$targ_alias
177 fi
178
179 . ${srcdir}/configure.tgt
180
181 # Target-specific object files
182 for i in ${gdb_target_obs}; do
183 case " $TARGET_OBS " in
184 *" ${i} "*) ;;
185 *)
186 TARGET_OBS="$TARGET_OBS ${i}"
187 ;;
188 esac
189 done
c0993dbe
UW
190
191 # Check whether this target needs 64-bit CORE_ADDR
192 if test x${want64} = xfalse; then
193 . ${srcdir}/../bfd/config.bfd
194 fi
d0c678e6
UW
195 fi
196done
197
198if test x${all_targets} = xtrue; then
c0993dbe
UW
199
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.
205 #
206 # NOTE: This test must be in sync with the corresponding
207 # tests in BFD!
208
209 if test x${want64} = xfalse; then
210 AC_CHECK_SIZEOF(long)
211 if test "x${ac_cv_sizeof_long}" = "x8"; then
212 want64=true
213 fi
214 fi
215 if test x${want64} = xtrue; then
216 TARGET_OBS='$(ALL_TARGET_OBS) $(ALL_64_TARGET_OBS)'
217 else
218 TARGET_OBS='$(ALL_TARGET_OBS)'
219 fi
d0c678e6
UW
220fi
221
222AC_SUBST(TARGET_OBS)
223
224# For other settings, only the main target counts.
225gdb_sim=
226gdb_osabi=
227build_gdbserver=
228targ=$target; . ${srcdir}/configure.tgt
c906108c 229
27e9bf90
MK
230# Fetch the default architecture and default target vector from BFD.
231targ=$target; . $srcdir/../bfd/config.bfd
5c8cc331 232
27e9bf90
MK
233# We only want the first architecture, so strip off the others if
234# there is more than one.
235targ_archs=`echo $targ_archs | sed 's/ .*//'`
5c8cc331 236
27e9bf90
MK
237if test "x$targ_archs" != x; then
238 AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, $targ_archs,
239 [Define to BFD's default architecture. ])
1ba607ad 240fi
27e9bf90
MK
241if test "x$targ_defvec" != x; then
242 AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, $targ_defvec,
243 [Define to BFD's default target vector. ])
1ba607ad
AC
244fi
245
627af7ea
MK
246# The CLI cannot be disabled yet, but may be in the future.
247
248# Enable CLI.
249AC_ARG_ENABLE(gdbcli,
250[ --disable-gdbcli disable command-line interface (CLI)],
251 [case $enableval in
252 yes)
253 ;;
254 no)
255 AC_MSG_ERROR([the command-line interface cannot be disabled yet]) ;;
256 *)
257 AC_MSG_ERROR([bad value $enableval for --enable-gdbcli]) ;;
258 esac],
259 [enable_gdbcli=yes])
260if 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)"
627af7ea 265 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)"
627af7ea
MK
266 fi
267fi
268
269# Enable MI.
270AC_ARG_ENABLE(gdbmi,
271[ --disable-gdbmi disable machine-interface (MI)],
272 [case $enableval in
273 yes | no)
274 ;;
275 *)
276 AC_MSG_ERROR([bad value $enableval for --enable-gdbmi]) ;;
277 esac],
278 [enable_gdbmi=yes])
279if 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)"
627af7ea 284 ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)"
627af7ea
MK
285 fi
286fi
287
287c1a40
MK
288# Enable TUI.
289AC_ARG_ENABLE(tui,
290[ --enable-tui enable full-screen terminal user interface (TUI)],
291 [case $enableval in
3ca64bd3 292 yes | no | auto)
287c1a40
MK
293 ;;
294 *)
295 AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
3ca64bd3 296 esac],enable_tui=auto)
287c1a40 297
8ee53726
MK
298# Enable gdbtk.
299AC_ARG_ENABLE(gdbtk,
d28f9cdf 300[ --enable-gdbtk enable gdbtk graphical user interface (GUI)],
8ee53726
MK
301 [case $enableval in
302 yes | no)
303 ;;
304 *)
305 AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
306 esac],
5062cc19 307 [if test -d $srcdir/gdbtk; then
8ee53726
MK
308 enable_gdbtk=yes
309 else
310 enable_gdbtk=no
311 fi])
312# We unconditionally disable gdbtk tests on selected platforms.
313case $host_os in
314 go32* | windows*)
315 AC_MSG_WARN([gdbtk isn't supported on $host; disabling])
316 enable_gdbtk=no ;;
317esac
318
0e5d83e3
JJ
319# Libunwind support.
320AC_ARG_WITH(libunwind,
321[ --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) ;;
326esac],[
a9322a30 327 AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
0e5d83e3
JJ
328 if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
329 enable_libunwind=yes;
330 fi
331])
332
333if test x"$enable_libunwind" = xyes; then
a9322a30 334 AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
60ca704f 335 AC_DEFINE(HAVE_LIBUNWIND, 1, [Define if libunwind library is being used.])
0e5d83e3
JJ
336 CONFIG_OBS="$CONFIG_OBS libunwind-frame.o"
337 CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o"
338 CONFIG_SRCS="$CONFIG_SRCS libunwind-frame.c"
339fi
340
cb01cfba
JB
341opt_curses=no
342AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
343
76a39ba7 344prefer_curses=no
cb01cfba 345if test "$opt_curses" = "yes"; then
76a39ba7 346 prefer_curses=yes
cb01cfba
JB
347fi
348
d28f9cdf
DJ
349# Profiling support.
350AC_ARG_ENABLE(profiling,
351[ --enable-profiling enable profiling of GDB],
352 [case $enableval in
353 yes | no)
354 ;;
355 *)
356 AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
357 esac],
358 [enable_profiling=no])
359
d9feb4e7 360AC_CHECK_FUNCS(monstartup _mcleanup)
b0b1c2c0
MK
361AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
362[AC_TRY_LINK(
363[#include <stdlib.h>
364extern char _etext;
365],
366[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
367if test $ac_cv_var__etext = yes; then
368 AC_DEFINE(HAVE__ETEXT, 1,
369 [Define to 1 if your system has the _etext variable. ])
370fi
01fe12f6
JB
371AC_CACHE_CHECK([for etext], ac_cv_var_etext,
372[AC_TRY_LINK(
373[#include <stdlib.h>
374extern char etext;
375],
376[free (&etext);], ac_cv_var_etext=yes, ac_cv_var_etext=no)])
377if test $ac_cv_var_etext = yes; then
378 AC_DEFINE(HAVE_ETEXT, 1,
379 [Define to 1 if your system has the etext variable. ])
380fi
d28f9cdf 381if test "$enable_profiling" = yes ; then
d9feb4e7
DJ
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)
384 fi
d28f9cdf
DJ
385 PROFILE_CFLAGS=-pg
386 OLD_CFLAGS="$CFLAGS"
387 CFLAGS="$CFLAGS $PROFILE_CFLAGS"
388
d9feb4e7
DJ
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)])
d28f9cdf 392
d9feb4e7
DJ
393 if test $ac_cv_cc_supports_pg = no; then
394 AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
395 fi
d28f9cdf
DJ
396
397 CFLAGS="$OLD_CFLAGS"
398fi
399
c16158bc
JM
400ACX_PKGVERSION([GDB])
401ACX_BUGURL([http://www.gnu.org/software/gdb/bugs/])
402AC_DEFINE_UNQUOTED([PKGVERSION], ["$PKGVERSION"], [Additional package description])
403AC_DEFINE_UNQUOTED([REPORT_BUGS_TO], ["$REPORT_BUGS_TO"], [Bug reporting address])
404
8bb2c122
MK
405# --------------------- #
406# Checks for programs. #
407# --------------------- #
408
7a292a7a 409AC_PROG_AWK
c906108c 410AC_PROG_INSTALL
8bb2c122
MK
411AC_PROG_LN_S
412AC_PROG_RANLIB
413AC_PROG_YACC
414
c906108c 415AC_CHECK_TOOL(AR, ar)
95ca63c4
CF
416AC_CHECK_TOOL(DLLTOOL, dlltool)
417AC_CHECK_TOOL(WINDRES, windres)
c906108c 418
8bb2c122 419# Needed for GNU/Hurd.
75c6e08a
MK
420AC_CHECK_TOOL(MIG, mig)
421
9a156167
MK
422# ---------------------- #
423# Checks for libraries. #
424# ---------------------- #
425
426# We might need to link with -lm; most simulators need it.
427AC_CHECK_LIB(m, main)
428
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.
433AC_CHECK_FUNC(wctype, [],
434 [AC_CHECK_LIB(w, wctype)])
435
c890192f
MK
436# Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
437AC_SEARCH_LIBS(gethostbyname, nsl)
438
9a156167
MK
439# Some systems (e.g. Solaris) have `socketpair' in libsocket.
440AC_SEARCH_LIBS(socketpair, socket)
441
233a11ab
CS
442# Link in zlib if we can. This allows us to read compressed debug sections.
443AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
444
d542061a
UW
445# On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
446AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
447
6c7a06a3
TT
448AM_ICONV
449
77f120bf
JB
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.
453#
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.
458#
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.
465
466case $host_os in
467 alpha*-*-osf* )
468 if "$enable_tui" = "yes"; then
469 AC_MSG_ERROR([Building GDB with TUI mode is not supported on this host])
470 fi
471 if "$enable_tui" = "auto"; then
472 enable_tui=no
473 fi
474 ;;
475esac
476
cb01cfba 477# For the TUI, we need enhanced curses functionality.
bd8a8e1b 478if test x"$enable_tui" != xno; then
cb01cfba
JB
479 prefer_curses=yes
480fi
481
482curses_found=no
483if 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
490 # a situation.
491 AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])
492
493 if test "$ac_cv_search_waddstr" != no; then
494 curses_found=yes
495 fi
496fi
497
77f120bf
JB
498# Check whether we should enable the TUI, but only do so if we really
499# can.
500if test x"$enable_tui" != xno; then
501 if test -d $srcdir/tui; then
cb01cfba 502 if test "$curses_found" != no; then
77f120bf
JB
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"
511 else
512 if test x"$enable_tui" = xyes; then
513 AC_MSG_ERROR([no enhanced curses library found; disable TUI])
514 else
515 AC_MSG_WARN([no enhanced curses library found; disabling TUI])
516 fi
517 fi
518 fi
519fi
520
4f0be353
MK
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.
287c1a40
MK
524
525case $host_os in
526 cygwin*)
527 if test -d $srcdir/libtermcap; then
528 LIBS="../libtermcap/libtermcap.a $LIBS"
529 ac_cv_search_tgetent="../libtermcap/libtermcap.a"
530 fi ;;
228a417c 531 go32* | *djgpp*)
287c1a40
MK
532 ac_cv_search_tgetent="none required"
533 ;;
7ef34f2c
MM
534 *mingw32*)
535 ac_cv_search_tgetent="none required"
31b060a2 536 CONFIG_OBS="$CONFIG_OBS windows-termcap.o"
7ef34f2c 537 ;;
287c1a40
MK
538esac
539
4f0be353
MK
540# These are the libraries checked by Readline.
541AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses])
287c1a40
MK
542
543if test "$ac_cv_search_tgetent" = no; then
544 AC_MSG_ERROR([no termcap library found])
545fi
546
6a30b0a5
AS
547AC_ARG_WITH([system-readline],
548 [AS_HELP_STRING([--with-system-readline],
549 [use installed readline library])])
550
551if test "$with_system_readline" = yes; then
552 READLINE=-lreadline
553 READLINE_DEPS=
554 READLINE_CFLAGS=
555else
556 READLINE='$(READLINE_DIR)/libreadline.a'
557 READLINE_DEPS='$(READLINE)'
558 READLINE_CFLAGS='-I$(READLINE_SRC)/..'
559fi
560AC_SUBST(READLINE)
561AC_SUBST(READLINE_DEPS)
562AC_SUBST(READLINE_CFLAGS)
563
5c39566f
DJ
564AC_ARG_WITH(expat,
565 AS_HELP_STRING([--with-expat], [include expat support (auto/yes/no)]),
566 [], [with_expat=auto])
567AC_MSG_CHECKING([whether to use expat])
568AC_MSG_RESULT([$with_expat])
569
570if test "${with_expat}" = no; then
571 AC_MSG_WARN([expat support disabled; some features may be unavailable.])
572 HAVE_LIBEXPAT=no
ca4ca11e 573else
5c39566f
DJ
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])
579 else
580 AC_MSG_WARN([expat is missing or unusable; some features may be unavailable.])
581 fi
582 else
583 save_LIBS=$LIBS
584 LIBS="$LIBS $LIBEXPAT"
585 AC_CHECK_FUNCS(XML_StopParser)
586 LIBS=$save_LIBS
587 fi
7fa2210b
DJ
588fi
589
d57a3c85
TJB
590dnl Utility to simplify finding libpython.
591AC_DEFUN([AC_TRY_LIBPYTHON],
592[
593 version=$1
594 define([have_libpython_var],$2)
595 define([VERSION],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
596 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
597 [HAVE_LIB]VERSION=no
598 AC_MSG_CHECKING([for ${version}])
599 save_LIBS=$LIBS
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],
605 [LIBS=$save_LIBS])
606 AC_MSG_RESULT([$[HAVE_LIB]VERSION])
607])
608
609AC_ARG_WITH(python,
610 AS_HELP_STRING([--with-python], [include python support (auto/yes/no/<path>)]),
611 [], [with_python=auto])
612AC_MSG_CHECKING([whether to use python])
613AC_MSG_RESULT([$with_python])
614
615if test "${with_python}" = no; then
616 AC_MSG_WARN([python support disabled; some features may be unavailable.])
617 have_libpython=no
618else
619 case "${with_python}" in
620 yes | auto)
621 # Leave as empty, use defaults.
622 python_includes=
623 python_libs=
624 ;;
625 /*)
626 python_includes="-I${with_python}/include"
627 python_libs="-L${with_python}/lib"
628 ;;
629 *)
630 AC_ERROR(invalid value for --with-python)
631 ;;
632 esac
633
634 save_CPPFLAGS=$CPPFLAGS
635 CPPFLAGS="$CPPFLAGS ${python_includes}"
636 save_LIBS=$LIBS
637 LIBS="$LIBS ${python_libs}"
638 have_libpython=no
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.])
643 fi
644 fi
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.])
649 fi
650 fi
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.])
655 fi
656 fi
657 if test ${have_libpython} = no; then
658 case "${with_python}" in
659 yes)
660 AC_MSG_ERROR([python is missing or unusable])
661 ;;
662 auto)
663 AC_MSG_WARN([python is missing or unusable; some features may be unavailable.])
664 ;;
665 *)
666 AC_MSG_ERROR([no usable python found at ${with_python}])
667 ;;
668 esac
669 CPPFLAGS=$save_CPPFLAGS
670 LIBS=$save_LIBS
671 fi
672fi
673
674if 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)"
680
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"
688 fi
689
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"
698 done
699 AC_MSG_RESULT(${PYTHON_CFLAGS})
700 fi
701else
a08702d6 702 # Even if Python support is not compiled in, we need to have these files
d57a3c85 703 # included in order to recognize the GDB command "python".
a08702d6
TJB
704 CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
705 CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
d57a3c85
TJB
706fi
707AC_SUBST(PYTHON_CFLAGS)
708
5ee754fc
MK
709# ------------------------- #
710# Checks for header files. #
711# ------------------------- #
c906108c 712
9608ab8b 713AC_HEADER_DIRENT
5ee754fc 714AC_HEADER_STAT
c906108c 715AC_HEADER_STDC
a9322a30
TT
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?
719AC_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 \
a8111142 726 sgtty.h unistd.h elf_hp.h ctype.h time.h locale.h])
7cb9022a
MK
727AC_CHECK_HEADERS(link.h, [], [],
728[#if HAVE_SYS_TYPES_H
729# include <sys/types.h>
730#endif
731#if HAVE_NLIST_H
732# include <nlist.h>
733#endif
734])
7cb9022a
MK
735AC_CHECK_HEADERS(sys/proc.h, [], [],
736[#if HAVE_SYS_PARAM_H
737# include <sys/param.h>
738#endif
739])
7cb9022a
MK
740AC_CHECK_HEADERS(sys/user.h, [], [],
741[#if HAVE_SYS_PARAM_H
742# include <sys/param.h>
743#endif
744])
5ee754fc 745
b1d19a62 746# On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash
5ee754fc
MK
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.
749case $host_os in
b1d19a62 750 solaris2.[[789]])
5ee754fc
MK
751 if test "$GCC" = yes; then
752 AC_DEFINE(_MSE_INT_H, 1,
ba1e897e
EZ
753 [Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
754 Solaris 2.[789] when using GCC. ])
5ee754fc
MK
755 fi ;;
756esac
a9322a30 757AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h)
c401b55a
MK
758AC_CHECK_HEADERS(term.h, [], [],
759[#if HAVE_CURSES_H
760# include <curses.h>
761#endif
762])
5ee754fc 763
b9362cc7
AC
764# ------------------------- #
765# Checks for declarations. #
766# ------------------------- #
767
a9322a30
TT
768AC_CHECK_DECLS([free, malloc, realloc, strerror, strstr, getopt,
769 snprintf, vsnprintf])
a8111142 770AM_LC_MESSAGES
b9362cc7 771
666ec76f
MK
772# ----------------------- #
773# Checks for structures. #
774# ----------------------- #
775
a9322a30 776AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
666ec76f 777
5ee754fc
MK
778# ------------------ #
779# Checks for types. #
780# ------------------ #
c906108c 781
5ee754fc 782AC_TYPE_SIGNAL
f9f87d2c
MK
783AC_CHECK_TYPES(socklen_t, [], [],
784[#include <sys/types.h>
785#include <sys/socket.h>
786])
5ee754fc
MK
787
788# ------------------------------------- #
789# Checks for compiler characteristics. #
790# ------------------------------------- #
c906108c
SS
791
792AC_C_CONST
bce58c09 793AC_C_INLINE
9b913628 794AC_C_BIGENDIAN
c906108c 795
5ee754fc
MK
796# ------------------------------ #
797# Checks for library functions. #
798# ------------------------------ #
799
c906108c 800AC_FUNC_ALLOCA
97bf5e38 801AC_FUNC_MMAP
46711df8 802AC_FUNC_VFORK
a9322a30
TT
803AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \
804 getgid poll pread64 sbrk setpgid setpgrp setsid \
805 sigaction sigprocmask sigsetmask socketpair syscall \
732f6a93 806 ttrace wborder setlocale iconvlist libiconvlist btowc])
6c7a06a3 807AM_LANGINFO_CODESET
97bf5e38 808
086ec9eb
MK
809# Check the return and argument types of ptrace. No canned test for
810# this, so roll our own.
811gdb_ptrace_headers='
812#if HAVE_SYS_TYPES_H
813# include <sys/types.h>
814#endif
815#if HAVE_SYS_PTRACE_H
816# include <sys/ptrace.h>
817#endif
818#if HAVE_UNISTD_H
819# include <unistd.h>
820#endif
821'
822# There is no point in checking if we don't have a prototype.
a3828db0 823AC_CHECK_DECLS(ptrace, [], [
086ec9eb
MK
824 : ${gdb_cv_func_ptrace_ret='int'}
825 : ${gdb_cv_func_ptrace_args='int,int,long,long'}
826], $gdb_ptrace_headers)
064ef605
DJ
827# Check return type. Varargs (used on GNU/Linux) conflict with the
828# empty argument list, so check for that explicitly.
086ec9eb
MK
829AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret,
830 AC_TRY_COMPILE($gdb_ptrace_headers,
064ef605
DJ
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')))
086ec9eb
MK
837AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret,
838 [Define as the return type of ptrace.])
839# Check argument types.
840AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [
064ef605
DJ
841 AC_TRY_COMPILE($gdb_ptrace_headers,
842 [extern long ptrace (enum __ptrace_request, ...);],
843 [gdb_cv_func_ptrace_args='int,int,long,long'],[
086ec9eb
MK
844for gdb_arg1 in 'int' 'long'; do
845 for gdb_arg2 in 'pid_t' 'int' 'long'; do
5ed10e6e 846 for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long' 'void *'; do
086ec9eb
MK
847 for gdb_arg4 in 'int' 'long'; do
848 AC_TRY_COMPILE($gdb_ptrace_headers, [
849extern $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";
852 break 4;])
853 for gdb_arg5 in 'int *' 'int' 'long'; do
854 AC_TRY_COMPILE($gdb_ptrace_headers, [
855extern $gdb_cv_func_ptrace_ret
856 ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5);
857], [
858gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5";
859 break 5;])
860 done
861 done
862 done
863 done
864done
865# Provide a safe default value.
866: ${gdb_cv_func_ptrace_args='int,int,long,long'}
064ef605 867])])
086ec9eb
MK
868ac_save_IFS=$IFS; IFS=','
869set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'`
870IFS=$ac_save_IFS
871shift
64218d3e 872AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3],
086ec9eb
MK
873 [Define to the type of arg 3 for ptrace.])
874if test -n "$[5]"; then
64218d3e 875 AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5],
086ec9eb
MK
876 [Define to the type of arg 5 for ptrace.])
877fi
878
72473524
DJ
879dnl AC_FUNC_SETPGRP does not work when cross compiling
880dnl Instead, assume we will have a prototype for setpgrp if cross compiling.
881if test "$cross_compiling" = no; then
882 AC_FUNC_SETPGRP
883else
884 AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void,
885 [AC_TRY_COMPILE([
886#include <unistd.h>
887], [
888 if (setpgrp(1,1) == -1)
889 exit (0);
890 else
891 exit (1);
892], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)])
893if test $ac_cv_func_setpgrp_void = yes; then
894 AC_DEFINE(SETPGRP_VOID, 1)
895fi
896fi
c906108c 897
2b2d558c
MK
898# Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
899# since sigsetjmp might only be defined as a macro.
900AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp,
901[AC_TRY_COMPILE([
902#include <setjmp.h>
903], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
904gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)])
905if test $gdb_cv_func_sigsetjmp = yes; then
906 AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
907fi
908
06825bd1
MK
909# Assume we'll default to using the included libiberty regex.
910gdb_use_included_regex=yes
911
912# However, if the system regex is GNU regex, then default to *not*
913# using the included regex.
914AC_CACHE_CHECK(
915 [for GNU regex],
916 [gdb_cv_have_gnu_regex],
917 [AC_TRY_COMPILE(
918 [#include <gnu-versions.h>],
919 [#define REGEX_INTERFACE_VERSION 1
920#if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION
921# error "Version mismatch"
922#endif],
923 gdb_cv_have_gnu_regex=yes,
924 gdb_cv_have_gnu_regex=no)])
925if test $gdb_cv_have_gnu_regex = yes; then
926 gdb_use_included_regex=no
927fi
928
929AC_ARG_WITH(included-regex,
930 [ --without-included-regex don't use included regex; this is the default
931 on systems with version 2 of the GNU C library
932 (use with caution on other system)],
933 gdb_with_regex=$withval,
934 gdb_with_regex=$gdb_use_included_regex)
935if test "$gdb_with_regex" = yes; then
936 AC_DEFINE(USE_INCLUDED_REGEX, 1,
937 [Define to 1 if the regex included in libiberty should be used.])
938fi
939
5c45e068
MK
940# Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
941AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
942[#include <sys/param.h>
943#include <sys/proc.h>
944])
70f9f479 945
da7d81e3
NW
946# See if <sys/lwp.h> defines `struct lwp`.
947AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
948[AC_TRY_COMPILE([#include <sys/param.h>
949#include <sys/lwp.h>], [struct lwp l;],
950gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)])
951if test $gdb_cv_struct_lwp = yes; then
952 AC_DEFINE(HAVE_STRUCT_LWP, 1,
953 [Define to 1 if your system has struct lwp.])
954fi
955
78434e59
MK
956# See if <machine/reg.h> degines `struct reg'.
957AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg,
958[AC_TRY_COMPILE([#include <sys/types.h>
959#include <machine/reg.h>], [struct reg r;],
960gdb_cv_struct_reg=yes, gdb_cv_struct_reg=no)])
961if test $gdb_cv_struct_reg = yes; then
962 AC_DEFINE(HAVE_STRUCT_REG, 1,
963 [Define to 1 if your system has struct reg in <machine/reg.h>.])
964fi
965
0afdd437 966# See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
7dfa765c 967# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
5c45e068
MK
968AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [],
969 [#include <machine/reg.h>])
7dfa765c 970
0afdd437 971# See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
f60300e7
MK
972AC_MSG_CHECKING(for PTRACE_GETREGS)
973AC_CACHE_VAL(gdb_cv_have_ptrace_getregs,
974[AC_TRY_COMPILE([#include <sys/ptrace.h>],
975 [PTRACE_GETREGS;],
976 [gdb_cv_have_ptrace_getregs=yes],
977 [gdb_cv_have_ptrace_getregs=no])])
978AC_MSG_RESULT($gdb_cv_have_ptrace_getregs)
979if test $gdb_cv_have_ptrace_getregs = yes; then
60ca704f
SE
980 AC_DEFINE(HAVE_PTRACE_GETREGS, 1,
981 [Define if sys/ptrace.h defines the PTRACE_GETREGS request.])
f60300e7
MK
982fi
983
0afdd437 984# See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
6ce2ac0b
MK
985AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
986AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs,
5c44784c 987[AC_TRY_COMPILE([#include <sys/ptrace.h>],
6ce2ac0b
MK
988 [PTRACE_GETFPXREGS;],
989 [gdb_cv_have_ptrace_getfpxregs=yes],
990 [gdb_cv_have_ptrace_getfpxregs=no])])
991AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs)
992if test $gdb_cv_have_ptrace_getfpxregs = yes; then
60ca704f
SE
993 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
994 [Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request.])
5c44784c
JM
995fi
996
0afdd437
MK
997# See if <sys/ptrace.h> provides the PT_GETDBREGS request.
998AC_MSG_CHECKING(for PT_GETDBREGS)
999AC_CACHE_VAL(gdb_cv_have_pt_getdbregs,
1000[AC_TRY_COMPILE([#include <sys/types.h>
1001#include <sys/ptrace.h>],
1002 [PT_GETDBREGS;],
1003 [gdb_cv_have_pt_getdbregs=yes],
1004 [gdb_cv_have_pt_getdbregs=no])])
1005AC_MSG_RESULT($gdb_cv_have_pt_getdbregs)
1006if test $gdb_cv_have_pt_getdbregs = yes; then
60ca704f
SE
1007 AC_DEFINE(HAVE_PT_GETDBREGS, 1,
1008 [Define if sys/ptrace.h defines the PT_GETDBREGS request.])
0afdd437
MK
1009fi
1010
7e89e357
JT
1011# See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
1012AC_MSG_CHECKING(for PT_GETXMMREGS)
1013AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs,
1014[AC_TRY_COMPILE([#include <sys/types.h>
1015#include <sys/ptrace.h>],
1016 [PT_GETXMMREGS;],
1017 [gdb_cv_have_pt_getxmmregs=yes],
1018 [gdb_cv_have_pt_getxmmregs=no])])
1019AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs)
1020if test $gdb_cv_have_pt_getxmmregs = yes; then
60ca704f
SE
1021 AC_DEFINE(HAVE_PT_GETXMMREGS, 1,
1022 [Define if sys/ptrace.h defines the PT_GETXMMREGS request.])
7e89e357
JT
1023fi
1024
eb368090 1025# Detect which type of /proc is in use, such as for Unixware or Solaris.
c906108c
SS
1026
1027if test "${target}" = "${host}"; then
1028 case "${host}" in
1045b512 1029 *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
60ca704f
SE
1030 AC_DEFINE(NEW_PROC_API, 1,
1031 [Define if you want to use new multi-fd /proc interface
1032 (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
c3f6f71d 1033 ;;
c162e8c9 1034 *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]]*)
60ca704f
SE
1035 AC_DEFINE(NEW_PROC_API, 1,
1036 [Define if you want to use new multi-fd /proc interface
1037 (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).])
c3f6f71d 1038 ;;
c960c18f
AC
1039 mips-sgi-irix5*)
1040 # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5.
60ca704f
SE
1041 AC_DEFINE([_KMEMUSER], 1,
1042 [Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works
1043 around a <sys/proc.h> problem on IRIX 5.])
c960c18f 1044 ;;
c906108c 1045 esac
c906108c
SS
1046fi
1047
1048if test "$ac_cv_header_sys_procfs_h" = yes; then
1049 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
1050 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
1051 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
1052 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
83d37ec8
MK
1053 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
1054 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
23e04971
MS
1055 BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t)
1056 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t)
83d37ec8
MK
1057 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
1058 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
596c9d4b
KB
1059 BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t)
1060 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t)
1061 BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t)
1062 BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t)
c906108c 1063
23e04971 1064
d84dd0c5
MK
1065 dnl Check for broken prfpregset_t type
1066
1067 dnl For Linux/i386, glibc 2.1.3 was released with a bogus
1068 dnl prfpregset_t type (it's a typedef for the pointer to a struct
1069 dnl instead of the struct itself). We detect this here, and work
a3007b6f 1070 dnl around it in gdb_proc_service.h.
d84dd0c5
MK
1071
1072 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
1073 AC_MSG_CHECKING(whether prfpregset_t type is broken)
1074 AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
1075 [AC_TRY_RUN([#include <sys/procfs.h>
1076 int main ()
1077 {
1078 if (sizeof (prfpregset_t) == sizeof (void *))
1079 return 1;
1080 return 0;
1081 }],
1082 gdb_cv_prfpregset_t_broken=no,
1083 gdb_cv_prfpregset_t_broken=yes,
1084 gdb_cv_prfpregset_t_broken=yes)])
1085 AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
1086 if test $gdb_cv_prfpregset_t_broken = yes; then
60ca704f
SE
1087 AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
1088 [Define if the prfpregset_t type is broken.])
d84dd0c5
MK
1089 fi
1090 fi
1091
c906108c
SS
1092 dnl Check for PIOCSET ioctl entry
1093
1094 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
1095 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
1096 [AC_TRY_COMPILE([#include <unistd.h>
1097#include <sys/types.h>
1098#include <sys/procfs.h>
1099], [
1100 int dummy;;
1101 dummy = ioctl(0, PIOCSET, &dummy);
1102 ],
1103 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
1104 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
1105 if test $gdb_cv_have_procfs_piocset = yes; then
60ca704f
SE
1106 AC_DEFINE(HAVE_PROCFS_PIOCSET, 1,
1107 [Define if ioctl argument PIOCSET is available.])
c906108c
SS
1108 fi
1109fi
1110
d45fe813
KB
1111dnl For native ports (host == target), check to see what kind of
1112dnl legacy link.h support is needed. (See solib-legacy.c.)
1113if test ${host} = ${target} ; then
1114 dnl Check for struct link_map with l_ members which are indicative
1115 dnl of SVR4-like shared libraries
1116
1117 AC_MSG_CHECKING(for member l_addr in struct link_map)
1118 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members,
1119 [AC_TRY_COMPILE([#include <link.h>],
1120 [struct link_map lm; (void) lm.l_addr;],
1121 gdb_cv_have_struct_link_map_with_l_members=yes,
1122 gdb_cv_have_struct_link_map_with_l_members=no)])
1123 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members)
1124 if test $gdb_cv_have_struct_link_map_with_l_members = yes; then
60ca704f
SE
1125 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS,1,
1126 [Define if <link.h> exists and defines struct link_map which has
1127 members with an ``l_'' prefix. (For Solaris, SVR4, and
1128 SVR4-like systems.)])
d45fe813
KB
1129 fi
1130
1131 dnl Check for struct link_map with lm_ members which are indicative
1132 dnl of SunOS-like shared libraries
1133
1134 AC_MSG_CHECKING(for member lm_addr in struct link_map)
1135 AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members,
1136 [AC_TRY_COMPILE([#include <sys/types.h>
1137#include <link.h>],
1138 [struct link_map lm; (void) lm.lm_addr;],
1139 gdb_cv_have_struct_link_map_with_lm_members=yes,
1140 gdb_cv_have_struct_link_map_with_lm_members=no)])
1141 AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members)
1142 if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then
60ca704f
SE
1143 AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS, 1,
1144 [Define if <link.h> exists and defines struct link_map which has
1145 members with an ``lm_'' prefix. (For SunOS.)])
d45fe813
KB
1146 fi
1147
1148 dnl Check for struct so_map with som_ members which are found on
1149 dnl some *BSD systems.
1150
1151 AC_MSG_CHECKING(for member som_addr in struct so_map)
1152 AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members,
1153 [AC_TRY_COMPILE([#include <sys/types.h>
39812ceb
C
1154#ifdef HAVE_NLIST_H
1155#include <nlist.h>
1156#endif
d45fe813
KB
1157#include <link.h>],
1158 [struct so_map lm; (void) lm.som_addr;],
1159 gdb_cv_have_struct_so_map_with_som_members=yes,
1160 gdb_cv_have_struct_so_map_with_som_members=no)])
1161 AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members)
1162 if test $gdb_cv_have_struct_so_map_with_som_members = yes; then
60ca704f
SE
1163 AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS, 1,
1164 [Define if <link.h> exists and defines a struct so_map which has
1165 members with an ``som_'' prefix. (Found on older *BSD systems.)])
d45fe813
KB
1166 fi
1167
1168 dnl Check for struct link_map32 type, which allows a 64-bit Solaris
1169 dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries.
1170
1171 AC_MSG_CHECKING(for struct link_map32 in sys/link.h)
1172 AC_CACHE_VAL(gdb_cv_have_struct_link_map32,
1173 [AC_TRY_COMPILE([#define _SYSCALL32
1174#include <sys/link.h>], [struct link_map32 l;],
1175 gdb_cv_have_struct_link_map32=yes,
1176 gdb_cv_have_struct_link_map32=no)])
1177 AC_MSG_RESULT($gdb_cv_have_struct_link_map32)
1178 if test $gdb_cv_have_struct_link_map32 = yes; then
60ca704f
SE
1179 AC_DEFINE(HAVE_STRUCT_LINK_MAP32, 1,
1180 [Define if <sys/link.h> has struct link_map32])
1181 AC_DEFINE(_SYSCALL32, 1,
1182 [Define if <sys/link.h> has link_map32 (solaris sparc-64 target)])
d45fe813
KB
1183 fi
1184fi
1185
bc8bcb4b
MK
1186# Check if the compiler supports the `long long' type.
1187
1188AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long,
1189 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1190[[extern long long foo;]],
1191[[switch (foo & 2) { case 0: return 1; }]])],
1192 gdb_cv_c_long_long=yes,
1193 gdb_cv_c_long_long=no)])
c906108c 1194if test $gdb_cv_c_long_long = yes; then
bc8bcb4b
MK
1195 AC_DEFINE(CC_HAS_LONG_LONG, 1,
1196 [Define to 1 if the compiler supports long long.])
c906108c
SS
1197fi
1198
bc8bcb4b 1199# Check if the compiler and runtime support printing long longs.
c906108c 1200
bc8bcb4b
MK
1201AC_CACHE_CHECK([for long long support in printf],
1202 gdb_cv_printf_has_long_long,
1203 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1204[[char buf[32];
c906108c
SS
1205 long long l = 0;
1206 l = (l << 16) + 0x0123;
1207 l = (l << 16) + 0x4567;
1208 l = (l << 16) + 0x89ab;
1209 l = (l << 16) + 0xcdef;
1210 sprintf (buf, "0x%016llx", l);
bc8bcb4b
MK
1211 return (strcmp ("0x0123456789abcdef", buf));]])],
1212 gdb_cv_printf_has_long_long=yes,
1213 gdb_cv_printf_has_long_long=no,
1214 gdb_cv_printf_has_long_long=no)])
c906108c 1215if test $gdb_cv_printf_has_long_long = yes; then
bc8bcb4b
MK
1216 AC_DEFINE(PRINTF_HAS_LONG_LONG, 1,
1217 [Define to 1 if the "%ll" format works to print long longs.])
c906108c 1218fi
c906108c 1219
1a619819
LM
1220# Check if the compiler and runtime support printing decfloats.
1221
1222AC_CACHE_CHECK([for decfloat support in printf],
1223 gdb_cv_printf_has_decfloat,
1224 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1225[[char buf[64];
1226 _Decimal32 d32 = 1.2345df;
1227 _Decimal64 d64 = 1.2345dd;
1228 _Decimal128 d128 = 1.2345dl;
1229 sprintf (buf, "Decimal32: %H\nDecimal64: %D\nDecimal128: %DD", d32, d64, d128);
1230 return (strcmp ("Decimal32: 1.2345\nDecimal64: 1.2345\nDecimal128: 1.2345", buf));]])],
1231 gdb_cv_printf_has_decfloat=yes,
1232 gdb_cv_printf_has_decfloat=no,
1233 gdb_cv_printf_has_decfloat=no)])
1234if test $gdb_cv_printf_has_decfloat = yes; then
1235 AC_DEFINE(PRINTF_HAS_DECFLOAT, 1,
1236 [Define to 1 if the "%H, %D and %DD" formats work to print decfloats.])
1237fi
1238
bc8bcb4b
MK
1239# Check if the compiler supports the `long double' type. We can't use
1240# AC_C_LONG_DOUBLE because that one does additional checks on the
1241# constants defined in <float.h> that fail on some systems,
1242# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
c906108c 1243
bc8bcb4b
MK
1244AC_CACHE_CHECK([for long double support in compiler], gdb_cv_c_long_double,
1245 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long double foo;]])],
1246 gdb_cv_c_long_double=yes,
1247 gdb_cv_c_long_double=no)])
1248if test $gdb_cv_c_long_double = yes; then
1249 AC_DEFINE(HAVE_LONG_DOUBLE, 1,
1250 [Define to 1 if the compiler supports long double.])
c906108c
SS
1251fi
1252
bc8bcb4b 1253# Check if the compiler and runtime support printing long doubles.
c906108c 1254
bc8bcb4b
MK
1255AC_CACHE_CHECK([for long double support in printf],
1256 gdb_cv_printf_has_long_double,
1257 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
1258[[char buf[16];
c906108c
SS
1259 long double f = 3.141592653;
1260 sprintf (buf, "%Lg", f);
bc8bcb4b
MK
1261 return (strncmp ("3.14159", buf, 7));]])],
1262 gdb_cv_printf_has_long_double=yes,
1263 gdb_cv_printf_has_long_double=no,
1264 gdb_cv_printf_has_long_double=no)])
c906108c 1265if test $gdb_cv_printf_has_long_double = yes; then
bc8bcb4b
MK
1266 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE, 1,
1267 [Define to 1 if the "%Lg" format works to print long doubles.])
c906108c 1268fi
c906108c 1269
bc8bcb4b 1270# Check if the compiler and runtime support scanning long doubles.
c906108c 1271
bc8bcb4b
MK
1272AC_CACHE_CHECK([for long double support in scanf],
1273 gdb_cv_scanf_has_long_double,
1274 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
1275[[#include <stdio.h>]],
1276[[char *buf = "3.141592653";
c906108c
SS
1277 long double f = 0;
1278 sscanf (buf, "%Lg", &f);
bc8bcb4b
MK
1279 return !(f > 3.14159 && f < 3.14160);]])],
1280 gdb_cv_scanf_has_long_double=yes,
1281 gdb_cv_scanf_has_long_double=no,
1282 gdb_cv_scanf_has_long_double=no)])
c906108c 1283if test $gdb_cv_scanf_has_long_double = yes; then
bc8bcb4b
MK
1284 AC_DEFINE(SCANF_HAS_LONG_DOUBLE, 1,
1285 [Define to 1 if the "%Lg" format works to scan long doubles.])
c906108c 1286fi
c906108c 1287
438013df
AO
1288case ${host_os} in
1289aix*)
1290 AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [
1291 SAVE_LDFLAGS=$LDFLAGS
1292
1293 case $GCC in
1294 yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;;
1295 *) gdb_cv_bigtoc=-bbigtoc ;;
1296 esac
1297
1298 LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
1299 AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
ec76baa5 1300 LDFLAGS="${SAVE_LDFLAGS}"
438013df
AO
1301 ])
1302 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
1303 ;;
1304esac
1305
c906108c 1306
d92419e5
JB
1307dnl For certain native configurations, we need to check whether thread
1308dnl support can be built in or not.
1309dnl
1310dnl Note that we only want this if we are both native (host == target),
1311dnl and not doing a canadian cross build (build == host).
c906108c
SS
1312
1313if test ${build} = ${host} -a ${host} = ${target} ; then
1314 case ${host_os} in
1315 hpux*)
1316 AC_MSG_CHECKING(for HPUX/OSF thread support)
1317 if test -f /usr/include/dce/cma_config.h ; then
1318 if test "$GCC" = "yes" ; then
1319 AC_MSG_RESULT(yes)
60ca704f
SE
1320 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT, 1,
1321 [Define if you have HPUX threads])
3483b318 1322 CONFIG_OBS="${CONFIG_OBS} hpux-thread.o"
c906108c
SS
1323 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
1324 else
1325 AC_MSG_RESULT(no (suppressed because you are not using GCC))
1326 fi
1327 else
1328 AC_MSG_RESULT(no)
1329 fi
1330 ;;
1331 solaris*)
d92419e5
JB
1332 # See if thread_db library is around for Solaris thread debugging.
1333 # Note that we must explicitly test for version 1 of the library
1334 # because version 0 (present on Solaris 2.4 or earlier) doesn't have
1335 # the same API.
c906108c
SS
1336 AC_MSG_CHECKING(for Solaris thread debugging library)
1337 if test -f /usr/lib/libthread_db.so.1 ; then
1338 AC_MSG_RESULT(yes)
60ca704f
SE
1339 AC_DEFINE(HAVE_THREAD_DB_LIB, 1,
1340 [Define if using Solaris thread debugging.])
3483b318 1341 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
c906108c
SS
1342 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
1343 AC_CHECK_LIB(dl, dlopen)
1344 if test "$GCC" = "yes" ; then
1345 # The GNU linker requires the -export-dynamic option to make
1346 # all symbols visible in the dynamic symbol table.
1347 hold_ldflags=$LDFLAGS
1348 AC_MSG_CHECKING(for the ld -export-dynamic flag)
1349 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
1350 AC_TRY_LINK(, [int i;], found=yes, found=no)
1351 LDFLAGS=$hold_ldflags
1352 AC_MSG_RESULT($found)
1353 if test $found = yes; then
1354 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
1355 fi
1356 fi
1357 # Sun randomly tweaked the prototypes in <proc_service.h>
1358 # at one point.
1359 AC_MSG_CHECKING(if <proc_service.h> is old)
1360 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
1361 AC_TRY_COMPILE([
1362 #include <proc_service.h>
1363 ps_err_e ps_pdwrite
1364 (struct ps_prochandle*, psaddr_t, const void*, size_t);
1365 ],, gdb_cv_proc_service_is_old=no,
1366 gdb_cv_proc_service_is_old=yes)
1367 ])
1368 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
1369 if test $gdb_cv_proc_service_is_old = yes; then
60ca704f
SE
1370 AC_DEFINE(PROC_SERVICE_IS_OLD, 1,
1371 [Define if <proc_service.h> on solaris uses int instead of
1372 size_t, and assorted other type changes.])
c906108c
SS
1373 fi
1374 else
1375 AC_MSG_RESULT(no)
1376 fi
1377 ;;
d92419e5
JB
1378 aix*)
1379 AC_MSG_CHECKING(for AiX thread debugging library)
1380 AC_CACHE_VAL(gdb_cv_have_aix_thread_debug,
1381 [AC_TRY_COMPILE([#include <sys/pthdebug.h>],
1382 [#ifndef PTHDB_VERSION_3
1383 #error
1384 #endif],
1385 gdb_cv_have_aix_thread_debug=yes,
1386 gdb_cv_have_aix_thread_debug=no)])
1387 AC_MSG_RESULT($gdb_cv_have_aix_thread_debug)
1388 if test $gdb_cv_have_aix_thread_debug = yes; then
1389 CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
3483b318 1390 CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
d92419e5
JB
1391 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug"
1392 fi
1393 ;;
c906108c
SS
1394 esac
1395 AC_SUBST(CONFIG_LDFLAGS)
1396fi
1397
59f80f10
DJ
1398dnl See if we have a thread_db header file that has TD_NOTALLOC and
1399dnl other error codes.
3f47be5c
EZ
1400if test "x$ac_cv_header_thread_db_h" = "xyes"; then
1401 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC],
1402 gdb_cv_thread_db_h_has_td_notalloc,
1403 AC_TRY_COMPILE(
1404 [#include <thread_db.h>],
1405 [int i = TD_NOTALLOC;],
1406 gdb_cv_thread_db_h_has_td_notalloc=yes,
1407 gdb_cv_thread_db_h_has_td_notalloc=no
1408 )
1409 )
59f80f10
DJ
1410 AC_CACHE_CHECK([whether <thread_db.h> has TD_VERSION],
1411 gdb_cv_thread_db_h_has_td_version,
1412 AC_TRY_COMPILE(
1413 [#include <thread_db.h>],
1414 [int i = TD_VERSION;],
1415 gdb_cv_thread_db_h_has_td_version=yes,
1416 gdb_cv_thread_db_h_has_td_version=no
1417 )
1418 )
1419 AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTLS],
1420 gdb_cv_thread_db_h_has_td_notls,
1421 AC_TRY_COMPILE(
1422 [#include <thread_db.h>],
1423 [int i = TD_NOTLS;],
1424 gdb_cv_thread_db_h_has_td_notls=yes,
1425 gdb_cv_thread_db_h_has_td_notls=no
1426 )
1427 )
3f47be5c
EZ
1428fi
1429if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then
1430 AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1,
1431 [Define if <thread_db.h> has the TD_NOTALLOC error code.])
1432fi
59f80f10
DJ
1433if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then
1434 AC_DEFINE(THREAD_DB_HAS_TD_VERSION, 1,
1435 [Define if <thread_db.h> has the TD_VERSION error code.])
1436fi
1437if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then
1438 AC_DEFINE(THREAD_DB_HAS_TD_NOTLS, 1,
1439 [Define if <thread_db.h> has the TD_NOTLS error code.])
1440fi
3f47be5c 1441
b757528f
JJ
1442dnl See if we have a sys/syscall header file that has __NR_tkill.
1443if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
1444 AC_CACHE_CHECK([whether <sys/syscall.h> has __NR_tkill],
1445 gdb_cv_sys_syscall_h_has_tkill,
1446 AC_TRY_COMPILE(
1447 [#include <sys/syscall.h>],
1448 [int i = __NR_tkill;],
1449 gdb_cv_sys_syscall_h_has_tkill=yes,
1450 gdb_cv_sys_syscall_h_has_tkill=no
1451 )
1452 )
1453fi
1454dnl See if we can issue tkill syscall.
1455if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then
60ca704f 1456 AC_DEFINE(HAVE_TKILL_SYSCALL, 1, [Define if you support the tkill syscall.])
b757528f
JJ
1457fi
1458
10568435
JK
1459dnl Check if we can disable the virtual address space randomization.
1460dnl The functionality of setarch -R.
1461AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include <sys/personality.h>])
1462define([PERSONALITY_TEST], [AC_LANG_PROGRAM([#include <sys/personality.h>], [
1463# if !HAVE_DECL_ADDR_NO_RANDOMIZE
1464# define ADDR_NO_RANDOMIZE 0x0040000
1465# endif
1466 /* Test the flag could be set and stays set. */
1467 personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE);
1468 if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE))
1469 return 1])])
1470AC_RUN_IFELSE([PERSONALITY_TEST],
1471 [have_personality=true],
1472 [have_personality=false],
1473 [AC_LINK_IFELSE([PERSONALITY_TEST],
1474 [have_personality=true],
1475 [have_personality=false])])
1476if $have_personality
1477then
1478 AC_DEFINE([HAVE_PERSONALITY], 1,
1479 [Define if you support the personality syscall.])
1480fi
1481
c906108c 1482dnl Handle optional features that can be enabled.
fb40c209 1483
030292b7
DJ
1484AC_ARG_WITH(sysroot,
1485[ --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
1486[
1487 case ${with_sysroot} in
715d1656 1488 yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
030292b7
DJ
1489 *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
1490 esac
1491
1492 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
1493
07abfebf
RS
1494 if test "x$prefix" = xNONE; then
1495 test_prefix=/usr/local
1496 else
1497 test_prefix=$prefix
1498 fi
aa28a74e 1499 if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
07abfebf 1500 test_exec_prefix=$test_prefix
030292b7 1501 else
07abfebf 1502 test_exec_prefix=$exec_prefix
030292b7
DJ
1503 fi
1504 case ${TARGET_SYSTEM_ROOT} in
715d1656 1505 "${test_prefix}"|"${test_prefix}/"*|\
07abfebf
RS
1506 "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
1507 '${prefix}'|'${prefix}/'*|\
715d1656 1508 '${exec_prefix}'|'${exec_prefix}/'*)
030292b7
DJ
1509 t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
1510 TARGET_SYSTEM_ROOT_DEFINE="$t"
1511 ;;
1512 esac
1513], [
1514 TARGET_SYSTEM_ROOT=
1515 TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
1516])
1517AC_SUBST(TARGET_SYSTEM_ROOT)
1518AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
1519
16e7150e
JG
1520system_gdbinit=
1521AC_ARG_WITH(system-gdbinit,
1522[ --with-system-gdbinit=file Automatically load a system-wide gdbinit file],
1523[system_gdbinit=${withval}])
1524
1525AC_DEFINE_DIR(SYSTEM_GDBINIT, system_gdbinit,
1526 [System-wide gdbinit file.])
1527
1528if test "x$prefix" = xNONE; then
1529 test_prefix=$ac_default_prefix
1530else
1531 test_prefix=$prefix
1532fi
1533if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
1534 test_exec_prefix=$test_prefix
1535else
1536 test_exec_prefix=$exec_prefix
1537fi
1538case ${system_gdbinit} in
1539 "${test_prefix}"|"${test_prefix}/"*|\
1540 "${test_exec_prefix}"|"${test_exec_prefix}/"*|\
1541 '${prefix}'|'${prefix}/'*|\
1542 '${exec_prefix}'|'${exec_prefix}/'*)
1543 AC_DEFINE(SYSTEM_GDBINIT_RELOCATABLE, 1,
1544 [Define if the system-wide gdbinit file should be relocated when GDB is moved.])
1545 ;;
1546esac
1547
094a342e
MK
1548AC_ARG_ENABLE(werror,
1549 [ --enable-werror treat compile warnings as errors],
1550 [case "${enableval}" in
1551 yes | y) ERROR_ON_WARNING="yes" ;;
1552 no | n) ERROR_ON_WARNING="no" ;;
1553 *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
1554 esac])
1555
1556# Enable -Werror by default when using gcc
1557if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
1558 ERROR_ON_WARNING=yes
1559fi
1560
1561WERROR_CFLAGS=""
1562if test "${ERROR_ON_WARNING}" = yes ; then
1563 WERROR_CFLAGS="-Werror"
1564fi
1565
aa79a185
DJ
1566# The entries after -Wno-pointer-sign are disabled warnings which may
1567# be enabled in the future, which can not currently be used to build
1568# GDB.
1569# NOTE: If you change this list, remember to update
3b851bce 1570# gdb/doc/gdbint.texinfo.
aa79a185
DJ
1571build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
1572-Wformat-nonliteral -Wno-pointer-sign \
58b38ee2 1573-Wno-unused -Wno-switch -Wno-char-subscripts"
a3b362c4 1574
3526781e
DJ
1575# Enable -Wno-format by default when using gcc on mingw since many
1576# GCC versions complain about %I64.
1577case "${host}" in
1578 *-*-mingw32*) build_warnings="$build_warnings -Wno-format" ;;
1579esac
1580
c906108c
SS
1581AC_ARG_ENABLE(build-warnings,
1582[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
1decb323 1583[case "${enableval}" in
c906108c
SS
1584 yes) ;;
1585 no) build_warnings="-w";;
1586 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1587 build_warnings="${build_warnings} ${t}";;
1588 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1589 build_warnings="${t} ${build_warnings}";;
1590 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
d4f3574e
SS
1591esac
1592if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
746a987d 1593 echo "Setting compiler warning flags = $build_warnings" 6>&1
1decb323 1594fi])dnl
3b851bce
AC
1595AC_ARG_ENABLE(gdb-build-warnings,
1596[ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used],
1597[case "${enableval}" in
1598 yes) ;;
1599 no) build_warnings="-w";;
1600 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1601 build_warnings="${build_warnings} ${t}";;
1602 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
1603 build_warnings="${t} ${build_warnings}";;
1604 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
1605esac
1606if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
1607 echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
1608fi])dnl
104c1213 1609WARN_CFLAGS=""
c906108c
SS
1610if test "x${build_warnings}" != x -a "x$GCC" = xyes
1611then
746a987d
AC
1612 AC_MSG_CHECKING(compiler warning flags)
1613 # Separate out the -Werror flag as some files just cannot be
1614 # compiled with it enabled.
1615 for w in ${build_warnings}; do
1616 case $w in
1617 -Werr*) WERROR_CFLAGS=-Werror ;;
1618 *) # Check that GCC accepts it
4536bbc6
AC
1619 saved_CFLAGS="$CFLAGS"
1620 CFLAGS="$CFLAGS $w"
1621 AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",)
1622 CFLAGS="$saved_CFLAGS"
746a987d
AC
1623 esac
1624 done
aa79a185 1625 AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS})
1decb323 1626fi
c906108c 1627AC_SUBST(WARN_CFLAGS)
104c1213 1628AC_SUBST(WERROR_CFLAGS)
c906108c 1629
7a292a7a
SS
1630# In the Cygwin environment, we need some additional flags.
1631AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
1632[AC_EGREP_CPP(lose, [
1633#if defined (__CYGWIN__) || defined (__CYGWIN32__)
1634lose
1635#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
1636
aff38e61
AC
1637
1638dnl Figure out which of the many generic ser-*.c files the _host_ supports.
3eb25fda 1639SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
aff38e61 1640case ${host} in
95cbc983
AC
1641 *go32* ) SER_HARDWIRE=ser-go32.o ;;
1642 *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
0ea3f30e 1643 *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;;
aff38e61
AC
1644esac
1645AC_SUBST(SER_HARDWIRE)
1646
cd0fc7c3
SS
1647# libreadline needs libuser32.a in a cygwin environment
1648WIN32LIBS=
1649if test x$gdb_cv_os_cygwin = xyes; then
c5394b80
JM
1650 WIN32LIBS="-luser32"
1651 case "${target}" in
1652 *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
1653 ;;
1654 esac
cd0fc7c3 1655fi
b4505029
MM
1656
1657# The ser-tcp.c module requires sockets.
1658case ${host} in
1659 *mingw32*)
1660 AC_DEFINE(USE_WIN32API, 1,
1661 [Define if we should use the Windows API, instead of the
1662 POSIX API. On Windows, we use the Windows API when
1663 building for MinGW, but the POSIX API when building
1664 for Cygwin.])
1665 WIN32LIBS="$WIN32LIBS -lws2_32"
1666 ;;
1667esac
cd0fc7c3 1668AC_SUBST(WIN32LIBS)
7a292a7a 1669
31d99776
DJ
1670# Add ELF support to GDB, but only if BFD includes ELF support.
1671OLD_CFLAGS=$CFLAGS
1672OLD_LDFLAGS=$LDFLAGS
1673OLD_LIBS=$LIBS
cab58a69 1674CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
31d99776 1675LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
7b3200f9 1676intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
0f72fb1c 1677LIBS="-lbfd -liberty $intl $LIBS"
31d99776
DJ
1678AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf,
1679[AC_TRY_LINK(
1680[#include <stdlib.h>
1681#include "bfd.h"
1682#include "elf-bfd.h"
1683],
1684[bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd); ],
1685gdb_cv_var_elf=yes, gdb_cv_var_elf=no)])
1686if test $gdb_cv_var_elf = yes; then
1687 CONFIG_OBS="$CONFIG_OBS elfread.o"
1688 AC_DEFINE(HAVE_ELF, 1,
1689 [Define if ELF support should be included.])
1690fi
1691CFLAGS=$OLD_CFLAGS
1692LDFLAGS=$OLD_LDFLAGS
1693LIBS=$OLD_LIBS
1694
121ce6e5
DJ
1695# Add any host-specific objects to GDB.
1696CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
1697
3fc11d3e
JM
1698LIBGUI="../libgui/src/libgui.a"
1699GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
1700AC_SUBST(LIBGUI)
1701AC_SUBST(GUI_CFLAGS_X)
7a292a7a 1702
3fc11d3e
JM
1703WIN32LDAPP=
1704AC_SUBST(WIN32LIBS)
1705AC_SUBST(WIN32LDAPP)
1706
d91670b9 1707case "${host}" in
686a5eed 1708*-*-cygwin* | *-*-mingw* )
d91670b9
CV
1709 configdir="win"
1710 ;;
1711*)
1712 configdir="unix"
1713 ;;
1714esac
3fc11d3e
JM
1715
1716GDBTKLIBS=
1717if test "${enable_gdbtk}" = "yes"; then
1718
d1c3b63a
KS
1719 # Gdbtk must have an absolute path to srcdir in order to run
1720 # properly when not installed.
1721 here=`pwd`
1722 cd ${srcdir}
1723 GDBTK_SRC_DIR=`pwd`
1724 cd $here
1725
5062cc19 1726 SC_PATH_TCLCONFIG
85541719
DE
1727
1728 # If $no_tk is nonempty, then we can't do Tk, and there is no
1729 # point to doing Tcl.
1730 SC_PATH_TKCONFIG
1731
1732 if test -z "${no_tcl}" -a -z "${no_tk}"; then
5062cc19
KS
1733 SC_LOAD_TCLCONFIG
1734
1735 # Check for in-tree tcl
1736 here=`pwd`
1737 cd ${srcdir}/..
1738 topdir=`pwd`
1739 cd ${here}
1740
1741 intree="no"
1742 if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
1743 intree="yes"
1744 fi
1745
1746 # Find Tcl private headers
1747 if test x"${intree}" = xno; then
1748 CY_AC_TCL_PRIVATE_HEADERS
1749 TCL_INCLUDE="${TCL_INCLUDE_SPEC} ${TCL_PRIVATE_INCLUDE}"
1750 TCL_LIBRARY="${TCL_LIB_SPEC}"
1751 TCL_DEPS=""
1752 else
1753 # If building tcl in the same src tree, private headers
1754 # are not needed, but we need to be sure to use the right
1755 # headers library
1756 TCL_INCLUDE="-I${TCL_SRC_DIR}/generic"
1757 TCL_LIBRARY="${TCL_BUILD_LIB_SPEC}"
1758 TCL_DEPS="../tcl/${configdir}${TCL_LIB_FILE}"
1759 fi
1760 AC_SUBST(TCL_INCLUDE)
1761 AC_SUBST(TCL_LIBRARY)
1762 AC_SUBST(TCL_DEPS)
dd2504ab 1763
85541719
DE
1764 SC_LOAD_TKCONFIG
1765
1766 # Check for in-tree Tk
1767 intree="no"
1768 if test "${TK_SRC_DIR}" = "${topdir}/tk"; then
1769 intree="yes"
1770 fi
1771
1772 # Find Tk private headers
1773 if test x"${intree}" = xno; then
1774 CY_AC_TK_PRIVATE_HEADERS
1775 TK_INCLUDE="${TK_INCLUDE_SPEC} ${TK_PRIVATE_INCLUDE}"
1776 TK_LIBRARY=${TK_LIB_SPEC}
1777 TK_DEPS=""
1778 else
1779 TK_INCLUDE="-I${TK_SRC_DIR}/generic"
1780 TK_LIBRARY="${TK_BUILD_LIB_SPEC}"
1781 TK_DEPS="../tk/${configdir}/${TK_LIB_FILE}"
1782 fi
1783 AC_SUBST(TK_INCLUDE)
1784 AC_SUBST(TK_LIBRARY)
1785 AC_SUBST(TK_DEPS)
1786 AC_SUBST(TK_XINCLUDES)
1787
1788 ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
1789
1790 # Include some libraries that Tcl and Tk want.
1791 TCL_LIBS='$(LIBGUI) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
1792 # Yes, the ordering seems wrong here. But it isn't.
1793 # TK_LIBS is the list of libraries that need to be linked
1794 # after Tcl/Tk. Note that this isn't put into LIBS. If it
1795 # were in LIBS then any link tests after this point would
1796 # try to include things like `$(LIBGUI)', which wouldn't work.
1797 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
1798
1799 CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)"
1800 CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)"
1801 CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)"
1802 CONFIG_ALL="${CONFIG_ALL} all-gdbtk"
1803 CONFIG_CLEAN="${CONFIG_CLEAN} clean-gdbtk"
1804 CONFIG_INSTALL="${CONFIG_INSTALL} install-gdbtk"
1805 CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-gdbtk"
1806
1807 if test x$gdb_cv_os_cygwin = xyes; then
1808 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
1809 WIN32LDAPP="-Wl,--subsystem,console"
1810 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
3fc11d3e 1811 fi
ffc6a242 1812
85541719
DE
1813 AC_CONFIG_SUBDIRS(gdbtk)
1814 fi
3fc11d3e
JM
1815fi
1816
3fc11d3e
JM
1817AC_SUBST(X_CFLAGS)
1818AC_SUBST(X_LDFLAGS)
1819AC_SUBST(X_LIBS)
3fc11d3e
JM
1820AC_SUBST(GDBTKLIBS)
1821AC_SUBST(GDBTK_CFLAGS)
d1c3b63a 1822AC_SUBST(GDBTK_SRC_DIR)
8b93c638 1823
c906108c
SS
1824AC_PATH_X
1825
7a292a7a 1826# Unlike the sim directory, whether a simulator is linked is controlled by
9b624dbe 1827# presence of a gdb_sim definition in the target configure.tgt entry.
7a292a7a
SS
1828# This code just checks for a few cases where we'd like to ignore those
1829# definitions, even when they're present in the '.mt' file. These cases
1830# are when --disable-sim is specified, or if the simulator directory is
6c5cfe5b 1831# not part of the source tree.
7a292a7a
SS
1832#
1833AC_ARG_ENABLE(sim,
1834[ --enable-sim Link gdb with simulator],
1835[echo "enable_sim = $enable_sim";
1836 echo "enableval = ${enableval}";
1837 case "${enableval}" in
1838 yes) ignore_sim=false ;;
1839 no) ignore_sim=true ;;
1840 *) ignore_sim=false ;;
1841 esac],
1842[ignore_sim=false])
1843
1844if test ! -d "${srcdir}/../sim"; then
1845 ignore_sim=true
1846fi
1847
9b624dbe
UW
1848SIM=
1849SIM_OBS=
1850if test "${ignore_sim}" = "false"; then
1851 if test x"${gdb_sim}" != x ; then
1852 SIM="${gdb_sim}"
1853 SIM_OBS="remote-sim.o"
60ca704f 1854 AC_DEFINE(WITH_SIM, 1, [Define if the simulator is being linked in.])
9b624dbe 1855 fi
7a292a7a 1856fi
9b624dbe
UW
1857AC_SUBST(SIM)
1858AC_SUBST(SIM_OBS)
7a292a7a 1859
c906108c 1860AC_SUBST(ENABLE_CFLAGS)
d28f9cdf 1861AC_SUBST(PROFILE_CFLAGS)
c906108c
SS
1862
1863AC_SUBST(CONFIG_OBS)
1864AC_SUBST(CONFIG_DEPS)
1865AC_SUBST(CONFIG_SRCS)
b3a90332
AC
1866AC_SUBST(CONFIG_ALL)
1867AC_SUBST(CONFIG_CLEAN)
e56ac5c3
AC
1868AC_SUBST(CONFIG_INSTALL)
1869AC_SUBST(CONFIG_UNINSTALL)
c906108c 1870
c35f4ffc
AC
1871# List of host floatformats.
1872AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat])
1873AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat])
1874AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat])
1875
c906108c
SS
1876# target_subdir is used by the testsuite to find the target libraries.
1877target_subdir=
1878if test "${host}" != "${target}"; then
1879 target_subdir="${target_alias}/"
1880fi
1881AC_SUBST(target_subdir)
1882
1883frags=
771b4502 1884if test "${gdb_native}" = "yes"; then
0dad8a66
MK
1885 host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
1886 if test ! -f ${host_makefile_frag}; then
1887 AC_MSG_ERROR("*** Gdb does not support native target ${host}")
1888 fi
1889 frags="$frags $host_makefile_frag"
1890else
1891 host_makefile_frag=/dev/null
c906108c 1892fi
c906108c 1893
c906108c 1894AC_SUBST_FILE(host_makefile_frag)
c906108c
SS
1895AC_SUBST(frags)
1896
1897changequote(,)dnl
771b4502 1898if test "${gdb_native}" = "yes"; then
a85f51e7
DJ
1899# We pick this up from the host configuration file (.mh) because we
1900# do not have a native configuration Makefile fragment.
c906108c
SS
1901nativefile=`sed -n '
1902s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
1903' ${host_makefile_frag}`
c906108c
SS
1904fi
1905changequote([,])
1906
b00a8037
DJ
1907if test x"${gdb_osabi}" != x ; then
1908 AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
1909 [Define to the default OS ABI for this configuration.])
1910fi
1911
8dcde887
MK
1912# Enable multi-ice-gdb-server.
1913AC_ARG_ENABLE(multi-ice,
1914[ --enable-multi-ice build the multi-ice-gdb-server],
1915 [case $enableval in
1916 yes | no)
1917 ;;
1918 *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;;
1919 esac])
1920if test "x$enable_multi_ice" = xyes; then
3ace7edb 1921 AC_CONFIG_SUBDIRS(multi-ice)
96baa820
JM
1922fi
1923
a13e2c95
UW
1924# We only build gdbserver automatically in a native configuration.
1925if test "$gdb_native" = "yes"; then
8dcde887
MK
1926 AC_MSG_CHECKING(whether gdbserver is supported on this host)
1927 if test "x$build_gdbserver" = xyes; then
8dcde887 1928 AC_MSG_RESULT(yes)
3ace7edb 1929 AC_CONFIG_SUBDIRS(gdbserver)
8dcde887
MK
1930 else
1931 AC_MSG_RESULT(no)
1932 fi
a85f51e7
DJ
1933fi
1934
db985757 1935# If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
2c0fc042 1936# to an empty version.
c906108c
SS
1937
1938files=
1939links=
5a2402b8 1940
c906108c 1941rm -f nm.h
5a2402b8 1942nm_h=""
c906108c 1943if test "${nativefile}" != ""; then
5a2402b8 1944 nm_h=nm.h
0f475e27
AC
1945 case "${nativefile}" in
1946 nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;;
1947 * ) GDB_NM_FILE="${nativefile}"
1948 esac
5a2402b8
AC
1949 files="${files} ${GDB_NM_FILE}"
1950 links="${links} nm.h"
60ca704f 1951 AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile])
c906108c 1952fi
5a2402b8
AC
1953AC_SUBST(nm_h)
1954
c906108c
SS
1955AC_LINK_FILES($files, $links)
1956
1957dnl Check for exe extension set on certain hosts (e.g. Win32)
1958AC_EXEEXT
1959
234b45d4 1960dnl Detect the character set used by this host.
6c7a06a3
TT
1961dnl At the moment, we just assume it's UTF-8.
1962AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "UTF-8",
234b45d4
KB
1963 [Define to be a string naming the default host character set.])
1964
89a34d1b
JM
1965dnl Required by html, pdf, install-pdf and install-html
1966AC_SUBST(datarootdir)
1967AC_SUBST(docdir)
1968AC_SUBST(htmldir)
1969AC_SUBST(pdfdir)
1970
e28b3332 1971AC_OUTPUT(Makefile .gdbinit:gdbinit.in gnulib/Makefile,
c906108c
SS
1972[
1973dnl Autoconf doesn't provide a mechanism for modifying definitions
1974dnl provided by makefile fragments.
1975dnl
c906108c
SS
1976
1977changequote(,)dnl
db985757 1978sed -e '/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
c906108c
SS
1979mv -f Makefile.tmp Makefile
1980changequote([,])dnl
1981
2acceee2 1982
c906108c
SS
1983case x$CONFIG_HEADERS in
1984xconfig.h:config.in)
1985echo > stamp-h ;;
1986esac
1987],
1988[
1989gdb_host_cpu=$gdb_host_cpu
c906108c
SS
1990nativefile=$nativefile
1991])
1992
1993exit 0
This page took 0.700853 seconds and 4 git commands to generate.