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