Commit | Line | Data |
---|---|---|
c906108c | 1 | dnl Autoconf configure script for GDB, the GNU debugger. |
0ea3f30e DJ |
2 | dnl Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
3 | dnl 2005, 2006 | |
b6ba6518 | 4 | dnl Free Software Foundation, Inc. |
c906108c SS |
5 | dnl |
6 | dnl This file is part of GDB. | |
7 | dnl | |
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 | |
5a0e3bd0 | 10 | dnl the Free Software Foundation; either version 3 of the License, or |
c906108c | 11 | dnl (at your option) any later version. |
5a0e3bd0 | 12 | dnl |
c906108c SS |
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. | |
5a0e3bd0 | 17 | dnl |
c906108c | 18 | dnl You should have received a copy of the GNU General Public License |
5a0e3bd0 | 19 | dnl along with this program. If not, see <http://www.gnu.org/licenses/>. |
c906108c SS |
20 | |
21 | dnl Process this file with autoconf to produce a configure script. | |
22 | ||
bec39cab | 23 | AC_PREREQ(2.59)dnl |
c906108c SS |
24 | AC_INIT(main.c) |
25 | AC_CONFIG_HEADER(config.h:config.in) | |
413ccac7 | 26 | AM_MAINTAINER_MODE |
c906108c SS |
27 | |
28 | AC_PROG_CC | |
14abd0fb | 29 | AC_GNU_SOURCE |
c906108c SS |
30 | AC_AIX |
31 | AC_ISC_POSIX | |
32 | AM_PROG_CC_STDC | |
33 | ||
34 | AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..) | |
35 | AC_CANONICAL_SYSTEM | |
36 | ||
ddc9cd0f AC |
37 | dnl List of object files and targets accumulated by configure. |
38 | ||
39 | CONFIG_OBS= | |
40 | CONFIG_DEPS= | |
41 | CONFIG_SRCS= | |
42 | ENABLE_CFLAGS= | |
43 | ||
44 | CONFIG_ALL= | |
45 | CONFIG_CLEAN= | |
46 | CONFIG_INSTALL= | |
47 | CONFIG_UNINSTALL= | |
48 | ||
20e95c23 DJ |
49 | dnl Set up for gettext. |
50 | ZW_GNU_GETTEXT_SISTER_DIR | |
ddc9cd0f AC |
51 | |
52 | localedir='${datadir}/locale' | |
53 | AC_SUBST(localedir) | |
54 | ||
20e95c23 | 55 | if test x"$USE_NLS" = xyes; then |
ddc9cd0f AC |
56 | CONFIG_ALL="$CONFIG_ALL all-po" |
57 | CONFIG_CLEAN="$CONFIG_CLEAN clean-po" | |
58 | CONFIG_INSTALL="$CONFIG_INSTALL install-po" | |
59 | CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-po" | |
60 | fi | |
61 | ||
62 | PACKAGE=gdb | |
63 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ]) | |
64 | AC_SUBST(PACKAGE) | |
0fbb3da7 | 65 | |
5b5d99cf JB |
66 | debugdir=${libdir}/debug |
67 | ||
68 | AC_ARG_WITH(separate-debug-dir, | |
69 | [ --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]], | |
70 | [debugdir="${withval}"]) | |
71 | ||
72 | AC_DEFINE_DIR(DEBUGDIR, debugdir, | |
73 | [Global directory for separate debug files. ]) | |
74 | #AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"), | |
c906108c | 75 | |
aa28a74e DJ |
76 | if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then |
77 | if test "x$prefix" = xNONE; then | |
78 | test_prefix=/usr/local | |
79 | else | |
80 | test_prefix=$prefix | |
81 | fi | |
82 | else | |
83 | test_prefix=$exec_prefix | |
84 | fi | |
85 | case ${debugdir} in | |
86 | "${test_prefix}"|"${test_prefix}/"*|\ | |
87 | '${exec_prefix}'|'${exec_prefix}/'*) | |
88 | AC_DEFINE(DEBUGDIR_RELOCATABLE, 1, [Define if the debug directory should be relocated when GDB is moved.]) | |
89 | ;; | |
90 | esac | |
91 | ||
8dcde887 | 92 | AC_CONFIG_SUBDIRS(doc testsuite) |
96baa820 | 93 | |
121ce6e5 DJ |
94 | # Provide defaults for some variables set by the per-host and per-target |
95 | # configuration. | |
96 | gdb_host_obs=posix-hdep.o | |
97 | ||
771b4502 UW |
98 | if test "${target}" = "${host}"; then |
99 | gdb_native=yes | |
100 | else | |
101 | gdb_native=no | |
102 | fi | |
103 | ||
27e9bf90 | 104 | . $srcdir/configure.host |
c906108c | 105 | |
27e9bf90 | 106 | . $srcdir/configure.tgt |
c906108c | 107 | |
27e9bf90 MK |
108 | # Fetch the default architecture and default target vector from BFD. |
109 | targ=$target; . $srcdir/../bfd/config.bfd | |
5c8cc331 | 110 | |
27e9bf90 MK |
111 | # We only want the first architecture, so strip off the others if |
112 | # there is more than one. | |
113 | targ_archs=`echo $targ_archs | sed 's/ .*//'` | |
5c8cc331 | 114 | |
27e9bf90 MK |
115 | if test "x$targ_archs" != x; then |
116 | AC_DEFINE_UNQUOTED(DEFAULT_BFD_ARCH, $targ_archs, | |
117 | [Define to BFD's default architecture. ]) | |
1ba607ad | 118 | fi |
27e9bf90 MK |
119 | if test "x$targ_defvec" != x; then |
120 | AC_DEFINE_UNQUOTED(DEFAULT_BFD_VEC, $targ_defvec, | |
121 | [Define to BFD's default target vector. ]) | |
1ba607ad AC |
122 | fi |
123 | ||
8bb2c122 MK |
124 | AC_ARG_PROGRAM |
125 | ||
627af7ea MK |
126 | # The CLI cannot be disabled yet, but may be in the future. |
127 | ||
128 | # Enable CLI. | |
129 | AC_ARG_ENABLE(gdbcli, | |
130 | [ --disable-gdbcli disable command-line interface (CLI)], | |
131 | [case $enableval in | |
132 | yes) | |
133 | ;; | |
134 | no) | |
135 | AC_MSG_ERROR([the command-line interface cannot be disabled yet]) ;; | |
136 | *) | |
137 | AC_MSG_ERROR([bad value $enableval for --enable-gdbcli]) ;; | |
138 | esac], | |
139 | [enable_gdbcli=yes]) | |
140 | if test x"$enable_gdbcli" = xyes; then | |
141 | if test -d $srcdir/cli; then | |
142 | CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_CLI_OBS)" | |
143 | CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_CLI_DEPS)" | |
144 | CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_CLI_SRCS)" | |
627af7ea | 145 | ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_CLI_CFLAGS)" |
627af7ea MK |
146 | fi |
147 | fi | |
148 | ||
149 | # Enable MI. | |
150 | AC_ARG_ENABLE(gdbmi, | |
151 | [ --disable-gdbmi disable machine-interface (MI)], | |
152 | [case $enableval in | |
153 | yes | no) | |
154 | ;; | |
155 | *) | |
156 | AC_MSG_ERROR([bad value $enableval for --enable-gdbmi]) ;; | |
157 | esac], | |
158 | [enable_gdbmi=yes]) | |
159 | if test x"$enable_gdbmi" = xyes; then | |
160 | if test -d $srcdir/mi; then | |
161 | CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_MI_OBS)" | |
162 | CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_MI_DEPS)" | |
163 | CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_MI_SRCS)" | |
627af7ea | 164 | ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_MI_CFLAGS)" |
627af7ea MK |
165 | fi |
166 | fi | |
167 | ||
287c1a40 MK |
168 | # Enable TUI. |
169 | AC_ARG_ENABLE(tui, | |
170 | [ --enable-tui enable full-screen terminal user interface (TUI)], | |
171 | [case $enableval in | |
172 | yes | no) | |
173 | ;; | |
174 | *) | |
175 | AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;; | |
c324d747 | 176 | esac],enable_tui=yes) |
287c1a40 | 177 | |
8ee53726 MK |
178 | # Enable gdbtk. |
179 | AC_ARG_ENABLE(gdbtk, | |
d28f9cdf | 180 | [ --enable-gdbtk enable gdbtk graphical user interface (GUI)], |
8ee53726 MK |
181 | [case $enableval in |
182 | yes | no) | |
183 | ;; | |
184 | *) | |
185 | AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;; | |
186 | esac], | |
04ac69aa | 187 | [if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then |
8ee53726 MK |
188 | enable_gdbtk=yes |
189 | else | |
190 | enable_gdbtk=no | |
191 | fi]) | |
192 | # We unconditionally disable gdbtk tests on selected platforms. | |
193 | case $host_os in | |
194 | go32* | windows*) | |
195 | AC_MSG_WARN([gdbtk isn't supported on $host; disabling]) | |
196 | enable_gdbtk=no ;; | |
197 | esac | |
198 | ||
0e5d83e3 JJ |
199 | # Libunwind support. |
200 | AC_ARG_WITH(libunwind, | |
201 | [ --with-libunwind Use libunwind frame unwinding support], | |
202 | [case "${withval}" in | |
203 | yes) enable_libunwind=yes ;; | |
204 | no) enable_libunwind=no ;; | |
205 | *) AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;; | |
206 | esac],[ | |
207 | AC_CHECK_HEADERS(libunwind.h) | |
208 | AC_CHECK_HEADERS(libunwind-ia64.h) | |
209 | if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then | |
210 | enable_libunwind=yes; | |
211 | fi | |
212 | ]) | |
213 | ||
214 | if test x"$enable_libunwind" = xyes; then | |
215 | AC_CHECK_HEADERS(libunwind.h) | |
216 | AC_CHECK_HEADERS(libunwind-ia64.h) | |
60ca704f | 217 | AC_DEFINE(HAVE_LIBUNWIND, 1, [Define if libunwind library is being used.]) |
0e5d83e3 JJ |
218 | CONFIG_OBS="$CONFIG_OBS libunwind-frame.o" |
219 | CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o" | |
220 | CONFIG_SRCS="$CONFIG_SRCS libunwind-frame.c" | |
221 | fi | |
222 | ||
d28f9cdf DJ |
223 | # Profiling support. |
224 | AC_ARG_ENABLE(profiling, | |
225 | [ --enable-profiling enable profiling of GDB], | |
226 | [case $enableval in | |
227 | yes | no) | |
228 | ;; | |
229 | *) | |
230 | AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;; | |
231 | esac], | |
232 | [enable_profiling=no]) | |
233 | ||
d9feb4e7 | 234 | AC_CHECK_FUNCS(monstartup _mcleanup) |
b0b1c2c0 MK |
235 | AC_CACHE_CHECK([for _etext], ac_cv_var__etext, |
236 | [AC_TRY_LINK( | |
237 | [#include <stdlib.h> | |
238 | extern char _etext; | |
239 | ], | |
240 | [free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)]) | |
241 | if test $ac_cv_var__etext = yes; then | |
242 | AC_DEFINE(HAVE__ETEXT, 1, | |
243 | [Define to 1 if your system has the _etext variable. ]) | |
244 | fi | |
01fe12f6 JB |
245 | AC_CACHE_CHECK([for etext], ac_cv_var_etext, |
246 | [AC_TRY_LINK( | |
247 | [#include <stdlib.h> | |
248 | extern char etext; | |
249 | ], | |
250 | [free (&etext);], ac_cv_var_etext=yes, ac_cv_var_etext=no)]) | |
251 | if test $ac_cv_var_etext = yes; then | |
252 | AC_DEFINE(HAVE_ETEXT, 1, | |
253 | [Define to 1 if your system has the etext variable. ]) | |
254 | fi | |
d28f9cdf | 255 | if test "$enable_profiling" = yes ; then |
d9feb4e7 DJ |
256 | if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then |
257 | AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup) | |
258 | fi | |
d28f9cdf DJ |
259 | PROFILE_CFLAGS=-pg |
260 | OLD_CFLAGS="$CFLAGS" | |
261 | CFLAGS="$CFLAGS $PROFILE_CFLAGS" | |
262 | ||
d9feb4e7 DJ |
263 | AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg, |
264 | [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes, | |
265 | ac_cv_cc_supports_pg=no)]) | |
d28f9cdf | 266 | |
d9feb4e7 DJ |
267 | if test $ac_cv_cc_supports_pg = no; then |
268 | AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg) | |
269 | fi | |
d28f9cdf DJ |
270 | |
271 | CFLAGS="$OLD_CFLAGS" | |
272 | fi | |
273 | ||
8bb2c122 MK |
274 | # --------------------- # |
275 | # Checks for programs. # | |
276 | # --------------------- # | |
277 | ||
7a292a7a | 278 | AC_PROG_AWK |
c906108c | 279 | AC_PROG_INSTALL |
8bb2c122 MK |
280 | AC_PROG_LN_S |
281 | AC_PROG_RANLIB | |
282 | AC_PROG_YACC | |
283 | ||
c906108c | 284 | AC_CHECK_TOOL(AR, ar) |
95ca63c4 CF |
285 | AC_CHECK_TOOL(DLLTOOL, dlltool) |
286 | AC_CHECK_TOOL(WINDRES, windres) | |
c906108c | 287 | |
8bb2c122 | 288 | # Needed for GNU/Hurd. |
75c6e08a MK |
289 | AC_CHECK_TOOL(MIG, mig) |
290 | ||
9a156167 MK |
291 | # ---------------------- # |
292 | # Checks for libraries. # | |
293 | # ---------------------- # | |
294 | ||
295 | # We might need to link with -lm; most simulators need it. | |
296 | AC_CHECK_LIB(m, main) | |
297 | ||
298 | # We need to link with -lw to get `wctype' on Solaris before Solaris | |
299 | # 2.6. Solaris 2.6 and beyond have this function in libc, and have a | |
300 | # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1 | |
301 | # is known to have this problem). Therefore we avoid libw if we can. | |
302 | AC_CHECK_FUNC(wctype, [], | |
303 | [AC_CHECK_LIB(w, wctype)]) | |
304 | ||
c890192f MK |
305 | # Some systems (e.g. Solaris) have `gethostbyname' in libnsl. |
306 | AC_SEARCH_LIBS(gethostbyname, nsl) | |
307 | ||
9a156167 MK |
308 | # Some systems (e.g. Solaris) have `socketpair' in libsocket. |
309 | AC_SEARCH_LIBS(socketpair, socket) | |
310 | ||
4f0be353 MK |
311 | # For the TUI, we need enhanced curses functionality. |
312 | # | |
313 | # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied | |
314 | # curses library because the latter might not provide all the | |
315 | # functionality we need. However, this leads to problems on systems | |
316 | # where the linker searches /usr/local/lib, but the compiler doesn't | |
317 | # search /usr/local/include, if ncurses is installed in /usr/local. A | |
318 | # default installation of ncurses on alpha*-dec-osf* will lead to such | |
319 | # a situation. | |
8b9cf735 | 320 | AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) |
4f0be353 | 321 | |
4f0be353 MK |
322 | # Since GDB uses Readline, we need termcap functionality. In many |
323 | # cases this will be provided by the curses library, but some systems | |
324 | # have a seperate termcap library, or no curses library at all. | |
287c1a40 MK |
325 | |
326 | case $host_os in | |
327 | cygwin*) | |
328 | if test -d $srcdir/libtermcap; then | |
329 | LIBS="../libtermcap/libtermcap.a $LIBS" | |
330 | ac_cv_search_tgetent="../libtermcap/libtermcap.a" | |
331 | fi ;; | |
228a417c | 332 | go32* | *djgpp*) |
287c1a40 MK |
333 | ac_cv_search_tgetent="none required" |
334 | ;; | |
7ef34f2c MM |
335 | *mingw32*) |
336 | ac_cv_search_tgetent="none required" | |
337 | CONFIG_OBS="$CONFIG_OBS win32-termcap.o" | |
338 | ;; | |
287c1a40 MK |
339 | esac |
340 | ||
4f0be353 MK |
341 | # These are the libraries checked by Readline. |
342 | AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses]) | |
287c1a40 MK |
343 | |
344 | if test "$ac_cv_search_tgetent" = no; then | |
345 | AC_MSG_ERROR([no termcap library found]) | |
346 | fi | |
347 | ||
6a30b0a5 AS |
348 | AC_ARG_WITH([system-readline], |
349 | [AS_HELP_STRING([--with-system-readline], | |
350 | [use installed readline library])]) | |
351 | ||
352 | if test "$with_system_readline" = yes; then | |
353 | READLINE=-lreadline | |
354 | READLINE_DEPS= | |
355 | READLINE_CFLAGS= | |
356 | else | |
357 | READLINE='$(READLINE_DIR)/libreadline.a' | |
358 | READLINE_DEPS='$(READLINE)' | |
359 | READLINE_CFLAGS='-I$(READLINE_SRC)/..' | |
360 | fi | |
361 | AC_SUBST(READLINE) | |
362 | AC_SUBST(READLINE_DEPS) | |
363 | AC_SUBST(READLINE_CFLAGS) | |
364 | ||
5c39566f DJ |
365 | AC_ARG_WITH(expat, |
366 | AS_HELP_STRING([--with-expat], [include expat support (auto/yes/no)]), | |
367 | [], [with_expat=auto]) | |
368 | AC_MSG_CHECKING([whether to use expat]) | |
369 | AC_MSG_RESULT([$with_expat]) | |
370 | ||
371 | if test "${with_expat}" = no; then | |
372 | AC_MSG_WARN([expat support disabled; some features may be unavailable.]) | |
373 | HAVE_LIBEXPAT=no | |
ca4ca11e | 374 | else |
5c39566f DJ |
375 | AC_LIB_HAVE_LINKFLAGS([expat], [], [#include "expat.h"], |
376 | [XML_Parser p = XML_ParserCreate (0);]) | |
377 | if test "$HAVE_LIBEXPAT" != yes; then | |
378 | if test "$with_expat" = yes; then | |
379 | AC_MSG_ERROR([expat is missing or unusable]) | |
380 | else | |
381 | AC_MSG_WARN([expat is missing or unusable; some features may be unavailable.]) | |
382 | fi | |
383 | else | |
384 | save_LIBS=$LIBS | |
385 | LIBS="$LIBS $LIBEXPAT" | |
386 | AC_CHECK_FUNCS(XML_StopParser) | |
387 | LIBS=$save_LIBS | |
388 | fi | |
7fa2210b DJ |
389 | fi |
390 | ||
5ee754fc MK |
391 | # ------------------------- # |
392 | # Checks for header files. # | |
393 | # ------------------------- # | |
c906108c | 394 | |
9608ab8b | 395 | AC_HEADER_DIRENT |
5ee754fc | 396 | AC_HEADER_STAT |
c906108c | 397 | AC_HEADER_STDC |
5ee754fc | 398 | AC_CHECK_HEADERS(nlist.h) |
7cb9022a MK |
399 | AC_CHECK_HEADERS(link.h, [], [], |
400 | [#if HAVE_SYS_TYPES_H | |
401 | # include <sys/types.h> | |
402 | #endif | |
403 | #if HAVE_NLIST_H | |
404 | # include <nlist.h> | |
405 | #endif | |
406 | ]) | |
407 | AC_CHECK_HEADERS(machine/reg.h) | |
5ee754fc | 408 | AC_CHECK_HEADERS(poll.h sys/poll.h) |
a2f23071 | 409 | AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h) |
436868fb | 410 | AC_CHECK_HEADERS(signal.h) |
5ee754fc MK |
411 | AC_CHECK_HEADERS(stddef.h) |
412 | AC_CHECK_HEADERS(stdlib.h) | |
413 | AC_CHECK_HEADERS(stdint.h) | |
414 | AC_CHECK_HEADERS(string.h memory.h strings.h) | |
415 | AC_CHECK_HEADERS(sys/fault.h) | |
416 | AC_CHECK_HEADERS(sys/file.h) | |
417 | AC_CHECK_HEADERS(sys/filio.h) | |
418 | AC_CHECK_HEADERS(sys/ioctl.h) | |
419 | AC_CHECK_HEADERS(sys/param.h) | |
7eb368b3 | 420 | AC_CHECK_HEADERS(sys/resource.h) |
7cb9022a MK |
421 | AC_CHECK_HEADERS(sys/proc.h, [], [], |
422 | [#if HAVE_SYS_PARAM_H | |
423 | # include <sys/param.h> | |
424 | #endif | |
425 | ]) | |
5ee754fc MK |
426 | AC_CHECK_HEADERS(sys/procfs.h) |
427 | AC_CHECK_HEADERS(sys/ptrace.h ptrace.h) | |
428 | AC_CHECK_HEADERS(sys/reg.h sys/debugreg.h) | |
429 | AC_CHECK_HEADERS(sys/select.h) | |
430 | AC_CHECK_HEADERS(sys/syscall.h) | |
086ec9eb | 431 | AC_CHECK_HEADERS(sys/types.h) |
7cb9022a MK |
432 | AC_CHECK_HEADERS(sys/user.h, [], [], |
433 | [#if HAVE_SYS_PARAM_H | |
434 | # include <sys/param.h> | |
435 | #endif | |
436 | ]) | |
5ee754fc MK |
437 | AC_CHECK_HEADERS(sys/wait.h wait.h) |
438 | AC_CHECK_HEADERS(termios.h termio.h sgtty.h) | |
439 | AC_CHECK_HEADERS(unistd.h) | |
440 | ||
b1d19a62 | 441 | # On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash |
5ee754fc MK |
442 | # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to |
443 | # think that we don't have <curses.h> if we're using GCC. | |
444 | case $host_os in | |
b1d19a62 | 445 | solaris2.[[789]]) |
5ee754fc MK |
446 | if test "$GCC" = yes; then |
447 | AC_DEFINE(_MSE_INT_H, 1, | |
ba1e897e EZ |
448 | [Define to 1 to avoid a clash between <widec.h> and <wchar.h> on |
449 | Solaris 2.[789] when using GCC. ]) | |
5ee754fc MK |
450 | fi ;; |
451 | esac | |
3b78cdbb | 452 | AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h) |
c401b55a MK |
453 | AC_CHECK_HEADERS(ncurses/term.h) |
454 | AC_CHECK_HEADERS(term.h, [], [], | |
455 | [#if HAVE_CURSES_H | |
456 | # include <curses.h> | |
457 | #endif | |
458 | ]) | |
5ee754fc MK |
459 | |
460 | # FIXME: kettenis/20030102: In most cases we include these | |
461 | # unconditionally, so what's the point in checking these? | |
462 | AC_CHECK_HEADERS(ctype.h time.h) | |
463 | ||
4e8d927d DJ |
464 | # Create a header we can use portably to get the standard integer types. |
465 | GCC_HEADER_STDINT(gdb_stdint.h) | |
466 | ||
b9362cc7 AC |
467 | # ------------------------- # |
468 | # Checks for declarations. # | |
469 | # ------------------------- # | |
470 | ||
a3828db0 MK |
471 | AC_CHECK_DECLS([free, malloc, realloc]) |
472 | AC_CHECK_DECLS([strerror, strstr]) | |
194134a1 | 473 | AC_CHECK_DECLS([getopt, snprintf, vsnprintf]) |
b9362cc7 | 474 | |
666ec76f MK |
475 | # ----------------------- # |
476 | # Checks for structures. # | |
477 | # ----------------------- # | |
478 | ||
479 | AC_CHECK_MEMBERS([struct stat.st_blocks]) | |
d3ea6809 | 480 | AC_CHECK_MEMBERS([struct stat.st_blksize]) |
666ec76f | 481 | |
5ee754fc MK |
482 | # ------------------ # |
483 | # Checks for types. # | |
484 | # ------------------ # | |
c906108c | 485 | |
5ee754fc | 486 | AC_TYPE_SIGNAL |
f9f87d2c MK |
487 | AC_CHECK_TYPES(socklen_t, [], [], |
488 | [#include <sys/types.h> | |
489 | #include <sys/socket.h> | |
490 | ]) | |
3be60c3d | 491 | AC_CHECK_TYPES(uintptr_t, [], [], [#include <stdint.h>]) |
5ee754fc MK |
492 | |
493 | # ------------------------------------- # | |
494 | # Checks for compiler characteristics. # | |
495 | # ------------------------------------- # | |
c906108c SS |
496 | |
497 | AC_C_CONST | |
bce58c09 | 498 | AC_C_INLINE |
c906108c | 499 | |
5ee754fc MK |
500 | # ------------------------------ # |
501 | # Checks for library functions. # | |
502 | # ------------------------------ # | |
503 | ||
c906108c | 504 | AC_FUNC_ALLOCA |
97bf5e38 | 505 | AC_FUNC_MMAP |
46711df8 | 506 | AC_FUNC_VFORK |
97bf5e38 | 507 | AC_CHECK_FUNCS(canonicalize_file_name realpath) |
7eb368b3 | 508 | AC_CHECK_FUNCS(getrusage) |
d3ea6809 | 509 | AC_CHECK_FUNCS(getuid getgid) |
97bf5e38 | 510 | AC_CHECK_FUNCS(poll) |
14abd0fb | 511 | AC_CHECK_FUNCS(pread64) |
97bf5e38 MK |
512 | AC_CHECK_FUNCS(sbrk) |
513 | AC_CHECK_FUNCS(setpgid setpgrp) | |
e1ea1d75 | 514 | AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask) |
97bf5e38 | 515 | AC_CHECK_FUNCS(socketpair) |
b757528f | 516 | AC_CHECK_FUNCS(syscall) |
bcb3dc3d | 517 | AC_CHECK_FUNCS(ttrace) |
8b9cf735 | 518 | AC_CHECK_FUNCS(wborder) |
97bf5e38 | 519 | |
086ec9eb MK |
520 | # Check the return and argument types of ptrace. No canned test for |
521 | # this, so roll our own. | |
522 | gdb_ptrace_headers=' | |
523 | #if HAVE_SYS_TYPES_H | |
524 | # include <sys/types.h> | |
525 | #endif | |
526 | #if HAVE_SYS_PTRACE_H | |
527 | # include <sys/ptrace.h> | |
528 | #endif | |
529 | #if HAVE_UNISTD_H | |
530 | # include <unistd.h> | |
531 | #endif | |
532 | ' | |
533 | # There is no point in checking if we don't have a prototype. | |
a3828db0 | 534 | AC_CHECK_DECLS(ptrace, [], [ |
086ec9eb MK |
535 | : ${gdb_cv_func_ptrace_ret='int'} |
536 | : ${gdb_cv_func_ptrace_args='int,int,long,long'} | |
537 | ], $gdb_ptrace_headers) | |
538 | # Check return type. | |
539 | AC_CACHE_CHECK([return type of ptrace], gdb_cv_func_ptrace_ret, | |
540 | AC_TRY_COMPILE($gdb_ptrace_headers, | |
5885ab49 MK |
541 | [extern int ptrace ();], |
542 | gdb_cv_func_ptrace_ret='int', | |
543 | gdb_cv_func_ptrace_ret='long')) | |
086ec9eb MK |
544 | AC_DEFINE_UNQUOTED(PTRACE_TYPE_RET, $gdb_cv_func_ptrace_ret, |
545 | [Define as the return type of ptrace.]) | |
546 | # Check argument types. | |
547 | AC_CACHE_CHECK([types of arguments for ptrace], gdb_cv_func_ptrace_args, [ | |
548 | for gdb_arg1 in 'int' 'long'; do | |
549 | for gdb_arg2 in 'pid_t' 'int' 'long'; do | |
550 | for gdb_arg3 in 'int *' 'caddr_t' 'int' 'long'; do | |
551 | for gdb_arg4 in 'int' 'long'; do | |
552 | AC_TRY_COMPILE($gdb_ptrace_headers, [ | |
553 | extern $gdb_cv_func_ptrace_ret | |
554 | ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4); | |
555 | ], [gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4"; | |
556 | break 4;]) | |
557 | for gdb_arg5 in 'int *' 'int' 'long'; do | |
558 | AC_TRY_COMPILE($gdb_ptrace_headers, [ | |
559 | extern $gdb_cv_func_ptrace_ret | |
560 | ptrace ($gdb_arg1, $gdb_arg2, $gdb_arg3, $gdb_arg4, $gdb_arg5); | |
561 | ], [ | |
562 | gdb_cv_func_ptrace_args="$gdb_arg1,$gdb_arg2,$gdb_arg3,$gdb_arg4,$gdb_arg5"; | |
563 | break 5;]) | |
564 | done | |
565 | done | |
566 | done | |
567 | done | |
568 | done | |
569 | # Provide a safe default value. | |
570 | : ${gdb_cv_func_ptrace_args='int,int,long,long'} | |
571 | ]) | |
572 | ac_save_IFS=$IFS; IFS=',' | |
573 | set dummy `echo "$gdb_cv_func_ptrace_args" | sed 's/\*/\*/g'` | |
574 | IFS=$ac_save_IFS | |
575 | shift | |
64218d3e | 576 | AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG3, $[3], |
086ec9eb MK |
577 | [Define to the type of arg 3 for ptrace.]) |
578 | if test -n "$[5]"; then | |
64218d3e | 579 | AC_DEFINE_UNQUOTED(PTRACE_TYPE_ARG5, $[5], |
086ec9eb MK |
580 | [Define to the type of arg 5 for ptrace.]) |
581 | fi | |
582 | ||
72473524 DJ |
583 | dnl AC_FUNC_SETPGRP does not work when cross compiling |
584 | dnl Instead, assume we will have a prototype for setpgrp if cross compiling. | |
585 | if test "$cross_compiling" = no; then | |
586 | AC_FUNC_SETPGRP | |
587 | else | |
588 | AC_CACHE_CHECK([whether setpgrp takes no argument], ac_cv_func_setpgrp_void, | |
589 | [AC_TRY_COMPILE([ | |
590 | #include <unistd.h> | |
591 | ], [ | |
592 | if (setpgrp(1,1) == -1) | |
593 | exit (0); | |
594 | else | |
595 | exit (1); | |
596 | ], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes)]) | |
597 | if test $ac_cv_func_setpgrp_void = yes; then | |
598 | AC_DEFINE(SETPGRP_VOID, 1) | |
599 | fi | |
600 | fi | |
c906108c | 601 | |
2b2d558c MK |
602 | # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do |
603 | # since sigsetjmp might only be defined as a macro. | |
604 | AC_CACHE_CHECK([for sigsetjmp], gdb_cv_func_sigsetjmp, | |
605 | [AC_TRY_COMPILE([ | |
606 | #include <setjmp.h> | |
607 | ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);], | |
608 | gdb_cv_func_sigsetjmp=yes, gdb_cv_func_sigsetjmp=no)]) | |
609 | if test $gdb_cv_func_sigsetjmp = yes; then | |
610 | AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ]) | |
611 | fi | |
612 | ||
06825bd1 MK |
613 | # Assume we'll default to using the included libiberty regex. |
614 | gdb_use_included_regex=yes | |
615 | ||
616 | # However, if the system regex is GNU regex, then default to *not* | |
617 | # using the included regex. | |
618 | AC_CACHE_CHECK( | |
619 | [for GNU regex], | |
620 | [gdb_cv_have_gnu_regex], | |
621 | [AC_TRY_COMPILE( | |
622 | [#include <gnu-versions.h>], | |
623 | [#define REGEX_INTERFACE_VERSION 1 | |
624 | #if _GNU_REGEX_INTERFACE_VERSION != REGEX_INTERFACE_VERSION | |
625 | # error "Version mismatch" | |
626 | #endif], | |
627 | gdb_cv_have_gnu_regex=yes, | |
628 | gdb_cv_have_gnu_regex=no)]) | |
629 | if test $gdb_cv_have_gnu_regex = yes; then | |
630 | gdb_use_included_regex=no | |
631 | fi | |
632 | ||
633 | AC_ARG_WITH(included-regex, | |
634 | [ --without-included-regex don't use included regex; this is the default | |
635 | on systems with version 2 of the GNU C library | |
636 | (use with caution on other system)], | |
637 | gdb_with_regex=$withval, | |
638 | gdb_with_regex=$gdb_use_included_regex) | |
639 | if test "$gdb_with_regex" = yes; then | |
640 | AC_DEFINE(USE_INCLUDED_REGEX, 1, | |
641 | [Define to 1 if the regex included in libiberty should be used.]) | |
642 | fi | |
643 | ||
5c45e068 MK |
644 | # Check if <sys/proc.h> defines `struct thread' with a td_pcb member. |
645 | AC_CHECK_MEMBERS([struct thread.td_pcb], [], [], | |
646 | [#include <sys/param.h> | |
647 | #include <sys/proc.h> | |
648 | ]) | |
70f9f479 | 649 | |
da7d81e3 NW |
650 | # See if <sys/lwp.h> defines `struct lwp`. |
651 | AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp, | |
652 | [AC_TRY_COMPILE([#include <sys/param.h> | |
653 | #include <sys/lwp.h>], [struct lwp l;], | |
654 | gdb_cv_struct_lwp=yes, gdb_cv_struct_lwp=no)]) | |
655 | if test $gdb_cv_struct_lwp = yes; then | |
656 | AC_DEFINE(HAVE_STRUCT_LWP, 1, | |
657 | [Define to 1 if your system has struct lwp.]) | |
658 | fi | |
659 | ||
78434e59 MK |
660 | # See if <machine/reg.h> degines `struct reg'. |
661 | AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg, | |
662 | [AC_TRY_COMPILE([#include <sys/types.h> | |
663 | #include <machine/reg.h>], [struct reg r;], | |
664 | gdb_cv_struct_reg=yes, gdb_cv_struct_reg=no)]) | |
665 | if test $gdb_cv_struct_reg = yes; then | |
666 | AC_DEFINE(HAVE_STRUCT_REG, 1, | |
667 | [Define to 1 if your system has struct reg in <machine/reg.h>.]) | |
668 | fi | |
669 | ||
0afdd437 | 670 | # See if <machine/reg.h> supports the %fs and %gs i386 segment registers. |
7dfa765c | 671 | # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. |
5c45e068 MK |
672 | AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [], |
673 | [#include <machine/reg.h>]) | |
7dfa765c | 674 | |
0afdd437 | 675 | # See if <sys/ptrace.h> provides the PTRACE_GETREGS request. |
f60300e7 MK |
676 | AC_MSG_CHECKING(for PTRACE_GETREGS) |
677 | AC_CACHE_VAL(gdb_cv_have_ptrace_getregs, | |
678 | [AC_TRY_COMPILE([#include <sys/ptrace.h>], | |
679 | [PTRACE_GETREGS;], | |
680 | [gdb_cv_have_ptrace_getregs=yes], | |
681 | [gdb_cv_have_ptrace_getregs=no])]) | |
682 | AC_MSG_RESULT($gdb_cv_have_ptrace_getregs) | |
683 | if test $gdb_cv_have_ptrace_getregs = yes; then | |
60ca704f SE |
684 | AC_DEFINE(HAVE_PTRACE_GETREGS, 1, |
685 | [Define if sys/ptrace.h defines the PTRACE_GETREGS request.]) | |
f60300e7 MK |
686 | fi |
687 | ||
0afdd437 | 688 | # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request. |
6ce2ac0b MK |
689 | AC_MSG_CHECKING(for PTRACE_GETFPXREGS) |
690 | AC_CACHE_VAL(gdb_cv_have_ptrace_getfpxregs, | |
5c44784c | 691 | [AC_TRY_COMPILE([#include <sys/ptrace.h>], |
6ce2ac0b MK |
692 | [PTRACE_GETFPXREGS;], |
693 | [gdb_cv_have_ptrace_getfpxregs=yes], | |
694 | [gdb_cv_have_ptrace_getfpxregs=no])]) | |
695 | AC_MSG_RESULT($gdb_cv_have_ptrace_getfpxregs) | |
696 | if test $gdb_cv_have_ptrace_getfpxregs = yes; then | |
60ca704f SE |
697 | AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1, |
698 | [Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request.]) | |
5c44784c JM |
699 | fi |
700 | ||
0afdd437 MK |
701 | # See if <sys/ptrace.h> provides the PT_GETDBREGS request. |
702 | AC_MSG_CHECKING(for PT_GETDBREGS) | |
703 | AC_CACHE_VAL(gdb_cv_have_pt_getdbregs, | |
704 | [AC_TRY_COMPILE([#include <sys/types.h> | |
705 | #include <sys/ptrace.h>], | |
706 | [PT_GETDBREGS;], | |
707 | [gdb_cv_have_pt_getdbregs=yes], | |
708 | [gdb_cv_have_pt_getdbregs=no])]) | |
709 | AC_MSG_RESULT($gdb_cv_have_pt_getdbregs) | |
710 | if test $gdb_cv_have_pt_getdbregs = yes; then | |
60ca704f SE |
711 | AC_DEFINE(HAVE_PT_GETDBREGS, 1, |
712 | [Define if sys/ptrace.h defines the PT_GETDBREGS request.]) | |
0afdd437 MK |
713 | fi |
714 | ||
7e89e357 JT |
715 | # See if <sys/ptrace.h> provides the PT_GETXMMREGS request. |
716 | AC_MSG_CHECKING(for PT_GETXMMREGS) | |
717 | AC_CACHE_VAL(gdb_cv_have_pt_getxmmregs, | |
718 | [AC_TRY_COMPILE([#include <sys/types.h> | |
719 | #include <sys/ptrace.h>], | |
720 | [PT_GETXMMREGS;], | |
721 | [gdb_cv_have_pt_getxmmregs=yes], | |
722 | [gdb_cv_have_pt_getxmmregs=no])]) | |
723 | AC_MSG_RESULT($gdb_cv_have_pt_getxmmregs) | |
724 | if test $gdb_cv_have_pt_getxmmregs = yes; then | |
60ca704f SE |
725 | AC_DEFINE(HAVE_PT_GETXMMREGS, 1, |
726 | [Define if sys/ptrace.h defines the PT_GETXMMREGS request.]) | |
7e89e357 JT |
727 | fi |
728 | ||
eb368090 | 729 | # Detect which type of /proc is in use, such as for Unixware or Solaris. |
c906108c SS |
730 | |
731 | if test "${target}" = "${host}"; then | |
732 | case "${host}" in | |
1045b512 | 733 | *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* ) |
60ca704f SE |
734 | AC_DEFINE(NEW_PROC_API, 1, |
735 | [Define if you want to use new multi-fd /proc interface | |
736 | (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).]) | |
c3f6f71d | 737 | ;; |
0bbc026e | 738 | *-*-solaris2.[[6789]] | *-*-solaris2.1[[0-9]]) |
60ca704f SE |
739 | AC_DEFINE(NEW_PROC_API, 1, |
740 | [Define if you want to use new multi-fd /proc interface | |
741 | (replaces HAVE_MULTIPLE_PROC_FDS as well as other macros).]) | |
c3f6f71d | 742 | ;; |
c960c18f AC |
743 | mips-sgi-irix5*) |
744 | # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5. | |
60ca704f SE |
745 | AC_DEFINE([_KMEMUSER], 1, |
746 | [Define to 1 so <sys/proc.h> gets a definition of anon_hdl. Works | |
747 | around a <sys/proc.h> problem on IRIX 5.]) | |
c960c18f | 748 | ;; |
c906108c | 749 | esac |
c906108c SS |
750 | fi |
751 | ||
752 | if test "$ac_cv_header_sys_procfs_h" = yes; then | |
753 | BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t) | |
754 | BFD_HAVE_SYS_PROCFS_TYPE(prrun_t) | |
755 | BFD_HAVE_SYS_PROCFS_TYPE(gregset_t) | |
756 | BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t) | |
83d37ec8 MK |
757 | BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t) |
758 | BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t) | |
23e04971 MS |
759 | BFD_HAVE_SYS_PROCFS_TYPE(prgregset32_t) |
760 | BFD_HAVE_SYS_PROCFS_TYPE(prfpregset32_t) | |
83d37ec8 MK |
761 | BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) |
762 | BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) | |
596c9d4b KB |
763 | BFD_HAVE_SYS_PROCFS_TYPE(prsysent_t) |
764 | BFD_HAVE_SYS_PROCFS_TYPE(pr_sigset_t) | |
765 | BFD_HAVE_SYS_PROCFS_TYPE(pr_sigaction64_t) | |
766 | BFD_HAVE_SYS_PROCFS_TYPE(pr_siginfo64_t) | |
c906108c | 767 | |
23e04971 | 768 | |
d84dd0c5 MK |
769 | dnl Check for broken prfpregset_t type |
770 | ||
771 | dnl For Linux/i386, glibc 2.1.3 was released with a bogus | |
772 | dnl prfpregset_t type (it's a typedef for the pointer to a struct | |
773 | dnl instead of the struct itself). We detect this here, and work | |
a3007b6f | 774 | dnl around it in gdb_proc_service.h. |
d84dd0c5 MK |
775 | |
776 | if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then | |
777 | AC_MSG_CHECKING(whether prfpregset_t type is broken) | |
778 | AC_CACHE_VAL(gdb_cv_prfpregset_t_broken, | |
779 | [AC_TRY_RUN([#include <sys/procfs.h> | |
780 | int main () | |
781 | { | |
782 | if (sizeof (prfpregset_t) == sizeof (void *)) | |
783 | return 1; | |
784 | return 0; | |
785 | }], | |
786 | gdb_cv_prfpregset_t_broken=no, | |
787 | gdb_cv_prfpregset_t_broken=yes, | |
788 | gdb_cv_prfpregset_t_broken=yes)]) | |
789 | AC_MSG_RESULT($gdb_cv_prfpregset_t_broken) | |
790 | if test $gdb_cv_prfpregset_t_broken = yes; then | |
60ca704f SE |
791 | AC_DEFINE(PRFPREGSET_T_BROKEN, 1, |
792 | [Define if the prfpregset_t type is broken.]) | |
d84dd0c5 MK |
793 | fi |
794 | fi | |
795 | ||
c906108c SS |
796 | dnl Check for PIOCSET ioctl entry |
797 | ||
798 | AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h) | |
799 | AC_CACHE_VAL(gdb_cv_have_procfs_piocset, | |
800 | [AC_TRY_COMPILE([#include <unistd.h> | |
801 | #include <sys/types.h> | |
802 | #include <sys/procfs.h> | |
803 | ], [ | |
804 | int dummy;; | |
805 | dummy = ioctl(0, PIOCSET, &dummy); | |
806 | ], | |
807 | gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)]) | |
808 | AC_MSG_RESULT($gdb_cv_have_procfs_piocset) | |
809 | if test $gdb_cv_have_procfs_piocset = yes; then | |
60ca704f SE |
810 | AC_DEFINE(HAVE_PROCFS_PIOCSET, 1, |
811 | [Define if ioctl argument PIOCSET is available.]) | |
c906108c SS |
812 | fi |
813 | fi | |
814 | ||
d45fe813 KB |
815 | dnl For native ports (host == target), check to see what kind of |
816 | dnl legacy link.h support is needed. (See solib-legacy.c.) | |
817 | if test ${host} = ${target} ; then | |
818 | dnl Check for struct link_map with l_ members which are indicative | |
819 | dnl of SVR4-like shared libraries | |
820 | ||
821 | AC_MSG_CHECKING(for member l_addr in struct link_map) | |
822 | AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_l_members, | |
823 | [AC_TRY_COMPILE([#include <link.h>], | |
824 | [struct link_map lm; (void) lm.l_addr;], | |
825 | gdb_cv_have_struct_link_map_with_l_members=yes, | |
826 | gdb_cv_have_struct_link_map_with_l_members=no)]) | |
827 | AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_l_members) | |
828 | if test $gdb_cv_have_struct_link_map_with_l_members = yes; then | |
60ca704f SE |
829 | AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_L_MEMBERS,1, |
830 | [Define if <link.h> exists and defines struct link_map which has | |
831 | members with an ``l_'' prefix. (For Solaris, SVR4, and | |
832 | SVR4-like systems.)]) | |
d45fe813 KB |
833 | fi |
834 | ||
835 | dnl Check for struct link_map with lm_ members which are indicative | |
836 | dnl of SunOS-like shared libraries | |
837 | ||
838 | AC_MSG_CHECKING(for member lm_addr in struct link_map) | |
839 | AC_CACHE_VAL(gdb_cv_have_struct_link_map_with_lm_members, | |
840 | [AC_TRY_COMPILE([#include <sys/types.h> | |
841 | #include <link.h>], | |
842 | [struct link_map lm; (void) lm.lm_addr;], | |
843 | gdb_cv_have_struct_link_map_with_lm_members=yes, | |
844 | gdb_cv_have_struct_link_map_with_lm_members=no)]) | |
845 | AC_MSG_RESULT($gdb_cv_have_struct_link_map_with_lm_members) | |
846 | if test $gdb_cv_have_struct_link_map_with_lm_members = yes; then | |
60ca704f SE |
847 | AC_DEFINE(HAVE_STRUCT_LINK_MAP_WITH_LM_MEMBERS, 1, |
848 | [Define if <link.h> exists and defines struct link_map which has | |
849 | members with an ``lm_'' prefix. (For SunOS.)]) | |
d45fe813 KB |
850 | fi |
851 | ||
852 | dnl Check for struct so_map with som_ members which are found on | |
853 | dnl some *BSD systems. | |
854 | ||
855 | AC_MSG_CHECKING(for member som_addr in struct so_map) | |
856 | AC_CACHE_VAL(gdb_cv_have_struct_so_map_with_som_members, | |
857 | [AC_TRY_COMPILE([#include <sys/types.h> | |
39812ceb C |
858 | #ifdef HAVE_NLIST_H |
859 | #include <nlist.h> | |
860 | #endif | |
d45fe813 KB |
861 | #include <link.h>], |
862 | [struct so_map lm; (void) lm.som_addr;], | |
863 | gdb_cv_have_struct_so_map_with_som_members=yes, | |
864 | gdb_cv_have_struct_so_map_with_som_members=no)]) | |
865 | AC_MSG_RESULT($gdb_cv_have_struct_so_map_with_som_members) | |
866 | if test $gdb_cv_have_struct_so_map_with_som_members = yes; then | |
60ca704f SE |
867 | AC_DEFINE(HAVE_STRUCT_SO_MAP_WITH_SOM_MEMBERS, 1, |
868 | [Define if <link.h> exists and defines a struct so_map which has | |
869 | members with an ``som_'' prefix. (Found on older *BSD systems.)]) | |
d45fe813 KB |
870 | fi |
871 | ||
872 | dnl Check for struct link_map32 type, which allows a 64-bit Solaris | |
873 | dnl debugger to debug a 32-bit Solaris app with 32-bit shared libraries. | |
874 | ||
875 | AC_MSG_CHECKING(for struct link_map32 in sys/link.h) | |
876 | AC_CACHE_VAL(gdb_cv_have_struct_link_map32, | |
877 | [AC_TRY_COMPILE([#define _SYSCALL32 | |
878 | #include <sys/link.h>], [struct link_map32 l;], | |
879 | gdb_cv_have_struct_link_map32=yes, | |
880 | gdb_cv_have_struct_link_map32=no)]) | |
881 | AC_MSG_RESULT($gdb_cv_have_struct_link_map32) | |
882 | if test $gdb_cv_have_struct_link_map32 = yes; then | |
60ca704f SE |
883 | AC_DEFINE(HAVE_STRUCT_LINK_MAP32, 1, |
884 | [Define if <sys/link.h> has struct link_map32]) | |
885 | AC_DEFINE(_SYSCALL32, 1, | |
886 | [Define if <sys/link.h> has link_map32 (solaris sparc-64 target)]) | |
d45fe813 KB |
887 | fi |
888 | fi | |
889 | ||
bc8bcb4b MK |
890 | # Check if the compiler supports the `long long' type. |
891 | ||
892 | AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long, | |
893 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | |
894 | [[extern long long foo;]], | |
895 | [[switch (foo & 2) { case 0: return 1; }]])], | |
896 | gdb_cv_c_long_long=yes, | |
897 | gdb_cv_c_long_long=no)]) | |
c906108c | 898 | if test $gdb_cv_c_long_long = yes; then |
bc8bcb4b MK |
899 | AC_DEFINE(CC_HAS_LONG_LONG, 1, |
900 | [Define to 1 if the compiler supports long long.]) | |
c906108c SS |
901 | fi |
902 | ||
bc8bcb4b | 903 | # Check if the compiler and runtime support printing long longs. |
c906108c | 904 | |
bc8bcb4b MK |
905 | AC_CACHE_CHECK([for long long support in printf], |
906 | gdb_cv_printf_has_long_long, | |
907 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], | |
908 | [[char buf[32]; | |
c906108c SS |
909 | long long l = 0; |
910 | l = (l << 16) + 0x0123; | |
911 | l = (l << 16) + 0x4567; | |
912 | l = (l << 16) + 0x89ab; | |
913 | l = (l << 16) + 0xcdef; | |
914 | sprintf (buf, "0x%016llx", l); | |
bc8bcb4b MK |
915 | return (strcmp ("0x0123456789abcdef", buf));]])], |
916 | gdb_cv_printf_has_long_long=yes, | |
917 | gdb_cv_printf_has_long_long=no, | |
918 | gdb_cv_printf_has_long_long=no)]) | |
c906108c | 919 | if test $gdb_cv_printf_has_long_long = yes; then |
bc8bcb4b MK |
920 | AC_DEFINE(PRINTF_HAS_LONG_LONG, 1, |
921 | [Define to 1 if the "%ll" format works to print long longs.]) | |
c906108c | 922 | fi |
c906108c | 923 | |
bc8bcb4b MK |
924 | # Check if the compiler supports the `long double' type. We can't use |
925 | # AC_C_LONG_DOUBLE because that one does additional checks on the | |
926 | # constants defined in <float.h> that fail on some systems, | |
927 | # e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6. | |
c906108c | 928 | |
bc8bcb4b MK |
929 | AC_CACHE_CHECK([for long double support in compiler], gdb_cv_c_long_double, |
930 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long double foo;]])], | |
931 | gdb_cv_c_long_double=yes, | |
932 | gdb_cv_c_long_double=no)]) | |
933 | if test $gdb_cv_c_long_double = yes; then | |
934 | AC_DEFINE(HAVE_LONG_DOUBLE, 1, | |
935 | [Define to 1 if the compiler supports long double.]) | |
c906108c SS |
936 | fi |
937 | ||
bc8bcb4b | 938 | # Check if the compiler and runtime support printing long doubles. |
c906108c | 939 | |
bc8bcb4b MK |
940 | AC_CACHE_CHECK([for long double support in printf], |
941 | gdb_cv_printf_has_long_double, | |
942 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], | |
943 | [[char buf[16]; | |
c906108c SS |
944 | long double f = 3.141592653; |
945 | sprintf (buf, "%Lg", f); | |
bc8bcb4b MK |
946 | return (strncmp ("3.14159", buf, 7));]])], |
947 | gdb_cv_printf_has_long_double=yes, | |
948 | gdb_cv_printf_has_long_double=no, | |
949 | gdb_cv_printf_has_long_double=no)]) | |
c906108c | 950 | if test $gdb_cv_printf_has_long_double = yes; then |
bc8bcb4b MK |
951 | AC_DEFINE(PRINTF_HAS_LONG_DOUBLE, 1, |
952 | [Define to 1 if the "%Lg" format works to print long doubles.]) | |
c906108c | 953 | fi |
c906108c | 954 | |
bc8bcb4b | 955 | # Check if the compiler and runtime support scanning long doubles. |
c906108c | 956 | |
bc8bcb4b MK |
957 | AC_CACHE_CHECK([for long double support in scanf], |
958 | gdb_cv_scanf_has_long_double, | |
959 | [AC_RUN_IFELSE([AC_LANG_PROGRAM( | |
960 | [[#include <stdio.h>]], | |
961 | [[char *buf = "3.141592653"; | |
c906108c SS |
962 | long double f = 0; |
963 | sscanf (buf, "%Lg", &f); | |
bc8bcb4b MK |
964 | return !(f > 3.14159 && f < 3.14160);]])], |
965 | gdb_cv_scanf_has_long_double=yes, | |
966 | gdb_cv_scanf_has_long_double=no, | |
967 | gdb_cv_scanf_has_long_double=no)]) | |
c906108c | 968 | if test $gdb_cv_scanf_has_long_double = yes; then |
bc8bcb4b MK |
969 | AC_DEFINE(SCANF_HAS_LONG_DOUBLE, 1, |
970 | [Define to 1 if the "%Lg" format works to scan long doubles.]) | |
c906108c | 971 | fi |
c906108c | 972 | |
438013df AO |
973 | case ${host_os} in |
974 | aix*) | |
975 | AC_CACHE_CHECK([for -bbigtoc option], [gdb_cv_bigtoc], [ | |
976 | SAVE_LDFLAGS=$LDFLAGS | |
977 | ||
978 | case $GCC in | |
979 | yes) gdb_cv_bigtoc=-Wl,-bbigtoc ;; | |
980 | *) gdb_cv_bigtoc=-bbigtoc ;; | |
981 | esac | |
982 | ||
983 | LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc | |
984 | AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=]) | |
ec76baa5 | 985 | LDFLAGS="${SAVE_LDFLAGS}" |
438013df AO |
986 | ]) |
987 | CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}" | |
988 | ;; | |
989 | esac | |
990 | ||
c906108c | 991 | |
d92419e5 JB |
992 | dnl For certain native configurations, we need to check whether thread |
993 | dnl support can be built in or not. | |
994 | dnl | |
995 | dnl Note that we only want this if we are both native (host == target), | |
996 | dnl and not doing a canadian cross build (build == host). | |
c906108c SS |
997 | |
998 | if test ${build} = ${host} -a ${host} = ${target} ; then | |
999 | case ${host_os} in | |
1000 | hpux*) | |
1001 | AC_MSG_CHECKING(for HPUX/OSF thread support) | |
1002 | if test -f /usr/include/dce/cma_config.h ; then | |
1003 | if test "$GCC" = "yes" ; then | |
1004 | AC_MSG_RESULT(yes) | |
60ca704f SE |
1005 | AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT, 1, |
1006 | [Define if you have HPUX threads]) | |
3483b318 | 1007 | CONFIG_OBS="${CONFIG_OBS} hpux-thread.o" |
c906108c SS |
1008 | CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c" |
1009 | else | |
1010 | AC_MSG_RESULT(no (suppressed because you are not using GCC)) | |
1011 | fi | |
1012 | else | |
1013 | AC_MSG_RESULT(no) | |
1014 | fi | |
1015 | ;; | |
1016 | solaris*) | |
d92419e5 JB |
1017 | # See if thread_db library is around for Solaris thread debugging. |
1018 | # Note that we must explicitly test for version 1 of the library | |
1019 | # because version 0 (present on Solaris 2.4 or earlier) doesn't have | |
1020 | # the same API. | |
c906108c SS |
1021 | AC_MSG_CHECKING(for Solaris thread debugging library) |
1022 | if test -f /usr/lib/libthread_db.so.1 ; then | |
1023 | AC_MSG_RESULT(yes) | |
60ca704f SE |
1024 | AC_DEFINE(HAVE_THREAD_DB_LIB, 1, |
1025 | [Define if using Solaris thread debugging.]) | |
3483b318 | 1026 | CONFIG_OBS="${CONFIG_OBS} sol-thread.o" |
c906108c SS |
1027 | CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c" |
1028 | AC_CHECK_LIB(dl, dlopen) | |
1029 | if test "$GCC" = "yes" ; then | |
1030 | # The GNU linker requires the -export-dynamic option to make | |
1031 | # all symbols visible in the dynamic symbol table. | |
1032 | hold_ldflags=$LDFLAGS | |
1033 | AC_MSG_CHECKING(for the ld -export-dynamic flag) | |
1034 | LDFLAGS="${LDFLAGS} -Wl,-export-dynamic" | |
1035 | AC_TRY_LINK(, [int i;], found=yes, found=no) | |
1036 | LDFLAGS=$hold_ldflags | |
1037 | AC_MSG_RESULT($found) | |
1038 | if test $found = yes; then | |
1039 | CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic" | |
1040 | fi | |
1041 | fi | |
1042 | # Sun randomly tweaked the prototypes in <proc_service.h> | |
1043 | # at one point. | |
1044 | AC_MSG_CHECKING(if <proc_service.h> is old) | |
1045 | AC_CACHE_VAL(gdb_cv_proc_service_is_old,[ | |
1046 | AC_TRY_COMPILE([ | |
1047 | #include <proc_service.h> | |
1048 | ps_err_e ps_pdwrite | |
1049 | (struct ps_prochandle*, psaddr_t, const void*, size_t); | |
1050 | ],, gdb_cv_proc_service_is_old=no, | |
1051 | gdb_cv_proc_service_is_old=yes) | |
1052 | ]) | |
1053 | AC_MSG_RESULT($gdb_cv_proc_service_is_old) | |
1054 | if test $gdb_cv_proc_service_is_old = yes; then | |
60ca704f SE |
1055 | AC_DEFINE(PROC_SERVICE_IS_OLD, 1, |
1056 | [Define if <proc_service.h> on solaris uses int instead of | |
1057 | size_t, and assorted other type changes.]) | |
c906108c SS |
1058 | fi |
1059 | else | |
1060 | AC_MSG_RESULT(no) | |
1061 | fi | |
1062 | ;; | |
d92419e5 JB |
1063 | aix*) |
1064 | AC_MSG_CHECKING(for AiX thread debugging library) | |
1065 | AC_CACHE_VAL(gdb_cv_have_aix_thread_debug, | |
1066 | [AC_TRY_COMPILE([#include <sys/pthdebug.h>], | |
1067 | [#ifndef PTHDB_VERSION_3 | |
1068 | #error | |
1069 | #endif], | |
1070 | gdb_cv_have_aix_thread_debug=yes, | |
1071 | gdb_cv_have_aix_thread_debug=no)]) | |
1072 | AC_MSG_RESULT($gdb_cv_have_aix_thread_debug) | |
1073 | if test $gdb_cv_have_aix_thread_debug = yes; then | |
1074 | CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c" | |
3483b318 | 1075 | CONFIG_OBS="${CONFIG_OBS} aix-thread.o" |
d92419e5 JB |
1076 | CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -lpthdebug" |
1077 | fi | |
1078 | ;; | |
c906108c SS |
1079 | esac |
1080 | AC_SUBST(CONFIG_LDFLAGS) | |
1081 | fi | |
1082 | ||
59f80f10 DJ |
1083 | dnl See if we have a thread_db header file that has TD_NOTALLOC and |
1084 | dnl other error codes. | |
3f47be5c EZ |
1085 | if test "x$ac_cv_header_thread_db_h" = "xyes"; then |
1086 | AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTALLOC], | |
1087 | gdb_cv_thread_db_h_has_td_notalloc, | |
1088 | AC_TRY_COMPILE( | |
1089 | [#include <thread_db.h>], | |
1090 | [int i = TD_NOTALLOC;], | |
1091 | gdb_cv_thread_db_h_has_td_notalloc=yes, | |
1092 | gdb_cv_thread_db_h_has_td_notalloc=no | |
1093 | ) | |
1094 | ) | |
59f80f10 DJ |
1095 | AC_CACHE_CHECK([whether <thread_db.h> has TD_VERSION], |
1096 | gdb_cv_thread_db_h_has_td_version, | |
1097 | AC_TRY_COMPILE( | |
1098 | [#include <thread_db.h>], | |
1099 | [int i = TD_VERSION;], | |
1100 | gdb_cv_thread_db_h_has_td_version=yes, | |
1101 | gdb_cv_thread_db_h_has_td_version=no | |
1102 | ) | |
1103 | ) | |
1104 | AC_CACHE_CHECK([whether <thread_db.h> has TD_NOTLS], | |
1105 | gdb_cv_thread_db_h_has_td_notls, | |
1106 | AC_TRY_COMPILE( | |
1107 | [#include <thread_db.h>], | |
1108 | [int i = TD_NOTLS;], | |
1109 | gdb_cv_thread_db_h_has_td_notls=yes, | |
1110 | gdb_cv_thread_db_h_has_td_notls=no | |
1111 | ) | |
1112 | ) | |
3f47be5c EZ |
1113 | fi |
1114 | if test "x$gdb_cv_thread_db_h_has_td_notalloc" = "xyes"; then | |
1115 | AC_DEFINE(THREAD_DB_HAS_TD_NOTALLOC, 1, | |
1116 | [Define if <thread_db.h> has the TD_NOTALLOC error code.]) | |
1117 | fi | |
59f80f10 DJ |
1118 | if test "x$gdb_cv_thread_db_h_has_td_version" = "xyes"; then |
1119 | AC_DEFINE(THREAD_DB_HAS_TD_VERSION, 1, | |
1120 | [Define if <thread_db.h> has the TD_VERSION error code.]) | |
1121 | fi | |
1122 | if test "x$gdb_cv_thread_db_h_has_td_notls" = "xyes"; then | |
1123 | AC_DEFINE(THREAD_DB_HAS_TD_NOTLS, 1, | |
1124 | [Define if <thread_db.h> has the TD_NOTLS error code.]) | |
1125 | fi | |
3f47be5c | 1126 | |
b757528f JJ |
1127 | dnl See if we have a sys/syscall header file that has __NR_tkill. |
1128 | if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then | |
1129 | AC_CACHE_CHECK([whether <sys/syscall.h> has __NR_tkill], | |
1130 | gdb_cv_sys_syscall_h_has_tkill, | |
1131 | AC_TRY_COMPILE( | |
1132 | [#include <sys/syscall.h>], | |
1133 | [int i = __NR_tkill;], | |
1134 | gdb_cv_sys_syscall_h_has_tkill=yes, | |
1135 | gdb_cv_sys_syscall_h_has_tkill=no | |
1136 | ) | |
1137 | ) | |
1138 | fi | |
1139 | dnl See if we can issue tkill syscall. | |
1140 | if test "x$gdb_cv_sys_syscall_h_has_tkill" = "xyes" && test "x$ac_cv_func_syscall" = "xyes"; then | |
60ca704f | 1141 | AC_DEFINE(HAVE_TKILL_SYSCALL, 1, [Define if you support the tkill syscall.]) |
b757528f JJ |
1142 | fi |
1143 | ||
c906108c | 1144 | dnl Handle optional features that can be enabled. |
fb40c209 | 1145 | |
030292b7 DJ |
1146 | AC_ARG_WITH(sysroot, |
1147 | [ --with-sysroot[=DIR] Search for usr/lib et al within DIR.], | |
1148 | [ | |
1149 | case ${with_sysroot} in | |
715d1656 | 1150 | yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;; |
030292b7 DJ |
1151 | *) TARGET_SYSTEM_ROOT=$with_sysroot ;; |
1152 | esac | |
1153 | ||
1154 | TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"' | |
1155 | ||
07abfebf RS |
1156 | if test "x$prefix" = xNONE; then |
1157 | test_prefix=/usr/local | |
1158 | else | |
1159 | test_prefix=$prefix | |
1160 | fi | |
aa28a74e | 1161 | if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then |
07abfebf | 1162 | test_exec_prefix=$test_prefix |
030292b7 | 1163 | else |
07abfebf | 1164 | test_exec_prefix=$exec_prefix |
030292b7 DJ |
1165 | fi |
1166 | case ${TARGET_SYSTEM_ROOT} in | |
715d1656 | 1167 | "${test_prefix}"|"${test_prefix}/"*|\ |
07abfebf RS |
1168 | "${test_exec_prefix}"|"${test_exec_prefix}/"*|\ |
1169 | '${prefix}'|'${prefix}/'*|\ | |
715d1656 | 1170 | '${exec_prefix}'|'${exec_prefix}/'*) |
030292b7 DJ |
1171 | t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE" |
1172 | TARGET_SYSTEM_ROOT_DEFINE="$t" | |
1173 | ;; | |
1174 | esac | |
1175 | ], [ | |
1176 | TARGET_SYSTEM_ROOT= | |
1177 | TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"' | |
1178 | ]) | |
1179 | AC_SUBST(TARGET_SYSTEM_ROOT) | |
1180 | AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE) | |
1181 | ||
094a342e MK |
1182 | AC_ARG_ENABLE(werror, |
1183 | [ --enable-werror treat compile warnings as errors], | |
1184 | [case "${enableval}" in | |
1185 | yes | y) ERROR_ON_WARNING="yes" ;; | |
1186 | no | n) ERROR_ON_WARNING="no" ;; | |
1187 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; | |
1188 | esac]) | |
1189 | ||
1190 | # Enable -Werror by default when using gcc | |
1191 | if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then | |
1192 | ERROR_ON_WARNING=yes | |
1193 | fi | |
1194 | ||
1195 | WERROR_CFLAGS="" | |
1196 | if test "${ERROR_ON_WARNING}" = yes ; then | |
1197 | WERROR_CFLAGS="-Werror" | |
1198 | fi | |
1199 | ||
aa79a185 DJ |
1200 | # The entries after -Wno-pointer-sign are disabled warnings which may |
1201 | # be enabled in the future, which can not currently be used to build | |
1202 | # GDB. | |
1203 | # NOTE: If you change this list, remember to update | |
3b851bce | 1204 | # gdb/doc/gdbint.texinfo. |
aa79a185 DJ |
1205 | build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \ |
1206 | -Wformat-nonliteral -Wno-pointer-sign \ | |
58b38ee2 | 1207 | -Wno-unused -Wno-switch -Wno-char-subscripts" |
a3b362c4 | 1208 | |
c906108c SS |
1209 | AC_ARG_ENABLE(build-warnings, |
1210 | [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], | |
1decb323 | 1211 | [case "${enableval}" in |
c906108c SS |
1212 | yes) ;; |
1213 | no) build_warnings="-w";; | |
1214 | ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
1215 | build_warnings="${build_warnings} ${t}";; | |
1216 | *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
1217 | build_warnings="${t} ${build_warnings}";; | |
1218 | *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; | |
d4f3574e SS |
1219 | esac |
1220 | if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then | |
746a987d | 1221 | echo "Setting compiler warning flags = $build_warnings" 6>&1 |
1decb323 | 1222 | fi])dnl |
3b851bce AC |
1223 | AC_ARG_ENABLE(gdb-build-warnings, |
1224 | [ --enable-gdb-build-warnings Enable GDB specific build-time compiler warnings if gcc is used], | |
1225 | [case "${enableval}" in | |
1226 | yes) ;; | |
1227 | no) build_warnings="-w";; | |
1228 | ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
1229 | build_warnings="${build_warnings} ${t}";; | |
1230 | *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
1231 | build_warnings="${t} ${build_warnings}";; | |
1232 | *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; | |
1233 | esac | |
1234 | if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then | |
1235 | echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1 | |
1236 | fi])dnl | |
104c1213 | 1237 | WARN_CFLAGS="" |
c906108c SS |
1238 | if test "x${build_warnings}" != x -a "x$GCC" = xyes |
1239 | then | |
746a987d AC |
1240 | AC_MSG_CHECKING(compiler warning flags) |
1241 | # Separate out the -Werror flag as some files just cannot be | |
1242 | # compiled with it enabled. | |
1243 | for w in ${build_warnings}; do | |
1244 | case $w in | |
1245 | -Werr*) WERROR_CFLAGS=-Werror ;; | |
1246 | *) # Check that GCC accepts it | |
4536bbc6 AC |
1247 | saved_CFLAGS="$CFLAGS" |
1248 | CFLAGS="$CFLAGS $w" | |
1249 | AC_TRY_COMPILE([],[],WARN_CFLAGS="${WARN_CFLAGS} $w",) | |
1250 | CFLAGS="$saved_CFLAGS" | |
746a987d AC |
1251 | esac |
1252 | done | |
aa79a185 | 1253 | AC_MSG_RESULT(${WARN_CFLAGS} ${WERROR_CFLAGS}) |
1decb323 | 1254 | fi |
c906108c | 1255 | AC_SUBST(WARN_CFLAGS) |
104c1213 | 1256 | AC_SUBST(WERROR_CFLAGS) |
c906108c | 1257 | |
7a292a7a SS |
1258 | # In the Cygwin environment, we need some additional flags. |
1259 | AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, | |
1260 | [AC_EGREP_CPP(lose, [ | |
1261 | #if defined (__CYGWIN__) || defined (__CYGWIN32__) | |
1262 | lose | |
1263 | #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])]) | |
1264 | ||
aff38e61 AC |
1265 | |
1266 | dnl Figure out which of the many generic ser-*.c files the _host_ supports. | |
3eb25fda | 1267 | SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o" |
aff38e61 | 1268 | case ${host} in |
95cbc983 AC |
1269 | *go32* ) SER_HARDWIRE=ser-go32.o ;; |
1270 | *djgpp* ) SER_HARDWIRE=ser-go32.o ;; | |
0ea3f30e | 1271 | *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o ser-mingw.o" ;; |
aff38e61 AC |
1272 | esac |
1273 | AC_SUBST(SER_HARDWIRE) | |
1274 | ||
cd0fc7c3 SS |
1275 | # libreadline needs libuser32.a in a cygwin environment |
1276 | WIN32LIBS= | |
1277 | if test x$gdb_cv_os_cygwin = xyes; then | |
c5394b80 JM |
1278 | WIN32LIBS="-luser32" |
1279 | case "${target}" in | |
1280 | *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp" | |
1281 | ;; | |
1282 | esac | |
cd0fc7c3 | 1283 | fi |
b4505029 MM |
1284 | |
1285 | # The ser-tcp.c module requires sockets. | |
1286 | case ${host} in | |
1287 | *mingw32*) | |
1288 | AC_DEFINE(USE_WIN32API, 1, | |
1289 | [Define if we should use the Windows API, instead of the | |
1290 | POSIX API. On Windows, we use the Windows API when | |
1291 | building for MinGW, but the POSIX API when building | |
1292 | for Cygwin.]) | |
1293 | WIN32LIBS="$WIN32LIBS -lws2_32" | |
1294 | ;; | |
1295 | esac | |
cd0fc7c3 | 1296 | AC_SUBST(WIN32LIBS) |
7a292a7a | 1297 | |
31d99776 DJ |
1298 | # Add ELF support to GDB, but only if BFD includes ELF support. |
1299 | OLD_CFLAGS=$CFLAGS | |
1300 | OLD_LDFLAGS=$LDFLAGS | |
1301 | OLD_LIBS=$LIBS | |
cab58a69 | 1302 | CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" |
31d99776 | 1303 | LDFLAGS="$LDFLAGS -L../bfd -L../libiberty" |
7921a279 | 1304 | LIBS="$LIBS -lbfd -liberty $LIBINTL" |
31d99776 DJ |
1305 | AC_CACHE_CHECK([for ELF support in BFD], gdb_cv_var_elf, |
1306 | [AC_TRY_LINK( | |
1307 | [#include <stdlib.h> | |
1308 | #include "bfd.h" | |
1309 | #include "elf-bfd.h" | |
1310 | ], | |
1311 | [bfd *abfd = NULL; bfd_get_elf_phdr_upper_bound (abfd); ], | |
1312 | gdb_cv_var_elf=yes, gdb_cv_var_elf=no)]) | |
1313 | if test $gdb_cv_var_elf = yes; then | |
1314 | CONFIG_OBS="$CONFIG_OBS elfread.o" | |
1315 | AC_DEFINE(HAVE_ELF, 1, | |
1316 | [Define if ELF support should be included.]) | |
1317 | fi | |
1318 | CFLAGS=$OLD_CFLAGS | |
1319 | LDFLAGS=$OLD_LDFLAGS | |
1320 | LIBS=$OLD_LIBS | |
1321 | ||
121ce6e5 DJ |
1322 | # Add any host-specific objects to GDB. |
1323 | CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}" | |
1324 | ||
3fc11d3e JM |
1325 | LIBGUI="../libgui/src/libgui.a" |
1326 | GUI_CFLAGS_X="-I${srcdir}/../libgui/src" | |
1327 | AC_SUBST(LIBGUI) | |
1328 | AC_SUBST(GUI_CFLAGS_X) | |
7a292a7a | 1329 | |
3fc11d3e JM |
1330 | WIN32LDAPP= |
1331 | AC_SUBST(WIN32LIBS) | |
1332 | AC_SUBST(WIN32LDAPP) | |
1333 | ||
d91670b9 CV |
1334 | case "${host}" in |
1335 | *-*-cygwin*) | |
1336 | configdir="win" | |
1337 | ;; | |
1338 | *) | |
1339 | configdir="unix" | |
1340 | ;; | |
1341 | esac | |
3fc11d3e JM |
1342 | |
1343 | GDBTKLIBS= | |
1344 | if test "${enable_gdbtk}" = "yes"; then | |
1345 | ||
d1c3b63a KS |
1346 | # Gdbtk must have an absolute path to srcdir in order to run |
1347 | # properly when not installed. | |
1348 | here=`pwd` | |
1349 | cd ${srcdir} | |
1350 | GDBTK_SRC_DIR=`pwd` | |
1351 | cd $here | |
1352 | ||
3fc11d3e JM |
1353 | CY_AC_PATH_TCLCONFIG |
1354 | if test -z "${no_tcl}"; then | |
1355 | CY_AC_LOAD_TCLCONFIG | |
1356 | CY_AC_PATH_TKCONFIG | |
1357 | ||
dd2504ab JM |
1358 | # now look for Tcl library stuff |
1359 | ||
d91670b9 | 1360 | tcldir="../tcl/${configdir}/" |
dd2504ab JM |
1361 | |
1362 | TCL_DEPS="${tcldir}${TCL_LIB_FILE}" | |
1363 | ||
3fc11d3e JM |
1364 | # If $no_tk is nonempty, then we can't do Tk, and there is no |
1365 | # point to doing Tcl. | |
1366 | if test -z "${no_tk}"; then | |
1367 | CY_AC_LOAD_TKCONFIG | |
1368 | CY_AC_PATH_TCLH | |
1369 | CY_AC_PATH_TKH | |
1370 | CY_AC_PATH_ITCLH | |
1371 | CY_AC_PATH_ITKH | |
3fc11d3e | 1372 | |
dd2504ab JM |
1373 | |
1374 | # now look for Tk library stuff | |
1375 | ||
d91670b9 | 1376 | tkdir="../tk/${configdir}/" |
dd2504ab JM |
1377 | |
1378 | TK_DEPS="${tkdir}${TK_LIB_FILE}" | |
1379 | ||
3fc11d3e JM |
1380 | # now look for Itcl library stuff |
1381 | ||
1382 | CY_AC_PATH_ITCLCONFIG | |
1383 | if test -z "${no_itcl}"; then | |
b381d62d | 1384 | CY_AC_LOAD_ITCLCONFIG |
3fc11d3e JM |
1385 | |
1386 | ITCLLIB="${ITCL_BUILD_LIB_SPEC}" | |
b381d62d | 1387 | ITCL_DEPS="${ITCL_LIB_FULL_PATH}" |
3fc11d3e JM |
1388 | fi |
1389 | ||
1390 | ||
1391 | # now look for Itk library stuff | |
1392 | CY_AC_PATH_ITKCONFIG | |
1393 | if test -z "${no_itcl}"; then | |
1394 | CY_AC_LOAD_ITKCONFIG | |
1395 | ||
3fc11d3e | 1396 | ITKLIB="${ITK_BUILD_LIB_SPEC}" |
b381d62d | 1397 | ITK_DEPS="${ITK_LIB_FULL_PATH}" |
3fc11d3e JM |
1398 | fi |
1399 | ||
4226a5a5 | 1400 | ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)" |
3fc11d3e JM |
1401 | |
1402 | # Include some libraries that Tcl and Tk want. | |
b2a1bd4f | 1403 | TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)' |
3fc11d3e JM |
1404 | # Yes, the ordering seems wrong here. But it isn't. |
1405 | # TK_LIBS is the list of libraries that need to be linked | |
1406 | # after Tcl/Tk. Note that this isn't put into LIBS. If it | |
1407 | # were in LIBS then any link tests after this point would | |
1408 | # try to include things like `$(LIBGUI)', which wouldn't work. | |
1409 | GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}" | |
4226a5a5 FN |
1410 | |
1411 | CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_GDBTK_OBS)" | |
1412 | CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_GDBTK_DEPS)" | |
1413 | CONFIG_SRCS="${CONFIG_SRCS} \$(SUBDIR_GDBTK_SRCS)" | |
33f8ca73 AC |
1414 | CONFIG_ALL="${CONFIG_ALL} all-gdbtk" |
1415 | CONFIG_CLEAN="${CONFIG_CLEAN} clean-gdbtk" | |
1416 | CONFIG_INSTALL="${CONFIG_INSTALL} install-gdbtk" | |
1417 | CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-gdbtk" | |
3fc11d3e JM |
1418 | |
1419 | if test x$gdb_cv_os_cygwin = xyes; then | |
1420 | WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32" | |
1421 | WIN32LDAPP="-Wl,--subsystem,console" | |
1422 | CONFIG_OBS="${CONFIG_OBS} gdbres.o" | |
1423 | fi | |
1424 | fi | |
1425 | fi | |
ffc6a242 | 1426 | |
3ace7edb | 1427 | AC_CONFIG_SUBDIRS(gdbtk) |
3fc11d3e JM |
1428 | fi |
1429 | ||
3fc11d3e JM |
1430 | AC_SUBST(X_CFLAGS) |
1431 | AC_SUBST(X_LDFLAGS) | |
1432 | AC_SUBST(X_LIBS) | |
dd2504ab JM |
1433 | AC_SUBST(TCL_DEPS) |
1434 | AC_SUBST(TK_DEPS) | |
3fc11d3e JM |
1435 | AC_SUBST(ITCLLIB) |
1436 | AC_SUBST(ITCL_DEPS) | |
1437 | AC_SUBST(ITKLIB) | |
1438 | AC_SUBST(ITK_DEPS) | |
3fc11d3e JM |
1439 | AC_SUBST(GDBTKLIBS) |
1440 | AC_SUBST(GDBTK_CFLAGS) | |
d1c3b63a | 1441 | AC_SUBST(GDBTK_SRC_DIR) |
8b93c638 | 1442 | |
c906108c SS |
1443 | AC_PATH_X |
1444 | ||
9cc52bde MK |
1445 | # Check whether we should enable the TUI, but only do so if we really |
1446 | # can. | |
1447 | if test x"$enable_tui" = xyes; then | |
1448 | if test -d $srcdir/tui; then | |
1449 | if test "$ac_cv_search_waddstr" != no; then | |
1450 | CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" | |
1451 | CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" | |
1452 | CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" | |
1453 | CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)" | |
1454 | ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)" | |
1455 | CONFIG_ALL="${CONFIG_ALL} all-tui" | |
1456 | CONFIG_CLEAN="${CONFIG_CLEAN} clean-tui" | |
1457 | CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" | |
1458 | CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" | |
1459 | else | |
1460 | AC_MSG_WARN([no enhanced curses library found; disabling TUI]) | |
1461 | fi | |
1462 | fi | |
1463 | fi | |
1464 | ||
7a292a7a SS |
1465 | # Unlike the sim directory, whether a simulator is linked is controlled by |
1466 | # presence of a SIM= and a SIM_OBS= definition in the target '.mt' file. | |
1467 | # This code just checks for a few cases where we'd like to ignore those | |
1468 | # definitions, even when they're present in the '.mt' file. These cases | |
1469 | # are when --disable-sim is specified, or if the simulator directory is | |
6c5cfe5b | 1470 | # not part of the source tree. |
7a292a7a SS |
1471 | # |
1472 | AC_ARG_ENABLE(sim, | |
1473 | [ --enable-sim Link gdb with simulator], | |
1474 | [echo "enable_sim = $enable_sim"; | |
1475 | echo "enableval = ${enableval}"; | |
1476 | case "${enableval}" in | |
1477 | yes) ignore_sim=false ;; | |
1478 | no) ignore_sim=true ;; | |
1479 | *) ignore_sim=false ;; | |
1480 | esac], | |
1481 | [ignore_sim=false]) | |
1482 | ||
1483 | if test ! -d "${srcdir}/../sim"; then | |
1484 | ignore_sim=true | |
1485 | fi | |
1486 | ||
1487 | if test "${ignore_sim}" = "true"; then | |
1488 | IGNORE_SIM="SIM=" | |
1489 | IGNORE_SIM_OBS="SIM_OBS=" | |
1490 | else | |
1491 | IGNORE_SIM="" | |
1492 | IGNORE_SIM_OBS="" | |
60ca704f | 1493 | AC_DEFINE(WITH_SIM, 1, [Define if the simulator is being linked in.]) |
7a292a7a SS |
1494 | fi |
1495 | AC_SUBST(IGNORE_SIM) | |
1496 | AC_SUBST(IGNORE_SIM_OBS) | |
1497 | ||
c906108c | 1498 | AC_SUBST(ENABLE_CFLAGS) |
d28f9cdf | 1499 | AC_SUBST(PROFILE_CFLAGS) |
c906108c SS |
1500 | |
1501 | AC_SUBST(CONFIG_OBS) | |
1502 | AC_SUBST(CONFIG_DEPS) | |
1503 | AC_SUBST(CONFIG_SRCS) | |
b3a90332 AC |
1504 | AC_SUBST(CONFIG_ALL) |
1505 | AC_SUBST(CONFIG_CLEAN) | |
e56ac5c3 AC |
1506 | AC_SUBST(CONFIG_INSTALL) |
1507 | AC_SUBST(CONFIG_UNINSTALL) | |
c906108c | 1508 | |
c35f4ffc AC |
1509 | # List of host floatformats. |
1510 | AC_DEFINE_UNQUOTED(GDB_HOST_FLOAT_FORMAT,$gdb_host_float_format,[Host float floatformat]) | |
1511 | AC_DEFINE_UNQUOTED(GDB_HOST_DOUBLE_FORMAT,$gdb_host_double_format,[Host double floatformat]) | |
1512 | AC_DEFINE_UNQUOTED(GDB_HOST_LONG_DOUBLE_FORMAT,$gdb_host_long_double_format,[Host long double floatformat]) | |
1513 | ||
c906108c SS |
1514 | # target_subdir is used by the testsuite to find the target libraries. |
1515 | target_subdir= | |
1516 | if test "${host}" != "${target}"; then | |
1517 | target_subdir="${target_alias}/" | |
1518 | fi | |
1519 | AC_SUBST(target_subdir) | |
1520 | ||
1521 | frags= | |
771b4502 | 1522 | if test "${gdb_native}" = "yes"; then |
0dad8a66 MK |
1523 | host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh |
1524 | if test ! -f ${host_makefile_frag}; then | |
1525 | AC_MSG_ERROR("*** Gdb does not support native target ${host}") | |
1526 | fi | |
1527 | frags="$frags $host_makefile_frag" | |
1528 | else | |
1529 | host_makefile_frag=/dev/null | |
c906108c | 1530 | fi |
c906108c SS |
1531 | |
1532 | target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt | |
1533 | if test ! -f ${target_makefile_frag}; then | |
0dad8a66 | 1534 | AC_MSG_ERROR("*** Gdb does not support target ${target}") |
c906108c SS |
1535 | fi |
1536 | frags="$frags $target_makefile_frag" | |
1537 | ||
1538 | AC_SUBST_FILE(host_makefile_frag) | |
1539 | AC_SUBST_FILE(target_makefile_frag) | |
1540 | AC_SUBST(frags) | |
1541 | ||
1542 | changequote(,)dnl | |
1543 | hostfile=`sed -n ' | |
1544 | s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p | |
1545 | ' ${host_makefile_frag}` | |
1546 | ||
1547 | targetfile=`sed -n ' | |
b523a1fd | 1548 | s/^[ ]*DEPRECATED_TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p |
c906108c SS |
1549 | ' ${target_makefile_frag}` |
1550 | ||
771b4502 | 1551 | if test "${gdb_native}" = "yes"; then |
a85f51e7 DJ |
1552 | # We pick this up from the host configuration file (.mh) because we |
1553 | # do not have a native configuration Makefile fragment. | |
c906108c SS |
1554 | nativefile=`sed -n ' |
1555 | s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p | |
1556 | ' ${host_makefile_frag}` | |
c906108c SS |
1557 | fi |
1558 | changequote([,]) | |
1559 | ||
b00a8037 DJ |
1560 | if test x"${gdb_osabi}" != x ; then |
1561 | AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi, | |
1562 | [Define to the default OS ABI for this configuration.]) | |
1563 | fi | |
1564 | ||
8dcde887 MK |
1565 | # Enable multi-ice-gdb-server. |
1566 | AC_ARG_ENABLE(multi-ice, | |
1567 | [ --enable-multi-ice build the multi-ice-gdb-server], | |
1568 | [case $enableval in | |
1569 | yes | no) | |
1570 | ;; | |
1571 | *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;; | |
1572 | esac]) | |
1573 | if test "x$enable_multi_ice" = xyes; then | |
3ace7edb | 1574 | AC_CONFIG_SUBDIRS(multi-ice) |
96baa820 JM |
1575 | fi |
1576 | ||
a13e2c95 UW |
1577 | # We only build gdbserver automatically in a native configuration. |
1578 | if test "$gdb_native" = "yes"; then | |
8dcde887 MK |
1579 | AC_MSG_CHECKING(whether gdbserver is supported on this host) |
1580 | if test "x$build_gdbserver" = xyes; then | |
8dcde887 | 1581 | AC_MSG_RESULT(yes) |
3ace7edb | 1582 | AC_CONFIG_SUBDIRS(gdbserver) |
8dcde887 MK |
1583 | else |
1584 | AC_MSG_RESULT(no) | |
1585 | fi | |
a85f51e7 DJ |
1586 | fi |
1587 | ||
2c0fc042 AC |
1588 | # If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or |
1589 | # nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link | |
1590 | # to an empty version. | |
c906108c SS |
1591 | |
1592 | files= | |
1593 | links= | |
5a2402b8 | 1594 | |
c906108c | 1595 | rm -f xm.h |
5a2402b8 | 1596 | xm_h="" |
c906108c | 1597 | if test "${hostfile}" != ""; then |
5a2402b8 | 1598 | xm_h=xm.h |
0f475e27 AC |
1599 | case "${hostfile}" in |
1600 | xm-*.h ) GDB_XM_FILE="config/${gdb_host_cpu}/${hostfile}" ;; | |
1601 | * ) GDB_XM_FILE="${hostfile}" | |
1602 | esac | |
5a2402b8 AC |
1603 | files="${files} ${GDB_XM_FILE}" |
1604 | links="${links} xm.h" | |
60ca704f | 1605 | AC_DEFINE_UNQUOTED(GDB_XM_FILE, "${GDB_XM_FILE}", [hostfile]) |
c906108c | 1606 | fi |
5a2402b8 AC |
1607 | AC_SUBST(xm_h) |
1608 | ||
c906108c | 1609 | rm -f tm.h |
5a2402b8 | 1610 | tm_h="" |
c906108c | 1611 | if test "${targetfile}" != ""; then |
5a2402b8 | 1612 | tm_h=tm.h |
0f475e27 | 1613 | case "${targetfile}" in |
b8c4aece | 1614 | tm-*.h ) GDB_TM_FILE="config/${gdb_target_cpu}/${targetfile}" ;; |
0f475e27 AC |
1615 | * ) GDB_TM_FILE="${targetfile}" |
1616 | esac | |
5a2402b8 AC |
1617 | files="${files} ${GDB_TM_FILE}" |
1618 | links="${links} tm.h" | |
60ca704f | 1619 | AC_DEFINE_UNQUOTED(GDB_TM_FILE, "${GDB_TM_FILE}", [targetfile]) |
c906108c | 1620 | fi |
5a2402b8 AC |
1621 | AC_SUBST(tm_h) |
1622 | ||
c906108c | 1623 | rm -f nm.h |
5a2402b8 | 1624 | nm_h="" |
c906108c | 1625 | if test "${nativefile}" != ""; then |
5a2402b8 | 1626 | nm_h=nm.h |
0f475e27 AC |
1627 | case "${nativefile}" in |
1628 | nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; | |
1629 | * ) GDB_NM_FILE="${nativefile}" | |
1630 | esac | |
5a2402b8 AC |
1631 | files="${files} ${GDB_NM_FILE}" |
1632 | links="${links} nm.h" | |
60ca704f | 1633 | AC_DEFINE_UNQUOTED(GDB_NM_FILE, "${GDB_NM_FILE}", [nativefile]) |
c906108c | 1634 | fi |
5a2402b8 AC |
1635 | AC_SUBST(nm_h) |
1636 | ||
c906108c SS |
1637 | AC_LINK_FILES($files, $links) |
1638 | ||
1639 | dnl Check for exe extension set on certain hosts (e.g. Win32) | |
1640 | AC_EXEEXT | |
1641 | ||
234b45d4 KB |
1642 | dnl Detect the character set used by this host. |
1643 | ||
1644 | dnl At the moment, we just assume it's ISO-8859-1 (which is a | |
1645 | dnl superset of ASCII containing the characters needed for French, | |
1646 | dnl German, Spanish, Italian, and possibly others), but if were | |
1647 | dnl *were* to support any host character sets other than ISO-8859-1, | |
1648 | dnl here's where we'd detect it. | |
1649 | AC_DEFINE(GDB_DEFAULT_HOST_CHARSET, "ISO-8859-1", | |
1650 | [Define to be a string naming the default host character set.]) | |
1651 | ||
1652 | AM_ICONV | |
1653 | ||
ed952ac5 | 1654 | AC_OUTPUT(Makefile .gdbinit:gdbinit.in, |
c906108c SS |
1655 | [ |
1656 | dnl Autoconf doesn't provide a mechanism for modifying definitions | |
1657 | dnl provided by makefile fragments. | |
1658 | dnl | |
c906108c SS |
1659 | |
1660 | changequote(,)dnl | |
2c0fc042 | 1661 | sed -e '/^DEPRECATED_TM_FILE[ ]*=/s,^DEPRECATED_TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/, |
c906108c SS |
1662 | /^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/, |
1663 | /^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp | |
1664 | mv -f Makefile.tmp Makefile | |
1665 | changequote([,])dnl | |
1666 | ||
2acceee2 | 1667 | |
c906108c SS |
1668 | case x$CONFIG_HEADERS in |
1669 | xconfig.h:config.in) | |
1670 | echo > stamp-h ;; | |
1671 | esac | |
1672 | ], | |
1673 | [ | |
1674 | gdb_host_cpu=$gdb_host_cpu | |
1675 | gdb_target_cpu=$gdb_target_cpu | |
1676 | nativefile=$nativefile | |
1677 | ]) | |
1678 | ||
1679 | exit 0 |