ia64/xen-unstable

changeset 5318:0b862197be40

bitkeeper revision 1.1665.1.5 (42a1a779yqLZDCutMj_vFNQlo3q3zw)

Rationalise debugger stuff in the tree.

Within Xen itself, remove PDB references and fold into domu_debug.
When domu_debug hits a breakpoint, it pauses all vcpus of the domain
and raises VIRQ_DEBUGGER (not VIRQ_PDB). The debugger in domain0 can
either poll pause status or bind to VIRQ_DEBUGGER. Before debugging
a breakpointed domain the debugger should issue PAUSEDOMAIN itself, or
it is not guaranteed to see paused state of the domain!

Outside Xen there's a new dir tools/debugger, containing gdb, pdb and
a new library libxendebug (used by pdb). I also think the ptrace
functions in libxc also ought to be moved out: either to libxendebug
or to a new library libxenptrace.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Jun 04 13:07:05 2005 +0000 (2005-06-04)
parents c59632e7ff3e
children 0078804371c0 fb827128345c 411d895b167e
files .rootkeys tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.srv tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c tools/debugger/gdb/gdb-6.2.1-xen-sparse/mkbuildtree tools/debugger/gdb/gdbbuild tools/debugger/libxendebug/Makefile tools/debugger/libxendebug/list.h tools/debugger/libxendebug/xendebug.c tools/debugger/libxendebug/xendebug.h tools/debugger/pdb/Domain.ml tools/debugger/pdb/Domain.mli tools/debugger/pdb/Intel.ml tools/debugger/pdb/Makefile tools/debugger/pdb/OCamlMakefile tools/debugger/pdb/PDB.ml tools/debugger/pdb/Process.ml tools/debugger/pdb/Process.mli tools/debugger/pdb/Util.ml tools/debugger/pdb/debugger.ml tools/debugger/pdb/evtchn.ml tools/debugger/pdb/evtchn.mli tools/debugger/pdb/pdb_caml_xc.c tools/debugger/pdb/pdb_xen.c tools/debugger/pdb/server.ml tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.srv tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c tools/gdb/gdb-6.2.1-xen-sparse/mkbuildtree tools/gdb/gdbbuild tools/libxc/Makefile tools/libxc/list.h tools/libxc/xc.h tools/libxc/xc_debug.c tools/libxc/xc_debug.h tools/libxc/xc_private.c tools/libxc/xc_private.h tools/pdb/Domain.ml tools/pdb/Domain.mli tools/pdb/Intel.ml tools/pdb/Makefile tools/pdb/OCamlMakefile tools/pdb/PDB.ml tools/pdb/Process.ml tools/pdb/Process.mli tools/pdb/Util.ml tools/pdb/debugger.ml tools/pdb/evtchn.ml tools/pdb/evtchn.mli tools/pdb/pdb_caml_xc.c tools/pdb/pdb_xen.c tools/pdb/server.ml xen/Rules.mk xen/common/domain.c xen/include/asm-x86/debugger.h xen/include/public/xen.h xen/include/xen/sched.h
line diff
     1.1 --- a/.rootkeys	Fri Jun 03 21:54:27 2005 +0000
     1.2 +++ b/.rootkeys	Sat Jun 04 13:07:05 2005 +0000
     1.3 @@ -519,6 +519,33 @@ 4124b307tRTjLqzRy60QrUoqN2Fhuw tools/che
     1.4  4124b307lnAATmulpXYa0M-dzxLBDA tools/check/check_zlib_devel
     1.5  4124b308ly20ptMKQoiztPyP_X68Mw tools/check/check_zlib_lib
     1.6  4124b308O8yPHMKbj4YPR_grPGZmdA tools/check/chk
     1.7 +423d3a7bpoTFd0vqFaocQ-FqC8RuPA tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
     1.8 +423d3a7b_HtKYGocoTS1adeOpqDFnw tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure
     1.9 +423d3a7b2vJq86I8FbYm6up5BsCwfA tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in
    1.10 +423d3a7bQPownmVb63qOoyq89ebBVA tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.srv
    1.11 +423d3a7bHtqhyOgiRWhjWt-S-6wbYg tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c
    1.12 +4273458dYPghQKVnj_xu5-fC38CcOg tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c
    1.13 +423d3a7b2ENk2IskDZYZ98pe5NsvIA tools/debugger/gdb/gdb-6.2.1-xen-sparse/mkbuildtree
    1.14 +423d3a7buANO_q-kgxIRffUu7lMnUw tools/debugger/gdb/gdbbuild
    1.15 +42a1a777Dt8l7bna7fm1vKmTEX1FCQ tools/debugger/libxendebug/Makefile
    1.16 +42a0c8d8qbLfvuvDUA0tFB9nHMh-zg tools/debugger/libxendebug/list.h
    1.17 +42a0c8d98XtmbhyddBgIyyHllz5WTw tools/debugger/libxendebug/xendebug.c
    1.18 +42a0c8d9ucRxWO41IHTfYI7xYGoKrw tools/debugger/libxendebug/xendebug.h
    1.19 +42a0c8d9zuGuWoaTux5NW4N3wOw8pg tools/debugger/pdb/Domain.ml
    1.20 +42a0c8d9pigEXFFtdut3R99jbf73NA tools/debugger/pdb/Domain.mli
    1.21 +42a0c8d93wnR_hcSAa7VHgn8CSrWEA tools/debugger/pdb/Intel.ml
    1.22 +42a0c8d95glt-jkgXe8GDOPT6TYN6Q tools/debugger/pdb/Makefile
    1.23 +42a0c8d9UueJDF0IRX3OozEvUhSTmw tools/debugger/pdb/OCamlMakefile
    1.24 +42a0c8d9PgBvaWPzTHSFb9ngii7c7w tools/debugger/pdb/PDB.ml
    1.25 +42a0c8danHHGiNywdeer6j4jzxAc2A tools/debugger/pdb/Process.ml
    1.26 +42a0c8dav_08OtySI4kYP1lahlVrpQ tools/debugger/pdb/Process.mli
    1.27 +42a0c8da51EqubQT5PJ4sxCKLF3xSw tools/debugger/pdb/Util.ml
    1.28 +42a0c8daxftpiXuvLmc9fOOEhdFWiQ tools/debugger/pdb/debugger.ml
    1.29 +42a0c8da81tzhpvIAfkx9nZqUNrQvg tools/debugger/pdb/evtchn.ml
    1.30 +42a0c8dasiso9c-2sCvHBzP6YVjATA tools/debugger/pdb/evtchn.mli
    1.31 +42a0c8daXD_6Y62A_u5-PO_Klrhi0w tools/debugger/pdb/pdb_caml_xc.c
    1.32 +42a0c8danJXun9ay5SPBhhkKvuUPfg tools/debugger/pdb/pdb_xen.c
    1.33 +42a0c8dbjK6Du89D2SUcxsuAdlUu3w tools/debugger/pdb/server.ml
    1.34  401d7e160vaxMBAUSLSicuZ7AQjJ3w tools/examples/Makefile
    1.35  401d7e16UgeqroJQTIhwkrDVkoWgZQ tools/examples/README
    1.36  41597996VhTbNuHbuscYSfRb-WR6fA tools/examples/block-enbd
    1.37 @@ -540,14 +567,6 @@ 41dde8af6M2Pm1Rrv_f5jEFC_BIOIA tools/exa
    1.38  41090ec8Pj_bkgCBpg2W7WfmNkumEA tools/examples/xmexample1
    1.39  40cf2937oKlROYOJTN8GWwWM5AmjBg tools/examples/xmexample2
    1.40  41fc0c18_k4iL81hu4pMIWQu9dKpKA tools/examples/xmexample3
    1.41 -423d3a7bpoTFd0vqFaocQ-FqC8RuPA tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in
    1.42 -423d3a7b_HtKYGocoTS1adeOpqDFnw tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure
    1.43 -423d3a7b2vJq86I8FbYm6up5BsCwfA tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in
    1.44 -423d3a7bQPownmVb63qOoyq89ebBVA tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.srv
    1.45 -423d3a7bHtqhyOgiRWhjWt-S-6wbYg tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c
    1.46 -4273458dYPghQKVnj_xu5-fC38CcOg tools/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c
    1.47 -423d3a7b2ENk2IskDZYZ98pe5NsvIA tools/gdb/gdb-6.2.1-xen-sparse/mkbuildtree
    1.48 -423d3a7buANO_q-kgxIRffUu7lMnUw tools/gdb/gdbbuild
    1.49  428d0d82yOaUzYQuYQxH7VzQytKo-g tools/ioemu/COPYING
    1.50  428d0d82EdPp1TqJBembLgyB1y413w tools/ioemu/COPYING.LIB
    1.51  428d0d82fd6-QydvFfHmeQBGrKnrrA tools/ioemu/Changelog
    1.52 @@ -681,14 +700,11 @@ 428d0d85d831iQvvCD3LcaOD9rYGkg tools/ioe
    1.53  428f0763_67jCiHbdgfGlgAOJqfg9A tools/ioemu/x86_64.ld
    1.54  3fbba6dbDfYvJSsw9500b4SZyUhxjQ tools/libxc/Makefile
    1.55  41dde8afKYRKxS4XtLv1KUegGQy_bg tools/libxc/linux_boot_params.h
    1.56 -42a0c8d8qbLfvuvDUA0tFB9nHMh-zg tools/libxc/list.h
    1.57  41cc934abX-QLXJXW_clV_wRjM0zYg tools/libxc/plan9a.out.h
    1.58  3fbba6dc1uU7U3IFeF6A-XEOYF2MkQ tools/libxc/rpm.spec
    1.59  3fbba6dcrNxtygEcgJYAJJ1gCQqfsA tools/libxc/xc.h
    1.60  3fbba6dbEVkVMX0JuDFzap9jeaucGA tools/libxc/xc_bvtsched.c
    1.61  4273458dyF2_sKA6CFkNJQYb8eY2dA tools/libxc/xc_core.c
    1.62 -42a0c8d98XtmbhyddBgIyyHllz5WTw tools/libxc/xc_debug.c
    1.63 -42a0c8d9ucRxWO41IHTfYI7xYGoKrw tools/libxc/xc_debug.h
    1.64  3fbba6dbasJQV-MVElDC0DGSHMiL5w tools/libxc/xc_domain.c
    1.65  40278d99BLsfUv3qxv0I8C1sClZ0ow tools/libxc/xc_elf.h
    1.66  403e0977Bjsm_e82pwvl9VvaJxh8Gg tools/libxc/xc_evtchn.c
    1.67 @@ -740,21 +756,6 @@ 40c9c4697z76HDfkCLdMhmaEwzFoNQ tools/mis
    1.68  41adc641dV-0cDLSyzMs5BT8nL7v3Q tools/misc/xenperf.c
    1.69  4056f5155QYZdsk-1fLdjsZPFTnlhg tools/misc/xensymoops
    1.70  40cf2937dqM1jWW87O5OoOYND8leuA tools/misc/xm
    1.71 -42a0c8d9zuGuWoaTux5NW4N3wOw8pg tools/pdb/Domain.ml
    1.72 -42a0c8d9pigEXFFtdut3R99jbf73NA tools/pdb/Domain.mli
    1.73 -42a0c8d93wnR_hcSAa7VHgn8CSrWEA tools/pdb/Intel.ml
    1.74 -42a0c8d95glt-jkgXe8GDOPT6TYN6Q tools/pdb/Makefile
    1.75 -42a0c8d9UueJDF0IRX3OozEvUhSTmw tools/pdb/OCamlMakefile
    1.76 -42a0c8d9PgBvaWPzTHSFb9ngii7c7w tools/pdb/PDB.ml
    1.77 -42a0c8danHHGiNywdeer6j4jzxAc2A tools/pdb/Process.ml
    1.78 -42a0c8dav_08OtySI4kYP1lahlVrpQ tools/pdb/Process.mli
    1.79 -42a0c8da51EqubQT5PJ4sxCKLF3xSw tools/pdb/Util.ml
    1.80 -42a0c8daxftpiXuvLmc9fOOEhdFWiQ tools/pdb/debugger.ml
    1.81 -42a0c8da81tzhpvIAfkx9nZqUNrQvg tools/pdb/evtchn.ml
    1.82 -42a0c8dasiso9c-2sCvHBzP6YVjATA tools/pdb/evtchn.mli
    1.83 -42a0c8daXD_6Y62A_u5-PO_Klrhi0w tools/pdb/pdb_caml_xc.c
    1.84 -42a0c8danJXun9ay5SPBhhkKvuUPfg tools/pdb/pdb_xen.c
    1.85 -42a0c8dbjK6Du89D2SUcxsuAdlUu3w tools/pdb/server.ml
    1.86  4270cc81g3nSNYCZ1ryCMDEbLtMtbQ tools/pygrub/Makefile
    1.87  4270deeccyRsJn6jLnRh9odRtMW9SA tools/pygrub/README
    1.88  4270cc81EIl7NyaS3Av6IPRk2c2a6Q tools/pygrub/setup.py
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/Makefile.in	Sat Jun 04 13:07:05 2005 +0000
     2.3 @@ -0,0 +1,308 @@
     2.4 +# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
     2.5 +# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
     2.6 +
     2.7 +# This file is part of GDB.
     2.8 +
     2.9 +# This program is free software; you can redistribute it and/or modify
    2.10 +# it under the terms of the GNU General Public License as published by
    2.11 +# the Free Software Foundation; either version 2 of the License, or
    2.12 +# (at your option) any later version.
    2.13 +# 
    2.14 +# This program is distributed in the hope that it will be useful,
    2.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.17 +# GNU General Public License for more details.
    2.18 +# 
    2.19 +# You should have received a copy of the GNU General Public License
    2.20 +# along with this program; if not, write to the Free Software
    2.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2.22 +
    2.23 +prefix = @prefix@
    2.24 +exec_prefix = @exec_prefix@
    2.25 +
    2.26 +host_alias = @host_alias@
    2.27 +target_alias = @target_alias@
    2.28 +program_transform_name = @program_transform_name@
    2.29 +bindir = @bindir@
    2.30 +libdir = @libdir@
    2.31 +tooldir = $(libdir)/$(target_alias)
    2.32 +
    2.33 +datadir = @datadir@
    2.34 +mandir = @mandir@
    2.35 +man1dir = $(mandir)/man1
    2.36 +man2dir = $(mandir)/man2
    2.37 +man3dir = $(mandir)/man3
    2.38 +man4dir = $(mandir)/man4
    2.39 +man5dir = $(mandir)/man5
    2.40 +man6dir = $(mandir)/man6
    2.41 +man7dir = $(mandir)/man7
    2.42 +man8dir = $(mandir)/man8
    2.43 +man9dir = $(mandir)/man9
    2.44 +infodir = @infodir@
    2.45 +htmldir = $(prefix)/html
    2.46 +includedir = @includedir@
    2.47 +
    2.48 +SHELL = /bin/sh
    2.49 +
    2.50 +INSTALL = @INSTALL@
    2.51 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
    2.52 +INSTALL_DATA = @INSTALL_DATA@
    2.53 +
    2.54 +CC = @CC@
    2.55 +
    2.56 +# Directory containing source files.  Don't clean up the spacing,
    2.57 +# this exact string is matched for by the "configure" script.
    2.58 +srcdir = @srcdir@
    2.59 +VPATH = @srcdir@
    2.60 +
    2.61 +# It is also possible that you will need to add -I/usr/include/sys to the
    2.62 +# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which 
    2.63 +# is where it should be according to Posix).
    2.64 +
    2.65 +# Set this up with gcc if you have gnu ld and the loader will print out
    2.66 +# line numbers for undefinded refs.
    2.67 +#CC-LD=gcc -static
    2.68 +CC-LD=${CC}
    2.69 +
    2.70 +# Where is the "include" directory?  Traditionally ../include or ./include
    2.71 +INCLUDE_DIR =  ${srcdir}/../../include
    2.72 +INCLUDE_DEP = $$(INCLUDE_DIR)
    2.73 +
    2.74 +# Where are the BFD library?
    2.75 +BFD_DIR = ../../bfd
    2.76 +BFD = $(BFD_DIR)/libbfd.a
    2.77 +BFD_SRC = $(srcdir)/$(BFD_DIR)
    2.78 +BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
    2.79 +
    2.80 +# Where is the source dir for the READLINE library?  Traditionally in .. or .
    2.81 +# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
    2.82 +READLINE_DIR = ${srcdir}/../readline
    2.83 +READLINE_DEP = $$(READLINE_DIR)
    2.84 +
    2.85 +# All the includes used for CFLAGS and for lint.
    2.86 +# -I. for config files.
    2.87 +# -I${srcdir} for our headers.
    2.88 +# -I$(srcdir)/../regformats for regdef.h.
    2.89 +INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)  -I../../../../../libxc/
    2.90 +
    2.91 +# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
    2.92 +# from the config/ directory.
    2.93 +GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
    2.94 +#PROFILE_CFLAGS = -pg
    2.95 +
    2.96 +WARN_CFLAGS = -Wall
    2.97 +
    2.98 +# CFLAGS is specifically reserved for setting from the command line
    2.99 +# when running make.  I.E.  "make CFLAGS=-Wmissing-prototypes".
   2.100 +CFLAGS = @CFLAGS@
   2.101 +
   2.102 +# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
   2.103 +INTERNAL_CFLAGS =  $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
   2.104 +	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
   2.105 +
   2.106 +# LDFLAGS is specifically reserved for setting from the command line
   2.107 +# when running make.
   2.108 +LDFLAGS = @LDFLAGS@
   2.109 +
   2.110 +# Perhaps should come from parent Makefile
   2.111 +VERSION = gdbserver-4.12.3
   2.112 +DIST=gdb
   2.113 +
   2.114 +LINT=/usr/5bin/lint
   2.115 +LINTFLAGS= $(BFD_CFLAGS)
   2.116 +
   2.117 +# All source files that go into linking GDB remote server.
   2.118 +
   2.119 +SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
   2.120 +	$(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \
   2.121 +	$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
   2.122 +	$(srcdir)/thread-db.c $(srcdir)/utils.c \
   2.123 +	$(srcdir)/linux-arm-low.c $(srcdir)/linux-i386-low.c \
   2.124 +	$(srcdir)/i387-fp.c \
   2.125 +	$(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \
   2.126 +	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
   2.127 +	$(srcdir)/linux-ppc-low.c $(srcdir)/linux-s390-low.c \
   2.128 +	$(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c
   2.129 +
   2.130 +DEPFILES = @GDBSERVER_DEPFILES@
   2.131 +
   2.132 +SOURCES = $(SFILES)
   2.133 +TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} 
   2.134 +
   2.135 +OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
   2.136 +	utils.o \
   2.137 +	mem-break.o \
   2.138 +	$(DEPFILES)
   2.139 +GDBSERVER_LIBS = @GDBSERVER_LIBS@
   2.140 +
   2.141 +# Prevent Sun make from putting in the machine type.  Setting
   2.142 +# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
   2.143 +.c.o:
   2.144 +	${CC} -c ${INTERNAL_CFLAGS} $<
   2.145 +
   2.146 +all: gdbserver-xen gdbreplay
   2.147 +
   2.148 +# Traditionally "install" depends on "all".  But it may be useful
   2.149 +# not to; for example, if the user has made some trivial change to a 
   2.150 +# source file and doesn't care about rebuilding or just wants to save the
   2.151 +# time it takes for make to check that all is up to date.
   2.152 +# install-only is intended to address that need.
   2.153 +install: all install-only
   2.154 +install-only: 
   2.155 +	n=`echo gdbserver-xen | sed '$(program_transform_name)'`; \
   2.156 +	if [ x$$n = x ]; then n=gdbserver-xen; else true; fi; \
   2.157 +	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
   2.158 +	$(INSTALL_PROGRAM) gdbserver-xen $(DESTDIR)$(bindir)/$$n; \
   2.159 +	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \
   2.160 +	$(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1
   2.161 +
   2.162 +uninstall: force
   2.163 +	n=`echo gdbserver-xen | sed '$(program_transform_name)'`; \
   2.164 +	if [ x$$n = x ]; then n=gdbserver-xen; else true; fi; \
   2.165 +	rm -f $(bindir)/$$n $(DESTDIR)$(man1dir)/$$n.1
   2.166 +
   2.167 +installcheck:
   2.168 +check:
   2.169 +info dvi:
   2.170 +install-info:
   2.171 +html:
   2.172 +install-html:
   2.173 +clean-info:
   2.174 +
   2.175 +gdbserver-xen: $(OBS) ${ADD_DEPS} ${CDEPS}
   2.176 +	rm -f gdbserver-xen
   2.177 +	${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbserver-xen $(OBS) \
   2.178 +	  $(GDBSERVER_LIBS) $(XM_CLIBS)
   2.179 +
   2.180 +gdbreplay: gdbreplay.o
   2.181 +	rm -f gdbreplay
   2.182 +	${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \
   2.183 +	  $(XM_CLIBS)
   2.184 +
   2.185 +# Put the proper machine-specific files first, so M-. on a machine
   2.186 +# specific routine gets the one for the correct machine.
   2.187 +# The xyzzy stuff below deals with empty DEPFILES
   2.188 +TAGS:	${TAGFILES}
   2.189 +	etags `find ${srcdir}/../config -name $(TM_FILE) -print` \
   2.190 +	  `find ${srcdir}/../config -name ${XM_FILE} -print` \
   2.191 +	  `find ${srcdir}/../config -name ${NAT_FILE} -print` \
   2.192 +	  `for i in yzzy ${DEPFILES}; do \
   2.193 +	     if [ x$$i != xyzzy ]; then \
   2.194 +	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
   2.195 +	     fi; \
   2.196 +	   done` \
   2.197 +	  ${TAGFILES}
   2.198 +tags: TAGS
   2.199 +
   2.200 +clean:
   2.201 +	rm -f *.o ${ADD_FILES} *~
   2.202 +	rm -f gdbserver gdbreplay core make.log
   2.203 +	rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m68k.c reg-mips.c
   2.204 +	rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c
   2.205 +
   2.206 +maintainer-clean realclean distclean: clean
   2.207 +	rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
   2.208 +	rm -f Makefile
   2.209 +
   2.210 +STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
   2.211 +
   2.212 +config.h: stamp-h ; @true
   2.213 +stamp-h: config.in config.status
   2.214 +	CONFIG_FILES="" $(SHELL) ./config.status
   2.215 +
   2.216 +Makefile: Makefile.in config.status
   2.217 +	CONFIG_HEADERS="" $(SHELL) ./config.status
   2.218 +
   2.219 +config.status: configure configure.srv
   2.220 +	$(SHELL) ./config.status --recheck
   2.221 +
   2.222 +force:
   2.223 +
   2.224 +version.c: Makefile
   2.225 +	echo 'char *version = "$(VERSION)";' >version.c
   2.226 +
   2.227 +# GNU Make has an annoying habit of putting *all* the Makefile variables
   2.228 +# into the environment, unless you include this target as a circumvention.
   2.229 +# Rumor is that this will be fixed (and this target can be removed)
   2.230 +# in GNU Make 4.0.
   2.231 +.NOEXPORT:
   2.232 +
   2.233 +# GNU Make 3.63 has a different problem: it keeps tacking command line
   2.234 +# overrides onto the definition of $(MAKE).  This variable setting
   2.235 +# will remove them.
   2.236 +MAKEOVERRIDES=
   2.237 +
   2.238 +gdb_proc_service_h = $(srcdir)/../gdb_proc_service.h $(srcdir)/../gregset.h
   2.239 +regdat_sh = $(srcdir)/../regformats/regdat.sh
   2.240 +regdef_h = $(srcdir)/../regformats/regdef.h
   2.241 +regcache_h = $(srcdir)/regcache.h
   2.242 +server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
   2.243 +		$(srcdir)/mem-break.h
   2.244 +
   2.245 +inferiors.o: inferiors.c $(server_h)
   2.246 +mem-break.o: mem-break.c $(server_h)
   2.247 +proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h)
   2.248 +regcache.o: regcache.c $(server_h) $(regdef_h)
   2.249 +remote-utils.o: remote-utils.c terminal.h $(server_h)
   2.250 +server.o: server.c $(server_h)
   2.251 +target.o: target.c $(server_h)
   2.252 +thread-db.o: thread-db.c $(server_h) $(gdb_proc_service_h)
   2.253 +utils.o: utils.c $(server_h)
   2.254 +
   2.255 +signals.o: ../signals/signals.c $(server_h)
   2.256 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
   2.257 +
   2.258 +i387-fp.o: i387-fp.c $(server_h)
   2.259 +
   2.260 +linux_low_h = $(srcdir)/linux-low.h
   2.261 +
   2.262 +linux-low.o: linux-low.c $(linux_low_h) $(server_h)
   2.263 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
   2.264 +
   2.265 +linux-xen-low.o: linux-xen-low.c $(linux_low_h) $(server_h)
   2.266 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
   2.267 +
   2.268 +linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
   2.269 +linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
   2.270 +linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h)
   2.271 +linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h)
   2.272 +linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h)
   2.273 +linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h)
   2.274 +linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h)
   2.275 +linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h)
   2.276 +
   2.277 +reg-arm.o : reg-arm.c $(regdef_h)
   2.278 +reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
   2.279 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c
   2.280 +reg-i386.o : reg-i386.c $(regdef_h)
   2.281 +reg-i386.c : $(srcdir)/../regformats/reg-i386.dat $(regdat_sh)
   2.282 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-i386.dat reg-i386.c
   2.283 +reg-i386-linux.o : reg-i386-linux.c $(regdef_h)
   2.284 +reg-i386-linux.c : $(srcdir)/../regformats/reg-i386-linux.dat $(regdat_sh)
   2.285 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-i386-linux.dat reg-i386-linux.c
   2.286 +reg-ia64.o : reg-ia64.c $(regdef_h)
   2.287 +reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh)
   2.288 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c
   2.289 +reg-m68k.o : reg-m68k.c $(regdef_h)
   2.290 +reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
   2.291 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
   2.292 +reg-mips.o : reg-mips.c $(regdef_h)
   2.293 +reg-mips.c : $(srcdir)/../regformats/reg-mips.dat $(regdat_sh)
   2.294 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-mips.dat reg-mips.c
   2.295 +reg-ppc.o : reg-ppc.c $(regdef_h)
   2.296 +reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh)
   2.297 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c
   2.298 +reg-s390.o : reg-s390.c $(regdef_h)
   2.299 +reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh)
   2.300 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c
   2.301 +reg-s390x.o : reg-s390x.c $(regdef_h)
   2.302 +reg-s390x.c : $(srcdir)/../regformats/reg-s390x.dat $(regdat_sh)
   2.303 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-s390x.dat reg-s390x.c
   2.304 +reg-sh.o : reg-sh.c $(regdef_h)
   2.305 +reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh)
   2.306 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c
   2.307 +reg-x86-64.o : reg-x86-64.c $(regdef_h)
   2.308 +reg-x86-64.c : $(srcdir)/../regformats/reg-x86-64.dat $(regdat_sh)
   2.309 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-x86-64.dat reg-x86-64.c
   2.310 +
   2.311 +# This is the end of "Makefile.in".
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure	Sat Jun 04 13:07:05 2005 +0000
     3.3 @@ -0,0 +1,4650 @@
     3.4 +#! /bin/sh
     3.5 +# Guess values for system-dependent variables and create Makefiles.
     3.6 +# Generated by GNU Autoconf 2.57.
     3.7 +#
     3.8 +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
     3.9 +# Free Software Foundation, Inc.
    3.10 +# This configure script is free software; the Free Software Foundation
    3.11 +# gives unlimited permission to copy, distribute and modify it.
    3.12 +## --------------------- ##
    3.13 +## M4sh Initialization.  ##
    3.14 +## --------------------- ##
    3.15 +
    3.16 +# Be Bourne compatible
    3.17 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
    3.18 +  emulate sh
    3.19 +  NULLCMD=:
    3.20 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
    3.21 +  # is contrary to our usage.  Disable this feature.
    3.22 +  alias -g '${1+"$@"}'='"$@"'
    3.23 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
    3.24 +  set -o posix
    3.25 +fi
    3.26 +
    3.27 +# Support unset when possible.
    3.28 +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
    3.29 +  as_unset=unset
    3.30 +else
    3.31 +  as_unset=false
    3.32 +fi
    3.33 +
    3.34 +
    3.35 +# Work around bugs in pre-3.0 UWIN ksh.
    3.36 +$as_unset ENV MAIL MAILPATH
    3.37 +PS1='$ '
    3.38 +PS2='> '
    3.39 +PS4='+ '
    3.40 +
    3.41 +# NLS nuisances.
    3.42 +for as_var in \
    3.43 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
    3.44 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
    3.45 +  LC_TELEPHONE LC_TIME
    3.46 +do
    3.47 +  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
    3.48 +    eval $as_var=C; export $as_var
    3.49 +  else
    3.50 +    $as_unset $as_var
    3.51 +  fi
    3.52 +done
    3.53 +
    3.54 +# Required to use basename.
    3.55 +if expr a : '\(a\)' >/dev/null 2>&1; then
    3.56 +  as_expr=expr
    3.57 +else
    3.58 +  as_expr=false
    3.59 +fi
    3.60 +
    3.61 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
    3.62 +  as_basename=basename
    3.63 +else
    3.64 +  as_basename=false
    3.65 +fi
    3.66 +
    3.67 +
    3.68 +# Name of the executable.
    3.69 +as_me=`$as_basename "$0" ||
    3.70 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
    3.71 +	 X"$0" : 'X\(//\)$' \| \
    3.72 +	 X"$0" : 'X\(/\)$' \| \
    3.73 +	 .     : '\(.\)' 2>/dev/null ||
    3.74 +echo X/"$0" |
    3.75 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
    3.76 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
    3.77 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
    3.78 +  	  s/.*/./; q'`
    3.79 +
    3.80 +
    3.81 +# PATH needs CR, and LINENO needs CR and PATH.
    3.82 +# Avoid depending upon Character Ranges.
    3.83 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
    3.84 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    3.85 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
    3.86 +as_cr_digits='0123456789'
    3.87 +as_cr_alnum=$as_cr_Letters$as_cr_digits
    3.88 +
    3.89 +# The user is always right.
    3.90 +if test "${PATH_SEPARATOR+set}" != set; then
    3.91 +  echo "#! /bin/sh" >conf$$.sh
    3.92 +  echo  "exit 0"   >>conf$$.sh
    3.93 +  chmod +x conf$$.sh
    3.94 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    3.95 +    PATH_SEPARATOR=';'
    3.96 +  else
    3.97 +    PATH_SEPARATOR=:
    3.98 +  fi
    3.99 +  rm -f conf$$.sh
   3.100 +fi
   3.101 +
   3.102 +
   3.103 +  as_lineno_1=$LINENO
   3.104 +  as_lineno_2=$LINENO
   3.105 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   3.106 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
   3.107 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
   3.108 +  # Find who we are.  Look in the path if we contain no path at all
   3.109 +  # relative or not.
   3.110 +  case $0 in
   3.111 +    *[\\/]* ) as_myself=$0 ;;
   3.112 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   3.113 +for as_dir in $PATH
   3.114 +do
   3.115 +  IFS=$as_save_IFS
   3.116 +  test -z "$as_dir" && as_dir=.
   3.117 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
   3.118 +done
   3.119 +
   3.120 +       ;;
   3.121 +  esac
   3.122 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
   3.123 +  # in which case we are not to be found in the path.
   3.124 +  if test "x$as_myself" = x; then
   3.125 +    as_myself=$0
   3.126 +  fi
   3.127 +  if test ! -f "$as_myself"; then
   3.128 +    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   3.129 +   { (exit 1); exit 1; }; }
   3.130 +  fi
   3.131 +  case $CONFIG_SHELL in
   3.132 +  '')
   3.133 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   3.134 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
   3.135 +do
   3.136 +  IFS=$as_save_IFS
   3.137 +  test -z "$as_dir" && as_dir=.
   3.138 +  for as_base in sh bash ksh sh5; do
   3.139 +	 case $as_dir in
   3.140 +	 /*)
   3.141 +	   if ("$as_dir/$as_base" -c '
   3.142 +  as_lineno_1=$LINENO
   3.143 +  as_lineno_2=$LINENO
   3.144 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   3.145 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
   3.146 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
   3.147 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
   3.148 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
   3.149 +	     CONFIG_SHELL=$as_dir/$as_base
   3.150 +	     export CONFIG_SHELL
   3.151 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
   3.152 +	   fi;;
   3.153 +	 esac
   3.154 +       done
   3.155 +done
   3.156 +;;
   3.157 +  esac
   3.158 +
   3.159 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   3.160 +  # uniformly replaced by the line number.  The first 'sed' inserts a
   3.161 +  # line-number line before each line; the second 'sed' does the real
   3.162 +  # work.  The second script uses 'N' to pair each line-number line
   3.163 +  # with the numbered line, and appends trailing '-' during
   3.164 +  # substitution so that $LINENO is not a special case at line end.
   3.165 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
   3.166 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
   3.167 +  sed '=' <$as_myself |
   3.168 +    sed '
   3.169 +      N
   3.170 +      s,$,-,
   3.171 +      : loop
   3.172 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
   3.173 +      t loop
   3.174 +      s,-$,,
   3.175 +      s,^['$as_cr_digits']*\n,,
   3.176 +    ' >$as_me.lineno &&
   3.177 +  chmod +x $as_me.lineno ||
   3.178 +    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   3.179 +   { (exit 1); exit 1; }; }
   3.180 +
   3.181 +  # Don't try to exec as it changes $[0], causing all sort of problems
   3.182 +  # (the dirname of $[0] is not the place where we might find the
   3.183 +  # original and so on.  Autoconf is especially sensible to this).
   3.184 +  . ./$as_me.lineno
   3.185 +  # Exit status is that of the last command.
   3.186 +  exit
   3.187 +}
   3.188 +
   3.189 +
   3.190 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
   3.191 +  *c*,-n*) ECHO_N= ECHO_C='
   3.192 +' ECHO_T='	' ;;
   3.193 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
   3.194 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
   3.195 +esac
   3.196 +
   3.197 +if expr a : '\(a\)' >/dev/null 2>&1; then
   3.198 +  as_expr=expr
   3.199 +else
   3.200 +  as_expr=false
   3.201 +fi
   3.202 +
   3.203 +rm -f conf$$ conf$$.exe conf$$.file
   3.204 +echo >conf$$.file
   3.205 +if ln -s conf$$.file conf$$ 2>/dev/null; then
   3.206 +  # We could just check for DJGPP; but this test a) works b) is more generic
   3.207 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
   3.208 +  if test -f conf$$.exe; then
   3.209 +    # Don't use ln at all; we don't have any links
   3.210 +    as_ln_s='cp -p'
   3.211 +  else
   3.212 +    as_ln_s='ln -s'
   3.213 +  fi
   3.214 +elif ln conf$$.file conf$$ 2>/dev/null; then
   3.215 +  as_ln_s=ln
   3.216 +else
   3.217 +  as_ln_s='cp -p'
   3.218 +fi
   3.219 +rm -f conf$$ conf$$.exe conf$$.file
   3.220 +
   3.221 +if mkdir -p . 2>/dev/null; then
   3.222 +  as_mkdir_p=:
   3.223 +else
   3.224 +  as_mkdir_p=false
   3.225 +fi
   3.226 +
   3.227 +as_executable_p="test -f"
   3.228 +
   3.229 +# Sed expression to map a string onto a valid CPP name.
   3.230 +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
   3.231 +
   3.232 +# Sed expression to map a string onto a valid variable name.
   3.233 +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
   3.234 +
   3.235 +
   3.236 +# IFS
   3.237 +# We need space, tab and new line, in precisely that order.
   3.238 +as_nl='
   3.239 +'
   3.240 +IFS=" 	$as_nl"
   3.241 +
   3.242 +# CDPATH.
   3.243 +$as_unset CDPATH
   3.244 +
   3.245 +
   3.246 +# Name of the host.
   3.247 +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
   3.248 +# so uname gets run too.
   3.249 +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
   3.250 +
   3.251 +exec 6>&1
   3.252 +
   3.253 +#
   3.254 +# Initializations.
   3.255 +#
   3.256 +ac_default_prefix=/usr/local
   3.257 +ac_config_libobj_dir=.
   3.258 +cross_compiling=no
   3.259 +subdirs=
   3.260 +MFLAGS=
   3.261 +MAKEFLAGS=
   3.262 +SHELL=${CONFIG_SHELL-/bin/sh}
   3.263 +
   3.264 +# Maximum number of lines to put in a shell here document.
   3.265 +# This variable seems obsolete.  It should probably be removed, and
   3.266 +# only ac_max_sed_lines should be used.
   3.267 +: ${ac_max_here_lines=38}
   3.268 +
   3.269 +# Identity of this package.
   3.270 +PACKAGE_NAME=
   3.271 +PACKAGE_TARNAME=
   3.272 +PACKAGE_VERSION=
   3.273 +PACKAGE_STRING=
   3.274 +PACKAGE_BUGREPORT=
   3.275 +
   3.276 +ac_unique_file="server.c"
   3.277 +# Factoring default headers for most tests.
   3.278 +ac_includes_default="\
   3.279 +#include <stdio.h>
   3.280 +#if HAVE_SYS_TYPES_H
   3.281 +# include <sys/types.h>
   3.282 +#endif
   3.283 +#if HAVE_SYS_STAT_H
   3.284 +# include <sys/stat.h>
   3.285 +#endif
   3.286 +#if STDC_HEADERS
   3.287 +# include <stdlib.h>
   3.288 +# include <stddef.h>
   3.289 +#else
   3.290 +# if HAVE_STDLIB_H
   3.291 +#  include <stdlib.h>
   3.292 +# endif
   3.293 +#endif
   3.294 +#if HAVE_STRING_H
   3.295 +# if !STDC_HEADERS && HAVE_MEMORY_H
   3.296 +#  include <memory.h>
   3.297 +# endif
   3.298 +# include <string.h>
   3.299 +#endif
   3.300 +#if HAVE_STRINGS_H
   3.301 +# include <strings.h>
   3.302 +#endif
   3.303 +#if HAVE_INTTYPES_H
   3.304 +# include <inttypes.h>
   3.305 +#else
   3.306 +# if HAVE_STDINT_H
   3.307 +#  include <stdint.h>
   3.308 +# endif
   3.309 +#endif
   3.310 +#if HAVE_UNISTD_H
   3.311 +# include <unistd.h>
   3.312 +#endif"
   3.313 +
   3.314 +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP GDBSERVER_DEPFILES GDBSERVER_LIBS USE_THREAD_DB LIBOBJS LTLIBOBJS'
   3.315 +ac_subst_files=''
   3.316 +
   3.317 +# Initialize some variables set by options.
   3.318 +ac_init_help=
   3.319 +ac_init_version=false
   3.320 +# The variables have the same names as the options, with
   3.321 +# dashes changed to underlines.
   3.322 +cache_file=/dev/null
   3.323 +exec_prefix=NONE
   3.324 +no_create=
   3.325 +no_recursion=
   3.326 +prefix=NONE
   3.327 +program_prefix=NONE
   3.328 +program_suffix=NONE
   3.329 +program_transform_name=s,x,x,
   3.330 +silent=
   3.331 +site=
   3.332 +srcdir=
   3.333 +verbose=
   3.334 +x_includes=NONE
   3.335 +x_libraries=NONE
   3.336 +
   3.337 +# Installation directory options.
   3.338 +# These are left unexpanded so users can "make install exec_prefix=/foo"
   3.339 +# and all the variables that are supposed to be based on exec_prefix
   3.340 +# by default will actually change.
   3.341 +# Use braces instead of parens because sh, perl, etc. also accept them.
   3.342 +bindir='${exec_prefix}/bin'
   3.343 +sbindir='${exec_prefix}/sbin'
   3.344 +libexecdir='${exec_prefix}/libexec'
   3.345 +datadir='${prefix}/share'
   3.346 +sysconfdir='${prefix}/etc'
   3.347 +sharedstatedir='${prefix}/com'
   3.348 +localstatedir='${prefix}/var'
   3.349 +libdir='${exec_prefix}/lib'
   3.350 +includedir='${prefix}/include'
   3.351 +oldincludedir='/usr/include'
   3.352 +infodir='${prefix}/info'
   3.353 +mandir='${prefix}/man'
   3.354 +
   3.355 +ac_prev=
   3.356 +for ac_option
   3.357 +do
   3.358 +  # If the previous option needs an argument, assign it.
   3.359 +  if test -n "$ac_prev"; then
   3.360 +    eval "$ac_prev=\$ac_option"
   3.361 +    ac_prev=
   3.362 +    continue
   3.363 +  fi
   3.364 +
   3.365 +  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
   3.366 +
   3.367 +  # Accept the important Cygnus configure options, so we can diagnose typos.
   3.368 +
   3.369 +  case $ac_option in
   3.370 +
   3.371 +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
   3.372 +    ac_prev=bindir ;;
   3.373 +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
   3.374 +    bindir=$ac_optarg ;;
   3.375 +
   3.376 +  -build | --build | --buil | --bui | --bu)
   3.377 +    ac_prev=build_alias ;;
   3.378 +  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
   3.379 +    build_alias=$ac_optarg ;;
   3.380 +
   3.381 +  -cache-file | --cache-file | --cache-fil | --cache-fi \
   3.382 +  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
   3.383 +    ac_prev=cache_file ;;
   3.384 +  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   3.385 +  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
   3.386 +    cache_file=$ac_optarg ;;
   3.387 +
   3.388 +  --config-cache | -C)
   3.389 +    cache_file=config.cache ;;
   3.390 +
   3.391 +  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
   3.392 +    ac_prev=datadir ;;
   3.393 +  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   3.394 +  | --da=*)
   3.395 +    datadir=$ac_optarg ;;
   3.396 +
   3.397 +  -disable-* | --disable-*)
   3.398 +    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
   3.399 +    # Reject names that are not valid shell variable names.
   3.400 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   3.401 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   3.402 +   { (exit 1); exit 1; }; }
   3.403 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
   3.404 +    eval "enable_$ac_feature=no" ;;
   3.405 +
   3.406 +  -enable-* | --enable-*)
   3.407 +    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
   3.408 +    # Reject names that are not valid shell variable names.
   3.409 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   3.410 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   3.411 +   { (exit 1); exit 1; }; }
   3.412 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
   3.413 +    case $ac_option in
   3.414 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
   3.415 +      *) ac_optarg=yes ;;
   3.416 +    esac
   3.417 +    eval "enable_$ac_feature='$ac_optarg'" ;;
   3.418 +
   3.419 +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   3.420 +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
   3.421 +  | --exec | --exe | --ex)
   3.422 +    ac_prev=exec_prefix ;;
   3.423 +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   3.424 +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   3.425 +  | --exec=* | --exe=* | --ex=*)
   3.426 +    exec_prefix=$ac_optarg ;;
   3.427 +
   3.428 +  -gas | --gas | --ga | --g)
   3.429 +    # Obsolete; use --with-gas.
   3.430 +    with_gas=yes ;;
   3.431 +
   3.432 +  -help | --help | --hel | --he | -h)
   3.433 +    ac_init_help=long ;;
   3.434 +  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
   3.435 +    ac_init_help=recursive ;;
   3.436 +  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
   3.437 +    ac_init_help=short ;;
   3.438 +
   3.439 +  -host | --host | --hos | --ho)
   3.440 +    ac_prev=host_alias ;;
   3.441 +  -host=* | --host=* | --hos=* | --ho=*)
   3.442 +    host_alias=$ac_optarg ;;
   3.443 +
   3.444 +  -includedir | --includedir | --includedi | --included | --include \
   3.445 +  | --includ | --inclu | --incl | --inc)
   3.446 +    ac_prev=includedir ;;
   3.447 +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   3.448 +  | --includ=* | --inclu=* | --incl=* | --inc=*)
   3.449 +    includedir=$ac_optarg ;;
   3.450 +
   3.451 +  -infodir | --infodir | --infodi | --infod | --info | --inf)
   3.452 +    ac_prev=infodir ;;
   3.453 +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
   3.454 +    infodir=$ac_optarg ;;
   3.455 +
   3.456 +  -libdir | --libdir | --libdi | --libd)
   3.457 +    ac_prev=libdir ;;
   3.458 +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
   3.459 +    libdir=$ac_optarg ;;
   3.460 +
   3.461 +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   3.462 +  | --libexe | --libex | --libe)
   3.463 +    ac_prev=libexecdir ;;
   3.464 +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   3.465 +  | --libexe=* | --libex=* | --libe=*)
   3.466 +    libexecdir=$ac_optarg ;;
   3.467 +
   3.468 +  -localstatedir | --localstatedir | --localstatedi | --localstated \
   3.469 +  | --localstate | --localstat | --localsta | --localst \
   3.470 +  | --locals | --local | --loca | --loc | --lo)
   3.471 +    ac_prev=localstatedir ;;
   3.472 +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   3.473 +  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   3.474 +  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
   3.475 +    localstatedir=$ac_optarg ;;
   3.476 +
   3.477 +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
   3.478 +    ac_prev=mandir ;;
   3.479 +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
   3.480 +    mandir=$ac_optarg ;;
   3.481 +
   3.482 +  -nfp | --nfp | --nf)
   3.483 +    # Obsolete; use --without-fp.
   3.484 +    with_fp=no ;;
   3.485 +
   3.486 +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
   3.487 +  | --no-cr | --no-c | -n)
   3.488 +    no_create=yes ;;
   3.489 +
   3.490 +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
   3.491 +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
   3.492 +    no_recursion=yes ;;
   3.493 +
   3.494 +  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
   3.495 +  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
   3.496 +  | --oldin | --oldi | --old | --ol | --o)
   3.497 +    ac_prev=oldincludedir ;;
   3.498 +  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   3.499 +  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   3.500 +  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
   3.501 +    oldincludedir=$ac_optarg ;;
   3.502 +
   3.503 +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
   3.504 +    ac_prev=prefix ;;
   3.505 +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
   3.506 +    prefix=$ac_optarg ;;
   3.507 +
   3.508 +  -program-prefix | --program-prefix | --program-prefi | --program-pref \
   3.509 +  | --program-pre | --program-pr | --program-p)
   3.510 +    ac_prev=program_prefix ;;
   3.511 +  -program-prefix=* | --program-prefix=* | --program-prefi=* \
   3.512 +  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
   3.513 +    program_prefix=$ac_optarg ;;
   3.514 +
   3.515 +  -program-suffix | --program-suffix | --program-suffi | --program-suff \
   3.516 +  | --program-suf | --program-su | --program-s)
   3.517 +    ac_prev=program_suffix ;;
   3.518 +  -program-suffix=* | --program-suffix=* | --program-suffi=* \
   3.519 +  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
   3.520 +    program_suffix=$ac_optarg ;;
   3.521 +
   3.522 +  -program-transform-name | --program-transform-name \
   3.523 +  | --program-transform-nam | --program-transform-na \
   3.524 +  | --program-transform-n | --program-transform- \
   3.525 +  | --program-transform | --program-transfor \
   3.526 +  | --program-transfo | --program-transf \
   3.527 +  | --program-trans | --program-tran \
   3.528 +  | --progr-tra | --program-tr | --program-t)
   3.529 +    ac_prev=program_transform_name ;;
   3.530 +  -program-transform-name=* | --program-transform-name=* \
   3.531 +  | --program-transform-nam=* | --program-transform-na=* \
   3.532 +  | --program-transform-n=* | --program-transform-=* \
   3.533 +  | --program-transform=* | --program-transfor=* \
   3.534 +  | --program-transfo=* | --program-transf=* \
   3.535 +  | --program-trans=* | --program-tran=* \
   3.536 +  | --progr-tra=* | --program-tr=* | --program-t=*)
   3.537 +    program_transform_name=$ac_optarg ;;
   3.538 +
   3.539 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   3.540 +  | -silent | --silent | --silen | --sile | --sil)
   3.541 +    silent=yes ;;
   3.542 +
   3.543 +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
   3.544 +    ac_prev=sbindir ;;
   3.545 +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   3.546 +  | --sbi=* | --sb=*)
   3.547 +    sbindir=$ac_optarg ;;
   3.548 +
   3.549 +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
   3.550 +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
   3.551 +  | --sharedst | --shareds | --shared | --share | --shar \
   3.552 +  | --sha | --sh)
   3.553 +    ac_prev=sharedstatedir ;;
   3.554 +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
   3.555 +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   3.556 +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   3.557 +  | --sha=* | --sh=*)
   3.558 +    sharedstatedir=$ac_optarg ;;
   3.559 +
   3.560 +  -site | --site | --sit)
   3.561 +    ac_prev=site ;;
   3.562 +  -site=* | --site=* | --sit=*)
   3.563 +    site=$ac_optarg ;;
   3.564 +
   3.565 +  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
   3.566 +    ac_prev=srcdir ;;
   3.567 +  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
   3.568 +    srcdir=$ac_optarg ;;
   3.569 +
   3.570 +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   3.571 +  | --syscon | --sysco | --sysc | --sys | --sy)
   3.572 +    ac_prev=sysconfdir ;;
   3.573 +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   3.574 +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
   3.575 +    sysconfdir=$ac_optarg ;;
   3.576 +
   3.577 +  -target | --target | --targe | --targ | --tar | --ta | --t)
   3.578 +    ac_prev=target_alias ;;
   3.579 +  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
   3.580 +    target_alias=$ac_optarg ;;
   3.581 +
   3.582 +  -v | -verbose | --verbose | --verbos | --verbo | --verb)
   3.583 +    verbose=yes ;;
   3.584 +
   3.585 +  -version | --version | --versio | --versi | --vers | -V)
   3.586 +    ac_init_version=: ;;
   3.587 +
   3.588 +  -with-* | --with-*)
   3.589 +    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
   3.590 +    # Reject names that are not valid shell variable names.
   3.591 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   3.592 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
   3.593 +   { (exit 1); exit 1; }; }
   3.594 +    ac_package=`echo $ac_package| sed 's/-/_/g'`
   3.595 +    case $ac_option in
   3.596 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
   3.597 +      *) ac_optarg=yes ;;
   3.598 +    esac
   3.599 +    eval "with_$ac_package='$ac_optarg'" ;;
   3.600 +
   3.601 +  -without-* | --without-*)
   3.602 +    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
   3.603 +    # Reject names that are not valid shell variable names.
   3.604 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   3.605 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
   3.606 +   { (exit 1); exit 1; }; }
   3.607 +    ac_package=`echo $ac_package | sed 's/-/_/g'`
   3.608 +    eval "with_$ac_package=no" ;;
   3.609 +
   3.610 +  --x)
   3.611 +    # Obsolete; use --with-x.
   3.612 +    with_x=yes ;;
   3.613 +
   3.614 +  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
   3.615 +  | --x-incl | --x-inc | --x-in | --x-i)
   3.616 +    ac_prev=x_includes ;;
   3.617 +  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   3.618 +  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
   3.619 +    x_includes=$ac_optarg ;;
   3.620 +
   3.621 +  -x-libraries | --x-libraries | --x-librarie | --x-librari \
   3.622 +  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
   3.623 +    ac_prev=x_libraries ;;
   3.624 +  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   3.625 +  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
   3.626 +    x_libraries=$ac_optarg ;;
   3.627 +
   3.628 +  -*) { echo "$as_me: error: unrecognized option: $ac_option
   3.629 +Try \`$0 --help' for more information." >&2
   3.630 +   { (exit 1); exit 1; }; }
   3.631 +    ;;
   3.632 +
   3.633 +  *=*)
   3.634 +    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
   3.635 +    # Reject names that are not valid shell variable names.
   3.636 +    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
   3.637 +      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
   3.638 +   { (exit 1); exit 1; }; }
   3.639 +    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
   3.640 +    eval "$ac_envvar='$ac_optarg'"
   3.641 +    export $ac_envvar ;;
   3.642 +
   3.643 +  *)
   3.644 +    # FIXME: should be removed in autoconf 3.0.
   3.645 +    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
   3.646 +    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
   3.647 +      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
   3.648 +    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
   3.649 +    ;;
   3.650 +
   3.651 +  esac
   3.652 +done
   3.653 +
   3.654 +if test -n "$ac_prev"; then
   3.655 +  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
   3.656 +  { echo "$as_me: error: missing argument to $ac_option" >&2
   3.657 +   { (exit 1); exit 1; }; }
   3.658 +fi
   3.659 +
   3.660 +# Be sure to have absolute paths.
   3.661 +for ac_var in exec_prefix prefix
   3.662 +do
   3.663 +  eval ac_val=$`echo $ac_var`
   3.664 +  case $ac_val in
   3.665 +    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
   3.666 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   3.667 +   { (exit 1); exit 1; }; };;
   3.668 +  esac
   3.669 +done
   3.670 +
   3.671 +# Be sure to have absolute paths.
   3.672 +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
   3.673 +              localstatedir libdir includedir oldincludedir infodir mandir
   3.674 +do
   3.675 +  eval ac_val=$`echo $ac_var`
   3.676 +  case $ac_val in
   3.677 +    [\\/$]* | ?:[\\/]* ) ;;
   3.678 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   3.679 +   { (exit 1); exit 1; }; };;
   3.680 +  esac
   3.681 +done
   3.682 +
   3.683 +# There might be people who depend on the old broken behavior: `$host'
   3.684 +# used to hold the argument of --host etc.
   3.685 +# FIXME: To remove some day.
   3.686 +build=$build_alias
   3.687 +host=$host_alias
   3.688 +target=$target_alias
   3.689 +
   3.690 +# FIXME: To remove some day.
   3.691 +if test "x$host_alias" != x; then
   3.692 +  if test "x$build_alias" = x; then
   3.693 +    cross_compiling=maybe
   3.694 +    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
   3.695 +    If a cross compiler is detected then cross compile mode will be used." >&2
   3.696 +  elif test "x$build_alias" != "x$host_alias"; then
   3.697 +    cross_compiling=yes
   3.698 +  fi
   3.699 +fi
   3.700 +
   3.701 +ac_tool_prefix=
   3.702 +test -n "$host_alias" && ac_tool_prefix=$host_alias-
   3.703 +
   3.704 +test "$silent" = yes && exec 6>/dev/null
   3.705 +
   3.706 +
   3.707 +# Find the source files, if location was not specified.
   3.708 +if test -z "$srcdir"; then
   3.709 +  ac_srcdir_defaulted=yes
   3.710 +  # Try the directory containing this script, then its parent.
   3.711 +  ac_confdir=`(dirname "$0") 2>/dev/null ||
   3.712 +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   3.713 +         X"$0" : 'X\(//\)[^/]' \| \
   3.714 +         X"$0" : 'X\(//\)$' \| \
   3.715 +         X"$0" : 'X\(/\)' \| \
   3.716 +         .     : '\(.\)' 2>/dev/null ||
   3.717 +echo X"$0" |
   3.718 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   3.719 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   3.720 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
   3.721 +  	  /^X\(\/\).*/{ s//\1/; q; }
   3.722 +  	  s/.*/./; q'`
   3.723 +  srcdir=$ac_confdir
   3.724 +  if test ! -r $srcdir/$ac_unique_file; then
   3.725 +    srcdir=..
   3.726 +  fi
   3.727 +else
   3.728 +  ac_srcdir_defaulted=no
   3.729 +fi
   3.730 +if test ! -r $srcdir/$ac_unique_file; then
   3.731 +  if test "$ac_srcdir_defaulted" = yes; then
   3.732 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
   3.733 +   { (exit 1); exit 1; }; }
   3.734 +  else
   3.735 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
   3.736 +   { (exit 1); exit 1; }; }
   3.737 +  fi
   3.738 +fi
   3.739 +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
   3.740 +  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
   3.741 +   { (exit 1); exit 1; }; }
   3.742 +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
   3.743 +ac_env_build_alias_set=${build_alias+set}
   3.744 +ac_env_build_alias_value=$build_alias
   3.745 +ac_cv_env_build_alias_set=${build_alias+set}
   3.746 +ac_cv_env_build_alias_value=$build_alias
   3.747 +ac_env_host_alias_set=${host_alias+set}
   3.748 +ac_env_host_alias_value=$host_alias
   3.749 +ac_cv_env_host_alias_set=${host_alias+set}
   3.750 +ac_cv_env_host_alias_value=$host_alias
   3.751 +ac_env_target_alias_set=${target_alias+set}
   3.752 +ac_env_target_alias_value=$target_alias
   3.753 +ac_cv_env_target_alias_set=${target_alias+set}
   3.754 +ac_cv_env_target_alias_value=$target_alias
   3.755 +ac_env_CC_set=${CC+set}
   3.756 +ac_env_CC_value=$CC
   3.757 +ac_cv_env_CC_set=${CC+set}
   3.758 +ac_cv_env_CC_value=$CC
   3.759 +ac_env_CFLAGS_set=${CFLAGS+set}
   3.760 +ac_env_CFLAGS_value=$CFLAGS
   3.761 +ac_cv_env_CFLAGS_set=${CFLAGS+set}
   3.762 +ac_cv_env_CFLAGS_value=$CFLAGS
   3.763 +ac_env_LDFLAGS_set=${LDFLAGS+set}
   3.764 +ac_env_LDFLAGS_value=$LDFLAGS
   3.765 +ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
   3.766 +ac_cv_env_LDFLAGS_value=$LDFLAGS
   3.767 +ac_env_CPPFLAGS_set=${CPPFLAGS+set}
   3.768 +ac_env_CPPFLAGS_value=$CPPFLAGS
   3.769 +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
   3.770 +ac_cv_env_CPPFLAGS_value=$CPPFLAGS
   3.771 +ac_env_CPP_set=${CPP+set}
   3.772 +ac_env_CPP_value=$CPP
   3.773 +ac_cv_env_CPP_set=${CPP+set}
   3.774 +ac_cv_env_CPP_value=$CPP
   3.775 +
   3.776 +#
   3.777 +# Report the --help message.
   3.778 +#
   3.779 +if test "$ac_init_help" = "long"; then
   3.780 +  # Omit some internal or obsolete options to make the list less imposing.
   3.781 +  # This message is too long to be a string in the A/UX 3.1 sh.
   3.782 +  cat <<_ACEOF
   3.783 +\`configure' configures this package to adapt to many kinds of systems.
   3.784 +
   3.785 +Usage: $0 [OPTION]... [VAR=VALUE]...
   3.786 +
   3.787 +To assign environment variables (e.g., CC, CFLAGS...), specify them as
   3.788 +VAR=VALUE.  See below for descriptions of some of the useful variables.
   3.789 +
   3.790 +Defaults for the options are specified in brackets.
   3.791 +
   3.792 +Configuration:
   3.793 +  -h, --help              display this help and exit
   3.794 +      --help=short        display options specific to this package
   3.795 +      --help=recursive    display the short help of all the included packages
   3.796 +  -V, --version           display version information and exit
   3.797 +  -q, --quiet, --silent   do not print \`checking...' messages
   3.798 +      --cache-file=FILE   cache test results in FILE [disabled]
   3.799 +  -C, --config-cache      alias for \`--cache-file=config.cache'
   3.800 +  -n, --no-create         do not create output files
   3.801 +      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
   3.802 +
   3.803 +_ACEOF
   3.804 +
   3.805 +  cat <<_ACEOF
   3.806 +Installation directories:
   3.807 +  --prefix=PREFIX         install architecture-independent files in PREFIX
   3.808 +                          [$ac_default_prefix]
   3.809 +  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
   3.810 +                          [PREFIX]
   3.811 +
   3.812 +By default, \`make install' will install all the files in
   3.813 +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
   3.814 +an installation prefix other than \`$ac_default_prefix' using \`--prefix',
   3.815 +for instance \`--prefix=\$HOME'.
   3.816 +
   3.817 +For better control, use the options below.
   3.818 +
   3.819 +Fine tuning of the installation directories:
   3.820 +  --bindir=DIR           user executables [EPREFIX/bin]
   3.821 +  --sbindir=DIR          system admin executables [EPREFIX/sbin]
   3.822 +  --libexecdir=DIR       program executables [EPREFIX/libexec]
   3.823 +  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   3.824 +  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   3.825 +  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   3.826 +  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   3.827 +  --libdir=DIR           object code libraries [EPREFIX/lib]
   3.828 +  --includedir=DIR       C header files [PREFIX/include]
   3.829 +  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   3.830 +  --infodir=DIR          info documentation [PREFIX/info]
   3.831 +  --mandir=DIR           man documentation [PREFIX/man]
   3.832 +_ACEOF
   3.833 +
   3.834 +  cat <<\_ACEOF
   3.835 +
   3.836 +System types:
   3.837 +  --build=BUILD     configure for building on BUILD [guessed]
   3.838 +  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
   3.839 +  --target=TARGET   configure for building compilers for TARGET [HOST]
   3.840 +_ACEOF
   3.841 +fi
   3.842 +
   3.843 +if test -n "$ac_init_help"; then
   3.844 +
   3.845 +  cat <<\_ACEOF
   3.846 +
   3.847 +Some influential environment variables:
   3.848 +  CC          C compiler command
   3.849 +  CFLAGS      C compiler flags
   3.850 +  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
   3.851 +              nonstandard directory <lib dir>
   3.852 +  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
   3.853 +              headers in a nonstandard directory <include dir>
   3.854 +  CPP         C preprocessor
   3.855 +
   3.856 +Use these variables to override the choices made by `configure' or to help
   3.857 +it to find libraries and programs with nonstandard names/locations.
   3.858 +
   3.859 +_ACEOF
   3.860 +fi
   3.861 +
   3.862 +if test "$ac_init_help" = "recursive"; then
   3.863 +  # If there are subdirs, report their specific --help.
   3.864 +  ac_popdir=`pwd`
   3.865 +  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
   3.866 +    test -d $ac_dir || continue
   3.867 +    ac_builddir=.
   3.868 +
   3.869 +if test "$ac_dir" != .; then
   3.870 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
   3.871 +  # A "../" for each directory in $ac_dir_suffix.
   3.872 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
   3.873 +else
   3.874 +  ac_dir_suffix= ac_top_builddir=
   3.875 +fi
   3.876 +
   3.877 +case $srcdir in
   3.878 +  .)  # No --srcdir option.  We are building in place.
   3.879 +    ac_srcdir=.
   3.880 +    if test -z "$ac_top_builddir"; then
   3.881 +       ac_top_srcdir=.
   3.882 +    else
   3.883 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
   3.884 +    fi ;;
   3.885 +  [\\/]* | ?:[\\/]* )  # Absolute path.
   3.886 +    ac_srcdir=$srcdir$ac_dir_suffix;
   3.887 +    ac_top_srcdir=$srcdir ;;
   3.888 +  *) # Relative path.
   3.889 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
   3.890 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
   3.891 +esac
   3.892 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
   3.893 +# absolute.
   3.894 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
   3.895 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
   3.896 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
   3.897 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
   3.898 +
   3.899 +    cd $ac_dir
   3.900 +    # Check for guested configure; otherwise get Cygnus style configure.
   3.901 +    if test -f $ac_srcdir/configure.gnu; then
   3.902 +      echo
   3.903 +      $SHELL $ac_srcdir/configure.gnu  --help=recursive
   3.904 +    elif test -f $ac_srcdir/configure; then
   3.905 +      echo
   3.906 +      $SHELL $ac_srcdir/configure  --help=recursive
   3.907 +    elif test -f $ac_srcdir/configure.ac ||
   3.908 +           test -f $ac_srcdir/configure.in; then
   3.909 +      echo
   3.910 +      $ac_configure --help
   3.911 +    else
   3.912 +      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
   3.913 +    fi
   3.914 +    cd $ac_popdir
   3.915 +  done
   3.916 +fi
   3.917 +
   3.918 +test -n "$ac_init_help" && exit 0
   3.919 +if $ac_init_version; then
   3.920 +  cat <<\_ACEOF
   3.921 +
   3.922 +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
   3.923 +Free Software Foundation, Inc.
   3.924 +This configure script is free software; the Free Software Foundation
   3.925 +gives unlimited permission to copy, distribute and modify it.
   3.926 +_ACEOF
   3.927 +  exit 0
   3.928 +fi
   3.929 +exec 5>config.log
   3.930 +cat >&5 <<_ACEOF
   3.931 +This file contains any messages produced by compilers while
   3.932 +running configure, to aid debugging if configure makes a mistake.
   3.933 +
   3.934 +It was created by $as_me, which was
   3.935 +generated by GNU Autoconf 2.57.  Invocation command line was
   3.936 +
   3.937 +  $ $0 $@
   3.938 +
   3.939 +_ACEOF
   3.940 +{
   3.941 +cat <<_ASUNAME
   3.942 +## --------- ##
   3.943 +## Platform. ##
   3.944 +## --------- ##
   3.945 +
   3.946 +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
   3.947 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
   3.948 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
   3.949 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
   3.950 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
   3.951 +
   3.952 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
   3.953 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
   3.954 +
   3.955 +/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
   3.956 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
   3.957 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
   3.958 +hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
   3.959 +/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
   3.960 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
   3.961 +/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
   3.962 +
   3.963 +_ASUNAME
   3.964 +
   3.965 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   3.966 +for as_dir in $PATH
   3.967 +do
   3.968 +  IFS=$as_save_IFS
   3.969 +  test -z "$as_dir" && as_dir=.
   3.970 +  echo "PATH: $as_dir"
   3.971 +done
   3.972 +
   3.973 +} >&5
   3.974 +
   3.975 +cat >&5 <<_ACEOF
   3.976 +
   3.977 +
   3.978 +## ----------- ##
   3.979 +## Core tests. ##
   3.980 +## ----------- ##
   3.981 +
   3.982 +_ACEOF
   3.983 +
   3.984 +
   3.985 +# Keep a trace of the command line.
   3.986 +# Strip out --no-create and --no-recursion so they do not pile up.
   3.987 +# Strip out --silent because we don't want to record it for future runs.
   3.988 +# Also quote any args containing shell meta-characters.
   3.989 +# Make two passes to allow for proper duplicate-argument suppression.
   3.990 +ac_configure_args=
   3.991 +ac_configure_args0=
   3.992 +ac_configure_args1=
   3.993 +ac_sep=
   3.994 +ac_must_keep_next=false
   3.995 +for ac_pass in 1 2
   3.996 +do
   3.997 +  for ac_arg
   3.998 +  do
   3.999 +    case $ac_arg in
  3.1000 +    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
  3.1001 +    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  3.1002 +    | -silent | --silent | --silen | --sile | --sil)
  3.1003 +      continue ;;
  3.1004 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
  3.1005 +      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  3.1006 +    esac
  3.1007 +    case $ac_pass in
  3.1008 +    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
  3.1009 +    2)
  3.1010 +      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
  3.1011 +      if test $ac_must_keep_next = true; then
  3.1012 +        ac_must_keep_next=false # Got value, back to normal.
  3.1013 +      else
  3.1014 +        case $ac_arg in
  3.1015 +          *=* | --config-cache | -C | -disable-* | --disable-* \
  3.1016 +          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
  3.1017 +          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
  3.1018 +          | -with-* | --with-* | -without-* | --without-* | --x)
  3.1019 +            case "$ac_configure_args0 " in
  3.1020 +              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
  3.1021 +            esac
  3.1022 +            ;;
  3.1023 +          -* ) ac_must_keep_next=true ;;
  3.1024 +        esac
  3.1025 +      fi
  3.1026 +      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
  3.1027 +      # Get rid of the leading space.
  3.1028 +      ac_sep=" "
  3.1029 +      ;;
  3.1030 +    esac
  3.1031 +  done
  3.1032 +done
  3.1033 +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
  3.1034 +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
  3.1035 +
  3.1036 +# When interrupted or exit'd, cleanup temporary files, and complete
  3.1037 +# config.log.  We remove comments because anyway the quotes in there
  3.1038 +# would cause problems or look ugly.
  3.1039 +# WARNING: Be sure not to use single quotes in there, as some shells,
  3.1040 +# such as our DU 5.0 friend, will then `close' the trap.
  3.1041 +trap 'exit_status=$?
  3.1042 +  # Save into config.log some information that might help in debugging.
  3.1043 +  {
  3.1044 +    echo
  3.1045 +
  3.1046 +    cat <<\_ASBOX
  3.1047 +## ---------------- ##
  3.1048 +## Cache variables. ##
  3.1049 +## ---------------- ##
  3.1050 +_ASBOX
  3.1051 +    echo
  3.1052 +    # The following way of writing the cache mishandles newlines in values,
  3.1053 +{
  3.1054 +  (set) 2>&1 |
  3.1055 +    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
  3.1056 +    *ac_space=\ *)
  3.1057 +      sed -n \
  3.1058 +        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
  3.1059 +    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
  3.1060 +      ;;
  3.1061 +    *)
  3.1062 +      sed -n \
  3.1063 +        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
  3.1064 +      ;;
  3.1065 +    esac;
  3.1066 +}
  3.1067 +    echo
  3.1068 +
  3.1069 +    cat <<\_ASBOX
  3.1070 +## ----------------- ##
  3.1071 +## Output variables. ##
  3.1072 +## ----------------- ##
  3.1073 +_ASBOX
  3.1074 +    echo
  3.1075 +    for ac_var in $ac_subst_vars
  3.1076 +    do
  3.1077 +      eval ac_val=$`echo $ac_var`
  3.1078 +      echo "$ac_var='"'"'$ac_val'"'"'"
  3.1079 +    done | sort
  3.1080 +    echo
  3.1081 +
  3.1082 +    if test -n "$ac_subst_files"; then
  3.1083 +      cat <<\_ASBOX
  3.1084 +## ------------- ##
  3.1085 +## Output files. ##
  3.1086 +## ------------- ##
  3.1087 +_ASBOX
  3.1088 +      echo
  3.1089 +      for ac_var in $ac_subst_files
  3.1090 +      do
  3.1091 +	eval ac_val=$`echo $ac_var`
  3.1092 +        echo "$ac_var='"'"'$ac_val'"'"'"
  3.1093 +      done | sort
  3.1094 +      echo
  3.1095 +    fi
  3.1096 +
  3.1097 +    if test -s confdefs.h; then
  3.1098 +      cat <<\_ASBOX
  3.1099 +## ----------- ##
  3.1100 +## confdefs.h. ##
  3.1101 +## ----------- ##
  3.1102 +_ASBOX
  3.1103 +      echo
  3.1104 +      sed "/^$/d" confdefs.h | sort
  3.1105 +      echo
  3.1106 +    fi
  3.1107 +    test "$ac_signal" != 0 &&
  3.1108 +      echo "$as_me: caught signal $ac_signal"
  3.1109 +    echo "$as_me: exit $exit_status"
  3.1110 +  } >&5
  3.1111 +  rm -f core core.* *.core &&
  3.1112 +  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
  3.1113 +    exit $exit_status
  3.1114 +     ' 0
  3.1115 +for ac_signal in 1 2 13 15; do
  3.1116 +  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
  3.1117 +done
  3.1118 +ac_signal=0
  3.1119 +
  3.1120 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
  3.1121 +rm -rf conftest* confdefs.h
  3.1122 +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
  3.1123 +echo >confdefs.h
  3.1124 +
  3.1125 +# Predefined preprocessor variables.
  3.1126 +
  3.1127 +cat >>confdefs.h <<_ACEOF
  3.1128 +#define PACKAGE_NAME "$PACKAGE_NAME"
  3.1129 +_ACEOF
  3.1130 +
  3.1131 +
  3.1132 +cat >>confdefs.h <<_ACEOF
  3.1133 +#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
  3.1134 +_ACEOF
  3.1135 +
  3.1136 +
  3.1137 +cat >>confdefs.h <<_ACEOF
  3.1138 +#define PACKAGE_VERSION "$PACKAGE_VERSION"
  3.1139 +_ACEOF
  3.1140 +
  3.1141 +
  3.1142 +cat >>confdefs.h <<_ACEOF
  3.1143 +#define PACKAGE_STRING "$PACKAGE_STRING"
  3.1144 +_ACEOF
  3.1145 +
  3.1146 +
  3.1147 +cat >>confdefs.h <<_ACEOF
  3.1148 +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
  3.1149 +_ACEOF
  3.1150 +
  3.1151 +
  3.1152 +# Let the site file select an alternate cache file if it wants to.
  3.1153 +# Prefer explicitly selected file to automatically selected ones.
  3.1154 +if test -z "$CONFIG_SITE"; then
  3.1155 +  if test "x$prefix" != xNONE; then
  3.1156 +    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  3.1157 +  else
  3.1158 +    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  3.1159 +  fi
  3.1160 +fi
  3.1161 +for ac_site_file in $CONFIG_SITE; do
  3.1162 +  if test -r "$ac_site_file"; then
  3.1163 +    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
  3.1164 +echo "$as_me: loading site script $ac_site_file" >&6;}
  3.1165 +    sed 's/^/| /' "$ac_site_file" >&5
  3.1166 +    . "$ac_site_file"
  3.1167 +  fi
  3.1168 +done
  3.1169 +
  3.1170 +if test -r "$cache_file"; then
  3.1171 +  # Some versions of bash will fail to source /dev/null (special
  3.1172 +  # files actually), so we avoid doing that.
  3.1173 +  if test -f "$cache_file"; then
  3.1174 +    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
  3.1175 +echo "$as_me: loading cache $cache_file" >&6;}
  3.1176 +    case $cache_file in
  3.1177 +      [\\/]* | ?:[\\/]* ) . $cache_file;;
  3.1178 +      *)                      . ./$cache_file;;
  3.1179 +    esac
  3.1180 +  fi
  3.1181 +else
  3.1182 +  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
  3.1183 +echo "$as_me: creating cache $cache_file" >&6;}
  3.1184 +  >$cache_file
  3.1185 +fi
  3.1186 +
  3.1187 +# Check that the precious variables saved in the cache have kept the same
  3.1188 +# value.
  3.1189 +ac_cache_corrupted=false
  3.1190 +for ac_var in `(set) 2>&1 |
  3.1191 +               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
  3.1192 +  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  3.1193 +  eval ac_new_set=\$ac_env_${ac_var}_set
  3.1194 +  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
  3.1195 +  eval ac_new_val="\$ac_env_${ac_var}_value"
  3.1196 +  case $ac_old_set,$ac_new_set in
  3.1197 +    set,)
  3.1198 +      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
  3.1199 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
  3.1200 +      ac_cache_corrupted=: ;;
  3.1201 +    ,set)
  3.1202 +      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
  3.1203 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
  3.1204 +      ac_cache_corrupted=: ;;
  3.1205 +    ,);;
  3.1206 +    *)
  3.1207 +      if test "x$ac_old_val" != "x$ac_new_val"; then
  3.1208 +        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  3.1209 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  3.1210 +        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  3.1211 +echo "$as_me:   former value:  $ac_old_val" >&2;}
  3.1212 +        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
  3.1213 +echo "$as_me:   current value: $ac_new_val" >&2;}
  3.1214 +        ac_cache_corrupted=:
  3.1215 +      fi;;
  3.1216 +  esac
  3.1217 +  # Pass precious variables to config.status.
  3.1218 +  if test "$ac_new_set" = set; then
  3.1219 +    case $ac_new_val in
  3.1220 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
  3.1221 +      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
  3.1222 +    *) ac_arg=$ac_var=$ac_new_val ;;
  3.1223 +    esac
  3.1224 +    case " $ac_configure_args " in
  3.1225 +      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
  3.1226 +      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  3.1227 +    esac
  3.1228 +  fi
  3.1229 +done
  3.1230 +if $ac_cache_corrupted; then
  3.1231 +  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
  3.1232 +echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  3.1233 +  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
  3.1234 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
  3.1235 +   { (exit 1); exit 1; }; }
  3.1236 +fi
  3.1237 +
  3.1238 +ac_ext=c
  3.1239 +ac_cpp='$CPP $CPPFLAGS'
  3.1240 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  3.1241 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  3.1242 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  3.1243 +
  3.1244 +
  3.1245 +
  3.1246 +
  3.1247 +
  3.1248 +
  3.1249 +
  3.1250 +
  3.1251 +
  3.1252 +
  3.1253 +
  3.1254 +
  3.1255 +
  3.1256 +
  3.1257 +
  3.1258 +
  3.1259 +
  3.1260 +
  3.1261 +
  3.1262 +          ac_config_headers="$ac_config_headers config.h:config.in"
  3.1263 +
  3.1264 +
  3.1265 +ac_ext=c
  3.1266 +ac_cpp='$CPP $CPPFLAGS'
  3.1267 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  3.1268 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  3.1269 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  3.1270 +if test -n "$ac_tool_prefix"; then
  3.1271 +  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
  3.1272 +set dummy ${ac_tool_prefix}gcc; ac_word=$2
  3.1273 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1274 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1275 +if test "${ac_cv_prog_CC+set}" = set; then
  3.1276 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1277 +else
  3.1278 +  if test -n "$CC"; then
  3.1279 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  3.1280 +else
  3.1281 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1282 +for as_dir in $PATH
  3.1283 +do
  3.1284 +  IFS=$as_save_IFS
  3.1285 +  test -z "$as_dir" && as_dir=.
  3.1286 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1287 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1288 +    ac_cv_prog_CC="${ac_tool_prefix}gcc"
  3.1289 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1290 +    break 2
  3.1291 +  fi
  3.1292 +done
  3.1293 +done
  3.1294 +
  3.1295 +fi
  3.1296 +fi
  3.1297 +CC=$ac_cv_prog_CC
  3.1298 +if test -n "$CC"; then
  3.1299 +  echo "$as_me:$LINENO: result: $CC" >&5
  3.1300 +echo "${ECHO_T}$CC" >&6
  3.1301 +else
  3.1302 +  echo "$as_me:$LINENO: result: no" >&5
  3.1303 +echo "${ECHO_T}no" >&6
  3.1304 +fi
  3.1305 +
  3.1306 +fi
  3.1307 +if test -z "$ac_cv_prog_CC"; then
  3.1308 +  ac_ct_CC=$CC
  3.1309 +  # Extract the first word of "gcc", so it can be a program name with args.
  3.1310 +set dummy gcc; ac_word=$2
  3.1311 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1312 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1313 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  3.1314 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1315 +else
  3.1316 +  if test -n "$ac_ct_CC"; then
  3.1317 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  3.1318 +else
  3.1319 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1320 +for as_dir in $PATH
  3.1321 +do
  3.1322 +  IFS=$as_save_IFS
  3.1323 +  test -z "$as_dir" && as_dir=.
  3.1324 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1325 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1326 +    ac_cv_prog_ac_ct_CC="gcc"
  3.1327 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1328 +    break 2
  3.1329 +  fi
  3.1330 +done
  3.1331 +done
  3.1332 +
  3.1333 +fi
  3.1334 +fi
  3.1335 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  3.1336 +if test -n "$ac_ct_CC"; then
  3.1337 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  3.1338 +echo "${ECHO_T}$ac_ct_CC" >&6
  3.1339 +else
  3.1340 +  echo "$as_me:$LINENO: result: no" >&5
  3.1341 +echo "${ECHO_T}no" >&6
  3.1342 +fi
  3.1343 +
  3.1344 +  CC=$ac_ct_CC
  3.1345 +else
  3.1346 +  CC="$ac_cv_prog_CC"
  3.1347 +fi
  3.1348 +
  3.1349 +if test -z "$CC"; then
  3.1350 +  if test -n "$ac_tool_prefix"; then
  3.1351 +  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
  3.1352 +set dummy ${ac_tool_prefix}cc; ac_word=$2
  3.1353 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1354 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1355 +if test "${ac_cv_prog_CC+set}" = set; then
  3.1356 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1357 +else
  3.1358 +  if test -n "$CC"; then
  3.1359 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  3.1360 +else
  3.1361 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1362 +for as_dir in $PATH
  3.1363 +do
  3.1364 +  IFS=$as_save_IFS
  3.1365 +  test -z "$as_dir" && as_dir=.
  3.1366 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1367 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1368 +    ac_cv_prog_CC="${ac_tool_prefix}cc"
  3.1369 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1370 +    break 2
  3.1371 +  fi
  3.1372 +done
  3.1373 +done
  3.1374 +
  3.1375 +fi
  3.1376 +fi
  3.1377 +CC=$ac_cv_prog_CC
  3.1378 +if test -n "$CC"; then
  3.1379 +  echo "$as_me:$LINENO: result: $CC" >&5
  3.1380 +echo "${ECHO_T}$CC" >&6
  3.1381 +else
  3.1382 +  echo "$as_me:$LINENO: result: no" >&5
  3.1383 +echo "${ECHO_T}no" >&6
  3.1384 +fi
  3.1385 +
  3.1386 +fi
  3.1387 +if test -z "$ac_cv_prog_CC"; then
  3.1388 +  ac_ct_CC=$CC
  3.1389 +  # Extract the first word of "cc", so it can be a program name with args.
  3.1390 +set dummy cc; ac_word=$2
  3.1391 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1392 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1393 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  3.1394 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1395 +else
  3.1396 +  if test -n "$ac_ct_CC"; then
  3.1397 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  3.1398 +else
  3.1399 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1400 +for as_dir in $PATH
  3.1401 +do
  3.1402 +  IFS=$as_save_IFS
  3.1403 +  test -z "$as_dir" && as_dir=.
  3.1404 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1405 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1406 +    ac_cv_prog_ac_ct_CC="cc"
  3.1407 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1408 +    break 2
  3.1409 +  fi
  3.1410 +done
  3.1411 +done
  3.1412 +
  3.1413 +fi
  3.1414 +fi
  3.1415 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  3.1416 +if test -n "$ac_ct_CC"; then
  3.1417 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  3.1418 +echo "${ECHO_T}$ac_ct_CC" >&6
  3.1419 +else
  3.1420 +  echo "$as_me:$LINENO: result: no" >&5
  3.1421 +echo "${ECHO_T}no" >&6
  3.1422 +fi
  3.1423 +
  3.1424 +  CC=$ac_ct_CC
  3.1425 +else
  3.1426 +  CC="$ac_cv_prog_CC"
  3.1427 +fi
  3.1428 +
  3.1429 +fi
  3.1430 +if test -z "$CC"; then
  3.1431 +  # Extract the first word of "cc", so it can be a program name with args.
  3.1432 +set dummy cc; ac_word=$2
  3.1433 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1434 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1435 +if test "${ac_cv_prog_CC+set}" = set; then
  3.1436 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1437 +else
  3.1438 +  if test -n "$CC"; then
  3.1439 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  3.1440 +else
  3.1441 +  ac_prog_rejected=no
  3.1442 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1443 +for as_dir in $PATH
  3.1444 +do
  3.1445 +  IFS=$as_save_IFS
  3.1446 +  test -z "$as_dir" && as_dir=.
  3.1447 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1448 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1449 +    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
  3.1450 +       ac_prog_rejected=yes
  3.1451 +       continue
  3.1452 +     fi
  3.1453 +    ac_cv_prog_CC="cc"
  3.1454 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1455 +    break 2
  3.1456 +  fi
  3.1457 +done
  3.1458 +done
  3.1459 +
  3.1460 +if test $ac_prog_rejected = yes; then
  3.1461 +  # We found a bogon in the path, so make sure we never use it.
  3.1462 +  set dummy $ac_cv_prog_CC
  3.1463 +  shift
  3.1464 +  if test $# != 0; then
  3.1465 +    # We chose a different compiler from the bogus one.
  3.1466 +    # However, it has the same basename, so the bogon will be chosen
  3.1467 +    # first if we set CC to just the basename; use the full file name.
  3.1468 +    shift
  3.1469 +    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
  3.1470 +  fi
  3.1471 +fi
  3.1472 +fi
  3.1473 +fi
  3.1474 +CC=$ac_cv_prog_CC
  3.1475 +if test -n "$CC"; then
  3.1476 +  echo "$as_me:$LINENO: result: $CC" >&5
  3.1477 +echo "${ECHO_T}$CC" >&6
  3.1478 +else
  3.1479 +  echo "$as_me:$LINENO: result: no" >&5
  3.1480 +echo "${ECHO_T}no" >&6
  3.1481 +fi
  3.1482 +
  3.1483 +fi
  3.1484 +if test -z "$CC"; then
  3.1485 +  if test -n "$ac_tool_prefix"; then
  3.1486 +  for ac_prog in cl
  3.1487 +  do
  3.1488 +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
  3.1489 +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
  3.1490 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1491 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1492 +if test "${ac_cv_prog_CC+set}" = set; then
  3.1493 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1494 +else
  3.1495 +  if test -n "$CC"; then
  3.1496 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  3.1497 +else
  3.1498 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1499 +for as_dir in $PATH
  3.1500 +do
  3.1501 +  IFS=$as_save_IFS
  3.1502 +  test -z "$as_dir" && as_dir=.
  3.1503 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1504 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1505 +    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
  3.1506 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1507 +    break 2
  3.1508 +  fi
  3.1509 +done
  3.1510 +done
  3.1511 +
  3.1512 +fi
  3.1513 +fi
  3.1514 +CC=$ac_cv_prog_CC
  3.1515 +if test -n "$CC"; then
  3.1516 +  echo "$as_me:$LINENO: result: $CC" >&5
  3.1517 +echo "${ECHO_T}$CC" >&6
  3.1518 +else
  3.1519 +  echo "$as_me:$LINENO: result: no" >&5
  3.1520 +echo "${ECHO_T}no" >&6
  3.1521 +fi
  3.1522 +
  3.1523 +    test -n "$CC" && break
  3.1524 +  done
  3.1525 +fi
  3.1526 +if test -z "$CC"; then
  3.1527 +  ac_ct_CC=$CC
  3.1528 +  for ac_prog in cl
  3.1529 +do
  3.1530 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
  3.1531 +set dummy $ac_prog; ac_word=$2
  3.1532 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3.1533 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3.1534 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  3.1535 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1536 +else
  3.1537 +  if test -n "$ac_ct_CC"; then
  3.1538 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  3.1539 +else
  3.1540 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.1541 +for as_dir in $PATH
  3.1542 +do
  3.1543 +  IFS=$as_save_IFS
  3.1544 +  test -z "$as_dir" && as_dir=.
  3.1545 +  for ac_exec_ext in '' $ac_executable_extensions; do
  3.1546 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3.1547 +    ac_cv_prog_ac_ct_CC="$ac_prog"
  3.1548 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3.1549 +    break 2
  3.1550 +  fi
  3.1551 +done
  3.1552 +done
  3.1553 +
  3.1554 +fi
  3.1555 +fi
  3.1556 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  3.1557 +if test -n "$ac_ct_CC"; then
  3.1558 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  3.1559 +echo "${ECHO_T}$ac_ct_CC" >&6
  3.1560 +else
  3.1561 +  echo "$as_me:$LINENO: result: no" >&5
  3.1562 +echo "${ECHO_T}no" >&6
  3.1563 +fi
  3.1564 +
  3.1565 +  test -n "$ac_ct_CC" && break
  3.1566 +done
  3.1567 +
  3.1568 +  CC=$ac_ct_CC
  3.1569 +fi
  3.1570 +
  3.1571 +fi
  3.1572 +
  3.1573 +
  3.1574 +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
  3.1575 +See \`config.log' for more details." >&5
  3.1576 +echo "$as_me: error: no acceptable C compiler found in \$PATH
  3.1577 +See \`config.log' for more details." >&2;}
  3.1578 +   { (exit 1); exit 1; }; }
  3.1579 +
  3.1580 +# Provide some information about the compiler.
  3.1581 +echo "$as_me:$LINENO:" \
  3.1582 +     "checking for C compiler version" >&5
  3.1583 +ac_compiler=`set X $ac_compile; echo $2`
  3.1584 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  3.1585 +  (eval $ac_compiler --version </dev/null >&5) 2>&5
  3.1586 +  ac_status=$?
  3.1587 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1588 +  (exit $ac_status); }
  3.1589 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  3.1590 +  (eval $ac_compiler -v </dev/null >&5) 2>&5
  3.1591 +  ac_status=$?
  3.1592 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1593 +  (exit $ac_status); }
  3.1594 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  3.1595 +  (eval $ac_compiler -V </dev/null >&5) 2>&5
  3.1596 +  ac_status=$?
  3.1597 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1598 +  (exit $ac_status); }
  3.1599 +
  3.1600 +cat >conftest.$ac_ext <<_ACEOF
  3.1601 +#line $LINENO "configure"
  3.1602 +/* confdefs.h.  */
  3.1603 +_ACEOF
  3.1604 +cat confdefs.h >>conftest.$ac_ext
  3.1605 +cat >>conftest.$ac_ext <<_ACEOF
  3.1606 +/* end confdefs.h.  */
  3.1607 +
  3.1608 +int
  3.1609 +main ()
  3.1610 +{
  3.1611 +
  3.1612 +  ;
  3.1613 +  return 0;
  3.1614 +}
  3.1615 +_ACEOF
  3.1616 +ac_clean_files_save=$ac_clean_files
  3.1617 +ac_clean_files="$ac_clean_files a.out a.exe b.out"
  3.1618 +# Try to create an executable without -o first, disregard a.out.
  3.1619 +# It will help us diagnose broken compilers, and finding out an intuition
  3.1620 +# of exeext.
  3.1621 +echo "$as_me:$LINENO: checking for C compiler default output" >&5
  3.1622 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
  3.1623 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
  3.1624 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
  3.1625 +  (eval $ac_link_default) 2>&5
  3.1626 +  ac_status=$?
  3.1627 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1628 +  (exit $ac_status); }; then
  3.1629 +  # Find the output, starting from the most likely.  This scheme is
  3.1630 +# not robust to junk in `.', hence go to wildcards (a.*) only as a last
  3.1631 +# resort.
  3.1632 +
  3.1633 +# Be careful to initialize this variable, since it used to be cached.
  3.1634 +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
  3.1635 +ac_cv_exeext=
  3.1636 +# b.out is created by i960 compilers.
  3.1637 +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
  3.1638 +do
  3.1639 +  test -f "$ac_file" || continue
  3.1640 +  case $ac_file in
  3.1641 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
  3.1642 +        ;;
  3.1643 +    conftest.$ac_ext )
  3.1644 +        # This is the source file.
  3.1645 +        ;;
  3.1646 +    [ab].out )
  3.1647 +        # We found the default executable, but exeext='' is most
  3.1648 +        # certainly right.
  3.1649 +        break;;
  3.1650 +    *.* )
  3.1651 +        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
  3.1652 +        # FIXME: I believe we export ac_cv_exeext for Libtool,
  3.1653 +        # but it would be cool to find out if it's true.  Does anybody
  3.1654 +        # maintain Libtool? --akim.
  3.1655 +        export ac_cv_exeext
  3.1656 +        break;;
  3.1657 +    * )
  3.1658 +        break;;
  3.1659 +  esac
  3.1660 +done
  3.1661 +else
  3.1662 +  echo "$as_me: failed program was:" >&5
  3.1663 +sed 's/^/| /' conftest.$ac_ext >&5
  3.1664 +
  3.1665 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
  3.1666 +See \`config.log' for more details." >&5
  3.1667 +echo "$as_me: error: C compiler cannot create executables
  3.1668 +See \`config.log' for more details." >&2;}
  3.1669 +   { (exit 77); exit 77; }; }
  3.1670 +fi
  3.1671 +
  3.1672 +ac_exeext=$ac_cv_exeext
  3.1673 +echo "$as_me:$LINENO: result: $ac_file" >&5
  3.1674 +echo "${ECHO_T}$ac_file" >&6
  3.1675 +
  3.1676 +# Check the compiler produces executables we can run.  If not, either
  3.1677 +# the compiler is broken, or we cross compile.
  3.1678 +echo "$as_me:$LINENO: checking whether the C compiler works" >&5
  3.1679 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
  3.1680 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
  3.1681 +# If not cross compiling, check that we can run a simple program.
  3.1682 +if test "$cross_compiling" != yes; then
  3.1683 +  if { ac_try='./$ac_file'
  3.1684 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.1685 +  (eval $ac_try) 2>&5
  3.1686 +  ac_status=$?
  3.1687 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1688 +  (exit $ac_status); }; }; then
  3.1689 +    cross_compiling=no
  3.1690 +  else
  3.1691 +    if test "$cross_compiling" = maybe; then
  3.1692 +	cross_compiling=yes
  3.1693 +    else
  3.1694 +	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
  3.1695 +If you meant to cross compile, use \`--host'.
  3.1696 +See \`config.log' for more details." >&5
  3.1697 +echo "$as_me: error: cannot run C compiled programs.
  3.1698 +If you meant to cross compile, use \`--host'.
  3.1699 +See \`config.log' for more details." >&2;}
  3.1700 +   { (exit 1); exit 1; }; }
  3.1701 +    fi
  3.1702 +  fi
  3.1703 +fi
  3.1704 +echo "$as_me:$LINENO: result: yes" >&5
  3.1705 +echo "${ECHO_T}yes" >&6
  3.1706 +
  3.1707 +rm -f a.out a.exe conftest$ac_cv_exeext b.out
  3.1708 +ac_clean_files=$ac_clean_files_save
  3.1709 +# Check the compiler produces executables we can run.  If not, either
  3.1710 +# the compiler is broken, or we cross compile.
  3.1711 +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
  3.1712 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
  3.1713 +echo "$as_me:$LINENO: result: $cross_compiling" >&5
  3.1714 +echo "${ECHO_T}$cross_compiling" >&6
  3.1715 +
  3.1716 +echo "$as_me:$LINENO: checking for suffix of executables" >&5
  3.1717 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
  3.1718 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  3.1719 +  (eval $ac_link) 2>&5
  3.1720 +  ac_status=$?
  3.1721 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1722 +  (exit $ac_status); }; then
  3.1723 +  # If both `conftest.exe' and `conftest' are `present' (well, observable)
  3.1724 +# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
  3.1725 +# work properly (i.e., refer to `conftest.exe'), while it won't with
  3.1726 +# `rm'.
  3.1727 +for ac_file in conftest.exe conftest conftest.*; do
  3.1728 +  test -f "$ac_file" || continue
  3.1729 +  case $ac_file in
  3.1730 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
  3.1731 +    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
  3.1732 +          export ac_cv_exeext
  3.1733 +          break;;
  3.1734 +    * ) break;;
  3.1735 +  esac
  3.1736 +done
  3.1737 +else
  3.1738 +  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
  3.1739 +See \`config.log' for more details." >&5
  3.1740 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
  3.1741 +See \`config.log' for more details." >&2;}
  3.1742 +   { (exit 1); exit 1; }; }
  3.1743 +fi
  3.1744 +
  3.1745 +rm -f conftest$ac_cv_exeext
  3.1746 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
  3.1747 +echo "${ECHO_T}$ac_cv_exeext" >&6
  3.1748 +
  3.1749 +rm -f conftest.$ac_ext
  3.1750 +EXEEXT=$ac_cv_exeext
  3.1751 +ac_exeext=$EXEEXT
  3.1752 +echo "$as_me:$LINENO: checking for suffix of object files" >&5
  3.1753 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
  3.1754 +if test "${ac_cv_objext+set}" = set; then
  3.1755 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1756 +else
  3.1757 +  cat >conftest.$ac_ext <<_ACEOF
  3.1758 +#line $LINENO "configure"
  3.1759 +/* confdefs.h.  */
  3.1760 +_ACEOF
  3.1761 +cat confdefs.h >>conftest.$ac_ext
  3.1762 +cat >>conftest.$ac_ext <<_ACEOF
  3.1763 +/* end confdefs.h.  */
  3.1764 +
  3.1765 +int
  3.1766 +main ()
  3.1767 +{
  3.1768 +
  3.1769 +  ;
  3.1770 +  return 0;
  3.1771 +}
  3.1772 +_ACEOF
  3.1773 +rm -f conftest.o conftest.obj
  3.1774 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.1775 +  (eval $ac_compile) 2>&5
  3.1776 +  ac_status=$?
  3.1777 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1778 +  (exit $ac_status); }; then
  3.1779 +  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
  3.1780 +  case $ac_file in
  3.1781 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
  3.1782 +    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
  3.1783 +       break;;
  3.1784 +  esac
  3.1785 +done
  3.1786 +else
  3.1787 +  echo "$as_me: failed program was:" >&5
  3.1788 +sed 's/^/| /' conftest.$ac_ext >&5
  3.1789 +
  3.1790 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
  3.1791 +See \`config.log' for more details." >&5
  3.1792 +echo "$as_me: error: cannot compute suffix of object files: cannot compile
  3.1793 +See \`config.log' for more details." >&2;}
  3.1794 +   { (exit 1); exit 1; }; }
  3.1795 +fi
  3.1796 +
  3.1797 +rm -f conftest.$ac_cv_objext conftest.$ac_ext
  3.1798 +fi
  3.1799 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
  3.1800 +echo "${ECHO_T}$ac_cv_objext" >&6
  3.1801 +OBJEXT=$ac_cv_objext
  3.1802 +ac_objext=$OBJEXT
  3.1803 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
  3.1804 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
  3.1805 +if test "${ac_cv_c_compiler_gnu+set}" = set; then
  3.1806 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1807 +else
  3.1808 +  cat >conftest.$ac_ext <<_ACEOF
  3.1809 +#line $LINENO "configure"
  3.1810 +/* confdefs.h.  */
  3.1811 +_ACEOF
  3.1812 +cat confdefs.h >>conftest.$ac_ext
  3.1813 +cat >>conftest.$ac_ext <<_ACEOF
  3.1814 +/* end confdefs.h.  */
  3.1815 +
  3.1816 +int
  3.1817 +main ()
  3.1818 +{
  3.1819 +#ifndef __GNUC__
  3.1820 +       choke me
  3.1821 +#endif
  3.1822 +
  3.1823 +  ;
  3.1824 +  return 0;
  3.1825 +}
  3.1826 +_ACEOF
  3.1827 +rm -f conftest.$ac_objext
  3.1828 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.1829 +  (eval $ac_compile) 2>&5
  3.1830 +  ac_status=$?
  3.1831 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1832 +  (exit $ac_status); } &&
  3.1833 +         { ac_try='test -s conftest.$ac_objext'
  3.1834 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.1835 +  (eval $ac_try) 2>&5
  3.1836 +  ac_status=$?
  3.1837 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1838 +  (exit $ac_status); }; }; then
  3.1839 +  ac_compiler_gnu=yes
  3.1840 +else
  3.1841 +  echo "$as_me: failed program was:" >&5
  3.1842 +sed 's/^/| /' conftest.$ac_ext >&5
  3.1843 +
  3.1844 +ac_compiler_gnu=no
  3.1845 +fi
  3.1846 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.1847 +ac_cv_c_compiler_gnu=$ac_compiler_gnu
  3.1848 +
  3.1849 +fi
  3.1850 +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
  3.1851 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
  3.1852 +GCC=`test $ac_compiler_gnu = yes && echo yes`
  3.1853 +ac_test_CFLAGS=${CFLAGS+set}
  3.1854 +ac_save_CFLAGS=$CFLAGS
  3.1855 +CFLAGS="-g"
  3.1856 +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
  3.1857 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
  3.1858 +if test "${ac_cv_prog_cc_g+set}" = set; then
  3.1859 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1860 +else
  3.1861 +  cat >conftest.$ac_ext <<_ACEOF
  3.1862 +#line $LINENO "configure"
  3.1863 +/* confdefs.h.  */
  3.1864 +_ACEOF
  3.1865 +cat confdefs.h >>conftest.$ac_ext
  3.1866 +cat >>conftest.$ac_ext <<_ACEOF
  3.1867 +/* end confdefs.h.  */
  3.1868 +
  3.1869 +int
  3.1870 +main ()
  3.1871 +{
  3.1872 +
  3.1873 +  ;
  3.1874 +  return 0;
  3.1875 +}
  3.1876 +_ACEOF
  3.1877 +rm -f conftest.$ac_objext
  3.1878 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.1879 +  (eval $ac_compile) 2>&5
  3.1880 +  ac_status=$?
  3.1881 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1882 +  (exit $ac_status); } &&
  3.1883 +         { ac_try='test -s conftest.$ac_objext'
  3.1884 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.1885 +  (eval $ac_try) 2>&5
  3.1886 +  ac_status=$?
  3.1887 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1888 +  (exit $ac_status); }; }; then
  3.1889 +  ac_cv_prog_cc_g=yes
  3.1890 +else
  3.1891 +  echo "$as_me: failed program was:" >&5
  3.1892 +sed 's/^/| /' conftest.$ac_ext >&5
  3.1893 +
  3.1894 +ac_cv_prog_cc_g=no
  3.1895 +fi
  3.1896 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.1897 +fi
  3.1898 +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
  3.1899 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
  3.1900 +if test "$ac_test_CFLAGS" = set; then
  3.1901 +  CFLAGS=$ac_save_CFLAGS
  3.1902 +elif test $ac_cv_prog_cc_g = yes; then
  3.1903 +  if test "$GCC" = yes; then
  3.1904 +    CFLAGS="-g -O2"
  3.1905 +  else
  3.1906 +    CFLAGS="-g"
  3.1907 +  fi
  3.1908 +else
  3.1909 +  if test "$GCC" = yes; then
  3.1910 +    CFLAGS="-O2"
  3.1911 +  else
  3.1912 +    CFLAGS=
  3.1913 +  fi
  3.1914 +fi
  3.1915 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
  3.1916 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
  3.1917 +if test "${ac_cv_prog_cc_stdc+set}" = set; then
  3.1918 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.1919 +else
  3.1920 +  ac_cv_prog_cc_stdc=no
  3.1921 +ac_save_CC=$CC
  3.1922 +cat >conftest.$ac_ext <<_ACEOF
  3.1923 +#line $LINENO "configure"
  3.1924 +/* confdefs.h.  */
  3.1925 +_ACEOF
  3.1926 +cat confdefs.h >>conftest.$ac_ext
  3.1927 +cat >>conftest.$ac_ext <<_ACEOF
  3.1928 +/* end confdefs.h.  */
  3.1929 +#include <stdarg.h>
  3.1930 +#include <stdio.h>
  3.1931 +#include <sys/types.h>
  3.1932 +#include <sys/stat.h>
  3.1933 +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
  3.1934 +struct buf { int x; };
  3.1935 +FILE * (*rcsopen) (struct buf *, struct stat *, int);
  3.1936 +static char *e (p, i)
  3.1937 +     char **p;
  3.1938 +     int i;
  3.1939 +{
  3.1940 +  return p[i];
  3.1941 +}
  3.1942 +static char *f (char * (*g) (char **, int), char **p, ...)
  3.1943 +{
  3.1944 +  char *s;
  3.1945 +  va_list v;
  3.1946 +  va_start (v,p);
  3.1947 +  s = g (p, va_arg (v,int));
  3.1948 +  va_end (v);
  3.1949 +  return s;
  3.1950 +}
  3.1951 +int test (int i, double x);
  3.1952 +struct s1 {int (*f) (int a);};
  3.1953 +struct s2 {int (*f) (double a);};
  3.1954 +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
  3.1955 +int argc;
  3.1956 +char **argv;
  3.1957 +int
  3.1958 +main ()
  3.1959 +{
  3.1960 +return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  3.1961 +  ;
  3.1962 +  return 0;
  3.1963 +}
  3.1964 +_ACEOF
  3.1965 +# Don't try gcc -ansi; that turns off useful extensions and
  3.1966 +# breaks some systems' header files.
  3.1967 +# AIX			-qlanglvl=ansi
  3.1968 +# Ultrix and OSF/1	-std1
  3.1969 +# HP-UX 10.20 and later	-Ae
  3.1970 +# HP-UX older versions	-Aa -D_HPUX_SOURCE
  3.1971 +# SVR4			-Xc -D__EXTENSIONS__
  3.1972 +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  3.1973 +do
  3.1974 +  CC="$ac_save_CC $ac_arg"
  3.1975 +  rm -f conftest.$ac_objext
  3.1976 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.1977 +  (eval $ac_compile) 2>&5
  3.1978 +  ac_status=$?
  3.1979 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1980 +  (exit $ac_status); } &&
  3.1981 +         { ac_try='test -s conftest.$ac_objext'
  3.1982 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.1983 +  (eval $ac_try) 2>&5
  3.1984 +  ac_status=$?
  3.1985 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.1986 +  (exit $ac_status); }; }; then
  3.1987 +  ac_cv_prog_cc_stdc=$ac_arg
  3.1988 +break
  3.1989 +else
  3.1990 +  echo "$as_me: failed program was:" >&5
  3.1991 +sed 's/^/| /' conftest.$ac_ext >&5
  3.1992 +
  3.1993 +fi
  3.1994 +rm -f conftest.$ac_objext
  3.1995 +done
  3.1996 +rm -f conftest.$ac_ext conftest.$ac_objext
  3.1997 +CC=$ac_save_CC
  3.1998 +
  3.1999 +fi
  3.2000 +
  3.2001 +case "x$ac_cv_prog_cc_stdc" in
  3.2002 +  x|xno)
  3.2003 +    echo "$as_me:$LINENO: result: none needed" >&5
  3.2004 +echo "${ECHO_T}none needed" >&6 ;;
  3.2005 +  *)
  3.2006 +    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
  3.2007 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
  3.2008 +    CC="$CC $ac_cv_prog_cc_stdc" ;;
  3.2009 +esac
  3.2010 +
  3.2011 +# Some people use a C++ compiler to compile C.  Since we use `exit',
  3.2012 +# in C++ we need to declare it.  In case someone uses the same compiler
  3.2013 +# for both compiling C and C++ we need to have the C++ compiler decide
  3.2014 +# the declaration of exit, since it's the most demanding environment.
  3.2015 +cat >conftest.$ac_ext <<_ACEOF
  3.2016 +#ifndef __cplusplus
  3.2017 +  choke me
  3.2018 +#endif
  3.2019 +_ACEOF
  3.2020 +rm -f conftest.$ac_objext
  3.2021 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2022 +  (eval $ac_compile) 2>&5
  3.2023 +  ac_status=$?
  3.2024 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2025 +  (exit $ac_status); } &&
  3.2026 +         { ac_try='test -s conftest.$ac_objext'
  3.2027 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2028 +  (eval $ac_try) 2>&5
  3.2029 +  ac_status=$?
  3.2030 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2031 +  (exit $ac_status); }; }; then
  3.2032 +  for ac_declaration in \
  3.2033 +   ''\
  3.2034 +   '#include <stdlib.h>' \
  3.2035 +   'extern "C" void std::exit (int) throw (); using std::exit;' \
  3.2036 +   'extern "C" void std::exit (int); using std::exit;' \
  3.2037 +   'extern "C" void exit (int) throw ();' \
  3.2038 +   'extern "C" void exit (int);' \
  3.2039 +   'void exit (int);'
  3.2040 +do
  3.2041 +  cat >conftest.$ac_ext <<_ACEOF
  3.2042 +#line $LINENO "configure"
  3.2043 +/* confdefs.h.  */
  3.2044 +_ACEOF
  3.2045 +cat confdefs.h >>conftest.$ac_ext
  3.2046 +cat >>conftest.$ac_ext <<_ACEOF
  3.2047 +/* end confdefs.h.  */
  3.2048 +#include <stdlib.h>
  3.2049 +$ac_declaration
  3.2050 +int
  3.2051 +main ()
  3.2052 +{
  3.2053 +exit (42);
  3.2054 +  ;
  3.2055 +  return 0;
  3.2056 +}
  3.2057 +_ACEOF
  3.2058 +rm -f conftest.$ac_objext
  3.2059 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2060 +  (eval $ac_compile) 2>&5
  3.2061 +  ac_status=$?
  3.2062 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2063 +  (exit $ac_status); } &&
  3.2064 +         { ac_try='test -s conftest.$ac_objext'
  3.2065 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2066 +  (eval $ac_try) 2>&5
  3.2067 +  ac_status=$?
  3.2068 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2069 +  (exit $ac_status); }; }; then
  3.2070 +  :
  3.2071 +else
  3.2072 +  echo "$as_me: failed program was:" >&5
  3.2073 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2074 +
  3.2075 +continue
  3.2076 +fi
  3.2077 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2078 +  cat >conftest.$ac_ext <<_ACEOF
  3.2079 +#line $LINENO "configure"
  3.2080 +/* confdefs.h.  */
  3.2081 +_ACEOF
  3.2082 +cat confdefs.h >>conftest.$ac_ext
  3.2083 +cat >>conftest.$ac_ext <<_ACEOF
  3.2084 +/* end confdefs.h.  */
  3.2085 +$ac_declaration
  3.2086 +int
  3.2087 +main ()
  3.2088 +{
  3.2089 +exit (42);
  3.2090 +  ;
  3.2091 +  return 0;
  3.2092 +}
  3.2093 +_ACEOF
  3.2094 +rm -f conftest.$ac_objext
  3.2095 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2096 +  (eval $ac_compile) 2>&5
  3.2097 +  ac_status=$?
  3.2098 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2099 +  (exit $ac_status); } &&
  3.2100 +         { ac_try='test -s conftest.$ac_objext'
  3.2101 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2102 +  (eval $ac_try) 2>&5
  3.2103 +  ac_status=$?
  3.2104 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2105 +  (exit $ac_status); }; }; then
  3.2106 +  break
  3.2107 +else
  3.2108 +  echo "$as_me: failed program was:" >&5
  3.2109 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2110 +
  3.2111 +fi
  3.2112 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2113 +done
  3.2114 +rm -f conftest*
  3.2115 +if test -n "$ac_declaration"; then
  3.2116 +  echo '#ifdef __cplusplus' >>confdefs.h
  3.2117 +  echo $ac_declaration      >>confdefs.h
  3.2118 +  echo '#endif'             >>confdefs.h
  3.2119 +fi
  3.2120 +
  3.2121 +else
  3.2122 +  echo "$as_me: failed program was:" >&5
  3.2123 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2124 +
  3.2125 +fi
  3.2126 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2127 +ac_ext=c
  3.2128 +ac_cpp='$CPP $CPPFLAGS'
  3.2129 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  3.2130 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  3.2131 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  3.2132 +
  3.2133 +
  3.2134 +ac_aux_dir=
  3.2135 +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  3.2136 +  if test -f $ac_dir/install-sh; then
  3.2137 +    ac_aux_dir=$ac_dir
  3.2138 +    ac_install_sh="$ac_aux_dir/install-sh -c"
  3.2139 +    break
  3.2140 +  elif test -f $ac_dir/install.sh; then
  3.2141 +    ac_aux_dir=$ac_dir
  3.2142 +    ac_install_sh="$ac_aux_dir/install.sh -c"
  3.2143 +    break
  3.2144 +  elif test -f $ac_dir/shtool; then
  3.2145 +    ac_aux_dir=$ac_dir
  3.2146 +    ac_install_sh="$ac_aux_dir/shtool install -c"
  3.2147 +    break
  3.2148 +  fi
  3.2149 +done
  3.2150 +if test -z "$ac_aux_dir"; then
  3.2151 +  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
  3.2152 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
  3.2153 +   { (exit 1); exit 1; }; }
  3.2154 +fi
  3.2155 +ac_config_guess="$SHELL $ac_aux_dir/config.guess"
  3.2156 +ac_config_sub="$SHELL $ac_aux_dir/config.sub"
  3.2157 +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
  3.2158 +
  3.2159 +# Make sure we can run config.sub.
  3.2160 +$ac_config_sub sun4 >/dev/null 2>&1 ||
  3.2161 +  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
  3.2162 +echo "$as_me: error: cannot run $ac_config_sub" >&2;}
  3.2163 +   { (exit 1); exit 1; }; }
  3.2164 +
  3.2165 +echo "$as_me:$LINENO: checking build system type" >&5
  3.2166 +echo $ECHO_N "checking build system type... $ECHO_C" >&6
  3.2167 +if test "${ac_cv_build+set}" = set; then
  3.2168 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2169 +else
  3.2170 +  ac_cv_build_alias=$build_alias
  3.2171 +test -z "$ac_cv_build_alias" &&
  3.2172 +  ac_cv_build_alias=`$ac_config_guess`
  3.2173 +test -z "$ac_cv_build_alias" &&
  3.2174 +  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
  3.2175 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
  3.2176 +   { (exit 1); exit 1; }; }
  3.2177 +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
  3.2178 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
  3.2179 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
  3.2180 +   { (exit 1); exit 1; }; }
  3.2181 +
  3.2182 +fi
  3.2183 +echo "$as_me:$LINENO: result: $ac_cv_build" >&5
  3.2184 +echo "${ECHO_T}$ac_cv_build" >&6
  3.2185 +build=$ac_cv_build
  3.2186 +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  3.2187 +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  3.2188 +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  3.2189 +
  3.2190 +
  3.2191 +echo "$as_me:$LINENO: checking host system type" >&5
  3.2192 +echo $ECHO_N "checking host system type... $ECHO_C" >&6
  3.2193 +if test "${ac_cv_host+set}" = set; then
  3.2194 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2195 +else
  3.2196 +  ac_cv_host_alias=$host_alias
  3.2197 +test -z "$ac_cv_host_alias" &&
  3.2198 +  ac_cv_host_alias=$ac_cv_build_alias
  3.2199 +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
  3.2200 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
  3.2201 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
  3.2202 +   { (exit 1); exit 1; }; }
  3.2203 +
  3.2204 +fi
  3.2205 +echo "$as_me:$LINENO: result: $ac_cv_host" >&5
  3.2206 +echo "${ECHO_T}$ac_cv_host" >&6
  3.2207 +host=$ac_cv_host
  3.2208 +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  3.2209 +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  3.2210 +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  3.2211 +
  3.2212 +
  3.2213 +echo "$as_me:$LINENO: checking target system type" >&5
  3.2214 +echo $ECHO_N "checking target system type... $ECHO_C" >&6
  3.2215 +if test "${ac_cv_target+set}" = set; then
  3.2216 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2217 +else
  3.2218 +  ac_cv_target_alias=$target_alias
  3.2219 +test "x$ac_cv_target_alias" = "x" &&
  3.2220 +  ac_cv_target_alias=$ac_cv_host_alias
  3.2221 +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
  3.2222 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
  3.2223 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
  3.2224 +   { (exit 1); exit 1; }; }
  3.2225 +
  3.2226 +fi
  3.2227 +echo "$as_me:$LINENO: result: $ac_cv_target" >&5
  3.2228 +echo "${ECHO_T}$ac_cv_target" >&6
  3.2229 +target=$ac_cv_target
  3.2230 +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  3.2231 +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  3.2232 +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  3.2233 +
  3.2234 +
  3.2235 +# The aliases save the names the user supplied, while $host etc.
  3.2236 +# will get canonicalized.
  3.2237 +test -n "$target_alias" &&
  3.2238 +  test "$program_prefix$program_suffix$program_transform_name" = \
  3.2239 +    NONENONEs,x,x, &&
  3.2240 +  program_prefix=${target_alias}-
  3.2241 +
  3.2242 +# Find a good install program.  We prefer a C program (faster),
  3.2243 +# so one script is as good as another.  But avoid the broken or
  3.2244 +# incompatible versions:
  3.2245 +# SysV /etc/install, /usr/sbin/install
  3.2246 +# SunOS /usr/etc/install
  3.2247 +# IRIX /sbin/install
  3.2248 +# AIX /bin/install
  3.2249 +# AmigaOS /C/install, which installs bootblocks on floppy discs
  3.2250 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
  3.2251 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
  3.2252 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  3.2253 +# ./install, which can be erroneously created by make from ./install.sh.
  3.2254 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
  3.2255 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
  3.2256 +if test -z "$INSTALL"; then
  3.2257 +if test "${ac_cv_path_install+set}" = set; then
  3.2258 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2259 +else
  3.2260 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.2261 +for as_dir in $PATH
  3.2262 +do
  3.2263 +  IFS=$as_save_IFS
  3.2264 +  test -z "$as_dir" && as_dir=.
  3.2265 +  # Account for people who put trailing slashes in PATH elements.
  3.2266 +case $as_dir/ in
  3.2267 +  ./ | .// | /cC/* | \
  3.2268 +  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
  3.2269 +  /usr/ucb/* ) ;;
  3.2270 +  *)
  3.2271 +    # OSF1 and SCO ODT 3.0 have their own names for install.
  3.2272 +    # Don't use installbsd from OSF since it installs stuff as root
  3.2273 +    # by default.
  3.2274 +    for ac_prog in ginstall scoinst install; do
  3.2275 +      for ac_exec_ext in '' $ac_executable_extensions; do
  3.2276 +        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
  3.2277 +          if test $ac_prog = install &&
  3.2278 +            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  3.2279 +            # AIX install.  It has an incompatible calling convention.
  3.2280 +            :
  3.2281 +          elif test $ac_prog = install &&
  3.2282 +            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  3.2283 +            # program-specific install script used by HP pwplus--don't use.
  3.2284 +            :
  3.2285 +          else
  3.2286 +            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
  3.2287 +            break 3
  3.2288 +          fi
  3.2289 +        fi
  3.2290 +      done
  3.2291 +    done
  3.2292 +    ;;
  3.2293 +esac
  3.2294 +done
  3.2295 +
  3.2296 +
  3.2297 +fi
  3.2298 +  if test "${ac_cv_path_install+set}" = set; then
  3.2299 +    INSTALL=$ac_cv_path_install
  3.2300 +  else
  3.2301 +    # As a last resort, use the slow shell script.  We don't cache a
  3.2302 +    # path for INSTALL within a source directory, because that will
  3.2303 +    # break other packages using the cache if that directory is
  3.2304 +    # removed, or if the path is relative.
  3.2305 +    INSTALL=$ac_install_sh
  3.2306 +  fi
  3.2307 +fi
  3.2308 +echo "$as_me:$LINENO: result: $INSTALL" >&5
  3.2309 +echo "${ECHO_T}$INSTALL" >&6
  3.2310 +
  3.2311 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  3.2312 +# It thinks the first close brace ends the variable substitution.
  3.2313 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  3.2314 +
  3.2315 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
  3.2316 +
  3.2317 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  3.2318 +
  3.2319 +
  3.2320 +
  3.2321 +ac_ext=c
  3.2322 +ac_cpp='$CPP $CPPFLAGS'
  3.2323 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  3.2324 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  3.2325 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  3.2326 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
  3.2327 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
  3.2328 +# On Suns, sometimes $CPP names a directory.
  3.2329 +if test -n "$CPP" && test -d "$CPP"; then
  3.2330 +  CPP=
  3.2331 +fi
  3.2332 +if test -z "$CPP"; then
  3.2333 +  if test "${ac_cv_prog_CPP+set}" = set; then
  3.2334 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2335 +else
  3.2336 +      # Double quotes because CPP needs to be expanded
  3.2337 +    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
  3.2338 +    do
  3.2339 +      ac_preproc_ok=false
  3.2340 +for ac_c_preproc_warn_flag in '' yes
  3.2341 +do
  3.2342 +  # Use a header file that comes with gcc, so configuring glibc
  3.2343 +  # with a fresh cross-compiler works.
  3.2344 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  3.2345 +  # <limits.h> exists even on freestanding compilers.
  3.2346 +  # On the NeXT, cc -E runs the code through the compiler's parser,
  3.2347 +  # not just through cpp. "Syntax error" is here to catch this case.
  3.2348 +  cat >conftest.$ac_ext <<_ACEOF
  3.2349 +#line $LINENO "configure"
  3.2350 +/* confdefs.h.  */
  3.2351 +_ACEOF
  3.2352 +cat confdefs.h >>conftest.$ac_ext
  3.2353 +cat >>conftest.$ac_ext <<_ACEOF
  3.2354 +/* end confdefs.h.  */
  3.2355 +#ifdef __STDC__
  3.2356 +# include <limits.h>
  3.2357 +#else
  3.2358 +# include <assert.h>
  3.2359 +#endif
  3.2360 +                     Syntax error
  3.2361 +_ACEOF
  3.2362 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  3.2363 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  3.2364 +  ac_status=$?
  3.2365 +  grep -v '^ *+' conftest.er1 >conftest.err
  3.2366 +  rm -f conftest.er1
  3.2367 +  cat conftest.err >&5
  3.2368 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2369 +  (exit $ac_status); } >/dev/null; then
  3.2370 +  if test -s conftest.err; then
  3.2371 +    ac_cpp_err=$ac_c_preproc_warn_flag
  3.2372 +  else
  3.2373 +    ac_cpp_err=
  3.2374 +  fi
  3.2375 +else
  3.2376 +  ac_cpp_err=yes
  3.2377 +fi
  3.2378 +if test -z "$ac_cpp_err"; then
  3.2379 +  :
  3.2380 +else
  3.2381 +  echo "$as_me: failed program was:" >&5
  3.2382 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2383 +
  3.2384 +  # Broken: fails on valid input.
  3.2385 +continue
  3.2386 +fi
  3.2387 +rm -f conftest.err conftest.$ac_ext
  3.2388 +
  3.2389 +  # OK, works on sane cases.  Now check whether non-existent headers
  3.2390 +  # can be detected and how.
  3.2391 +  cat >conftest.$ac_ext <<_ACEOF
  3.2392 +#line $LINENO "configure"
  3.2393 +/* confdefs.h.  */
  3.2394 +_ACEOF
  3.2395 +cat confdefs.h >>conftest.$ac_ext
  3.2396 +cat >>conftest.$ac_ext <<_ACEOF
  3.2397 +/* end confdefs.h.  */
  3.2398 +#include <ac_nonexistent.h>
  3.2399 +_ACEOF
  3.2400 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  3.2401 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  3.2402 +  ac_status=$?
  3.2403 +  grep -v '^ *+' conftest.er1 >conftest.err
  3.2404 +  rm -f conftest.er1
  3.2405 +  cat conftest.err >&5
  3.2406 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2407 +  (exit $ac_status); } >/dev/null; then
  3.2408 +  if test -s conftest.err; then
  3.2409 +    ac_cpp_err=$ac_c_preproc_warn_flag
  3.2410 +  else
  3.2411 +    ac_cpp_err=
  3.2412 +  fi
  3.2413 +else
  3.2414 +  ac_cpp_err=yes
  3.2415 +fi
  3.2416 +if test -z "$ac_cpp_err"; then
  3.2417 +  # Broken: success on invalid input.
  3.2418 +continue
  3.2419 +else
  3.2420 +  echo "$as_me: failed program was:" >&5
  3.2421 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2422 +
  3.2423 +  # Passes both tests.
  3.2424 +ac_preproc_ok=:
  3.2425 +break
  3.2426 +fi
  3.2427 +rm -f conftest.err conftest.$ac_ext
  3.2428 +
  3.2429 +done
  3.2430 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  3.2431 +rm -f conftest.err conftest.$ac_ext
  3.2432 +if $ac_preproc_ok; then
  3.2433 +  break
  3.2434 +fi
  3.2435 +
  3.2436 +    done
  3.2437 +    ac_cv_prog_CPP=$CPP
  3.2438 +
  3.2439 +fi
  3.2440 +  CPP=$ac_cv_prog_CPP
  3.2441 +else
  3.2442 +  ac_cv_prog_CPP=$CPP
  3.2443 +fi
  3.2444 +echo "$as_me:$LINENO: result: $CPP" >&5
  3.2445 +echo "${ECHO_T}$CPP" >&6
  3.2446 +ac_preproc_ok=false
  3.2447 +for ac_c_preproc_warn_flag in '' yes
  3.2448 +do
  3.2449 +  # Use a header file that comes with gcc, so configuring glibc
  3.2450 +  # with a fresh cross-compiler works.
  3.2451 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  3.2452 +  # <limits.h> exists even on freestanding compilers.
  3.2453 +  # On the NeXT, cc -E runs the code through the compiler's parser,
  3.2454 +  # not just through cpp. "Syntax error" is here to catch this case.
  3.2455 +  cat >conftest.$ac_ext <<_ACEOF
  3.2456 +#line $LINENO "configure"
  3.2457 +/* confdefs.h.  */
  3.2458 +_ACEOF
  3.2459 +cat confdefs.h >>conftest.$ac_ext
  3.2460 +cat >>conftest.$ac_ext <<_ACEOF
  3.2461 +/* end confdefs.h.  */
  3.2462 +#ifdef __STDC__
  3.2463 +# include <limits.h>
  3.2464 +#else
  3.2465 +# include <assert.h>
  3.2466 +#endif
  3.2467 +                     Syntax error
  3.2468 +_ACEOF
  3.2469 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  3.2470 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  3.2471 +  ac_status=$?
  3.2472 +  grep -v '^ *+' conftest.er1 >conftest.err
  3.2473 +  rm -f conftest.er1
  3.2474 +  cat conftest.err >&5
  3.2475 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2476 +  (exit $ac_status); } >/dev/null; then
  3.2477 +  if test -s conftest.err; then
  3.2478 +    ac_cpp_err=$ac_c_preproc_warn_flag
  3.2479 +  else
  3.2480 +    ac_cpp_err=
  3.2481 +  fi
  3.2482 +else
  3.2483 +  ac_cpp_err=yes
  3.2484 +fi
  3.2485 +if test -z "$ac_cpp_err"; then
  3.2486 +  :
  3.2487 +else
  3.2488 +  echo "$as_me: failed program was:" >&5
  3.2489 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2490 +
  3.2491 +  # Broken: fails on valid input.
  3.2492 +continue
  3.2493 +fi
  3.2494 +rm -f conftest.err conftest.$ac_ext
  3.2495 +
  3.2496 +  # OK, works on sane cases.  Now check whether non-existent headers
  3.2497 +  # can be detected and how.
  3.2498 +  cat >conftest.$ac_ext <<_ACEOF
  3.2499 +#line $LINENO "configure"
  3.2500 +/* confdefs.h.  */
  3.2501 +_ACEOF
  3.2502 +cat confdefs.h >>conftest.$ac_ext
  3.2503 +cat >>conftest.$ac_ext <<_ACEOF
  3.2504 +/* end confdefs.h.  */
  3.2505 +#include <ac_nonexistent.h>
  3.2506 +_ACEOF
  3.2507 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  3.2508 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  3.2509 +  ac_status=$?
  3.2510 +  grep -v '^ *+' conftest.er1 >conftest.err
  3.2511 +  rm -f conftest.er1
  3.2512 +  cat conftest.err >&5
  3.2513 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2514 +  (exit $ac_status); } >/dev/null; then
  3.2515 +  if test -s conftest.err; then
  3.2516 +    ac_cpp_err=$ac_c_preproc_warn_flag
  3.2517 +  else
  3.2518 +    ac_cpp_err=
  3.2519 +  fi
  3.2520 +else
  3.2521 +  ac_cpp_err=yes
  3.2522 +fi
  3.2523 +if test -z "$ac_cpp_err"; then
  3.2524 +  # Broken: success on invalid input.
  3.2525 +continue
  3.2526 +else
  3.2527 +  echo "$as_me: failed program was:" >&5
  3.2528 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2529 +
  3.2530 +  # Passes both tests.
  3.2531 +ac_preproc_ok=:
  3.2532 +break
  3.2533 +fi
  3.2534 +rm -f conftest.err conftest.$ac_ext
  3.2535 +
  3.2536 +done
  3.2537 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  3.2538 +rm -f conftest.err conftest.$ac_ext
  3.2539 +if $ac_preproc_ok; then
  3.2540 +  :
  3.2541 +else
  3.2542 +  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
  3.2543 +See \`config.log' for more details." >&5
  3.2544 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
  3.2545 +See \`config.log' for more details." >&2;}
  3.2546 +   { (exit 1); exit 1; }; }
  3.2547 +fi
  3.2548 +
  3.2549 +ac_ext=c
  3.2550 +ac_cpp='$CPP $CPPFLAGS'
  3.2551 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  3.2552 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  3.2553 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  3.2554 +
  3.2555 +
  3.2556 +echo "$as_me:$LINENO: checking for egrep" >&5
  3.2557 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6
  3.2558 +if test "${ac_cv_prog_egrep+set}" = set; then
  3.2559 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2560 +else
  3.2561 +  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
  3.2562 +    then ac_cv_prog_egrep='grep -E'
  3.2563 +    else ac_cv_prog_egrep='egrep'
  3.2564 +    fi
  3.2565 +fi
  3.2566 +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
  3.2567 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6
  3.2568 + EGREP=$ac_cv_prog_egrep
  3.2569 +
  3.2570 +
  3.2571 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5
  3.2572 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
  3.2573 +if test "${ac_cv_header_stdc+set}" = set; then
  3.2574 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2575 +else
  3.2576 +  cat >conftest.$ac_ext <<_ACEOF
  3.2577 +#line $LINENO "configure"
  3.2578 +/* confdefs.h.  */
  3.2579 +_ACEOF
  3.2580 +cat confdefs.h >>conftest.$ac_ext
  3.2581 +cat >>conftest.$ac_ext <<_ACEOF
  3.2582 +/* end confdefs.h.  */
  3.2583 +#include <stdlib.h>
  3.2584 +#include <stdarg.h>
  3.2585 +#include <string.h>
  3.2586 +#include <float.h>
  3.2587 +
  3.2588 +int
  3.2589 +main ()
  3.2590 +{
  3.2591 +
  3.2592 +  ;
  3.2593 +  return 0;
  3.2594 +}
  3.2595 +_ACEOF
  3.2596 +rm -f conftest.$ac_objext
  3.2597 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2598 +  (eval $ac_compile) 2>&5
  3.2599 +  ac_status=$?
  3.2600 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2601 +  (exit $ac_status); } &&
  3.2602 +         { ac_try='test -s conftest.$ac_objext'
  3.2603 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2604 +  (eval $ac_try) 2>&5
  3.2605 +  ac_status=$?
  3.2606 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2607 +  (exit $ac_status); }; }; then
  3.2608 +  ac_cv_header_stdc=yes
  3.2609 +else
  3.2610 +  echo "$as_me: failed program was:" >&5
  3.2611 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2612 +
  3.2613 +ac_cv_header_stdc=no
  3.2614 +fi
  3.2615 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2616 +
  3.2617 +if test $ac_cv_header_stdc = yes; then
  3.2618 +  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  3.2619 +  cat >conftest.$ac_ext <<_ACEOF
  3.2620 +#line $LINENO "configure"
  3.2621 +/* confdefs.h.  */
  3.2622 +_ACEOF
  3.2623 +cat confdefs.h >>conftest.$ac_ext
  3.2624 +cat >>conftest.$ac_ext <<_ACEOF
  3.2625 +/* end confdefs.h.  */
  3.2626 +#include <string.h>
  3.2627 +
  3.2628 +_ACEOF
  3.2629 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3.2630 +  $EGREP "memchr" >/dev/null 2>&1; then
  3.2631 +  :
  3.2632 +else
  3.2633 +  ac_cv_header_stdc=no
  3.2634 +fi
  3.2635 +rm -f conftest*
  3.2636 +
  3.2637 +fi
  3.2638 +
  3.2639 +if test $ac_cv_header_stdc = yes; then
  3.2640 +  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  3.2641 +  cat >conftest.$ac_ext <<_ACEOF
  3.2642 +#line $LINENO "configure"
  3.2643 +/* confdefs.h.  */
  3.2644 +_ACEOF
  3.2645 +cat confdefs.h >>conftest.$ac_ext
  3.2646 +cat >>conftest.$ac_ext <<_ACEOF
  3.2647 +/* end confdefs.h.  */
  3.2648 +#include <stdlib.h>
  3.2649 +
  3.2650 +_ACEOF
  3.2651 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3.2652 +  $EGREP "free" >/dev/null 2>&1; then
  3.2653 +  :
  3.2654 +else
  3.2655 +  ac_cv_header_stdc=no
  3.2656 +fi
  3.2657 +rm -f conftest*
  3.2658 +
  3.2659 +fi
  3.2660 +
  3.2661 +if test $ac_cv_header_stdc = yes; then
  3.2662 +  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  3.2663 +  if test "$cross_compiling" = yes; then
  3.2664 +  :
  3.2665 +else
  3.2666 +  cat >conftest.$ac_ext <<_ACEOF
  3.2667 +#line $LINENO "configure"
  3.2668 +/* confdefs.h.  */
  3.2669 +_ACEOF
  3.2670 +cat confdefs.h >>conftest.$ac_ext
  3.2671 +cat >>conftest.$ac_ext <<_ACEOF
  3.2672 +/* end confdefs.h.  */
  3.2673 +#include <ctype.h>
  3.2674 +#if ((' ' & 0x0FF) == 0x020)
  3.2675 +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  3.2676 +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  3.2677 +#else
  3.2678 +# define ISLOWER(c) \
  3.2679 +                   (('a' <= (c) && (c) <= 'i') \
  3.2680 +                     || ('j' <= (c) && (c) <= 'r') \
  3.2681 +                     || ('s' <= (c) && (c) <= 'z'))
  3.2682 +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
  3.2683 +#endif
  3.2684 +
  3.2685 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
  3.2686 +int
  3.2687 +main ()
  3.2688 +{
  3.2689 +  int i;
  3.2690 +  for (i = 0; i < 256; i++)
  3.2691 +    if (XOR (islower (i), ISLOWER (i))
  3.2692 +        || toupper (i) != TOUPPER (i))
  3.2693 +      exit(2);
  3.2694 +  exit (0);
  3.2695 +}
  3.2696 +_ACEOF
  3.2697 +rm -f conftest$ac_exeext
  3.2698 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  3.2699 +  (eval $ac_link) 2>&5
  3.2700 +  ac_status=$?
  3.2701 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2702 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  3.2703 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2704 +  (eval $ac_try) 2>&5
  3.2705 +  ac_status=$?
  3.2706 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2707 +  (exit $ac_status); }; }; then
  3.2708 +  :
  3.2709 +else
  3.2710 +  echo "$as_me: program exited with status $ac_status" >&5
  3.2711 +echo "$as_me: failed program was:" >&5
  3.2712 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2713 +
  3.2714 +( exit $ac_status )
  3.2715 +ac_cv_header_stdc=no
  3.2716 +fi
  3.2717 +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
  3.2718 +fi
  3.2719 +fi
  3.2720 +fi
  3.2721 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
  3.2722 +echo "${ECHO_T}$ac_cv_header_stdc" >&6
  3.2723 +if test $ac_cv_header_stdc = yes; then
  3.2724 +
  3.2725 +cat >>confdefs.h <<\_ACEOF
  3.2726 +#define STDC_HEADERS 1
  3.2727 +_ACEOF
  3.2728 +
  3.2729 +fi
  3.2730 +
  3.2731 +
  3.2732 +# On IRIX 5.3, sys/types and inttypes.h are conflicting.
  3.2733 +
  3.2734 +
  3.2735 +
  3.2736 +
  3.2737 +
  3.2738 +
  3.2739 +
  3.2740 +
  3.2741 +
  3.2742 +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
  3.2743 +                  inttypes.h stdint.h unistd.h
  3.2744 +do
  3.2745 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  3.2746 +echo "$as_me:$LINENO: checking for $ac_header" >&5
  3.2747 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  3.2748 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  3.2749 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2750 +else
  3.2751 +  cat >conftest.$ac_ext <<_ACEOF
  3.2752 +#line $LINENO "configure"
  3.2753 +/* confdefs.h.  */
  3.2754 +_ACEOF
  3.2755 +cat confdefs.h >>conftest.$ac_ext
  3.2756 +cat >>conftest.$ac_ext <<_ACEOF
  3.2757 +/* end confdefs.h.  */
  3.2758 +$ac_includes_default
  3.2759 +
  3.2760 +#include <$ac_header>
  3.2761 +_ACEOF
  3.2762 +rm -f conftest.$ac_objext
  3.2763 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2764 +  (eval $ac_compile) 2>&5
  3.2765 +  ac_status=$?
  3.2766 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2767 +  (exit $ac_status); } &&
  3.2768 +         { ac_try='test -s conftest.$ac_objext'
  3.2769 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2770 +  (eval $ac_try) 2>&5
  3.2771 +  ac_status=$?
  3.2772 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2773 +  (exit $ac_status); }; }; then
  3.2774 +  eval "$as_ac_Header=yes"
  3.2775 +else
  3.2776 +  echo "$as_me: failed program was:" >&5
  3.2777 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2778 +
  3.2779 +eval "$as_ac_Header=no"
  3.2780 +fi
  3.2781 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2782 +fi
  3.2783 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  3.2784 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  3.2785 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
  3.2786 +  cat >>confdefs.h <<_ACEOF
  3.2787 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
  3.2788 +_ACEOF
  3.2789 +
  3.2790 +fi
  3.2791 +
  3.2792 +done
  3.2793 +
  3.2794 +
  3.2795 +
  3.2796 +
  3.2797 +
  3.2798 +
  3.2799 +
  3.2800 +
  3.2801 +
  3.2802 +
  3.2803 +
  3.2804 +
  3.2805 +
  3.2806 +for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h 		 proc_service.h sys/procfs.h thread_db.h linux/elf.h 		 stdlib.h unistd.h
  3.2807 +do
  3.2808 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  3.2809 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  3.2810 +  echo "$as_me:$LINENO: checking for $ac_header" >&5
  3.2811 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  3.2812 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  3.2813 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2814 +fi
  3.2815 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  3.2816 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  3.2817 +else
  3.2818 +  # Is the header compilable?
  3.2819 +echo "$as_me:$LINENO: checking $ac_header usability" >&5
  3.2820 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
  3.2821 +cat >conftest.$ac_ext <<_ACEOF
  3.2822 +#line $LINENO "configure"
  3.2823 +/* confdefs.h.  */
  3.2824 +_ACEOF
  3.2825 +cat confdefs.h >>conftest.$ac_ext
  3.2826 +cat >>conftest.$ac_ext <<_ACEOF
  3.2827 +/* end confdefs.h.  */
  3.2828 +$ac_includes_default
  3.2829 +#include <$ac_header>
  3.2830 +_ACEOF
  3.2831 +rm -f conftest.$ac_objext
  3.2832 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2833 +  (eval $ac_compile) 2>&5
  3.2834 +  ac_status=$?
  3.2835 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2836 +  (exit $ac_status); } &&
  3.2837 +         { ac_try='test -s conftest.$ac_objext'
  3.2838 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2839 +  (eval $ac_try) 2>&5
  3.2840 +  ac_status=$?
  3.2841 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2842 +  (exit $ac_status); }; }; then
  3.2843 +  ac_header_compiler=yes
  3.2844 +else
  3.2845 +  echo "$as_me: failed program was:" >&5
  3.2846 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2847 +
  3.2848 +ac_header_compiler=no
  3.2849 +fi
  3.2850 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.2851 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
  3.2852 +echo "${ECHO_T}$ac_header_compiler" >&6
  3.2853 +
  3.2854 +# Is the header present?
  3.2855 +echo "$as_me:$LINENO: checking $ac_header presence" >&5
  3.2856 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
  3.2857 +cat >conftest.$ac_ext <<_ACEOF
  3.2858 +#line $LINENO "configure"
  3.2859 +/* confdefs.h.  */
  3.2860 +_ACEOF
  3.2861 +cat confdefs.h >>conftest.$ac_ext
  3.2862 +cat >>conftest.$ac_ext <<_ACEOF
  3.2863 +/* end confdefs.h.  */
  3.2864 +#include <$ac_header>
  3.2865 +_ACEOF
  3.2866 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  3.2867 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  3.2868 +  ac_status=$?
  3.2869 +  grep -v '^ *+' conftest.er1 >conftest.err
  3.2870 +  rm -f conftest.er1
  3.2871 +  cat conftest.err >&5
  3.2872 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2873 +  (exit $ac_status); } >/dev/null; then
  3.2874 +  if test -s conftest.err; then
  3.2875 +    ac_cpp_err=$ac_c_preproc_warn_flag
  3.2876 +  else
  3.2877 +    ac_cpp_err=
  3.2878 +  fi
  3.2879 +else
  3.2880 +  ac_cpp_err=yes
  3.2881 +fi
  3.2882 +if test -z "$ac_cpp_err"; then
  3.2883 +  ac_header_preproc=yes
  3.2884 +else
  3.2885 +  echo "$as_me: failed program was:" >&5
  3.2886 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2887 +
  3.2888 +  ac_header_preproc=no
  3.2889 +fi
  3.2890 +rm -f conftest.err conftest.$ac_ext
  3.2891 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
  3.2892 +echo "${ECHO_T}$ac_header_preproc" >&6
  3.2893 +
  3.2894 +# So?  What about this header?
  3.2895 +case $ac_header_compiler:$ac_header_preproc in
  3.2896 +  yes:no )
  3.2897 +    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
  3.2898 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
  3.2899 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
  3.2900 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
  3.2901 +    (
  3.2902 +      cat <<\_ASBOX
  3.2903 +## ------------------------------------ ##
  3.2904 +## Report this to bug-autoconf@gnu.org. ##
  3.2905 +## ------------------------------------ ##
  3.2906 +_ASBOX
  3.2907 +    ) |
  3.2908 +      sed "s/^/$as_me: WARNING:     /" >&2
  3.2909 +    ;;
  3.2910 +  no:yes )
  3.2911 +    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
  3.2912 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
  3.2913 +    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
  3.2914 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
  3.2915 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
  3.2916 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
  3.2917 +    (
  3.2918 +      cat <<\_ASBOX
  3.2919 +## ------------------------------------ ##
  3.2920 +## Report this to bug-autoconf@gnu.org. ##
  3.2921 +## ------------------------------------ ##
  3.2922 +_ASBOX
  3.2923 +    ) |
  3.2924 +      sed "s/^/$as_me: WARNING:     /" >&2
  3.2925 +    ;;
  3.2926 +esac
  3.2927 +echo "$as_me:$LINENO: checking for $ac_header" >&5
  3.2928 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  3.2929 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  3.2930 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2931 +else
  3.2932 +  eval "$as_ac_Header=$ac_header_preproc"
  3.2933 +fi
  3.2934 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  3.2935 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  3.2936 +
  3.2937 +fi
  3.2938 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
  3.2939 +  cat >>confdefs.h <<_ACEOF
  3.2940 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
  3.2941 +_ACEOF
  3.2942 +
  3.2943 +fi
  3.2944 +
  3.2945 +done
  3.2946 +
  3.2947 +
  3.2948 +echo "$as_me:$LINENO: checking whether strerror must be declared" >&5
  3.2949 +echo $ECHO_N "checking whether strerror must be declared... $ECHO_C" >&6
  3.2950 +if test "${bfd_cv_decl_needed_strerror+set}" = set; then
  3.2951 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.2952 +else
  3.2953 +  cat >conftest.$ac_ext <<_ACEOF
  3.2954 +#line $LINENO "configure"
  3.2955 +/* confdefs.h.  */
  3.2956 +_ACEOF
  3.2957 +cat confdefs.h >>conftest.$ac_ext
  3.2958 +cat >>conftest.$ac_ext <<_ACEOF
  3.2959 +/* end confdefs.h.  */
  3.2960 +
  3.2961 +#include <stdio.h>
  3.2962 +#ifdef HAVE_STRING_H
  3.2963 +#include <string.h>
  3.2964 +#else
  3.2965 +#ifdef HAVE_STRINGS_H
  3.2966 +#include <strings.h>
  3.2967 +#endif
  3.2968 +#endif
  3.2969 +#ifdef HAVE_STDLIB_H
  3.2970 +#include <stdlib.h>
  3.2971 +#endif
  3.2972 +#ifdef HAVE_UNISTD_H
  3.2973 +#include <unistd.h>
  3.2974 +#endif
  3.2975 +int
  3.2976 +main ()
  3.2977 +{
  3.2978 +char *(*pfn) = (char *(*)) strerror
  3.2979 +  ;
  3.2980 +  return 0;
  3.2981 +}
  3.2982 +_ACEOF
  3.2983 +rm -f conftest.$ac_objext
  3.2984 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.2985 +  (eval $ac_compile) 2>&5
  3.2986 +  ac_status=$?
  3.2987 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2988 +  (exit $ac_status); } &&
  3.2989 +         { ac_try='test -s conftest.$ac_objext'
  3.2990 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.2991 +  (eval $ac_try) 2>&5
  3.2992 +  ac_status=$?
  3.2993 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.2994 +  (exit $ac_status); }; }; then
  3.2995 +  bfd_cv_decl_needed_strerror=no
  3.2996 +else
  3.2997 +  echo "$as_me: failed program was:" >&5
  3.2998 +sed 's/^/| /' conftest.$ac_ext >&5
  3.2999 +
  3.3000 +bfd_cv_decl_needed_strerror=yes
  3.3001 +fi
  3.3002 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3003 +fi
  3.3004 +
  3.3005 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_strerror" >&5
  3.3006 +echo "${ECHO_T}$bfd_cv_decl_needed_strerror" >&6
  3.3007 +if test $bfd_cv_decl_needed_strerror = yes; then
  3.3008 +
  3.3009 +cat >>confdefs.h <<\_ACEOF
  3.3010 +#define NEED_DECLARATION_STRERROR 1
  3.3011 +_ACEOF
  3.3012 +
  3.3013 +fi
  3.3014 +
  3.3015 +
  3.3016 +. ${srcdir}/configure.srv
  3.3017 +
  3.3018 +if test "${srv_linux_usrregs}" = "yes"; then
  3.3019 +  cat >>confdefs.h <<\_ACEOF
  3.3020 +#define HAVE_LINUX_USRREGS 1
  3.3021 +_ACEOF
  3.3022 +
  3.3023 +fi
  3.3024 +
  3.3025 +if test "${srv_linux_regsets}" = "yes"; then
  3.3026 +  echo "$as_me:$LINENO: checking for PTRACE_GETREGS" >&5
  3.3027 +echo $ECHO_N "checking for PTRACE_GETREGS... $ECHO_C" >&6
  3.3028 +  if test "${gdbsrv_cv_have_ptrace_getregs+set}" = set; then
  3.3029 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3030 +else
  3.3031 +  cat >conftest.$ac_ext <<_ACEOF
  3.3032 +#line $LINENO "configure"
  3.3033 +/* confdefs.h.  */
  3.3034 +_ACEOF
  3.3035 +cat confdefs.h >>conftest.$ac_ext
  3.3036 +cat >>conftest.$ac_ext <<_ACEOF
  3.3037 +/* end confdefs.h.  */
  3.3038 +#include <sys/ptrace.h>
  3.3039 +int
  3.3040 +main ()
  3.3041 +{
  3.3042 +PTRACE_GETREGS;
  3.3043 +  ;
  3.3044 +  return 0;
  3.3045 +}
  3.3046 +_ACEOF
  3.3047 +rm -f conftest.$ac_objext
  3.3048 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3049 +  (eval $ac_compile) 2>&5
  3.3050 +  ac_status=$?
  3.3051 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3052 +  (exit $ac_status); } &&
  3.3053 +         { ac_try='test -s conftest.$ac_objext'
  3.3054 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3055 +  (eval $ac_try) 2>&5
  3.3056 +  ac_status=$?
  3.3057 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3058 +  (exit $ac_status); }; }; then
  3.3059 +  gdbsrv_cv_have_ptrace_getregs=yes
  3.3060 +else
  3.3061 +  echo "$as_me: failed program was:" >&5
  3.3062 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3063 +
  3.3064 +gdbsrv_cv_have_ptrace_getregs=no
  3.3065 +fi
  3.3066 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3067 +fi
  3.3068 +
  3.3069 +  echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getregs" >&5
  3.3070 +echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getregs" >&6
  3.3071 +  if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
  3.3072 +    cat >>confdefs.h <<\_ACEOF
  3.3073 +#define HAVE_LINUX_REGSETS 1
  3.3074 +_ACEOF
  3.3075 +
  3.3076 +  fi
  3.3077 +
  3.3078 +  echo "$as_me:$LINENO: checking for PTRACE_GETFPXREGS" >&5
  3.3079 +echo $ECHO_N "checking for PTRACE_GETFPXREGS... $ECHO_C" >&6
  3.3080 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs+set}" = set; then
  3.3081 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3082 +else
  3.3083 +  cat >conftest.$ac_ext <<_ACEOF
  3.3084 +#line $LINENO "configure"
  3.3085 +/* confdefs.h.  */
  3.3086 +_ACEOF
  3.3087 +cat confdefs.h >>conftest.$ac_ext
  3.3088 +cat >>conftest.$ac_ext <<_ACEOF
  3.3089 +/* end confdefs.h.  */
  3.3090 +#include <sys/ptrace.h>
  3.3091 +int
  3.3092 +main ()
  3.3093 +{
  3.3094 +PTRACE_GETFPXREGS;
  3.3095 +  ;
  3.3096 +  return 0;
  3.3097 +}
  3.3098 +_ACEOF
  3.3099 +rm -f conftest.$ac_objext
  3.3100 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3101 +  (eval $ac_compile) 2>&5
  3.3102 +  ac_status=$?
  3.3103 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3104 +  (exit $ac_status); } &&
  3.3105 +         { ac_try='test -s conftest.$ac_objext'
  3.3106 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3107 +  (eval $ac_try) 2>&5
  3.3108 +  ac_status=$?
  3.3109 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3110 +  (exit $ac_status); }; }; then
  3.3111 +  gdbsrv_cv_have_ptrace_getfpxregs=yes
  3.3112 +else
  3.3113 +  echo "$as_me: failed program was:" >&5
  3.3114 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3115 +
  3.3116 +gdbsrv_cv_have_ptrace_getfpxregs=no
  3.3117 +fi
  3.3118 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3119 +fi
  3.3120 +
  3.3121 +  echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5
  3.3122 +echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getfpxregs" >&6
  3.3123 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
  3.3124 +    cat >>confdefs.h <<\_ACEOF
  3.3125 +#define HAVE_PTRACE_GETFPXREGS 1
  3.3126 +_ACEOF
  3.3127 +
  3.3128 +  fi
  3.3129 +fi
  3.3130 +
  3.3131 +if test "$ac_cv_header_sys_procfs_h" = yes; then
  3.3132 +  echo "$as_me:$LINENO: checking for lwpid_t in sys/procfs.h" >&5
  3.3133 +echo $ECHO_N "checking for lwpid_t in sys/procfs.h... $ECHO_C" >&6
  3.3134 + if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then
  3.3135 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3136 +else
  3.3137 +  cat >conftest.$ac_ext <<_ACEOF
  3.3138 +#line $LINENO "configure"
  3.3139 +/* confdefs.h.  */
  3.3140 +_ACEOF
  3.3141 +cat confdefs.h >>conftest.$ac_ext
  3.3142 +cat >>conftest.$ac_ext <<_ACEOF
  3.3143 +/* end confdefs.h.  */
  3.3144 +
  3.3145 +#define _SYSCALL32
  3.3146 +#include <sys/procfs.h>
  3.3147 +int
  3.3148 +main ()
  3.3149 +{
  3.3150 +lwpid_t avar
  3.3151 +  ;
  3.3152 +  return 0;
  3.3153 +}
  3.3154 +_ACEOF
  3.3155 +rm -f conftest.$ac_objext
  3.3156 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3157 +  (eval $ac_compile) 2>&5
  3.3158 +  ac_status=$?
  3.3159 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3160 +  (exit $ac_status); } &&
  3.3161 +         { ac_try='test -s conftest.$ac_objext'
  3.3162 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3163 +  (eval $ac_try) 2>&5
  3.3164 +  ac_status=$?
  3.3165 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3166 +  (exit $ac_status); }; }; then
  3.3167 +  bfd_cv_have_sys_procfs_type_lwpid_t=yes
  3.3168 +else
  3.3169 +  echo "$as_me: failed program was:" >&5
  3.3170 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3171 +
  3.3172 +bfd_cv_have_sys_procfs_type_lwpid_t=no
  3.3173 +
  3.3174 +fi
  3.3175 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3176 +fi
  3.3177 +
  3.3178 + if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
  3.3179 +
  3.3180 +cat >>confdefs.h <<\_ACEOF
  3.3181 +#define HAVE_LWPID_T 1
  3.3182 +_ACEOF
  3.3183 +
  3.3184 + fi
  3.3185 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
  3.3186 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpid_t" >&6
  3.3187 +
  3.3188 +  echo "$as_me:$LINENO: checking for psaddr_t in sys/procfs.h" >&5
  3.3189 +echo $ECHO_N "checking for psaddr_t in sys/procfs.h... $ECHO_C" >&6
  3.3190 + if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then
  3.3191 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3192 +else
  3.3193 +  cat >conftest.$ac_ext <<_ACEOF
  3.3194 +#line $LINENO "configure"
  3.3195 +/* confdefs.h.  */
  3.3196 +_ACEOF
  3.3197 +cat confdefs.h >>conftest.$ac_ext
  3.3198 +cat >>conftest.$ac_ext <<_ACEOF
  3.3199 +/* end confdefs.h.  */
  3.3200 +
  3.3201 +#define _SYSCALL32
  3.3202 +#include <sys/procfs.h>
  3.3203 +int
  3.3204 +main ()
  3.3205 +{
  3.3206 +psaddr_t avar
  3.3207 +  ;
  3.3208 +  return 0;
  3.3209 +}
  3.3210 +_ACEOF
  3.3211 +rm -f conftest.$ac_objext
  3.3212 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3213 +  (eval $ac_compile) 2>&5
  3.3214 +  ac_status=$?
  3.3215 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3216 +  (exit $ac_status); } &&
  3.3217 +         { ac_try='test -s conftest.$ac_objext'
  3.3218 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3219 +  (eval $ac_try) 2>&5
  3.3220 +  ac_status=$?
  3.3221 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3222 +  (exit $ac_status); }; }; then
  3.3223 +  bfd_cv_have_sys_procfs_type_psaddr_t=yes
  3.3224 +else
  3.3225 +  echo "$as_me: failed program was:" >&5
  3.3226 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3227 +
  3.3228 +bfd_cv_have_sys_procfs_type_psaddr_t=no
  3.3229 +
  3.3230 +fi
  3.3231 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3232 +fi
  3.3233 +
  3.3234 + if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
  3.3235 +
  3.3236 +cat >>confdefs.h <<\_ACEOF
  3.3237 +#define HAVE_PSADDR_T 1
  3.3238 +_ACEOF
  3.3239 +
  3.3240 + fi
  3.3241 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
  3.3242 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psaddr_t" >&6
  3.3243 +
  3.3244 +  echo "$as_me:$LINENO: checking for prgregset_t in sys/procfs.h" >&5
  3.3245 +echo $ECHO_N "checking for prgregset_t in sys/procfs.h... $ECHO_C" >&6
  3.3246 + if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then
  3.3247 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3248 +else
  3.3249 +  cat >conftest.$ac_ext <<_ACEOF
  3.3250 +#line $LINENO "configure"
  3.3251 +/* confdefs.h.  */
  3.3252 +_ACEOF
  3.3253 +cat confdefs.h >>conftest.$ac_ext
  3.3254 +cat >>conftest.$ac_ext <<_ACEOF
  3.3255 +/* end confdefs.h.  */
  3.3256 +
  3.3257 +#define _SYSCALL32
  3.3258 +#include <sys/procfs.h>
  3.3259 +int
  3.3260 +main ()
  3.3261 +{
  3.3262 +prgregset_t avar
  3.3263 +  ;
  3.3264 +  return 0;
  3.3265 +}
  3.3266 +_ACEOF
  3.3267 +rm -f conftest.$ac_objext
  3.3268 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3269 +  (eval $ac_compile) 2>&5
  3.3270 +  ac_status=$?
  3.3271 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3272 +  (exit $ac_status); } &&
  3.3273 +         { ac_try='test -s conftest.$ac_objext'
  3.3274 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3275 +  (eval $ac_try) 2>&5
  3.3276 +  ac_status=$?
  3.3277 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3278 +  (exit $ac_status); }; }; then
  3.3279 +  bfd_cv_have_sys_procfs_type_prgregset_t=yes
  3.3280 +else
  3.3281 +  echo "$as_me: failed program was:" >&5
  3.3282 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3283 +
  3.3284 +bfd_cv_have_sys_procfs_type_prgregset_t=no
  3.3285 +
  3.3286 +fi
  3.3287 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3288 +fi
  3.3289 +
  3.3290 + if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
  3.3291 +
  3.3292 +cat >>confdefs.h <<\_ACEOF
  3.3293 +#define HAVE_PRGREGSET_T 1
  3.3294 +_ACEOF
  3.3295 +
  3.3296 + fi
  3.3297 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
  3.3298 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prgregset_t" >&6
  3.3299 +
  3.3300 +  echo "$as_me:$LINENO: checking for prfpregset_t in sys/procfs.h" >&5
  3.3301 +echo $ECHO_N "checking for prfpregset_t in sys/procfs.h... $ECHO_C" >&6
  3.3302 + if test "${bfd_cv_have_sys_procfs_type_prfpregset_t+set}" = set; then
  3.3303 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3304 +else
  3.3305 +  cat >conftest.$ac_ext <<_ACEOF
  3.3306 +#line $LINENO "configure"
  3.3307 +/* confdefs.h.  */
  3.3308 +_ACEOF
  3.3309 +cat confdefs.h >>conftest.$ac_ext
  3.3310 +cat >>conftest.$ac_ext <<_ACEOF
  3.3311 +/* end confdefs.h.  */
  3.3312 +
  3.3313 +#define _SYSCALL32
  3.3314 +#include <sys/procfs.h>
  3.3315 +int
  3.3316 +main ()
  3.3317 +{
  3.3318 +prfpregset_t avar
  3.3319 +  ;
  3.3320 +  return 0;
  3.3321 +}
  3.3322 +_ACEOF
  3.3323 +rm -f conftest.$ac_objext
  3.3324 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3325 +  (eval $ac_compile) 2>&5
  3.3326 +  ac_status=$?
  3.3327 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3328 +  (exit $ac_status); } &&
  3.3329 +         { ac_try='test -s conftest.$ac_objext'
  3.3330 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3331 +  (eval $ac_try) 2>&5
  3.3332 +  ac_status=$?
  3.3333 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3334 +  (exit $ac_status); }; }; then
  3.3335 +  bfd_cv_have_sys_procfs_type_prfpregset_t=yes
  3.3336 +else
  3.3337 +  echo "$as_me: failed program was:" >&5
  3.3338 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3339 +
  3.3340 +bfd_cv_have_sys_procfs_type_prfpregset_t=no
  3.3341 +
  3.3342 +fi
  3.3343 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3344 +fi
  3.3345 +
  3.3346 + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
  3.3347 +
  3.3348 +cat >>confdefs.h <<\_ACEOF
  3.3349 +#define HAVE_PRFPREGSET_T 1
  3.3350 +_ACEOF
  3.3351 +
  3.3352 + fi
  3.3353 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
  3.3354 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6
  3.3355 +
  3.3356 +
  3.3357 +
  3.3358 +
  3.3359 +  if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
  3.3360 +    echo "$as_me:$LINENO: checking whether prfpregset_t type is broken" >&5
  3.3361 +echo $ECHO_N "checking whether prfpregset_t type is broken... $ECHO_C" >&6
  3.3362 +    if test "${gdb_cv_prfpregset_t_broken+set}" = set; then
  3.3363 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3364 +else
  3.3365 +  if test "$cross_compiling" = yes; then
  3.3366 +  gdb_cv_prfpregset_t_broken=yes
  3.3367 +else
  3.3368 +  cat >conftest.$ac_ext <<_ACEOF
  3.3369 +#line $LINENO "configure"
  3.3370 +/* confdefs.h.  */
  3.3371 +_ACEOF
  3.3372 +cat confdefs.h >>conftest.$ac_ext
  3.3373 +cat >>conftest.$ac_ext <<_ACEOF
  3.3374 +/* end confdefs.h.  */
  3.3375 +#include <sys/procfs.h>
  3.3376 +       int main ()
  3.3377 +       {
  3.3378 +         if (sizeof (prfpregset_t) == sizeof (void *))
  3.3379 +           return 1;
  3.3380 +         return 0;
  3.3381 +       }
  3.3382 +_ACEOF
  3.3383 +rm -f conftest$ac_exeext
  3.3384 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  3.3385 +  (eval $ac_link) 2>&5
  3.3386 +  ac_status=$?
  3.3387 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3388 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  3.3389 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3390 +  (eval $ac_try) 2>&5
  3.3391 +  ac_status=$?
  3.3392 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3393 +  (exit $ac_status); }; }; then
  3.3394 +  gdb_cv_prfpregset_t_broken=no
  3.3395 +else
  3.3396 +  echo "$as_me: program exited with status $ac_status" >&5
  3.3397 +echo "$as_me: failed program was:" >&5
  3.3398 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3399 +
  3.3400 +( exit $ac_status )
  3.3401 +gdb_cv_prfpregset_t_broken=yes
  3.3402 +fi
  3.3403 +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
  3.3404 +fi
  3.3405 +fi
  3.3406 +
  3.3407 +    echo "$as_me:$LINENO: result: $gdb_cv_prfpregset_t_broken" >&5
  3.3408 +echo "${ECHO_T}$gdb_cv_prfpregset_t_broken" >&6
  3.3409 +    if test $gdb_cv_prfpregset_t_broken = yes; then
  3.3410 +      cat >>confdefs.h <<\_ACEOF
  3.3411 +#define PRFPREGSET_T_BROKEN 1
  3.3412 +_ACEOF
  3.3413 +
  3.3414 +    fi
  3.3415 +  fi
  3.3416 +
  3.3417 +  echo "$as_me:$LINENO: checking for elf_fpregset_t in sys/procfs.h" >&5
  3.3418 +echo $ECHO_N "checking for elf_fpregset_t in sys/procfs.h... $ECHO_C" >&6
  3.3419 + if test "${bfd_cv_have_sys_procfs_type_elf_fpregset_t+set}" = set; then
  3.3420 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  3.3421 +else
  3.3422 +  cat >conftest.$ac_ext <<_ACEOF
  3.3423 +#line $LINENO "configure"
  3.3424 +/* confdefs.h.  */
  3.3425 +_ACEOF
  3.3426 +cat confdefs.h >>conftest.$ac_ext
  3.3427 +cat >>conftest.$ac_ext <<_ACEOF
  3.3428 +/* end confdefs.h.  */
  3.3429 +
  3.3430 +#define _SYSCALL32
  3.3431 +#include <sys/procfs.h>
  3.3432 +int
  3.3433 +main ()
  3.3434 +{
  3.3435 +elf_fpregset_t avar
  3.3436 +  ;
  3.3437 +  return 0;
  3.3438 +}
  3.3439 +_ACEOF
  3.3440 +rm -f conftest.$ac_objext
  3.3441 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  3.3442 +  (eval $ac_compile) 2>&5
  3.3443 +  ac_status=$?
  3.3444 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3445 +  (exit $ac_status); } &&
  3.3446 +         { ac_try='test -s conftest.$ac_objext'
  3.3447 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  3.3448 +  (eval $ac_try) 2>&5
  3.3449 +  ac_status=$?
  3.3450 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  3.3451 +  (exit $ac_status); }; }; then
  3.3452 +  bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
  3.3453 +else
  3.3454 +  echo "$as_me: failed program was:" >&5
  3.3455 +sed 's/^/| /' conftest.$ac_ext >&5
  3.3456 +
  3.3457 +bfd_cv_have_sys_procfs_type_elf_fpregset_t=no
  3.3458 +
  3.3459 +fi
  3.3460 +rm -f conftest.$ac_objext conftest.$ac_ext
  3.3461 +fi
  3.3462 +
  3.3463 + if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then
  3.3464 +
  3.3465 +cat >>confdefs.h <<\_ACEOF
  3.3466 +#define HAVE_ELF_FPREGSET_T 1
  3.3467 +_ACEOF
  3.3468 +
  3.3469 + fi
  3.3470 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
  3.3471 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6
  3.3472 +
  3.3473 +fi
  3.3474 +
  3.3475 +srv_thread_depfiles=
  3.3476 +srv_libs=
  3.3477 +USE_THREAD_DB=
  3.3478 +
  3.3479 +
  3.3480 +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
  3.3481 +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc"
  3.3482 +
  3.3483 +
  3.3484 +
  3.3485 +
  3.3486 +
  3.3487 +          ac_config_files="$ac_config_files Makefile"
  3.3488 +          ac_config_commands="$ac_config_commands default"
  3.3489 +cat >confcache <<\_ACEOF
  3.3490 +# This file is a shell script that caches the results of configure
  3.3491 +# tests run on this system so they can be shared between configure
  3.3492 +# scripts and configure runs, see configure's option --config-cache.
  3.3493 +# It is not useful on other systems.  If it contains results you don't
  3.3494 +# want to keep, you may remove or edit it.
  3.3495 +#
  3.3496 +# config.status only pays attention to the cache file if you give it
  3.3497 +# the --recheck option to rerun configure.
  3.3498 +#
  3.3499 +# `ac_cv_env_foo' variables (set or unset) will be overridden when
  3.3500 +# loading this file, other *unset* `ac_cv_foo' will be assigned the
  3.3501 +# following values.
  3.3502 +
  3.3503 +_ACEOF
  3.3504 +
  3.3505 +# The following way of writing the cache mishandles newlines in values,
  3.3506 +# but we know of no workaround that is simple, portable, and efficient.
  3.3507 +# So, don't put newlines in cache variables' values.
  3.3508 +# Ultrix sh set writes to stderr and can't be redirected directly,
  3.3509 +# and sets the high bit in the cache file unless we assign to the vars.
  3.3510 +{
  3.3511 +  (set) 2>&1 |
  3.3512 +    case `(ac_space=' '; set | grep ac_space) 2>&1` in
  3.3513 +    *ac_space=\ *)
  3.3514 +      # `set' does not quote correctly, so add quotes (double-quote
  3.3515 +      # substitution turns \\\\ into \\, and sed turns \\ into \).
  3.3516 +      sed -n \
  3.3517 +        "s/'/'\\\\''/g;
  3.3518 +    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
  3.3519 +      ;;
  3.3520 +    *)
  3.3521 +      # `set' quotes correctly as required by POSIX, so do not add quotes.
  3.3522 +      sed -n \
  3.3523 +        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
  3.3524 +      ;;
  3.3525 +    esac;
  3.3526 +} |
  3.3527 +  sed '
  3.3528 +     t clear
  3.3529 +     : clear
  3.3530 +     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
  3.3531 +     t end
  3.3532 +     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
  3.3533 +     : end' >>confcache
  3.3534 +if diff $cache_file confcache >/dev/null 2>&1; then :; else
  3.3535 +  if test -w $cache_file; then
  3.3536 +    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
  3.3537 +    cat confcache >$cache_file
  3.3538 +  else
  3.3539 +    echo "not updating unwritable cache $cache_file"
  3.3540 +  fi
  3.3541 +fi
  3.3542 +rm -f confcache
  3.3543 +
  3.3544 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
  3.3545 +# Let make expand exec_prefix.
  3.3546 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  3.3547 +
  3.3548 +# VPATH may cause trouble with some makes, so we remove $(srcdir),
  3.3549 +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
  3.3550 +# trailing colons and then remove the whole line if VPATH becomes empty
  3.3551 +# (actually we leave an empty line to preserve line numbers).
  3.3552 +if test "x$srcdir" = x.; then
  3.3553 +  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
  3.3554 +s/:*\$(srcdir):*/:/;
  3.3555 +s/:*\${srcdir}:*/:/;
  3.3556 +s/:*@srcdir@:*/:/;
  3.3557 +s/^\([^=]*=[ 	]*\):*/\1/;
  3.3558 +s/:*$//;
  3.3559 +s/^[^=]*=[ 	]*$//;
  3.3560 +}'
  3.3561 +fi
  3.3562 +
  3.3563 +DEFS=-DHAVE_CONFIG_H
  3.3564 +
  3.3565 +ac_libobjs=
  3.3566 +ac_ltlibobjs=
  3.3567 +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  3.3568 +  # 1. Remove the extension, and $U if already installed.
  3.3569 +  ac_i=`echo "$ac_i" |
  3.3570 +         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
  3.3571 +  # 2. Add them.
  3.3572 +  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
  3.3573 +  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
  3.3574 +done
  3.3575 +LIBOBJS=$ac_libobjs
  3.3576 +
  3.3577 +LTLIBOBJS=$ac_ltlibobjs
  3.3578 +
  3.3579 +
  3.3580 +
  3.3581 +: ${CONFIG_STATUS=./config.status}
  3.3582 +ac_clean_files_save=$ac_clean_files
  3.3583 +ac_clean_files="$ac_clean_files $CONFIG_STATUS"
  3.3584 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
  3.3585 +echo "$as_me: creating $CONFIG_STATUS" >&6;}
  3.3586 +cat >$CONFIG_STATUS <<_ACEOF
  3.3587 +#! $SHELL
  3.3588 +# Generated by $as_me.
  3.3589 +# Run this file to recreate the current configuration.
  3.3590 +# Compiler output produced by configure, useful for debugging
  3.3591 +# configure, is in config.log if it exists.
  3.3592 +
  3.3593 +debug=false
  3.3594 +ac_cs_recheck=false
  3.3595 +ac_cs_silent=false
  3.3596 +SHELL=\${CONFIG_SHELL-$SHELL}
  3.3597 +_ACEOF
  3.3598 +
  3.3599 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.3600 +## --------------------- ##
  3.3601 +## M4sh Initialization.  ##
  3.3602 +## --------------------- ##
  3.3603 +
  3.3604 +# Be Bourne compatible
  3.3605 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  3.3606 +  emulate sh
  3.3607 +  NULLCMD=:
  3.3608 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  3.3609 +  # is contrary to our usage.  Disable this feature.
  3.3610 +  alias -g '${1+"$@"}'='"$@"'
  3.3611 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  3.3612 +  set -o posix
  3.3613 +fi
  3.3614 +
  3.3615 +# Support unset when possible.
  3.3616 +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
  3.3617 +  as_unset=unset
  3.3618 +else
  3.3619 +  as_unset=false
  3.3620 +fi
  3.3621 +
  3.3622 +
  3.3623 +# Work around bugs in pre-3.0 UWIN ksh.
  3.3624 +$as_unset ENV MAIL MAILPATH
  3.3625 +PS1='$ '
  3.3626 +PS2='> '
  3.3627 +PS4='+ '
  3.3628 +
  3.3629 +# NLS nuisances.
  3.3630 +for as_var in \
  3.3631 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  3.3632 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  3.3633 +  LC_TELEPHONE LC_TIME
  3.3634 +do
  3.3635 +  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
  3.3636 +    eval $as_var=C; export $as_var
  3.3637 +  else
  3.3638 +    $as_unset $as_var
  3.3639 +  fi
  3.3640 +done
  3.3641 +
  3.3642 +# Required to use basename.
  3.3643 +if expr a : '\(a\)' >/dev/null 2>&1; then
  3.3644 +  as_expr=expr
  3.3645 +else
  3.3646 +  as_expr=false
  3.3647 +fi
  3.3648 +
  3.3649 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
  3.3650 +  as_basename=basename
  3.3651 +else
  3.3652 +  as_basename=false
  3.3653 +fi
  3.3654 +
  3.3655 +
  3.3656 +# Name of the executable.
  3.3657 +as_me=`$as_basename "$0" ||
  3.3658 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
  3.3659 +	 X"$0" : 'X\(//\)$' \| \
  3.3660 +	 X"$0" : 'X\(/\)$' \| \
  3.3661 +	 .     : '\(.\)' 2>/dev/null ||
  3.3662 +echo X/"$0" |
  3.3663 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  3.3664 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  3.3665 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
  3.3666 +  	  s/.*/./; q'`
  3.3667 +
  3.3668 +
  3.3669 +# PATH needs CR, and LINENO needs CR and PATH.
  3.3670 +# Avoid depending upon Character Ranges.
  3.3671 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
  3.3672 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  3.3673 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
  3.3674 +as_cr_digits='0123456789'
  3.3675 +as_cr_alnum=$as_cr_Letters$as_cr_digits
  3.3676 +
  3.3677 +# The user is always right.
  3.3678 +if test "${PATH_SEPARATOR+set}" != set; then
  3.3679 +  echo "#! /bin/sh" >conf$$.sh
  3.3680 +  echo  "exit 0"   >>conf$$.sh
  3.3681 +  chmod +x conf$$.sh
  3.3682 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
  3.3683 +    PATH_SEPARATOR=';'
  3.3684 +  else
  3.3685 +    PATH_SEPARATOR=:
  3.3686 +  fi
  3.3687 +  rm -f conf$$.sh
  3.3688 +fi
  3.3689 +
  3.3690 +
  3.3691 +  as_lineno_1=$LINENO
  3.3692 +  as_lineno_2=$LINENO
  3.3693 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  3.3694 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  3.3695 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  3.3696 +  # Find who we are.  Look in the path if we contain no path at all
  3.3697 +  # relative or not.
  3.3698 +  case $0 in
  3.3699 +    *[\\/]* ) as_myself=$0 ;;
  3.3700 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.3701 +for as_dir in $PATH
  3.3702 +do
  3.3703 +  IFS=$as_save_IFS
  3.3704 +  test -z "$as_dir" && as_dir=.
  3.3705 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  3.3706 +done
  3.3707 +
  3.3708 +       ;;
  3.3709 +  esac
  3.3710 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
  3.3711 +  # in which case we are not to be found in the path.
  3.3712 +  if test "x$as_myself" = x; then
  3.3713 +    as_myself=$0
  3.3714 +  fi
  3.3715 +  if test ! -f "$as_myself"; then
  3.3716 +    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
  3.3717 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
  3.3718 +   { (exit 1); exit 1; }; }
  3.3719 +  fi
  3.3720 +  case $CONFIG_SHELL in
  3.3721 +  '')
  3.3722 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3.3723 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
  3.3724 +do
  3.3725 +  IFS=$as_save_IFS
  3.3726 +  test -z "$as_dir" && as_dir=.
  3.3727 +  for as_base in sh bash ksh sh5; do
  3.3728 +	 case $as_dir in
  3.3729 +	 /*)
  3.3730 +	   if ("$as_dir/$as_base" -c '
  3.3731 +  as_lineno_1=$LINENO
  3.3732 +  as_lineno_2=$LINENO
  3.3733 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  3.3734 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  3.3735 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
  3.3736 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
  3.3737 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
  3.3738 +	     CONFIG_SHELL=$as_dir/$as_base
  3.3739 +	     export CONFIG_SHELL
  3.3740 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
  3.3741 +	   fi;;
  3.3742 +	 esac
  3.3743 +       done
  3.3744 +done
  3.3745 +;;
  3.3746 +  esac
  3.3747 +
  3.3748 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  3.3749 +  # uniformly replaced by the line number.  The first 'sed' inserts a
  3.3750 +  # line-number line before each line; the second 'sed' does the real
  3.3751 +  # work.  The second script uses 'N' to pair each line-number line
  3.3752 +  # with the numbered line, and appends trailing '-' during
  3.3753 +  # substitution so that $LINENO is not a special case at line end.
  3.3754 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  3.3755 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  3.3756 +  sed '=' <$as_myself |
  3.3757 +    sed '
  3.3758 +      N
  3.3759 +      s,$,-,
  3.3760 +      : loop
  3.3761 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
  3.3762 +      t loop
  3.3763 +      s,-$,,
  3.3764 +      s,^['$as_cr_digits']*\n,,
  3.3765 +    ' >$as_me.lineno &&
  3.3766 +  chmod +x $as_me.lineno ||
  3.3767 +    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
  3.3768 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
  3.3769 +   { (exit 1); exit 1; }; }
  3.3770 +
  3.3771 +  # Don't try to exec as it changes $[0], causing all sort of problems
  3.3772 +  # (the dirname of $[0] is not the place where we might find the
  3.3773 +  # original and so on.  Autoconf is especially sensible to this).
  3.3774 +  . ./$as_me.lineno
  3.3775 +  # Exit status is that of the last command.
  3.3776 +  exit
  3.3777 +}
  3.3778 +
  3.3779 +
  3.3780 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  3.3781 +  *c*,-n*) ECHO_N= ECHO_C='
  3.3782 +' ECHO_T='	' ;;
  3.3783 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  3.3784 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
  3.3785 +esac
  3.3786 +
  3.3787 +if expr a : '\(a\)' >/dev/null 2>&1; then
  3.3788 +  as_expr=expr
  3.3789 +else
  3.3790 +  as_expr=false
  3.3791 +fi
  3.3792 +
  3.3793 +rm -f conf$$ conf$$.exe conf$$.file
  3.3794 +echo >conf$$.file
  3.3795 +if ln -s conf$$.file conf$$ 2>/dev/null; then
  3.3796 +  # We could just check for DJGPP; but this test a) works b) is more generic
  3.3797 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  3.3798 +  if test -f conf$$.exe; then
  3.3799 +    # Don't use ln at all; we don't have any links
  3.3800 +    as_ln_s='cp -p'
  3.3801 +  else
  3.3802 +    as_ln_s='ln -s'
  3.3803 +  fi
  3.3804 +elif ln conf$$.file conf$$ 2>/dev/null; then
  3.3805 +  as_ln_s=ln
  3.3806 +else
  3.3807 +  as_ln_s='cp -p'
  3.3808 +fi
  3.3809 +rm -f conf$$ conf$$.exe conf$$.file
  3.3810 +
  3.3811 +if mkdir -p . 2>/dev/null; then
  3.3812 +  as_mkdir_p=:
  3.3813 +else
  3.3814 +  as_mkdir_p=false
  3.3815 +fi
  3.3816 +
  3.3817 +as_executable_p="test -f"
  3.3818 +
  3.3819 +# Sed expression to map a string onto a valid CPP name.
  3.3820 +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
  3.3821 +
  3.3822 +# Sed expression to map a string onto a valid variable name.
  3.3823 +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
  3.3824 +
  3.3825 +
  3.3826 +# IFS
  3.3827 +# We need space, tab and new line, in precisely that order.
  3.3828 +as_nl='
  3.3829 +'
  3.3830 +IFS=" 	$as_nl"
  3.3831 +
  3.3832 +# CDPATH.
  3.3833 +$as_unset CDPATH
  3.3834 +
  3.3835 +exec 6>&1
  3.3836 +
  3.3837 +# Open the log real soon, to keep \$[0] and so on meaningful, and to
  3.3838 +# report actual input values of CONFIG_FILES etc. instead of their
  3.3839 +# values after options handling.  Logging --version etc. is OK.
  3.3840 +exec 5>>config.log
  3.3841 +{
  3.3842 +  echo
  3.3843 +  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
  3.3844 +## Running $as_me. ##
  3.3845 +_ASBOX
  3.3846 +} >&5
  3.3847 +cat >&5 <<_CSEOF
  3.3848 +
  3.3849 +This file was extended by $as_me, which was
  3.3850 +generated by GNU Autoconf 2.57.  Invocation command line was
  3.3851 +
  3.3852 +  CONFIG_FILES    = $CONFIG_FILES
  3.3853 +  CONFIG_HEADERS  = $CONFIG_HEADERS
  3.3854 +  CONFIG_LINKS    = $CONFIG_LINKS
  3.3855 +  CONFIG_COMMANDS = $CONFIG_COMMANDS
  3.3856 +  $ $0 $@
  3.3857 +
  3.3858 +_CSEOF
  3.3859 +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
  3.3860 +echo >&5
  3.3861 +_ACEOF
  3.3862 +
  3.3863 +# Files that config.status was made for.
  3.3864 +if test -n "$ac_config_files"; then
  3.3865 +  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
  3.3866 +fi
  3.3867 +
  3.3868 +if test -n "$ac_config_headers"; then
  3.3869 +  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
  3.3870 +fi
  3.3871 +
  3.3872 +if test -n "$ac_config_links"; then
  3.3873 +  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
  3.3874 +fi
  3.3875 +
  3.3876 +if test -n "$ac_config_commands"; then
  3.3877 +  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
  3.3878 +fi
  3.3879 +
  3.3880 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.3881 +
  3.3882 +ac_cs_usage="\
  3.3883 +\`$as_me' instantiates files from templates according to the
  3.3884 +current configuration.
  3.3885 +
  3.3886 +Usage: $0 [OPTIONS] [FILE]...
  3.3887 +
  3.3888 +  -h, --help       print this help, then exit
  3.3889 +  -V, --version    print version number, then exit
  3.3890 +  -q, --quiet      do not print progress messages
  3.3891 +  -d, --debug      don't remove temporary files
  3.3892 +      --recheck    update $as_me by reconfiguring in the same conditions
  3.3893 +  --file=FILE[:TEMPLATE]
  3.3894 +                   instantiate the configuration file FILE
  3.3895 +  --header=FILE[:TEMPLATE]
  3.3896 +                   instantiate the configuration header FILE
  3.3897 +
  3.3898 +Configuration files:
  3.3899 +$config_files
  3.3900 +
  3.3901 +Configuration headers:
  3.3902 +$config_headers
  3.3903 +
  3.3904 +Configuration commands:
  3.3905 +$config_commands
  3.3906 +
  3.3907 +Report bugs to <bug-autoconf@gnu.org>."
  3.3908 +_ACEOF
  3.3909 +
  3.3910 +cat >>$CONFIG_STATUS <<_ACEOF
  3.3911 +ac_cs_version="\\
  3.3912 +config.status
  3.3913 +configured by $0, generated by GNU Autoconf 2.57,
  3.3914 +  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
  3.3915 +
  3.3916 +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
  3.3917 +Free Software Foundation, Inc.
  3.3918 +This config.status script is free software; the Free Software Foundation
  3.3919 +gives unlimited permission to copy, distribute and modify it."
  3.3920 +srcdir=$srcdir
  3.3921 +INSTALL="$INSTALL"
  3.3922 +_ACEOF
  3.3923 +
  3.3924 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.3925 +# If no file are specified by the user, then we need to provide default
  3.3926 +# value.  By we need to know if files were specified by the user.
  3.3927 +ac_need_defaults=:
  3.3928 +while test $# != 0
  3.3929 +do
  3.3930 +  case $1 in
  3.3931 +  --*=*)
  3.3932 +    ac_option=`expr "x$1" : 'x\([^=]*\)='`
  3.3933 +    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
  3.3934 +    ac_shift=:
  3.3935 +    ;;
  3.3936 +  -*)
  3.3937 +    ac_option=$1
  3.3938 +    ac_optarg=$2
  3.3939 +    ac_shift=shift
  3.3940 +    ;;
  3.3941 +  *) # This is not an option, so the user has probably given explicit
  3.3942 +     # arguments.
  3.3943 +     ac_option=$1
  3.3944 +     ac_need_defaults=false;;
  3.3945 +  esac
  3.3946 +
  3.3947 +  case $ac_option in
  3.3948 +  # Handling of the options.
  3.3949 +_ACEOF
  3.3950 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.3951 +  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  3.3952 +    ac_cs_recheck=: ;;
  3.3953 +  --version | --vers* | -V )
  3.3954 +    echo "$ac_cs_version"; exit 0 ;;
  3.3955 +  --he | --h)
  3.3956 +    # Conflict between --help and --header
  3.3957 +    { { echo "$as_me:$LINENO: error: ambiguous option: $1
  3.3958 +Try \`$0 --help' for more information." >&5
  3.3959 +echo "$as_me: error: ambiguous option: $1
  3.3960 +Try \`$0 --help' for more information." >&2;}
  3.3961 +   { (exit 1); exit 1; }; };;
  3.3962 +  --help | --hel | -h )
  3.3963 +    echo "$ac_cs_usage"; exit 0 ;;
  3.3964 +  --debug | --d* | -d )
  3.3965 +    debug=: ;;
  3.3966 +  --file | --fil | --fi | --f )
  3.3967 +    $ac_shift
  3.3968 +    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
  3.3969 +    ac_need_defaults=false;;
  3.3970 +  --header | --heade | --head | --hea )
  3.3971 +    $ac_shift
  3.3972 +    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
  3.3973 +    ac_need_defaults=false;;
  3.3974 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  3.3975 +  | -silent | --silent | --silen | --sile | --sil | --si | --s)
  3.3976 +    ac_cs_silent=: ;;
  3.3977 +
  3.3978 +  # This is an error.
  3.3979 +  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
  3.3980 +Try \`$0 --help' for more information." >&5
  3.3981 +echo "$as_me: error: unrecognized option: $1
  3.3982 +Try \`$0 --help' for more information." >&2;}
  3.3983 +   { (exit 1); exit 1; }; } ;;
  3.3984 +
  3.3985 +  *) ac_config_targets="$ac_config_targets $1" ;;
  3.3986 +
  3.3987 +  esac
  3.3988 +  shift
  3.3989 +done
  3.3990 +
  3.3991 +ac_configure_extra_args=
  3.3992 +
  3.3993 +if $ac_cs_silent; then
  3.3994 +  exec 6>/dev/null
  3.3995 +  ac_configure_extra_args="$ac_configure_extra_args --silent"
  3.3996 +fi
  3.3997 +
  3.3998 +_ACEOF
  3.3999 +cat >>$CONFIG_STATUS <<_ACEOF
  3.4000 +if \$ac_cs_recheck; then
  3.4001 +  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
  3.4002 +  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  3.4003 +fi
  3.4004 +
  3.4005 +_ACEOF
  3.4006 +
  3.4007 +
  3.4008 +
  3.4009 +
  3.4010 +
  3.4011 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4012 +for ac_config_target in $ac_config_targets
  3.4013 +do
  3.4014 +  case "$ac_config_target" in
  3.4015 +  # Handling of arguments.
  3.4016 +  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
  3.4017 +  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
  3.4018 +  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
  3.4019 +  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
  3.4020 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
  3.4021 +   { (exit 1); exit 1; }; };;
  3.4022 +  esac
  3.4023 +done
  3.4024 +
  3.4025 +# If the user did not use the arguments to specify the items to instantiate,
  3.4026 +# then the envvar interface is used.  Set only those that are not.
  3.4027 +# We use the long form for the default assignment because of an extremely
  3.4028 +# bizarre bug on SunOS 4.1.3.
  3.4029 +if $ac_need_defaults; then
  3.4030 +  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  3.4031 +  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  3.4032 +  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
  3.4033 +fi
  3.4034 +
  3.4035 +# Have a temporary directory for convenience.  Make it in the build tree
  3.4036 +# simply because there is no reason to put it here, and in addition,
  3.4037 +# creating and moving files from /tmp can sometimes cause problems.
  3.4038 +# Create a temporary directory, and hook for its removal unless debugging.
  3.4039 +$debug ||
  3.4040 +{
  3.4041 +  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  3.4042 +  trap '{ (exit 1); exit 1; }' 1 2 13 15
  3.4043 +}
  3.4044 +
  3.4045 +# Create a (secure) tmp directory for tmp files.
  3.4046 +
  3.4047 +{
  3.4048 +  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
  3.4049 +  test -n "$tmp" && test -d "$tmp"
  3.4050 +}  ||
  3.4051 +{
  3.4052 +  tmp=./confstat$$-$RANDOM
  3.4053 +  (umask 077 && mkdir $tmp)
  3.4054 +} ||
  3.4055 +{
  3.4056 +   echo "$me: cannot create a temporary directory in ." >&2
  3.4057 +   { (exit 1); exit 1; }
  3.4058 +}
  3.4059 +
  3.4060 +_ACEOF
  3.4061 +
  3.4062 +cat >>$CONFIG_STATUS <<_ACEOF
  3.4063 +
  3.4064 +#
  3.4065 +# CONFIG_FILES section.
  3.4066 +#
  3.4067 +
  3.4068 +# No need to generate the scripts if there are no CONFIG_FILES.
  3.4069 +# This happens for instance when ./config.status config.h
  3.4070 +if test -n "\$CONFIG_FILES"; then
  3.4071 +  # Protect against being on the right side of a sed subst in config.status.
  3.4072 +  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
  3.4073 +   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
  3.4074 +s,@SHELL@,$SHELL,;t t
  3.4075 +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
  3.4076 +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
  3.4077 +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
  3.4078 +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
  3.4079 +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
  3.4080 +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
  3.4081 +s,@exec_prefix@,$exec_prefix,;t t
  3.4082 +s,@prefix@,$prefix,;t t
  3.4083 +s,@program_transform_name@,$program_transform_name,;t t
  3.4084 +s,@bindir@,$bindir,;t t
  3.4085 +s,@sbindir@,$sbindir,;t t
  3.4086 +s,@libexecdir@,$libexecdir,;t t
  3.4087 +s,@datadir@,$datadir,;t t
  3.4088 +s,@sysconfdir@,$sysconfdir,;t t
  3.4089 +s,@sharedstatedir@,$sharedstatedir,;t t
  3.4090 +s,@localstatedir@,$localstatedir,;t t
  3.4091 +s,@libdir@,$libdir,;t t
  3.4092 +s,@includedir@,$includedir,;t t
  3.4093 +s,@oldincludedir@,$oldincludedir,;t t
  3.4094 +s,@infodir@,$infodir,;t t
  3.4095 +s,@mandir@,$mandir,;t t
  3.4096 +s,@build_alias@,$build_alias,;t t
  3.4097 +s,@host_alias@,$host_alias,;t t
  3.4098 +s,@target_alias@,$target_alias,;t t
  3.4099 +s,@DEFS@,$DEFS,;t t
  3.4100 +s,@ECHO_C@,$ECHO_C,;t t
  3.4101 +s,@ECHO_N@,$ECHO_N,;t t
  3.4102 +s,@ECHO_T@,$ECHO_T,;t t
  3.4103 +s,@LIBS@,$LIBS,;t t
  3.4104 +s,@CC@,$CC,;t t
  3.4105 +s,@CFLAGS@,$CFLAGS,;t t
  3.4106 +s,@LDFLAGS@,$LDFLAGS,;t t
  3.4107 +s,@CPPFLAGS@,$CPPFLAGS,;t t
  3.4108 +s,@ac_ct_CC@,$ac_ct_CC,;t t
  3.4109 +s,@EXEEXT@,$EXEEXT,;t t
  3.4110 +s,@OBJEXT@,$OBJEXT,;t t
  3.4111 +s,@build@,$build,;t t
  3.4112 +s,@build_cpu@,$build_cpu,;t t
  3.4113 +s,@build_vendor@,$build_vendor,;t t
  3.4114 +s,@build_os@,$build_os,;t t
  3.4115 +s,@host@,$host,;t t
  3.4116 +s,@host_cpu@,$host_cpu,;t t
  3.4117 +s,@host_vendor@,$host_vendor,;t t
  3.4118 +s,@host_os@,$host_os,;t t
  3.4119 +s,@target@,$target,;t t
  3.4120 +s,@target_cpu@,$target_cpu,;t t
  3.4121 +s,@target_vendor@,$target_vendor,;t t
  3.4122 +s,@target_os@,$target_os,;t t
  3.4123 +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
  3.4124 +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
  3.4125 +s,@INSTALL_DATA@,$INSTALL_DATA,;t t
  3.4126 +s,@CPP@,$CPP,;t t
  3.4127 +s,@EGREP@,$EGREP,;t t
  3.4128 +s,@GDBSERVER_DEPFILES@,$GDBSERVER_DEPFILES,;t t
  3.4129 +s,@GDBSERVER_LIBS@,$GDBSERVER_LIBS,;t t
  3.4130 +s,@USE_THREAD_DB@,$USE_THREAD_DB,;t t
  3.4131 +s,@LIBOBJS@,$LIBOBJS,;t t
  3.4132 +s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  3.4133 +CEOF
  3.4134 +
  3.4135 +_ACEOF
  3.4136 +
  3.4137 +  cat >>$CONFIG_STATUS <<\_ACEOF
  3.4138 +  # Split the substitutions into bite-sized pieces for seds with
  3.4139 +  # small command number limits, like on Digital OSF/1 and HP-UX.
  3.4140 +  ac_max_sed_lines=48
  3.4141 +  ac_sed_frag=1 # Number of current file.
  3.4142 +  ac_beg=1 # First line for current file.
  3.4143 +  ac_end=$ac_max_sed_lines # Line after last line for current file.
  3.4144 +  ac_more_lines=:
  3.4145 +  ac_sed_cmds=
  3.4146 +  while $ac_more_lines; do
  3.4147 +    if test $ac_beg -gt 1; then
  3.4148 +      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
  3.4149 +    else
  3.4150 +      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
  3.4151 +    fi
  3.4152 +    if test ! -s $tmp/subs.frag; then
  3.4153 +      ac_more_lines=false
  3.4154 +    else
  3.4155 +      # The purpose of the label and of the branching condition is to
  3.4156 +      # speed up the sed processing (if there are no `@' at all, there
  3.4157 +      # is no need to browse any of the substitutions).
  3.4158 +      # These are the two extra sed commands mentioned above.
  3.4159 +      (echo ':t
  3.4160 +  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
  3.4161 +      if test -z "$ac_sed_cmds"; then
  3.4162 +  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
  3.4163 +      else
  3.4164 +  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
  3.4165 +      fi
  3.4166 +      ac_sed_frag=`expr $ac_sed_frag + 1`
  3.4167 +      ac_beg=$ac_end
  3.4168 +      ac_end=`expr $ac_end + $ac_max_sed_lines`
  3.4169 +    fi
  3.4170 +  done
  3.4171 +  if test -z "$ac_sed_cmds"; then
  3.4172 +    ac_sed_cmds=cat
  3.4173 +  fi
  3.4174 +fi # test -n "$CONFIG_FILES"
  3.4175 +
  3.4176 +_ACEOF
  3.4177 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4178 +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
  3.4179 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  3.4180 +  case $ac_file in
  3.4181 +  - | *:- | *:-:* ) # input from stdin
  3.4182 +        cat >$tmp/stdin
  3.4183 +        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  3.4184 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  3.4185 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  3.4186 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  3.4187 +  * )   ac_file_in=$ac_file.in ;;
  3.4188 +  esac
  3.4189 +
  3.4190 +  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
  3.4191 +  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
  3.4192 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  3.4193 +         X"$ac_file" : 'X\(//\)[^/]' \| \
  3.4194 +         X"$ac_file" : 'X\(//\)$' \| \
  3.4195 +         X"$ac_file" : 'X\(/\)' \| \
  3.4196 +         .     : '\(.\)' 2>/dev/null ||
  3.4197 +echo X"$ac_file" |
  3.4198 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  3.4199 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  3.4200 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  3.4201 +  	  /^X\(\/\).*/{ s//\1/; q; }
  3.4202 +  	  s/.*/./; q'`
  3.4203 +  { if $as_mkdir_p; then
  3.4204 +    mkdir -p "$ac_dir"
  3.4205 +  else
  3.4206 +    as_dir="$ac_dir"
  3.4207 +    as_dirs=
  3.4208 +    while test ! -d "$as_dir"; do
  3.4209 +      as_dirs="$as_dir $as_dirs"
  3.4210 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
  3.4211 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  3.4212 +         X"$as_dir" : 'X\(//\)[^/]' \| \
  3.4213 +         X"$as_dir" : 'X\(//\)$' \| \
  3.4214 +         X"$as_dir" : 'X\(/\)' \| \
  3.4215 +         .     : '\(.\)' 2>/dev/null ||
  3.4216 +echo X"$as_dir" |
  3.4217 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  3.4218 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  3.4219 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  3.4220 +  	  /^X\(\/\).*/{ s//\1/; q; }
  3.4221 +  	  s/.*/./; q'`
  3.4222 +    done
  3.4223 +    test ! -n "$as_dirs" || mkdir $as_dirs
  3.4224 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
  3.4225 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
  3.4226 +   { (exit 1); exit 1; }; }; }
  3.4227 +
  3.4228 +  ac_builddir=.
  3.4229 +
  3.4230 +if test "$ac_dir" != .; then
  3.4231 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  3.4232 +  # A "../" for each directory in $ac_dir_suffix.
  3.4233 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  3.4234 +else
  3.4235 +  ac_dir_suffix= ac_top_builddir=
  3.4236 +fi
  3.4237 +
  3.4238 +case $srcdir in
  3.4239 +  .)  # No --srcdir option.  We are building in place.
  3.4240 +    ac_srcdir=.
  3.4241 +    if test -z "$ac_top_builddir"; then
  3.4242 +       ac_top_srcdir=.
  3.4243 +    else
  3.4244 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  3.4245 +    fi ;;
  3.4246 +  [\\/]* | ?:[\\/]* )  # Absolute path.
  3.4247 +    ac_srcdir=$srcdir$ac_dir_suffix;
  3.4248 +    ac_top_srcdir=$srcdir ;;
  3.4249 +  *) # Relative path.
  3.4250 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  3.4251 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  3.4252 +esac
  3.4253 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
  3.4254 +# absolute.
  3.4255 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
  3.4256 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
  3.4257 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
  3.4258 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
  3.4259 +
  3.4260 +
  3.4261 +  case $INSTALL in
  3.4262 +  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  3.4263 +  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
  3.4264 +  esac
  3.4265 +
  3.4266 +  if test x"$ac_file" != x-; then
  3.4267 +    { echo "$as_me:$LINENO: creating $ac_file" >&5
  3.4268 +echo "$as_me: creating $ac_file" >&6;}
  3.4269 +    rm -f "$ac_file"
  3.4270 +  fi
  3.4271 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
  3.4272 +  # use $as_me), people would be surprised to read:
  3.4273 +  #    /* config.h.  Generated by config.status.  */
  3.4274 +  if test x"$ac_file" = x-; then
  3.4275 +    configure_input=
  3.4276 +  else
  3.4277 +    configure_input="$ac_file.  "
  3.4278 +  fi
  3.4279 +  configure_input=$configure_input"Generated from `echo $ac_file_in |
  3.4280 +                                     sed 's,.*/,,'` by configure."
  3.4281 +
  3.4282 +  # First look for the input files in the build tree, otherwise in the
  3.4283 +  # src tree.
  3.4284 +  ac_file_inputs=`IFS=:
  3.4285 +    for f in $ac_file_in; do
  3.4286 +      case $f in
  3.4287 +      -) echo $tmp/stdin ;;
  3.4288 +      [\\/$]*)
  3.4289 +         # Absolute (can't be DOS-style, as IFS=:)
  3.4290 +         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  3.4291 +echo "$as_me: error: cannot find input file: $f" >&2;}
  3.4292 +   { (exit 1); exit 1; }; }
  3.4293 +         echo $f;;
  3.4294 +      *) # Relative
  3.4295 +         if test -f "$f"; then
  3.4296 +           # Build tree
  3.4297 +           echo $f
  3.4298 +         elif test -f "$srcdir/$f"; then
  3.4299 +           # Source tree
  3.4300 +           echo $srcdir/$f
  3.4301 +         else
  3.4302 +           # /dev/null tree
  3.4303 +           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  3.4304 +echo "$as_me: error: cannot find input file: $f" >&2;}
  3.4305 +   { (exit 1); exit 1; }; }
  3.4306 +         fi;;
  3.4307 +      esac
  3.4308 +    done` || { (exit 1); exit 1; }
  3.4309 +_ACEOF
  3.4310 +cat >>$CONFIG_STATUS <<_ACEOF
  3.4311 +  sed "$ac_vpsub
  3.4312 +$extrasub
  3.4313 +_ACEOF
  3.4314 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4315 +:t
  3.4316 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
  3.4317 +s,@configure_input@,$configure_input,;t t
  3.4318 +s,@srcdir@,$ac_srcdir,;t t
  3.4319 +s,@abs_srcdir@,$ac_abs_srcdir,;t t
  3.4320 +s,@top_srcdir@,$ac_top_srcdir,;t t
  3.4321 +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
  3.4322 +s,@builddir@,$ac_builddir,;t t
  3.4323 +s,@abs_builddir@,$ac_abs_builddir,;t t
  3.4324 +s,@top_builddir@,$ac_top_builddir,;t t
  3.4325 +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
  3.4326 +s,@INSTALL@,$ac_INSTALL,;t t
  3.4327 +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
  3.4328 +  rm -f $tmp/stdin
  3.4329 +  if test x"$ac_file" != x-; then
  3.4330 +    mv $tmp/out $ac_file
  3.4331 +  else
  3.4332 +    cat $tmp/out
  3.4333 +    rm -f $tmp/out
  3.4334 +  fi
  3.4335 +
  3.4336 +done
  3.4337 +_ACEOF
  3.4338 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4339 +
  3.4340 +#
  3.4341 +# CONFIG_HEADER section.
  3.4342 +#
  3.4343 +
  3.4344 +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  3.4345 +# NAME is the cpp macro being defined and VALUE is the value it is being given.
  3.4346 +#
  3.4347 +# ac_d sets the value in "#define NAME VALUE" lines.
  3.4348 +ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
  3.4349 +ac_dB='[ 	].*$,\1#\2'
  3.4350 +ac_dC=' '
  3.4351 +ac_dD=',;t'
  3.4352 +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  3.4353 +ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
  3.4354 +ac_uB='$,\1#\2define\3'
  3.4355 +ac_uC=' '
  3.4356 +ac_uD=',;t'
  3.4357 +
  3.4358 +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
  3.4359 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  3.4360 +  case $ac_file in
  3.4361 +  - | *:- | *:-:* ) # input from stdin
  3.4362 +        cat >$tmp/stdin
  3.4363 +        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  3.4364 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  3.4365 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  3.4366 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  3.4367 +  * )   ac_file_in=$ac_file.in ;;
  3.4368 +  esac
  3.4369 +
  3.4370 +  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
  3.4371 +echo "$as_me: creating $ac_file" >&6;}
  3.4372 +
  3.4373 +  # First look for the input files in the build tree, otherwise in the
  3.4374 +  # src tree.
  3.4375 +  ac_file_inputs=`IFS=:
  3.4376 +    for f in $ac_file_in; do
  3.4377 +      case $f in
  3.4378 +      -) echo $tmp/stdin ;;
  3.4379 +      [\\/$]*)
  3.4380 +         # Absolute (can't be DOS-style, as IFS=:)
  3.4381 +         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  3.4382 +echo "$as_me: error: cannot find input file: $f" >&2;}
  3.4383 +   { (exit 1); exit 1; }; }
  3.4384 +         echo $f;;
  3.4385 +      *) # Relative
  3.4386 +         if test -f "$f"; then
  3.4387 +           # Build tree
  3.4388 +           echo $f
  3.4389 +         elif test -f "$srcdir/$f"; then
  3.4390 +           # Source tree
  3.4391 +           echo $srcdir/$f
  3.4392 +         else
  3.4393 +           # /dev/null tree
  3.4394 +           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  3.4395 +echo "$as_me: error: cannot find input file: $f" >&2;}
  3.4396 +   { (exit 1); exit 1; }; }
  3.4397 +         fi;;
  3.4398 +      esac
  3.4399 +    done` || { (exit 1); exit 1; }
  3.4400 +  # Remove the trailing spaces.
  3.4401 +  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
  3.4402 +
  3.4403 +_ACEOF
  3.4404 +
  3.4405 +# Transform confdefs.h into two sed scripts, `conftest.defines' and
  3.4406 +# `conftest.undefs', that substitutes the proper values into
  3.4407 +# config.h.in to produce config.h.  The first handles `#define'
  3.4408 +# templates, and the second `#undef' templates.
  3.4409 +# And first: Protect against being on the right side of a sed subst in
  3.4410 +# config.status.  Protect against being in an unquoted here document
  3.4411 +# in config.status.
  3.4412 +rm -f conftest.defines conftest.undefs
  3.4413 +# Using a here document instead of a string reduces the quoting nightmare.
  3.4414 +# Putting comments in sed scripts is not portable.
  3.4415 +#
  3.4416 +# `end' is used to avoid that the second main sed command (meant for
  3.4417 +# 0-ary CPP macros) applies to n-ary macro definitions.
  3.4418 +# See the Autoconf documentation for `clear'.
  3.4419 +cat >confdef2sed.sed <<\_ACEOF
  3.4420 +s/[\\&,]/\\&/g
  3.4421 +s,[\\$`],\\&,g
  3.4422 +t clear
  3.4423 +: clear
  3.4424 +s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
  3.4425 +t end
  3.4426 +s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
  3.4427 +: end
  3.4428 +_ACEOF
  3.4429 +# If some macros were called several times there might be several times
  3.4430 +# the same #defines, which is useless.  Nevertheless, we may not want to
  3.4431 +# sort them, since we want the *last* AC-DEFINE to be honored.
  3.4432 +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
  3.4433 +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
  3.4434 +rm -f confdef2sed.sed
  3.4435 +
  3.4436 +# This sed command replaces #undef with comments.  This is necessary, for
  3.4437 +# example, in the case of _POSIX_SOURCE, which is predefined and required
  3.4438 +# on some systems where configure will not decide to define it.
  3.4439 +cat >>conftest.undefs <<\_ACEOF
  3.4440 +s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  3.4441 +_ACEOF
  3.4442 +
  3.4443 +# Break up conftest.defines because some shells have a limit on the size
  3.4444 +# of here documents, and old seds have small limits too (100 cmds).
  3.4445 +echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
  3.4446 +echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
  3.4447 +echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
  3.4448 +echo '  :' >>$CONFIG_STATUS
  3.4449 +rm -f conftest.tail
  3.4450 +while grep . conftest.defines >/dev/null
  3.4451 +do
  3.4452 +  # Write a limited-size here document to $tmp/defines.sed.
  3.4453 +  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
  3.4454 +  # Speed up: don't consider the non `#define' lines.
  3.4455 +  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
  3.4456 +  # Work around the forget-to-reset-the-flag bug.
  3.4457 +  echo 't clr' >>$CONFIG_STATUS
  3.4458 +  echo ': clr' >>$CONFIG_STATUS
  3.4459 +  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
  3.4460 +  echo 'CEOF
  3.4461 +  sed -f $tmp/defines.sed $tmp/in >$tmp/out
  3.4462 +  rm -f $tmp/in
  3.4463 +  mv $tmp/out $tmp/in
  3.4464 +' >>$CONFIG_STATUS
  3.4465 +  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
  3.4466 +  rm -f conftest.defines
  3.4467 +  mv conftest.tail conftest.defines
  3.4468 +done
  3.4469 +rm -f conftest.defines
  3.4470 +echo '  fi # grep' >>$CONFIG_STATUS
  3.4471 +echo >>$CONFIG_STATUS
  3.4472 +
  3.4473 +# Break up conftest.undefs because some shells have a limit on the size
  3.4474 +# of here documents, and old seds have small limits too (100 cmds).
  3.4475 +echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
  3.4476 +rm -f conftest.tail
  3.4477 +while grep . conftest.undefs >/dev/null
  3.4478 +do
  3.4479 +  # Write a limited-size here document to $tmp/undefs.sed.
  3.4480 +  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
  3.4481 +  # Speed up: don't consider the non `#undef'
  3.4482 +  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
  3.4483 +  # Work around the forget-to-reset-the-flag bug.
  3.4484 +  echo 't clr' >>$CONFIG_STATUS
  3.4485 +  echo ': clr' >>$CONFIG_STATUS
  3.4486 +  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
  3.4487 +  echo 'CEOF
  3.4488 +  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
  3.4489 +  rm -f $tmp/in
  3.4490 +  mv $tmp/out $tmp/in
  3.4491 +' >>$CONFIG_STATUS
  3.4492 +  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
  3.4493 +  rm -f conftest.undefs
  3.4494 +  mv conftest.tail conftest.undefs
  3.4495 +done
  3.4496 +rm -f conftest.undefs
  3.4497 +
  3.4498 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4499 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
  3.4500 +  # use $as_me), people would be surprised to read:
  3.4501 +  #    /* config.h.  Generated by config.status.  */
  3.4502 +  if test x"$ac_file" = x-; then
  3.4503 +    echo "/* Generated by configure.  */" >$tmp/config.h
  3.4504 +  else
  3.4505 +    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
  3.4506 +  fi
  3.4507 +  cat $tmp/in >>$tmp/config.h
  3.4508 +  rm -f $tmp/in
  3.4509 +  if test x"$ac_file" != x-; then
  3.4510 +    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
  3.4511 +      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
  3.4512 +echo "$as_me: $ac_file is unchanged" >&6;}
  3.4513 +    else
  3.4514 +      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
  3.4515 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  3.4516 +         X"$ac_file" : 'X\(//\)[^/]' \| \
  3.4517 +         X"$ac_file" : 'X\(//\)$' \| \
  3.4518 +         X"$ac_file" : 'X\(/\)' \| \
  3.4519 +         .     : '\(.\)' 2>/dev/null ||
  3.4520 +echo X"$ac_file" |
  3.4521 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  3.4522 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  3.4523 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  3.4524 +  	  /^X\(\/\).*/{ s//\1/; q; }
  3.4525 +  	  s/.*/./; q'`
  3.4526 +      { if $as_mkdir_p; then
  3.4527 +    mkdir -p "$ac_dir"
  3.4528 +  else
  3.4529 +    as_dir="$ac_dir"
  3.4530 +    as_dirs=
  3.4531 +    while test ! -d "$as_dir"; do
  3.4532 +      as_dirs="$as_dir $as_dirs"
  3.4533 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
  3.4534 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  3.4535 +         X"$as_dir" : 'X\(//\)[^/]' \| \
  3.4536 +         X"$as_dir" : 'X\(//\)$' \| \
  3.4537 +         X"$as_dir" : 'X\(/\)' \| \
  3.4538 +         .     : '\(.\)' 2>/dev/null ||
  3.4539 +echo X"$as_dir" |
  3.4540 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  3.4541 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  3.4542 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  3.4543 +  	  /^X\(\/\).*/{ s//\1/; q; }
  3.4544 +  	  s/.*/./; q'`
  3.4545 +    done
  3.4546 +    test ! -n "$as_dirs" || mkdir $as_dirs
  3.4547 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
  3.4548 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
  3.4549 +   { (exit 1); exit 1; }; }; }
  3.4550 +
  3.4551 +      rm -f $ac_file
  3.4552 +      mv $tmp/config.h $ac_file
  3.4553 +    fi
  3.4554 +  else
  3.4555 +    cat $tmp/config.h
  3.4556 +    rm -f $tmp/config.h
  3.4557 +  fi
  3.4558 +done
  3.4559 +_ACEOF
  3.4560 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4561 +
  3.4562 +#
  3.4563 +# CONFIG_COMMANDS section.
  3.4564 +#
  3.4565 +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
  3.4566 +  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
  3.4567 +  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
  3.4568 +  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
  3.4569 +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  3.4570 +         X"$ac_dest" : 'X\(//\)[^/]' \| \
  3.4571 +         X"$ac_dest" : 'X\(//\)$' \| \
  3.4572 +         X"$ac_dest" : 'X\(/\)' \| \
  3.4573 +         .     : '\(.\)' 2>/dev/null ||
  3.4574 +echo X"$ac_dest" |
  3.4575 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  3.4576 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  3.4577 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  3.4578 +  	  /^X\(\/\).*/{ s//\1/; q; }
  3.4579 +  	  s/.*/./; q'`
  3.4580 +  ac_builddir=.
  3.4581 +
  3.4582 +if test "$ac_dir" != .; then
  3.4583 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  3.4584 +  # A "../" for each directory in $ac_dir_suffix.
  3.4585 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  3.4586 +else
  3.4587 +  ac_dir_suffix= ac_top_builddir=
  3.4588 +fi
  3.4589 +
  3.4590 +case $srcdir in
  3.4591 +  .)  # No --srcdir option.  We are building in place.
  3.4592 +    ac_srcdir=.
  3.4593 +    if test -z "$ac_top_builddir"; then
  3.4594 +       ac_top_srcdir=.
  3.4595 +    else
  3.4596 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  3.4597 +    fi ;;
  3.4598 +  [\\/]* | ?:[\\/]* )  # Absolute path.
  3.4599 +    ac_srcdir=$srcdir$ac_dir_suffix;
  3.4600 +    ac_top_srcdir=$srcdir ;;
  3.4601 +  *) # Relative path.
  3.4602 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  3.4603 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  3.4604 +esac
  3.4605 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
  3.4606 +# absolute.
  3.4607 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
  3.4608 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
  3.4609 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
  3.4610 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
  3.4611 +
  3.4612 +
  3.4613 +  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
  3.4614 +echo "$as_me: executing $ac_dest commands" >&6;}
  3.4615 +  case $ac_dest in
  3.4616 +    default ) case x$CONFIG_HEADERS in
  3.4617 +xconfig.h:config.in)
  3.4618 +echo > stamp-h ;;
  3.4619 +esac
  3.4620 + ;;
  3.4621 +  esac
  3.4622 +done
  3.4623 +_ACEOF
  3.4624 +
  3.4625 +cat >>$CONFIG_STATUS <<\_ACEOF
  3.4626 +
  3.4627 +{ (exit 0); exit 0; }
  3.4628 +_ACEOF
  3.4629 +chmod +x $CONFIG_STATUS
  3.4630 +ac_clean_files=$ac_clean_files_save
  3.4631 +
  3.4632 +
  3.4633 +# configure is writing to config.log, and then calls config.status.
  3.4634 +# config.status does its own redirection, appending to config.log.
  3.4635 +# Unfortunately, on DOS this fails, as config.log is still kept open
  3.4636 +# by configure, so config.status won't be able to write to it; its
  3.4637 +# output is simply discarded.  So we exec the FD to /dev/null,
  3.4638 +# effectively closing config.log, so it can be properly (re)opened and
  3.4639 +# appended to by config.status.  When coming back to configure, we
  3.4640 +# need to make the FD available again.
  3.4641 +if test "$no_create" != yes; then
  3.4642 +  ac_cs_success=:
  3.4643 +  ac_config_status_args=
  3.4644 +  test "$silent" = yes &&
  3.4645 +    ac_config_status_args="$ac_config_status_args --quiet"
  3.4646 +  exec 5>/dev/null
  3.4647 +  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  3.4648 +  exec 5>>config.log
  3.4649 +  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  3.4650 +  # would make configure fail if this is the last instruction.
  3.4651 +  $ac_cs_success || { (exit 1); exit 1; }
  3.4652 +fi
  3.4653 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in	Sat Jun 04 13:07:05 2005 +0000
     4.3 @@ -0,0 +1,121 @@
     4.4 +dnl Autoconf configure script for GDB server.
     4.5 +dnl Copyright 2000, 2002 Free Software Foundation, Inc.
     4.6 +dnl
     4.7 +dnl This file is part of GDB.
     4.8 +dnl
     4.9 +dnl This program is free software; you can redistribute it and/or modify
    4.10 +dnl it under the terms of the GNU General Public License as published by
    4.11 +dnl the Free Software Foundation; either version 2 of the License, or
    4.12 +dnl (at your option) any later version.
    4.13 +dnl
    4.14 +dnl This program is distributed in the hope that it will be useful,
    4.15 +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.16 +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.17 +dnl GNU General Public License for more details.
    4.18 +dnl
    4.19 +dnl You should have received a copy of the GNU General Public License
    4.20 +dnl along with this program; if not, write to the Free Software
    4.21 +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    4.22 +
    4.23 +dnl Process this file with autoconf to produce a configure script.
    4.24 +
    4.25 +AC_INIT(server.c)
    4.26 +AC_CONFIG_HEADER(config.h:config.in)
    4.27 +
    4.28 +AC_PROG_CC
    4.29 +
    4.30 +AC_CANONICAL_SYSTEM
    4.31 +
    4.32 +AC_PROG_INSTALL
    4.33 +
    4.34 +AC_HEADER_STDC
    4.35 +
    4.36 +AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
    4.37 +		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
    4.38 +		 stdlib.h unistd.h)
    4.39 +
    4.40 +BFD_NEED_DECLARATION(strerror)
    4.41 +
    4.42 +. ${srcdir}/configure.srv
    4.43 +
    4.44 +if test "${srv_linux_usrregs}" = "yes"; then
    4.45 +  AC_DEFINE(HAVE_LINUX_USRREGS)
    4.46 +fi
    4.47 +
    4.48 +if test "${srv_linux_regsets}" = "yes"; then
    4.49 +  AC_MSG_CHECKING(for PTRACE_GETREGS)
    4.50 +  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
    4.51 +  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
    4.52 +		  [PTRACE_GETREGS;],
    4.53 +		  [gdbsrv_cv_have_ptrace_getregs=yes],
    4.54 +		  [gdbsrv_cv_have_ptrace_getregs=no])])
    4.55 +  AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
    4.56 +  if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
    4.57 +    AC_DEFINE(HAVE_LINUX_REGSETS)
    4.58 +  fi
    4.59 +
    4.60 +  AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
    4.61 +  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
    4.62 +  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
    4.63 +		  [PTRACE_GETFPXREGS;],
    4.64 +		  [gdbsrv_cv_have_ptrace_getfpxregs=yes],
    4.65 +		  [gdbsrv_cv_have_ptrace_getfpxregs=no])])
    4.66 +  AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
    4.67 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
    4.68 +    AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
    4.69 +  fi
    4.70 +fi
    4.71 +
    4.72 +if test "$ac_cv_header_sys_procfs_h" = yes; then
    4.73 +  BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
    4.74 +  BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
    4.75 +  BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
    4.76 +  BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
    4.77 +
    4.78 +  dnl Check for broken prfpregset_t type
    4.79 +
    4.80 +  dnl For Linux/i386, glibc 2.1.3 was released with a bogus
    4.81 +  dnl prfpregset_t type (it's a typedef for the pointer to a struct
    4.82 +  dnl instead of the struct itself).  We detect this here, and work
    4.83 +  dnl around it in gdb_proc_service.h.
    4.84 +
    4.85 +  if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
    4.86 +    AC_MSG_CHECKING(whether prfpregset_t type is broken)
    4.87 +    AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
    4.88 +      [AC_TRY_RUN([#include <sys/procfs.h>
    4.89 +       int main ()
    4.90 +       {
    4.91 +         if (sizeof (prfpregset_t) == sizeof (void *))
    4.92 +           return 1;
    4.93 +         return 0;
    4.94 +       }],
    4.95 +       gdb_cv_prfpregset_t_broken=no,
    4.96 +       gdb_cv_prfpregset_t_broken=yes,
    4.97 +       gdb_cv_prfpregset_t_broken=yes)])
    4.98 +    AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
    4.99 +    if test $gdb_cv_prfpregset_t_broken = yes; then
   4.100 +      AC_DEFINE(PRFPREGSET_T_BROKEN)
   4.101 +    fi
   4.102 +  fi
   4.103 +
   4.104 +  BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
   4.105 +fi
   4.106 +
   4.107 +srv_thread_depfiles=
   4.108 +srv_libs=
   4.109 +USE_THREAD_DB=
   4.110 +
   4.111 +
   4.112 +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
   4.113 +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc"
   4.114 +
   4.115 +AC_SUBST(GDBSERVER_DEPFILES)
   4.116 +AC_SUBST(GDBSERVER_LIBS)
   4.117 +AC_SUBST(USE_THREAD_DB)
   4.118 +
   4.119 +AC_OUTPUT(Makefile,
   4.120 +[case x$CONFIG_HEADERS in
   4.121 +xconfig.h:config.in)
   4.122 +echo > stamp-h ;;
   4.123 +esac
   4.124 +])
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.srv	Sat Jun 04 13:07:05 2005 +0000
     5.3 @@ -0,0 +1,75 @@
     5.4 +# Mappings from configuration triplets to gdbserver build options.
     5.5 +# This is invoked from the autoconf-generated configure script, to
     5.6 +# produce the appropriate Makefile substitutions.
     5.7 +
     5.8 +# This file sets the following shell variables:
     5.9 +#   srv_regobj		The register protocol appropriate for this target.
    5.10 +#   srv_tgtobj		Any other target-specific modules appropriate
    5.11 +#			for this target.
    5.12 +#
    5.13 +# In addition, on GNU/Linux the following shell variables will be set:
    5.14 +#   srv_linux_regsets	Set to "yes" if ptrace(PTRACE_GETREGS) and friends
    5.15 +#			may be available on this platform;  unset otherwise.
    5.16 +#			They will only be used if <sys/ptrace.h> defines
    5.17 +#			PTRACE_GETREGS.
    5.18 +#   srv_linux_usrregs	Set to "yes" if we can get at registers via
    5.19 +#			PTRACE_PEEKUSR / PTRACE_POKEUSR.
    5.20 +
    5.21 +# Input is taken from the "${target}" variable.
    5.22 +
    5.23 +case "${target}" in
    5.24 +  arm*-*-linux*)	srv_regobj=reg-arm.o
    5.25 +			srv_tgtobj="linux-xen-low.o linux-arm-low.o"
    5.26 +			srv_linux_usrregs=yes
    5.27 +			srv_linux_thread_db=yes
    5.28 +			;;
    5.29 +  i[34567]86-*-linux*)	srv_regobj=reg-i386-linux.o
    5.30 +			srv_tgtobj="linux-xen-low.o linux-i386-low.o i387-fp.o"
    5.31 +			srv_linux_usrregs=yes
    5.32 +			srv_linux_regsets=yes
    5.33 +			srv_linux_thread_db=yes
    5.34 +			;;
    5.35 +  ia64-*-linux*)	srv_regobj=reg-ia64.o
    5.36 +			srv_tgtobj="linux-low.o linux-ia64-low.o"
    5.37 +			srv_linux_usrregs=yes
    5.38 +			;;
    5.39 +  m68*-*-linux*)	srv_regobj=reg-m68k.o
    5.40 +			srv_tgtobj="linux-low.o linux-m68k-low.o"
    5.41 +			srv_linux_usrregs=yes
    5.42 +			;;
    5.43 +  mips*-*-linux*)	srv_regobj=reg-mips.o
    5.44 +			srv_tgtobj="linux-low.o linux-mips-low.o"
    5.45 +			srv_linux_usrregs=yes
    5.46 +			srv_linux_thread_db=yes
    5.47 +			;;
    5.48 +  powerpc*-*-linux*)	srv_regobj=reg-ppc.o
    5.49 +			srv_tgtobj="linux-low.o linux-ppc-low.o"
    5.50 +			srv_linux_usrregs=yes
    5.51 +			srv_linux_thread_db=yes
    5.52 +			;;
    5.53 +  s390-*-linux*)	srv_regobj=reg-s390.o
    5.54 +			srv_tgtobj="linux-low.o linux-s390-low.o"
    5.55 +			srv_linux_usrregs=yes
    5.56 +			;;
    5.57 +  s390x-*-linux*)	srv_regobj=reg-s390x.o
    5.58 +			srv_tgtobj="linux-low.o linux-s390-low.o"
    5.59 +			srv_linux_usrregs=yes
    5.60 +			;;
    5.61 +  sh*-*-linux*)		srv_regobj=reg-sh.o
    5.62 +			srv_tgtobj="linux-low.o linux-sh-low.o"
    5.63 +			srv_linux_usrregs=yes
    5.64 +			srv_linux_thread_db=yes
    5.65 +			;;
    5.66 +  x86_64-*-linux*)	srv_regobj=reg-x86-64.o
    5.67 +			srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o"
    5.68 +			srv_linux_regsets=yes
    5.69 +			;;
    5.70 +  xscale*-*-linux*)	srv_regobj=reg-arm.o
    5.71 +			srv_tgtobj="linux-low.o linux-arm-low.o"
    5.72 +			srv_linux_usrregs=yes
    5.73 +			srv_linux_thread_db=yes
    5.74 +			;;
    5.75 +  *)			echo "Error: target not supported by gdbserver."
    5.76 +			exit 1
    5.77 +			;;
    5.78 +esac
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/linux-xen-low.c	Sat Jun 04 13:07:05 2005 +0000
     6.3 @@ -0,0 +1,556 @@
     6.4 +/* Low level interface to ptrace, for the remote server for GDB.
     6.5 +   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
     6.6 +   Free Software Foundation, Inc.
     6.7 +
     6.8 +   This file is part of GDB.
     6.9 +
    6.10 +   This program is free software; you can redistribute it and/or modify
    6.11 +   it under the terms of the GNU General Public License as published by
    6.12 +   the Free Software Foundation; either version 2 of the License, or
    6.13 +   (at your option) any later version.
    6.14 +
    6.15 +   This program is distributed in the hope that it will be useful,
    6.16 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.17 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.18 +   GNU General Public License for more details.
    6.19 +
    6.20 +   You should have received a copy of the GNU General Public License
    6.21 +   along with this program; if not, write to the Free Software
    6.22 +   Foundation, Inc., 59 Temple Place - Suite 330,
    6.23 +   Boston, MA 02111-1307, USA.  */
    6.24 +
    6.25 +#include "server.h"
    6.26 +#include "linux-low.h"
    6.27 +
    6.28 +#include <sys/wait.h>
    6.29 +#include <stdio.h>
    6.30 +#include <sys/param.h>
    6.31 +#include <sys/dir.h>
    6.32 +#include <sys/ptrace.h>
    6.33 +#include <sys/user.h>
    6.34 +#include <signal.h>
    6.35 +#include <sys/ioctl.h>
    6.36 +#include <fcntl.h>
    6.37 +#include <string.h>
    6.38 +#include <stdlib.h>
    6.39 +#include <unistd.h>
    6.40 +#include <errno.h>
    6.41 +#include <xc.h>
    6.42 +#define TRACE_ENTER /* printf("enter %s\n", __FUNCTION__) */
    6.43 +long (*myptrace)(enum __ptrace_request, pid_t, long, long);
    6.44 +int (*myxcwait)(int domain, int *status, int options) ;
    6.45 +
    6.46 +
    6.47 +#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
    6.48 +#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut down.             */
    6.49 +#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
    6.50 +#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
    6.51 +#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
    6.52 +
    6.53 +
    6.54 +
    6.55 +struct inferior_list all_processes;
    6.56 +
    6.57 +
    6.58 +static int current_domain;
    6.59 +static int expect_signal = 0;
    6.60 +static int signal_to_send = 0; 
    6.61 +static void linux_resume (struct thread_resume *resume_info);
    6.62 +
    6.63 +int debug_threads;
    6.64 +int using_threads;
    6.65 +extern int isfile;
    6.66 +
    6.67 +struct pending_signals
    6.68 +{
    6.69 +  int signal;
    6.70 +  struct pending_signals *prev;
    6.71 +};
    6.72 +
    6.73 +#define PTRACE_ARG3_TYPE long
    6.74 +#define PTRACE_XFER_TYPE long
    6.75 +
    6.76 +static int use_regsets_p = 1;
    6.77 +
    6.78 +
    6.79 +#define pid_of(proc) ((proc)->head.id)
    6.80 +
    6.81 +/* FIXME: Delete eventually.  */
    6.82 +#define inferior_pid (pid_of (get_thread_process (current_inferior)))
    6.83 +
    6.84 +/* This function should only be called if the process got a SIGTRAP.
    6.85 +   The SIGTRAP could mean several things.
    6.86 +
    6.87 +   On i386, where decr_pc_after_break is non-zero:
    6.88 +   If we were single-stepping this process using PTRACE_SINGLESTEP,
    6.89 +   we will get only the one SIGTRAP (even if the instruction we
    6.90 +   stepped over was a breakpoint).  The value of $eip will be the
    6.91 +   next instruction.
    6.92 +   If we continue the process using PTRACE_CONT, we will get a
    6.93 +   SIGTRAP when we hit a breakpoint.  The value of $eip will be
    6.94 +   the instruction after the breakpoint (i.e. needs to be
    6.95 +   decremented).  If we report the SIGTRAP to GDB, we must also
    6.96 +   report the undecremented PC.  If we cancel the SIGTRAP, we
    6.97 +   must resume at the decremented PC.
    6.98 +
    6.99 +   (Presumably, not yet tested) On a non-decr_pc_after_break machine
   6.100 +   with hardware or kernel single-step:
   6.101 +   If we single-step over a breakpoint instruction, our PC will
   6.102 +   point at the following instruction.  If we continue and hit a
   6.103 +   breakpoint instruction, our PC will point at the breakpoint
   6.104 +   instruction.  */
   6.105 +#if 0
   6.106 +static CORE_ADDR
   6.107 +get_stop_pc (void)
   6.108 +{
   6.109 +  CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
   6.110 +
   6.111 +  if (get_thread_process (current_inferior)->stepping)
   6.112 +    return stop_pc;
   6.113 +  else
   6.114 +    return stop_pc - the_low_target.decr_pc_after_break;
   6.115 +}
   6.116 +#endif
   6.117 +static void *
   6.118 +add_process (int pid)
   6.119 +{
   6.120 +  struct process_info *process;
   6.121 +
   6.122 +  process = (struct process_info *) malloc (sizeof (*process));
   6.123 +  memset (process, 0, sizeof (*process));
   6.124 +
   6.125 +  process->head.id = pid;
   6.126 +
   6.127 +  /* Default to tid == lwpid == pid.  */
   6.128 +  process->tid = pid;
   6.129 +  process->lwpid = pid;
   6.130 +
   6.131 +  add_inferior_to_list (&all_processes, &process->head);
   6.132 +
   6.133 +  return process;
   6.134 +}
   6.135 +
   6.136 +/* Start an inferior process and returns its pid.
   6.137 +   ALLARGS is a vector of program-name and args. */
   6.138 +
   6.139 +static int
   6.140 +linux_create_inferior (char *program, char **allargs)
   6.141 +{
   6.142 +
   6.143 +  fprintf (stderr, "Cannot exec %s: %s.\n", program,
   6.144 +	   strerror (errno));
   6.145 +  fflush (stderr);
   6.146 +  _exit (0177);
   6.147 +  /* NOT REACHED */
   6.148 +  return -1;
   6.149 +}
   6.150 +
   6.151 +int
   6.152 +linux_attach (int domain)
   6.153 +{
   6.154 +    struct process_info *new_process;
   6.155 +    current_domain = domain;
   6.156 +    if (myptrace (PTRACE_ATTACH, domain, 0, 0) != 0) {
   6.157 +	fprintf (stderr, "Cannot attach to domain %d: %s (%d)\n", domain,
   6.158 +		 strerror (errno), errno);
   6.159 +	fflush (stderr);
   6.160 +	_exit (0177);
   6.161 +    }
   6.162 +    
   6.163 +    new_process = (struct process_info *) add_process (domain);
   6.164 +    add_thread (domain, new_process);
   6.165 +
   6.166 +    /* Don't ignore the initial SIGSTOP if we just attached to this process.  */
   6.167 +    new_process->stop_expected = 0;
   6.168 +    
   6.169 +    return 0;
   6.170 +}
   6.171 +
   6.172 +/* Kill the inferior process.  Make us have no inferior.  */
   6.173 +
   6.174 +static void
   6.175 +linux_kill_one_process (struct inferior_list_entry *entry)
   6.176 +{
   6.177 +  struct thread_info *thread = (struct thread_info *) entry;
   6.178 +  struct process_info *process = get_thread_process (thread);
   6.179 +  myptrace (PTRACE_KILL, pid_of (process), 0, 0);
   6.180 +
   6.181 +}
   6.182 +
   6.183 +static void
   6.184 +linux_kill (void)
   6.185 +{
   6.186 +  for_each_inferior (&all_threads, linux_kill_one_process);
   6.187 +}
   6.188 +
   6.189 +
   6.190 +static void
   6.191 +linux_detach_one_process (struct inferior_list_entry *entry)
   6.192 +{
   6.193 +  struct thread_info *thread = (struct thread_info *) entry;
   6.194 +  struct process_info *process = get_thread_process (thread);
   6.195 +
   6.196 +  myptrace (PTRACE_DETACH, pid_of (process), 0, 0);
   6.197 +}
   6.198 +
   6.199 +
   6.200 +static void
   6.201 +linux_detach (void)
   6.202 +{
   6.203 +  for_each_inferior (&all_threads, linux_detach_one_process);
   6.204 +}
   6.205 +
   6.206 +/* Return nonzero if the given thread is still alive.  */
   6.207 +static int
   6.208 +linux_thread_alive (int tid)
   6.209 +{
   6.210 +    if (find_inferior_id (&all_threads, tid) != NULL)
   6.211 +	return 1;
   6.212 +    else
   6.213 +	return 0;
   6.214 +}
   6.215 +
   6.216 +/* Wait for process, returns status.  */
   6.217 +
   6.218 +static unsigned char
   6.219 +linux_wait (char *status)
   6.220 +{
   6.221 +  int w;
   6.222 +  if (myxcwait(current_domain, &w, 0))
   6.223 +      return -1;
   6.224 +  
   6.225 +  if (w & (DOMFLAGS_SHUTDOWN|DOMFLAGS_DYING)) {
   6.226 +      *status = 'W';
   6.227 +      return 0;
   6.228 +  }
   6.229 +
   6.230 +
   6.231 +  *status = 'T';
   6.232 +  if (expect_signal)
   6.233 +      return expect_signal;
   6.234 +  else
   6.235 +      return SIGTRAP;
   6.236 +
   6.237 +}
   6.238 +
   6.239 +static void
   6.240 +linux_resume (struct thread_resume *resume_info)
   6.241 +{
   6.242 +  int step = resume_info->step;
   6.243 +  TRACE_ENTER;
   6.244 +  expect_signal = resume_info->sig;
   6.245 +  for_each_inferior(&all_threads, regcache_invalidate_one);
   6.246 +
   6.247 +  myptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, current_domain, 0, 0);
   6.248 +
   6.249 +}
   6.250 +
   6.251 +
   6.252 +static int
   6.253 +regsets_fetch_inferior_registers ()
   6.254 +{
   6.255 +  struct regset_info *regset;
   6.256 +  TRACE_ENTER;
   6.257 +  regset = target_regsets;
   6.258 +
   6.259 +  while (regset->size >= 0)
   6.260 +    {
   6.261 +      void *buf;
   6.262 +      int res;
   6.263 +
   6.264 +      if (regset->size == 0)
   6.265 +	{
   6.266 +	  regset ++;
   6.267 +	  continue;
   6.268 +	}
   6.269 +
   6.270 +      buf = malloc (regset->size);
   6.271 +      res = myptrace (regset->get_request, inferior_pid, 0, (PTRACE_XFER_TYPE)buf);
   6.272 +      if (res < 0)
   6.273 +	{
   6.274 +	  if (errno == EIO)
   6.275 +	    {
   6.276 +	      /* If we get EIO on the first regset, do not try regsets again.
   6.277 +		 If we get EIO on a later regset, disable that regset.  */
   6.278 +	      if (regset == target_regsets)
   6.279 +		{
   6.280 +		  use_regsets_p = 0;
   6.281 +		  return -1;
   6.282 +		}
   6.283 +	      else
   6.284 +		{
   6.285 +		  regset->size = 0;
   6.286 +		  continue;
   6.287 +		}
   6.288 +	    }
   6.289 +	  else
   6.290 +	    {
   6.291 +	      char s[256];
   6.292 +	      sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d",
   6.293 +		       inferior_pid);
   6.294 +	      perror (s);
   6.295 +	    }
   6.296 +	}
   6.297 +      regset->store_function (buf);
   6.298 +      regset ++;
   6.299 +    }
   6.300 +  return 0;
   6.301 +}
   6.302 +
   6.303 +static int
   6.304 +regsets_store_inferior_registers ()
   6.305 +{
   6.306 +  struct regset_info *regset;
   6.307 +  TRACE_ENTER;
   6.308 +  regset = target_regsets;
   6.309 +
   6.310 +  while (regset->size >= 0)
   6.311 +    {
   6.312 +      void *buf;
   6.313 +      int res;
   6.314 +
   6.315 +      if (regset->size == 0)
   6.316 +	{
   6.317 +	  regset ++;
   6.318 +	  continue;
   6.319 +	}
   6.320 +
   6.321 +      buf = malloc (regset->size);
   6.322 +      regset->fill_function (buf);
   6.323 +      res = myptrace (regset->set_request, inferior_pid, 0, (PTRACE_XFER_TYPE)buf);
   6.324 +      if (res < 0)
   6.325 +	{
   6.326 +	  if (errno == EIO)
   6.327 +	    {
   6.328 +	      /* If we get EIO on the first regset, do not try regsets again.
   6.329 +		 If we get EIO on a later regset, disable that regset.  */
   6.330 +	      if (regset == target_regsets)
   6.331 +		{
   6.332 +		  use_regsets_p = 0;
   6.333 +		  return -1;
   6.334 +		}
   6.335 +	      else
   6.336 +		{
   6.337 +		  regset->size = 0;
   6.338 +		  continue;
   6.339 +		}
   6.340 +	    }
   6.341 +	  else
   6.342 +	    {
   6.343 +#ifdef DEBUG
   6.344 +	      perror ("Warning: ptrace(regsets_store_inferior_registers)");
   6.345 +#endif
   6.346 +	    }
   6.347 +	}
   6.348 +      regset ++;
   6.349 +      free (buf);
   6.350 +    }
   6.351 +  return 0;
   6.352 +}
   6.353 +
   6.354 +
   6.355 +
   6.356 +
   6.357 +void
   6.358 +linux_fetch_registers (int regno)
   6.359 +{
   6.360 +  if (use_regsets_p)
   6.361 +    {
   6.362 +      if (regsets_fetch_inferior_registers () == 0)
   6.363 +	return;
   6.364 +    }
   6.365 +
   6.366 +}
   6.367 +
   6.368 +void
   6.369 +linux_store_registers (int regno)
   6.370 +{
   6.371 +  if (use_regsets_p)
   6.372 +    {
   6.373 +      if (regsets_store_inferior_registers () == 0)
   6.374 +	return;
   6.375 +    }
   6.376 +}
   6.377 +
   6.378 +
   6.379 +/* Copy LEN bytes from inferior's memory starting at MEMADDR
   6.380 +   to debugger memory starting at MYADDR.  */
   6.381 +
   6.382 +static int
   6.383 +linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
   6.384 +{
   6.385 +  register int i;
   6.386 +  /* Round starting address down to longword boundary.  */
   6.387 +  register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
   6.388 +  /* Round ending address up; get number of longwords that makes.  */
   6.389 +  register int count
   6.390 +    = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
   6.391 +      / sizeof (PTRACE_XFER_TYPE);
   6.392 +  /* Allocate buffer of that many longwords.  */
   6.393 +  register PTRACE_XFER_TYPE *buffer
   6.394 +    = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
   6.395 +
   6.396 +  TRACE_ENTER;
   6.397 +  /* Read all the longwords */
   6.398 +  for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
   6.399 +    {
   6.400 +      errno = 0;
   6.401 +      buffer[i] = myptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
   6.402 +      if (errno)
   6.403 +	return errno;
   6.404 +    }
   6.405 +
   6.406 +  /* Copy appropriate bytes out of the buffer.  */
   6.407 +  memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
   6.408 +
   6.409 +  return 0;
   6.410 +}
   6.411 +
   6.412 +/* Copy LEN bytes of data from debugger memory at MYADDR
   6.413 +   to inferior's memory at MEMADDR.
   6.414 +   On failure (cannot write the inferior)
   6.415 +   returns the value of errno.  */
   6.416 +
   6.417 +static int
   6.418 +linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
   6.419 +{
   6.420 +  register int i;
   6.421 +  /* Round starting address down to longword boundary.  */
   6.422 +  register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
   6.423 +  /* Round ending address up; get number of longwords that makes.  */
   6.424 +  register int count
   6.425 +  = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
   6.426 +  /* Allocate buffer of that many longwords.  */
   6.427 +  register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
   6.428 +  extern int errno;
   6.429 +
   6.430 +  TRACE_ENTER;
   6.431 +
   6.432 +  /* Fill start and end extra bytes of buffer with existing memory data.  */
   6.433 +
   6.434 +  buffer[0] = myptrace (PTRACE_PEEKTEXT, inferior_pid,
   6.435 +		      (PTRACE_ARG3_TYPE) addr, 0);
   6.436 +
   6.437 +  if (count > 1)
   6.438 +    {
   6.439 +      buffer[count - 1]
   6.440 +	= myptrace (PTRACE_PEEKTEXT, inferior_pid,
   6.441 +		  (PTRACE_ARG3_TYPE) (addr + (count - 1)
   6.442 +				      * sizeof (PTRACE_XFER_TYPE)),
   6.443 +		  0);
   6.444 +    }
   6.445 +
   6.446 +  /* Copy data to be written over corresponding part of buffer */
   6.447 +
   6.448 +  memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len);
   6.449 +
   6.450 +  /* Write the entire buffer.  */
   6.451 +  for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
   6.452 +    {
   6.453 +      errno = 0;
   6.454 +      myptrace (PTRACE_POKETEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]);
   6.455 +      if (errno)
   6.456 +	return errno;
   6.457 +    }
   6.458 +
   6.459 +  return 0;
   6.460 +}
   6.461 +
   6.462 +static void
   6.463 +linux_look_up_symbols (void)
   6.464 +{
   6.465 +#if 0
   6.466 +  using_threads = thread_db_init ();
   6.467 +#endif
   6.468 +}
   6.469 +
   6.470 +static void
   6.471 +linux_send_signal (int signum)
   6.472 +{
   6.473 +  extern int signal_pid;
   6.474 +
   6.475 +  TRACE_ENTER;
   6.476 +  signal_to_send = signum;
   6.477 +  psignal(signum, "need to send ");
   6.478 +  if (cont_thread > 0)
   6.479 +    {
   6.480 +      struct process_info *process;
   6.481 +
   6.482 +      process = get_thread_process (current_inferior);
   6.483 +      kill (process->lwpid, signum);
   6.484 +    }
   6.485 +  else
   6.486 +    kill (signal_pid, signum);
   6.487 +}
   6.488 +
   6.489 +/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
   6.490 +   to debugger memory starting at MYADDR.  */
   6.491 +
   6.492 +static int
   6.493 +linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
   6.494 +{
   6.495 +  char filename[PATH_MAX];
   6.496 +  int fd, n;
   6.497 +
   6.498 +  TRACE_ENTER;
   6.499 +  snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid);
   6.500 +
   6.501 +  fd = open (filename, O_RDONLY);
   6.502 +  if (fd < 0)
   6.503 +    return -1;
   6.504 +
   6.505 +  if (offset != (CORE_ADDR) 0
   6.506 +      && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
   6.507 +    n = -1;
   6.508 +  else
   6.509 +    n = read (fd, myaddr, len);
   6.510 +
   6.511 +  close (fd);
   6.512 +
   6.513 +  return n;
   6.514 +}
   6.515 +
   6.516 +
   6.517 +static struct target_ops linux_xen_target_ops = {
   6.518 +  linux_create_inferior,
   6.519 +  linux_attach,
   6.520 +  linux_kill,
   6.521 +  linux_detach,
   6.522 +  linux_thread_alive,
   6.523 +  linux_resume,
   6.524 +  linux_wait,
   6.525 +  linux_fetch_registers,
   6.526 +  linux_store_registers,
   6.527 +  linux_read_memory,
   6.528 +  linux_write_memory,
   6.529 +  linux_look_up_symbols,
   6.530 +  linux_send_signal,
   6.531 +  linux_read_auxv,
   6.532 +};
   6.533 +
   6.534 +static void
   6.535 +linux_init_signals ()
   6.536 +{
   6.537 +  /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads
   6.538 +     to find what the cancel signal actually is.  */
   6.539 +  signal (__SIGRTMIN+1, SIG_IGN);
   6.540 +}
   6.541 +
   6.542 +void
   6.543 +initialize_low (void)
   6.544 +{
   6.545 +
   6.546 +  set_target_ops (&linux_xen_target_ops);
   6.547 +  set_breakpoint_data (the_low_target.breakpoint,
   6.548 +		       the_low_target.breakpoint_len);
   6.549 +  init_registers ();
   6.550 +  linux_init_signals ();
   6.551 +  if (isfile) {
   6.552 +      myptrace = xc_ptrace_core;
   6.553 +      myxcwait = xc_waitdomain_core;
   6.554 +  } else {
   6.555 +      myptrace = xc_ptrace;
   6.556 +      myxcwait = xc_waitdomain;
   6.557 +  }
   6.558 +
   6.559 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c	Sat Jun 04 13:07:05 2005 +0000
     7.3 @@ -0,0 +1,639 @@
     7.4 +/* Main code for remote server for GDB.
     7.5 +   Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004
     7.6 +   Free Software Foundation, Inc.
     7.7 +
     7.8 +   This file is part of GDB.
     7.9 +
    7.10 +   This program is free software; you can redistribute it and/or modify
    7.11 +   it under the terms of the GNU General Public License as published by
    7.12 +   the Free Software Foundation; either version 2 of the License, or
    7.13 +   (at your option) any later version.
    7.14 +
    7.15 +   This program is distributed in the hope that it will be useful,
    7.16 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.17 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7.18 +   GNU General Public License for more details.
    7.19 +
    7.20 +   You should have received a copy of the GNU General Public License
    7.21 +   along with this program; if not, write to the Free Software
    7.22 +   Foundation, Inc., 59 Temple Place - Suite 330,
    7.23 +   Boston, MA 02111-1307, USA.  */
    7.24 +
    7.25 +#include "server.h"
    7.26 +
    7.27 +#include <unistd.h>
    7.28 +#include <signal.h>
    7.29 +#include <sys/wait.h>
    7.30 +#include <sys/types.h>
    7.31 +#include <sys/stat.h>
    7.32 +#include <fcntl.h>
    7.33 +
    7.34 +int cont_thread;
    7.35 +int general_thread;
    7.36 +int step_thread;
    7.37 +int thread_from_wait;
    7.38 +int old_thread_from_wait;
    7.39 +int extended_protocol;
    7.40 +int server_waiting;
    7.41 +int isfile = 0;
    7.42 +
    7.43 +jmp_buf toplevel;
    7.44 +
    7.45 +/* The PID of the originally created or attached inferior.  Used to
    7.46 +   send signals to the process when GDB sends us an asynchronous interrupt
    7.47 +   (user hitting Control-C in the client), and to wait for the child to exit
    7.48 +   when no longer debugging it.  */
    7.49 +
    7.50 +int signal_pid;
    7.51 +
    7.52 +static unsigned char
    7.53 +start_inferior (char *argv[], char *statusptr)
    7.54 +{
    7.55 +  signal (SIGTTOU, SIG_DFL);
    7.56 +  signal (SIGTTIN, SIG_DFL);
    7.57 +
    7.58 +  signal_pid = create_inferior (argv[0], argv);
    7.59 +
    7.60 +  fprintf (stderr, "Process %s created; pid = %d\n", argv[0],
    7.61 +	   signal_pid);
    7.62 +
    7.63 +  signal (SIGTTOU, SIG_IGN);
    7.64 +  signal (SIGTTIN, SIG_IGN);
    7.65 +  tcsetpgrp (fileno (stderr), signal_pid);
    7.66 +
    7.67 +  /* Wait till we are at 1st instruction in program, return signal number.  */
    7.68 +  return mywait (statusptr, 0);
    7.69 +}
    7.70 +
    7.71 +static int
    7.72 +attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
    7.73 +{
    7.74 +  /* myattach should return -1 if attaching is unsupported,
    7.75 +     0 if it succeeded, and call error() otherwise.  */
    7.76 +
    7.77 +  if (myattach (pid) != 0)
    7.78 +    return -1;
    7.79 +
    7.80 +  fprintf (stderr, "Attached; pid = %d\n", pid);
    7.81 +
    7.82 +  /* FIXME - It may be that we should get the SIGNAL_PID from the
    7.83 +     attach function, so that it can be the main thread instead of
    7.84 +     whichever we were told to attach to.  */
    7.85 +  signal_pid = pid;
    7.86 +
    7.87 +  *sigptr = mywait (statusptr, 0);
    7.88 +
    7.89 +  return 0;
    7.90 +}
    7.91 +
    7.92 +extern int remote_debug;
    7.93 +
    7.94 +/* Handle all of the extended 'q' packets.  */
    7.95 +void
    7.96 +handle_query (char *own_buf)
    7.97 +{
    7.98 +  static struct inferior_list_entry *thread_ptr;
    7.99 +
   7.100 +  if (strcmp ("qSymbol::", own_buf) == 0)
   7.101 +    {
   7.102 +      if (the_target->look_up_symbols != NULL)
   7.103 +	(*the_target->look_up_symbols) ();
   7.104 +
   7.105 +      strcpy (own_buf, "OK");
   7.106 +      return;
   7.107 +    }
   7.108 +
   7.109 +  if (strcmp ("qfThreadInfo", own_buf) == 0)
   7.110 +    {
   7.111 +      thread_ptr = all_threads.head;
   7.112 +      sprintf (own_buf, "m%x", thread_ptr->id);
   7.113 +      thread_ptr = thread_ptr->next;
   7.114 +      return;
   7.115 +    }
   7.116 +
   7.117 +  if (strcmp ("qsThreadInfo", own_buf) == 0)
   7.118 +    {
   7.119 +      if (thread_ptr != NULL)
   7.120 +	{
   7.121 +	  sprintf (own_buf, "m%x", thread_ptr->id);
   7.122 +	  thread_ptr = thread_ptr->next;
   7.123 +	  return;
   7.124 +	}
   7.125 +      else
   7.126 +	{
   7.127 +	  sprintf (own_buf, "l");
   7.128 +	  return;
   7.129 +	}
   7.130 +    }
   7.131 +
   7.132 +  if (the_target->read_auxv != NULL
   7.133 +      && strncmp ("qPart:auxv:read::", own_buf, 17) == 0)
   7.134 +    {
   7.135 +      char data[(PBUFSIZ - 1) / 2];
   7.136 +      CORE_ADDR ofs;
   7.137 +      unsigned int len;
   7.138 +      int n;
   7.139 +      decode_m_packet (&own_buf[17], &ofs, &len); /* "OFS,LEN" */
   7.140 +      if (len > sizeof data)
   7.141 +	len = sizeof data;
   7.142 +      n = (*the_target->read_auxv) (ofs, data, len);
   7.143 +      if (n == 0)
   7.144 +	write_ok (own_buf);
   7.145 +      else if (n < 0)
   7.146 +	write_enn (own_buf);
   7.147 +      else
   7.148 +	convert_int_to_ascii (data, own_buf, n);
   7.149 +      return;
   7.150 +    }
   7.151 +
   7.152 +  /* Otherwise we didn't know what packet it was.  Say we didn't
   7.153 +     understand it.  */
   7.154 +  own_buf[0] = 0;
   7.155 +}
   7.156 +
   7.157 +/* Parse vCont packets.  */
   7.158 +void
   7.159 +handle_v_cont (char *own_buf, char *status, unsigned char *signal)
   7.160 +{
   7.161 +  char *p, *q;
   7.162 +  int n = 0, i = 0;
   7.163 +  struct thread_resume *resume_info, default_action;
   7.164 +
   7.165 +  /* Count the number of semicolons in the packet.  There should be one
   7.166 +     for every action.  */
   7.167 +  p = &own_buf[5];
   7.168 +  while (p)
   7.169 +    {
   7.170 +      n++;
   7.171 +      p++;
   7.172 +      p = strchr (p, ';');
   7.173 +    }
   7.174 +  /* Allocate room for one extra action, for the default remain-stopped
   7.175 +     behavior; if no default action is in the list, we'll need the extra
   7.176 +     slot.  */
   7.177 +  resume_info = malloc ((n + 1) * sizeof (resume_info[0]));
   7.178 +
   7.179 +  default_action.thread = -1;
   7.180 +  default_action.leave_stopped = 1;
   7.181 +  default_action.step = 0;
   7.182 +  default_action.sig = 0;
   7.183 +
   7.184 +  p = &own_buf[5];
   7.185 +  i = 0;
   7.186 +  while (*p)
   7.187 +    {
   7.188 +      p++;
   7.189 +
   7.190 +      resume_info[i].leave_stopped = 0;
   7.191 +
   7.192 +      if (p[0] == 's' || p[0] == 'S')
   7.193 +	resume_info[i].step = 1;
   7.194 +      else if (p[0] == 'c' || p[0] == 'C')
   7.195 +	resume_info[i].step = 0;
   7.196 +      else
   7.197 +	goto err;
   7.198 +
   7.199 +      if (p[0] == 'S' || p[0] == 'C')
   7.200 +	{
   7.201 +	  int sig;
   7.202 +	  sig = strtol (p + 1, &q, 16);
   7.203 +	  if (p == q)
   7.204 +	    goto err;
   7.205 +	  p = q;
   7.206 +
   7.207 +	  if (!target_signal_to_host_p (sig))
   7.208 +	    goto err;
   7.209 +	  resume_info[i].sig = target_signal_to_host (sig);
   7.210 +	}
   7.211 +      else
   7.212 +	{
   7.213 +	  resume_info[i].sig = 0;
   7.214 +	  p = p + 1;
   7.215 +	}
   7.216 +
   7.217 +      if (p[0] == 0)
   7.218 +	{
   7.219 +	  resume_info[i].thread = -1;
   7.220 +	  default_action = resume_info[i];
   7.221 +
   7.222 +	  /* Note: we don't increment i here, we'll overwrite this entry
   7.223 +	     the next time through.  */
   7.224 +	}
   7.225 +      else if (p[0] == ':')
   7.226 +	{
   7.227 +	  resume_info[i].thread = strtol (p + 1, &q, 16);
   7.228 +	  if (p == q)
   7.229 +	    goto err;
   7.230 +	  p = q;
   7.231 +	  if (p[0] != ';' && p[0] != 0)
   7.232 +	    goto err;
   7.233 +
   7.234 +	  i++;
   7.235 +	}
   7.236 +    }
   7.237 +
   7.238 +  resume_info[i] = default_action;
   7.239 +
   7.240 +  /* Still used in occasional places in the backend.  */
   7.241 +  if (n == 1 && resume_info[0].thread != -1)
   7.242 +    cont_thread = resume_info[0].thread;
   7.243 +  else
   7.244 +    cont_thread = -1;
   7.245 +  set_desired_inferior (0);
   7.246 +
   7.247 +  (*the_target->resume) (resume_info);
   7.248 +
   7.249 +  free (resume_info);
   7.250 +
   7.251 +  *signal = mywait (status, 1);
   7.252 +  prepare_resume_reply (own_buf, *status, *signal);
   7.253 +  return;
   7.254 +
   7.255 +err:
   7.256 +  /* No other way to report an error... */
   7.257 +  strcpy (own_buf, "");
   7.258 +  free (resume_info);
   7.259 +  return;
   7.260 +}
   7.261 +
   7.262 +/* Handle all of the extended 'v' packets.  */
   7.263 +void
   7.264 +handle_v_requests (char *own_buf, char *status, unsigned char *signal)
   7.265 +{
   7.266 +  if (strncmp (own_buf, "vCont;", 6) == 0)
   7.267 +    {
   7.268 +      handle_v_cont (own_buf, status, signal);
   7.269 +      return;
   7.270 +    }
   7.271 +
   7.272 +  if (strncmp (own_buf, "vCont?", 6) == 0)
   7.273 +    {
   7.274 +      strcpy (own_buf, "vCont;c;C;s;S");
   7.275 +      return;
   7.276 +    }
   7.277 +
   7.278 +  /* Otherwise we didn't know what packet it was.  Say we didn't
   7.279 +     understand it.  */
   7.280 +  own_buf[0] = 0;
   7.281 +  return;
   7.282 +}
   7.283 +
   7.284 +void
   7.285 +myresume (int step, int sig)
   7.286 +{
   7.287 +  struct thread_resume resume_info[2];
   7.288 +  int n = 0;
   7.289 +
   7.290 +  if (step || sig || cont_thread > 0)
   7.291 +    {
   7.292 +      resume_info[0].thread
   7.293 +	= ((struct inferior_list_entry *) current_inferior)->id;
   7.294 +      resume_info[0].step = step;
   7.295 +      resume_info[0].sig = sig;
   7.296 +      resume_info[0].leave_stopped = 0;
   7.297 +      n++;
   7.298 +    }
   7.299 +  resume_info[n].thread = -1;
   7.300 +  resume_info[n].step = 0;
   7.301 +  resume_info[n].sig = 0;
   7.302 +  resume_info[n].leave_stopped = (cont_thread > 0);
   7.303 +
   7.304 +  (*the_target->resume) (resume_info);
   7.305 +}
   7.306 +
   7.307 +static int attached;
   7.308 +
   7.309 +static void
   7.310 +gdbserver_usage (void)
   7.311 +{
   7.312 +  error ("Usage:\tgdbserver COMM PROG [ARGS ...]\n"
   7.313 +	 "\tgdbserver COMM --attach PID\n"
   7.314 +	 "\tgdbserver COMM --file COREFILE\n"
   7.315 +	 "\n"
   7.316 +	 "COMM may either be a tty device (for serial debugging), or \n"
   7.317 +	 "HOST:PORT to listen for a TCP connection.\n");
   7.318 +}
   7.319 +
   7.320 +int
   7.321 +main (int argc, char *argv[])
   7.322 +{
   7.323 +  char ch, status, *own_buf, mem_buf[2000];
   7.324 +  int i = 0;
   7.325 +  unsigned char signal;
   7.326 +  unsigned int len;
   7.327 +  CORE_ADDR mem_addr;
   7.328 +  int bad_attach;
   7.329 +  int pid;
   7.330 +  char *arg_end;
   7.331 +
   7.332 +  if (setjmp (toplevel))
   7.333 +    {
   7.334 +      fprintf (stderr, "Exiting\n");
   7.335 +      exit (1);
   7.336 +    }
   7.337 +
   7.338 +  bad_attach = 0;
   7.339 +  pid = 0;
   7.340 +  attached = 0;
   7.341 +  if (argc >= 3 && strcmp (argv[2], "--attach") == 0)
   7.342 +    {
   7.343 +      if (argc == 4
   7.344 +	  && argv[3] != '\0'
   7.345 +	  && (pid = strtoul (argv[3], &arg_end, 10)) != 0
   7.346 +	  && *arg_end == '\0')
   7.347 +	{
   7.348 +	  ;
   7.349 +	}
   7.350 +      else
   7.351 +	bad_attach = 1;
   7.352 +    }
   7.353 +  else if (argc >= 3 && strcmp (argv[2], "--file") == 0)
   7.354 +    {
   7.355 +      if (argc == 4
   7.356 +	  && argv[3] != '\0')
   7.357 +	{
   7.358 +	  if ((pid = open(argv[3], O_RDONLY)) <= 0) 
   7.359 +	    bad_attach = 1;
   7.360 +	  else 
   7.361 +	    isfile = 1;
   7.362 +	}
   7.363 +      else
   7.364 +	bad_attach = 1;
   7.365 +    }
   7.366 +
   7.367 +  if (argc < 3 || bad_attach)
   7.368 +    gdbserver_usage();
   7.369 +
   7.370 +  initialize_low ();
   7.371 +
   7.372 +  own_buf = malloc (PBUFSIZ);
   7.373 +
   7.374 +  if (pid == 0)
   7.375 +    {
   7.376 +      /* Wait till we are at first instruction in program.  */
   7.377 +      signal = start_inferior (&argv[2], &status);
   7.378 +
   7.379 +      /* We are now stopped at the first instruction of the target process */
   7.380 +    }
   7.381 +  else
   7.382 +    {
   7.383 +      switch (attach_inferior (pid, &status, &signal))
   7.384 +	{
   7.385 +	case -1:
   7.386 +	  error ("Attaching not supported on this target");
   7.387 +	  break;
   7.388 +	default:
   7.389 +	  attached = 1;
   7.390 +	  break;
   7.391 +	}
   7.392 +    }
   7.393 +
   7.394 +  while (1)
   7.395 +    {
   7.396 +      remote_open (argv[1]);
   7.397 +
   7.398 +    restart:
   7.399 +      setjmp (toplevel);
   7.400 +      while (getpkt (own_buf) > 0)
   7.401 +	{
   7.402 +	  unsigned char sig;
   7.403 +	  i = 0;
   7.404 +	  ch = own_buf[i++];
   7.405 +	  switch (ch)
   7.406 +	    {
   7.407 +	    case 'q':
   7.408 +	      handle_query (own_buf);
   7.409 +	      break;
   7.410 +	    case 'd':
   7.411 +	      remote_debug = !remote_debug;
   7.412 +	      break;
   7.413 +	    case 'D':
   7.414 +	      fprintf (stderr, "Detaching from inferior\n");
   7.415 +	      detach_inferior ();
   7.416 +	      write_ok (own_buf);
   7.417 +	      putpkt (own_buf);
   7.418 +	      remote_close ();
   7.419 +
   7.420 +	      /* If we are attached, then we can exit.  Otherwise, we need to
   7.421 +		 hang around doing nothing, until the child is gone.  */
   7.422 +	      if (!attached)
   7.423 +		{
   7.424 +		  int status, ret;
   7.425 +
   7.426 +		  do {
   7.427 +		    ret = waitpid (signal_pid, &status, 0);
   7.428 +		    if (WIFEXITED (status) || WIFSIGNALED (status))
   7.429 +		      break;
   7.430 +		  } while (ret != -1 || errno != ECHILD);
   7.431 +		}
   7.432 +
   7.433 +	      exit (0);
   7.434 +
   7.435 +	    case '!':
   7.436 +	      if (attached == 0)
   7.437 +		{
   7.438 +		  extended_protocol = 1;
   7.439 +		  prepare_resume_reply (own_buf, status, signal);
   7.440 +		}
   7.441 +	      else
   7.442 +		{
   7.443 +		  /* We can not use the extended protocol if we are
   7.444 +		     attached, because we can not restart the running
   7.445 +		     program.  So return unrecognized.  */
   7.446 +		  own_buf[0] = '\0';
   7.447 +		}
   7.448 +	      break;
   7.449 +	    case '?':
   7.450 +	      prepare_resume_reply (own_buf, status, signal);
   7.451 +	      break;
   7.452 +	    case 'H':
   7.453 +	      switch (own_buf[1])
   7.454 +		{
   7.455 +		case 'g':
   7.456 +		  general_thread = strtol (&own_buf[2], NULL, 16);
   7.457 +		  write_ok (own_buf);
   7.458 +		  set_desired_inferior (1);
   7.459 +		  break;
   7.460 +		case 'c':
   7.461 +		  cont_thread = strtol (&own_buf[2], NULL, 16);
   7.462 +		  write_ok (own_buf);
   7.463 +		  break;
   7.464 +		case 's':
   7.465 +		  step_thread = strtol (&own_buf[2], NULL, 16);
   7.466 +		  write_ok (own_buf);
   7.467 +		  break;
   7.468 +		default:
   7.469 +		  /* Silently ignore it so that gdb can extend the protocol
   7.470 +		     without compatibility headaches.  */
   7.471 +		  own_buf[0] = '\0';
   7.472 +		  break;
   7.473 +		}
   7.474 +	      break;
   7.475 +	    case 'g':
   7.476 +	      set_desired_inferior (1);
   7.477 +	      registers_to_string (own_buf);
   7.478 +	      break;
   7.479 +	    case 'G':
   7.480 +	      set_desired_inferior (1);
   7.481 +	      registers_from_string (&own_buf[1]);
   7.482 +	      write_ok (own_buf);
   7.483 +	      break;
   7.484 +	    case 'm':
   7.485 +	      decode_m_packet (&own_buf[1], &mem_addr, &len);
   7.486 +	      if (read_inferior_memory (mem_addr, mem_buf, len) == 0)
   7.487 +		convert_int_to_ascii (mem_buf, own_buf, len);
   7.488 +	      else
   7.489 +		write_enn (own_buf);
   7.490 +	      break;
   7.491 +	    case 'M':
   7.492 +	      decode_M_packet (&own_buf[1], &mem_addr, &len, mem_buf);
   7.493 +	      if (write_inferior_memory (mem_addr, mem_buf, len) == 0)
   7.494 +		write_ok (own_buf);
   7.495 +	      else
   7.496 +		write_enn (own_buf);
   7.497 +	      break;
   7.498 +	    case 'C':
   7.499 +	      convert_ascii_to_int (own_buf + 1, &sig, 1);
   7.500 +	      if (target_signal_to_host_p (sig))
   7.501 +		signal = target_signal_to_host (sig);
   7.502 +	      else
   7.503 +		signal = 0;
   7.504 +	      set_desired_inferior (0);
   7.505 +	      myresume (0, signal);
   7.506 +	      signal = mywait (&status, 1);
   7.507 +	      prepare_resume_reply (own_buf, status, signal);
   7.508 +	      break;
   7.509 +	    case 'S':
   7.510 +	      convert_ascii_to_int (own_buf + 1, &sig, 1);
   7.511 +	      if (target_signal_to_host_p (sig))
   7.512 +		signal = target_signal_to_host (sig);
   7.513 +	      else
   7.514 +		signal = 0;
   7.515 +	      set_desired_inferior (0);
   7.516 +	      myresume (1, signal);
   7.517 +	      signal = mywait (&status, 1);
   7.518 +	      prepare_resume_reply (own_buf, status, signal);
   7.519 +	      break;
   7.520 +	    case 'c':
   7.521 +	      set_desired_inferior (0);
   7.522 +	      myresume (0, 0);
   7.523 +	      signal = mywait (&status, 1);
   7.524 +	      prepare_resume_reply (own_buf, status, signal);
   7.525 +	      break;
   7.526 +	    case 's':
   7.527 +	      set_desired_inferior (0);
   7.528 +	      myresume (1, 0);
   7.529 +	      signal = mywait (&status, 1);
   7.530 +	      prepare_resume_reply (own_buf, status, signal);
   7.531 +	      break;
   7.532 +	    case 'k':
   7.533 +	      fprintf (stderr, "Killing inferior\n");
   7.534 +	      kill_inferior ();
   7.535 +	      /* When using the extended protocol, we start up a new
   7.536 +	         debugging session.   The traditional protocol will
   7.537 +	         exit instead.  */
   7.538 +	      if (extended_protocol)
   7.539 +		{
   7.540 +		  write_ok (own_buf);
   7.541 +		  fprintf (stderr, "GDBserver restarting\n");
   7.542 +
   7.543 +		  /* Wait till we are at 1st instruction in prog.  */
   7.544 +		  signal = start_inferior (&argv[2], &status);
   7.545 +		  goto restart;
   7.546 +		  break;
   7.547 +		}
   7.548 +	      else
   7.549 +		{
   7.550 +		  exit (0);
   7.551 +		  break;
   7.552 +		}
   7.553 +	    case 'T':
   7.554 +	      if (mythread_alive (strtol (&own_buf[1], NULL, 16)))
   7.555 +		write_ok (own_buf);
   7.556 +	      else
   7.557 +		write_enn (own_buf);
   7.558 +	      break;
   7.559 +	    case 'R':
   7.560 +	      /* Restarting the inferior is only supported in the
   7.561 +	         extended protocol.  */
   7.562 +	      if (extended_protocol)
   7.563 +		{
   7.564 +		  kill_inferior ();
   7.565 +		  write_ok (own_buf);
   7.566 +		  fprintf (stderr, "GDBserver restarting\n");
   7.567 +
   7.568 +		  /* Wait till we are at 1st instruction in prog.  */
   7.569 +		  signal = start_inferior (&argv[2], &status);
   7.570 +		  goto restart;
   7.571 +		  break;
   7.572 +		}
   7.573 +	      else
   7.574 +		{
   7.575 +		  /* It is a request we don't understand.  Respond with an
   7.576 +		     empty packet so that gdb knows that we don't support this
   7.577 +		     request.  */
   7.578 +		  own_buf[0] = '\0';
   7.579 +		  break;
   7.580 +		}
   7.581 +	    case 'v':
   7.582 +	      /* Extended (long) request.  */
   7.583 +	      handle_v_requests (own_buf, &status, &signal);
   7.584 +	      break;
   7.585 +	    default:
   7.586 +	      /* It is a request we don't understand.  Respond with an
   7.587 +	         empty packet so that gdb knows that we don't support this
   7.588 +	         request.  */
   7.589 +	      own_buf[0] = '\0';
   7.590 +	      break;
   7.591 +	    }
   7.592 +
   7.593 +	  putpkt (own_buf);
   7.594 +
   7.595 +	  if (status == 'W')
   7.596 +	    fprintf (stderr,
   7.597 +		     "\nChild exited with status %d\n", signal);
   7.598 +	  if (status == 'X')
   7.599 +	    fprintf (stderr, "\nChild terminated with signal = 0x%x\n",
   7.600 +		     signal);
   7.601 +	  if (status == 'W' || status == 'X')
   7.602 +	    {
   7.603 +	      if (extended_protocol)
   7.604 +		{
   7.605 +		  fprintf (stderr, "Killing inferior\n");
   7.606 +		  kill_inferior ();
   7.607 +		  write_ok (own_buf);
   7.608 +		  fprintf (stderr, "GDBserver restarting\n");
   7.609 +
   7.610 +		  /* Wait till we are at 1st instruction in prog.  */
   7.611 +		  signal = start_inferior (&argv[2], &status);
   7.612 +		  goto restart;
   7.613 +		  break;
   7.614 +		}
   7.615 +	      else
   7.616 +		{
   7.617 +		  fprintf (stderr, "GDBserver exiting\n");
   7.618 +		  exit (0);
   7.619 +		}
   7.620 +	    }
   7.621 +	}
   7.622 +
   7.623 +      /* We come here when getpkt fails.
   7.624 +
   7.625 +         For the extended remote protocol we exit (and this is the only
   7.626 +         way we gracefully exit!).
   7.627 +
   7.628 +         For the traditional remote protocol close the connection,
   7.629 +         and re-open it at the top of the loop.  */
   7.630 +      if (extended_protocol)
   7.631 +	{
   7.632 +	  remote_close ();
   7.633 +	  exit (0);
   7.634 +	}
   7.635 +      else
   7.636 +	{
   7.637 +	  fprintf (stderr, "Remote side has terminated connection.  "
   7.638 +			   "GDBserver will reopen the connection.\n");
   7.639 +	  remote_close ();
   7.640 +	}
   7.641 +    }
   7.642 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/mkbuildtree	Sat Jun 04 13:07:05 2005 +0000
     8.3 @@ -0,0 +1,115 @@
     8.4 +#!/bin/bash
     8.5 +
     8.6 +# mkbuildtree <build tree>
     8.7 +#
     8.8 +# Creates symbolic links in <build tree> for the sparse tree
     8.9 +# in the current directory.
    8.10 +
    8.11 +# Script to determine the relative path between two directories.
    8.12 +# Copyright (c) D. J. Hawkey Jr. 2002
    8.13 +# Fixed for Xen project by K. Fraser in 2003.  
    8.14 +abs_to_rel ()
    8.15 +{
    8.16 +	local CWD SRCPATH
    8.17 +                
    8.18 +	if [ "$1" != "/" -a "${1##*[^/]}" = "/" ]; then
    8.19 +		SRCPATH=${1%?}
    8.20 +	else
    8.21 +		SRCPATH=$1
    8.22 +	fi
    8.23 +	if [ "$2" != "/" -a "${2##*[^/]}" = "/" ]; then
    8.24 +		DESTPATH=${2%?}
    8.25 +	else
    8.26 +		DESTPATH=$2
    8.27 +	fi
    8.28 +
    8.29 +	CWD=$PWD
    8.30 +	[ "${1%%[^/]*}" != "/" ] && cd $1 && SRCPATH=$PWD
    8.31 +	[ "${2%%[^/]*}" != "/" ] && cd $2 && DESTPATH=$PWD
    8.32 +	[ "$CWD" != "$PWD" ] && cd $CWD
    8.33 +
    8.34 +	BASEPATH=$SRCPATH
    8.35 +
    8.36 +	[ "$SRCPATH" = "$DESTPATH" ] && DESTPATH="." && return
    8.37 +	[ "$SRCPATH" = "/" ] && DESTPATH=${DESTPATH#?} && return
    8.38 +
    8.39 +	while [ "$BASEPATH/" != "${DESTPATH%${DESTPATH#$BASEPATH/}}" ]; do
    8.40 +          BASEPATH=${BASEPATH%/*}
    8.41 +	done
    8.42 +
    8.43 +	SRCPATH=${SRCPATH#$BASEPATH}
    8.44 +        DESTPATH=${DESTPATH#$BASEPATH}
    8.45 +        DESTPATH=${DESTPATH#?}
    8.46 +	while [ -n "$SRCPATH" ]; do
    8.47 +		SRCPATH=${SRCPATH%/*}
    8.48 +		DESTPATH="../$DESTPATH"
    8.49 +	done
    8.50 +
    8.51 +	[ -z "$BASEPATH" ] && BASEPATH="/"
    8.52 +	[ "${DESTPATH##*[^/]}" = "/" ] && DESTPATH=${DESTPATH%?}
    8.53 +}
    8.54 +
    8.55 +# relative_lndir <target_dir>
    8.56 +# Creates a tree of symlinks in the current working directory that mirror
    8.57 +# real files in <target_dir>. <target_dir> should be relative to the current
    8.58 +# working directory. Symlinks in <target_dir> are ignored. Source-control files
    8.59 +# are ignored.
    8.60 +relative_lndir ()
    8.61 +{
    8.62 +  local SYMLINK_DIR REAL_DIR pref i j
    8.63 +  SYMLINK_DIR=$PWD
    8.64 +  REAL_DIR=$1
    8.65 +  (
    8.66 +  cd $REAL_DIR
    8.67 +  for i in `find . -type d | grep -v SCCS`; do
    8.68 +    [ -d $SYMLINK_DIR/$i ] || mkdir -p $SYMLINK_DIR/$i
    8.69 +    (
    8.70 +    cd $i
    8.71 +    pref=`echo $i | sed -e 's#/[^/]*#../#g' -e 's#^\.##'`
    8.72 +    for j in `find . -type f -o -type l -maxdepth 1`; do
    8.73 +      ln -sf ${pref}${REAL_DIR}/$i/$j ${SYMLINK_DIR}/$i/$j
    8.74 +    done
    8.75 +    )
    8.76 +  done
    8.77 +  )
    8.78 +}
    8.79 +
    8.80 +[ "$1" == "" ] && { echo "Syntax: $0 <linux tree to xenify>"; exit 1; }
    8.81 +
    8.82 +# Get absolute path to the destination directory
    8.83 +pushd . >/dev/null
    8.84 +cd ${1}
    8.85 +AD=$PWD
    8.86 +popd >/dev/null
    8.87 +  
    8.88 +# Get absolute path to the source directory
    8.89 +AS=`pwd`
    8.90 +
    8.91 +# Get name of sparse directory
    8.92 +SDN=$(basename $AS)
    8.93 +
    8.94 +# Get path to source, relative to destination
    8.95 +abs_to_rel ${AD} ${AS}
    8.96 +RS=$DESTPATH
    8.97 +
    8.98 +# We now work from the destination directory
    8.99 +cd ${AD}
   8.100 +
   8.101 +# Remove old symlinks
   8.102 +find sys -type l | while read f
   8.103 +do
   8.104 +  case $(readlink $f) in
   8.105 +  */$SDN/*)
   8.106 +    rm -f $f
   8.107 +    ;;
   8.108 +  esac
   8.109 +done
   8.110 +
   8.111 +if [ -f ${AD}/BUILDING ]; then
   8.112 +  # Create symlinks of files and directories which exist in the sparse source
   8.113 +  (cd sys && relative_lndir ../${RS}/sys)
   8.114 +else
   8.115 +  # Create symlinks of files and directories which exist in the sparse source
   8.116 +  relative_lndir ${RS}
   8.117 +  rm -f mkbuildtree
   8.118 +fi
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/tools/debugger/gdb/gdbbuild	Sat Jun 04 13:07:05 2005 +0000
     9.3 @@ -0,0 +1,23 @@
     9.4 +#!/bin/sh
     9.5 +
     9.6 +XENROOT=`bk root`
     9.7 +export XENROOT
     9.8 +
     9.9 +cd $XENROOT/tools/debugger/gdb
    9.10 +rm -rf gdb-6.2.1  gdb-6.2.1-linux-i386-xen
    9.11 +# FIXME:cw this should be smarter
    9.12 +wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-6.2.1.tar.bz2
    9.13 +tar xjf gdb-6.2.1.tar.bz2
    9.14 +
    9.15 +cd $XENROOT/tools/debugger/gdb/gdb-6.2.1-xen-sparse
    9.16 +./mkbuildtree ../gdb-6.2.1
    9.17 +
    9.18 +mkdir $XENROOT/tools/debugger/gdb/gdb-6.2.1-linux-i386-xen
    9.19 +cd $XENROOT/tools/debugger/gdb/gdb-6.2.1-linux-i386-xen
    9.20 +../gdb-6.2.1/configure
    9.21 +# some people don't have gmake
    9.22 +if which gmake ; then
    9.23 +    gmake -j4
    9.24 +else
    9.25 +    make -j4
    9.26 +fi
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tools/debugger/libxendebug/Makefile	Sat Jun 04 13:07:05 2005 +0000
    10.3 @@ -0,0 +1,72 @@
    10.4 +
    10.5 +INSTALL		= install
    10.6 +INSTALL_PROG	= $(INSTALL) -m0755
    10.7 +INSTALL_DATA	= $(INSTALL) -m0644
    10.8 +INSTALL_DIR	= $(INSTALL) -d -m0755
    10.9 +
   10.10 +MAJOR    = 3.0
   10.11 +MINOR    = 0
   10.12 +
   10.13 +CC       = gcc
   10.14 +
   10.15 +XEN_ROOT = ../../..
   10.16 +include $(XEN_ROOT)/tools/Rules.mk
   10.17 +
   10.18 +SRCS     := xendebug.c
   10.19 +
   10.20 +CFLAGS   += -Wall -Werror -O3 -fno-strict-aliasing
   10.21 +CFLAGS   += $(INCLUDES) -I. -I$(XEN_ROOT)/tools/libxc
   10.22 +# Get gcc to generate the dependencies for us.
   10.23 +CFLAGS   += -Wp,-MD,.$(@F).d
   10.24 +DEPS     = .*.d
   10.25 +
   10.26 +LDFLAGS  += -L$(XEN_ROOT)/tools/libxc -lxc
   10.27 +
   10.28 +LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
   10.29 +PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
   10.30 +
   10.31 +LIB      := libxendebug.a libxendebug.so
   10.32 +LIB      += libxendebug.so.$(MAJOR) libxendebug.so.$(MAJOR).$(MINOR)
   10.33 +
   10.34 +all: build
   10.35 +build:
   10.36 +	$(MAKE) $(LIB)
   10.37 +
   10.38 +install: build
   10.39 +	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   10.40 +	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
   10.41 +	$(INSTALL_PROG) libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   10.42 +	$(INSTALL_DATA) libxendebug.a $(DESTDIR)/usr/$(LIBDIR)
   10.43 +	ln -sf libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so.$(MAJOR)
   10.44 +	ln -sf libxendebug.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so
   10.45 +	$(INSTALL_DATA) xendebug.h $(DESTDIR)/usr/include
   10.46 +
   10.47 +.PHONY: TAGS clean rpm install all
   10.48 +
   10.49 +TAGS:
   10.50 +	etags -t $(SRCS) *.h
   10.51 +
   10.52 +clean:
   10.53 +	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
   10.54 +
   10.55 +rpm: build
   10.56 +	rm -rf staging
   10.57 +	mkdir staging
   10.58 +	mkdir staging/i386
   10.59 +	rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
   10.60 +		--define "_rpmdir$$PWD/staging" -bb rpm.spec
   10.61 +	mv staging/i386/*.rpm .
   10.62 +	rm -rf staging
   10.63 +
   10.64 +libxendebug.a: $(LIB_OBJS)
   10.65 +	$(AR) rc $@ $^
   10.66 +
   10.67 +libxendebug.so: libxendebug.so.$(MAJOR)
   10.68 +	ln -sf $< $@
   10.69 +libxendebug.so.$(MAJOR): libxendebug.so.$(MAJOR).$(MINOR)
   10.70 +	ln -sf $< $@
   10.71 +
   10.72 +libxendebug.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
   10.73 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxendebug.so.$(MAJOR) -shared -o $@ $^
   10.74 +
   10.75 +-include $(DEPS)
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/tools/debugger/libxendebug/list.h	Sat Jun 04 13:07:05 2005 +0000
    11.3 @@ -0,0 +1,186 @@
    11.4 +#ifndef _LINUX_LIST_H
    11.5 +#define _LINUX_LIST_H
    11.6 +
    11.7 +/*
    11.8 + * Simple doubly linked list implementation.
    11.9 + *
   11.10 + * Some of the internal functions ("__xxx") are useful when
   11.11 + * manipulating whole lists rather than single entries, as
   11.12 + * sometimes we already know the next/prev entries and we can
   11.13 + * generate better code by using them directly rather than
   11.14 + * using the generic single-entry routines.
   11.15 + */
   11.16 +
   11.17 +struct list_head {
   11.18 +	struct list_head *next, *prev;
   11.19 +};
   11.20 +
   11.21 +#define LIST_HEAD_INIT(name) { &(name), &(name) }
   11.22 +
   11.23 +#define LIST_HEAD(name) \
   11.24 +	struct list_head name = LIST_HEAD_INIT(name)
   11.25 +
   11.26 +#define INIT_LIST_HEAD(ptr) do { \
   11.27 +	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
   11.28 +} while (0)
   11.29 +
   11.30 +/*
   11.31 + * Insert a new entry between two known consecutive entries. 
   11.32 + *
   11.33 + * This is only for internal list manipulation where we know
   11.34 + * the prev/next entries already!
   11.35 + */
   11.36 +static __inline__ void __list_add(struct list_head * new,
   11.37 +	struct list_head * prev,
   11.38 +	struct list_head * next)
   11.39 +{
   11.40 +	next->prev = new;
   11.41 +	new->next = next;
   11.42 +	new->prev = prev;
   11.43 +	prev->next = new;
   11.44 +}
   11.45 +
   11.46 +/**
   11.47 + * list_add - add a new entry
   11.48 + * @new: new entry to be added
   11.49 + * @head: list head to add it after
   11.50 + *
   11.51 + * Insert a new entry after the specified head.
   11.52 + * This is good for implementing stacks.
   11.53 + */
   11.54 +static __inline__ void list_add(struct list_head *new, struct list_head *head)
   11.55 +{
   11.56 +	__list_add(new, head, head->next);
   11.57 +}
   11.58 +
   11.59 +/**
   11.60 + * list_add_tail - add a new entry
   11.61 + * @new: new entry to be added
   11.62 + * @head: list head to add it before
   11.63 + *
   11.64 + * Insert a new entry before the specified head.
   11.65 + * This is useful for implementing queues.
   11.66 + */
   11.67 +static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
   11.68 +{
   11.69 +	__list_add(new, head->prev, head);
   11.70 +}
   11.71 +
   11.72 +/*
   11.73 + * Delete a list entry by making the prev/next entries
   11.74 + * point to each other.
   11.75 + *
   11.76 + * This is only for internal list manipulation where we know
   11.77 + * the prev/next entries already!
   11.78 + */
   11.79 +static __inline__ void __list_del(struct list_head * prev,
   11.80 +				  struct list_head * next)
   11.81 +{
   11.82 +	next->prev = prev;
   11.83 +	prev->next = next;
   11.84 +}
   11.85 +
   11.86 +/**
   11.87 + * list_del - deletes entry from list.
   11.88 + * @entry: the element to delete from the list.
   11.89 + * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
   11.90 + */
   11.91 +static __inline__ void list_del(struct list_head *entry)
   11.92 +{
   11.93 +	__list_del(entry->prev, entry->next);
   11.94 +}
   11.95 +
   11.96 +/**
   11.97 + * list_del_init - deletes entry from list and reinitialize it.
   11.98 + * @entry: the element to delete from the list.
   11.99 + */
  11.100 +static __inline__ void list_del_init(struct list_head *entry)
  11.101 +{
  11.102 +	__list_del(entry->prev, entry->next);
  11.103 +	INIT_LIST_HEAD(entry); 
  11.104 +}
  11.105 +
  11.106 +/**
  11.107 + * list_empty - tests whether a list is empty
  11.108 + * @head: the list to test.
  11.109 + */
  11.110 +static __inline__ int list_empty(struct list_head *head)
  11.111 +{
  11.112 +	return head->next == head;
  11.113 +}
  11.114 +
  11.115 +/**
  11.116 + * list_splice - join two lists
  11.117 + * @list: the new list to add.
  11.118 + * @head: the place to add it in the first list.
  11.119 + */
  11.120 +static __inline__ void list_splice(struct list_head *list, struct list_head *head)
  11.121 +{
  11.122 +	struct list_head *first = list->next;
  11.123 +
  11.124 +	if (first != list) {
  11.125 +		struct list_head *last = list->prev;
  11.126 +		struct list_head *at = head->next;
  11.127 +
  11.128 +		first->prev = head;
  11.129 +		head->next = first;
  11.130 +
  11.131 +		last->next = at;
  11.132 +		at->prev = last;
  11.133 +	}
  11.134 +}
  11.135 +
  11.136 +/**
  11.137 + * list_entry - get the struct for this entry
  11.138 + * @ptr:	the &struct list_head pointer.
  11.139 + * @type:	the type of the struct this is embedded in.
  11.140 + * @member:	the name of the list_struct within the struct.
  11.141 + */
  11.142 +#define list_entry(ptr, type, member) \
  11.143 +	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
  11.144 +
  11.145 +/**
  11.146 + * list_for_each	-	iterate over a list
  11.147 + * @pos:	the &struct list_head to use as a loop counter.
  11.148 + * @head:	the head for your list.
  11.149 + */
  11.150 +#define list_for_each(pos, head) \
  11.151 +	for (pos = (head)->next; pos != (head); pos = pos->next)
  11.152 +        	
  11.153 +/**
  11.154 + * list_for_each_safe	-	iterate over a list safe against removal of list entry
  11.155 + * @pos:	the &struct list_head to use as a loop counter.
  11.156 + * @n:		another &struct list_head to use as temporary storage
  11.157 + * @head:	the head for your list.
  11.158 + */
  11.159 +#define list_for_each_safe(pos, n, head) \
  11.160 +	for (pos = (head)->next, n = pos->next; pos != (head); \
  11.161 +		pos = n, n = pos->next)
  11.162 +
  11.163 +/**
  11.164 + * list_for_each_entry	-	iterate over list of given type
  11.165 + * @pos:	the type * to use as a loop counter.
  11.166 + * @head:	the head for your list.
  11.167 + * @member:	the name of the list_struct within the struct.
  11.168 + */
  11.169 +#define list_for_each_entry(pos, head, member)				\
  11.170 +	for (pos = list_entry((head)->next, typeof(*pos), member),	\
  11.171 +		     prefetch(pos->member.next);			\
  11.172 +	     &pos->member != (head); 					\
  11.173 +	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
  11.174 +		     prefetch(pos->member.next))
  11.175 +
  11.176 +/**
  11.177 + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  11.178 + * @pos:	the type * to use as a loop counter.
  11.179 + * @n:		another type * to use as temporary storage
  11.180 + * @head:	the head for your list.
  11.181 + * @member:	the name of the list_struct within the struct.
  11.182 + */
  11.183 +#define list_for_each_entry_safe(pos, n, head, member)			\
  11.184 +	for (pos = list_entry((head)->next, typeof(*pos), member),	\
  11.185 +		n = list_entry(pos->member.next, typeof(*pos), member);	\
  11.186 +	     &pos->member != (head); 					\
  11.187 +	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
  11.188 +#endif /* _LINUX_LIST_H */
  11.189 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/tools/debugger/libxendebug/xendebug.c	Sat Jun 04 13:07:05 2005 +0000
    12.3 @@ -0,0 +1,599 @@
    12.4 +/*
    12.5 + * xendebug.c
    12.6 + *
    12.7 + * alex ho
    12.8 + * http://www.cl.cam.ac.uk/netos/pdb
    12.9 + *
   12.10 + * xendebug_memory_page adapted from xc_ptrace.c
   12.11 + */
   12.12 +
   12.13 +#include <stdio.h>
   12.14 +#include <stdlib.h>
   12.15 +#include <string.h>
   12.16 +#include <errno.h>
   12.17 +#include <sys/mman.h>
   12.18 +#include <xc.h>
   12.19 +#include "list.h"
   12.20 +
   12.21 +#if defined(__i386__)
   12.22 +#define L1_PAGETABLE_SHIFT       12
   12.23 +#define L2_PAGETABLE_SHIFT       22
   12.24 +#elif defined(__x86_64__)
   12.25 +#define L1_PAGETABLE_SHIFT      12
   12.26 +#define L2_PAGETABLE_SHIFT      21
   12.27 +#define L3_PAGETABLE_SHIFT      30
   12.28 +#define L4_PAGETABLE_SHIFT      39
   12.29 +#endif
   12.30 +
   12.31 +#define PAGE_SHIFT L1_PAGETABLE_SHIFT
   12.32 +#define PAGE_SIZE  (1UL<<PAGE_SHIFT)
   12.33 +#define PAGE_MASK  (~(PAGE_SIZE - 1))
   12.34 +
   12.35 +/* from xen/include/asm-x86/processor.h */
   12.36 +#define X86_EFLAGS_TF	0x00000100 /* Trap Flag */
   12.37 +
   12.38 +typedef int boolean;
   12.39 +#define true 1
   12.40 +#define false 0
   12.41 +
   12.42 +
   12.43 +typedef struct bwcpoint                           /* break/watch/catch point */
   12.44 +{
   12.45 +    struct list_head list;
   12.46 +    memory_t address;
   12.47 +    u32 domain;
   12.48 +    u16 vcpu;
   12.49 +    u8 old_value;                             /* old value for software bkpt */
   12.50 +} bwcpoint_t, *bwcpoint_p;
   12.51 +
   12.52 +static bwcpoint_t bwcpoint_list;
   12.53 +
   12.54 +
   12.55 +
   12.56 +typedef struct domain_context                 /* local cache of domain state */
   12.57 +{
   12.58 +    struct list_head     list;
   12.59 +    u32                  domid;
   12.60 +    boolean              valid[MAX_VIRT_CPUS];
   12.61 +    vcpu_guest_context_t context[MAX_VIRT_CPUS];
   12.62 +
   12.63 +    long            total_pages;
   12.64 +    unsigned long  *page_array;
   12.65 +
   12.66 +    unsigned long   cr3_phys[MAX_VIRT_CPUS];
   12.67 +    unsigned long  *cr3_virt[MAX_VIRT_CPUS];
   12.68 +    unsigned long   pde_phys[MAX_VIRT_CPUS];     
   12.69 +    unsigned long  *pde_virt[MAX_VIRT_CPUS];
   12.70 +    unsigned long   page_phys[MAX_VIRT_CPUS];     
   12.71 +    unsigned long  *page_virt[MAX_VIRT_CPUS];
   12.72 +    int             page_perm[MAX_VIRT_CPUS];
   12.73 +} domain_context_t, *domain_context_p;
   12.74 +
   12.75 +static domain_context_t domain_context_list;
   12.76 +
   12.77 +/* initialization */
   12.78 +
   12.79 +static boolean xendebug_initialized = false;
   12.80 +
   12.81 +static __inline__ void
   12.82 +xendebug_initialize()
   12.83 +{
   12.84 +    if ( !xendebug_initialized )
   12.85 +    {
   12.86 +        memset((void *) &domain_context_list, 0, sizeof(domain_context_t));
   12.87 +        INIT_LIST_HEAD(&domain_context_list.list);
   12.88 +
   12.89 +        memset((void *) &bwcpoint_list, 0, sizeof(bwcpoint_t));
   12.90 +        INIT_LIST_HEAD(&bwcpoint_list.list);
   12.91 +
   12.92 +        xendebug_initialized = true;
   12.93 +    }
   12.94 +}
   12.95 +
   12.96 +/**************/
   12.97 +
   12.98 +static domain_context_p
   12.99 +xendebug_domain_context_search (u32 domid)
  12.100 +{
  12.101 +    struct list_head *entry;
  12.102 +    domain_context_p  ctxt;
  12.103 +
  12.104 +    list_for_each(entry, &domain_context_list.list)
  12.105 +    {
  12.106 +        ctxt = list_entry(entry, domain_context_t, list);
  12.107 +        if ( domid == ctxt->domid )
  12.108 +            return ctxt;
  12.109 +    }
  12.110 +    return (domain_context_p)NULL;
  12.111 +}
  12.112 +
  12.113 +static __inline__ domain_context_p
  12.114 +xendebug_get_context (int xc_handle, u32 domid, u32 vcpu)
  12.115 +{
  12.116 +    int rc;
  12.117 +    domain_context_p ctxt;
  12.118 +
  12.119 +    xendebug_initialize();
  12.120 +
  12.121 +    if ( (ctxt = xendebug_domain_context_search(domid)) == NULL)
  12.122 +        return NULL;
  12.123 +
  12.124 +    if ( !ctxt->valid[vcpu] )
  12.125 +    {
  12.126 +        if ( (rc = xc_domain_get_vcpu_context(xc_handle, domid, vcpu, 
  12.127 +                                              &ctxt->context[vcpu])) )
  12.128 +            return NULL;
  12.129 +
  12.130 +        ctxt->valid[vcpu] = true;
  12.131 +    }
  12.132 +
  12.133 +    return ctxt;
  12.134 +}
  12.135 +
  12.136 +static __inline__ int
  12.137 +xendebug_set_context (int xc_handle, domain_context_p ctxt, u32 vcpu)
  12.138 +{
  12.139 +    dom0_op_t op;
  12.140 +    int rc;
  12.141 +
  12.142 +    if ( !ctxt->valid[vcpu] )
  12.143 +        return -EINVAL;
  12.144 +
  12.145 +    op.interface_version = DOM0_INTERFACE_VERSION;
  12.146 +    op.cmd = DOM0_SETDOMAININFO;
  12.147 +    op.u.setdomaininfo.domain = ctxt->domid;
  12.148 +    op.u.setdomaininfo.vcpu = vcpu;
  12.149 +    op.u.setdomaininfo.ctxt = &ctxt->context[vcpu];
  12.150 +
  12.151 +    if ( (rc = mlock(&ctxt->context[vcpu], sizeof(vcpu_guest_context_t))) )
  12.152 +        return rc;
  12.153 +
  12.154 +    rc = xc_dom0_op(xc_handle, &op);
  12.155 +    (void) munlock(&ctxt->context[vcpu], sizeof(vcpu_guest_context_t));
  12.156 +
  12.157 +    return rc;
  12.158 +}
  12.159 +
  12.160 +/**************/
  12.161 +
  12.162 +int
  12.163 +xendebug_attach(int xc_handle,
  12.164 +                u32 domid,
  12.165 +                u32 vcpu)
  12.166 +{
  12.167 +    domain_context_p ctxt;
  12.168 +
  12.169 +    xendebug_initialize();
  12.170 +
  12.171 +    if ( (ctxt = malloc(sizeof(domain_context_t))) == NULL )
  12.172 +        return -1;
  12.173 +    memset(ctxt, 0, sizeof(domain_context_t));
  12.174 +    
  12.175 +    ctxt->domid = domid;
  12.176 +    list_add(&ctxt->list, &domain_context_list.list);
  12.177 +
  12.178 +    return xc_domain_pause(xc_handle, domid);
  12.179 +}
  12.180 +
  12.181 +int
  12.182 +xendebug_detach(int xc_handle,
  12.183 +                u32 domid,
  12.184 +                u32 vcpu)
  12.185 +{
  12.186 +    domain_context_p ctxt;
  12.187 +    
  12.188 +    xendebug_initialize();
  12.189 +
  12.190 +    if ( (ctxt = xendebug_domain_context_search (domid)) == NULL)
  12.191 +        return -EINVAL;
  12.192 +
  12.193 +    list_del(&ctxt->list);
  12.194 +
  12.195 +    if ( ctxt->page_array ) free(ctxt->page_array);
  12.196 +
  12.197 +    free(ctxt);
  12.198 +
  12.199 +    return xc_domain_unpause(xc_handle, domid);
  12.200 +}
  12.201 +
  12.202 +int
  12.203 +xendebug_read_registers(int xc_handle,
  12.204 +                        u32 domid,
  12.205 +                        u32 vcpu,
  12.206 +                        cpu_user_regs_t **regs)
  12.207 +{
  12.208 +    domain_context_p ctxt;
  12.209 +    int rc = -1;
  12.210 +
  12.211 +    xendebug_initialize();
  12.212 +
  12.213 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.214 +    if (ctxt)
  12.215 +    {
  12.216 +        *regs = &ctxt->context[vcpu].user_regs;
  12.217 +        rc = 0;
  12.218 +    }
  12.219 +
  12.220 +    return rc;
  12.221 +}
  12.222 +
  12.223 +int
  12.224 +xendebug_read_fpregisters (int xc_handle,
  12.225 +                           u32 domid,
  12.226 +                           u32 vcpu,
  12.227 +                           char **regs)
  12.228 +{
  12.229 +    domain_context_p ctxt;
  12.230 +    int rc = -1;
  12.231 +
  12.232 +    xendebug_initialize();
  12.233 +
  12.234 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.235 +    if (ctxt)
  12.236 +    {
  12.237 +        *regs = ctxt->context[vcpu].fpu_ctxt.x;
  12.238 +        rc = 0;
  12.239 +    }
  12.240 +
  12.241 +    return rc;
  12.242 +}
  12.243 +
  12.244 +int
  12.245 +xendebug_write_registers(int xc_handle,
  12.246 +                         u32 domid,
  12.247 +                         u32 vcpu,
  12.248 +                         cpu_user_regs_t *regs)
  12.249 +{
  12.250 +    domain_context_p ctxt;
  12.251 +    int rc = -1;
  12.252 +
  12.253 +    xendebug_initialize();
  12.254 +
  12.255 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.256 +    if (ctxt)
  12.257 +    {
  12.258 +        memcpy(&ctxt->context[vcpu].user_regs, regs, sizeof(cpu_user_regs_t));
  12.259 +        rc = xendebug_set_context(xc_handle, ctxt, vcpu);
  12.260 +    }
  12.261 +    
  12.262 +    return rc;
  12.263 +}
  12.264 +
  12.265 +int
  12.266 +xendebug_step(int xc_handle,
  12.267 +              u32 domid,
  12.268 +              u32 vcpu)
  12.269 +{
  12.270 +    domain_context_p ctxt;
  12.271 +    int rc;
  12.272 +
  12.273 +    xendebug_initialize();
  12.274 +
  12.275 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.276 +    if (!ctxt) return -EINVAL;
  12.277 +
  12.278 +    ctxt->context[vcpu].user_regs.eflags |= X86_EFLAGS_TF;
  12.279 +
  12.280 +    if ( (rc = xendebug_set_context(xc_handle, ctxt, vcpu)) )
  12.281 +        return rc;
  12.282 +
  12.283 +    ctxt->valid[vcpu] = false;
  12.284 +    return xc_domain_unpause(xc_handle, domid);
  12.285 +}
  12.286 +
  12.287 +int
  12.288 +xendebug_continue(int xc_handle,
  12.289 +                  u32 domid,
  12.290 +                  u32 vcpu)
  12.291 +{
  12.292 +    domain_context_p ctxt;
  12.293 +    int rc;
  12.294 +
  12.295 +    xendebug_initialize();
  12.296 +
  12.297 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.298 +    if (!ctxt) return -EINVAL;
  12.299 +
  12.300 +    if ( ctxt->context[vcpu].user_regs.eflags & X86_EFLAGS_TF )
  12.301 +    {
  12.302 +        ctxt->context[vcpu].user_regs.eflags &= ~X86_EFLAGS_TF;
  12.303 +        if ( (rc = xendebug_set_context(xc_handle, ctxt, vcpu)) )
  12.304 +            return rc;
  12.305 +    }
  12.306 +    ctxt->valid[vcpu] = false;
  12.307 +    return xc_domain_unpause(xc_handle, domid);
  12.308 +}
  12.309 +
  12.310 +/*************************************************/
  12.311 +
  12.312 +#define vtopdi(va) ((va) >> L2_PAGETABLE_SHIFT)
  12.313 +#define vtopti(va) (((va) >> PAGE_SHIFT) & 0x3ff)
  12.314 +
  12.315 +/* access to one page */
  12.316 +static int
  12.317 +xendebug_memory_page (domain_context_p ctxt, int xc_handle, u32 vcpu,
  12.318 +                      int protection, memory_t address, int length, u8 *buffer)
  12.319 +{
  12.320 +    vcpu_guest_context_t *vcpu_ctxt = &ctxt->context[vcpu];
  12.321 +    unsigned long pde, page;
  12.322 +    unsigned long va = (unsigned long)address;
  12.323 +    void *ptr;
  12.324 +    long pages;
  12.325 +
  12.326 +    pages = xc_get_tot_pages(xc_handle, ctxt->domid);
  12.327 +
  12.328 +    if ( ctxt->total_pages != pages )
  12.329 +    {
  12.330 +        if ( ctxt->total_pages > 0 ) free( ctxt->page_array );
  12.331 +        ctxt->total_pages = pages;
  12.332 +
  12.333 +        ctxt->page_array = malloc(pages * sizeof(unsigned long));
  12.334 +        if ( ctxt->page_array == NULL )
  12.335 +        {
  12.336 +            printf("Could not allocate memory\n");
  12.337 +            return 0;
  12.338 +        }
  12.339 +
  12.340 +        if ( xc_get_pfn_list(xc_handle, ctxt->domid, ctxt->page_array,pages) !=
  12.341 +                pages )
  12.342 +        {
  12.343 +            printf("Could not get the page frame list\n");
  12.344 +            return 0;
  12.345 +        }
  12.346 +    }
  12.347 +
  12.348 +    if ( vcpu_ctxt->pt_base != ctxt->cr3_phys[vcpu]) 
  12.349 +    {
  12.350 +        ctxt->cr3_phys[vcpu] = vcpu_ctxt->pt_base;
  12.351 +        if ( ctxt->cr3_virt[vcpu] )
  12.352 +            munmap(ctxt->cr3_virt[vcpu], PAGE_SIZE);
  12.353 +        ctxt->cr3_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid,
  12.354 +                    PAGE_SIZE, PROT_READ, ctxt->cr3_phys[vcpu] >> PAGE_SHIFT);
  12.355 +        if ( ctxt->cr3_virt[vcpu] == NULL )
  12.356 +            return 0;
  12.357 +    } 
  12.358 +
  12.359 +
  12.360 +    if ( (pde = ctxt->cr3_virt[vcpu][vtopdi(va)]) == 0) /* logical address */
  12.361 +        return 0;
  12.362 +    if (ctxt->context[vcpu].flags & VGCF_VMX_GUEST)
  12.363 +        pde = ctxt->page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT;
  12.364 +    if (pde != ctxt->pde_phys[vcpu]) 
  12.365 +    {
  12.366 +        ctxt->pde_phys[vcpu] = pde;
  12.367 +        if ( ctxt->pde_virt[vcpu])
  12.368 +            munmap(ctxt->pde_virt[vcpu], PAGE_SIZE);
  12.369 +        ctxt->pde_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid,
  12.370 +                    PAGE_SIZE, PROT_READ, ctxt->pde_phys[vcpu] >> PAGE_SHIFT);
  12.371 +        if ( ctxt->pde_virt[vcpu] == NULL )
  12.372 +            return 0;
  12.373 +    }
  12.374 +
  12.375 +    if ((page = ctxt->pde_virt[vcpu][vtopti(va)]) == 0) /* logical address */
  12.376 +        return 0;
  12.377 +    if (ctxt->context[vcpu].flags & VGCF_VMX_GUEST)
  12.378 +        page = ctxt->page_array[page >> PAGE_SHIFT] << PAGE_SHIFT;
  12.379 +    if (page != ctxt->page_phys[vcpu] || protection != ctxt->page_perm[vcpu]) 
  12.380 +    {
  12.381 +        ctxt->page_phys[vcpu] = page;
  12.382 +        if (ctxt->page_virt[vcpu])
  12.383 +            munmap(ctxt->page_virt[vcpu], PAGE_SIZE);
  12.384 +        ctxt->page_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid, 
  12.385 +                  PAGE_SIZE, protection, ctxt->page_phys[vcpu] >> PAGE_SHIFT);
  12.386 +        if ( ctxt->page_virt[vcpu] == NULL )
  12.387 +        {
  12.388 +            printf("cr3 %lx pde %lx page %lx pti %lx\n", 
  12.389 +                   vcpu_ctxt->pt_base, pde, page, vtopti(va));
  12.390 +            ctxt->page_phys[vcpu] = 0;
  12.391 +            return 0;
  12.392 +        }
  12.393 +        ctxt->page_perm[vcpu] = protection;
  12.394 +    }	
  12.395 +
  12.396 +    ptr = (void *)( (unsigned long)ctxt->page_virt[vcpu] |
  12.397 +                    (va & ~PAGE_MASK) );
  12.398 +
  12.399 +    if ( protection & PROT_WRITE )
  12.400 +    {
  12.401 +        memcpy(ptr, buffer, length);
  12.402 +    }
  12.403 +    else
  12.404 +    {
  12.405 +        memcpy(buffer, ptr, length);
  12.406 +    }
  12.407 +
  12.408 +    return length;
  12.409 +}
  12.410 +
  12.411 +/* divide a memory operation into accesses to individual pages */
  12.412 +static int
  12.413 +xendebug_memory_op (domain_context_p ctxt, int xc_handle, u32 vcpu,
  12.414 +                    int protection, memory_t address, int length, u8 *buffer)
  12.415 +{
  12.416 +    int      remain;              /* number of bytes to touch past this page */
  12.417 +    int      bytes   = 0;
  12.418 +
  12.419 +    while ( (remain = (address + length - 1) - (address | (PAGE_SIZE-1))) > 0)
  12.420 +    {
  12.421 +        bytes += xendebug_memory_page(ctxt, xc_handle, vcpu, protection,
  12.422 +                                      address, length - remain, buffer);
  12.423 +        buffer += (length - remain);
  12.424 +        length = remain;
  12.425 +        address = (address | (PAGE_SIZE - 1)) + 1;
  12.426 +    }
  12.427 +
  12.428 +    bytes += xendebug_memory_page(ctxt, xc_handle, vcpu, protection,
  12.429 +                                  address, length, buffer);
  12.430 +
  12.431 +    return bytes;
  12.432 +}
  12.433 +
  12.434 +int
  12.435 +xendebug_read_memory(int xc_handle,
  12.436 +                     u32 domid,
  12.437 +                     u32 vcpu,
  12.438 +                     memory_t address,
  12.439 +                     u32 length,
  12.440 +                     u8 *data)
  12.441 +{
  12.442 +    domain_context_p ctxt;
  12.443 +
  12.444 +    xendebug_initialize();
  12.445 +
  12.446 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.447 +
  12.448 +    xendebug_memory_op(ctxt, xc_handle, vcpu, PROT_READ, 
  12.449 +                       address, length, data);
  12.450 +
  12.451 +    return 0;
  12.452 +}
  12.453 +
  12.454 +int
  12.455 +xendebug_write_memory(int xc_handle,
  12.456 +                      u32 domid,
  12.457 +                      u32 vcpu,
  12.458 +                      memory_t address,
  12.459 +                      u32 length,
  12.460 +                      u8 *data)
  12.461 +{
  12.462 +    domain_context_p ctxt;
  12.463 +
  12.464 +    xendebug_initialize();
  12.465 +
  12.466 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  12.467 +    xendebug_memory_op(ctxt, xc_handle, vcpu, PROT_READ | PROT_WRITE,
  12.468 +
  12.469 +                       address, length, data);
  12.470 +
  12.471 +    return 0;
  12.472 +}
  12.473 +
  12.474 +int
  12.475 +xendebug_insert_memory_breakpoint(int xc_handle,
  12.476 +                                  u32 domid,
  12.477 +                                  u32 vcpu,
  12.478 +                                  memory_t address,
  12.479 +                                  u32 length)
  12.480 +{
  12.481 +    bwcpoint_p bkpt;
  12.482 +    u8 breakpoint_opcode = 0xcc;
  12.483 +
  12.484 +    printf("insert breakpoint %d:%lx %d\n",
  12.485 +            domid, address, length);
  12.486 +
  12.487 +    xendebug_initialize();
  12.488 +
  12.489 +    bkpt = malloc(sizeof(bwcpoint_t));
  12.490 +    if ( bkpt == NULL )
  12.491 +    {
  12.492 +        printf("error: breakpoint length should be 1\n");
  12.493 +        return -1;
  12.494 +    }
  12.495 +
  12.496 +    if ( length != 1 )
  12.497 +    {
  12.498 +        printf("error: breakpoint length should be 1\n");
  12.499 +        free(bkpt);
  12.500 +        return -1;
  12.501 +    }
  12.502 +
  12.503 +    bkpt->address = address;
  12.504 +    bkpt->domain  = domid;
  12.505 +
  12.506 +    xendebug_read_memory(xc_handle, domid, vcpu, address, 1,
  12.507 +                         &bkpt->old_value);
  12.508 +
  12.509 +    xendebug_write_memory(xc_handle, domid, vcpu, address, 1, 
  12.510 +                          &breakpoint_opcode);
  12.511 +    
  12.512 +    list_add(&bkpt->list, &bwcpoint_list.list);
  12.513 +
  12.514 +    printf("breakpoint_set %d:%lx 0x%x\n",
  12.515 +           domid, address, bkpt->old_value);
  12.516 +
  12.517 +    return 0;
  12.518 +}
  12.519 +
  12.520 +int
  12.521 +xendebug_remove_memory_breakpoint(int xc_handle,
  12.522 +                                  u32 domid,
  12.523 +                                  u32 vcpu,
  12.524 +                                  memory_t address,
  12.525 +                                  u32 length)
  12.526 +{
  12.527 +    bwcpoint_p bkpt = NULL;
  12.528 +
  12.529 +    printf ("remove breakpoint %d:%lx\n",
  12.530 +            domid, address);
  12.531 +
  12.532 +    struct list_head *entry;
  12.533 +    list_for_each(entry, &bwcpoint_list.list)
  12.534 +    {
  12.535 +        bkpt = list_entry(entry, bwcpoint_t, list);
  12.536 +        if ( domid == bkpt->domain && address == bkpt->address )
  12.537 +            break;
  12.538 +    }
  12.539 +    
  12.540 +    if (bkpt == &bwcpoint_list || bkpt == NULL)
  12.541 +    {
  12.542 +        printf ("error: no breakpoint found\n");
  12.543 +        return -1;
  12.544 +    }
  12.545 +
  12.546 +    list_del(&bkpt->list);
  12.547 +
  12.548 +    xendebug_write_memory(xc_handle, domid, vcpu, address, 1, 
  12.549 +                          &bkpt->old_value);
  12.550 +
  12.551 +    free(bkpt);
  12.552 +    return 0;
  12.553 +}
  12.554 +
  12.555 +int
  12.556 +xendebug_query_domain_stop(int xc_handle, int *dom_list, int dom_list_size)
  12.557 +{
  12.558 +    xc_dominfo_t *info;
  12.559 +    u32 first_dom = 0;
  12.560 +    int max_doms = 1024;
  12.561 +    int nr_doms, loop;
  12.562 +    int count = 0;
  12.563 +
  12.564 +    if ( (info = malloc(max_doms * sizeof(xc_dominfo_t))) == NULL )
  12.565 +        return -ENOMEM;
  12.566 +
  12.567 +    nr_doms = xc_domain_getinfo(xc_handle, first_dom, max_doms, info);
  12.568 +
  12.569 +    for (loop = 0; loop < nr_doms; loop++)
  12.570 +    {
  12.571 +        printf ("domid: %d", info[loop].domid);
  12.572 +        printf (" %c%c%c%c%c%c",
  12.573 +                info[loop].dying ? 'D' : '-',
  12.574 +                info[loop].crashed ? 'C' : '-',
  12.575 +                info[loop].shutdown ? 'S' : '-',
  12.576 +                info[loop].paused ? 'P' : '-',
  12.577 +                info[loop].blocked ? 'B' : '-',
  12.578 +                info[loop].running ? 'R' : '-');
  12.579 +        printf (" pages: %ld, vcpus %d", 
  12.580 +                info[loop].nr_pages, info[loop].vcpus);
  12.581 +        printf ("\n");
  12.582 +
  12.583 +        if ( info[loop].paused && count < dom_list_size)
  12.584 +        {
  12.585 +            dom_list[count++] = info[loop].domid;
  12.586 +        }
  12.587 +    }
  12.588 +
  12.589 +    free(info);
  12.590 +
  12.591 +    return count;
  12.592 +}
  12.593 +
  12.594 +/*
  12.595 + * Local variables:
  12.596 + * mode: C
  12.597 + * c-set-style: "BSD"
  12.598 + * c-basic-offset: 4
  12.599 + * tab-width: 4
  12.600 + * indent-tabs-mode: nil
  12.601 + * End:
  12.602 + */
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tools/debugger/libxendebug/xendebug.h	Sat Jun 04 13:07:05 2005 +0000
    13.3 @@ -0,0 +1,78 @@
    13.4 +/*
    13.5 + * xendebug.h
    13.6 + *
    13.7 + * alex ho
    13.8 + * http://www.cl.cam.ac.uk/netos/pdb
    13.9 + *
   13.10 + */
   13.11 +
   13.12 +#ifndef _XENDEBUG_H_DEFINED
   13.13 +#define _XENDEBUG_H_DEFINED
   13.14 +
   13.15 +#include <xc.h>
   13.16 +
   13.17 +int xendebug_attach(int xc_handle,
   13.18 +		    u32 domid,
   13.19 +		    u32 vcpu);
   13.20 +
   13.21 +int xendebug_detach(int xc_handle,
   13.22 +		    u32 domid,
   13.23 +		    u32 vcpu);
   13.24 +
   13.25 +int xendebug_read_registers(int xc_handle,
   13.26 +			    u32 domid,
   13.27 +			    u32 vcpu,
   13.28 +			    cpu_user_regs_t **regs);
   13.29 +
   13.30 +int xendebug_read_fpregisters (int xc_handle,
   13.31 +			       u32 domid,
   13.32 +			       u32 vcpu,
   13.33 +			       char **regs);
   13.34 +
   13.35 +int xendebug_write_registers(int xc_handle,
   13.36 +			     u32 domid,
   13.37 +			     u32 vcpu,
   13.38 +			     cpu_user_regs_t *regs);
   13.39 +
   13.40 +int xendebug_step(int xc_handle,
   13.41 +		  u32 domid,
   13.42 +		  u32 vcpu);
   13.43 +
   13.44 +int xendebug_continue(int xc_handle,
   13.45 +		      u32 domid,
   13.46 +		      u32 vcpu);
   13.47 +
   13.48 +int xendebug_read_memory(int xc_handle,
   13.49 +			 u32 domid,
   13.50 +			 u32 vcpu,
   13.51 +			 memory_t address,
   13.52 +			 u32 length,
   13.53 +			 u8 *data);
   13.54 +
   13.55 +
   13.56 +int xendebug_write_memory(int xc_handle,
   13.57 +			  u32 domid,
   13.58 +			  u32 vcpu,
   13.59 +			  memory_t address,
   13.60 +			  u32 length,
   13.61 +			  u8 *data);
   13.62 +
   13.63 +
   13.64 +int xendebug_insert_memory_breakpoint(int xc_handle,
   13.65 +				      u32 domid,
   13.66 +				      u32 vcpu,
   13.67 +				      memory_t address,
   13.68 +				      u32 length);
   13.69 +
   13.70 +int xendebug_remove_memory_breakpoint(int xc_handle,
   13.71 +				      u32 domid,
   13.72 +				      u32 vcpu,
   13.73 +				      memory_t address,
   13.74 +				      u32 length);
   13.75 +
   13.76 +int xendebug_query_domain_stop(int xc_handle,
   13.77 +			       int *dom_list, 
   13.78 +			       int dom_list_size);
   13.79 +
   13.80 +
   13.81 +#endif /* _XENDEBUG_H_DEFINED */
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tools/debugger/pdb/Domain.ml	Sat Jun 04 13:07:05 2005 +0000
    14.3 @@ -0,0 +1,63 @@
    14.4 +(** Domain.ml
    14.5 + *
    14.6 + *  domain context implementation
    14.7 + *
    14.8 + *  @author copyright (c) 2005 alex ho
    14.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   14.10 + *  @version 1
   14.11 + *)
   14.12 +
   14.13 +open Int32
   14.14 +open Intel
   14.15 +
   14.16 +type context_t =
   14.17 +{
   14.18 +  mutable domain : int;
   14.19 +  mutable execution_domain : int
   14.20 +}
   14.21 +
   14.22 +let default_context = { domain = 0; execution_domain = 0 }
   14.23 +
   14.24 +let new_context dom exec_dom = {domain = dom; execution_domain = exec_dom}
   14.25 +
   14.26 +let set_domain ctx value =
   14.27 +  ctx.domain <- value;
   14.28 +  print_endline (Printf.sprintf "ctx.domain <- %d" ctx.domain)
   14.29 +
   14.30 +let set_execution_domain ctx value =
   14.31 +  ctx.execution_domain <- value;
   14.32 +  print_endline (Printf.sprintf "ctx.execution_domain <- %d"
   14.33 +		 ctx.execution_domain)
   14.34 +
   14.35 +let get_domain ctx =
   14.36 +  ctx.domain
   14.37 +
   14.38 +let get_execution_domain ctx =
   14.39 +  ctx.execution_domain
   14.40 +
   14.41 +let string_of_context ctx =
   14.42 +      Printf.sprintf "{domain} domain: %d, execution_domain: %d"
   14.43 +                      ctx.domain  ctx.execution_domain
   14.44 +
   14.45 +external read_registers : context_t -> registers = "read_registers"
   14.46 +external write_register : context_t -> register -> int32 -> unit =
   14.47 +  "write_register"
   14.48 +external read_memory : context_t -> int32 -> int -> int list = 
   14.49 +  "read_memory"
   14.50 +external write_memory : context_t -> int32 -> int list -> unit = 
   14.51 +  "write_memory"
   14.52 +	
   14.53 +external continue : context_t -> unit = "continue_target"
   14.54 +external step : context_t -> unit = "step_target"
   14.55 +
   14.56 +external insert_memory_breakpoint : context_t -> int32 -> int -> unit = 
   14.57 +  "insert_memory_breakpoint"
   14.58 +external remove_memory_breakpoint : context_t -> int32 -> int -> unit = 
   14.59 +  "remove_memory_breakpoint"
   14.60 +
   14.61 +external attach_debugger : int -> int -> unit = "attach_debugger"
   14.62 +external detach_debugger : int -> int -> unit = "detach_debugger"
   14.63 +external pause_target : int -> unit = "pause_target"
   14.64 +
   14.65 +let pause ctx =
   14.66 +  pause_target ctx.domain
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tools/debugger/pdb/Domain.mli	Sat Jun 04 13:07:05 2005 +0000
    15.3 @@ -0,0 +1,38 @@
    15.4 +(** Domain.mli
    15.5 + *
    15.6 + *  domain context interface
    15.7 + *
    15.8 + *  @author copyright (c) 2005 alex ho
    15.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   15.10 + *  @version 1
   15.11 + *)
   15.12 +
   15.13 +open Int32
   15.14 +open Intel
   15.15 +
   15.16 +type context_t
   15.17 +
   15.18 +val default_context : context_t
   15.19 +val new_context : int -> int -> context_t 
   15.20 +
   15.21 +val set_domain : context_t -> int -> unit
   15.22 +val get_domain : context_t -> int
   15.23 +val set_execution_domain : context_t -> int -> unit
   15.24 +val get_execution_domain : context_t -> int
   15.25 +
   15.26 +val string_of_context : context_t -> string
   15.27 +
   15.28 +val read_registers : context_t -> registers
   15.29 +val write_register : context_t -> register -> int32 -> unit
   15.30 +val read_memory : context_t -> int32 -> int -> int list
   15.31 +val write_memory : context_t -> int32 -> int list -> unit
   15.32 +	
   15.33 +val continue : context_t -> unit
   15.34 +val step : context_t -> unit
   15.35 +
   15.36 +val insert_memory_breakpoint : context_t -> int32 -> int -> unit
   15.37 +val remove_memory_breakpoint : context_t -> int32 -> int -> unit
   15.38 +
   15.39 +val attach_debugger : int -> int -> unit
   15.40 +val detach_debugger : int -> int -> unit
   15.41 +val pause : context_t -> unit
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/debugger/pdb/Intel.ml	Sat Jun 04 13:07:05 2005 +0000
    16.3 @@ -0,0 +1,71 @@
    16.4 +(** Intel.ml
    16.5 + *
    16.6 + *  various sundry Intel x86 definitions
    16.7 + *
    16.8 + *  @author copyright (c) 2005 alex ho
    16.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   16.10 + *  @version 1
   16.11 + *)
   16.12 +
   16.13 +
   16.14 +type register =
   16.15 +  | EBX
   16.16 +  | ECX
   16.17 +  | EDX
   16.18 +  | ESI
   16.19 +  | EDI
   16.20 +  | EBP
   16.21 +  | EAX
   16.22 +  | Error_code
   16.23 +  | Entry_vector
   16.24 +  | EIP
   16.25 +  | CS
   16.26 +  | EFLAGS
   16.27 +  | ESP
   16.28 +  | SS
   16.29 +  | ES
   16.30 +  | DS
   16.31 +  | FS
   16.32 +  | GS
   16.33 +
   16.34 +type registers =
   16.35 +    { ebx : int32;
   16.36 +      ecx : int32;
   16.37 +      edx : int32;
   16.38 +      esi : int32;
   16.39 +      edi : int32;
   16.40 +      ebp : int32;
   16.41 +      eax : int32;
   16.42 +      error_code : int32;
   16.43 +      entry_vector : int32;
   16.44 +      eip : int32;
   16.45 +      cs : int32;
   16.46 +      eflags : int32;
   16.47 +      esp : int32;
   16.48 +      ss : int32;
   16.49 +      es : int32;
   16.50 +      ds : int32;
   16.51 +      fs : int32;
   16.52 +      gs : int32
   16.53 +    }
   16.54 +
   16.55 +let null_registers =
   16.56 +  { ebx = 0l;
   16.57 +    ecx = 0l;
   16.58 +    edx = 0l;
   16.59 +    esi = 0l;
   16.60 +    edi = 0l;
   16.61 +    ebp = 0l;
   16.62 +    eax = 0l;
   16.63 +    error_code = 0l;
   16.64 +    entry_vector = 0l;
   16.65 +    eip = 0l;
   16.66 +    cs = 0l;
   16.67 +    eflags = 0l;
   16.68 +    esp = 0l;
   16.69 +    ss = 0l;
   16.70 +    es = 0l;
   16.71 +    ds = 0l;
   16.72 +    fs = 0l;
   16.73 +    gs = 0l
   16.74 +  }
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/debugger/pdb/Makefile	Sat Jun 04 13:07:05 2005 +0000
    17.3 @@ -0,0 +1,56 @@
    17.4 +OCAMLMAKEFILE = OCamlMakefile
    17.5 +
    17.6 +XEN_ROOT    = ../../..
    17.7 +include $(XEN_ROOT)/tools/Rules.mk
    17.8 +
    17.9 +# overwrite LDFLAGS from xen/tool/Rules.mk
   17.10 +# otherwise, ocamlmktop gets confused.
   17.11 +LDFLAGS     =
   17.12 +
   17.13 +OCAML_ROOT=/usr/local
   17.14 +# force ocaml 3.08
   17.15 +# OCAML_ROOT  = /anfs/nos1/ach61/ocaml
   17.16 +
   17.17 +OCAMLC      = $(OCAML_ROOT)/bin/ocamlc
   17.18 +OCAMLMKTOP  = $(OCAML_ROOT)/bin/ocamlmktop
   17.19 +OCAMLLIBPATH= $(OCAML_ROOT)/lib/ocaml
   17.20 +
   17.21 +INCLUDES   += -I $(XEN_XC)
   17.22 +INCLUDES   += -I $(XEN_LIBXC)
   17.23 +INCLUDES   += -I ../libxendebug
   17.24 +INCLUDES   += -I $(OCAML_ROOT)/lib/ocaml
   17.25 +
   17.26 +CFLAGS     += $(INCLUDES)
   17.27 +CFLAGS     += -Wall
   17.28 +CFLAGS     += -Werror
   17.29 +CFLAGS     += -g
   17.30 +
   17.31 +CLIBS      += xc
   17.32 +CLIBS      += xendebug
   17.33 +CLIBS      += pdb
   17.34 +
   17.35 +LIBDIRS    += $(XEN_LIBXC)
   17.36 +LIBDIRS    += $(XEN_LIBXUTIL)
   17.37 +LIBDIRS    += ../libxendebug
   17.38 +LIBDIRS    += .
   17.39 +
   17.40 +LIBS       += unix str
   17.41 +
   17.42 +PRE_TARGETS = libpdb.a
   17.43 +
   17.44 +all : bc
   17.45 +
   17.46 +libpdb.a : pdb_xen.o
   17.47 +	ar rc $@ $^
   17.48 +	ranlib $@
   17.49 +
   17.50 +SOURCES    += pdb_caml_xc.c pdb_xen.c
   17.51 +SOURCES    += Util.ml Intel.ml 
   17.52 +SOURCES    += evtchn.ml evtchn.mli
   17.53 +SOURCES    += Domain.ml  Process.ml
   17.54 +SOURCES    += Domain.mli Process.mli
   17.55 +SOURCES    += PDB.ml debugger.ml server.ml
   17.56 +RESULT      = pdb
   17.57 +
   17.58 +include $(OCAMLMAKEFILE)
   17.59 +
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/debugger/pdb/OCamlMakefile	Sat Jun 04 13:07:05 2005 +0000
    18.3 @@ -0,0 +1,1149 @@
    18.4 +###########################################################################
    18.5 +#                              OCamlMakefile
    18.6 +#                  Copyright (C) 1999-2004  Markus Mottl
    18.7 +#
    18.8 +#                             For updates see:
    18.9 +#                http://www.oefai.at/~markus/ocaml_sources
   18.10 +#
   18.11 +#        $Id: OCamlMakefile,v 1.1 2005/05/19 09:30:48 root Exp $
   18.12 +#
   18.13 +###########################################################################
   18.14 +
   18.15 +# Modified by damien for .glade.ml compilation
   18.16 +
   18.17 +# Set these variables to the names of the sources to be processed and
   18.18 +# the result variable. Order matters during linkage!
   18.19 +
   18.20 +ifndef SOURCES
   18.21 +  SOURCES := foo.ml
   18.22 +endif
   18.23 +export SOURCES
   18.24 +
   18.25 +ifndef RES_CLIB_SUF
   18.26 +  RES_CLIB_SUF := _stubs
   18.27 +endif
   18.28 +export RES_CLIB_SUF
   18.29 +
   18.30 +ifndef RESULT
   18.31 +  RESULT := foo
   18.32 +endif
   18.33 +export RESULT
   18.34 +
   18.35 +export LIB_PACK_NAME
   18.36 +
   18.37 +ifndef DOC_FILES
   18.38 +  DOC_FILES := $(filter %.mli, $(SOURCES))
   18.39 +endif
   18.40 +export DOC_FILES
   18.41 +
   18.42 +export BCSUFFIX
   18.43 +export NCSUFFIX
   18.44 +
   18.45 +ifndef TOPSUFFIX
   18.46 +  TOPSUFFIX := .top
   18.47 +endif
   18.48 +export TOPSUFFIX
   18.49 +
   18.50 +# Eventually set include- and library-paths, libraries to link,
   18.51 +# additional compilation-, link- and ocamlyacc-flags
   18.52 +# Path- and library information needs not be written with "-I" and such...
   18.53 +# Define THREADS if you need it, otherwise leave it unset (same for
   18.54 +# USE_CAMLP4)!
   18.55 +
   18.56 +export THREADS
   18.57 +export VMTHREADS
   18.58 +export ANNOTATE
   18.59 +export USE_CAMLP4
   18.60 +
   18.61 +export INCDIRS
   18.62 +export LIBDIRS
   18.63 +export EXTLIBDIRS
   18.64 +export RESULTDEPS
   18.65 +export OCAML_DEFAULT_DIRS
   18.66 +
   18.67 +export LIBS
   18.68 +export CLIBS
   18.69 +
   18.70 +export OCAMLFLAGS
   18.71 +export OCAMLNCFLAGS
   18.72 +export OCAMLBCFLAGS
   18.73 +
   18.74 +export OCAMLLDFLAGS
   18.75 +export OCAMLNLDFLAGS
   18.76 +export OCAMLBLDFLAGS
   18.77 +
   18.78 +ifndef OCAMLCPFLAGS
   18.79 +  OCAMLCPFLAGS := a
   18.80 +endif
   18.81 +
   18.82 +export OCAMLCPFLAGS
   18.83 +
   18.84 +export PPFLAGS
   18.85 +
   18.86 +export YFLAGS
   18.87 +export IDLFLAGS
   18.88 +
   18.89 +export OCAMLDOCFLAGS
   18.90 +
   18.91 +export OCAMLFIND_INSTFLAGS
   18.92 +
   18.93 +export DVIPSFLAGS
   18.94 +
   18.95 +export STATIC
   18.96 +
   18.97 +# Add a list of optional trash files that should be deleted by "make clean"
   18.98 +export TRASH
   18.99 +
  18.100 +####################  variables depending on your OCaml-installation
  18.101 +
  18.102 +ifdef MINGW
  18.103 +  export MINGW
  18.104 +  WIN32   := 1
  18.105 +  CFLAGS_WIN32 := -mno-cygwin
  18.106 +endif
  18.107 +ifdef MSVC
  18.108 +  export MSVC
  18.109 +  WIN32   := 1
  18.110 +  ifndef STATIC
  18.111 +    CPPFLAGS_WIN32 := -DCAML_DLL
  18.112 +  endif
  18.113 +  CFLAGS_WIN32 += -nologo
  18.114 +  EXT_OBJ := obj
  18.115 +  EXT_LIB := lib
  18.116 +  ifeq ($(CC),gcc)
  18.117 +    # work around GNU Make default value
  18.118 +    ifdef THREADS
  18.119 +      CC := cl -MT
  18.120 +    else
  18.121 +      CC := cl
  18.122 +    endif
  18.123 +  endif
  18.124 +  ifeq ($(CXX),g++)
  18.125 +    # work around GNU Make default value
  18.126 +    CXX := $(CC)
  18.127 +  endif
  18.128 +  CFLAG_O := -Fo
  18.129 +endif
  18.130 +ifdef WIN32
  18.131 +  EXT_CXX := cpp
  18.132 +  EXE     := .exe
  18.133 +endif
  18.134 +
  18.135 +ifndef EXT_OBJ
  18.136 +  EXT_OBJ := o
  18.137 +endif
  18.138 +ifndef EXT_LIB
  18.139 +  EXT_LIB := a
  18.140 +endif
  18.141 +ifndef EXT_CXX
  18.142 +  EXT_CXX := cc
  18.143 +endif
  18.144 +ifndef EXE
  18.145 +  EXE := # empty
  18.146 +endif
  18.147 +ifndef CFLAG_O
  18.148 +  CFLAG_O := -o # do not delete this comment (preserves trailing whitespace)!
  18.149 +endif
  18.150 +
  18.151 +export CC
  18.152 +export CXX
  18.153 +export CFLAGS
  18.154 +export CXXFLAGS
  18.155 +export LDFLAGS
  18.156 +export CPPFLAGS
  18.157 +
  18.158 +ifndef RPATH_FLAG
  18.159 +  RPATH_FLAG := -R
  18.160 +endif
  18.161 +export RPATH_FLAG
  18.162 +
  18.163 +ifndef MSVC
  18.164 +ifndef PIC_CFLAGS
  18.165 +  PIC_CFLAGS := -fPIC
  18.166 +endif
  18.167 +ifndef PIC_CPPFLAGS
  18.168 +  PIC_CPPFLAGS := -DPIC
  18.169 +endif
  18.170 +endif
  18.171 +
  18.172 +export PIC_CFLAGS
  18.173 +export PIC_CPPFLAGS
  18.174 +
  18.175 +BCRESULT  := $(addsuffix $(BCSUFFIX), $(RESULT))
  18.176 +NCRESULT  := $(addsuffix $(NCSUFFIX), $(RESULT))
  18.177 +TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT))
  18.178 +
  18.179 +ifndef OCAMLFIND
  18.180 +  OCAMLFIND := ocamlfind
  18.181 +endif
  18.182 +export OCAMLFIND
  18.183 +
  18.184 +ifndef OCAMLC
  18.185 +  OCAMLC := ocamlc
  18.186 +endif
  18.187 +export OCAMLC
  18.188 +
  18.189 +ifndef OCAMLOPT
  18.190 +  OCAMLOPT := ocamlopt
  18.191 +endif
  18.192 +export OCAMLOPT
  18.193 +
  18.194 +ifndef OCAMLMKTOP
  18.195 +  OCAMLMKTOP := ocamlmktop
  18.196 +endif
  18.197 +export OCAMLMKTOP
  18.198 +
  18.199 +ifndef OCAMLCP
  18.200 +  OCAMLCP := ocamlcp
  18.201 +endif
  18.202 +export OCAMLCP
  18.203 +
  18.204 +ifndef OCAMLDEP
  18.205 +  OCAMLDEP := ocamldep
  18.206 +endif
  18.207 +export OCAMLDEP
  18.208 +
  18.209 +ifndef OCAMLLEX
  18.210 +  OCAMLLEX := ocamllex
  18.211 +endif
  18.212 +export OCAMLLEX
  18.213 +
  18.214 +ifndef OCAMLYACC
  18.215 +  OCAMLYACC := ocamlyacc
  18.216 +endif
  18.217 +export OCAMLYACC
  18.218 +
  18.219 +ifndef OCAMLMKLIB
  18.220 +  OCAMLMKLIB := ocamlmklib
  18.221 +endif
  18.222 +export OCAMLMKLIB
  18.223 +
  18.224 +ifndef OCAML_GLADECC
  18.225 +  OCAML_GLADECC := lablgladecc2
  18.226 +endif
  18.227 +export OCAML_GLADECC
  18.228 +
  18.229 +ifndef OCAML_GLADECC_FLAGS
  18.230 +  OCAML_GLADECC_FLAGS :=
  18.231 +endif
  18.232 +export OCAML_GLADECC_FLAGS
  18.233 +
  18.234 +ifndef CAMELEON_REPORT
  18.235 +  CAMELEON_REPORT := report
  18.236 +endif
  18.237 +export CAMELEON_REPORT
  18.238 +
  18.239 +ifndef CAMELEON_REPORT_FLAGS
  18.240 +  CAMELEON_REPORT_FLAGS :=
  18.241 +endif
  18.242 +export CAMELEON_REPORT_FLAGS
  18.243 +
  18.244 +ifndef CAMELEON_ZOGGY
  18.245 +  CAMELEON_ZOGGY := camlp4o pa_zog.cma pr_o.cmo
  18.246 +endif
  18.247 +export CAMELEON_ZOGGY
  18.248 +
  18.249 +ifndef CAMELEON_ZOGGY_FLAGS
  18.250 +  CAMELEON_ZOGGY_FLAGS :=
  18.251 +endif
  18.252 +export CAMELEON_ZOGGY_FLAGS
  18.253 +
  18.254 +ifndef OXRIDL
  18.255 +  OXRIDL := oxridl
  18.256 +endif
  18.257 +export OXRIDL
  18.258 +
  18.259 +ifndef CAMLIDL
  18.260 +  CAMLIDL := camlidl
  18.261 +endif
  18.262 +export CAMLIDL
  18.263 +
  18.264 +ifndef CAMLIDLDLL
  18.265 +  CAMLIDLDLL := camlidldll
  18.266 +endif
  18.267 +export CAMLIDLDLL
  18.268 +
  18.269 +ifndef NOIDLHEADER
  18.270 +  MAYBE_IDL_HEADER := -header
  18.271 +endif
  18.272 +export NOIDLHEADER
  18.273 +
  18.274 +export NO_CUSTOM
  18.275 +
  18.276 +ifndef CAMLP4
  18.277 +  CAMLP4 := camlp4
  18.278 +endif
  18.279 +export CAMLP4
  18.280 +
  18.281 +ifndef REAL_OCAMLFIND
  18.282 +  ifdef PACKS
  18.283 +    ifndef CREATE_LIB
  18.284 +      ifdef THREADS
  18.285 +	PACKS += threads
  18.286 +      endif
  18.287 +    endif
  18.288 +    empty :=
  18.289 +    space := $(empty) $(empty)
  18.290 +    comma := ,
  18.291 +    ifdef PREDS
  18.292 +      PRE_OCAML_FIND_PREDICATES := $(subst $(space),$(comma),$(PREDS))
  18.293 +      PRE_OCAML_FIND_PACKAGES := $(subst $(space),$(comma),$(PACKS))
  18.294 +      OCAML_FIND_PREDICATES := -predicates $(PRE_OCAML_FIND_PREDICATES)
  18.295 +  #    OCAML_DEP_PREDICATES := -syntax $(PRE_OCAML_FIND_PREDICATES)
  18.296 +      OCAML_FIND_PACKAGES := $(OCAML_FIND_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
  18.297 +      OCAML_DEP_PACKAGES := $(OCAML_DEP_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
  18.298 +    else
  18.299 +      OCAML_FIND_PACKAGES := -package $(subst $(space),$(comma),$(PACKS))
  18.300 +      OCAML_DEP_PACKAGES :=
  18.301 +    endif
  18.302 +    OCAML_FIND_LINKPKG := -linkpkg
  18.303 +    REAL_OCAMLFIND := $(OCAMLFIND)
  18.304 +  endif
  18.305 +endif
  18.306 +
  18.307 +export OCAML_FIND_PACKAGES
  18.308 +export OCAML_DEP_PACKAGES
  18.309 +export OCAML_FIND_LINKPKG
  18.310 +export REAL_OCAMLFIND
  18.311 +
  18.312 +ifndef OCAMLDOC
  18.313 +  OCAMLDOC := ocamldoc
  18.314 +endif
  18.315 +export OCAMLDOC
  18.316 +
  18.317 +ifndef LATEX
  18.318 +  LATEX := latex
  18.319 +endif
  18.320 +export LATEX
  18.321 +
  18.322 +ifndef DVIPS
  18.323 +  DVIPS := dvips
  18.324 +endif
  18.325 +export DVIPS
  18.326 +
  18.327 +ifndef PS2PDF
  18.328 +  PS2PDF := ps2pdf
  18.329 +endif
  18.330 +export PS2PDF
  18.331 +
  18.332 +ifndef OCAMLMAKEFILE
  18.333 +  OCAMLMAKEFILE := OCamlMakefile
  18.334 +endif
  18.335 +export OCAMLMAKEFILE
  18.336 +
  18.337 +ifndef OCAMLLIBPATH
  18.338 +  OCAMLLIBPATH := \
  18.339 +    $(shell $(OCAMLC) 2>/dev/null -where || echo /usr/local/lib/ocaml)
  18.340 +endif
  18.341 +export OCAMLLIBPATH
  18.342 +
  18.343 +ifndef OCAML_LIB_INSTALL
  18.344 +  OCAML_LIB_INSTALL := $(OCAMLLIBPATH)/contrib
  18.345 +endif
  18.346 +export OCAML_LIB_INSTALL
  18.347 +
  18.348 +###########################################################################
  18.349 +
  18.350 +####################  change following sections only if
  18.351 +####################    you know what you are doing!
  18.352 +
  18.353 +# delete target files when a build command fails
  18.354 +.PHONY: .DELETE_ON_ERROR
  18.355 +.DELETE_ON_ERROR:
  18.356 +
  18.357 +# for pedants using "--warn-undefined-variables"
  18.358 +export MAYBE_IDL
  18.359 +export REAL_RESULT
  18.360 +export CAMLIDLFLAGS
  18.361 +export THREAD_FLAG
  18.362 +export RES_CLIB
  18.363 +export MAKEDLL
  18.364 +export ANNOT_FLAG
  18.365 +export C_OXRIDL
  18.366 +export SUBPROJS
  18.367 +export CFLAGS_WIN32
  18.368 +export CPPFLAGS_WIN32
  18.369 +
  18.370 +INCFLAGS :=
  18.371 +
  18.372 +SHELL := /bin/sh
  18.373 +
  18.374 +MLDEPDIR := ._d
  18.375 +BCDIDIR  := ._bcdi
  18.376 +NCDIDIR  := ._ncdi
  18.377 +
  18.378 +FILTER_EXTNS := %.mli %.ml %.mll %.mly %.idl %.oxridl %.c %.$(EXT_CXX) %.rep %.zog %.glade
  18.379 +
  18.380 +FILTERED     := $(filter $(FILTER_EXTNS), $(SOURCES))
  18.381 +SOURCE_DIRS  := $(filter-out ./, $(sort $(dir $(FILTERED))))
  18.382 +
  18.383 +FILTERED_REP := $(filter %.rep, $(FILTERED))
  18.384 +DEP_REP      := $(FILTERED_REP:%.rep=$(MLDEPDIR)/%.d)
  18.385 +AUTO_REP     := $(FILTERED_REP:.rep=.ml)
  18.386 +
  18.387 +FILTERED_ZOG := $(filter %.zog, $(FILTERED))
  18.388 +DEP_ZOG      := $(FILTERED_ZOG:%.zog=$(MLDEPDIR)/%.d)
  18.389 +AUTO_ZOG     := $(FILTERED_ZOG:.zog=.ml)
  18.390 +
  18.391 +FILTERED_GLADE := $(filter %.glade, $(FILTERED))
  18.392 +DEP_GLADE      := $(FILTERED_GLADE:%.glade=$(MLDEPDIR)/%.d)
  18.393 +AUTO_GLADE     := $(FILTERED_GLADE:.glade=.ml)
  18.394 +
  18.395 +FILTERED_ML  := $(filter %.ml, $(FILTERED))
  18.396 +DEP_ML       := $(FILTERED_ML:%.ml=$(MLDEPDIR)/%.d)
  18.397 +
  18.398 +FILTERED_MLI := $(filter %.mli, $(FILTERED))
  18.399 +DEP_MLI      := $(FILTERED_MLI:.mli=.di)
  18.400 +
  18.401 +FILTERED_MLL := $(filter %.mll, $(FILTERED))
  18.402 +DEP_MLL      := $(FILTERED_MLL:%.mll=$(MLDEPDIR)/%.d)
  18.403 +AUTO_MLL     := $(FILTERED_MLL:.mll=.ml)
  18.404 +
  18.405 +FILTERED_MLY := $(filter %.mly, $(FILTERED))
  18.406 +DEP_MLY      := $(FILTERED_MLY:%.mly=$(MLDEPDIR)/%.d) $(FILTERED_MLY:.mly=.di)
  18.407 +AUTO_MLY     := $(FILTERED_MLY:.mly=.mli) $(FILTERED_MLY:.mly=.ml)
  18.408 +
  18.409 +FILTERED_IDL := $(filter %.idl, $(FILTERED))
  18.410 +DEP_IDL      := $(FILTERED_IDL:%.idl=$(MLDEPDIR)/%.d) $(FILTERED_IDL:.idl=.di)
  18.411 +C_IDL        := $(FILTERED_IDL:%.idl=%_stubs.c)
  18.412 +ifndef NOIDLHEADER
  18.413 + C_IDL += $(FILTERED_IDL:.idl=.h)
  18.414 +endif
  18.415 +OBJ_C_IDL    := $(FILTERED_IDL:%.idl=%_stubs.$(EXT_OBJ))
  18.416 +AUTO_IDL     := $(FILTERED_IDL:.idl=.mli) $(FILTERED_IDL:.idl=.ml) $(C_IDL)
  18.417 +
  18.418 +FILTERED_OXRIDL := $(filter %.oxridl, $(FILTERED))
  18.419 +DEP_OXRIDL      := $(FILTERED_OXRIDL:%.oxridl=$(MLDEPDIR)/%.d) $(FILTERED_OXRIDL:.oxridl=.di)
  18.420 +AUTO_OXRIDL     := $(FILTERED_OXRIDL:.oxridl=.mli) $(FILTERED_OXRIDL:.oxridl=.ml) $(C_OXRIDL)
  18.421 +
  18.422 +FILTERED_C_CXX := $(filter %.c %.$(EXT_CXX), $(FILTERED))
  18.423 +OBJ_C_CXX      := $(FILTERED_C_CXX:.c=.$(EXT_OBJ))
  18.424 +OBJ_C_CXX      := $(OBJ_C_CXX:.$(EXT_CXX)=.$(EXT_OBJ))
  18.425 +
  18.426 +PRE_TARGETS  += $(AUTO_MLL) $(AUTO_MLY) $(AUTO_IDL) $(AUTO_OXRIDL) $(AUTO_ZOG) $(AUTO_REP) $(AUTO_GLADE)
  18.427 +
  18.428 +ALL_DEPS     := $(DEP_ML) $(DEP_MLI) $(DEP_MLL) $(DEP_MLY) $(DEP_IDL) $(DEP_OXRIDL) $(DEP_ZOG) $(DEP_REP) $(DEP_GLADE)
  18.429 +
  18.430 +MLDEPS       := $(filter %.d, $(ALL_DEPS))
  18.431 +MLIDEPS      := $(filter %.di, $(ALL_DEPS))
  18.432 +BCDEPIS      := $(MLIDEPS:%.di=$(BCDIDIR)/%.di)
  18.433 +NCDEPIS      := $(MLIDEPS:%.di=$(NCDIDIR)/%.di)
  18.434 +
  18.435 +ALLML        := $(filter %.mli %.ml %.mll %.mly %.idl %.oxridl %.rep %.zog %.glade, $(FILTERED))
  18.436 +
  18.437 +IMPLO_INTF   := $(ALLML:%.mli=%.mli.__)
  18.438 +IMPLO_INTF   := $(foreach file, $(IMPLO_INTF), \
  18.439 +                  $(basename $(file)).cmi $(basename $(file)).cmo)
  18.440 +IMPLO_INTF   := $(filter-out %.mli.cmo, $(IMPLO_INTF))
  18.441 +IMPLO_INTF   := $(IMPLO_INTF:%.mli.cmi=%.cmi)
  18.442 +
  18.443 +IMPLX_INTF   := $(IMPLO_INTF:.cmo=.cmx)
  18.444 +
  18.445 +INTF         := $(filter %.cmi, $(IMPLO_INTF))
  18.446 +IMPL_CMO     := $(filter %.cmo, $(IMPLO_INTF))
  18.447 +IMPL_CMX     := $(IMPL_CMO:.cmo=.cmx)
  18.448 +IMPL_ASM     := $(IMPL_CMO:.cmo=.asm)
  18.449 +IMPL_S       := $(IMPL_CMO:.cmo=.s)
  18.450 +
  18.451 +OBJ_LINK     := $(OBJ_C_IDL) $(OBJ_C_CXX)
  18.452 +OBJ_FILES    := $(IMPL_CMO:.cmo=.$(EXT_OBJ)) $(OBJ_LINK)
  18.453 +
  18.454 +EXECS        := $(addsuffix $(EXE), \
  18.455 +                            $(sort $(TOPRESULT) $(BCRESULT) $(NCRESULT)))
  18.456 +ifdef WIN32
  18.457 +  EXECS      += $(BCRESULT).dll $(NCRESULT).dll
  18.458 +endif
  18.459 +
  18.460 +CLIB_BASE    := $(RESULT)$(RES_CLIB_SUF)
  18.461 +ifneq ($(strip $(OBJ_LINK)),)
  18.462 +  RES_CLIB     := lib$(CLIB_BASE).$(EXT_LIB)
  18.463 +endif
  18.464 +
  18.465 +ifdef WIN32
  18.466 +DLLSONAME := $(CLIB_BASE).dll
  18.467 +else
  18.468 +DLLSONAME := dll$(CLIB_BASE).so
  18.469 +endif
  18.470 +
  18.471 +NONEXECS     := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \
  18.472 +		$(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \
  18.473 +		$(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmo \
  18.474 +		$(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).o \
  18.475 +		$(RES_CLIB) $(IMPL_CMO:.cmo=.annot) \
  18.476 +		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx $(LIB_PACK_NAME).o
  18.477 +
  18.478 +ifndef STATIC
  18.479 +  NONEXECS += $(DLLSONAME)
  18.480 +endif
  18.481 +
  18.482 +ifndef LIBINSTALL_FILES
  18.483 +  LIBINSTALL_FILES := $(RESULT).mli $(RESULT).cmi $(RESULT).cma \
  18.484 +		      $(RESULT).cmxa $(RESULT).$(EXT_LIB) $(RES_CLIB)
  18.485 +  ifndef STATIC
  18.486 +    ifneq ($(strip $(OBJ_LINK)),)
  18.487 +      LIBINSTALL_FILES += $(DLLSONAME)
  18.488 +    endif
  18.489 +  endif
  18.490 +endif
  18.491 +
  18.492 +export LIBINSTALL_FILES
  18.493 +
  18.494 +ifdef WIN32
  18.495 +  # some extra stuff is created while linking DLLs
  18.496 +  NONEXECS   += $(BCRESULT).$(EXT_LIB) $(BCRESULT).exp $(NCRESULT).exp $(CLIB_BASE).exp $(CLIB_BASE).lib
  18.497 +endif
  18.498 +
  18.499 +TARGETS      := $(EXECS) $(NONEXECS)
  18.500 +
  18.501 +# If there are IDL-files
  18.502 +ifneq ($(strip $(FILTERED_IDL)),)
  18.503 +  MAYBE_IDL := -cclib -lcamlidl
  18.504 +endif
  18.505 +
  18.506 +ifdef USE_CAMLP4
  18.507 +  CAMLP4PATH := \
  18.508 +    $(shell $(CAMLP4) -where 2>/dev/null || echo /usr/local/lib/camlp4)
  18.509 +  INCFLAGS := -I $(CAMLP4PATH)
  18.510 +  CINCFLAGS := -I$(CAMLP4PATH)
  18.511 +endif
  18.512 +
  18.513 +DINCFLAGS := $(INCFLAGS) $(SOURCE_DIRS:%=-I %) $(OCAML_DEFAULT_DIRS:%=-I %)
  18.514 +INCFLAGS := $(DINCFLAGS) $(INCDIRS:%=-I %)
  18.515 +CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%)
  18.516 +
  18.517 +ifndef MSVC
  18.518 +CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
  18.519 +             $(EXTLIBDIRS:%=-L%) $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%) \
  18.520 +             $(OCAML_DEFAULT_DIRS:%=-L%)
  18.521 +endif
  18.522 +
  18.523 +ifndef PROFILING
  18.524 +  INTF_OCAMLC := $(OCAMLC)
  18.525 +else
  18.526 +  ifndef THREADS
  18.527 +    INTF_OCAMLC := $(OCAMLCP) -p $(OCAMLCPFLAGS)
  18.528 +  else
  18.529 +    # OCaml does not support profiling byte code
  18.530 +    # with threads (yet), therefore we force an error.
  18.531 +    ifndef REAL_OCAMLC
  18.532 +      $(error Profiling of multithreaded byte code not yet supported by OCaml)
  18.533 +    endif
  18.534 +    INTF_OCAMLC := $(OCAMLC)
  18.535 +  endif
  18.536 +endif
  18.537 +
  18.538 +ifndef MSVC
  18.539 +COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
  18.540 +		  $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
  18.541 +		  $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%) \
  18.542 +		  $(OCAML_DEFAULT_DIRS:%=-ccopt -L%)
  18.543 +else
  18.544 +COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
  18.545 +		  $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
  18.546 +		  $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
  18.547 +endif
  18.548 +
  18.549 +CLIBS_OPTS := $(CLIBS:%=-cclib -l%)
  18.550 +ifdef MSVC
  18.551 +  ifndef STATIC
  18.552 +  # MSVC libraries do not have 'lib' prefix
  18.553 +  CLIBS_OPTS := $(CLIBS:%=-cclib %.lib)
  18.554 +  endif
  18.555 +endif
  18.556 +
  18.557 +ifneq ($(strip $(OBJ_LINK)),)
  18.558 +  ifdef CREATE_LIB
  18.559 +    OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL)
  18.560 +  else
  18.561 +    OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL)
  18.562 +  endif
  18.563 +else
  18.564 +  OBJS_LIBS := $(CLIBS_OPTS) $(MAYBE_IDL)
  18.565 +endif
  18.566 +
  18.567 +# If we have to make byte-code
  18.568 +ifndef REAL_OCAMLC
  18.569 +  BYTE_OCAML := y
  18.570 +
  18.571 +  # EXTRADEPS is added dependencies we have to insert for all
  18.572 +  # executable files we generate.  Ideally it should be all of the
  18.573 +  # libraries we use, but it's hard to find the ones that get searched on
  18.574 +  # the path since I don't know the paths built into the compiler, so
  18.575 +  # just include the ones with slashes in their names.
  18.576 +  EXTRADEPS := $(addsuffix .cma,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
  18.577 +  SPECIAL_OCAMLFLAGS := $(OCAMLBCFLAGS)
  18.578 +
  18.579 +  REAL_OCAMLC := $(INTF_OCAMLC)
  18.580 +
  18.581 +  REAL_IMPL := $(IMPL_CMO)
  18.582 +  REAL_IMPL_INTF := $(IMPLO_INTF)
  18.583 +  IMPL_SUF := .cmo
  18.584 +
  18.585 +  DEPFLAGS  :=
  18.586 +  MAKE_DEPS := $(MLDEPS) $(BCDEPIS)
  18.587 +
  18.588 +  ifdef CREATE_LIB
  18.589 +    CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
  18.590 +    CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
  18.591 +    ifndef STATIC
  18.592 +      ifneq ($(strip $(OBJ_LINK)),)
  18.593 +	MAKEDLL := $(DLLSONAME)
  18.594 +	ALL_LDFLAGS := -dllib $(DLLSONAME)
  18.595 +      endif
  18.596 +    endif
  18.597 +  endif
  18.598 +
  18.599 +  ifndef NO_CUSTOM
  18.600 +    ifneq "$(strip $(OBJ_LINK) $(THREADS) $(MAYBE_IDL) $(CLIBS))" ""
  18.601 +      ALL_LDFLAGS += -custom
  18.602 +    endif
  18.603 +  endif
  18.604 +
  18.605 +  ALL_LDFLAGS += $(INCFLAGS) $(OCAMLLDFLAGS) $(OCAMLBLDFLAGS) \
  18.606 +                 $(COMMON_LDFLAGS) $(LIBS:%=%.cma)
  18.607 +  CAMLIDLDLLFLAGS :=
  18.608 +
  18.609 +  ifdef THREADS
  18.610 +    ifdef VMTHREADS
  18.611 +      THREAD_FLAG := -vmthread
  18.612 +    else
  18.613 +      THREAD_FLAG := -thread
  18.614 +    endif
  18.615 +    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
  18.616 +    ifndef CREATE_LIB
  18.617 +      ifndef REAL_OCAMLFIND
  18.618 +        ALL_LDFLAGS := unix.cma threads.cma $(ALL_LDFLAGS)
  18.619 +      endif
  18.620 +    endif
  18.621 +  endif
  18.622 +
  18.623 +# we have to make native-code
  18.624 +else
  18.625 +  EXTRADEPS := $(addsuffix .cmxa,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
  18.626 +  ifndef PROFILING
  18.627 +    SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS)
  18.628 +    PLDFLAGS :=
  18.629 +  else
  18.630 +    SPECIAL_OCAMLFLAGS := -p $(OCAMLNCFLAGS)
  18.631 +    PLDFLAGS := -p
  18.632 +  endif
  18.633 +
  18.634 +  REAL_IMPL := $(IMPL_CMX)
  18.635 +  REAL_IMPL_INTF := $(IMPLX_INTF)
  18.636 +  IMPL_SUF := .cmx
  18.637 +
  18.638 +  CPPFLAGS := -DNATIVE_CODE $(CPPFLAGS)
  18.639 +
  18.640 +  DEPFLAGS  := -native
  18.641 +  MAKE_DEPS := $(MLDEPS) $(NCDEPIS)
  18.642 +
  18.643 +  ALL_LDFLAGS := $(PLDFLAGS) $(INCFLAGS) $(OCAMLLDFLAGS) \
  18.644 +                 $(OCAMLNLDFLAGS) $(COMMON_LDFLAGS)
  18.645 +  CAMLIDLDLLFLAGS := -opt
  18.646 +
  18.647 +  ifndef CREATE_LIB
  18.648 +    ALL_LDFLAGS += $(LIBS:%=%.cmxa)
  18.649 +  else
  18.650 +    CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
  18.651 +    CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
  18.652 +  endif
  18.653 +
  18.654 +  ifdef THREADS
  18.655 +    THREAD_FLAG := -thread
  18.656 +    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
  18.657 +    ifndef CREATE_LIB
  18.658 +      ifndef REAL_OCAMLFIND
  18.659 +        ALL_LDFLAGS := unix.cmxa threads.cmxa $(ALL_LDFLAGS)
  18.660 +      endif
  18.661 +    endif
  18.662 +  endif
  18.663 +endif
  18.664 +
  18.665 +export MAKE_DEPS
  18.666 +
  18.667 +ifdef ANNOTATE
  18.668 +  ANNOT_FLAG := -dtypes
  18.669 +else
  18.670 +endif
  18.671 +
  18.672 +ALL_OCAMLCFLAGS := $(THREAD_FLAG) $(ANNOT_FLAG) $(OCAMLFLAGS) \
  18.673 +                   $(INCFLAGS) $(SPECIAL_OCAMLFLAGS)
  18.674 +
  18.675 +ifdef make_deps
  18.676 +  -include $(MAKE_DEPS)
  18.677 +  PRE_TARGETS :=
  18.678 +endif
  18.679 +
  18.680 +###########################################################################
  18.681 +# USER RULES
  18.682 +
  18.683 +# Call "OCamlMakefile QUIET=" to get rid of all of the @'s.
  18.684 +QUIET=@
  18.685 +
  18.686 +# generates byte-code (default)
  18.687 +byte-code:		$(PRE_TARGETS)
  18.688 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  18.689 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  18.690 +bc:	byte-code
  18.691 +
  18.692 +byte-code-nolink:	$(PRE_TARGETS)
  18.693 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  18.694 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  18.695 +bcnl:	byte-code-nolink
  18.696 +
  18.697 +top:			$(PRE_TARGETS)
  18.698 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(TOPRESULT) \
  18.699 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  18.700 +
  18.701 +# generates native-code
  18.702 +
  18.703 +native-code:		$(PRE_TARGETS)
  18.704 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
  18.705 +				REAL_RESULT="$(NCRESULT)" \
  18.706 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.707 +				make_deps=yes
  18.708 +nc:	native-code
  18.709 +
  18.710 +native-code-nolink:	$(PRE_TARGETS)
  18.711 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  18.712 +				REAL_RESULT="$(NCRESULT)" \
  18.713 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.714 +				make_deps=yes
  18.715 +ncnl:	native-code-nolink
  18.716 +
  18.717 +# generates byte-code libraries
  18.718 +byte-code-library:	$(PRE_TARGETS)
  18.719 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.720 +				$(RES_CLIB) $(BCRESULT).cma \
  18.721 +				REAL_RESULT="$(BCRESULT)" \
  18.722 +				CREATE_LIB=yes \
  18.723 +				make_deps=yes
  18.724 +bcl:	byte-code-library
  18.725 +
  18.726 +# generates native-code libraries
  18.727 +native-code-library:	$(PRE_TARGETS)
  18.728 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.729 +				$(RES_CLIB) $(NCRESULT).cmxa \
  18.730 +				REAL_RESULT="$(NCRESULT)" \
  18.731 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.732 +				CREATE_LIB=yes \
  18.733 +				make_deps=yes
  18.734 +ncl:	native-code-library
  18.735 +
  18.736 +ifdef WIN32
  18.737 +# generates byte-code dll
  18.738 +byte-code-dll:		$(PRE_TARGETS)
  18.739 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.740 +				$(RES_CLIB) $(BCRESULT).dll \
  18.741 +				REAL_RESULT="$(BCRESULT)" \
  18.742 +				make_deps=yes
  18.743 +bcd:	byte-code-dll
  18.744 +
  18.745 +# generates native-code dll
  18.746 +native-code-dll:	$(PRE_TARGETS)
  18.747 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.748 +				$(RES_CLIB) $(NCRESULT).dll \
  18.749 +				REAL_RESULT="$(NCRESULT)" \
  18.750 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.751 +				make_deps=yes
  18.752 +ncd:	native-code-dll
  18.753 +endif
  18.754 +
  18.755 +# generates byte-code with debugging information
  18.756 +debug-code:		$(PRE_TARGETS)
  18.757 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  18.758 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  18.759 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  18.760 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  18.761 +dc:	debug-code
  18.762 +
  18.763 +debug-code-nolink:	$(PRE_TARGETS)
  18.764 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  18.765 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  18.766 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  18.767 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  18.768 +dcnl:	debug-code-nolink
  18.769 +
  18.770 +# generates byte-code libraries with debugging information
  18.771 +debug-code-library:	$(PRE_TARGETS)
  18.772 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.773 +				$(RES_CLIB) $(BCRESULT).cma \
  18.774 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  18.775 +				CREATE_LIB=yes \
  18.776 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  18.777 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  18.778 +dcl:	debug-code-library
  18.779 +
  18.780 +# generates byte-code for profiling
  18.781 +profiling-byte-code:		$(PRE_TARGETS)
  18.782 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  18.783 +				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
  18.784 +				make_deps=yes
  18.785 +pbc:	profiling-byte-code
  18.786 +
  18.787 +# generates native-code
  18.788 +
  18.789 +profiling-native-code:		$(PRE_TARGETS)
  18.790 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
  18.791 +				REAL_RESULT="$(NCRESULT)" \
  18.792 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.793 +				PROFILING="y" \
  18.794 +				make_deps=yes
  18.795 +pnc:	profiling-native-code
  18.796 +
  18.797 +# generates byte-code libraries
  18.798 +profiling-byte-code-library:	$(PRE_TARGETS)
  18.799 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.800 +				$(RES_CLIB) $(BCRESULT).cma \
  18.801 +				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
  18.802 +				CREATE_LIB=yes \
  18.803 +				make_deps=yes
  18.804 +pbcl:	profiling-byte-code-library
  18.805 +
  18.806 +# generates native-code libraries
  18.807 +profiling-native-code-library:	$(PRE_TARGETS)
  18.808 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.809 +				$(RES_CLIB) $(NCRESULT).cmxa \
  18.810 +				REAL_RESULT="$(NCRESULT)" PROFILING="y" \
  18.811 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.812 +				CREATE_LIB=yes \
  18.813 +				make_deps=yes
  18.814 +pncl:	profiling-native-code-library
  18.815 +
  18.816 +# packs byte-code objects
  18.817 +pack-byte-code:			$(PRE_TARGETS)
  18.818 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT).cmo \
  18.819 +				REAL_RESULT="$(BCRESULT)" \
  18.820 +				PACK_LIB=yes make_deps=yes
  18.821 +pabc:	pack-byte-code
  18.822 +
  18.823 +# packs native-code objects
  18.824 +pack-native-code:		$(PRE_TARGETS)
  18.825 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  18.826 +				$(NCRESULT).cmx $(NCRESULT).o \
  18.827 +				REAL_RESULT="$(NCRESULT)" \
  18.828 +				REAL_OCAMLC="$(OCAMLOPT)" \
  18.829 +				PACK_LIB=yes make_deps=yes
  18.830 +panc:	pack-native-code
  18.831 +
  18.832 +# generates HTML-documentation
  18.833 +htdoc:	doc/$(RESULT)/html
  18.834 +
  18.835 +# generates Latex-documentation
  18.836 +ladoc:	doc/$(RESULT)/latex
  18.837 +
  18.838 +# generates PostScript-documentation
  18.839 +psdoc:	doc/$(RESULT)/latex/doc.ps
  18.840 +
  18.841 +# generates PDF-documentation
  18.842 +pdfdoc:	doc/$(RESULT)/latex/doc.pdf
  18.843 +
  18.844 +# generates all supported forms of documentation
  18.845 +doc: htdoc ladoc psdoc pdfdoc
  18.846 +
  18.847 +###########################################################################
  18.848 +# LOW LEVEL RULES
  18.849 +
  18.850 +$(REAL_RESULT):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) $(RESULTDEPS)
  18.851 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) \
  18.852 +				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
  18.853 +				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
  18.854 +				$(REAL_IMPL)
  18.855 +
  18.856 +nolink:			$(REAL_IMPL_INTF) $(OBJ_LINK)
  18.857 +
  18.858 +ifdef WIN32
  18.859 +$(REAL_RESULT).dll:	$(REAL_IMPL_INTF) $(OBJ_LINK)
  18.860 +			$(CAMLIDLDLL) $(CAMLIDLDLLFLAGS) $(OBJ_LINK) $(CLIBS) \
  18.861 +				-o $@ $(REAL_IMPL)
  18.862 +endif
  18.863 +
  18.864 +%$(TOPSUFFIX):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
  18.865 +			$(REAL_OCAMLFIND) $(OCAMLMKTOP) \
  18.866 +				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
  18.867 +				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
  18.868 +				$(REAL_IMPL)
  18.869 +
  18.870 +.SUFFIXES:		.mli .ml .cmi .cmo .cmx .cma .cmxa .$(EXT_OBJ) \
  18.871 +                        .mly .di .d .$(EXT_LIB) .idl %.oxridl .c .$(EXT_CXX) .h .so \
  18.872 +                        .rep .zog .glade
  18.873 +
  18.874 +ifndef STATIC
  18.875 +ifdef MINGW
  18.876 +$(DLLSONAME):		$(OBJ_LINK)
  18.877 +			$(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
  18.878 +			-Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
  18.879 +			 $(OCAMLLIBPATH)/ocamlrun.a \
  18.880 +			-Wl,--export-all-symbols \
  18.881 +			-Wl,--no-whole-archive
  18.882 +else
  18.883 +ifdef MSVC
  18.884 +$(DLLSONAME):		$(OBJ_LINK)
  18.885 +			link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
  18.886 +			 $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
  18.887 +			 $(OCAMLLIBPATH)/ocamlrun.lib
  18.888 +
  18.889 +else
  18.890 +$(DLLSONAME):		$(OBJ_LINK)
  18.891 +			$(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \
  18.892 +				-o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \
  18.893 +				$(OCAMLMKLIB_FLAGS)
  18.894 +endif
  18.895 +endif
  18.896 +endif
  18.897 +
  18.898 +ifndef LIB_PACK_NAME
  18.899 +$(RESULT).cma:		$(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
  18.900 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
  18.901 +				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(REAL_IMPL)
  18.902 +
  18.903 +$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(REAL_IMPL_INTF) $(EXTRADEPS) $(RESULTDEPS)
  18.904 +			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
  18.905 +				$(OCAMLNLDFLAGS) -o $@ $(REAL_IMPL)
  18.906 +else
  18.907 +ifdef BYTE_OCAML
  18.908 +$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF)
  18.909 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(REAL_IMPL)
  18.910 +else
  18.911 +$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF)
  18.912 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmx $(REAL_IMPL)
  18.913 +endif
  18.914 +
  18.915 +$(RESULT).cma:		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
  18.916 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
  18.917 +				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(LIB_PACK_NAME).cmo
  18.918 +
  18.919 +$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx $(EXTRADEPS) $(RESULTDEPS)
  18.920 +			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
  18.921 +				$(OCAMLNLDFLAGS) -o $@ $(LIB_PACK_NAME).cmx
  18.922 +endif
  18.923 +
  18.924 +$(RES_CLIB): 		$(OBJ_LINK)
  18.925 +ifndef MSVC
  18.926 +  ifneq ($(strip $(OBJ_LINK)),)
  18.927 +		      $(AR) rcs $@ $(OBJ_LINK)
  18.928 +  endif
  18.929 +else
  18.930 +  ifneq ($(strip $(OBJ_LINK)),)
  18.931 +			lib -nologo -debugtype:cv -out:$(RES_CLIB) $(OBJ_LINK)
  18.932 +  endif
  18.933 +endif
  18.934 +
  18.935 +.mli.cmi: $(EXTRADEPS)
  18.936 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
  18.937 +			if [ -z "$$pp" ]; then \
  18.938 +			  echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.939 +				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
  18.940 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  18.941 +			  $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.942 +				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
  18.943 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  18.944 +			else \
  18.945 +			    echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.946 +				-c -pp \"$$pp $(PPFLAGS)\" $(THREAD_FLAG) $(ANNOT_FLAG) \
  18.947 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  18.948 +			    $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.949 +				-c -pp "$$pp $(PPFLAGS)" $(THREAD_FLAG) $(ANNOT_FLAG) \
  18.950 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  18.951 +			fi
  18.952 +
  18.953 +.ml.cmi .ml.$(EXT_OBJ) .ml.cmx .ml.cmo: $(EXTRADEPS)
  18.954 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
  18.955 +			if [ -z "$$pp" ]; then \
  18.956 +			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.957 +				-c $(ALL_OCAMLCFLAGS) $<; \
  18.958 +			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.959 +				-c $(ALL_OCAMLCFLAGS) $<; \
  18.960 +			else \
  18.961 +			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.962 +				-c -pp \"$$pp $(PPFLAGS)\" $(ALL_OCAMLCFLAGS) $<; \
  18.963 +			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  18.964 +				-c -pp "$$pp $(PPFLAGS)" $(ALL_OCAMLCFLAGS) $<; \
  18.965 +			fi
  18.966 +
  18.967 +ifdef PACK_LIB
  18.968 +$(REAL_RESULT).cmo $(REAL_RESULT).cmx $(REAL_RESULT).o: $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
  18.969 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack $(ALL_LDFLAGS) \
  18.970 +				$(OBJS_LIBS) -o $@ $(REAL_IMPL)
  18.971 +endif
  18.972 +
  18.973 +.PRECIOUS:		%.ml
  18.974 +%.ml:			%.mll
  18.975 +			$(OCAMLLEX) $<
  18.976 +
  18.977 +.PRECIOUS:              %.ml %.mli
  18.978 +%.ml %.mli:             %.mly
  18.979 +			$(OCAMLYACC) $(YFLAGS) $<
  18.980 +			$(QUIET)pp=`sed -n -e 's/.*(\*pp \([^*]*\) \*).*/\1/p;q' $<`; \
  18.981 +			if [ ! -z "$$pp" ]; then \
  18.982 +			  mv $*.ml $*.ml.temporary; \
  18.983 +			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.ml; \
  18.984 +			  cat $*.ml.temporary >> $*.ml; \
  18.985 +			  rm $*.ml.temporary; \
  18.986 +			  mv $*.mli $*.mli.temporary; \
  18.987 +			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.mli; \
  18.988 +			  cat $*.mli.temporary >> $*.mli; \
  18.989 +			  rm $*.mli.temporary; \
  18.990 +			fi
  18.991 +
  18.992 +
  18.993 +.PRECIOUS:		%.ml
  18.994 +%.ml:			%.rep
  18.995 +			$(CAMELEON_REPORT) $(CAMELEON_REPORT_FLAGS) -gen $<
  18.996 +
  18.997 +.PRECIOUS:		%.ml
  18.998 +%.ml:			%.zog
  18.999 +			$(CAMELEON_ZOGGY)  $(CAMELEON_ZOGGY_FLAGS) -impl $< > $@
 18.1000 +
 18.1001 +.PRECIOUS:		%.ml
 18.1002 +%.ml:			%.glade
 18.1003 +			$(OCAML_GLADECC)  $(OCAML_GLADECC_FLAGS) $< > $@
 18.1004 +
 18.1005 +.PRECIOUS:		%.ml %.mli
 18.1006 +%.ml %.mli:		%.oxridl
 18.1007 +			$(OXRIDL) $<
 18.1008 +
 18.1009 +.PRECIOUS:		%.ml %.mli %_stubs.c %.h
 18.1010 +%.ml %.mli %_stubs.c %.h:		%.idl
 18.1011 +			$(CAMLIDL) $(MAYBE_IDL_HEADER) $(IDLFLAGS) \
 18.1012 +				$(CAMLIDLFLAGS) $<
 18.1013 +			$(QUIET)if [ $(NOIDLHEADER) ]; then touch $*.h; fi
 18.1014 +
 18.1015 +.c.$(EXT_OBJ):
 18.1016 +			$(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \
 18.1017 +				$(CPPFLAGS) $(CPPFLAGS_WIN32) \
 18.1018 +				$(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $< 
 18.1019 +
 18.1020 +.$(EXT_CXX).$(EXT_OBJ):
 18.1021 +			$(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
 18.1022 +				-I'$(OCAMLLIBPATH)' \
 18.1023 +				$< $(CFLAG_O)$@
 18.1024 +
 18.1025 +$(MLDEPDIR)/%.d:	%.ml
 18.1026 +			$(QUIET)echo making $@ from $<
 18.1027 +			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
 18.1028 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 18.1029 +			if [ -z "$$pp" ]; then \
 18.1030 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
 18.1031 +				$(DINCFLAGS) $< > $@; \
 18.1032 +			else \
 18.1033 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
 18.1034 +				-pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
 18.1035 +			fi
 18.1036 +
 18.1037 +$(BCDIDIR)/%.di $(NCDIDIR)/%.di:	%.mli
 18.1038 +			$(QUIET)echo making $@ from $<
 18.1039 +			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
 18.1040 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 18.1041 +			if [ -z "$$pp" ]; then \
 18.1042 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< > $@; \
 18.1043 +			else \
 18.1044 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
 18.1045 +			    -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
 18.1046 +			fi
 18.1047 +
 18.1048 +doc/$(RESULT)/html: $(DOC_FILES)
 18.1049 +	rm -rf $@
 18.1050 +	mkdir -p $@
 18.1051 +	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 18.1052 +	if [ -z "$$pp" ]; then \
 18.1053 +	  echo $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 18.1054 +	  $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 18.1055 +	else \
 18.1056 +	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -html -d $@ $(OCAMLDOCFLAGS) \
 18.1057 +	  	$(INCFLAGS) $(DOC_FILES); \
 18.1058 +	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -html -d $@ $(OCAMLDOCFLAGS) \
 18.1059 +	  	$(INCFLAGS) $(DOC_FILES); \
 18.1060 +	fi
 18.1061 +
 18.1062 +doc/$(RESULT)/latex: $(DOC_FILES)
 18.1063 +	rm -rf $@
 18.1064 +	mkdir -p $@
 18.1065 +	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 18.1066 +	if [ -z "$$pp" ]; then \
 18.1067 +	  echo $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) \
 18.1068 +	  	$(DOC_FILES) -o $@/doc.tex; \
 18.1069 +	  $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES) \
 18.1070 +	  	-o $@/doc.tex; \
 18.1071 +	else \
 18.1072 +	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -latex $(OCAMLDOCFLAGS) \
 18.1073 +	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
 18.1074 +	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -latex $(OCAMLDOCFLAGS) \
 18.1075 +	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
 18.1076 +	fi
 18.1077 +
 18.1078 +doc/$(RESULT)/latex/doc.ps: doc/$(RESULT)/latex
 18.1079 +	cd doc/$(RESULT)/latex && \
 18.1080 +	  $(LATEX) doc.tex && \
 18.1081 +	  $(LATEX) doc.tex && \
 18.1082 +	  $(DVIPS) $(DVIPSFLAGS) doc.dvi -o $(@F)
 18.1083 +
 18.1084 +doc/$(RESULT)/latex/doc.pdf: doc/$(RESULT)/latex/doc.ps
 18.1085 +	cd doc/$(RESULT)/latex && $(PS2PDF) $(<F)
 18.1086 +
 18.1087 +define make_subproj
 18.1088 +.PHONY:
 18.1089 +subproj_$(1):
 18.1090 +	$$(eval $$(call PROJ_$(1)))
 18.1091 +	$(QUIET)if [ "$(SUBTARGET)" != "all" ]; then \
 18.1092 +	  $(MAKE) -f $(OCAMLMAKEFILE) $(SUBTARGET); \
 18.1093 +	fi
 18.1094 +endef
 18.1095 +
 18.1096 +$(foreach subproj,$(SUBPROJS),$(eval $(call make_subproj,$(subproj))))
 18.1097 +
 18.1098 +.PHONY:
 18.1099 +subprojs: $(SUBPROJS:%=subproj_%)
 18.1100 +
 18.1101 +###########################################################################
 18.1102 +# (UN)INSTALL RULES FOR LIBRARIES
 18.1103 +
 18.1104 +.PHONY: libinstall
 18.1105 +libinstall:	all
 18.1106 +	$(QUIET)printf "\nInstalling library with ocamlfind\n"
 18.1107 +	$(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META $(LIBINSTALL_FILES)
 18.1108 +	$(QUIET)printf "\nInstallation successful.\n"
 18.1109 +
 18.1110 +.PHONY: libuninstall
 18.1111 +libuninstall:
 18.1112 +	$(QUIET)printf "\nUninstalling library with ocamlfind\n"
 18.1113 +	$(OCAMLFIND) remove $(OCAMLFIND_INSTFLAGS) $(RESULT)
 18.1114 +	$(QUIET)printf "\nUninstallation successful.\n"
 18.1115 +
 18.1116 +.PHONY: rawinstall
 18.1117 +rawinstall:	all
 18.1118 +	$(QUIET)printf "\nInstalling library to: $(OCAML_LIB_INSTALL)\n"
 18.1119 +	-install -d $(OCAML_LIB_INSTALL)
 18.1120 +	for i in $(LIBINSTALL_FILES); do \
 18.1121 +	  if [ -f $$i ]; then \
 18.1122 +	    install -c -m 0644 $$i $(OCAML_LIB_INSTALL); \
 18.1123 +	  fi; \
 18.1124 +	done
 18.1125 +	$(QUIET)printf "\nInstallation successful.\n"
 18.1126 +
 18.1127 +.PHONY: rawuninstall
 18.1128 +rawuninstall:
 18.1129 +	$(QUIET)printf "\nUninstalling library from: $(OCAML_LIB_INSTALL)\n"
 18.1130 +	cd $(OCAML_LIB_INSTALL) && rm $(notdir $(LIBINSTALL_FILES))
 18.1131 +	$(QUIET)printf "\nUninstallation successful.\n"
 18.1132 +
 18.1133 +###########################################################################
 18.1134 +# MAINTAINANCE RULES
 18.1135 +
 18.1136 +.PHONY:	clean
 18.1137 +clean::
 18.1138 +	rm -f $(TARGETS) $(TRASH)
 18.1139 +	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
 18.1140 +
 18.1141 +.PHONY:	cleanup
 18.1142 +cleanup::
 18.1143 +	rm -f $(NONEXECS) $(TRASH)
 18.1144 +	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
 18.1145 +
 18.1146 +.PHONY: clean-doc
 18.1147 +clean-doc::
 18.1148 +	rm -rf doc
 18.1149 +
 18.1150 +.PHONY: nobackup
 18.1151 +nobackup:
 18.1152 +	rm -f *.bak *~ *.dup
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tools/debugger/pdb/PDB.ml	Sat Jun 04 13:07:05 2005 +0000
    19.3 @@ -0,0 +1,180 @@
    19.4 +(** PDB.ml
    19.5 + *
    19.6 + *  Dispatch debugger commands to the appropriate context
    19.7 + *
    19.8 + *  @author copyright (c) 2005 alex ho
    19.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   19.10 + *  @version 1
   19.11 + *)
   19.12 +
   19.13 +exception Unimplemented of string
   19.14 +exception Unknown_context of string
   19.15 +exception Unknown_domain
   19.16 +
   19.17 +type context_t =
   19.18 +  | Void
   19.19 +  | Event_channel
   19.20 +  | Domain of Domain.context_t
   19.21 +  | Process of Process.context_t
   19.22 +
   19.23 +let string_of_context ctx =
   19.24 +  match ctx with
   19.25 +  | Void -> "{void}"
   19.26 +  | Event_channel -> "{event channel}"
   19.27 +  | Domain d  -> Domain.string_of_context d
   19.28 +  | Process p -> Process.string_of_context p
   19.29 +
   19.30 +
   19.31 +
   19.32 +let read_registers ctx =
   19.33 +  match ctx with
   19.34 +  | Domain d  -> Domain.read_registers d 
   19.35 +  | _ -> Intel.null_registers
   19.36 +
   19.37 +let write_register ctx register value =
   19.38 +  match ctx with
   19.39 +  | Domain d  -> Domain.write_register d register value
   19.40 +  | _ -> raise (Unimplemented "write register")
   19.41 +
   19.42 +
   19.43 +let read_memory ctx addr len =
   19.44 +  match ctx with
   19.45 +  | Domain d  -> Domain.read_memory d addr len
   19.46 +  | _ -> raise (Unimplemented "read memory")
   19.47 +
   19.48 +let write_memory ctx addr values =
   19.49 +  match ctx with
   19.50 +  | Domain d  -> Domain.write_memory d addr values
   19.51 +  | _ -> raise (Unimplemented "write memory")
   19.52 +
   19.53 +
   19.54 +let continue ctx =
   19.55 +  match ctx with
   19.56 +  | Domain d  -> Domain.continue d
   19.57 +  | _ -> raise (Unimplemented "continue")
   19.58 +
   19.59 +let step ctx =
   19.60 +  match ctx with
   19.61 +  | Domain d  -> Domain.step d
   19.62 +  | _ -> raise (Unimplemented "step")
   19.63 +
   19.64 +
   19.65 +let insert_memory_breakpoint ctx addr len =
   19.66 +  match ctx with
   19.67 +  | Domain d  -> Domain.insert_memory_breakpoint d addr len
   19.68 +  | _ -> raise (Unimplemented "insert memory breakpoint")
   19.69 +
   19.70 +let remove_memory_breakpoint ctx addr len =
   19.71 +  match ctx with
   19.72 +  | Domain d  -> Domain.remove_memory_breakpoint d addr len
   19.73 +  | _ -> raise (Unimplemented "remove memory breakpoint")
   19.74 +
   19.75 +
   19.76 +let pause ctx =
   19.77 +  match ctx with
   19.78 +  | Domain d  -> Domain.pause d
   19.79 +  | _ -> raise (Unimplemented "pause target")
   19.80 +
   19.81 +
   19.82 +let attach_debugger ctx =
   19.83 +  match ctx with
   19.84 +  | Domain d  -> Domain.attach_debugger (Domain.get_domain d) 
   19.85 +	                                (Domain.get_execution_domain d)
   19.86 +  | _ -> raise (Unimplemented "attach debugger")
   19.87 +
   19.88 +let detach_debugger ctx =
   19.89 +  match ctx with
   19.90 +  | Domain d  -> Domain.detach_debugger (Domain.get_domain d) 
   19.91 +	                                (Domain.get_execution_domain d)
   19.92 +  | _ -> raise (Unimplemented "detach debugger")
   19.93 +
   19.94 +external open_debugger : unit -> unit = "open_context"
   19.95 +external close_debugger : unit -> unit = "close_context"
   19.96 +
   19.97 +(* this is just the domains right now... expand to other contexts later *)
   19.98 +external debugger_status : unit -> unit = "debugger_status"
   19.99 +
  19.100 +
  19.101 +(***********************************************************)
  19.102 +
  19.103 +
  19.104 +let hash = Hashtbl.create 10
  19.105 +
  19.106 +let debug_contexts () =
  19.107 +  print_endline "context list:";
  19.108 +  let print_context key ctx = 
  19.109 +    match ctx with
  19.110 +    | Void -> print_endline (Printf.sprintf "  [%s] {void}" 
  19.111 +			       (Util.get_connection_info key))
  19.112 +    | Event_channel -> print_endline (Printf.sprintf "  [%s] {event_channel}" 
  19.113 +			       (Util.get_connection_info key))
  19.114 +    | Process p -> print_endline (Printf.sprintf "  [%s] %s" 
  19.115 +				    (Util.get_connection_info key)
  19.116 +				    (Process.string_of_context p))
  19.117 +    | Domain d -> print_endline (Printf.sprintf "  [%s] %s" 
  19.118 +				   (Util.get_connection_info key)
  19.119 +				   (Domain.string_of_context d))
  19.120 +  in
  19.121 +  Hashtbl.iter print_context hash
  19.122 +
  19.123 +(** add_context : add a new context to the hash table.
  19.124 + *  if there is an existing context for the same key then it 
  19.125 + *  is first removed implictly by the hash table replace function.
  19.126 + *)
  19.127 +let add_context (key:Unix.file_descr) context params =
  19.128 +  match context with
  19.129 +  | "void" -> Hashtbl.replace hash key Void
  19.130 +  | "event channel" -> Hashtbl.replace hash key Event_channel
  19.131 +  | "domain" -> 
  19.132 +      begin
  19.133 +	match params with
  19.134 +	| dom::exec_dom::_ ->
  19.135 +            let d = Domain(Domain.new_context dom exec_dom) in
  19.136 +	    attach_debugger d;
  19.137 +            Hashtbl.replace hash key d
  19.138 +	| _ -> failwith "bogus parameters to domain context"
  19.139 +      end
  19.140 +  | "process" -> 
  19.141 +      begin
  19.142 +	match params with
  19.143 +	| dom::pid::_ ->
  19.144 +	    let p = Process.new_context dom pid in
  19.145 +	    Hashtbl.replace hash key (Process(p))
  19.146 +	| _ -> failwith "bogus parameters to process context"
  19.147 +      end
  19.148 +  | _ -> raise (Unknown_context context)
  19.149 +
  19.150 +let add_default_context sock =
  19.151 +  add_context sock "void" []
  19.152 +
  19.153 +let find_context key =
  19.154 +  try
  19.155 +    Hashtbl.find hash key
  19.156 +  with
  19.157 +    Not_found ->
  19.158 +      print_endline "error: (find_context) PDB context not found";
  19.159 +      raise Not_found
  19.160 +
  19.161 +let delete_context key =
  19.162 +  Hashtbl.remove hash key
  19.163 +
  19.164 +(** find_domain : Locate the context(s) matching a particular domain 
  19.165 + *  and execution_domain pair.
  19.166 + *)
  19.167 +
  19.168 +let find_domain dom exec_dom =
  19.169 +    let find key ctx list =
  19.170 +      match ctx with
  19.171 +      |	Domain d ->
  19.172 +	  if (((Domain.get_domain d) = dom) &&
  19.173 +	      ((Domain.get_execution_domain d) = exec_dom))
  19.174 +	  then
  19.175 +	    key :: list
  19.176 +	  else
  19.177 +	    list
  19.178 +      | _ -> list
  19.179 +    in
  19.180 +    let sock_list = Hashtbl.fold find hash [] in
  19.181 +    match sock_list with
  19.182 +    | hd::tl -> hd
  19.183 +    | [] -> raise Unknown_domain
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tools/debugger/pdb/Process.ml	Sat Jun 04 13:07:05 2005 +0000
    20.3 @@ -0,0 +1,39 @@
    20.4 +(** Process.ml
    20.5 + *
    20.6 + *  process context implementation
    20.7 + *
    20.8 + *  @author copyright (c) 2005 alex ho
    20.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   20.10 + *  @version 1
   20.11 + *)
   20.12 +
   20.13 +open Int32
   20.14 +open Intel
   20.15 +
   20.16 +type context_t =
   20.17 +{
   20.18 +  mutable domain : int;
   20.19 +  mutable process : int;
   20.20 +}
   20.21 +
   20.22 +let default_context = { domain = 0; process = 0 }
   20.23 +
   20.24 +let new_context dom proc = { domain = dom; process = proc }
   20.25 +
   20.26 +let string_of_context ctx =
   20.27 +  Printf.sprintf "{process} domain: %d, process: %d"
   20.28 +                 ctx.domain  ctx.process
   20.29 +
   20.30 +let set_domain ctx value =
   20.31 +  ctx.domain <- value;
   20.32 +  print_endline (Printf.sprintf "ctx.domain <- %d" ctx.domain)
   20.33 +
   20.34 +let set_process ctx value =
   20.35 +  ctx.process <- value;
   20.36 +  print_endline (Printf.sprintf "ctx.process <- %d" ctx.process)
   20.37 +
   20.38 +let get_domain ctx =
   20.39 +  ctx.domain
   20.40 +
   20.41 +let get_process ctx =
   20.42 +  ctx.process
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/debugger/pdb/Process.mli	Sat Jun 04 13:07:05 2005 +0000
    21.3 @@ -0,0 +1,20 @@
    21.4 +(** Process.mli
    21.5 + *
    21.6 + *  process context interface
    21.7 + *
    21.8 + *  @author copyright (c) 2005 alex ho
    21.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   21.10 + *  @version 1
   21.11 + *)
   21.12 +
   21.13 +type context_t
   21.14 +
   21.15 +val default_context : context_t
   21.16 +val new_context : int -> int -> context_t
   21.17 +
   21.18 +val set_domain : context_t -> int -> unit
   21.19 +val get_domain : context_t -> int
   21.20 +val set_process : context_t -> int -> unit
   21.21 +val get_process : context_t -> int
   21.22 +
   21.23 +val string_of_context : context_t -> string
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tools/debugger/pdb/Util.ml	Sat Jun 04 13:07:05 2005 +0000
    22.3 @@ -0,0 +1,153 @@
    22.4 +(** Util.ml
    22.5 + *
    22.6 + *  various utility functions
    22.7 + *
    22.8 + *  @author copyright (c) 2005 alex ho
    22.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   22.10 + *  @version 1
   22.11 + *)
   22.12 +
   22.13 +let int_of_hexchar h = 
   22.14 +  let i = int_of_char h in
   22.15 +  match h with
   22.16 +  | '0' .. '9' -> i - (int_of_char '0')
   22.17 +  | 'a' .. 'f' -> i - (int_of_char 'a') + 10
   22.18 +  | 'A' .. 'F' -> i - (int_of_char 'A') + 10
   22.19 +  | _ -> raise (Invalid_argument "unknown hex character")
   22.20 +
   22.21 +let hexchar_of_int i = 
   22.22 +  let hexchars = [| '0'; '1'; '2'; '3'; '4'; '5'; '6'; '7';
   22.23 +		    '8'; '9'; 'a'; 'b'; 'c'; 'd'; 'e'; 'f' |]
   22.24 +  in
   22.25 +  hexchars.(i)
   22.26 +
   22.27 +
   22.28 +(** flip the bytes of a four byte int 
   22.29 + *)
   22.30 +
   22.31 +let flip_int num =
   22.32 +  let a = num mod 256
   22.33 +  and b = (num / 256) mod 256
   22.34 +  and c = (num / (256 * 256)) mod 256
   22.35 +  and d = (num / (256 * 256 * 256)) in
   22.36 +  (a * 256 * 256 * 256) + (b * 256 * 256) + (c * 256) + d
   22.37 +
   22.38 +    
   22.39 +let flip_int32 num =
   22.40 +  let a = Int32.logand num 0xffl
   22.41 +  and b = Int32.logand (Int32.shift_right_logical num 8)  0xffl
   22.42 +  and c = Int32.logand (Int32.shift_right_logical num 16) 0xffl
   22.43 +  and d =              (Int32.shift_right_logical num 24)       in
   22.44 +  (Int32.logor
   22.45 +     (Int32.logor (Int32.shift_left a 24) (Int32.shift_left b 16))
   22.46 +     (Int32.logor (Int32.shift_left c 8)  d))
   22.47 +
   22.48 +
   22.49 +let int_list_of_string_list list =
   22.50 +  List.map (fun x -> int_of_string x) list
   22.51 +    
   22.52 +let int_list_of_string str len =
   22.53 +  let array_of_string s =
   22.54 +    let int_array = Array.make len 0 in
   22.55 +    for loop = 0 to len - 1 do
   22.56 +      int_array.(loop) <- (Char.code s.[loop]);
   22.57 +    done;
   22.58 +    int_array
   22.59 +  in
   22.60 +  Array.to_list (array_of_string str)
   22.61 +
   22.62 +
   22.63 +(* remove leading and trailing whitespace from a string *)
   22.64 +
   22.65 +let chomp str =
   22.66 +  let head = Str.regexp "^[ \t\r\n]+" in
   22.67 +  let tail = Str.regexp "[ \t\r\n]+$" in
   22.68 +  let str = Str.global_replace head "" str in
   22.69 +  Str.global_replace tail "" str
   22.70 +
   22.71 +(* Stupid little parser for    "<key>=<value>[,<key>=<value>]*"
   22.72 +   It first chops the entire command at each ',', so no ',' in key or value!
   22.73 +   Mucked to return a list of words for "value"
   22.74 + *)
   22.75 +
   22.76 +let list_of_string str =
   22.77 +  let delim c = Str.regexp ("[ \t]*" ^ c ^ "[ \t]*") in
   22.78 +  let str_list = Str.split (delim " ") str in
   22.79 +  List.map (fun x -> chomp(x)) str_list
   22.80 +
   22.81 +let little_parser fn str =
   22.82 +  let delim c = Str.regexp ("[ \t]*" ^ c ^ "[ \t]*") in
   22.83 +  let str_list = Str.split (delim ",") str in
   22.84 +  let pair s =
   22.85 +    match Str.split (delim "=") s with
   22.86 +    | [key;value] -> fn (chomp key) (list_of_string value)
   22.87 +    | [key] -> fn (chomp key) []
   22.88 +    | _ -> failwith (Printf.sprintf "error: (little_parser) parse error [%s]" str)
   22.89 +  in
   22.90 +  List.iter pair str_list
   22.91 +
   22.92 +(* boolean list membership test *)
   22.93 +let not_list_member the_list element =
   22.94 +  try 
   22.95 +    List.find (fun x -> x = element) the_list;
   22.96 +    false
   22.97 +  with
   22.98 +    Not_found -> true
   22.99 +
  22.100 +(* a very inefficient way to remove the elements of one list from another *)
  22.101 +let list_remove the_list remove_list =
  22.102 +  List.filter (not_list_member remove_list) the_list
  22.103 +
  22.104 +(* get a description of a file descriptor *)
  22.105 +let get_connection_info fd =
  22.106 +  let get_local_info fd =
  22.107 +    let sockname = Unix.getsockname fd in
  22.108 +    match sockname with
  22.109 +    | Unix.ADDR_UNIX(s) -> s
  22.110 +    | Unix.ADDR_INET(a,p) -> ((Unix.string_of_inet_addr a) ^ ":" ^
  22.111 +			      (string_of_int p))
  22.112 +  and get_remote_info fd =
  22.113 +    let sockname = Unix.getpeername fd in 
  22.114 +    match sockname with
  22.115 +    | Unix.ADDR_UNIX(s) -> s
  22.116 +    | Unix.ADDR_INET(a,p) -> ((Unix.string_of_inet_addr a) ^ ":" ^
  22.117 +			      (string_of_int p))
  22.118 +  in
  22.119 +  try
  22.120 +    get_remote_info fd
  22.121 +  with
  22.122 +  | Unix.Unix_error (Unix.ENOTSOCK, s1, s2) -> 
  22.123 +      let s = Unix.fstat fd in
  22.124 +      Printf.sprintf "dev: %d, inode: %d" s.Unix.st_dev s.Unix.st_ino
  22.125 +  | _ -> get_local_info fd
  22.126 +
  22.127 +
  22.128 +(* really write a string *)
  22.129 +let really_write fd str =
  22.130 +  let strlen = String.length str in
  22.131 +  let sent = ref 0 in
  22.132 +  while (!sent < strlen) do
  22.133 +    sent := !sent + (Unix.write fd str !sent (strlen - !sent))
  22.134 +  done
  22.135 +
  22.136 +let write_character fd ch =
  22.137 +  let str = String.create 1 in
  22.138 +  str.[0] <- ch;
  22.139 +  really_write fd str
  22.140 +
  22.141 +
  22.142 +
  22.143 +let send_reply fd reply =
  22.144 +  let checksum = ref 0 in
  22.145 +  write_character fd '$';
  22.146 +  for loop = 0 to (String.length reply) - 1 do
  22.147 +    write_character fd reply.[loop];
  22.148 +    checksum := !checksum + int_of_char reply.[loop]
  22.149 +  done;
  22.150 +  write_character fd '#';
  22.151 +  write_character fd (hexchar_of_int ((!checksum mod 256) / 16));
  22.152 +  write_character fd (hexchar_of_int ((!checksum mod 256) mod 16))
  22.153 +  (*
  22.154 +   * BUG NEED TO LISTEN FOR REPLY +/- AND POSSIBLY RE-TRANSMIT
  22.155 +   *)
  22.156 +
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/debugger/pdb/debugger.ml	Sat Jun 04 13:07:05 2005 +0000
    23.3 @@ -0,0 +1,315 @@
    23.4 +(** debugger.ml
    23.5 + *
    23.6 + *  main debug functionality
    23.7 + *
    23.8 + *  @author copyright (c) 2005 alex ho
    23.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   23.10 + *  @version 1
   23.11 + *)
   23.12 +
   23.13 +open Intel
   23.14 +open PDB
   23.15 +open Util
   23.16 +open Str
   23.17 +
   23.18 +(** a few debugger commands such as step 's' and continue 'c' do 
   23.19 + *  not immediately return a response to the debugger.  in these 
   23.20 + *  cases we raise No_reply instead. 
   23.21 + *)
   23.22 +exception No_reply
   23.23 +
   23.24 +let initialize_debugger () =
   23.25 +  ()
   23.26 +
   23.27 +let exit_debugger () =
   23.28 +  ()
   23.29 +
   23.30 +
   23.31 +(**
   23.32 +   Detach Command
   23.33 +   Note: response is ignored by gdb.  We leave the context in the
   23.34 +   hash.  It will be cleaned up with the socket is closed.
   23.35 + *)
   23.36 +let gdb_detach ctx =
   23.37 +  PDB.detach_debugger ctx;
   23.38 +  raise No_reply
   23.39 +
   23.40 +(**
   23.41 +   Kill Command
   23.42 +   Note: response is ignored by gdb.  We leave the context in the
   23.43 +   hash.  It will be cleaned up with the socket is closed.
   23.44 + *)
   23.45 +let gdb_kill () =
   23.46 +  ""
   23.47 +
   23.48 +
   23.49 +
   23.50 +(**
   23.51 +   Continue Command.
   23.52 +   resume the target
   23.53 + *)
   23.54 +let gdb_continue ctx =
   23.55 +  PDB.continue ctx;
   23.56 +  raise No_reply
   23.57 +
   23.58 +(**
   23.59 +   Step Command.
   23.60 +   single step the target
   23.61 + *)
   23.62 +let gdb_step ctx =
   23.63 +  PDB.step ctx;
   23.64 +  raise No_reply
   23.65 +
   23.66 +
   23.67 +(**
   23.68 +   Read Registers Command.
   23.69 +   returns 16 4-byte registers in a particular defined by gdb.
   23.70 + *)
   23.71 +let gdb_read_registers ctx =
   23.72 +  let regs = PDB.read_registers ctx in
   23.73 +  let str = 
   23.74 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eax)) ^
   23.75 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ecx)) ^
   23.76 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.edx)) ^
   23.77 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ebx)) ^
   23.78 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.esp)) ^
   23.79 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ebp)) ^
   23.80 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.esi)) ^
   23.81 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.edi)) ^
   23.82 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eip)) ^
   23.83 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eflags)) ^
   23.84 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.cs)) ^
   23.85 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ss)) ^
   23.86 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ds)) ^
   23.87 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.es)) ^
   23.88 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.fs)) ^
   23.89 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.gs)) in
   23.90 +  str
   23.91 +      
   23.92 +(**
   23.93 +   Set Thread Command
   23.94 + *)
   23.95 +let gdb_set_thread command =
   23.96 +  "OK"
   23.97 +
   23.98 +
   23.99 +(**
  23.100 +   Read Memory Packets
  23.101 + *)
  23.102 +let gdb_read_memory ctx command =
  23.103 +  let int_list_to_string i str =
  23.104 +    (Printf.sprintf "%02x" i) ^ str
  23.105 +  in
  23.106 +  let read_mem addr len =
  23.107 +    try
  23.108 +      let mem = PDB.read_memory ctx addr len  in
  23.109 +      List.fold_right int_list_to_string mem ""
  23.110 +    with
  23.111 +      Failure s -> "E02"
  23.112 +  in
  23.113 +  Scanf.sscanf command "m%lx,%d" read_mem
  23.114 +
  23.115 +
  23.116 +
  23.117 +(**
  23.118 +   Write Memory Packets
  23.119 + *)
  23.120 +let gdb_write_memory ctx command =
  23.121 +  let write_mem addr len =
  23.122 +    print_endline (Printf.sprintf "  gdb_write_memory %lx %x\n" addr len);
  23.123 +    print_endline (Printf.sprintf "  [[ unimplemented ]]\n")
  23.124 +  in
  23.125 +  Scanf.sscanf command "M%lx,%d" write_mem;
  23.126 +  "OK"
  23.127 +
  23.128 +
  23.129 +
  23.130 +(**
  23.131 +   Write Register Packets
  23.132 + *)
  23.133 +let gdb_write_register ctx command =
  23.134 +  let write_reg reg goofy_val =
  23.135 +    let new_val = Util.flip_int32 goofy_val in
  23.136 +    match reg with
  23.137 +    |  0 -> PDB.write_register ctx EAX new_val
  23.138 +    |  1 -> PDB.write_register ctx ECX new_val
  23.139 +    |  2 -> PDB.write_register ctx EDX new_val
  23.140 +    |  3 -> PDB.write_register ctx EBX new_val
  23.141 +    |  4 -> PDB.write_register ctx ESP new_val
  23.142 +    |  5 -> PDB.write_register ctx EBP new_val
  23.143 +    |  6 -> PDB.write_register ctx ESI new_val
  23.144 +    |  7 -> PDB.write_register ctx EDI new_val
  23.145 +    |  8 -> PDB.write_register ctx EIP new_val
  23.146 +    |  9 -> PDB.write_register ctx EFLAGS new_val
  23.147 +    | 10 -> PDB.write_register ctx CS new_val
  23.148 +    | 11 -> PDB.write_register ctx SS new_val
  23.149 +    | 12 -> PDB.write_register ctx DS new_val
  23.150 +    | 13 -> PDB.write_register ctx ES new_val
  23.151 +    | 14 -> PDB.write_register ctx FS new_val
  23.152 +    | 15 -> PDB.write_register ctx GS new_val
  23.153 +    | _  -> print_endline (Printf.sprintf "write unknown register [%d]" reg)
  23.154 +  in
  23.155 +  Scanf.sscanf command "P%x=%lx" write_reg;
  23.156 +  "OK"
  23.157 +
  23.158 +
  23.159 +(**
  23.160 +   General Query Packets
  23.161 + *)
  23.162 +let gdb_query command =
  23.163 +  match command with
  23.164 +  | "qC" -> ""
  23.165 +  | "qOffsets" -> ""
  23.166 +  | "qSymbol::" -> ""
  23.167 +  | _ -> 
  23.168 +      print_endline (Printf.sprintf "unknown gdb query packet [%s]" command);
  23.169 +      "E01"
  23.170 +
  23.171 +
  23.172 +(**
  23.173 +   Write Memory Binary Packets
  23.174 + *)
  23.175 +let gdb_write_memory_binary ctx command =
  23.176 +  let write_mem addr len =
  23.177 +    let pos = Str.search_forward (Str.regexp ":") command 0 in
  23.178 +    let txt = Str.string_after command (pos + 1) in
  23.179 +    PDB.write_memory ctx addr (int_list_of_string txt len)
  23.180 +  in
  23.181 +  Scanf.sscanf command "X%lx,%d" write_mem;
  23.182 +  "OK"
  23.183 +
  23.184 +
  23.185 +
  23.186 +(**
  23.187 +   Last Signal Command
  23.188 + *)
  23.189 +let gdb_last_signal =
  23.190 +  "S00"
  23.191 +
  23.192 +
  23.193 +
  23.194 +
  23.195 +(**
  23.196 +   Process PDB extensions to the GDB serial protocol.
  23.197 +   Changes the mutable context state.
  23.198 + *)
  23.199 +let pdb_extensions command sock =
  23.200 +  let process_extension key value =
  23.201 +    (* since this command can change the context, we need to grab it each time *)
  23.202 +    let ctx = PDB.find_context sock in
  23.203 +    match key with
  23.204 +    | "status" ->
  23.205 +	print_endline (string_of_context ctx);
  23.206 +	PDB.debug_contexts ();
  23.207 +	debugger_status ()
  23.208 +    | "context" ->
  23.209 +        PDB.add_context sock (List.hd value) 
  23.210 +                             (int_list_of_string_list (List.tl value))
  23.211 +    | _ -> failwith (Printf.sprintf "unknown pdb extension command [%s:%s]" 
  23.212 +		                    key (List.hd value))
  23.213 +  in
  23.214 +  try
  23.215 +    Util.little_parser process_extension 
  23.216 +                       (String.sub command 1 ((String.length command) - 1));
  23.217 +    "OK"
  23.218 +  with
  23.219 +  | Unknown_context s -> 
  23.220 +      print_endline (Printf.sprintf "unknown context [%s]" s);
  23.221 +      "E01"
  23.222 +  | Failure s -> "E01"
  23.223 +
  23.224 +
  23.225 +(**
  23.226 +   Insert Breakpoint or Watchpoint Packet
  23.227 + *)
  23.228 +let gdb_insert_bwcpoint ctx command =
  23.229 +  let insert cmd addr length =
  23.230 +    try
  23.231 +      match cmd with
  23.232 +      | 0 -> PDB.insert_memory_breakpoint ctx addr length; "OK"
  23.233 +      | _ -> ""
  23.234 +    with
  23.235 +      Failure s -> "E03"
  23.236 +  in
  23.237 +  Scanf.sscanf command "Z%d,%lx,%d" insert
  23.238 +
  23.239 +(**
  23.240 +   Remove Breakpoint or Watchpoint Packet
  23.241 + *)
  23.242 +let gdb_remove_bwcpoint ctx command =
  23.243 +  let insert cmd addr length =
  23.244 +    try
  23.245 +      match cmd with
  23.246 +      | 0 -> PDB.remove_memory_breakpoint ctx addr length; "OK"
  23.247 +      | _ -> ""
  23.248 +    with
  23.249 +      Failure s -> "E04"
  23.250 +  in
  23.251 +  Scanf.sscanf command "z%d,%lx,%d" insert
  23.252 +
  23.253 +(**
  23.254 +   Do Work!
  23.255 +
  23.256 +   @param command  char list
  23.257 + *)
  23.258 +
  23.259 +let process_command command sock =
  23.260 +  let ctx = PDB.find_context sock in
  23.261 +  try
  23.262 +    match command.[0] with
  23.263 +    | 'c' -> gdb_continue ctx
  23.264 +    | 'D' -> gdb_detach ctx
  23.265 +    | 'g' -> gdb_read_registers ctx
  23.266 +    | 'H' -> gdb_set_thread command
  23.267 +    | 'k' -> gdb_kill ()
  23.268 +    | 'm' -> gdb_read_memory ctx command
  23.269 +    | 'M' -> gdb_write_memory ctx command
  23.270 +    | 'P' -> gdb_write_register ctx command
  23.271 +    | 'q' -> gdb_query command
  23.272 +    | 's' -> gdb_step ctx
  23.273 +    | 'x' -> pdb_extensions command sock
  23.274 +    | 'X' -> gdb_write_memory_binary ctx command
  23.275 +    | '?' -> gdb_last_signal
  23.276 +    | 'z' -> gdb_remove_bwcpoint ctx command
  23.277 +    | 'Z' -> gdb_insert_bwcpoint ctx command
  23.278 +    | _ -> 
  23.279 +	print_endline (Printf.sprintf "unknown gdb command [%s]" command);
  23.280 +	""
  23.281 +  with
  23.282 +    Unimplemented s ->
  23.283 +      print_endline (Printf.sprintf "loser. unimplemented command [%s][%s]" 
  23.284 +		                    command s);
  23.285 +      ""
  23.286 +
  23.287 +
  23.288 +(**
  23.289 +   process_evtchn  
  23.290 +
  23.291 +   This is called each time a virq_pdb is sent from xen to dom 0.
  23.292 +   It is sent by Xen when a domain hits a breakpoint. 
  23.293 +
  23.294 +   Think of this as the continuation function for a "c" or "s" command.
  23.295 +*)
  23.296 +
  23.297 +external query_domain_stop : unit -> (int * int) list = "query_domain_stop"
  23.298 +(* returns a list of paused domains : () -> (domain, vcpu) list *)
  23.299 +
  23.300 +let process_evtchn fd =
  23.301 +  let channel = Evtchn.read fd in
  23.302 +  let find_pair (dom, vcpu) =
  23.303 +    print_endline (Printf.sprintf "checking %d.%d" dom vcpu);
  23.304 +    try
  23.305 +      let sock = PDB.find_domain dom vcpu in
  23.306 +      true
  23.307 +    with
  23.308 +      Unknown_domain -> false
  23.309 +  in
  23.310 +  let dom_list = query_domain_stop () in
  23.311 +  let (dom, vcpu) = List.find find_pair dom_list in
  23.312 +  let vec = 3 in
  23.313 +  let sock = PDB.find_domain dom vcpu in
  23.314 +  print_endline (Printf.sprintf "handle bkpt d:%d ed:%d v:%d  %s" 
  23.315 +		   dom vcpu vec (Util.get_connection_info sock));
  23.316 +  Util.send_reply sock "S05";
  23.317 +  Evtchn.unmask fd channel                                (* allow next virq *)
  23.318 +  
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tools/debugger/pdb/evtchn.ml	Sat Jun 04 13:07:05 2005 +0000
    24.3 @@ -0,0 +1,32 @@
    24.4 +(** evtchn.ml
    24.5 + *
    24.6 + *  event channel interface
    24.7 + *
    24.8 + *  @author copyright (c) 2005 alex ho
    24.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   24.10 + *  @version 1
   24.11 + *)
   24.12 +
   24.13 +let dev_name = "/dev/xen/evtchn"                          (* EVTCHN_DEV_NAME *)
   24.14 +let dev_major = 10                                       (* EVTCHN_DEV_MAJOR *)
   24.15 +let dev_minor = 201                                      (* EVTCHN_DEV_MINOR *)
   24.16 +
   24.17 +let virq_pdb = 6                                      (* as defined VIRQ_PDB *)
   24.18 +
   24.19 +external bind_virq : int -> int = "evtchn_bind_virq"
   24.20 +external bind : Unix.file_descr -> int -> unit = "evtchn_bind"
   24.21 +external unbind : Unix.file_descr -> int -> unit = "evtchn_unbind"
   24.22 +external ec_open : string -> int -> int -> Unix.file_descr = "evtchn_open"
   24.23 +external read : Unix.file_descr -> int = "evtchn_read"
   24.24 +external ec_close : Unix.file_descr -> unit = "evtchn_close"
   24.25 +external unmask : Unix.file_descr -> int -> unit = "evtchn_unmask"
   24.26 +
   24.27 +let setup () =
   24.28 +  let port = bind_virq virq_pdb in
   24.29 +  let fd = ec_open dev_name dev_major dev_minor in
   24.30 +  bind fd port;
   24.31 +  fd
   24.32 +
   24.33 +let teardown fd =
   24.34 +  unbind fd virq_pdb;
   24.35 +  ec_close fd
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tools/debugger/pdb/evtchn.mli	Sat Jun 04 13:07:05 2005 +0000
    25.3 @@ -0,0 +1,14 @@
    25.4 +(** evtchn.mli
    25.5 + *
    25.6 + *  event channel interface
    25.7 + *
    25.8 + *  @author copyright (c) 2005 alex ho
    25.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   25.10 + *  @version 1
   25.11 + *)
   25.12 +
   25.13 +
   25.14 +val setup : unit -> Unix.file_descr
   25.15 +val read : Unix.file_descr -> int
   25.16 +val teardown : Unix.file_descr -> unit
   25.17 +val unmask : Unix.file_descr -> int -> unit
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/tools/debugger/pdb/pdb_caml_xc.c	Sat Jun 04 13:07:05 2005 +0000
    26.3 @@ -0,0 +1,732 @@
    26.4 +/*
    26.5 + * pdb_caml_xc.c
    26.6 + *
    26.7 + * http://www.cl.cam.ac.uk/netos/pdb
    26.8 + *
    26.9 + * OCaml to libxc interface library for PDB
   26.10 + */
   26.11 +
   26.12 +#include <xc.h>
   26.13 +#include <xendebug.h>
   26.14 +#include <errno.h>
   26.15 +#include <stdio.h>
   26.16 +#include <stdlib.h>
   26.17 +#include <string.h>
   26.18 +#include <sys/mman.h>
   26.19 +#include <caml/alloc.h>
   26.20 +#include <caml/fail.h>
   26.21 +#include <caml/memory.h>
   26.22 +#include <caml/mlvalues.h>
   26.23 +
   26.24 +int pdb_evtchn_bind_virq (int xc_handle, int virq, int *port);
   26.25 +int xen_evtchn_bind (int evtchn_fd, int idx);
   26.26 +int xen_evtchn_unbind (int evtchn_fd, int idx);
   26.27 +
   26.28 +/* this order comes from xen/include/public/arch-x86_32.h */
   26.29 +enum x86_registers { PDB_EBX, PDB_ECX, PDB_EDX, PDB_ESI, PDB_EDI,
   26.30 +                     PDB_EBP, PDB_EAX, PDB_Error_code, PDB_Entry_vector, 
   26.31 +                     PDB_EIP, PDB_CS, PDB_EFLAGS, PDB_ESP, PDB_SS,
   26.32 +                     PDB_ES, PDB_DS, PDB_FS, PDB_GS };
   26.33 +
   26.34 +static void dump_regs (cpu_user_regs_t *ctx);
   26.35 +
   26.36 +static int xc_handle = -1;
   26.37 +
   26.38 +typedef struct
   26.39 +{
   26.40 +    int domain;
   26.41 +    int vcpu;
   26.42 +} context_t;
   26.43 +
   26.44 +#define decode_context(_ctx, _ocaml)   \
   26.45 +{  \
   26.46 +    (_ctx)->domain = Int_val(Field((_ocaml),0));  \
   26.47 +    (_ctx)->vcpu = Int_val(Field((_ocaml),1));  \
   26.48 +}
   26.49 +
   26.50 +#define encode_context(_ctx, _ocaml)  \
   26.51 +{  \
   26.52 +    (_ocaml) = caml_alloc_tuple(2);  \
   26.53 +    Store_field((_ocaml), 0, Val_int((_ctx)->domain));  \
   26.54 +    Store_field((_ocaml), 1, Val_int((_ctx)->vcpu));  \
   26.55 +}
   26.56 +
   26.57 +
   26.58 +/****************************************************************************/
   26.59 +
   26.60 +/*
   26.61 + * open_context : unit -> unit
   26.62 + */
   26.63 +value
   26.64 +open_context (value unit)
   26.65 +{
   26.66 +    CAMLparam1(unit);
   26.67 +
   26.68 +    xc_handle = xc_interface_open();
   26.69 +
   26.70 +    if ( xc_handle < 0 )
   26.71 +    {
   26.72 +        fprintf(stderr, "(pdb) error opening xc interface: %d (%s)\n",
   26.73 +                errno, strerror(errno));
   26.74 +    }
   26.75 +
   26.76 +    CAMLreturn(Val_unit);
   26.77 +}
   26.78 +
   26.79 +/*
   26.80 + * close_context : unit -> unit
   26.81 + */
   26.82 +value
   26.83 +close_context (value unit)
   26.84 +{
   26.85 +    CAMLparam1(unit);
   26.86 +    int rc;
   26.87 +    
   26.88 +    if ( (rc = xc_interface_close(xc_handle)) < 0 )
   26.89 +    {
   26.90 +        fprintf(stderr, "(pdb) error closing xc interface: %d (%s)\n",
   26.91 +                errno, strerror(errno));
   26.92 +    }
   26.93 +
   26.94 +    CAMLreturn(Val_unit);
   26.95 +}
   26.96 +
   26.97 +/*
   26.98 + * read_registers : context_t -> int32
   26.99 + */
  26.100 +value
  26.101 +read_registers (value context)
  26.102 +{
  26.103 +    CAMLparam1(context);
  26.104 +    CAMLlocal1(result);
  26.105 +
  26.106 +    cpu_user_regs_t *regs;
  26.107 +    context_t ctx;
  26.108 +
  26.109 +    decode_context(&ctx, context);
  26.110 +
  26.111 +    if ( xendebug_read_registers(xc_handle, ctx.domain, ctx.vcpu, &regs) )
  26.112 +    {
  26.113 +        printf("(pdb) read registers error!\n");  fflush(stdout);
  26.114 +        failwith("read registers error");
  26.115 +    }
  26.116 +
  26.117 +    dump_regs(regs);
  26.118 +
  26.119 +    result = caml_alloc_tuple(18);                                  /* FIXME */
  26.120 +
  26.121 +    Store_field(result,  0, caml_copy_int32(regs->ebx));
  26.122 +    Store_field(result,  1, caml_copy_int32(regs->ecx));
  26.123 +    Store_field(result,  2, caml_copy_int32(regs->edx));
  26.124 +    Store_field(result,  3, caml_copy_int32(regs->esi));
  26.125 +    Store_field(result,  4, caml_copy_int32(regs->edi));
  26.126 +    Store_field(result,  5, caml_copy_int32(regs->ebp));
  26.127 +    Store_field(result,  6, caml_copy_int32(regs->eax));
  26.128 +    Store_field(result,  7, caml_copy_int32(regs->error_code));        /* 16 */
  26.129 +    Store_field(result,  8, caml_copy_int32(regs->entry_vector));      /* 16 */
  26.130 +    Store_field(result,  9, caml_copy_int32(regs->eip));
  26.131 +    Store_field(result, 10, caml_copy_int32(regs->cs));                /* 16 */
  26.132 +    Store_field(result, 11, caml_copy_int32(regs->eflags));
  26.133