diff options
Diffstat (limited to 'contrib/gdb/gdb/gdbserver/configure.in')
-rw-r--r-- | contrib/gdb/gdb/gdbserver/configure.in | 139 |
1 files changed, 54 insertions, 85 deletions
diff --git a/contrib/gdb/gdb/gdbserver/configure.in b/contrib/gdb/gdb/gdbserver/configure.in index 1bbb73c..744aac2 100644 --- a/contrib/gdb/gdb/gdbserver/configure.in +++ b/contrib/gdb/gdb/gdbserver/configure.in @@ -1,100 +1,69 @@ -srcname="Remote GDB server" -srctrigger=server.c -gdb_serial_driver=../ser-unix.c +dnl Autoconf configure script for GDB server. +dnl Copyright 2000, 2002 Free Software Foundation, Inc. +dnl +dnl This file is part of GDB. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# per-host: +dnl Process this file with autoconf to produce a configure script. -. ${srcdir}/../configure.host +AC_INIT(server.c) +AC_CONFIG_HEADER(config.h:config.in) -echo "gdbserver/configure.in: host is $host, target is $target" +AC_PROG_CC -if [ ! -f ${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh ]; then - echo '***' "GDB remote does not support host ${host}" 1>&2 - exit 1 -fi - -# We really shouldn't depend on there being a space after XM_FILE= ... -hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh` +AC_CANONICAL_SYSTEM -# per-target: +AC_PROG_INSTALL -. ${srcdir}/../configure.tgt +AC_HEADER_STDC -echo "gdbserver/configure.in: host_cpu is $host_cpu, target_cpu is $target_cpu" +AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h) -if [ ! -f ${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt ]; then - echo '***' "GDB remote does not support target ${target}" 1>&2 - exit 1 -fi +. ${srcdir}/configure.srv -if [ -z "${removing}" ] ; then - cat ${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh ${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt | awk '$1 == "#msg" { - print substr($0,6)}' +if test "${srv_linux_usrregs}" = "yes"; then + AC_DEFINE(HAVE_LINUX_USRREGS) fi -# We really shouldn't depend on there being a space after TM_FILE= ... -targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt` - -if [ "${target}" = "${host}" ] ; then - nativefile=`awk '$1 == "NAT_FILE=" { print $2 }' <${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh` +if test "${srv_linux_regsets}" = "yes"; then + AC_MSG_CHECKING(for PTRACE_GETREGS) + AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs, + [AC_TRY_COMPILE([#include <sys/ptrace.h>], + [PTRACE_GETREGS;], + [gdbsrv_cv_have_ptrace_getregs=yes], + [gdbsrv_cv_have_ptrace_getregs=no])]) + AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs) + if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then + AC_DEFINE(HAVE_LINUX_REGSETS) + fi + + AC_MSG_CHECKING(for PTRACE_GETFPXREGS) + AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs, + [AC_TRY_COMPILE([#include <sys/ptrace.h>], + [PTRACE_GETFPXREGS;], + [gdbsrv_cv_have_ptrace_getfpxregs=yes], + [gdbsrv_cv_have_ptrace_getfpxregs=no])]) + AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs) + if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then + AC_DEFINE(HAVE_PTRACE_GETFPXREGS) + fi fi -host_makefile_frag=../config/${gdb_host_cpu}/${gdb_host}.mh -target_makefile_frag=../config/${gdb_target_cpu}/${gdb_target}.mt +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj" -# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile -# (NAT_FILE) is not set in the ?config/* file, we don't make the -# corresponding links. But we have to remove the xm.h files and tm.h -# files anyway, e.g. when switching from "configure host" to -# "configure none". +AC_SUBST(GDBSERVER_DEPFILES) -files= -links= -rm -f xm.h -rm -f ser-hardwire.c -if [ "${hostfile}" != "" ]; then - if [ -f ${srcdir}/../config/${hostfile} ]; then - files="${files} ../config/${hostfile}" - else - files="${files} ../config/${gdb_host_cpu}/${hostfile}" - fi - links="${links} xm.h" - -# files="${files} ${gdb_serial_driver}" -# links="${links} ser-hardwire.c" -fi -rm -f tm.h -if [ "${targetfile}" != "" ]; then - if [ -f ${srcdir}/../config/${targetfile} ]; then - files="${files} ../config/${targetfile}" - else - files="${files} ../config/${gdb_target_cpu}/${targetfile}" - fi - links="${links} tm.h" -fi -rm -f nm.h -if [ "${nativefile}" != "" ]; then - if [ -f ${srcdir}/../config/${nativefile} ]; then - files="${files} ../config/${nativefile}" - else - files="${files} ../config/${gdb_host_cpu}/${nativefile}" - fi - links="${links} nm.h" -# temporary scaffolding until all hosts have the host/target/native -# split in place. -else - files="${files} ../config/nm-empty.h" - links="${links} nm.h" -fi - -if [ ${target_cpu} = "sparclite" ]; then - configdirs="${configdirs} sparclite" -fi - -# post-target: - -if [ "${nativefile}" = "" ] ; then - sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \ - < Makefile > Makefile.tem - mv -f Makefile.tem Makefile -fi +AC_OUTPUT(Makefile) |