]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/gdbserver/configure.ac
* configure.ac: Remove checks for prfpregset_t.
[thirdparty/binutils-gdb.git] / gdb / gdbserver / configure.ac
CommitLineData
d6e9fb05 1dnl Autoconf configure script for GDB server.
0050a760
DJ
2dnl Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006
3dnl Free Software Foundation, Inc.
d6e9fb05
JK
4dnl
5dnl This file is part of GDB.
6dnl
7dnl This program is free software; you can redistribute it and/or modify
8dnl it under the terms of the GNU General Public License as published by
9dnl the Free Software Foundation; either version 2 of the License, or
10dnl (at your option) any later version.
11dnl
12dnl This program is distributed in the hope that it will be useful,
13dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15dnl GNU General Public License for more details.
16dnl
17dnl You should have received a copy of the GNU General Public License
18dnl along with this program; if not, write to the Free Software
6f0f660e
EZ
19dnl Foundation, Inc., 51 Franklin Street, Fifth Floor,
20dnl Boston, MA 02110-1301, USA.
d6e9fb05
JK
21
22dnl Process this file with autoconf to produce a configure script.
23
bec39cab
AC
24AC_PREREQ(2.59)dnl
25
d6e9fb05 26AC_INIT(server.c)
84563040
DJ
27AC_CONFIG_HEADER(config.h:config.in)
28
29AC_PROG_CC
d6e9fb05
JK
30
31AC_CANONICAL_SYSTEM
84563040 32
d6e9fb05 33AC_PROG_INSTALL
c906108c 34
dcdb98d2
DJ
35AC_ARG_PROGRAM
36
ee6e2b82 37AC_HEADER_STDC
84563040 38
0d62e5e8 39AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
94e10508
DJ
40 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
41 stdlib.h unistd.h)
84563040 42
e122f1f5 43AC_CHECK_DECLS(strerror)
43d5792c 44
ccbd4912
MK
45AC_CHECK_TYPES(socklen_t, [], [],
46[#include <sys/types.h>
47#include <sys/socket.h>
48])
7ea81414 49. ${srcdir}/configure.srv
c906108c 50
58caa3dc 51if test "${srv_linux_usrregs}" = "yes"; then
f450004a
DJ
52 AC_DEFINE(HAVE_LINUX_USRREGS, 1,
53 [Define if the target supports PTRACE_PEEKUSR for register ]
54 [access.])
58caa3dc
DJ
55fi
56
57if test "${srv_linux_regsets}" = "yes"; then
e9d25b98
DJ
58 AC_DEFINE(HAVE_LINUX_REGSETS, 1,
59 [Define if the target supports register sets.])
60
58caa3dc
DJ
61 AC_MSG_CHECKING(for PTRACE_GETREGS)
62 AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
63 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
64 [PTRACE_GETREGS;],
65 [gdbsrv_cv_have_ptrace_getregs=yes],
66 [gdbsrv_cv_have_ptrace_getregs=no])])
67 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
68 if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
e9d25b98 69 AC_DEFINE(HAVE_PTRACE_GETREGS, 1,
f450004a
DJ
70 [Define if the target supports PTRACE_GETREGS for register ]
71 [access.])
58caa3dc
DJ
72 fi
73
74 AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
75 AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
76 [AC_TRY_COMPILE([#include <sys/ptrace.h>],
77 [PTRACE_GETFPXREGS;],
78 [gdbsrv_cv_have_ptrace_getfpxregs=yes],
79 [gdbsrv_cv_have_ptrace_getfpxregs=no])])
80 AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
81 if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
f450004a
DJ
82 AC_DEFINE(HAVE_PTRACE_GETFPXREGS, 1,
83 [Define if the target supports PTRACE_GETFPXREGS for extended ]
84 [register access.])
58caa3dc
DJ
85 fi
86fi
87
0d62e5e8
DJ
88if test "$ac_cv_header_sys_procfs_h" = yes; then
89 BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
90 BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
91 BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
0d62e5e8
DJ
92 BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
93fi
94
95srv_thread_depfiles=
96srv_libs=
97USE_THREAD_DB=
98
99if test "$srv_linux_thread_db" = "yes"; then
100 SRV_CHECK_THREAD_DB
101 if test "$srv_cv_thread_db" = no; then
102 AC_WARN([Could not find libthread_db.])
103 AC_WARN([Disabling thread support in gdbserver.])
104 srv_linux_thread_db=no
105 else
106 srv_libs="$srv_cv_thread_db"
107 fi
f6de3c42
DJ
108 old_LDFLAGS="$LDFLAGS"
109 LDFLAGS="$LDFLAGS -rdynamic"
110 AC_TRY_LINK([], [], [RDYNAMIC=-rdynamic], [RDYNAMIC=])
111 AC_SUBST(RDYNAMIC)
112 LDFLAGS="$old_LDFLAGS"
0d62e5e8
DJ
113fi
114
115if test "$srv_linux_thread_db" = "yes"; then
116 srv_thread_depfiles="thread-db.o proc-service.o"
117 USE_THREAD_DB="-DUSE_THREAD_DB"
3db0444b
DJ
118 AC_CACHE_CHECK([for TD_VERSION], gdbsrv_cv_have_td_version,
119 [AC_TRY_COMPILE([#include <thread_db.h>], [TD_VERSION;],
120 [gdbsrv_cv_have_td_version=yes],
121 [gdbsrv_cv_have_td_version=no])])
122 if test $gdbsrv_cv_have_td_version = yes; then
123 AC_DEFINE(HAVE_TD_VERSION, 1, [Define if TD_VERSION is available.])
124 fi
0d62e5e8
DJ
125fi
126
127GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
128GDBSERVER_LIBS="$srv_libs"
c906108c 129
7ea81414 130AC_SUBST(GDBSERVER_DEPFILES)
0d62e5e8
DJ
131AC_SUBST(GDBSERVER_LIBS)
132AC_SUBST(USE_THREAD_DB)
c906108c 133
c3a3ccc7
DJ
134AC_OUTPUT(Makefile,
135[case x$CONFIG_HEADERS in
136xconfig.h:config.in)
137echo > stamp-h ;;
138esac
139])