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