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