* gdbserver/configure.srv: New file.
* gdbserver/configure.in: Use configure.srv instead
of the host/target makefile fragments. Set GDBSERVER_DEPFILES
from it.
* gdbserver/configure: Regenerated.
* gdbserver/terminal.h: New file.
* gdbserver/Makefile.in: Update for configure changes. Remove
more unneeded include paths.
+2002-02-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/configure.srv: New file.
+ * gdbserver/configure.in: Use configure.srv instead
+ of the host/target makefile fragments. Set GDBSERVER_DEPFILES
+ from it.
+ * gdbserver/configure: Regenerated.
+ * gdbserver/terminal.h: New file.
+ * gdbserver/Makefile.in: Update for configure changes. Remove
+ more unneeded include paths.
+
2002-02-24 Andrew Cagney <ac131313@redhat.com>
From wiz at danbala:
# All the includes used for CFLAGS and for lint.
# -I. for config files.
-# -I.. for gdb's config files (especially config.h)
-# -I${srcdir} possibly for regex.h also.
-# -I${srcdir}/config for more generic config files.
-# -I$(srcdir)/../regformats for regdef.h
-INCLUDE_CFLAGS = -I. -I.. -I${srcdir} -I${srcdir}/.. \
- -I$(srcdir)/../regformats
+# -I${srcdir} for our headers.
+# -I$(srcdir)/../regformats for regdef.h.
+INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats
# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
# from the config/ directory.
LINT=/usr/5bin/lint
LINTFLAGS= $(BFD_CFLAGS)
-# Host and target-dependent makefile fragments come in here.
-@host_makefile_frag@
-@target_makefile_frag@
-# End of host and target-dependent makefile fragments
-
# All source files that go into linking GDB remote server.
SFILES = $(srcdir)/low-hppabsd.c $(srcdir)/low-linux.c $(srcdir)/low-lynx.c \
$(srcdir)/low-sun3.c $(srcdir)/utils.c $(srcdir)/server.c \
$(srcdir)/remote-utils.c
-DEPFILES = $(GDBSERVER_DEPFILES)
+DEPFILES = @GDBSERVER_DEPFILES@
-SOURCES = $(SFILES) $(ALLDEPFILES)
+SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
-OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o regcache.o
+OBS = utils.o $(DEPFILES) server.o remote-utils.o regcache.o
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
-Makefile: Makefile.in config.status @frags@
+Makefile: Makefile.in config.status
$(SHELL) ./config.status
config.status: configure
server_h = $(srcdir)/server.h $(regcache_h)
server.o: server.c $(server_h)
-remote-utils.o: remote-utils.c $(server_h)
+remote-utils.o: remote-utils.c terminal.h $(server_h)
utils.o: utils.c $(server_h)
regcache.o: regcache.c $(server_h) $(regdef_h)
done
-. ${srcdir}/../configure.host
-
-. ${srcdir}/../configure.tgt
-
-frags=
-host_makefile_frag=${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh
-if test ! -f ${host_makefile_frag}; then
- { echo "configure: error: "*** GDB remote does not support host ${host}"" 1>&2; exit 1; }
-fi
-frags="$frags $host_makefile_frag"
-
-target_makefile_frag=${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt
-if test ! -f ${target_makefile_frag}; then
- { echo "configure: error: "*** GDB remote does not support target ${target}"" 1>&2; exit 1; }
-fi
-frags="$frags $target_makefile_frag"
+. ${srcdir}/configure.srv
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
-
-hostfile=`sed -n '
-s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${host_makefile_frag}`
-
-targetfile=`sed -n '
-s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${target_makefile_frag}`
-
-if test "${target}" = "${host}"; then
-nativefile=`sed -n '
-s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${host_makefile_frag}`
-fi
-
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@CPP@%$CPP%g
-/@host_makefile_frag@/r $host_makefile_frag
-s%@host_makefile_frag@%%g
-/@target_makefile_frag@/r $target_makefile_frag
-s%@target_makefile_frag@%%g
-s%@frags@%$frags%g
+s%@GDBSERVER_DEPFILES@%$GDBSERVER_DEPFILES%g
CEOF
EOF
AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h)
-. ${srcdir}/../configure.host
+. ${srcdir}/configure.srv
-. ${srcdir}/../configure.tgt
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj"
-frags=
-host_makefile_frag=${srcdir}/../config/${gdb_host_cpu}/${gdb_host}.mh
-if test ! -f ${host_makefile_frag}; then
- AC_MSG_ERROR("*** GDB remote does not support host ${host}")
-fi
-frags="$frags $host_makefile_frag"
-
-target_makefile_frag=${srcdir}/../config/${gdb_target_cpu}/${gdb_target}.mt
-if test ! -f ${target_makefile_frag}; then
- AC_MSG_ERROR("*** GDB remote does not support target ${target}")
-fi
-frags="$frags $target_makefile_frag"
-
-AC_SUBST_FILE(host_makefile_frag)
-AC_SUBST_FILE(target_makefile_frag)
-AC_SUBST(frags)
-
-changequote(,)dnl
-hostfile=`sed -n '
-s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${host_makefile_frag}`
-
-targetfile=`sed -n '
-s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${target_makefile_frag}`
-
-if test "${target}" = "${host}"; then
-nativefile=`sed -n '
-s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
-' ${host_makefile_frag}`
-fi
-changequote([,])dnl
+AC_SUBST(GDBSERVER_DEPFILES)
AC_OUTPUT(Makefile)
--- /dev/null
+# Mappings from configuration triplets to gdbserver build options.
+# This is invoked from the autoconf-generated configure script, to
+# produce the appropriate Makefile substitutions.
+
+# This file sets the following shell variables:
+# srv_regobj The register protocol appropriate for this target.
+# srv_tgtobj Any other target-specific modules appropriate
+# for this target.
+#
+# In addition, on GNU/Linux the following shell variables will be set:
+# srv_linux_regsets Set to "yes" if ptrace(PTRACE_GETREGS) and friends
+# may be available on this platform; unset otherwise.
+
+# Input is taken from the "${target}" variable.
+
+case "${target}" in
+ arm*-*-linux*) srv_regobj=reg-arm.o
+ srv_tgtobj="linux-low.o linux-arm-low.o"
+ ;;
+ i[3456]86-*-linux*) srv_regobj=reg-i386.o
+ srv_tgtobj="linux-low.o linux-i386-low.o"
+ ;;
+ ia64-*-linux*) srv_regobj=reg-ia64.o
+ srv_tgtobj="linux-low.o linux-ia64-low.o"
+ ;;
+ m68*-*-linux*) srv_regobj=reg-m68k.o
+ srv_tgtobj="linux-low.o linux-m68k-low.o"
+ ;;
+ mips*-*-linux*) srv_regobj=reg-mips.o
+ srv_tgtobj="linux-low.o linux-mips-low.o"
+ ;;
+ powerpc*-*-linux*) srv_regobj=reg-ppc.o
+ srv_tgtobj="linux-low.o linux-ppc-low.o"
+ ;;
+ sh*-*-linux*) srv_regobj=reg-sh.o
+ srv_tgtobj="linux-low.o linux-sh-low.o"
+ ;;
+ *) echo "Error: target not supported by gdbserver."
+ exit 1
+ ;;
+esac
--- /dev/null
+/* Terminal interface definitions for the GDB remote server.
+ Copyright 2002, Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined (TERMINAL_H)
+#define TERMINAL_H 1
+
+/* Autoconf will have defined HAVE_TERMIOS_H, HAVE_TERMIO_H,
+ and HAVE_SGTTY_H for us as appropriate. */
+
+#if defined(HAVE_TERMIOS_H)
+#define HAVE_TERMIOS
+#include <termios.h>
+#else /* ! HAVE_TERMIOS_H */
+#if defined(HAVE_TERMIO_H)
+#define HAVE_TERMIO
+#include <termio.h>
+
+#undef TIOCGETP
+#define TIOCGETP TCGETA
+#undef TIOCSETN
+#define TIOCSETN TCSETA
+#undef TIOCSETP
+#define TIOCSETP TCSETAF
+#define TERMINAL struct termio
+#else /* ! HAVE_TERMIO_H; default to SGTTY. */
+#define HAVE_SGTTY
+#include <fcntl.h>
+#include <sgtty.h>
+#include <sys/ioctl.h>
+#define TERMINAL struct sgttyb
+#endif
+#endif
+
+#endif /* !defined (TERMINAL_H) */