db7e301934b1df85f3891e26599f4435b0fff7f3
[external/binutils.git] / gdb / gdbserver / configure.in
1 dnl Autoconf configure script for GDB server.
2 dnl Copyright 2000, 2002 Free Software Foundation, Inc.
3 dnl
4 dnl This file is part of GDB.
5 dnl
6 dnl This program is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2 of the License, or
9 dnl (at your option) any later version.
10 dnl
11 dnl This program is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with this program; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 dnl Process this file with autoconf to produce a configure script.
21
22 AC_INIT(server.c)
23 AC_CONFIG_HEADER(config.h:config.in)
24
25 AC_PROG_CC
26
27 AC_CANONICAL_SYSTEM
28
29 AC_PROG_INSTALL
30
31 AC_HEADER_STDC
32
33 AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h)
34
35 . ${srcdir}/configure.srv
36
37 if test "${srv_linux_usrregs}" = "yes"; then
38   AC_DEFINE(HAVE_LINUX_USRREGS)
39 fi
40
41 if test "${srv_linux_regsets}" = "yes"; then
42   AC_MSG_CHECKING(for PTRACE_GETREGS)
43   AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
44   [AC_TRY_COMPILE([#include <sys/ptrace.h>],
45                   [PTRACE_GETREGS;],
46                   [gdbsrv_cv_have_ptrace_getregs=yes],
47                   [gdbsrv_cv_have_ptrace_getregs=no])])
48   AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
49   if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
50     AC_DEFINE(HAVE_LINUX_REGSETS)
51   fi
52
53   AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
54   AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
55   [AC_TRY_COMPILE([#include <sys/ptrace.h>],
56                   [PTRACE_GETFPXREGS;],
57                   [gdbsrv_cv_have_ptrace_getfpxregs=yes],
58                   [gdbsrv_cv_have_ptrace_getfpxregs=no])])
59   AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
60   if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
61     AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
62   fi
63 fi
64
65 GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
66
67 AC_SUBST(GDBSERVER_DEPFILES)
68
69 AC_OUTPUT(Makefile,
70 [case x$CONFIG_HEADERS in
71 xconfig.h:config.in)
72 echo > stamp-h ;;
73 esac
74 ])