* MAINTAINERS (Write After Approval): Add myself.
[deliverable/binutils-gdb.git] / gdb / gdbserver / configure.ac
... / ...
CommitLineData
1dnl Autoconf configure script for GDB server.
2dnl Copyright 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
3dnl
4dnl This file is part of GDB.
5dnl
6dnl This program is free software; you can redistribute it and/or modify
7dnl it under the terms of the GNU General Public License as published by
8dnl the Free Software Foundation; either version 2 of the License, or
9dnl (at your option) any later version.
10dnl
11dnl This program is distributed in the hope that it will be useful,
12dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14dnl GNU General Public License for more details.
15dnl
16dnl You should have received a copy of the GNU General Public License
17dnl along with this program; if not, write to the Free Software
18dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20dnl Process this file with autoconf to produce a configure script.
21
22AC_PREREQ(2.59)dnl
23
24AC_INIT(server.c)
25AC_CONFIG_HEADER(config.h:config.in)
26
27AC_PROG_CC
28
29AC_CANONICAL_SYSTEM
30
31AC_PROG_INSTALL
32
33AC_ARG_PROGRAM
34
35AC_HEADER_STDC
36
37AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
38 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
39 stdlib.h unistd.h)
40
41BFD_NEED_DECLARATION(strerror)
42
43AC_CHECK_TYPES(socklen_t, [], [],
44[#include <sys/types.h>
45#include <sys/socket.h>
46])
47. ${srcdir}/configure.srv
48
49if test "${srv_linux_usrregs}" = "yes"; then
50 AC_DEFINE(HAVE_LINUX_USRREGS, 1,
51 [Define if the target supports PTRACE_PEEKUSR for register ]
52 [access.])
53fi
54
55if test "${srv_linux_regsets}" = "yes"; then
56 AC_MSG_CHECKING(for PTRACE_GETREGS)
57 AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
58 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
59 [PTRACE_GETREGS;],
60 [gdbsrv_cv_have_ptrace_getregs=yes],
61 [gdbsrv_cv_have_ptrace_getregs=no])])
62 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
63 if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
64 AC_DEFINE(HAVE_LINUX_REGSETS, 1,
65 [Define if the target supports PTRACE_GETREGS for register ]
66 [access.])
67 fi
68
69 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
70 AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
71 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
72 [PTRACE_GETFPXREGS;],
73 [gdbsrv_cv_have_ptrace_getfpxregs=yes],
74 [gdbsrv_cv_have_ptrace_getfpxregs=no])])
75 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
76 if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
77 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
78 [Define if the target supports PTRACE_GETFPXREGS for extended ]
79 [register access.])
80 fi
81fi
82
83if test "$ac_cv_header_sys_procfs_h" = yes; then
84 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
85 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
86 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
87 BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
88
89 dnl Check for broken prfpregset_t type
90
91 dnl For Linux/i386, glibc 2.1.3 was released with a bogus
92 dnl prfpregset_t type (it's a typedef for the pointer to a struct
93 dnl instead of the struct itself). We detect this here, and work
94 dnl around it in gdb_proc_service.h.
95
96 if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
97 AC_MSG_CHECKING(whether prfpregset_t type is broken)
98 AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
99 [AC_TRY_RUN([#include <sys/procfs.h>
100 int main ()
101 {
102 if (sizeof (prfpregset_t) == sizeof (void *))
103 return 1;
104 return 0;
105 }],
106 gdb_cv_prfpregset_t_broken=no,
107 gdb_cv_prfpregset_t_broken=yes,
108 gdb_cv_prfpregset_t_broken=yes)])
109 AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
110 if test $gdb_cv_prfpregset_t_broken = yes; then
111 AC_DEFINE(PRFPREGSET_T_BROKEN, 1,
112 [Define if the prfpregset_t type is broken.])
113 fi
114 fi
115
116 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
117fi
118
119srv_thread_depfiles=
120srv_libs=
121USE_THREAD_DB=
122
123if test "$srv_linux_thread_db" = "yes"; then
124 SRV_CHECK_THREAD_DB
125 if test "$srv_cv_thread_db" = no; then
126 AC_WARN([Could not find libthread_db.])
127 AC_WARN([Disabling thread support in gdbserver.])
128 srv_linux_thread_db=no
129 else
130 srv_libs="$srv_cv_thread_db"
131 fi
132 old_LDFLAGS="$LDFLAGS"
133 LDFLAGS="$LDFLAGS -rdynamic"
134 AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
135 AC_SUBST(RDYNAMIC)
136 LDFLAGS="$old_LDFLAGS"
137fi
138
139if test "$srv_linux_thread_db" = "yes"; then
140 srv_thread_depfiles="thread-db.o proc-service.o"
141 USE_THREAD_DB="-DUSE_THREAD_DB"
142fi
143
144GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
145GDBSERVER_LIBS="$srv_libs"
146
147AC_SUBST(GDBSERVER_DEPFILES)
148AC_SUBST(GDBSERVER_LIBS)
149AC_SUBST(USE_THREAD_DB)
150
151AC_OUTPUT(Makefile,
152[case x$CONFIG_HEADERS in
153xconfig.h:config.in)
154echo > stamp-h ;;
155esac
156])
This page took 0.023222 seconds and 4 git commands to generate.