ia64/xen-unstable

changeset 5320:fb827128345c

bitkeeper revision 1.1669 (42a1c87fJjvGo-daXN_d0s-Pg-eAEQ)

Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xeno-unstable-ia64.bk
author kaf24@firebug.cl.cam.ac.uk
date Sat Jun 04 15:27:59 2005 +0000 (2005-06-04)
parents fea2f7f8df31 0b862197be40
children da199897c714
files .rootkeys BitKeeper/etc/logging_ok 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/xc.h tools/libxc/xc_private.c tools/libxc/xc_private.h 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 22:22:23 2005 +0000
     1.2 +++ b/.rootkeys	Sat Jun 04 15:27:59 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
     2.1 --- a/BitKeeper/etc/logging_ok	Fri Jun 03 22:22:23 2005 +0000
     2.2 +++ b/BitKeeper/etc/logging_ok	Sat Jun 04 15:27:59 2005 +0000
     2.3 @@ -1,3 +1,4 @@
     2.4 +ach61@arcadians.cl.cam.ac.uk
     2.5  ach61@boulderdash.cl.cam.ac.uk
     2.6  ach61@labyrinth.cl.cam.ac.uk
     2.7  ach61@soar.cl.cam.ac.uk
     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/Makefile.in	Sat Jun 04 15:27:59 2005 +0000
     3.3 @@ -0,0 +1,308 @@
     3.4 +# Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
     3.5 +# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
     3.6 +
     3.7 +# This file is part of GDB.
     3.8 +
     3.9 +# This program is free software; you can redistribute it and/or modify
    3.10 +# it under the terms of the GNU General Public License as published by
    3.11 +# the Free Software Foundation; either version 2 of the License, or
    3.12 +# (at your option) any later version.
    3.13 +# 
    3.14 +# This program is distributed in the hope that it will be useful,
    3.15 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.17 +# GNU General Public License for more details.
    3.18 +# 
    3.19 +# You should have received a copy of the GNU General Public License
    3.20 +# along with this program; if not, write to the Free Software
    3.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    3.22 +
    3.23 +prefix = @prefix@
    3.24 +exec_prefix = @exec_prefix@
    3.25 +
    3.26 +host_alias = @host_alias@
    3.27 +target_alias = @target_alias@
    3.28 +program_transform_name = @program_transform_name@
    3.29 +bindir = @bindir@
    3.30 +libdir = @libdir@
    3.31 +tooldir = $(libdir)/$(target_alias)
    3.32 +
    3.33 +datadir = @datadir@
    3.34 +mandir = @mandir@
    3.35 +man1dir = $(mandir)/man1
    3.36 +man2dir = $(mandir)/man2
    3.37 +man3dir = $(mandir)/man3
    3.38 +man4dir = $(mandir)/man4
    3.39 +man5dir = $(mandir)/man5
    3.40 +man6dir = $(mandir)/man6
    3.41 +man7dir = $(mandir)/man7
    3.42 +man8dir = $(mandir)/man8
    3.43 +man9dir = $(mandir)/man9
    3.44 +infodir = @infodir@
    3.45 +htmldir = $(prefix)/html
    3.46 +includedir = @includedir@
    3.47 +
    3.48 +SHELL = /bin/sh
    3.49 +
    3.50 +INSTALL = @INSTALL@
    3.51 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
    3.52 +INSTALL_DATA = @INSTALL_DATA@
    3.53 +
    3.54 +CC = @CC@
    3.55 +
    3.56 +# Directory containing source files.  Don't clean up the spacing,
    3.57 +# this exact string is matched for by the "configure" script.
    3.58 +srcdir = @srcdir@
    3.59 +VPATH = @srcdir@
    3.60 +
    3.61 +# It is also possible that you will need to add -I/usr/include/sys to the
    3.62 +# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which 
    3.63 +# is where it should be according to Posix).
    3.64 +
    3.65 +# Set this up with gcc if you have gnu ld and the loader will print out
    3.66 +# line numbers for undefinded refs.
    3.67 +#CC-LD=gcc -static
    3.68 +CC-LD=${CC}
    3.69 +
    3.70 +# Where is the "include" directory?  Traditionally ../include or ./include
    3.71 +INCLUDE_DIR =  ${srcdir}/../../include
    3.72 +INCLUDE_DEP = $$(INCLUDE_DIR)
    3.73 +
    3.74 +# Where are the BFD library?
    3.75 +BFD_DIR = ../../bfd
    3.76 +BFD = $(BFD_DIR)/libbfd.a
    3.77 +BFD_SRC = $(srcdir)/$(BFD_DIR)
    3.78 +BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
    3.79 +
    3.80 +# Where is the source dir for the READLINE library?  Traditionally in .. or .
    3.81 +# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
    3.82 +READLINE_DIR = ${srcdir}/../readline
    3.83 +READLINE_DEP = $$(READLINE_DIR)
    3.84 +
    3.85 +# All the includes used for CFLAGS and for lint.
    3.86 +# -I. for config files.
    3.87 +# -I${srcdir} for our headers.
    3.88 +# -I$(srcdir)/../regformats for regdef.h.
    3.89 +INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../regformats -I$(INCLUDE_DIR)  -I../../../../../libxc/
    3.90 +
    3.91 +# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
    3.92 +# from the config/ directory.
    3.93 +GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS}
    3.94 +#PROFILE_CFLAGS = -pg
    3.95 +
    3.96 +WARN_CFLAGS = -Wall
    3.97 +
    3.98 +# CFLAGS is specifically reserved for setting from the command line
    3.99 +# when running make.  I.E.  "make CFLAGS=-Wmissing-prototypes".
   3.100 +CFLAGS = @CFLAGS@
   3.101 +
   3.102 +# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
   3.103 +INTERNAL_CFLAGS =  $(WARN_CFLAGS) ${CFLAGS} ${GLOBAL_CFLAGS} \
   3.104 +	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${BFD_CFLAGS}
   3.105 +
   3.106 +# LDFLAGS is specifically reserved for setting from the command line
   3.107 +# when running make.
   3.108 +LDFLAGS = @LDFLAGS@
   3.109 +
   3.110 +# Perhaps should come from parent Makefile
   3.111 +VERSION = gdbserver-4.12.3
   3.112 +DIST=gdb
   3.113 +
   3.114 +LINT=/usr/5bin/lint
   3.115 +LINTFLAGS= $(BFD_CFLAGS)
   3.116 +
   3.117 +# All source files that go into linking GDB remote server.
   3.118 +
   3.119 +SFILES=	$(srcdir)/gdbreplay.c $(srcdir)/inferiors.c \
   3.120 +	$(srcdir)/mem-break.c $(srcdir)/proc-service.c $(srcdir)/regcache.c \
   3.121 +	$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
   3.122 +	$(srcdir)/thread-db.c $(srcdir)/utils.c \
   3.123 +	$(srcdir)/linux-arm-low.c $(srcdir)/linux-i386-low.c \
   3.124 +	$(srcdir)/i387-fp.c \
   3.125 +	$(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \
   3.126 +	$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
   3.127 +	$(srcdir)/linux-ppc-low.c $(srcdir)/linux-s390-low.c \
   3.128 +	$(srcdir)/linux-sh-low.c $(srcdir)/linux-x86-64-low.c
   3.129 +
   3.130 +DEPFILES = @GDBSERVER_DEPFILES@
   3.131 +
   3.132 +SOURCES = $(SFILES)
   3.133 +TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} 
   3.134 +
   3.135 +OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
   3.136 +	utils.o \
   3.137 +	mem-break.o \
   3.138 +	$(DEPFILES)
   3.139 +GDBSERVER_LIBS = @GDBSERVER_LIBS@
   3.140 +
   3.141 +# Prevent Sun make from putting in the machine type.  Setting
   3.142 +# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
   3.143 +.c.o:
   3.144 +	${CC} -c ${INTERNAL_CFLAGS} $<
   3.145 +
   3.146 +all: gdbserver-xen gdbreplay
   3.147 +
   3.148 +# Traditionally "install" depends on "all".  But it may be useful
   3.149 +# not to; for example, if the user has made some trivial change to a 
   3.150 +# source file and doesn't care about rebuilding or just wants to save the
   3.151 +# time it takes for make to check that all is up to date.
   3.152 +# install-only is intended to address that need.
   3.153 +install: all install-only
   3.154 +install-only: 
   3.155 +	n=`echo gdbserver-xen | sed '$(program_transform_name)'`; \
   3.156 +	if [ x$$n = x ]; then n=gdbserver-xen; else true; fi; \
   3.157 +	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
   3.158 +	$(INSTALL_PROGRAM) gdbserver-xen $(DESTDIR)$(bindir)/$$n; \
   3.159 +	$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \
   3.160 +	$(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1
   3.161 +
   3.162 +uninstall: force
   3.163 +	n=`echo gdbserver-xen | sed '$(program_transform_name)'`; \
   3.164 +	if [ x$$n = x ]; then n=gdbserver-xen; else true; fi; \
   3.165 +	rm -f $(bindir)/$$n $(DESTDIR)$(man1dir)/$$n.1
   3.166 +
   3.167 +installcheck:
   3.168 +check:
   3.169 +info dvi:
   3.170 +install-info:
   3.171 +html:
   3.172 +install-html:
   3.173 +clean-info:
   3.174 +
   3.175 +gdbserver-xen: $(OBS) ${ADD_DEPS} ${CDEPS}
   3.176 +	rm -f gdbserver-xen
   3.177 +	${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbserver-xen $(OBS) \
   3.178 +	  $(GDBSERVER_LIBS) $(XM_CLIBS)
   3.179 +
   3.180 +gdbreplay: gdbreplay.o
   3.181 +	rm -f gdbreplay
   3.182 +	${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdbreplay gdbreplay.o \
   3.183 +	  $(XM_CLIBS)
   3.184 +
   3.185 +# Put the proper machine-specific files first, so M-. on a machine
   3.186 +# specific routine gets the one for the correct machine.
   3.187 +# The xyzzy stuff below deals with empty DEPFILES
   3.188 +TAGS:	${TAGFILES}
   3.189 +	etags `find ${srcdir}/../config -name $(TM_FILE) -print` \
   3.190 +	  `find ${srcdir}/../config -name ${XM_FILE} -print` \
   3.191 +	  `find ${srcdir}/../config -name ${NAT_FILE} -print` \
   3.192 +	  `for i in yzzy ${DEPFILES}; do \
   3.193 +	     if [ x$$i != xyzzy ]; then \
   3.194 +	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
   3.195 +	     fi; \
   3.196 +	   done` \
   3.197 +	  ${TAGFILES}
   3.198 +tags: TAGS
   3.199 +
   3.200 +clean:
   3.201 +	rm -f *.o ${ADD_FILES} *~
   3.202 +	rm -f gdbserver gdbreplay core make.log
   3.203 +	rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m68k.c reg-mips.c
   3.204 +	rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c
   3.205 +
   3.206 +maintainer-clean realclean distclean: clean
   3.207 +	rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
   3.208 +	rm -f Makefile
   3.209 +
   3.210 +STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
   3.211 +
   3.212 +config.h: stamp-h ; @true
   3.213 +stamp-h: config.in config.status
   3.214 +	CONFIG_FILES="" $(SHELL) ./config.status
   3.215 +
   3.216 +Makefile: Makefile.in config.status
   3.217 +	CONFIG_HEADERS="" $(SHELL) ./config.status
   3.218 +
   3.219 +config.status: configure configure.srv
   3.220 +	$(SHELL) ./config.status --recheck
   3.221 +
   3.222 +force:
   3.223 +
   3.224 +version.c: Makefile
   3.225 +	echo 'char *version = "$(VERSION)";' >version.c
   3.226 +
   3.227 +# GNU Make has an annoying habit of putting *all* the Makefile variables
   3.228 +# into the environment, unless you include this target as a circumvention.
   3.229 +# Rumor is that this will be fixed (and this target can be removed)
   3.230 +# in GNU Make 4.0.
   3.231 +.NOEXPORT:
   3.232 +
   3.233 +# GNU Make 3.63 has a different problem: it keeps tacking command line
   3.234 +# overrides onto the definition of $(MAKE).  This variable setting
   3.235 +# will remove them.
   3.236 +MAKEOVERRIDES=
   3.237 +
   3.238 +gdb_proc_service_h = $(srcdir)/../gdb_proc_service.h $(srcdir)/../gregset.h
   3.239 +regdat_sh = $(srcdir)/../regformats/regdat.sh
   3.240 +regdef_h = $(srcdir)/../regformats/regdef.h
   3.241 +regcache_h = $(srcdir)/regcache.h
   3.242 +server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
   3.243 +		$(srcdir)/mem-break.h
   3.244 +
   3.245 +inferiors.o: inferiors.c $(server_h)
   3.246 +mem-break.o: mem-break.c $(server_h)
   3.247 +proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h)
   3.248 +regcache.o: regcache.c $(server_h) $(regdef_h)
   3.249 +remote-utils.o: remote-utils.c terminal.h $(server_h)
   3.250 +server.o: server.c $(server_h)
   3.251 +target.o: target.c $(server_h)
   3.252 +thread-db.o: thread-db.c $(server_h) $(gdb_proc_service_h)
   3.253 +utils.o: utils.c $(server_h)
   3.254 +
   3.255 +signals.o: ../signals/signals.c $(server_h)
   3.256 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
   3.257 +
   3.258 +i387-fp.o: i387-fp.c $(server_h)
   3.259 +
   3.260 +linux_low_h = $(srcdir)/linux-low.h
   3.261 +
   3.262 +linux-low.o: linux-low.c $(linux_low_h) $(server_h)
   3.263 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
   3.264 +
   3.265 +linux-xen-low.o: linux-xen-low.c $(linux_low_h) $(server_h)
   3.266 +	$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< @USE_THREAD_DB@
   3.267 +
   3.268 +linux-arm-low.o: linux-arm-low.c $(linux_low_h) $(server_h)
   3.269 +linux-i386-low.o: linux-i386-low.c $(linux_low_h) $(server_h)
   3.270 +linux-ia64-low.o: linux-ia64-low.c $(linux_low_h) $(server_h)
   3.271 +linux-mips-low.o: linux-mips-low.c $(linux_low_h) $(server_h)
   3.272 +linux-ppc-low.o: linux-ppc-low.c $(linux_low_h) $(server_h)
   3.273 +linux-s390-low.o: linux-s390-low.c $(linux_low_h) $(server_h)
   3.274 +linux-sh-low.o: linux-sh-low.c $(linux_low_h) $(server_h)
   3.275 +linux-x86-64-low.o: linux-x86-64-low.c $(linux_low_h) $(server_h)
   3.276 +
   3.277 +reg-arm.o : reg-arm.c $(regdef_h)
   3.278 +reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
   3.279 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c
   3.280 +reg-i386.o : reg-i386.c $(regdef_h)
   3.281 +reg-i386.c : $(srcdir)/../regformats/reg-i386.dat $(regdat_sh)
   3.282 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-i386.dat reg-i386.c
   3.283 +reg-i386-linux.o : reg-i386-linux.c $(regdef_h)
   3.284 +reg-i386-linux.c : $(srcdir)/../regformats/reg-i386-linux.dat $(regdat_sh)
   3.285 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-i386-linux.dat reg-i386-linux.c
   3.286 +reg-ia64.o : reg-ia64.c $(regdef_h)
   3.287 +reg-ia64.c : $(srcdir)/../regformats/reg-ia64.dat $(regdat_sh)
   3.288 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-ia64.dat reg-ia64.c
   3.289 +reg-m68k.o : reg-m68k.c $(regdef_h)
   3.290 +reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
   3.291 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
   3.292 +reg-mips.o : reg-mips.c $(regdef_h)
   3.293 +reg-mips.c : $(srcdir)/../regformats/reg-mips.dat $(regdat_sh)
   3.294 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-mips.dat reg-mips.c
   3.295 +reg-ppc.o : reg-ppc.c $(regdef_h)
   3.296 +reg-ppc.c : $(srcdir)/../regformats/reg-ppc.dat $(regdat_sh)
   3.297 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-ppc.dat reg-ppc.c
   3.298 +reg-s390.o : reg-s390.c $(regdef_h)
   3.299 +reg-s390.c : $(srcdir)/../regformats/reg-s390.dat $(regdat_sh)
   3.300 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-s390.dat reg-s390.c
   3.301 +reg-s390x.o : reg-s390x.c $(regdef_h)
   3.302 +reg-s390x.c : $(srcdir)/../regformats/reg-s390x.dat $(regdat_sh)
   3.303 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-s390x.dat reg-s390x.c
   3.304 +reg-sh.o : reg-sh.c $(regdef_h)
   3.305 +reg-sh.c : $(srcdir)/../regformats/reg-sh.dat $(regdat_sh)
   3.306 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-sh.dat reg-sh.c
   3.307 +reg-x86-64.o : reg-x86-64.c $(regdef_h)
   3.308 +reg-x86-64.c : $(srcdir)/../regformats/reg-x86-64.dat $(regdat_sh)
   3.309 +	sh $(regdat_sh) $(srcdir)/../regformats/reg-x86-64.dat reg-x86-64.c
   3.310 +
   3.311 +# This is the end of "Makefile.in".
     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	Sat Jun 04 15:27:59 2005 +0000
     4.3 @@ -0,0 +1,4650 @@
     4.4 +#! /bin/sh
     4.5 +# Guess values for system-dependent variables and create Makefiles.
     4.6 +# Generated by GNU Autoconf 2.57.
     4.7 +#
     4.8 +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
     4.9 +# Free Software Foundation, Inc.
    4.10 +# This configure script is free software; the Free Software Foundation
    4.11 +# gives unlimited permission to copy, distribute and modify it.
    4.12 +## --------------------- ##
    4.13 +## M4sh Initialization.  ##
    4.14 +## --------------------- ##
    4.15 +
    4.16 +# Be Bourne compatible
    4.17 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
    4.18 +  emulate sh
    4.19 +  NULLCMD=:
    4.20 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
    4.21 +  # is contrary to our usage.  Disable this feature.
    4.22 +  alias -g '${1+"$@"}'='"$@"'
    4.23 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
    4.24 +  set -o posix
    4.25 +fi
    4.26 +
    4.27 +# Support unset when possible.
    4.28 +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
    4.29 +  as_unset=unset
    4.30 +else
    4.31 +  as_unset=false
    4.32 +fi
    4.33 +
    4.34 +
    4.35 +# Work around bugs in pre-3.0 UWIN ksh.
    4.36 +$as_unset ENV MAIL MAILPATH
    4.37 +PS1='$ '
    4.38 +PS2='> '
    4.39 +PS4='+ '
    4.40 +
    4.41 +# NLS nuisances.
    4.42 +for as_var in \
    4.43 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
    4.44 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
    4.45 +  LC_TELEPHONE LC_TIME
    4.46 +do
    4.47 +  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
    4.48 +    eval $as_var=C; export $as_var
    4.49 +  else
    4.50 +    $as_unset $as_var
    4.51 +  fi
    4.52 +done
    4.53 +
    4.54 +# Required to use basename.
    4.55 +if expr a : '\(a\)' >/dev/null 2>&1; then
    4.56 +  as_expr=expr
    4.57 +else
    4.58 +  as_expr=false
    4.59 +fi
    4.60 +
    4.61 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
    4.62 +  as_basename=basename
    4.63 +else
    4.64 +  as_basename=false
    4.65 +fi
    4.66 +
    4.67 +
    4.68 +# Name of the executable.
    4.69 +as_me=`$as_basename "$0" ||
    4.70 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
    4.71 +	 X"$0" : 'X\(//\)$' \| \
    4.72 +	 X"$0" : 'X\(/\)$' \| \
    4.73 +	 .     : '\(.\)' 2>/dev/null ||
    4.74 +echo X/"$0" |
    4.75 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
    4.76 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
    4.77 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
    4.78 +  	  s/.*/./; q'`
    4.79 +
    4.80 +
    4.81 +# PATH needs CR, and LINENO needs CR and PATH.
    4.82 +# Avoid depending upon Character Ranges.
    4.83 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
    4.84 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    4.85 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
    4.86 +as_cr_digits='0123456789'
    4.87 +as_cr_alnum=$as_cr_Letters$as_cr_digits
    4.88 +
    4.89 +# The user is always right.
    4.90 +if test "${PATH_SEPARATOR+set}" != set; then
    4.91 +  echo "#! /bin/sh" >conf$$.sh
    4.92 +  echo  "exit 0"   >>conf$$.sh
    4.93 +  chmod +x conf$$.sh
    4.94 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
    4.95 +    PATH_SEPARATOR=';'
    4.96 +  else
    4.97 +    PATH_SEPARATOR=:
    4.98 +  fi
    4.99 +  rm -f conf$$.sh
   4.100 +fi
   4.101 +
   4.102 +
   4.103 +  as_lineno_1=$LINENO
   4.104 +  as_lineno_2=$LINENO
   4.105 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   4.106 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
   4.107 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
   4.108 +  # Find who we are.  Look in the path if we contain no path at all
   4.109 +  # relative or not.
   4.110 +  case $0 in
   4.111 +    *[\\/]* ) as_myself=$0 ;;
   4.112 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.113 +for as_dir in $PATH
   4.114 +do
   4.115 +  IFS=$as_save_IFS
   4.116 +  test -z "$as_dir" && as_dir=.
   4.117 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
   4.118 +done
   4.119 +
   4.120 +       ;;
   4.121 +  esac
   4.122 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
   4.123 +  # in which case we are not to be found in the path.
   4.124 +  if test "x$as_myself" = x; then
   4.125 +    as_myself=$0
   4.126 +  fi
   4.127 +  if test ! -f "$as_myself"; then
   4.128 +    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
   4.129 +   { (exit 1); exit 1; }; }
   4.130 +  fi
   4.131 +  case $CONFIG_SHELL in
   4.132 +  '')
   4.133 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.134 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
   4.135 +do
   4.136 +  IFS=$as_save_IFS
   4.137 +  test -z "$as_dir" && as_dir=.
   4.138 +  for as_base in sh bash ksh sh5; do
   4.139 +	 case $as_dir in
   4.140 +	 /*)
   4.141 +	   if ("$as_dir/$as_base" -c '
   4.142 +  as_lineno_1=$LINENO
   4.143 +  as_lineno_2=$LINENO
   4.144 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   4.145 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
   4.146 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
   4.147 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
   4.148 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
   4.149 +	     CONFIG_SHELL=$as_dir/$as_base
   4.150 +	     export CONFIG_SHELL
   4.151 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
   4.152 +	   fi;;
   4.153 +	 esac
   4.154 +       done
   4.155 +done
   4.156 +;;
   4.157 +  esac
   4.158 +
   4.159 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   4.160 +  # uniformly replaced by the line number.  The first 'sed' inserts a
   4.161 +  # line-number line before each line; the second 'sed' does the real
   4.162 +  # work.  The second script uses 'N' to pair each line-number line
   4.163 +  # with the numbered line, and appends trailing '-' during
   4.164 +  # substitution so that $LINENO is not a special case at line end.
   4.165 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
   4.166 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
   4.167 +  sed '=' <$as_myself |
   4.168 +    sed '
   4.169 +      N
   4.170 +      s,$,-,
   4.171 +      : loop
   4.172 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
   4.173 +      t loop
   4.174 +      s,-$,,
   4.175 +      s,^['$as_cr_digits']*\n,,
   4.176 +    ' >$as_me.lineno &&
   4.177 +  chmod +x $as_me.lineno ||
   4.178 +    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
   4.179 +   { (exit 1); exit 1; }; }
   4.180 +
   4.181 +  # Don't try to exec as it changes $[0], causing all sort of problems
   4.182 +  # (the dirname of $[0] is not the place where we might find the
   4.183 +  # original and so on.  Autoconf is especially sensible to this).
   4.184 +  . ./$as_me.lineno
   4.185 +  # Exit status is that of the last command.
   4.186 +  exit
   4.187 +}
   4.188 +
   4.189 +
   4.190 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
   4.191 +  *c*,-n*) ECHO_N= ECHO_C='
   4.192 +' ECHO_T='	' ;;
   4.193 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
   4.194 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
   4.195 +esac
   4.196 +
   4.197 +if expr a : '\(a\)' >/dev/null 2>&1; then
   4.198 +  as_expr=expr
   4.199 +else
   4.200 +  as_expr=false
   4.201 +fi
   4.202 +
   4.203 +rm -f conf$$ conf$$.exe conf$$.file
   4.204 +echo >conf$$.file
   4.205 +if ln -s conf$$.file conf$$ 2>/dev/null; then
   4.206 +  # We could just check for DJGPP; but this test a) works b) is more generic
   4.207 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
   4.208 +  if test -f conf$$.exe; then
   4.209 +    # Don't use ln at all; we don't have any links
   4.210 +    as_ln_s='cp -p'
   4.211 +  else
   4.212 +    as_ln_s='ln -s'
   4.213 +  fi
   4.214 +elif ln conf$$.file conf$$ 2>/dev/null; then
   4.215 +  as_ln_s=ln
   4.216 +else
   4.217 +  as_ln_s='cp -p'
   4.218 +fi
   4.219 +rm -f conf$$ conf$$.exe conf$$.file
   4.220 +
   4.221 +if mkdir -p . 2>/dev/null; then
   4.222 +  as_mkdir_p=:
   4.223 +else
   4.224 +  as_mkdir_p=false
   4.225 +fi
   4.226 +
   4.227 +as_executable_p="test -f"
   4.228 +
   4.229 +# Sed expression to map a string onto a valid CPP name.
   4.230 +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
   4.231 +
   4.232 +# Sed expression to map a string onto a valid variable name.
   4.233 +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
   4.234 +
   4.235 +
   4.236 +# IFS
   4.237 +# We need space, tab and new line, in precisely that order.
   4.238 +as_nl='
   4.239 +'
   4.240 +IFS=" 	$as_nl"
   4.241 +
   4.242 +# CDPATH.
   4.243 +$as_unset CDPATH
   4.244 +
   4.245 +
   4.246 +# Name of the host.
   4.247 +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
   4.248 +# so uname gets run too.
   4.249 +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
   4.250 +
   4.251 +exec 6>&1
   4.252 +
   4.253 +#
   4.254 +# Initializations.
   4.255 +#
   4.256 +ac_default_prefix=/usr/local
   4.257 +ac_config_libobj_dir=.
   4.258 +cross_compiling=no
   4.259 +subdirs=
   4.260 +MFLAGS=
   4.261 +MAKEFLAGS=
   4.262 +SHELL=${CONFIG_SHELL-/bin/sh}
   4.263 +
   4.264 +# Maximum number of lines to put in a shell here document.
   4.265 +# This variable seems obsolete.  It should probably be removed, and
   4.266 +# only ac_max_sed_lines should be used.
   4.267 +: ${ac_max_here_lines=38}
   4.268 +
   4.269 +# Identity of this package.
   4.270 +PACKAGE_NAME=
   4.271 +PACKAGE_TARNAME=
   4.272 +PACKAGE_VERSION=
   4.273 +PACKAGE_STRING=
   4.274 +PACKAGE_BUGREPORT=
   4.275 +
   4.276 +ac_unique_file="server.c"
   4.277 +# Factoring default headers for most tests.
   4.278 +ac_includes_default="\
   4.279 +#include <stdio.h>
   4.280 +#if HAVE_SYS_TYPES_H
   4.281 +# include <sys/types.h>
   4.282 +#endif
   4.283 +#if HAVE_SYS_STAT_H
   4.284 +# include <sys/stat.h>
   4.285 +#endif
   4.286 +#if STDC_HEADERS
   4.287 +# include <stdlib.h>
   4.288 +# include <stddef.h>
   4.289 +#else
   4.290 +# if HAVE_STDLIB_H
   4.291 +#  include <stdlib.h>
   4.292 +# endif
   4.293 +#endif
   4.294 +#if HAVE_STRING_H
   4.295 +# if !STDC_HEADERS && HAVE_MEMORY_H
   4.296 +#  include <memory.h>
   4.297 +# endif
   4.298 +# include <string.h>
   4.299 +#endif
   4.300 +#if HAVE_STRINGS_H
   4.301 +# include <strings.h>
   4.302 +#endif
   4.303 +#if HAVE_INTTYPES_H
   4.304 +# include <inttypes.h>
   4.305 +#else
   4.306 +# if HAVE_STDINT_H
   4.307 +#  include <stdint.h>
   4.308 +# endif
   4.309 +#endif
   4.310 +#if HAVE_UNISTD_H
   4.311 +# include <unistd.h>
   4.312 +#endif"
   4.313 +
   4.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'
   4.315 +ac_subst_files=''
   4.316 +
   4.317 +# Initialize some variables set by options.
   4.318 +ac_init_help=
   4.319 +ac_init_version=false
   4.320 +# The variables have the same names as the options, with
   4.321 +# dashes changed to underlines.
   4.322 +cache_file=/dev/null
   4.323 +exec_prefix=NONE
   4.324 +no_create=
   4.325 +no_recursion=
   4.326 +prefix=NONE
   4.327 +program_prefix=NONE
   4.328 +program_suffix=NONE
   4.329 +program_transform_name=s,x,x,
   4.330 +silent=
   4.331 +site=
   4.332 +srcdir=
   4.333 +verbose=
   4.334 +x_includes=NONE
   4.335 +x_libraries=NONE
   4.336 +
   4.337 +# Installation directory options.
   4.338 +# These are left unexpanded so users can "make install exec_prefix=/foo"
   4.339 +# and all the variables that are supposed to be based on exec_prefix
   4.340 +# by default will actually change.
   4.341 +# Use braces instead of parens because sh, perl, etc. also accept them.
   4.342 +bindir='${exec_prefix}/bin'
   4.343 +sbindir='${exec_prefix}/sbin'
   4.344 +libexecdir='${exec_prefix}/libexec'
   4.345 +datadir='${prefix}/share'
   4.346 +sysconfdir='${prefix}/etc'
   4.347 +sharedstatedir='${prefix}/com'
   4.348 +localstatedir='${prefix}/var'
   4.349 +libdir='${exec_prefix}/lib'
   4.350 +includedir='${prefix}/include'
   4.351 +oldincludedir='/usr/include'
   4.352 +infodir='${prefix}/info'
   4.353 +mandir='${prefix}/man'
   4.354 +
   4.355 +ac_prev=
   4.356 +for ac_option
   4.357 +do
   4.358 +  # If the previous option needs an argument, assign it.
   4.359 +  if test -n "$ac_prev"; then
   4.360 +    eval "$ac_prev=\$ac_option"
   4.361 +    ac_prev=
   4.362 +    continue
   4.363 +  fi
   4.364 +
   4.365 +  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
   4.366 +
   4.367 +  # Accept the important Cygnus configure options, so we can diagnose typos.
   4.368 +
   4.369 +  case $ac_option in
   4.370 +
   4.371 +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
   4.372 +    ac_prev=bindir ;;
   4.373 +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
   4.374 +    bindir=$ac_optarg ;;
   4.375 +
   4.376 +  -build | --build | --buil | --bui | --bu)
   4.377 +    ac_prev=build_alias ;;
   4.378 +  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
   4.379 +    build_alias=$ac_optarg ;;
   4.380 +
   4.381 +  -cache-file | --cache-file | --cache-fil | --cache-fi \
   4.382 +  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
   4.383 +    ac_prev=cache_file ;;
   4.384 +  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
   4.385 +  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
   4.386 +    cache_file=$ac_optarg ;;
   4.387 +
   4.388 +  --config-cache | -C)
   4.389 +    cache_file=config.cache ;;
   4.390 +
   4.391 +  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
   4.392 +    ac_prev=datadir ;;
   4.393 +  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
   4.394 +  | --da=*)
   4.395 +    datadir=$ac_optarg ;;
   4.396 +
   4.397 +  -disable-* | --disable-*)
   4.398 +    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
   4.399 +    # Reject names that are not valid shell variable names.
   4.400 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   4.401 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   4.402 +   { (exit 1); exit 1; }; }
   4.403 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
   4.404 +    eval "enable_$ac_feature=no" ;;
   4.405 +
   4.406 +  -enable-* | --enable-*)
   4.407 +    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
   4.408 +    # Reject names that are not valid shell variable names.
   4.409 +    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   4.410 +      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
   4.411 +   { (exit 1); exit 1; }; }
   4.412 +    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
   4.413 +    case $ac_option in
   4.414 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
   4.415 +      *) ac_optarg=yes ;;
   4.416 +    esac
   4.417 +    eval "enable_$ac_feature='$ac_optarg'" ;;
   4.418 +
   4.419 +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   4.420 +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
   4.421 +  | --exec | --exe | --ex)
   4.422 +    ac_prev=exec_prefix ;;
   4.423 +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
   4.424 +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
   4.425 +  | --exec=* | --exe=* | --ex=*)
   4.426 +    exec_prefix=$ac_optarg ;;
   4.427 +
   4.428 +  -gas | --gas | --ga | --g)
   4.429 +    # Obsolete; use --with-gas.
   4.430 +    with_gas=yes ;;
   4.431 +
   4.432 +  -help | --help | --hel | --he | -h)
   4.433 +    ac_init_help=long ;;
   4.434 +  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
   4.435 +    ac_init_help=recursive ;;
   4.436 +  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
   4.437 +    ac_init_help=short ;;
   4.438 +
   4.439 +  -host | --host | --hos | --ho)
   4.440 +    ac_prev=host_alias ;;
   4.441 +  -host=* | --host=* | --hos=* | --ho=*)
   4.442 +    host_alias=$ac_optarg ;;
   4.443 +
   4.444 +  -includedir | --includedir | --includedi | --included | --include \
   4.445 +  | --includ | --inclu | --incl | --inc)
   4.446 +    ac_prev=includedir ;;
   4.447 +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
   4.448 +  | --includ=* | --inclu=* | --incl=* | --inc=*)
   4.449 +    includedir=$ac_optarg ;;
   4.450 +
   4.451 +  -infodir | --infodir | --infodi | --infod | --info | --inf)
   4.452 +    ac_prev=infodir ;;
   4.453 +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
   4.454 +    infodir=$ac_optarg ;;
   4.455 +
   4.456 +  -libdir | --libdir | --libdi | --libd)
   4.457 +    ac_prev=libdir ;;
   4.458 +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
   4.459 +    libdir=$ac_optarg ;;
   4.460 +
   4.461 +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
   4.462 +  | --libexe | --libex | --libe)
   4.463 +    ac_prev=libexecdir ;;
   4.464 +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
   4.465 +  | --libexe=* | --libex=* | --libe=*)
   4.466 +    libexecdir=$ac_optarg ;;
   4.467 +
   4.468 +  -localstatedir | --localstatedir | --localstatedi | --localstated \
   4.469 +  | --localstate | --localstat | --localsta | --localst \
   4.470 +  | --locals | --local | --loca | --loc | --lo)
   4.471 +    ac_prev=localstatedir ;;
   4.472 +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
   4.473 +  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
   4.474 +  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
   4.475 +    localstatedir=$ac_optarg ;;
   4.476 +
   4.477 +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
   4.478 +    ac_prev=mandir ;;
   4.479 +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
   4.480 +    mandir=$ac_optarg ;;
   4.481 +
   4.482 +  -nfp | --nfp | --nf)
   4.483 +    # Obsolete; use --without-fp.
   4.484 +    with_fp=no ;;
   4.485 +
   4.486 +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
   4.487 +  | --no-cr | --no-c | -n)
   4.488 +    no_create=yes ;;
   4.489 +
   4.490 +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
   4.491 +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
   4.492 +    no_recursion=yes ;;
   4.493 +
   4.494 +  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
   4.495 +  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
   4.496 +  | --oldin | --oldi | --old | --ol | --o)
   4.497 +    ac_prev=oldincludedir ;;
   4.498 +  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
   4.499 +  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
   4.500 +  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
   4.501 +    oldincludedir=$ac_optarg ;;
   4.502 +
   4.503 +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
   4.504 +    ac_prev=prefix ;;
   4.505 +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
   4.506 +    prefix=$ac_optarg ;;
   4.507 +
   4.508 +  -program-prefix | --program-prefix | --program-prefi | --program-pref \
   4.509 +  | --program-pre | --program-pr | --program-p)
   4.510 +    ac_prev=program_prefix ;;
   4.511 +  -program-prefix=* | --program-prefix=* | --program-prefi=* \
   4.512 +  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
   4.513 +    program_prefix=$ac_optarg ;;
   4.514 +
   4.515 +  -program-suffix | --program-suffix | --program-suffi | --program-suff \
   4.516 +  | --program-suf | --program-su | --program-s)
   4.517 +    ac_prev=program_suffix ;;
   4.518 +  -program-suffix=* | --program-suffix=* | --program-suffi=* \
   4.519 +  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
   4.520 +    program_suffix=$ac_optarg ;;
   4.521 +
   4.522 +  -program-transform-name | --program-transform-name \
   4.523 +  | --program-transform-nam | --program-transform-na \
   4.524 +  | --program-transform-n | --program-transform- \
   4.525 +  | --program-transform | --program-transfor \
   4.526 +  | --program-transfo | --program-transf \
   4.527 +  | --program-trans | --program-tran \
   4.528 +  | --progr-tra | --program-tr | --program-t)
   4.529 +    ac_prev=program_transform_name ;;
   4.530 +  -program-transform-name=* | --program-transform-name=* \
   4.531 +  | --program-transform-nam=* | --program-transform-na=* \
   4.532 +  | --program-transform-n=* | --program-transform-=* \
   4.533 +  | --program-transform=* | --program-transfor=* \
   4.534 +  | --program-transfo=* | --program-transf=* \
   4.535 +  | --program-trans=* | --program-tran=* \
   4.536 +  | --progr-tra=* | --program-tr=* | --program-t=*)
   4.537 +    program_transform_name=$ac_optarg ;;
   4.538 +
   4.539 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   4.540 +  | -silent | --silent | --silen | --sile | --sil)
   4.541 +    silent=yes ;;
   4.542 +
   4.543 +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
   4.544 +    ac_prev=sbindir ;;
   4.545 +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
   4.546 +  | --sbi=* | --sb=*)
   4.547 +    sbindir=$ac_optarg ;;
   4.548 +
   4.549 +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
   4.550 +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
   4.551 +  | --sharedst | --shareds | --shared | --share | --shar \
   4.552 +  | --sha | --sh)
   4.553 +    ac_prev=sharedstatedir ;;
   4.554 +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
   4.555 +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
   4.556 +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
   4.557 +  | --sha=* | --sh=*)
   4.558 +    sharedstatedir=$ac_optarg ;;
   4.559 +
   4.560 +  -site | --site | --sit)
   4.561 +    ac_prev=site ;;
   4.562 +  -site=* | --site=* | --sit=*)
   4.563 +    site=$ac_optarg ;;
   4.564 +
   4.565 +  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
   4.566 +    ac_prev=srcdir ;;
   4.567 +  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
   4.568 +    srcdir=$ac_optarg ;;
   4.569 +
   4.570 +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
   4.571 +  | --syscon | --sysco | --sysc | --sys | --sy)
   4.572 +    ac_prev=sysconfdir ;;
   4.573 +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   4.574 +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
   4.575 +    sysconfdir=$ac_optarg ;;
   4.576 +
   4.577 +  -target | --target | --targe | --targ | --tar | --ta | --t)
   4.578 +    ac_prev=target_alias ;;
   4.579 +  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
   4.580 +    target_alias=$ac_optarg ;;
   4.581 +
   4.582 +  -v | -verbose | --verbose | --verbos | --verbo | --verb)
   4.583 +    verbose=yes ;;
   4.584 +
   4.585 +  -version | --version | --versio | --versi | --vers | -V)
   4.586 +    ac_init_version=: ;;
   4.587 +
   4.588 +  -with-* | --with-*)
   4.589 +    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
   4.590 +    # Reject names that are not valid shell variable names.
   4.591 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   4.592 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
   4.593 +   { (exit 1); exit 1; }; }
   4.594 +    ac_package=`echo $ac_package| sed 's/-/_/g'`
   4.595 +    case $ac_option in
   4.596 +      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
   4.597 +      *) ac_optarg=yes ;;
   4.598 +    esac
   4.599 +    eval "with_$ac_package='$ac_optarg'" ;;
   4.600 +
   4.601 +  -without-* | --without-*)
   4.602 +    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
   4.603 +    # Reject names that are not valid shell variable names.
   4.604 +    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
   4.605 +      { echo "$as_me: error: invalid package name: $ac_package" >&2
   4.606 +   { (exit 1); exit 1; }; }
   4.607 +    ac_package=`echo $ac_package | sed 's/-/_/g'`
   4.608 +    eval "with_$ac_package=no" ;;
   4.609 +
   4.610 +  --x)
   4.611 +    # Obsolete; use --with-x.
   4.612 +    with_x=yes ;;
   4.613 +
   4.614 +  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
   4.615 +  | --x-incl | --x-inc | --x-in | --x-i)
   4.616 +    ac_prev=x_includes ;;
   4.617 +  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
   4.618 +  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
   4.619 +    x_includes=$ac_optarg ;;
   4.620 +
   4.621 +  -x-libraries | --x-libraries | --x-librarie | --x-librari \
   4.622 +  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
   4.623 +    ac_prev=x_libraries ;;
   4.624 +  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
   4.625 +  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
   4.626 +    x_libraries=$ac_optarg ;;
   4.627 +
   4.628 +  -*) { echo "$as_me: error: unrecognized option: $ac_option
   4.629 +Try \`$0 --help' for more information." >&2
   4.630 +   { (exit 1); exit 1; }; }
   4.631 +    ;;
   4.632 +
   4.633 +  *=*)
   4.634 +    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
   4.635 +    # Reject names that are not valid shell variable names.
   4.636 +    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
   4.637 +      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
   4.638 +   { (exit 1); exit 1; }; }
   4.639 +    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
   4.640 +    eval "$ac_envvar='$ac_optarg'"
   4.641 +    export $ac_envvar ;;
   4.642 +
   4.643 +  *)
   4.644 +    # FIXME: should be removed in autoconf 3.0.
   4.645 +    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
   4.646 +    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
   4.647 +      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
   4.648 +    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
   4.649 +    ;;
   4.650 +
   4.651 +  esac
   4.652 +done
   4.653 +
   4.654 +if test -n "$ac_prev"; then
   4.655 +  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
   4.656 +  { echo "$as_me: error: missing argument to $ac_option" >&2
   4.657 +   { (exit 1); exit 1; }; }
   4.658 +fi
   4.659 +
   4.660 +# Be sure to have absolute paths.
   4.661 +for ac_var in exec_prefix prefix
   4.662 +do
   4.663 +  eval ac_val=$`echo $ac_var`
   4.664 +  case $ac_val in
   4.665 +    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
   4.666 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   4.667 +   { (exit 1); exit 1; }; };;
   4.668 +  esac
   4.669 +done
   4.670 +
   4.671 +# Be sure to have absolute paths.
   4.672 +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
   4.673 +              localstatedir libdir includedir oldincludedir infodir mandir
   4.674 +do
   4.675 +  eval ac_val=$`echo $ac_var`
   4.676 +  case $ac_val in
   4.677 +    [\\/$]* | ?:[\\/]* ) ;;
   4.678 +    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
   4.679 +   { (exit 1); exit 1; }; };;
   4.680 +  esac
   4.681 +done
   4.682 +
   4.683 +# There might be people who depend on the old broken behavior: `$host'
   4.684 +# used to hold the argument of --host etc.
   4.685 +# FIXME: To remove some day.
   4.686 +build=$build_alias
   4.687 +host=$host_alias
   4.688 +target=$target_alias
   4.689 +
   4.690 +# FIXME: To remove some day.
   4.691 +if test "x$host_alias" != x; then
   4.692 +  if test "x$build_alias" = x; then
   4.693 +    cross_compiling=maybe
   4.694 +    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
   4.695 +    If a cross compiler is detected then cross compile mode will be used." >&2
   4.696 +  elif test "x$build_alias" != "x$host_alias"; then
   4.697 +    cross_compiling=yes
   4.698 +  fi
   4.699 +fi
   4.700 +
   4.701 +ac_tool_prefix=
   4.702 +test -n "$host_alias" && ac_tool_prefix=$host_alias-
   4.703 +
   4.704 +test "$silent" = yes && exec 6>/dev/null
   4.705 +
   4.706 +
   4.707 +# Find the source files, if location was not specified.
   4.708 +if test -z "$srcdir"; then
   4.709 +  ac_srcdir_defaulted=yes
   4.710 +  # Try the directory containing this script, then its parent.
   4.711 +  ac_confdir=`(dirname "$0") 2>/dev/null ||
   4.712 +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
   4.713 +         X"$0" : 'X\(//\)[^/]' \| \
   4.714 +         X"$0" : 'X\(//\)$' \| \
   4.715 +         X"$0" : 'X\(/\)' \| \
   4.716 +         .     : '\(.\)' 2>/dev/null ||
   4.717 +echo X"$0" |
   4.718 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
   4.719 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
   4.720 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
   4.721 +  	  /^X\(\/\).*/{ s//\1/; q; }
   4.722 +  	  s/.*/./; q'`
   4.723 +  srcdir=$ac_confdir
   4.724 +  if test ! -r $srcdir/$ac_unique_file; then
   4.725 +    srcdir=..
   4.726 +  fi
   4.727 +else
   4.728 +  ac_srcdir_defaulted=no
   4.729 +fi
   4.730 +if test ! -r $srcdir/$ac_unique_file; then
   4.731 +  if test "$ac_srcdir_defaulted" = yes; then
   4.732 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
   4.733 +   { (exit 1); exit 1; }; }
   4.734 +  else
   4.735 +    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
   4.736 +   { (exit 1); exit 1; }; }
   4.737 +  fi
   4.738 +fi
   4.739 +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
   4.740 +  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
   4.741 +   { (exit 1); exit 1; }; }
   4.742 +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
   4.743 +ac_env_build_alias_set=${build_alias+set}
   4.744 +ac_env_build_alias_value=$build_alias
   4.745 +ac_cv_env_build_alias_set=${build_alias+set}
   4.746 +ac_cv_env_build_alias_value=$build_alias
   4.747 +ac_env_host_alias_set=${host_alias+set}
   4.748 +ac_env_host_alias_value=$host_alias
   4.749 +ac_cv_env_host_alias_set=${host_alias+set}
   4.750 +ac_cv_env_host_alias_value=$host_alias
   4.751 +ac_env_target_alias_set=${target_alias+set}
   4.752 +ac_env_target_alias_value=$target_alias
   4.753 +ac_cv_env_target_alias_set=${target_alias+set}
   4.754 +ac_cv_env_target_alias_value=$target_alias
   4.755 +ac_env_CC_set=${CC+set}
   4.756 +ac_env_CC_value=$CC
   4.757 +ac_cv_env_CC_set=${CC+set}
   4.758 +ac_cv_env_CC_value=$CC
   4.759 +ac_env_CFLAGS_set=${CFLAGS+set}
   4.760 +ac_env_CFLAGS_value=$CFLAGS
   4.761 +ac_cv_env_CFLAGS_set=${CFLAGS+set}
   4.762 +ac_cv_env_CFLAGS_value=$CFLAGS
   4.763 +ac_env_LDFLAGS_set=${LDFLAGS+set}
   4.764 +ac_env_LDFLAGS_value=$LDFLAGS
   4.765 +ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
   4.766 +ac_cv_env_LDFLAGS_value=$LDFLAGS
   4.767 +ac_env_CPPFLAGS_set=${CPPFLAGS+set}
   4.768 +ac_env_CPPFLAGS_value=$CPPFLAGS
   4.769 +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
   4.770 +ac_cv_env_CPPFLAGS_value=$CPPFLAGS
   4.771 +ac_env_CPP_set=${CPP+set}
   4.772 +ac_env_CPP_value=$CPP
   4.773 +ac_cv_env_CPP_set=${CPP+set}
   4.774 +ac_cv_env_CPP_value=$CPP
   4.775 +
   4.776 +#
   4.777 +# Report the --help message.
   4.778 +#
   4.779 +if test "$ac_init_help" = "long"; then
   4.780 +  # Omit some internal or obsolete options to make the list less imposing.
   4.781 +  # This message is too long to be a string in the A/UX 3.1 sh.
   4.782 +  cat <<_ACEOF
   4.783 +\`configure' configures this package to adapt to many kinds of systems.
   4.784 +
   4.785 +Usage: $0 [OPTION]... [VAR=VALUE]...
   4.786 +
   4.787 +To assign environment variables (e.g., CC, CFLAGS...), specify them as
   4.788 +VAR=VALUE.  See below for descriptions of some of the useful variables.
   4.789 +
   4.790 +Defaults for the options are specified in brackets.
   4.791 +
   4.792 +Configuration:
   4.793 +  -h, --help              display this help and exit
   4.794 +      --help=short        display options specific to this package
   4.795 +      --help=recursive    display the short help of all the included packages
   4.796 +  -V, --version           display version information and exit
   4.797 +  -q, --quiet, --silent   do not print \`checking...' messages
   4.798 +      --cache-file=FILE   cache test results in FILE [disabled]
   4.799 +  -C, --config-cache      alias for \`--cache-file=config.cache'
   4.800 +  -n, --no-create         do not create output files
   4.801 +      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
   4.802 +
   4.803 +_ACEOF
   4.804 +
   4.805 +  cat <<_ACEOF
   4.806 +Installation directories:
   4.807 +  --prefix=PREFIX         install architecture-independent files in PREFIX
   4.808 +                          [$ac_default_prefix]
   4.809 +  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
   4.810 +                          [PREFIX]
   4.811 +
   4.812 +By default, \`make install' will install all the files in
   4.813 +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
   4.814 +an installation prefix other than \`$ac_default_prefix' using \`--prefix',
   4.815 +for instance \`--prefix=\$HOME'.
   4.816 +
   4.817 +For better control, use the options below.
   4.818 +
   4.819 +Fine tuning of the installation directories:
   4.820 +  --bindir=DIR           user executables [EPREFIX/bin]
   4.821 +  --sbindir=DIR          system admin executables [EPREFIX/sbin]
   4.822 +  --libexecdir=DIR       program executables [EPREFIX/libexec]
   4.823 +  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   4.824 +  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   4.825 +  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   4.826 +  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   4.827 +  --libdir=DIR           object code libraries [EPREFIX/lib]
   4.828 +  --includedir=DIR       C header files [PREFIX/include]
   4.829 +  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
   4.830 +  --infodir=DIR          info documentation [PREFIX/info]
   4.831 +  --mandir=DIR           man documentation [PREFIX/man]
   4.832 +_ACEOF
   4.833 +
   4.834 +  cat <<\_ACEOF
   4.835 +
   4.836 +System types:
   4.837 +  --build=BUILD     configure for building on BUILD [guessed]
   4.838 +  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
   4.839 +  --target=TARGET   configure for building compilers for TARGET [HOST]
   4.840 +_ACEOF
   4.841 +fi
   4.842 +
   4.843 +if test -n "$ac_init_help"; then
   4.844 +
   4.845 +  cat <<\_ACEOF
   4.846 +
   4.847 +Some influential environment variables:
   4.848 +  CC          C compiler command
   4.849 +  CFLAGS      C compiler flags
   4.850 +  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
   4.851 +              nonstandard directory <lib dir>
   4.852 +  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
   4.853 +              headers in a nonstandard directory <include dir>
   4.854 +  CPP         C preprocessor
   4.855 +
   4.856 +Use these variables to override the choices made by `configure' or to help
   4.857 +it to find libraries and programs with nonstandard names/locations.
   4.858 +
   4.859 +_ACEOF
   4.860 +fi
   4.861 +
   4.862 +if test "$ac_init_help" = "recursive"; then
   4.863 +  # If there are subdirs, report their specific --help.
   4.864 +  ac_popdir=`pwd`
   4.865 +  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
   4.866 +    test -d $ac_dir || continue
   4.867 +    ac_builddir=.
   4.868 +
   4.869 +if test "$ac_dir" != .; then
   4.870 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
   4.871 +  # A "../" for each directory in $ac_dir_suffix.
   4.872 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
   4.873 +else
   4.874 +  ac_dir_suffix= ac_top_builddir=
   4.875 +fi
   4.876 +
   4.877 +case $srcdir in
   4.878 +  .)  # No --srcdir option.  We are building in place.
   4.879 +    ac_srcdir=.
   4.880 +    if test -z "$ac_top_builddir"; then
   4.881 +       ac_top_srcdir=.
   4.882 +    else
   4.883 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
   4.884 +    fi ;;
   4.885 +  [\\/]* | ?:[\\/]* )  # Absolute path.
   4.886 +    ac_srcdir=$srcdir$ac_dir_suffix;
   4.887 +    ac_top_srcdir=$srcdir ;;
   4.888 +  *) # Relative path.
   4.889 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
   4.890 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
   4.891 +esac
   4.892 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
   4.893 +# absolute.
   4.894 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
   4.895 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
   4.896 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
   4.897 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
   4.898 +
   4.899 +    cd $ac_dir
   4.900 +    # Check for guested configure; otherwise get Cygnus style configure.
   4.901 +    if test -f $ac_srcdir/configure.gnu; then
   4.902 +      echo
   4.903 +      $SHELL $ac_srcdir/configure.gnu  --help=recursive
   4.904 +    elif test -f $ac_srcdir/configure; then
   4.905 +      echo
   4.906 +      $SHELL $ac_srcdir/configure  --help=recursive
   4.907 +    elif test -f $ac_srcdir/configure.ac ||
   4.908 +           test -f $ac_srcdir/configure.in; then
   4.909 +      echo
   4.910 +      $ac_configure --help
   4.911 +    else
   4.912 +      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
   4.913 +    fi
   4.914 +    cd $ac_popdir
   4.915 +  done
   4.916 +fi
   4.917 +
   4.918 +test -n "$ac_init_help" && exit 0
   4.919 +if $ac_init_version; then
   4.920 +  cat <<\_ACEOF
   4.921 +
   4.922 +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
   4.923 +Free Software Foundation, Inc.
   4.924 +This configure script is free software; the Free Software Foundation
   4.925 +gives unlimited permission to copy, distribute and modify it.
   4.926 +_ACEOF
   4.927 +  exit 0
   4.928 +fi
   4.929 +exec 5>config.log
   4.930 +cat >&5 <<_ACEOF
   4.931 +This file contains any messages produced by compilers while
   4.932 +running configure, to aid debugging if configure makes a mistake.
   4.933 +
   4.934 +It was created by $as_me, which was
   4.935 +generated by GNU Autoconf 2.57.  Invocation command line was
   4.936 +
   4.937 +  $ $0 $@
   4.938 +
   4.939 +_ACEOF
   4.940 +{
   4.941 +cat <<_ASUNAME
   4.942 +## --------- ##
   4.943 +## Platform. ##
   4.944 +## --------- ##
   4.945 +
   4.946 +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
   4.947 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
   4.948 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
   4.949 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
   4.950 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
   4.951 +
   4.952 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
   4.953 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
   4.954 +
   4.955 +/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
   4.956 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
   4.957 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
   4.958 +hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
   4.959 +/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
   4.960 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
   4.961 +/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
   4.962 +
   4.963 +_ASUNAME
   4.964 +
   4.965 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   4.966 +for as_dir in $PATH
   4.967 +do
   4.968 +  IFS=$as_save_IFS
   4.969 +  test -z "$as_dir" && as_dir=.
   4.970 +  echo "PATH: $as_dir"
   4.971 +done
   4.972 +
   4.973 +} >&5
   4.974 +
   4.975 +cat >&5 <<_ACEOF
   4.976 +
   4.977 +
   4.978 +## ----------- ##
   4.979 +## Core tests. ##
   4.980 +## ----------- ##
   4.981 +
   4.982 +_ACEOF
   4.983 +
   4.984 +
   4.985 +# Keep a trace of the command line.
   4.986 +# Strip out --no-create and --no-recursion so they do not pile up.
   4.987 +# Strip out --silent because we don't want to record it for future runs.
   4.988 +# Also quote any args containing shell meta-characters.
   4.989 +# Make two passes to allow for proper duplicate-argument suppression.
   4.990 +ac_configure_args=
   4.991 +ac_configure_args0=
   4.992 +ac_configure_args1=
   4.993 +ac_sep=
   4.994 +ac_must_keep_next=false
   4.995 +for ac_pass in 1 2
   4.996 +do
   4.997 +  for ac_arg
   4.998 +  do
   4.999 +    case $ac_arg in
  4.1000 +    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
  4.1001 +    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  4.1002 +    | -silent | --silent | --silen | --sile | --sil)
  4.1003 +      continue ;;
  4.1004 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
  4.1005 +      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  4.1006 +    esac
  4.1007 +    case $ac_pass in
  4.1008 +    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
  4.1009 +    2)
  4.1010 +      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
  4.1011 +      if test $ac_must_keep_next = true; then
  4.1012 +        ac_must_keep_next=false # Got value, back to normal.
  4.1013 +      else
  4.1014 +        case $ac_arg in
  4.1015 +          *=* | --config-cache | -C | -disable-* | --disable-* \
  4.1016 +          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
  4.1017 +          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
  4.1018 +          | -with-* | --with-* | -without-* | --without-* | --x)
  4.1019 +            case "$ac_configure_args0 " in
  4.1020 +              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
  4.1021 +            esac
  4.1022 +            ;;
  4.1023 +          -* ) ac_must_keep_next=true ;;
  4.1024 +        esac
  4.1025 +      fi
  4.1026 +      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
  4.1027 +      # Get rid of the leading space.
  4.1028 +      ac_sep=" "
  4.1029 +      ;;
  4.1030 +    esac
  4.1031 +  done
  4.1032 +done
  4.1033 +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
  4.1034 +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
  4.1035 +
  4.1036 +# When interrupted or exit'd, cleanup temporary files, and complete
  4.1037 +# config.log.  We remove comments because anyway the quotes in there
  4.1038 +# would cause problems or look ugly.
  4.1039 +# WARNING: Be sure not to use single quotes in there, as some shells,
  4.1040 +# such as our DU 5.0 friend, will then `close' the trap.
  4.1041 +trap 'exit_status=$?
  4.1042 +  # Save into config.log some information that might help in debugging.
  4.1043 +  {
  4.1044 +    echo
  4.1045 +
  4.1046 +    cat <<\_ASBOX
  4.1047 +## ---------------- ##
  4.1048 +## Cache variables. ##
  4.1049 +## ---------------- ##
  4.1050 +_ASBOX
  4.1051 +    echo
  4.1052 +    # The following way of writing the cache mishandles newlines in values,
  4.1053 +{
  4.1054 +  (set) 2>&1 |
  4.1055 +    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
  4.1056 +    *ac_space=\ *)
  4.1057 +      sed -n \
  4.1058 +        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
  4.1059 +    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
  4.1060 +      ;;
  4.1061 +    *)
  4.1062 +      sed -n \
  4.1063 +        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
  4.1064 +      ;;
  4.1065 +    esac;
  4.1066 +}
  4.1067 +    echo
  4.1068 +
  4.1069 +    cat <<\_ASBOX
  4.1070 +## ----------------- ##
  4.1071 +## Output variables. ##
  4.1072 +## ----------------- ##
  4.1073 +_ASBOX
  4.1074 +    echo
  4.1075 +    for ac_var in $ac_subst_vars
  4.1076 +    do
  4.1077 +      eval ac_val=$`echo $ac_var`
  4.1078 +      echo "$ac_var='"'"'$ac_val'"'"'"
  4.1079 +    done | sort
  4.1080 +    echo
  4.1081 +
  4.1082 +    if test -n "$ac_subst_files"; then
  4.1083 +      cat <<\_ASBOX
  4.1084 +## ------------- ##
  4.1085 +## Output files. ##
  4.1086 +## ------------- ##
  4.1087 +_ASBOX
  4.1088 +      echo
  4.1089 +      for ac_var in $ac_subst_files
  4.1090 +      do
  4.1091 +	eval ac_val=$`echo $ac_var`
  4.1092 +        echo "$ac_var='"'"'$ac_val'"'"'"
  4.1093 +      done | sort
  4.1094 +      echo
  4.1095 +    fi
  4.1096 +
  4.1097 +    if test -s confdefs.h; then
  4.1098 +      cat <<\_ASBOX
  4.1099 +## ----------- ##
  4.1100 +## confdefs.h. ##
  4.1101 +## ----------- ##
  4.1102 +_ASBOX
  4.1103 +      echo
  4.1104 +      sed "/^$/d" confdefs.h | sort
  4.1105 +      echo
  4.1106 +    fi
  4.1107 +    test "$ac_signal" != 0 &&
  4.1108 +      echo "$as_me: caught signal $ac_signal"
  4.1109 +    echo "$as_me: exit $exit_status"
  4.1110 +  } >&5
  4.1111 +  rm -f core core.* *.core &&
  4.1112 +  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
  4.1113 +    exit $exit_status
  4.1114 +     ' 0
  4.1115 +for ac_signal in 1 2 13 15; do
  4.1116 +  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
  4.1117 +done
  4.1118 +ac_signal=0
  4.1119 +
  4.1120 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
  4.1121 +rm -rf conftest* confdefs.h
  4.1122 +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
  4.1123 +echo >confdefs.h
  4.1124 +
  4.1125 +# Predefined preprocessor variables.
  4.1126 +
  4.1127 +cat >>confdefs.h <<_ACEOF
  4.1128 +#define PACKAGE_NAME "$PACKAGE_NAME"
  4.1129 +_ACEOF
  4.1130 +
  4.1131 +
  4.1132 +cat >>confdefs.h <<_ACEOF
  4.1133 +#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
  4.1134 +_ACEOF
  4.1135 +
  4.1136 +
  4.1137 +cat >>confdefs.h <<_ACEOF
  4.1138 +#define PACKAGE_VERSION "$PACKAGE_VERSION"
  4.1139 +_ACEOF
  4.1140 +
  4.1141 +
  4.1142 +cat >>confdefs.h <<_ACEOF
  4.1143 +#define PACKAGE_STRING "$PACKAGE_STRING"
  4.1144 +_ACEOF
  4.1145 +
  4.1146 +
  4.1147 +cat >>confdefs.h <<_ACEOF
  4.1148 +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
  4.1149 +_ACEOF
  4.1150 +
  4.1151 +
  4.1152 +# Let the site file select an alternate cache file if it wants to.
  4.1153 +# Prefer explicitly selected file to automatically selected ones.
  4.1154 +if test -z "$CONFIG_SITE"; then
  4.1155 +  if test "x$prefix" != xNONE; then
  4.1156 +    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  4.1157 +  else
  4.1158 +    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  4.1159 +  fi
  4.1160 +fi
  4.1161 +for ac_site_file in $CONFIG_SITE; do
  4.1162 +  if test -r "$ac_site_file"; then
  4.1163 +    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
  4.1164 +echo "$as_me: loading site script $ac_site_file" >&6;}
  4.1165 +    sed 's/^/| /' "$ac_site_file" >&5
  4.1166 +    . "$ac_site_file"
  4.1167 +  fi
  4.1168 +done
  4.1169 +
  4.1170 +if test -r "$cache_file"; then
  4.1171 +  # Some versions of bash will fail to source /dev/null (special
  4.1172 +  # files actually), so we avoid doing that.
  4.1173 +  if test -f "$cache_file"; then
  4.1174 +    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
  4.1175 +echo "$as_me: loading cache $cache_file" >&6;}
  4.1176 +    case $cache_file in
  4.1177 +      [\\/]* | ?:[\\/]* ) . $cache_file;;
  4.1178 +      *)                      . ./$cache_file;;
  4.1179 +    esac
  4.1180 +  fi
  4.1181 +else
  4.1182 +  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
  4.1183 +echo "$as_me: creating cache $cache_file" >&6;}
  4.1184 +  >$cache_file
  4.1185 +fi
  4.1186 +
  4.1187 +# Check that the precious variables saved in the cache have kept the same
  4.1188 +# value.
  4.1189 +ac_cache_corrupted=false
  4.1190 +for ac_var in `(set) 2>&1 |
  4.1191 +               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
  4.1192 +  eval ac_old_set=\$ac_cv_env_${ac_var}_set
  4.1193 +  eval ac_new_set=\$ac_env_${ac_var}_set
  4.1194 +  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
  4.1195 +  eval ac_new_val="\$ac_env_${ac_var}_value"
  4.1196 +  case $ac_old_set,$ac_new_set in
  4.1197 +    set,)
  4.1198 +      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
  4.1199 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
  4.1200 +      ac_cache_corrupted=: ;;
  4.1201 +    ,set)
  4.1202 +      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
  4.1203 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
  4.1204 +      ac_cache_corrupted=: ;;
  4.1205 +    ,);;
  4.1206 +    *)
  4.1207 +      if test "x$ac_old_val" != "x$ac_new_val"; then
  4.1208 +        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
  4.1209 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
  4.1210 +        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
  4.1211 +echo "$as_me:   former value:  $ac_old_val" >&2;}
  4.1212 +        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
  4.1213 +echo "$as_me:   current value: $ac_new_val" >&2;}
  4.1214 +        ac_cache_corrupted=:
  4.1215 +      fi;;
  4.1216 +  esac
  4.1217 +  # Pass precious variables to config.status.
  4.1218 +  if test "$ac_new_set" = set; then
  4.1219 +    case $ac_new_val in
  4.1220 +    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
  4.1221 +      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
  4.1222 +    *) ac_arg=$ac_var=$ac_new_val ;;
  4.1223 +    esac
  4.1224 +    case " $ac_configure_args " in
  4.1225 +      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
  4.1226 +      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  4.1227 +    esac
  4.1228 +  fi
  4.1229 +done
  4.1230 +if $ac_cache_corrupted; then
  4.1231 +  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
  4.1232 +echo "$as_me: error: changes in the environment can compromise the build" >&2;}
  4.1233 +  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
  4.1234 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
  4.1235 +   { (exit 1); exit 1; }; }
  4.1236 +fi
  4.1237 +
  4.1238 +ac_ext=c
  4.1239 +ac_cpp='$CPP $CPPFLAGS'
  4.1240 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  4.1241 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  4.1242 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  4.1243 +
  4.1244 +
  4.1245 +
  4.1246 +
  4.1247 +
  4.1248 +
  4.1249 +
  4.1250 +
  4.1251 +
  4.1252 +
  4.1253 +
  4.1254 +
  4.1255 +
  4.1256 +
  4.1257 +
  4.1258 +
  4.1259 +
  4.1260 +
  4.1261 +
  4.1262 +          ac_config_headers="$ac_config_headers config.h:config.in"
  4.1263 +
  4.1264 +
  4.1265 +ac_ext=c
  4.1266 +ac_cpp='$CPP $CPPFLAGS'
  4.1267 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  4.1268 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  4.1269 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  4.1270 +if test -n "$ac_tool_prefix"; then
  4.1271 +  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
  4.1272 +set dummy ${ac_tool_prefix}gcc; ac_word=$2
  4.1273 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1274 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1275 +if test "${ac_cv_prog_CC+set}" = set; then
  4.1276 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1277 +else
  4.1278 +  if test -n "$CC"; then
  4.1279 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  4.1280 +else
  4.1281 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1282 +for as_dir in $PATH
  4.1283 +do
  4.1284 +  IFS=$as_save_IFS
  4.1285 +  test -z "$as_dir" && as_dir=.
  4.1286 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1287 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1288 +    ac_cv_prog_CC="${ac_tool_prefix}gcc"
  4.1289 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1290 +    break 2
  4.1291 +  fi
  4.1292 +done
  4.1293 +done
  4.1294 +
  4.1295 +fi
  4.1296 +fi
  4.1297 +CC=$ac_cv_prog_CC
  4.1298 +if test -n "$CC"; then
  4.1299 +  echo "$as_me:$LINENO: result: $CC" >&5
  4.1300 +echo "${ECHO_T}$CC" >&6
  4.1301 +else
  4.1302 +  echo "$as_me:$LINENO: result: no" >&5
  4.1303 +echo "${ECHO_T}no" >&6
  4.1304 +fi
  4.1305 +
  4.1306 +fi
  4.1307 +if test -z "$ac_cv_prog_CC"; then
  4.1308 +  ac_ct_CC=$CC
  4.1309 +  # Extract the first word of "gcc", so it can be a program name with args.
  4.1310 +set dummy gcc; ac_word=$2
  4.1311 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1312 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1313 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  4.1314 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1315 +else
  4.1316 +  if test -n "$ac_ct_CC"; then
  4.1317 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  4.1318 +else
  4.1319 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1320 +for as_dir in $PATH
  4.1321 +do
  4.1322 +  IFS=$as_save_IFS
  4.1323 +  test -z "$as_dir" && as_dir=.
  4.1324 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1325 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1326 +    ac_cv_prog_ac_ct_CC="gcc"
  4.1327 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1328 +    break 2
  4.1329 +  fi
  4.1330 +done
  4.1331 +done
  4.1332 +
  4.1333 +fi
  4.1334 +fi
  4.1335 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  4.1336 +if test -n "$ac_ct_CC"; then
  4.1337 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  4.1338 +echo "${ECHO_T}$ac_ct_CC" >&6
  4.1339 +else
  4.1340 +  echo "$as_me:$LINENO: result: no" >&5
  4.1341 +echo "${ECHO_T}no" >&6
  4.1342 +fi
  4.1343 +
  4.1344 +  CC=$ac_ct_CC
  4.1345 +else
  4.1346 +  CC="$ac_cv_prog_CC"
  4.1347 +fi
  4.1348 +
  4.1349 +if test -z "$CC"; then
  4.1350 +  if test -n "$ac_tool_prefix"; then
  4.1351 +  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
  4.1352 +set dummy ${ac_tool_prefix}cc; ac_word=$2
  4.1353 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1354 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1355 +if test "${ac_cv_prog_CC+set}" = set; then
  4.1356 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1357 +else
  4.1358 +  if test -n "$CC"; then
  4.1359 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  4.1360 +else
  4.1361 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1362 +for as_dir in $PATH
  4.1363 +do
  4.1364 +  IFS=$as_save_IFS
  4.1365 +  test -z "$as_dir" && as_dir=.
  4.1366 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1367 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1368 +    ac_cv_prog_CC="${ac_tool_prefix}cc"
  4.1369 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1370 +    break 2
  4.1371 +  fi
  4.1372 +done
  4.1373 +done
  4.1374 +
  4.1375 +fi
  4.1376 +fi
  4.1377 +CC=$ac_cv_prog_CC
  4.1378 +if test -n "$CC"; then
  4.1379 +  echo "$as_me:$LINENO: result: $CC" >&5
  4.1380 +echo "${ECHO_T}$CC" >&6
  4.1381 +else
  4.1382 +  echo "$as_me:$LINENO: result: no" >&5
  4.1383 +echo "${ECHO_T}no" >&6
  4.1384 +fi
  4.1385 +
  4.1386 +fi
  4.1387 +if test -z "$ac_cv_prog_CC"; then
  4.1388 +  ac_ct_CC=$CC
  4.1389 +  # Extract the first word of "cc", so it can be a program name with args.
  4.1390 +set dummy cc; ac_word=$2
  4.1391 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1392 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1393 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  4.1394 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1395 +else
  4.1396 +  if test -n "$ac_ct_CC"; then
  4.1397 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  4.1398 +else
  4.1399 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1400 +for as_dir in $PATH
  4.1401 +do
  4.1402 +  IFS=$as_save_IFS
  4.1403 +  test -z "$as_dir" && as_dir=.
  4.1404 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1405 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1406 +    ac_cv_prog_ac_ct_CC="cc"
  4.1407 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1408 +    break 2
  4.1409 +  fi
  4.1410 +done
  4.1411 +done
  4.1412 +
  4.1413 +fi
  4.1414 +fi
  4.1415 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  4.1416 +if test -n "$ac_ct_CC"; then
  4.1417 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  4.1418 +echo "${ECHO_T}$ac_ct_CC" >&6
  4.1419 +else
  4.1420 +  echo "$as_me:$LINENO: result: no" >&5
  4.1421 +echo "${ECHO_T}no" >&6
  4.1422 +fi
  4.1423 +
  4.1424 +  CC=$ac_ct_CC
  4.1425 +else
  4.1426 +  CC="$ac_cv_prog_CC"
  4.1427 +fi
  4.1428 +
  4.1429 +fi
  4.1430 +if test -z "$CC"; then
  4.1431 +  # Extract the first word of "cc", so it can be a program name with args.
  4.1432 +set dummy cc; ac_word=$2
  4.1433 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1434 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1435 +if test "${ac_cv_prog_CC+set}" = set; then
  4.1436 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1437 +else
  4.1438 +  if test -n "$CC"; then
  4.1439 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  4.1440 +else
  4.1441 +  ac_prog_rejected=no
  4.1442 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1443 +for as_dir in $PATH
  4.1444 +do
  4.1445 +  IFS=$as_save_IFS
  4.1446 +  test -z "$as_dir" && as_dir=.
  4.1447 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1448 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1449 +    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
  4.1450 +       ac_prog_rejected=yes
  4.1451 +       continue
  4.1452 +     fi
  4.1453 +    ac_cv_prog_CC="cc"
  4.1454 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1455 +    break 2
  4.1456 +  fi
  4.1457 +done
  4.1458 +done
  4.1459 +
  4.1460 +if test $ac_prog_rejected = yes; then
  4.1461 +  # We found a bogon in the path, so make sure we never use it.
  4.1462 +  set dummy $ac_cv_prog_CC
  4.1463 +  shift
  4.1464 +  if test $# != 0; then
  4.1465 +    # We chose a different compiler from the bogus one.
  4.1466 +    # However, it has the same basename, so the bogon will be chosen
  4.1467 +    # first if we set CC to just the basename; use the full file name.
  4.1468 +    shift
  4.1469 +    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
  4.1470 +  fi
  4.1471 +fi
  4.1472 +fi
  4.1473 +fi
  4.1474 +CC=$ac_cv_prog_CC
  4.1475 +if test -n "$CC"; then
  4.1476 +  echo "$as_me:$LINENO: result: $CC" >&5
  4.1477 +echo "${ECHO_T}$CC" >&6
  4.1478 +else
  4.1479 +  echo "$as_me:$LINENO: result: no" >&5
  4.1480 +echo "${ECHO_T}no" >&6
  4.1481 +fi
  4.1482 +
  4.1483 +fi
  4.1484 +if test -z "$CC"; then
  4.1485 +  if test -n "$ac_tool_prefix"; then
  4.1486 +  for ac_prog in cl
  4.1487 +  do
  4.1488 +    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
  4.1489 +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
  4.1490 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1491 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1492 +if test "${ac_cv_prog_CC+set}" = set; then
  4.1493 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1494 +else
  4.1495 +  if test -n "$CC"; then
  4.1496 +  ac_cv_prog_CC="$CC" # Let the user override the test.
  4.1497 +else
  4.1498 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1499 +for as_dir in $PATH
  4.1500 +do
  4.1501 +  IFS=$as_save_IFS
  4.1502 +  test -z "$as_dir" && as_dir=.
  4.1503 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1504 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1505 +    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
  4.1506 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1507 +    break 2
  4.1508 +  fi
  4.1509 +done
  4.1510 +done
  4.1511 +
  4.1512 +fi
  4.1513 +fi
  4.1514 +CC=$ac_cv_prog_CC
  4.1515 +if test -n "$CC"; then
  4.1516 +  echo "$as_me:$LINENO: result: $CC" >&5
  4.1517 +echo "${ECHO_T}$CC" >&6
  4.1518 +else
  4.1519 +  echo "$as_me:$LINENO: result: no" >&5
  4.1520 +echo "${ECHO_T}no" >&6
  4.1521 +fi
  4.1522 +
  4.1523 +    test -n "$CC" && break
  4.1524 +  done
  4.1525 +fi
  4.1526 +if test -z "$CC"; then
  4.1527 +  ac_ct_CC=$CC
  4.1528 +  for ac_prog in cl
  4.1529 +do
  4.1530 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
  4.1531 +set dummy $ac_prog; ac_word=$2
  4.1532 +echo "$as_me:$LINENO: checking for $ac_word" >&5
  4.1533 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  4.1534 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
  4.1535 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1536 +else
  4.1537 +  if test -n "$ac_ct_CC"; then
  4.1538 +  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
  4.1539 +else
  4.1540 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.1541 +for as_dir in $PATH
  4.1542 +do
  4.1543 +  IFS=$as_save_IFS
  4.1544 +  test -z "$as_dir" && as_dir=.
  4.1545 +  for ac_exec_ext in '' $ac_executable_extensions; do
  4.1546 +  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  4.1547 +    ac_cv_prog_ac_ct_CC="$ac_prog"
  4.1548 +    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  4.1549 +    break 2
  4.1550 +  fi
  4.1551 +done
  4.1552 +done
  4.1553 +
  4.1554 +fi
  4.1555 +fi
  4.1556 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
  4.1557 +if test -n "$ac_ct_CC"; then
  4.1558 +  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
  4.1559 +echo "${ECHO_T}$ac_ct_CC" >&6
  4.1560 +else
  4.1561 +  echo "$as_me:$LINENO: result: no" >&5
  4.1562 +echo "${ECHO_T}no" >&6
  4.1563 +fi
  4.1564 +
  4.1565 +  test -n "$ac_ct_CC" && break
  4.1566 +done
  4.1567 +
  4.1568 +  CC=$ac_ct_CC
  4.1569 +fi
  4.1570 +
  4.1571 +fi
  4.1572 +
  4.1573 +
  4.1574 +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
  4.1575 +See \`config.log' for more details." >&5
  4.1576 +echo "$as_me: error: no acceptable C compiler found in \$PATH
  4.1577 +See \`config.log' for more details." >&2;}
  4.1578 +   { (exit 1); exit 1; }; }
  4.1579 +
  4.1580 +# Provide some information about the compiler.
  4.1581 +echo "$as_me:$LINENO:" \
  4.1582 +     "checking for C compiler version" >&5
  4.1583 +ac_compiler=`set X $ac_compile; echo $2`
  4.1584 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
  4.1585 +  (eval $ac_compiler --version </dev/null >&5) 2>&5
  4.1586 +  ac_status=$?
  4.1587 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1588 +  (exit $ac_status); }
  4.1589 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
  4.1590 +  (eval $ac_compiler -v </dev/null >&5) 2>&5
  4.1591 +  ac_status=$?
  4.1592 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1593 +  (exit $ac_status); }
  4.1594 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
  4.1595 +  (eval $ac_compiler -V </dev/null >&5) 2>&5
  4.1596 +  ac_status=$?
  4.1597 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1598 +  (exit $ac_status); }
  4.1599 +
  4.1600 +cat >conftest.$ac_ext <<_ACEOF
  4.1601 +#line $LINENO "configure"
  4.1602 +/* confdefs.h.  */
  4.1603 +_ACEOF
  4.1604 +cat confdefs.h >>conftest.$ac_ext
  4.1605 +cat >>conftest.$ac_ext <<_ACEOF
  4.1606 +/* end confdefs.h.  */
  4.1607 +
  4.1608 +int
  4.1609 +main ()
  4.1610 +{
  4.1611 +
  4.1612 +  ;
  4.1613 +  return 0;
  4.1614 +}
  4.1615 +_ACEOF
  4.1616 +ac_clean_files_save=$ac_clean_files
  4.1617 +ac_clean_files="$ac_clean_files a.out a.exe b.out"
  4.1618 +# Try to create an executable without -o first, disregard a.out.
  4.1619 +# It will help us diagnose broken compilers, and finding out an intuition
  4.1620 +# of exeext.
  4.1621 +echo "$as_me:$LINENO: checking for C compiler default output" >&5
  4.1622 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
  4.1623 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
  4.1624 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
  4.1625 +  (eval $ac_link_default) 2>&5
  4.1626 +  ac_status=$?
  4.1627 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1628 +  (exit $ac_status); }; then
  4.1629 +  # Find the output, starting from the most likely.  This scheme is
  4.1630 +# not robust to junk in `.', hence go to wildcards (a.*) only as a last
  4.1631 +# resort.
  4.1632 +
  4.1633 +# Be careful to initialize this variable, since it used to be cached.
  4.1634 +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
  4.1635 +ac_cv_exeext=
  4.1636 +# b.out is created by i960 compilers.
  4.1637 +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
  4.1638 +do
  4.1639 +  test -f "$ac_file" || continue
  4.1640 +  case $ac_file in
  4.1641 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
  4.1642 +        ;;
  4.1643 +    conftest.$ac_ext )
  4.1644 +        # This is the source file.
  4.1645 +        ;;
  4.1646 +    [ab].out )
  4.1647 +        # We found the default executable, but exeext='' is most
  4.1648 +        # certainly right.
  4.1649 +        break;;
  4.1650 +    *.* )
  4.1651 +        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
  4.1652 +        # FIXME: I believe we export ac_cv_exeext for Libtool,
  4.1653 +        # but it would be cool to find out if it's true.  Does anybody
  4.1654 +        # maintain Libtool? --akim.
  4.1655 +        export ac_cv_exeext
  4.1656 +        break;;
  4.1657 +    * )
  4.1658 +        break;;
  4.1659 +  esac
  4.1660 +done
  4.1661 +else
  4.1662 +  echo "$as_me: failed program was:" >&5
  4.1663 +sed 's/^/| /' conftest.$ac_ext >&5
  4.1664 +
  4.1665 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
  4.1666 +See \`config.log' for more details." >&5
  4.1667 +echo "$as_me: error: C compiler cannot create executables
  4.1668 +See \`config.log' for more details." >&2;}
  4.1669 +   { (exit 77); exit 77; }; }
  4.1670 +fi
  4.1671 +
  4.1672 +ac_exeext=$ac_cv_exeext
  4.1673 +echo "$as_me:$LINENO: result: $ac_file" >&5
  4.1674 +echo "${ECHO_T}$ac_file" >&6
  4.1675 +
  4.1676 +# Check the compiler produces executables we can run.  If not, either
  4.1677 +# the compiler is broken, or we cross compile.
  4.1678 +echo "$as_me:$LINENO: checking whether the C compiler works" >&5
  4.1679 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
  4.1680 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
  4.1681 +# If not cross compiling, check that we can run a simple program.
  4.1682 +if test "$cross_compiling" != yes; then
  4.1683 +  if { ac_try='./$ac_file'
  4.1684 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.1685 +  (eval $ac_try) 2>&5
  4.1686 +  ac_status=$?
  4.1687 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1688 +  (exit $ac_status); }; }; then
  4.1689 +    cross_compiling=no
  4.1690 +  else
  4.1691 +    if test "$cross_compiling" = maybe; then
  4.1692 +	cross_compiling=yes
  4.1693 +    else
  4.1694 +	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
  4.1695 +If you meant to cross compile, use \`--host'.
  4.1696 +See \`config.log' for more details." >&5
  4.1697 +echo "$as_me: error: cannot run C compiled programs.
  4.1698 +If you meant to cross compile, use \`--host'.
  4.1699 +See \`config.log' for more details." >&2;}
  4.1700 +   { (exit 1); exit 1; }; }
  4.1701 +    fi
  4.1702 +  fi
  4.1703 +fi
  4.1704 +echo "$as_me:$LINENO: result: yes" >&5
  4.1705 +echo "${ECHO_T}yes" >&6
  4.1706 +
  4.1707 +rm -f a.out a.exe conftest$ac_cv_exeext b.out
  4.1708 +ac_clean_files=$ac_clean_files_save
  4.1709 +# Check the compiler produces executables we can run.  If not, either
  4.1710 +# the compiler is broken, or we cross compile.
  4.1711 +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
  4.1712 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
  4.1713 +echo "$as_me:$LINENO: result: $cross_compiling" >&5
  4.1714 +echo "${ECHO_T}$cross_compiling" >&6
  4.1715 +
  4.1716 +echo "$as_me:$LINENO: checking for suffix of executables" >&5
  4.1717 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
  4.1718 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  4.1719 +  (eval $ac_link) 2>&5
  4.1720 +  ac_status=$?
  4.1721 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1722 +  (exit $ac_status); }; then
  4.1723 +  # If both `conftest.exe' and `conftest' are `present' (well, observable)
  4.1724 +# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
  4.1725 +# work properly (i.e., refer to `conftest.exe'), while it won't with
  4.1726 +# `rm'.
  4.1727 +for ac_file in conftest.exe conftest conftest.*; do
  4.1728 +  test -f "$ac_file" || continue
  4.1729 +  case $ac_file in
  4.1730 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
  4.1731 +    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
  4.1732 +          export ac_cv_exeext
  4.1733 +          break;;
  4.1734 +    * ) break;;
  4.1735 +  esac
  4.1736 +done
  4.1737 +else
  4.1738 +  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
  4.1739 +See \`config.log' for more details." >&5
  4.1740 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
  4.1741 +See \`config.log' for more details." >&2;}
  4.1742 +   { (exit 1); exit 1; }; }
  4.1743 +fi
  4.1744 +
  4.1745 +rm -f conftest$ac_cv_exeext
  4.1746 +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
  4.1747 +echo "${ECHO_T}$ac_cv_exeext" >&6
  4.1748 +
  4.1749 +rm -f conftest.$ac_ext
  4.1750 +EXEEXT=$ac_cv_exeext
  4.1751 +ac_exeext=$EXEEXT
  4.1752 +echo "$as_me:$LINENO: checking for suffix of object files" >&5
  4.1753 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
  4.1754 +if test "${ac_cv_objext+set}" = set; then
  4.1755 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1756 +else
  4.1757 +  cat >conftest.$ac_ext <<_ACEOF
  4.1758 +#line $LINENO "configure"
  4.1759 +/* confdefs.h.  */
  4.1760 +_ACEOF
  4.1761 +cat confdefs.h >>conftest.$ac_ext
  4.1762 +cat >>conftest.$ac_ext <<_ACEOF
  4.1763 +/* end confdefs.h.  */
  4.1764 +
  4.1765 +int
  4.1766 +main ()
  4.1767 +{
  4.1768 +
  4.1769 +  ;
  4.1770 +  return 0;
  4.1771 +}
  4.1772 +_ACEOF
  4.1773 +rm -f conftest.o conftest.obj
  4.1774 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.1775 +  (eval $ac_compile) 2>&5
  4.1776 +  ac_status=$?
  4.1777 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1778 +  (exit $ac_status); }; then
  4.1779 +  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
  4.1780 +  case $ac_file in
  4.1781 +    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
  4.1782 +    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
  4.1783 +       break;;
  4.1784 +  esac
  4.1785 +done
  4.1786 +else
  4.1787 +  echo "$as_me: failed program was:" >&5
  4.1788 +sed 's/^/| /' conftest.$ac_ext >&5
  4.1789 +
  4.1790 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
  4.1791 +See \`config.log' for more details." >&5
  4.1792 +echo "$as_me: error: cannot compute suffix of object files: cannot compile
  4.1793 +See \`config.log' for more details." >&2;}
  4.1794 +   { (exit 1); exit 1; }; }
  4.1795 +fi
  4.1796 +
  4.1797 +rm -f conftest.$ac_cv_objext conftest.$ac_ext
  4.1798 +fi
  4.1799 +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
  4.1800 +echo "${ECHO_T}$ac_cv_objext" >&6
  4.1801 +OBJEXT=$ac_cv_objext
  4.1802 +ac_objext=$OBJEXT
  4.1803 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
  4.1804 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
  4.1805 +if test "${ac_cv_c_compiler_gnu+set}" = set; then
  4.1806 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1807 +else
  4.1808 +  cat >conftest.$ac_ext <<_ACEOF
  4.1809 +#line $LINENO "configure"
  4.1810 +/* confdefs.h.  */
  4.1811 +_ACEOF
  4.1812 +cat confdefs.h >>conftest.$ac_ext
  4.1813 +cat >>conftest.$ac_ext <<_ACEOF
  4.1814 +/* end confdefs.h.  */
  4.1815 +
  4.1816 +int
  4.1817 +main ()
  4.1818 +{
  4.1819 +#ifndef __GNUC__
  4.1820 +       choke me
  4.1821 +#endif
  4.1822 +
  4.1823 +  ;
  4.1824 +  return 0;
  4.1825 +}
  4.1826 +_ACEOF
  4.1827 +rm -f conftest.$ac_objext
  4.1828 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.1829 +  (eval $ac_compile) 2>&5
  4.1830 +  ac_status=$?
  4.1831 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1832 +  (exit $ac_status); } &&
  4.1833 +         { ac_try='test -s conftest.$ac_objext'
  4.1834 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.1835 +  (eval $ac_try) 2>&5
  4.1836 +  ac_status=$?
  4.1837 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1838 +  (exit $ac_status); }; }; then
  4.1839 +  ac_compiler_gnu=yes
  4.1840 +else
  4.1841 +  echo "$as_me: failed program was:" >&5
  4.1842 +sed 's/^/| /' conftest.$ac_ext >&5
  4.1843 +
  4.1844 +ac_compiler_gnu=no
  4.1845 +fi
  4.1846 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.1847 +ac_cv_c_compiler_gnu=$ac_compiler_gnu
  4.1848 +
  4.1849 +fi
  4.1850 +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
  4.1851 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
  4.1852 +GCC=`test $ac_compiler_gnu = yes && echo yes`
  4.1853 +ac_test_CFLAGS=${CFLAGS+set}
  4.1854 +ac_save_CFLAGS=$CFLAGS
  4.1855 +CFLAGS="-g"
  4.1856 +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
  4.1857 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
  4.1858 +if test "${ac_cv_prog_cc_g+set}" = set; then
  4.1859 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1860 +else
  4.1861 +  cat >conftest.$ac_ext <<_ACEOF
  4.1862 +#line $LINENO "configure"
  4.1863 +/* confdefs.h.  */
  4.1864 +_ACEOF
  4.1865 +cat confdefs.h >>conftest.$ac_ext
  4.1866 +cat >>conftest.$ac_ext <<_ACEOF
  4.1867 +/* end confdefs.h.  */
  4.1868 +
  4.1869 +int
  4.1870 +main ()
  4.1871 +{
  4.1872 +
  4.1873 +  ;
  4.1874 +  return 0;
  4.1875 +}
  4.1876 +_ACEOF
  4.1877 +rm -f conftest.$ac_objext
  4.1878 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.1879 +  (eval $ac_compile) 2>&5
  4.1880 +  ac_status=$?
  4.1881 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1882 +  (exit $ac_status); } &&
  4.1883 +         { ac_try='test -s conftest.$ac_objext'
  4.1884 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.1885 +  (eval $ac_try) 2>&5
  4.1886 +  ac_status=$?
  4.1887 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1888 +  (exit $ac_status); }; }; then
  4.1889 +  ac_cv_prog_cc_g=yes
  4.1890 +else
  4.1891 +  echo "$as_me: failed program was:" >&5
  4.1892 +sed 's/^/| /' conftest.$ac_ext >&5
  4.1893 +
  4.1894 +ac_cv_prog_cc_g=no
  4.1895 +fi
  4.1896 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.1897 +fi
  4.1898 +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
  4.1899 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
  4.1900 +if test "$ac_test_CFLAGS" = set; then
  4.1901 +  CFLAGS=$ac_save_CFLAGS
  4.1902 +elif test $ac_cv_prog_cc_g = yes; then
  4.1903 +  if test "$GCC" = yes; then
  4.1904 +    CFLAGS="-g -O2"
  4.1905 +  else
  4.1906 +    CFLAGS="-g"
  4.1907 +  fi
  4.1908 +else
  4.1909 +  if test "$GCC" = yes; then
  4.1910 +    CFLAGS="-O2"
  4.1911 +  else
  4.1912 +    CFLAGS=
  4.1913 +  fi
  4.1914 +fi
  4.1915 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
  4.1916 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
  4.1917 +if test "${ac_cv_prog_cc_stdc+set}" = set; then
  4.1918 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.1919 +else
  4.1920 +  ac_cv_prog_cc_stdc=no
  4.1921 +ac_save_CC=$CC
  4.1922 +cat >conftest.$ac_ext <<_ACEOF
  4.1923 +#line $LINENO "configure"
  4.1924 +/* confdefs.h.  */
  4.1925 +_ACEOF
  4.1926 +cat confdefs.h >>conftest.$ac_ext
  4.1927 +cat >>conftest.$ac_ext <<_ACEOF
  4.1928 +/* end confdefs.h.  */
  4.1929 +#include <stdarg.h>
  4.1930 +#include <stdio.h>
  4.1931 +#include <sys/types.h>
  4.1932 +#include <sys/stat.h>
  4.1933 +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
  4.1934 +struct buf { int x; };
  4.1935 +FILE * (*rcsopen) (struct buf *, struct stat *, int);
  4.1936 +static char *e (p, i)
  4.1937 +     char **p;
  4.1938 +     int i;
  4.1939 +{
  4.1940 +  return p[i];
  4.1941 +}
  4.1942 +static char *f (char * (*g) (char **, int), char **p, ...)
  4.1943 +{
  4.1944 +  char *s;
  4.1945 +  va_list v;
  4.1946 +  va_start (v,p);
  4.1947 +  s = g (p, va_arg (v,int));
  4.1948 +  va_end (v);
  4.1949 +  return s;
  4.1950 +}
  4.1951 +int test (int i, double x);
  4.1952 +struct s1 {int (*f) (int a);};
  4.1953 +struct s2 {int (*f) (double a);};
  4.1954 +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
  4.1955 +int argc;
  4.1956 +char **argv;
  4.1957 +int
  4.1958 +main ()
  4.1959 +{
  4.1960 +return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
  4.1961 +  ;
  4.1962 +  return 0;
  4.1963 +}
  4.1964 +_ACEOF
  4.1965 +# Don't try gcc -ansi; that turns off useful extensions and
  4.1966 +# breaks some systems' header files.
  4.1967 +# AIX			-qlanglvl=ansi
  4.1968 +# Ultrix and OSF/1	-std1
  4.1969 +# HP-UX 10.20 and later	-Ae
  4.1970 +# HP-UX older versions	-Aa -D_HPUX_SOURCE
  4.1971 +# SVR4			-Xc -D__EXTENSIONS__
  4.1972 +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  4.1973 +do
  4.1974 +  CC="$ac_save_CC $ac_arg"
  4.1975 +  rm -f conftest.$ac_objext
  4.1976 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.1977 +  (eval $ac_compile) 2>&5
  4.1978 +  ac_status=$?
  4.1979 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1980 +  (exit $ac_status); } &&
  4.1981 +         { ac_try='test -s conftest.$ac_objext'
  4.1982 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.1983 +  (eval $ac_try) 2>&5
  4.1984 +  ac_status=$?
  4.1985 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.1986 +  (exit $ac_status); }; }; then
  4.1987 +  ac_cv_prog_cc_stdc=$ac_arg
  4.1988 +break
  4.1989 +else
  4.1990 +  echo "$as_me: failed program was:" >&5
  4.1991 +sed 's/^/| /' conftest.$ac_ext >&5
  4.1992 +
  4.1993 +fi
  4.1994 +rm -f conftest.$ac_objext
  4.1995 +done
  4.1996 +rm -f conftest.$ac_ext conftest.$ac_objext
  4.1997 +CC=$ac_save_CC
  4.1998 +
  4.1999 +fi
  4.2000 +
  4.2001 +case "x$ac_cv_prog_cc_stdc" in
  4.2002 +  x|xno)
  4.2003 +    echo "$as_me:$LINENO: result: none needed" >&5
  4.2004 +echo "${ECHO_T}none needed" >&6 ;;
  4.2005 +  *)
  4.2006 +    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
  4.2007 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
  4.2008 +    CC="$CC $ac_cv_prog_cc_stdc" ;;
  4.2009 +esac
  4.2010 +
  4.2011 +# Some people use a C++ compiler to compile C.  Since we use `exit',
  4.2012 +# in C++ we need to declare it.  In case someone uses the same compiler
  4.2013 +# for both compiling C and C++ we need to have the C++ compiler decide
  4.2014 +# the declaration of exit, since it's the most demanding environment.
  4.2015 +cat >conftest.$ac_ext <<_ACEOF
  4.2016 +#ifndef __cplusplus
  4.2017 +  choke me
  4.2018 +#endif
  4.2019 +_ACEOF
  4.2020 +rm -f conftest.$ac_objext
  4.2021 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2022 +  (eval $ac_compile) 2>&5
  4.2023 +  ac_status=$?
  4.2024 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2025 +  (exit $ac_status); } &&
  4.2026 +         { ac_try='test -s conftest.$ac_objext'
  4.2027 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2028 +  (eval $ac_try) 2>&5
  4.2029 +  ac_status=$?
  4.2030 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2031 +  (exit $ac_status); }; }; then
  4.2032 +  for ac_declaration in \
  4.2033 +   ''\
  4.2034 +   '#include <stdlib.h>' \
  4.2035 +   'extern "C" void std::exit (int) throw (); using std::exit;' \
  4.2036 +   'extern "C" void std::exit (int); using std::exit;' \
  4.2037 +   'extern "C" void exit (int) throw ();' \
  4.2038 +   'extern "C" void exit (int);' \
  4.2039 +   'void exit (int);'
  4.2040 +do
  4.2041 +  cat >conftest.$ac_ext <<_ACEOF
  4.2042 +#line $LINENO "configure"
  4.2043 +/* confdefs.h.  */
  4.2044 +_ACEOF
  4.2045 +cat confdefs.h >>conftest.$ac_ext
  4.2046 +cat >>conftest.$ac_ext <<_ACEOF
  4.2047 +/* end confdefs.h.  */
  4.2048 +#include <stdlib.h>
  4.2049 +$ac_declaration
  4.2050 +int
  4.2051 +main ()
  4.2052 +{
  4.2053 +exit (42);
  4.2054 +  ;
  4.2055 +  return 0;
  4.2056 +}
  4.2057 +_ACEOF
  4.2058 +rm -f conftest.$ac_objext
  4.2059 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2060 +  (eval $ac_compile) 2>&5
  4.2061 +  ac_status=$?
  4.2062 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2063 +  (exit $ac_status); } &&
  4.2064 +         { ac_try='test -s conftest.$ac_objext'
  4.2065 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2066 +  (eval $ac_try) 2>&5
  4.2067 +  ac_status=$?
  4.2068 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2069 +  (exit $ac_status); }; }; then
  4.2070 +  :
  4.2071 +else
  4.2072 +  echo "$as_me: failed program was:" >&5
  4.2073 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2074 +
  4.2075 +continue
  4.2076 +fi
  4.2077 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2078 +  cat >conftest.$ac_ext <<_ACEOF
  4.2079 +#line $LINENO "configure"
  4.2080 +/* confdefs.h.  */
  4.2081 +_ACEOF
  4.2082 +cat confdefs.h >>conftest.$ac_ext
  4.2083 +cat >>conftest.$ac_ext <<_ACEOF
  4.2084 +/* end confdefs.h.  */
  4.2085 +$ac_declaration
  4.2086 +int
  4.2087 +main ()
  4.2088 +{
  4.2089 +exit (42);
  4.2090 +  ;
  4.2091 +  return 0;
  4.2092 +}
  4.2093 +_ACEOF
  4.2094 +rm -f conftest.$ac_objext
  4.2095 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2096 +  (eval $ac_compile) 2>&5
  4.2097 +  ac_status=$?
  4.2098 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2099 +  (exit $ac_status); } &&
  4.2100 +         { ac_try='test -s conftest.$ac_objext'
  4.2101 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2102 +  (eval $ac_try) 2>&5
  4.2103 +  ac_status=$?
  4.2104 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2105 +  (exit $ac_status); }; }; then
  4.2106 +  break
  4.2107 +else
  4.2108 +  echo "$as_me: failed program was:" >&5
  4.2109 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2110 +
  4.2111 +fi
  4.2112 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2113 +done
  4.2114 +rm -f conftest*
  4.2115 +if test -n "$ac_declaration"; then
  4.2116 +  echo '#ifdef __cplusplus' >>confdefs.h
  4.2117 +  echo $ac_declaration      >>confdefs.h
  4.2118 +  echo '#endif'             >>confdefs.h
  4.2119 +fi
  4.2120 +
  4.2121 +else
  4.2122 +  echo "$as_me: failed program was:" >&5
  4.2123 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2124 +
  4.2125 +fi
  4.2126 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2127 +ac_ext=c
  4.2128 +ac_cpp='$CPP $CPPFLAGS'
  4.2129 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  4.2130 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  4.2131 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  4.2132 +
  4.2133 +
  4.2134 +ac_aux_dir=
  4.2135 +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
  4.2136 +  if test -f $ac_dir/install-sh; then
  4.2137 +    ac_aux_dir=$ac_dir
  4.2138 +    ac_install_sh="$ac_aux_dir/install-sh -c"
  4.2139 +    break
  4.2140 +  elif test -f $ac_dir/install.sh; then
  4.2141 +    ac_aux_dir=$ac_dir
  4.2142 +    ac_install_sh="$ac_aux_dir/install.sh -c"
  4.2143 +    break
  4.2144 +  elif test -f $ac_dir/shtool; then
  4.2145 +    ac_aux_dir=$ac_dir
  4.2146 +    ac_install_sh="$ac_aux_dir/shtool install -c"
  4.2147 +    break
  4.2148 +  fi
  4.2149 +done
  4.2150 +if test -z "$ac_aux_dir"; then
  4.2151 +  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
  4.2152 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
  4.2153 +   { (exit 1); exit 1; }; }
  4.2154 +fi
  4.2155 +ac_config_guess="$SHELL $ac_aux_dir/config.guess"
  4.2156 +ac_config_sub="$SHELL $ac_aux_dir/config.sub"
  4.2157 +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
  4.2158 +
  4.2159 +# Make sure we can run config.sub.
  4.2160 +$ac_config_sub sun4 >/dev/null 2>&1 ||
  4.2161 +  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
  4.2162 +echo "$as_me: error: cannot run $ac_config_sub" >&2;}
  4.2163 +   { (exit 1); exit 1; }; }
  4.2164 +
  4.2165 +echo "$as_me:$LINENO: checking build system type" >&5
  4.2166 +echo $ECHO_N "checking build system type... $ECHO_C" >&6
  4.2167 +if test "${ac_cv_build+set}" = set; then
  4.2168 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2169 +else
  4.2170 +  ac_cv_build_alias=$build_alias
  4.2171 +test -z "$ac_cv_build_alias" &&
  4.2172 +  ac_cv_build_alias=`$ac_config_guess`
  4.2173 +test -z "$ac_cv_build_alias" &&
  4.2174 +  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
  4.2175 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
  4.2176 +   { (exit 1); exit 1; }; }
  4.2177 +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
  4.2178 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
  4.2179 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
  4.2180 +   { (exit 1); exit 1; }; }
  4.2181 +
  4.2182 +fi
  4.2183 +echo "$as_me:$LINENO: result: $ac_cv_build" >&5
  4.2184 +echo "${ECHO_T}$ac_cv_build" >&6
  4.2185 +build=$ac_cv_build
  4.2186 +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  4.2187 +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  4.2188 +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  4.2189 +
  4.2190 +
  4.2191 +echo "$as_me:$LINENO: checking host system type" >&5
  4.2192 +echo $ECHO_N "checking host system type... $ECHO_C" >&6
  4.2193 +if test "${ac_cv_host+set}" = set; then
  4.2194 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2195 +else
  4.2196 +  ac_cv_host_alias=$host_alias
  4.2197 +test -z "$ac_cv_host_alias" &&
  4.2198 +  ac_cv_host_alias=$ac_cv_build_alias
  4.2199 +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
  4.2200 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
  4.2201 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
  4.2202 +   { (exit 1); exit 1; }; }
  4.2203 +
  4.2204 +fi
  4.2205 +echo "$as_me:$LINENO: result: $ac_cv_host" >&5
  4.2206 +echo "${ECHO_T}$ac_cv_host" >&6
  4.2207 +host=$ac_cv_host
  4.2208 +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  4.2209 +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  4.2210 +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  4.2211 +
  4.2212 +
  4.2213 +echo "$as_me:$LINENO: checking target system type" >&5
  4.2214 +echo $ECHO_N "checking target system type... $ECHO_C" >&6
  4.2215 +if test "${ac_cv_target+set}" = set; then
  4.2216 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2217 +else
  4.2218 +  ac_cv_target_alias=$target_alias
  4.2219 +test "x$ac_cv_target_alias" = "x" &&
  4.2220 +  ac_cv_target_alias=$ac_cv_host_alias
  4.2221 +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
  4.2222 +  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
  4.2223 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
  4.2224 +   { (exit 1); exit 1; }; }
  4.2225 +
  4.2226 +fi
  4.2227 +echo "$as_me:$LINENO: result: $ac_cv_target" >&5
  4.2228 +echo "${ECHO_T}$ac_cv_target" >&6
  4.2229 +target=$ac_cv_target
  4.2230 +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  4.2231 +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  4.2232 +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  4.2233 +
  4.2234 +
  4.2235 +# The aliases save the names the user supplied, while $host etc.
  4.2236 +# will get canonicalized.
  4.2237 +test -n "$target_alias" &&
  4.2238 +  test "$program_prefix$program_suffix$program_transform_name" = \
  4.2239 +    NONENONEs,x,x, &&
  4.2240 +  program_prefix=${target_alias}-
  4.2241 +
  4.2242 +# Find a good install program.  We prefer a C program (faster),
  4.2243 +# so one script is as good as another.  But avoid the broken or
  4.2244 +# incompatible versions:
  4.2245 +# SysV /etc/install, /usr/sbin/install
  4.2246 +# SunOS /usr/etc/install
  4.2247 +# IRIX /sbin/install
  4.2248 +# AIX /bin/install
  4.2249 +# AmigaOS /C/install, which installs bootblocks on floppy discs
  4.2250 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
  4.2251 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
  4.2252 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  4.2253 +# ./install, which can be erroneously created by make from ./install.sh.
  4.2254 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
  4.2255 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
  4.2256 +if test -z "$INSTALL"; then
  4.2257 +if test "${ac_cv_path_install+set}" = set; then
  4.2258 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2259 +else
  4.2260 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.2261 +for as_dir in $PATH
  4.2262 +do
  4.2263 +  IFS=$as_save_IFS
  4.2264 +  test -z "$as_dir" && as_dir=.
  4.2265 +  # Account for people who put trailing slashes in PATH elements.
  4.2266 +case $as_dir/ in
  4.2267 +  ./ | .// | /cC/* | \
  4.2268 +  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
  4.2269 +  /usr/ucb/* ) ;;
  4.2270 +  *)
  4.2271 +    # OSF1 and SCO ODT 3.0 have their own names for install.
  4.2272 +    # Don't use installbsd from OSF since it installs stuff as root
  4.2273 +    # by default.
  4.2274 +    for ac_prog in ginstall scoinst install; do
  4.2275 +      for ac_exec_ext in '' $ac_executable_extensions; do
  4.2276 +        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
  4.2277 +          if test $ac_prog = install &&
  4.2278 +            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  4.2279 +            # AIX install.  It has an incompatible calling convention.
  4.2280 +            :
  4.2281 +          elif test $ac_prog = install &&
  4.2282 +            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
  4.2283 +            # program-specific install script used by HP pwplus--don't use.
  4.2284 +            :
  4.2285 +          else
  4.2286 +            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
  4.2287 +            break 3
  4.2288 +          fi
  4.2289 +        fi
  4.2290 +      done
  4.2291 +    done
  4.2292 +    ;;
  4.2293 +esac
  4.2294 +done
  4.2295 +
  4.2296 +
  4.2297 +fi
  4.2298 +  if test "${ac_cv_path_install+set}" = set; then
  4.2299 +    INSTALL=$ac_cv_path_install
  4.2300 +  else
  4.2301 +    # As a last resort, use the slow shell script.  We don't cache a
  4.2302 +    # path for INSTALL within a source directory, because that will
  4.2303 +    # break other packages using the cache if that directory is
  4.2304 +    # removed, or if the path is relative.
  4.2305 +    INSTALL=$ac_install_sh
  4.2306 +  fi
  4.2307 +fi
  4.2308 +echo "$as_me:$LINENO: result: $INSTALL" >&5
  4.2309 +echo "${ECHO_T}$INSTALL" >&6
  4.2310 +
  4.2311 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  4.2312 +# It thinks the first close brace ends the variable substitution.
  4.2313 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  4.2314 +
  4.2315 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
  4.2316 +
  4.2317 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  4.2318 +
  4.2319 +
  4.2320 +
  4.2321 +ac_ext=c
  4.2322 +ac_cpp='$CPP $CPPFLAGS'
  4.2323 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  4.2324 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  4.2325 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  4.2326 +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
  4.2327 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
  4.2328 +# On Suns, sometimes $CPP names a directory.
  4.2329 +if test -n "$CPP" && test -d "$CPP"; then
  4.2330 +  CPP=
  4.2331 +fi
  4.2332 +if test -z "$CPP"; then
  4.2333 +  if test "${ac_cv_prog_CPP+set}" = set; then
  4.2334 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2335 +else
  4.2336 +      # Double quotes because CPP needs to be expanded
  4.2337 +    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
  4.2338 +    do
  4.2339 +      ac_preproc_ok=false
  4.2340 +for ac_c_preproc_warn_flag in '' yes
  4.2341 +do
  4.2342 +  # Use a header file that comes with gcc, so configuring glibc
  4.2343 +  # with a fresh cross-compiler works.
  4.2344 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  4.2345 +  # <limits.h> exists even on freestanding compilers.
  4.2346 +  # On the NeXT, cc -E runs the code through the compiler's parser,
  4.2347 +  # not just through cpp. "Syntax error" is here to catch this case.
  4.2348 +  cat >conftest.$ac_ext <<_ACEOF
  4.2349 +#line $LINENO "configure"
  4.2350 +/* confdefs.h.  */
  4.2351 +_ACEOF
  4.2352 +cat confdefs.h >>conftest.$ac_ext
  4.2353 +cat >>conftest.$ac_ext <<_ACEOF
  4.2354 +/* end confdefs.h.  */
  4.2355 +#ifdef __STDC__
  4.2356 +# include <limits.h>
  4.2357 +#else
  4.2358 +# include <assert.h>
  4.2359 +#endif
  4.2360 +                     Syntax error
  4.2361 +_ACEOF
  4.2362 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  4.2363 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  4.2364 +  ac_status=$?
  4.2365 +  grep -v '^ *+' conftest.er1 >conftest.err
  4.2366 +  rm -f conftest.er1
  4.2367 +  cat conftest.err >&5
  4.2368 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2369 +  (exit $ac_status); } >/dev/null; then
  4.2370 +  if test -s conftest.err; then
  4.2371 +    ac_cpp_err=$ac_c_preproc_warn_flag
  4.2372 +  else
  4.2373 +    ac_cpp_err=
  4.2374 +  fi
  4.2375 +else
  4.2376 +  ac_cpp_err=yes
  4.2377 +fi
  4.2378 +if test -z "$ac_cpp_err"; then
  4.2379 +  :
  4.2380 +else
  4.2381 +  echo "$as_me: failed program was:" >&5
  4.2382 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2383 +
  4.2384 +  # Broken: fails on valid input.
  4.2385 +continue
  4.2386 +fi
  4.2387 +rm -f conftest.err conftest.$ac_ext
  4.2388 +
  4.2389 +  # OK, works on sane cases.  Now check whether non-existent headers
  4.2390 +  # can be detected and how.
  4.2391 +  cat >conftest.$ac_ext <<_ACEOF
  4.2392 +#line $LINENO "configure"
  4.2393 +/* confdefs.h.  */
  4.2394 +_ACEOF
  4.2395 +cat confdefs.h >>conftest.$ac_ext
  4.2396 +cat >>conftest.$ac_ext <<_ACEOF
  4.2397 +/* end confdefs.h.  */
  4.2398 +#include <ac_nonexistent.h>
  4.2399 +_ACEOF
  4.2400 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  4.2401 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  4.2402 +  ac_status=$?
  4.2403 +  grep -v '^ *+' conftest.er1 >conftest.err
  4.2404 +  rm -f conftest.er1
  4.2405 +  cat conftest.err >&5
  4.2406 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2407 +  (exit $ac_status); } >/dev/null; then
  4.2408 +  if test -s conftest.err; then
  4.2409 +    ac_cpp_err=$ac_c_preproc_warn_flag
  4.2410 +  else
  4.2411 +    ac_cpp_err=
  4.2412 +  fi
  4.2413 +else
  4.2414 +  ac_cpp_err=yes
  4.2415 +fi
  4.2416 +if test -z "$ac_cpp_err"; then
  4.2417 +  # Broken: success on invalid input.
  4.2418 +continue
  4.2419 +else
  4.2420 +  echo "$as_me: failed program was:" >&5
  4.2421 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2422 +
  4.2423 +  # Passes both tests.
  4.2424 +ac_preproc_ok=:
  4.2425 +break
  4.2426 +fi
  4.2427 +rm -f conftest.err conftest.$ac_ext
  4.2428 +
  4.2429 +done
  4.2430 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  4.2431 +rm -f conftest.err conftest.$ac_ext
  4.2432 +if $ac_preproc_ok; then
  4.2433 +  break
  4.2434 +fi
  4.2435 +
  4.2436 +    done
  4.2437 +    ac_cv_prog_CPP=$CPP
  4.2438 +
  4.2439 +fi
  4.2440 +  CPP=$ac_cv_prog_CPP
  4.2441 +else
  4.2442 +  ac_cv_prog_CPP=$CPP
  4.2443 +fi
  4.2444 +echo "$as_me:$LINENO: result: $CPP" >&5
  4.2445 +echo "${ECHO_T}$CPP" >&6
  4.2446 +ac_preproc_ok=false
  4.2447 +for ac_c_preproc_warn_flag in '' yes
  4.2448 +do
  4.2449 +  # Use a header file that comes with gcc, so configuring glibc
  4.2450 +  # with a fresh cross-compiler works.
  4.2451 +  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
  4.2452 +  # <limits.h> exists even on freestanding compilers.
  4.2453 +  # On the NeXT, cc -E runs the code through the compiler's parser,
  4.2454 +  # not just through cpp. "Syntax error" is here to catch this case.
  4.2455 +  cat >conftest.$ac_ext <<_ACEOF
  4.2456 +#line $LINENO "configure"
  4.2457 +/* confdefs.h.  */
  4.2458 +_ACEOF
  4.2459 +cat confdefs.h >>conftest.$ac_ext
  4.2460 +cat >>conftest.$ac_ext <<_ACEOF
  4.2461 +/* end confdefs.h.  */
  4.2462 +#ifdef __STDC__
  4.2463 +# include <limits.h>
  4.2464 +#else
  4.2465 +# include <assert.h>
  4.2466 +#endif
  4.2467 +                     Syntax error
  4.2468 +_ACEOF
  4.2469 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  4.2470 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  4.2471 +  ac_status=$?
  4.2472 +  grep -v '^ *+' conftest.er1 >conftest.err
  4.2473 +  rm -f conftest.er1
  4.2474 +  cat conftest.err >&5
  4.2475 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2476 +  (exit $ac_status); } >/dev/null; then
  4.2477 +  if test -s conftest.err; then
  4.2478 +    ac_cpp_err=$ac_c_preproc_warn_flag
  4.2479 +  else
  4.2480 +    ac_cpp_err=
  4.2481 +  fi
  4.2482 +else
  4.2483 +  ac_cpp_err=yes
  4.2484 +fi
  4.2485 +if test -z "$ac_cpp_err"; then
  4.2486 +  :
  4.2487 +else
  4.2488 +  echo "$as_me: failed program was:" >&5
  4.2489 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2490 +
  4.2491 +  # Broken: fails on valid input.
  4.2492 +continue
  4.2493 +fi
  4.2494 +rm -f conftest.err conftest.$ac_ext
  4.2495 +
  4.2496 +  # OK, works on sane cases.  Now check whether non-existent headers
  4.2497 +  # can be detected and how.
  4.2498 +  cat >conftest.$ac_ext <<_ACEOF
  4.2499 +#line $LINENO "configure"
  4.2500 +/* confdefs.h.  */
  4.2501 +_ACEOF
  4.2502 +cat confdefs.h >>conftest.$ac_ext
  4.2503 +cat >>conftest.$ac_ext <<_ACEOF
  4.2504 +/* end confdefs.h.  */
  4.2505 +#include <ac_nonexistent.h>
  4.2506 +_ACEOF
  4.2507 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  4.2508 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  4.2509 +  ac_status=$?
  4.2510 +  grep -v '^ *+' conftest.er1 >conftest.err
  4.2511 +  rm -f conftest.er1
  4.2512 +  cat conftest.err >&5
  4.2513 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2514 +  (exit $ac_status); } >/dev/null; then
  4.2515 +  if test -s conftest.err; then
  4.2516 +    ac_cpp_err=$ac_c_preproc_warn_flag
  4.2517 +  else
  4.2518 +    ac_cpp_err=
  4.2519 +  fi
  4.2520 +else
  4.2521 +  ac_cpp_err=yes
  4.2522 +fi
  4.2523 +if test -z "$ac_cpp_err"; then
  4.2524 +  # Broken: success on invalid input.
  4.2525 +continue
  4.2526 +else
  4.2527 +  echo "$as_me: failed program was:" >&5
  4.2528 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2529 +
  4.2530 +  # Passes both tests.
  4.2531 +ac_preproc_ok=:
  4.2532 +break
  4.2533 +fi
  4.2534 +rm -f conftest.err conftest.$ac_ext
  4.2535 +
  4.2536 +done
  4.2537 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
  4.2538 +rm -f conftest.err conftest.$ac_ext
  4.2539 +if $ac_preproc_ok; then
  4.2540 +  :
  4.2541 +else
  4.2542 +  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
  4.2543 +See \`config.log' for more details." >&5
  4.2544 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
  4.2545 +See \`config.log' for more details." >&2;}
  4.2546 +   { (exit 1); exit 1; }; }
  4.2547 +fi
  4.2548 +
  4.2549 +ac_ext=c
  4.2550 +ac_cpp='$CPP $CPPFLAGS'
  4.2551 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
  4.2552 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
  4.2553 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
  4.2554 +
  4.2555 +
  4.2556 +echo "$as_me:$LINENO: checking for egrep" >&5
  4.2557 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6
  4.2558 +if test "${ac_cv_prog_egrep+set}" = set; then
  4.2559 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2560 +else
  4.2561 +  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
  4.2562 +    then ac_cv_prog_egrep='grep -E'
  4.2563 +    else ac_cv_prog_egrep='egrep'
  4.2564 +    fi
  4.2565 +fi
  4.2566 +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
  4.2567 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6
  4.2568 + EGREP=$ac_cv_prog_egrep
  4.2569 +
  4.2570 +
  4.2571 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5
  4.2572 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
  4.2573 +if test "${ac_cv_header_stdc+set}" = set; then
  4.2574 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2575 +else
  4.2576 +  cat >conftest.$ac_ext <<_ACEOF
  4.2577 +#line $LINENO "configure"
  4.2578 +/* confdefs.h.  */
  4.2579 +_ACEOF
  4.2580 +cat confdefs.h >>conftest.$ac_ext
  4.2581 +cat >>conftest.$ac_ext <<_ACEOF
  4.2582 +/* end confdefs.h.  */
  4.2583 +#include <stdlib.h>
  4.2584 +#include <stdarg.h>
  4.2585 +#include <string.h>
  4.2586 +#include <float.h>
  4.2587 +
  4.2588 +int
  4.2589 +main ()
  4.2590 +{
  4.2591 +
  4.2592 +  ;
  4.2593 +  return 0;
  4.2594 +}
  4.2595 +_ACEOF
  4.2596 +rm -f conftest.$ac_objext
  4.2597 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2598 +  (eval $ac_compile) 2>&5
  4.2599 +  ac_status=$?
  4.2600 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2601 +  (exit $ac_status); } &&
  4.2602 +         { ac_try='test -s conftest.$ac_objext'
  4.2603 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2604 +  (eval $ac_try) 2>&5
  4.2605 +  ac_status=$?
  4.2606 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2607 +  (exit $ac_status); }; }; then
  4.2608 +  ac_cv_header_stdc=yes
  4.2609 +else
  4.2610 +  echo "$as_me: failed program was:" >&5
  4.2611 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2612 +
  4.2613 +ac_cv_header_stdc=no
  4.2614 +fi
  4.2615 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2616 +
  4.2617 +if test $ac_cv_header_stdc = yes; then
  4.2618 +  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  4.2619 +  cat >conftest.$ac_ext <<_ACEOF
  4.2620 +#line $LINENO "configure"
  4.2621 +/* confdefs.h.  */
  4.2622 +_ACEOF
  4.2623 +cat confdefs.h >>conftest.$ac_ext
  4.2624 +cat >>conftest.$ac_ext <<_ACEOF
  4.2625 +/* end confdefs.h.  */
  4.2626 +#include <string.h>
  4.2627 +
  4.2628 +_ACEOF
  4.2629 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4.2630 +  $EGREP "memchr" >/dev/null 2>&1; then
  4.2631 +  :
  4.2632 +else
  4.2633 +  ac_cv_header_stdc=no
  4.2634 +fi
  4.2635 +rm -f conftest*
  4.2636 +
  4.2637 +fi
  4.2638 +
  4.2639 +if test $ac_cv_header_stdc = yes; then
  4.2640 +  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  4.2641 +  cat >conftest.$ac_ext <<_ACEOF
  4.2642 +#line $LINENO "configure"
  4.2643 +/* confdefs.h.  */
  4.2644 +_ACEOF
  4.2645 +cat confdefs.h >>conftest.$ac_ext
  4.2646 +cat >>conftest.$ac_ext <<_ACEOF
  4.2647 +/* end confdefs.h.  */
  4.2648 +#include <stdlib.h>
  4.2649 +
  4.2650 +_ACEOF
  4.2651 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4.2652 +  $EGREP "free" >/dev/null 2>&1; then
  4.2653 +  :
  4.2654 +else
  4.2655 +  ac_cv_header_stdc=no
  4.2656 +fi
  4.2657 +rm -f conftest*
  4.2658 +
  4.2659 +fi
  4.2660 +
  4.2661 +if test $ac_cv_header_stdc = yes; then
  4.2662 +  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  4.2663 +  if test "$cross_compiling" = yes; then
  4.2664 +  :
  4.2665 +else
  4.2666 +  cat >conftest.$ac_ext <<_ACEOF
  4.2667 +#line $LINENO "configure"
  4.2668 +/* confdefs.h.  */
  4.2669 +_ACEOF
  4.2670 +cat confdefs.h >>conftest.$ac_ext
  4.2671 +cat >>conftest.$ac_ext <<_ACEOF
  4.2672 +/* end confdefs.h.  */
  4.2673 +#include <ctype.h>
  4.2674 +#if ((' ' & 0x0FF) == 0x020)
  4.2675 +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  4.2676 +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  4.2677 +#else
  4.2678 +# define ISLOWER(c) \
  4.2679 +                   (('a' <= (c) && (c) <= 'i') \
  4.2680 +                     || ('j' <= (c) && (c) <= 'r') \
  4.2681 +                     || ('s' <= (c) && (c) <= 'z'))
  4.2682 +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
  4.2683 +#endif
  4.2684 +
  4.2685 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
  4.2686 +int
  4.2687 +main ()
  4.2688 +{
  4.2689 +  int i;
  4.2690 +  for (i = 0; i < 256; i++)
  4.2691 +    if (XOR (islower (i), ISLOWER (i))
  4.2692 +        || toupper (i) != TOUPPER (i))
  4.2693 +      exit(2);
  4.2694 +  exit (0);
  4.2695 +}
  4.2696 +_ACEOF
  4.2697 +rm -f conftest$ac_exeext
  4.2698 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  4.2699 +  (eval $ac_link) 2>&5
  4.2700 +  ac_status=$?
  4.2701 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2702 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  4.2703 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2704 +  (eval $ac_try) 2>&5
  4.2705 +  ac_status=$?
  4.2706 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2707 +  (exit $ac_status); }; }; then
  4.2708 +  :
  4.2709 +else
  4.2710 +  echo "$as_me: program exited with status $ac_status" >&5
  4.2711 +echo "$as_me: failed program was:" >&5
  4.2712 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2713 +
  4.2714 +( exit $ac_status )
  4.2715 +ac_cv_header_stdc=no
  4.2716 +fi
  4.2717 +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
  4.2718 +fi
  4.2719 +fi
  4.2720 +fi
  4.2721 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
  4.2722 +echo "${ECHO_T}$ac_cv_header_stdc" >&6
  4.2723 +if test $ac_cv_header_stdc = yes; then
  4.2724 +
  4.2725 +cat >>confdefs.h <<\_ACEOF
  4.2726 +#define STDC_HEADERS 1
  4.2727 +_ACEOF
  4.2728 +
  4.2729 +fi
  4.2730 +
  4.2731 +
  4.2732 +# On IRIX 5.3, sys/types and inttypes.h are conflicting.
  4.2733 +
  4.2734 +
  4.2735 +
  4.2736 +
  4.2737 +
  4.2738 +
  4.2739 +
  4.2740 +
  4.2741 +
  4.2742 +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
  4.2743 +                  inttypes.h stdint.h unistd.h
  4.2744 +do
  4.2745 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  4.2746 +echo "$as_me:$LINENO: checking for $ac_header" >&5
  4.2747 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  4.2748 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  4.2749 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2750 +else
  4.2751 +  cat >conftest.$ac_ext <<_ACEOF
  4.2752 +#line $LINENO "configure"
  4.2753 +/* confdefs.h.  */
  4.2754 +_ACEOF
  4.2755 +cat confdefs.h >>conftest.$ac_ext
  4.2756 +cat >>conftest.$ac_ext <<_ACEOF
  4.2757 +/* end confdefs.h.  */
  4.2758 +$ac_includes_default
  4.2759 +
  4.2760 +#include <$ac_header>
  4.2761 +_ACEOF
  4.2762 +rm -f conftest.$ac_objext
  4.2763 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2764 +  (eval $ac_compile) 2>&5
  4.2765 +  ac_status=$?
  4.2766 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2767 +  (exit $ac_status); } &&
  4.2768 +         { ac_try='test -s conftest.$ac_objext'
  4.2769 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2770 +  (eval $ac_try) 2>&5
  4.2771 +  ac_status=$?
  4.2772 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2773 +  (exit $ac_status); }; }; then
  4.2774 +  eval "$as_ac_Header=yes"
  4.2775 +else
  4.2776 +  echo "$as_me: failed program was:" >&5
  4.2777 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2778 +
  4.2779 +eval "$as_ac_Header=no"
  4.2780 +fi
  4.2781 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2782 +fi
  4.2783 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  4.2784 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  4.2785 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
  4.2786 +  cat >>confdefs.h <<_ACEOF
  4.2787 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
  4.2788 +_ACEOF
  4.2789 +
  4.2790 +fi
  4.2791 +
  4.2792 +done
  4.2793 +
  4.2794 +
  4.2795 +
  4.2796 +
  4.2797 +
  4.2798 +
  4.2799 +
  4.2800 +
  4.2801 +
  4.2802 +
  4.2803 +
  4.2804 +
  4.2805 +
  4.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
  4.2807 +do
  4.2808 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  4.2809 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  4.2810 +  echo "$as_me:$LINENO: checking for $ac_header" >&5
  4.2811 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  4.2812 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  4.2813 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2814 +fi
  4.2815 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  4.2816 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  4.2817 +else
  4.2818 +  # Is the header compilable?
  4.2819 +echo "$as_me:$LINENO: checking $ac_header usability" >&5
  4.2820 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
  4.2821 +cat >conftest.$ac_ext <<_ACEOF
  4.2822 +#line $LINENO "configure"
  4.2823 +/* confdefs.h.  */
  4.2824 +_ACEOF
  4.2825 +cat confdefs.h >>conftest.$ac_ext
  4.2826 +cat >>conftest.$ac_ext <<_ACEOF
  4.2827 +/* end confdefs.h.  */
  4.2828 +$ac_includes_default
  4.2829 +#include <$ac_header>
  4.2830 +_ACEOF
  4.2831 +rm -f conftest.$ac_objext
  4.2832 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2833 +  (eval $ac_compile) 2>&5
  4.2834 +  ac_status=$?
  4.2835 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2836 +  (exit $ac_status); } &&
  4.2837 +         { ac_try='test -s conftest.$ac_objext'
  4.2838 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2839 +  (eval $ac_try) 2>&5
  4.2840 +  ac_status=$?
  4.2841 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2842 +  (exit $ac_status); }; }; then
  4.2843 +  ac_header_compiler=yes
  4.2844 +else
  4.2845 +  echo "$as_me: failed program was:" >&5
  4.2846 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2847 +
  4.2848 +ac_header_compiler=no
  4.2849 +fi
  4.2850 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.2851 +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
  4.2852 +echo "${ECHO_T}$ac_header_compiler" >&6
  4.2853 +
  4.2854 +# Is the header present?
  4.2855 +echo "$as_me:$LINENO: checking $ac_header presence" >&5
  4.2856 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
  4.2857 +cat >conftest.$ac_ext <<_ACEOF
  4.2858 +#line $LINENO "configure"
  4.2859 +/* confdefs.h.  */
  4.2860 +_ACEOF
  4.2861 +cat confdefs.h >>conftest.$ac_ext
  4.2862 +cat >>conftest.$ac_ext <<_ACEOF
  4.2863 +/* end confdefs.h.  */
  4.2864 +#include <$ac_header>
  4.2865 +_ACEOF
  4.2866 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
  4.2867 +  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
  4.2868 +  ac_status=$?
  4.2869 +  grep -v '^ *+' conftest.er1 >conftest.err
  4.2870 +  rm -f conftest.er1
  4.2871 +  cat conftest.err >&5
  4.2872 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2873 +  (exit $ac_status); } >/dev/null; then
  4.2874 +  if test -s conftest.err; then
  4.2875 +    ac_cpp_err=$ac_c_preproc_warn_flag
  4.2876 +  else
  4.2877 +    ac_cpp_err=
  4.2878 +  fi
  4.2879 +else
  4.2880 +  ac_cpp_err=yes
  4.2881 +fi
  4.2882 +if test -z "$ac_cpp_err"; then
  4.2883 +  ac_header_preproc=yes
  4.2884 +else
  4.2885 +  echo "$as_me: failed program was:" >&5
  4.2886 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2887 +
  4.2888 +  ac_header_preproc=no
  4.2889 +fi
  4.2890 +rm -f conftest.err conftest.$ac_ext
  4.2891 +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
  4.2892 +echo "${ECHO_T}$ac_header_preproc" >&6
  4.2893 +
  4.2894 +# So?  What about this header?
  4.2895 +case $ac_header_compiler:$ac_header_preproc in
  4.2896 +  yes:no )
  4.2897 +    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
  4.2898 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
  4.2899 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
  4.2900 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
  4.2901 +    (
  4.2902 +      cat <<\_ASBOX
  4.2903 +## ------------------------------------ ##
  4.2904 +## Report this to bug-autoconf@gnu.org. ##
  4.2905 +## ------------------------------------ ##
  4.2906 +_ASBOX
  4.2907 +    ) |
  4.2908 +      sed "s/^/$as_me: WARNING:     /" >&2
  4.2909 +    ;;
  4.2910 +  no:yes )
  4.2911 +    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
  4.2912 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
  4.2913 +    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
  4.2914 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
  4.2915 +    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
  4.2916 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
  4.2917 +    (
  4.2918 +      cat <<\_ASBOX
  4.2919 +## ------------------------------------ ##
  4.2920 +## Report this to bug-autoconf@gnu.org. ##
  4.2921 +## ------------------------------------ ##
  4.2922 +_ASBOX
  4.2923 +    ) |
  4.2924 +      sed "s/^/$as_me: WARNING:     /" >&2
  4.2925 +    ;;
  4.2926 +esac
  4.2927 +echo "$as_me:$LINENO: checking for $ac_header" >&5
  4.2928 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
  4.2929 +if eval "test \"\${$as_ac_Header+set}\" = set"; then
  4.2930 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2931 +else
  4.2932 +  eval "$as_ac_Header=$ac_header_preproc"
  4.2933 +fi
  4.2934 +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
  4.2935 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
  4.2936 +
  4.2937 +fi
  4.2938 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
  4.2939 +  cat >>confdefs.h <<_ACEOF
  4.2940 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
  4.2941 +_ACEOF
  4.2942 +
  4.2943 +fi
  4.2944 +
  4.2945 +done
  4.2946 +
  4.2947 +
  4.2948 +echo "$as_me:$LINENO: checking whether strerror must be declared" >&5
  4.2949 +echo $ECHO_N "checking whether strerror must be declared... $ECHO_C" >&6
  4.2950 +if test "${bfd_cv_decl_needed_strerror+set}" = set; then
  4.2951 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.2952 +else
  4.2953 +  cat >conftest.$ac_ext <<_ACEOF
  4.2954 +#line $LINENO "configure"
  4.2955 +/* confdefs.h.  */
  4.2956 +_ACEOF
  4.2957 +cat confdefs.h >>conftest.$ac_ext
  4.2958 +cat >>conftest.$ac_ext <<_ACEOF
  4.2959 +/* end confdefs.h.  */
  4.2960 +
  4.2961 +#include <stdio.h>
  4.2962 +#ifdef HAVE_STRING_H
  4.2963 +#include <string.h>
  4.2964 +#else
  4.2965 +#ifdef HAVE_STRINGS_H
  4.2966 +#include <strings.h>
  4.2967 +#endif
  4.2968 +#endif
  4.2969 +#ifdef HAVE_STDLIB_H
  4.2970 +#include <stdlib.h>
  4.2971 +#endif
  4.2972 +#ifdef HAVE_UNISTD_H
  4.2973 +#include <unistd.h>
  4.2974 +#endif
  4.2975 +int
  4.2976 +main ()
  4.2977 +{
  4.2978 +char *(*pfn) = (char *(*)) strerror
  4.2979 +  ;
  4.2980 +  return 0;
  4.2981 +}
  4.2982 +_ACEOF
  4.2983 +rm -f conftest.$ac_objext
  4.2984 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.2985 +  (eval $ac_compile) 2>&5
  4.2986 +  ac_status=$?
  4.2987 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2988 +  (exit $ac_status); } &&
  4.2989 +         { ac_try='test -s conftest.$ac_objext'
  4.2990 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.2991 +  (eval $ac_try) 2>&5
  4.2992 +  ac_status=$?
  4.2993 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.2994 +  (exit $ac_status); }; }; then
  4.2995 +  bfd_cv_decl_needed_strerror=no
  4.2996 +else
  4.2997 +  echo "$as_me: failed program was:" >&5
  4.2998 +sed 's/^/| /' conftest.$ac_ext >&5
  4.2999 +
  4.3000 +bfd_cv_decl_needed_strerror=yes
  4.3001 +fi
  4.3002 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3003 +fi
  4.3004 +
  4.3005 +echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_strerror" >&5
  4.3006 +echo "${ECHO_T}$bfd_cv_decl_needed_strerror" >&6
  4.3007 +if test $bfd_cv_decl_needed_strerror = yes; then
  4.3008 +
  4.3009 +cat >>confdefs.h <<\_ACEOF
  4.3010 +#define NEED_DECLARATION_STRERROR 1
  4.3011 +_ACEOF
  4.3012 +
  4.3013 +fi
  4.3014 +
  4.3015 +
  4.3016 +. ${srcdir}/configure.srv
  4.3017 +
  4.3018 +if test "${srv_linux_usrregs}" = "yes"; then
  4.3019 +  cat >>confdefs.h <<\_ACEOF
  4.3020 +#define HAVE_LINUX_USRREGS 1
  4.3021 +_ACEOF
  4.3022 +
  4.3023 +fi
  4.3024 +
  4.3025 +if test "${srv_linux_regsets}" = "yes"; then
  4.3026 +  echo "$as_me:$LINENO: checking for PTRACE_GETREGS" >&5
  4.3027 +echo $ECHO_N "checking for PTRACE_GETREGS... $ECHO_C" >&6
  4.3028 +  if test "${gdbsrv_cv_have_ptrace_getregs+set}" = set; then
  4.3029 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3030 +else
  4.3031 +  cat >conftest.$ac_ext <<_ACEOF
  4.3032 +#line $LINENO "configure"
  4.3033 +/* confdefs.h.  */
  4.3034 +_ACEOF
  4.3035 +cat confdefs.h >>conftest.$ac_ext
  4.3036 +cat >>conftest.$ac_ext <<_ACEOF
  4.3037 +/* end confdefs.h.  */
  4.3038 +#include <sys/ptrace.h>
  4.3039 +int
  4.3040 +main ()
  4.3041 +{
  4.3042 +PTRACE_GETREGS;
  4.3043 +  ;
  4.3044 +  return 0;
  4.3045 +}
  4.3046 +_ACEOF
  4.3047 +rm -f conftest.$ac_objext
  4.3048 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3049 +  (eval $ac_compile) 2>&5
  4.3050 +  ac_status=$?
  4.3051 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3052 +  (exit $ac_status); } &&
  4.3053 +         { ac_try='test -s conftest.$ac_objext'
  4.3054 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3055 +  (eval $ac_try) 2>&5
  4.3056 +  ac_status=$?
  4.3057 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3058 +  (exit $ac_status); }; }; then
  4.3059 +  gdbsrv_cv_have_ptrace_getregs=yes
  4.3060 +else
  4.3061 +  echo "$as_me: failed program was:" >&5
  4.3062 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3063 +
  4.3064 +gdbsrv_cv_have_ptrace_getregs=no
  4.3065 +fi
  4.3066 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3067 +fi
  4.3068 +
  4.3069 +  echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getregs" >&5
  4.3070 +echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getregs" >&6
  4.3071 +  if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
  4.3072 +    cat >>confdefs.h <<\_ACEOF
  4.3073 +#define HAVE_LINUX_REGSETS 1
  4.3074 +_ACEOF
  4.3075 +
  4.3076 +  fi
  4.3077 +
  4.3078 +  echo "$as_me:$LINENO: checking for PTRACE_GETFPXREGS" >&5
  4.3079 +echo $ECHO_N "checking for PTRACE_GETFPXREGS... $ECHO_C" >&6
  4.3080 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs+set}" = set; then
  4.3081 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3082 +else
  4.3083 +  cat >conftest.$ac_ext <<_ACEOF
  4.3084 +#line $LINENO "configure"
  4.3085 +/* confdefs.h.  */
  4.3086 +_ACEOF
  4.3087 +cat confdefs.h >>conftest.$ac_ext
  4.3088 +cat >>conftest.$ac_ext <<_ACEOF
  4.3089 +/* end confdefs.h.  */
  4.3090 +#include <sys/ptrace.h>
  4.3091 +int
  4.3092 +main ()
  4.3093 +{
  4.3094 +PTRACE_GETFPXREGS;
  4.3095 +  ;
  4.3096 +  return 0;
  4.3097 +}
  4.3098 +_ACEOF
  4.3099 +rm -f conftest.$ac_objext
  4.3100 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3101 +  (eval $ac_compile) 2>&5
  4.3102 +  ac_status=$?
  4.3103 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3104 +  (exit $ac_status); } &&
  4.3105 +         { ac_try='test -s conftest.$ac_objext'
  4.3106 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3107 +  (eval $ac_try) 2>&5
  4.3108 +  ac_status=$?
  4.3109 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3110 +  (exit $ac_status); }; }; then
  4.3111 +  gdbsrv_cv_have_ptrace_getfpxregs=yes
  4.3112 +else
  4.3113 +  echo "$as_me: failed program was:" >&5
  4.3114 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3115 +
  4.3116 +gdbsrv_cv_have_ptrace_getfpxregs=no
  4.3117 +fi
  4.3118 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3119 +fi
  4.3120 +
  4.3121 +  echo "$as_me:$LINENO: result: $gdbsrv_cv_have_ptrace_getfpxregs" >&5
  4.3122 +echo "${ECHO_T}$gdbsrv_cv_have_ptrace_getfpxregs" >&6
  4.3123 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
  4.3124 +    cat >>confdefs.h <<\_ACEOF
  4.3125 +#define HAVE_PTRACE_GETFPXREGS 1
  4.3126 +_ACEOF
  4.3127 +
  4.3128 +  fi
  4.3129 +fi
  4.3130 +
  4.3131 +if test "$ac_cv_header_sys_procfs_h" = yes; then
  4.3132 +  echo "$as_me:$LINENO: checking for lwpid_t in sys/procfs.h" >&5
  4.3133 +echo $ECHO_N "checking for lwpid_t in sys/procfs.h... $ECHO_C" >&6
  4.3134 + if test "${bfd_cv_have_sys_procfs_type_lwpid_t+set}" = set; then
  4.3135 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3136 +else
  4.3137 +  cat >conftest.$ac_ext <<_ACEOF
  4.3138 +#line $LINENO "configure"
  4.3139 +/* confdefs.h.  */
  4.3140 +_ACEOF
  4.3141 +cat confdefs.h >>conftest.$ac_ext
  4.3142 +cat >>conftest.$ac_ext <<_ACEOF
  4.3143 +/* end confdefs.h.  */
  4.3144 +
  4.3145 +#define _SYSCALL32
  4.3146 +#include <sys/procfs.h>
  4.3147 +int
  4.3148 +main ()
  4.3149 +{
  4.3150 +lwpid_t avar
  4.3151 +  ;
  4.3152 +  return 0;
  4.3153 +}
  4.3154 +_ACEOF
  4.3155 +rm -f conftest.$ac_objext
  4.3156 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3157 +  (eval $ac_compile) 2>&5
  4.3158 +  ac_status=$?
  4.3159 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3160 +  (exit $ac_status); } &&
  4.3161 +         { ac_try='test -s conftest.$ac_objext'
  4.3162 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3163 +  (eval $ac_try) 2>&5
  4.3164 +  ac_status=$?
  4.3165 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3166 +  (exit $ac_status); }; }; then
  4.3167 +  bfd_cv_have_sys_procfs_type_lwpid_t=yes
  4.3168 +else
  4.3169 +  echo "$as_me: failed program was:" >&5
  4.3170 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3171 +
  4.3172 +bfd_cv_have_sys_procfs_type_lwpid_t=no
  4.3173 +
  4.3174 +fi
  4.3175 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3176 +fi
  4.3177 +
  4.3178 + if test $bfd_cv_have_sys_procfs_type_lwpid_t = yes; then
  4.3179 +
  4.3180 +cat >>confdefs.h <<\_ACEOF
  4.3181 +#define HAVE_LWPID_T 1
  4.3182 +_ACEOF
  4.3183 +
  4.3184 + fi
  4.3185 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_lwpid_t" >&5
  4.3186 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_lwpid_t" >&6
  4.3187 +
  4.3188 +  echo "$as_me:$LINENO: checking for psaddr_t in sys/procfs.h" >&5
  4.3189 +echo $ECHO_N "checking for psaddr_t in sys/procfs.h... $ECHO_C" >&6
  4.3190 + if test "${bfd_cv_have_sys_procfs_type_psaddr_t+set}" = set; then
  4.3191 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3192 +else
  4.3193 +  cat >conftest.$ac_ext <<_ACEOF
  4.3194 +#line $LINENO "configure"
  4.3195 +/* confdefs.h.  */
  4.3196 +_ACEOF
  4.3197 +cat confdefs.h >>conftest.$ac_ext
  4.3198 +cat >>conftest.$ac_ext <<_ACEOF
  4.3199 +/* end confdefs.h.  */
  4.3200 +
  4.3201 +#define _SYSCALL32
  4.3202 +#include <sys/procfs.h>
  4.3203 +int
  4.3204 +main ()
  4.3205 +{
  4.3206 +psaddr_t avar
  4.3207 +  ;
  4.3208 +  return 0;
  4.3209 +}
  4.3210 +_ACEOF
  4.3211 +rm -f conftest.$ac_objext
  4.3212 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3213 +  (eval $ac_compile) 2>&5
  4.3214 +  ac_status=$?
  4.3215 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3216 +  (exit $ac_status); } &&
  4.3217 +         { ac_try='test -s conftest.$ac_objext'
  4.3218 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3219 +  (eval $ac_try) 2>&5
  4.3220 +  ac_status=$?
  4.3221 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3222 +  (exit $ac_status); }; }; then
  4.3223 +  bfd_cv_have_sys_procfs_type_psaddr_t=yes
  4.3224 +else
  4.3225 +  echo "$as_me: failed program was:" >&5
  4.3226 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3227 +
  4.3228 +bfd_cv_have_sys_procfs_type_psaddr_t=no
  4.3229 +
  4.3230 +fi
  4.3231 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3232 +fi
  4.3233 +
  4.3234 + if test $bfd_cv_have_sys_procfs_type_psaddr_t = yes; then
  4.3235 +
  4.3236 +cat >>confdefs.h <<\_ACEOF
  4.3237 +#define HAVE_PSADDR_T 1
  4.3238 +_ACEOF
  4.3239 +
  4.3240 + fi
  4.3241 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_psaddr_t" >&5
  4.3242 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_psaddr_t" >&6
  4.3243 +
  4.3244 +  echo "$as_me:$LINENO: checking for prgregset_t in sys/procfs.h" >&5
  4.3245 +echo $ECHO_N "checking for prgregset_t in sys/procfs.h... $ECHO_C" >&6
  4.3246 + if test "${bfd_cv_have_sys_procfs_type_prgregset_t+set}" = set; then
  4.3247 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3248 +else
  4.3249 +  cat >conftest.$ac_ext <<_ACEOF
  4.3250 +#line $LINENO "configure"
  4.3251 +/* confdefs.h.  */
  4.3252 +_ACEOF
  4.3253 +cat confdefs.h >>conftest.$ac_ext
  4.3254 +cat >>conftest.$ac_ext <<_ACEOF
  4.3255 +/* end confdefs.h.  */
  4.3256 +
  4.3257 +#define _SYSCALL32
  4.3258 +#include <sys/procfs.h>
  4.3259 +int
  4.3260 +main ()
  4.3261 +{
  4.3262 +prgregset_t avar
  4.3263 +  ;
  4.3264 +  return 0;
  4.3265 +}
  4.3266 +_ACEOF
  4.3267 +rm -f conftest.$ac_objext
  4.3268 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3269 +  (eval $ac_compile) 2>&5
  4.3270 +  ac_status=$?
  4.3271 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3272 +  (exit $ac_status); } &&
  4.3273 +         { ac_try='test -s conftest.$ac_objext'
  4.3274 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3275 +  (eval $ac_try) 2>&5
  4.3276 +  ac_status=$?
  4.3277 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3278 +  (exit $ac_status); }; }; then
  4.3279 +  bfd_cv_have_sys_procfs_type_prgregset_t=yes
  4.3280 +else
  4.3281 +  echo "$as_me: failed program was:" >&5
  4.3282 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3283 +
  4.3284 +bfd_cv_have_sys_procfs_type_prgregset_t=no
  4.3285 +
  4.3286 +fi
  4.3287 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3288 +fi
  4.3289 +
  4.3290 + if test $bfd_cv_have_sys_procfs_type_prgregset_t = yes; then
  4.3291 +
  4.3292 +cat >>confdefs.h <<\_ACEOF
  4.3293 +#define HAVE_PRGREGSET_T 1
  4.3294 +_ACEOF
  4.3295 +
  4.3296 + fi
  4.3297 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prgregset_t" >&5
  4.3298 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prgregset_t" >&6
  4.3299 +
  4.3300 +  echo "$as_me:$LINENO: checking for prfpregset_t in sys/procfs.h" >&5
  4.3301 +echo $ECHO_N "checking for prfpregset_t in sys/procfs.h... $ECHO_C" >&6
  4.3302 + if test "${bfd_cv_have_sys_procfs_type_prfpregset_t+set}" = set; then
  4.3303 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3304 +else
  4.3305 +  cat >conftest.$ac_ext <<_ACEOF
  4.3306 +#line $LINENO "configure"
  4.3307 +/* confdefs.h.  */
  4.3308 +_ACEOF
  4.3309 +cat confdefs.h >>conftest.$ac_ext
  4.3310 +cat >>conftest.$ac_ext <<_ACEOF
  4.3311 +/* end confdefs.h.  */
  4.3312 +
  4.3313 +#define _SYSCALL32
  4.3314 +#include <sys/procfs.h>
  4.3315 +int
  4.3316 +main ()
  4.3317 +{
  4.3318 +prfpregset_t avar
  4.3319 +  ;
  4.3320 +  return 0;
  4.3321 +}
  4.3322 +_ACEOF
  4.3323 +rm -f conftest.$ac_objext
  4.3324 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3325 +  (eval $ac_compile) 2>&5
  4.3326 +  ac_status=$?
  4.3327 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3328 +  (exit $ac_status); } &&
  4.3329 +         { ac_try='test -s conftest.$ac_objext'
  4.3330 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3331 +  (eval $ac_try) 2>&5
  4.3332 +  ac_status=$?
  4.3333 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3334 +  (exit $ac_status); }; }; then
  4.3335 +  bfd_cv_have_sys_procfs_type_prfpregset_t=yes
  4.3336 +else
  4.3337 +  echo "$as_me: failed program was:" >&5
  4.3338 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3339 +
  4.3340 +bfd_cv_have_sys_procfs_type_prfpregset_t=no
  4.3341 +
  4.3342 +fi
  4.3343 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3344 +fi
  4.3345 +
  4.3346 + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
  4.3347 +
  4.3348 +cat >>confdefs.h <<\_ACEOF
  4.3349 +#define HAVE_PRFPREGSET_T 1
  4.3350 +_ACEOF
  4.3351 +
  4.3352 + fi
  4.3353 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_prfpregset_t" >&5
  4.3354 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_prfpregset_t" >&6
  4.3355 +
  4.3356 +
  4.3357 +
  4.3358 +
  4.3359 +  if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
  4.3360 +    echo "$as_me:$LINENO: checking whether prfpregset_t type is broken" >&5
  4.3361 +echo $ECHO_N "checking whether prfpregset_t type is broken... $ECHO_C" >&6
  4.3362 +    if test "${gdb_cv_prfpregset_t_broken+set}" = set; then
  4.3363 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3364 +else
  4.3365 +  if test "$cross_compiling" = yes; then
  4.3366 +  gdb_cv_prfpregset_t_broken=yes
  4.3367 +else
  4.3368 +  cat >conftest.$ac_ext <<_ACEOF
  4.3369 +#line $LINENO "configure"
  4.3370 +/* confdefs.h.  */
  4.3371 +_ACEOF
  4.3372 +cat confdefs.h >>conftest.$ac_ext
  4.3373 +cat >>conftest.$ac_ext <<_ACEOF
  4.3374 +/* end confdefs.h.  */
  4.3375 +#include <sys/procfs.h>
  4.3376 +       int main ()
  4.3377 +       {
  4.3378 +         if (sizeof (prfpregset_t) == sizeof (void *))
  4.3379 +           return 1;
  4.3380 +         return 0;
  4.3381 +       }
  4.3382 +_ACEOF
  4.3383 +rm -f conftest$ac_exeext
  4.3384 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
  4.3385 +  (eval $ac_link) 2>&5
  4.3386 +  ac_status=$?
  4.3387 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3388 +  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
  4.3389 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3390 +  (eval $ac_try) 2>&5
  4.3391 +  ac_status=$?
  4.3392 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3393 +  (exit $ac_status); }; }; then
  4.3394 +  gdb_cv_prfpregset_t_broken=no
  4.3395 +else
  4.3396 +  echo "$as_me: program exited with status $ac_status" >&5
  4.3397 +echo "$as_me: failed program was:" >&5
  4.3398 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3399 +
  4.3400 +( exit $ac_status )
  4.3401 +gdb_cv_prfpregset_t_broken=yes
  4.3402 +fi
  4.3403 +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
  4.3404 +fi
  4.3405 +fi
  4.3406 +
  4.3407 +    echo "$as_me:$LINENO: result: $gdb_cv_prfpregset_t_broken" >&5
  4.3408 +echo "${ECHO_T}$gdb_cv_prfpregset_t_broken" >&6
  4.3409 +    if test $gdb_cv_prfpregset_t_broken = yes; then
  4.3410 +      cat >>confdefs.h <<\_ACEOF
  4.3411 +#define PRFPREGSET_T_BROKEN 1
  4.3412 +_ACEOF
  4.3413 +
  4.3414 +    fi
  4.3415 +  fi
  4.3416 +
  4.3417 +  echo "$as_me:$LINENO: checking for elf_fpregset_t in sys/procfs.h" >&5
  4.3418 +echo $ECHO_N "checking for elf_fpregset_t in sys/procfs.h... $ECHO_C" >&6
  4.3419 + if test "${bfd_cv_have_sys_procfs_type_elf_fpregset_t+set}" = set; then
  4.3420 +  echo $ECHO_N "(cached) $ECHO_C" >&6
  4.3421 +else
  4.3422 +  cat >conftest.$ac_ext <<_ACEOF
  4.3423 +#line $LINENO "configure"
  4.3424 +/* confdefs.h.  */
  4.3425 +_ACEOF
  4.3426 +cat confdefs.h >>conftest.$ac_ext
  4.3427 +cat >>conftest.$ac_ext <<_ACEOF
  4.3428 +/* end confdefs.h.  */
  4.3429 +
  4.3430 +#define _SYSCALL32
  4.3431 +#include <sys/procfs.h>
  4.3432 +int
  4.3433 +main ()
  4.3434 +{
  4.3435 +elf_fpregset_t avar
  4.3436 +  ;
  4.3437 +  return 0;
  4.3438 +}
  4.3439 +_ACEOF
  4.3440 +rm -f conftest.$ac_objext
  4.3441 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
  4.3442 +  (eval $ac_compile) 2>&5
  4.3443 +  ac_status=$?
  4.3444 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3445 +  (exit $ac_status); } &&
  4.3446 +         { ac_try='test -s conftest.$ac_objext'
  4.3447 +  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
  4.3448 +  (eval $ac_try) 2>&5
  4.3449 +  ac_status=$?
  4.3450 +  echo "$as_me:$LINENO: \$? = $ac_status" >&5
  4.3451 +  (exit $ac_status); }; }; then
  4.3452 +  bfd_cv_have_sys_procfs_type_elf_fpregset_t=yes
  4.3453 +else
  4.3454 +  echo "$as_me: failed program was:" >&5
  4.3455 +sed 's/^/| /' conftest.$ac_ext >&5
  4.3456 +
  4.3457 +bfd_cv_have_sys_procfs_type_elf_fpregset_t=no
  4.3458 +
  4.3459 +fi
  4.3460 +rm -f conftest.$ac_objext conftest.$ac_ext
  4.3461 +fi
  4.3462 +
  4.3463 + if test $bfd_cv_have_sys_procfs_type_elf_fpregset_t = yes; then
  4.3464 +
  4.3465 +cat >>confdefs.h <<\_ACEOF
  4.3466 +#define HAVE_ELF_FPREGSET_T 1
  4.3467 +_ACEOF
  4.3468 +
  4.3469 + fi
  4.3470 + echo "$as_me:$LINENO: result: $bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&5
  4.3471 +echo "${ECHO_T}$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6
  4.3472 +
  4.3473 +fi
  4.3474 +
  4.3475 +srv_thread_depfiles=
  4.3476 +srv_libs=
  4.3477 +USE_THREAD_DB=
  4.3478 +
  4.3479 +
  4.3480 +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
  4.3481 +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc"
  4.3482 +
  4.3483 +
  4.3484 +
  4.3485 +
  4.3486 +
  4.3487 +          ac_config_files="$ac_config_files Makefile"
  4.3488 +          ac_config_commands="$ac_config_commands default"
  4.3489 +cat >confcache <<\_ACEOF
  4.3490 +# This file is a shell script that caches the results of configure
  4.3491 +# tests run on this system so they can be shared between configure
  4.3492 +# scripts and configure runs, see configure's option --config-cache.
  4.3493 +# It is not useful on other systems.  If it contains results you don't
  4.3494 +# want to keep, you may remove or edit it.
  4.3495 +#
  4.3496 +# config.status only pays attention to the cache file if you give it
  4.3497 +# the --recheck option to rerun configure.
  4.3498 +#
  4.3499 +# `ac_cv_env_foo' variables (set or unset) will be overridden when
  4.3500 +# loading this file, other *unset* `ac_cv_foo' will be assigned the
  4.3501 +# following values.
  4.3502 +
  4.3503 +_ACEOF
  4.3504 +
  4.3505 +# The following way of writing the cache mishandles newlines in values,
  4.3506 +# but we know of no workaround that is simple, portable, and efficient.
  4.3507 +# So, don't put newlines in cache variables' values.
  4.3508 +# Ultrix sh set writes to stderr and can't be redirected directly,
  4.3509 +# and sets the high bit in the cache file unless we assign to the vars.
  4.3510 +{
  4.3511 +  (set) 2>&1 |
  4.3512 +    case `(ac_space=' '; set | grep ac_space) 2>&1` in
  4.3513 +    *ac_space=\ *)
  4.3514 +      # `set' does not quote correctly, so add quotes (double-quote
  4.3515 +      # substitution turns \\\\ into \\, and sed turns \\ into \).
  4.3516 +      sed -n \
  4.3517 +        "s/'/'\\\\''/g;
  4.3518 +    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
  4.3519 +      ;;
  4.3520 +    *)
  4.3521 +      # `set' quotes correctly as required by POSIX, so do not add quotes.
  4.3522 +      sed -n \
  4.3523 +        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
  4.3524 +      ;;
  4.3525 +    esac;
  4.3526 +} |
  4.3527 +  sed '
  4.3528 +     t clear
  4.3529 +     : clear
  4.3530 +     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
  4.3531 +     t end
  4.3532 +     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
  4.3533 +     : end' >>confcache
  4.3534 +if diff $cache_file confcache >/dev/null 2>&1; then :; else
  4.3535 +  if test -w $cache_file; then
  4.3536 +    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
  4.3537 +    cat confcache >$cache_file
  4.3538 +  else
  4.3539 +    echo "not updating unwritable cache $cache_file"
  4.3540 +  fi
  4.3541 +fi
  4.3542 +rm -f confcache
  4.3543 +
  4.3544 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
  4.3545 +# Let make expand exec_prefix.
  4.3546 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  4.3547 +
  4.3548 +# VPATH may cause trouble with some makes, so we remove $(srcdir),
  4.3549 +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
  4.3550 +# trailing colons and then remove the whole line if VPATH becomes empty
  4.3551 +# (actually we leave an empty line to preserve line numbers).
  4.3552 +if test "x$srcdir" = x.; then
  4.3553 +  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
  4.3554 +s/:*\$(srcdir):*/:/;
  4.3555 +s/:*\${srcdir}:*/:/;
  4.3556 +s/:*@srcdir@:*/:/;
  4.3557 +s/^\([^=]*=[ 	]*\):*/\1/;
  4.3558 +s/:*$//;
  4.3559 +s/^[^=]*=[ 	]*$//;
  4.3560 +}'
  4.3561 +fi
  4.3562 +
  4.3563 +DEFS=-DHAVE_CONFIG_H
  4.3564 +
  4.3565 +ac_libobjs=
  4.3566 +ac_ltlibobjs=
  4.3567 +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
  4.3568 +  # 1. Remove the extension, and $U if already installed.
  4.3569 +  ac_i=`echo "$ac_i" |
  4.3570 +         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
  4.3571 +  # 2. Add them.
  4.3572 +  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
  4.3573 +  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
  4.3574 +done
  4.3575 +LIBOBJS=$ac_libobjs
  4.3576 +
  4.3577 +LTLIBOBJS=$ac_ltlibobjs
  4.3578 +
  4.3579 +
  4.3580 +
  4.3581 +: ${CONFIG_STATUS=./config.status}
  4.3582 +ac_clean_files_save=$ac_clean_files
  4.3583 +ac_clean_files="$ac_clean_files $CONFIG_STATUS"
  4.3584 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
  4.3585 +echo "$as_me: creating $CONFIG_STATUS" >&6;}
  4.3586 +cat >$CONFIG_STATUS <<_ACEOF
  4.3587 +#! $SHELL
  4.3588 +# Generated by $as_me.
  4.3589 +# Run this file to recreate the current configuration.
  4.3590 +# Compiler output produced by configure, useful for debugging
  4.3591 +# configure, is in config.log if it exists.
  4.3592 +
  4.3593 +debug=false
  4.3594 +ac_cs_recheck=false
  4.3595 +ac_cs_silent=false
  4.3596 +SHELL=\${CONFIG_SHELL-$SHELL}
  4.3597 +_ACEOF
  4.3598 +
  4.3599 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.3600 +## --------------------- ##
  4.3601 +## M4sh Initialization.  ##
  4.3602 +## --------------------- ##
  4.3603 +
  4.3604 +# Be Bourne compatible
  4.3605 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  4.3606 +  emulate sh
  4.3607 +  NULLCMD=:
  4.3608 +  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  4.3609 +  # is contrary to our usage.  Disable this feature.
  4.3610 +  alias -g '${1+"$@"}'='"$@"'
  4.3611 +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
  4.3612 +  set -o posix
  4.3613 +fi
  4.3614 +
  4.3615 +# Support unset when possible.
  4.3616 +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
  4.3617 +  as_unset=unset
  4.3618 +else
  4.3619 +  as_unset=false
  4.3620 +fi
  4.3621 +
  4.3622 +
  4.3623 +# Work around bugs in pre-3.0 UWIN ksh.
  4.3624 +$as_unset ENV MAIL MAILPATH
  4.3625 +PS1='$ '
  4.3626 +PS2='> '
  4.3627 +PS4='+ '
  4.3628 +
  4.3629 +# NLS nuisances.
  4.3630 +for as_var in \
  4.3631 +  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
  4.3632 +  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
  4.3633 +  LC_TELEPHONE LC_TIME
  4.3634 +do
  4.3635 +  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
  4.3636 +    eval $as_var=C; export $as_var
  4.3637 +  else
  4.3638 +    $as_unset $as_var
  4.3639 +  fi
  4.3640 +done
  4.3641 +
  4.3642 +# Required to use basename.
  4.3643 +if expr a : '\(a\)' >/dev/null 2>&1; then
  4.3644 +  as_expr=expr
  4.3645 +else
  4.3646 +  as_expr=false
  4.3647 +fi
  4.3648 +
  4.3649 +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
  4.3650 +  as_basename=basename
  4.3651 +else
  4.3652 +  as_basename=false
  4.3653 +fi
  4.3654 +
  4.3655 +
  4.3656 +# Name of the executable.
  4.3657 +as_me=`$as_basename "$0" ||
  4.3658 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
  4.3659 +	 X"$0" : 'X\(//\)$' \| \
  4.3660 +	 X"$0" : 'X\(/\)$' \| \
  4.3661 +	 .     : '\(.\)' 2>/dev/null ||
  4.3662 +echo X/"$0" |
  4.3663 +    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
  4.3664 +  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
  4.3665 +  	  /^X\/\(\/\).*/{ s//\1/; q; }
  4.3666 +  	  s/.*/./; q'`
  4.3667 +
  4.3668 +
  4.3669 +# PATH needs CR, and LINENO needs CR and PATH.
  4.3670 +# Avoid depending upon Character Ranges.
  4.3671 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
  4.3672 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  4.3673 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
  4.3674 +as_cr_digits='0123456789'
  4.3675 +as_cr_alnum=$as_cr_Letters$as_cr_digits
  4.3676 +
  4.3677 +# The user is always right.
  4.3678 +if test "${PATH_SEPARATOR+set}" != set; then
  4.3679 +  echo "#! /bin/sh" >conf$$.sh
  4.3680 +  echo  "exit 0"   >>conf$$.sh
  4.3681 +  chmod +x conf$$.sh
  4.3682 +  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
  4.3683 +    PATH_SEPARATOR=';'
  4.3684 +  else
  4.3685 +    PATH_SEPARATOR=:
  4.3686 +  fi
  4.3687 +  rm -f conf$$.sh
  4.3688 +fi
  4.3689 +
  4.3690 +
  4.3691 +  as_lineno_1=$LINENO
  4.3692 +  as_lineno_2=$LINENO
  4.3693 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  4.3694 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  4.3695 +  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
  4.3696 +  # Find who we are.  Look in the path if we contain no path at all
  4.3697 +  # relative or not.
  4.3698 +  case $0 in
  4.3699 +    *[\\/]* ) as_myself=$0 ;;
  4.3700 +    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.3701 +for as_dir in $PATH
  4.3702 +do
  4.3703 +  IFS=$as_save_IFS
  4.3704 +  test -z "$as_dir" && as_dir=.
  4.3705 +  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
  4.3706 +done
  4.3707 +
  4.3708 +       ;;
  4.3709 +  esac
  4.3710 +  # We did not find ourselves, most probably we were run as `sh COMMAND'
  4.3711 +  # in which case we are not to be found in the path.
  4.3712 +  if test "x$as_myself" = x; then
  4.3713 +    as_myself=$0
  4.3714 +  fi
  4.3715 +  if test ! -f "$as_myself"; then
  4.3716 +    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
  4.3717 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
  4.3718 +   { (exit 1); exit 1; }; }
  4.3719 +  fi
  4.3720 +  case $CONFIG_SHELL in
  4.3721 +  '')
  4.3722 +    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  4.3723 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
  4.3724 +do
  4.3725 +  IFS=$as_save_IFS
  4.3726 +  test -z "$as_dir" && as_dir=.
  4.3727 +  for as_base in sh bash ksh sh5; do
  4.3728 +	 case $as_dir in
  4.3729 +	 /*)
  4.3730 +	   if ("$as_dir/$as_base" -c '
  4.3731 +  as_lineno_1=$LINENO
  4.3732 +  as_lineno_2=$LINENO
  4.3733 +  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
  4.3734 +  test "x$as_lineno_1" != "x$as_lineno_2" &&
  4.3735 +  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
  4.3736 +	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
  4.3737 +	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
  4.3738 +	     CONFIG_SHELL=$as_dir/$as_base
  4.3739 +	     export CONFIG_SHELL
  4.3740 +	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
  4.3741 +	   fi;;
  4.3742 +	 esac
  4.3743 +       done
  4.3744 +done
  4.3745 +;;
  4.3746 +  esac
  4.3747 +
  4.3748 +  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
  4.3749 +  # uniformly replaced by the line number.  The first 'sed' inserts a
  4.3750 +  # line-number line before each line; the second 'sed' does the real
  4.3751 +  # work.  The second script uses 'N' to pair each line-number line
  4.3752 +  # with the numbered line, and appends trailing '-' during
  4.3753 +  # substitution so that $LINENO is not a special case at line end.
  4.3754 +  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
  4.3755 +  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
  4.3756 +  sed '=' <$as_myself |
  4.3757 +    sed '
  4.3758 +      N
  4.3759 +      s,$,-,
  4.3760 +      : loop
  4.3761 +      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
  4.3762 +      t loop
  4.3763 +      s,-$,,
  4.3764 +      s,^['$as_cr_digits']*\n,,
  4.3765 +    ' >$as_me.lineno &&
  4.3766 +  chmod +x $as_me.lineno ||
  4.3767 +    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
  4.3768 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
  4.3769 +   { (exit 1); exit 1; }; }
  4.3770 +
  4.3771 +  # Don't try to exec as it changes $[0], causing all sort of problems
  4.3772 +  # (the dirname of $[0] is not the place where we might find the
  4.3773 +  # original and so on.  Autoconf is especially sensible to this).
  4.3774 +  . ./$as_me.lineno
  4.3775 +  # Exit status is that of the last command.
  4.3776 +  exit
  4.3777 +}
  4.3778 +
  4.3779 +
  4.3780 +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
  4.3781 +  *c*,-n*) ECHO_N= ECHO_C='
  4.3782 +' ECHO_T='	' ;;
  4.3783 +  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
  4.3784 +  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
  4.3785 +esac
  4.3786 +
  4.3787 +if expr a : '\(a\)' >/dev/null 2>&1; then
  4.3788 +  as_expr=expr
  4.3789 +else
  4.3790 +  as_expr=false
  4.3791 +fi
  4.3792 +
  4.3793 +rm -f conf$$ conf$$.exe conf$$.file
  4.3794 +echo >conf$$.file
  4.3795 +if ln -s conf$$.file conf$$ 2>/dev/null; then
  4.3796 +  # We could just check for DJGPP; but this test a) works b) is more generic
  4.3797 +  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
  4.3798 +  if test -f conf$$.exe; then
  4.3799 +    # Don't use ln at all; we don't have any links
  4.3800 +    as_ln_s='cp -p'
  4.3801 +  else
  4.3802 +    as_ln_s='ln -s'
  4.3803 +  fi
  4.3804 +elif ln conf$$.file conf$$ 2>/dev/null; then
  4.3805 +  as_ln_s=ln
  4.3806 +else
  4.3807 +  as_ln_s='cp -p'
  4.3808 +fi
  4.3809 +rm -f conf$$ conf$$.exe conf$$.file
  4.3810 +
  4.3811 +if mkdir -p . 2>/dev/null; then
  4.3812 +  as_mkdir_p=:
  4.3813 +else
  4.3814 +  as_mkdir_p=false
  4.3815 +fi
  4.3816 +
  4.3817 +as_executable_p="test -f"
  4.3818 +
  4.3819 +# Sed expression to map a string onto a valid CPP name.
  4.3820 +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
  4.3821 +
  4.3822 +# Sed expression to map a string onto a valid variable name.
  4.3823 +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
  4.3824 +
  4.3825 +
  4.3826 +# IFS
  4.3827 +# We need space, tab and new line, in precisely that order.
  4.3828 +as_nl='
  4.3829 +'
  4.3830 +IFS=" 	$as_nl"
  4.3831 +
  4.3832 +# CDPATH.
  4.3833 +$as_unset CDPATH
  4.3834 +
  4.3835 +exec 6>&1
  4.3836 +
  4.3837 +# Open the log real soon, to keep \$[0] and so on meaningful, and to
  4.3838 +# report actual input values of CONFIG_FILES etc. instead of their
  4.3839 +# values after options handling.  Logging --version etc. is OK.
  4.3840 +exec 5>>config.log
  4.3841 +{
  4.3842 +  echo
  4.3843 +  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
  4.3844 +## Running $as_me. ##
  4.3845 +_ASBOX
  4.3846 +} >&5
  4.3847 +cat >&5 <<_CSEOF
  4.3848 +
  4.3849 +This file was extended by $as_me, which was
  4.3850 +generated by GNU Autoconf 2.57.  Invocation command line was
  4.3851 +
  4.3852 +  CONFIG_FILES    = $CONFIG_FILES
  4.3853 +  CONFIG_HEADERS  = $CONFIG_HEADERS
  4.3854 +  CONFIG_LINKS    = $CONFIG_LINKS
  4.3855 +  CONFIG_COMMANDS = $CONFIG_COMMANDS
  4.3856 +  $ $0 $@
  4.3857 +
  4.3858 +_CSEOF
  4.3859 +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
  4.3860 +echo >&5
  4.3861 +_ACEOF
  4.3862 +
  4.3863 +# Files that config.status was made for.
  4.3864 +if test -n "$ac_config_files"; then
  4.3865 +  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
  4.3866 +fi
  4.3867 +
  4.3868 +if test -n "$ac_config_headers"; then
  4.3869 +  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
  4.3870 +fi
  4.3871 +
  4.3872 +if test -n "$ac_config_links"; then
  4.3873 +  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
  4.3874 +fi
  4.3875 +
  4.3876 +if test -n "$ac_config_commands"; then
  4.3877 +  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
  4.3878 +fi
  4.3879 +
  4.3880 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.3881 +
  4.3882 +ac_cs_usage="\
  4.3883 +\`$as_me' instantiates files from templates according to the
  4.3884 +current configuration.
  4.3885 +
  4.3886 +Usage: $0 [OPTIONS] [FILE]...
  4.3887 +
  4.3888 +  -h, --help       print this help, then exit
  4.3889 +  -V, --version    print version number, then exit
  4.3890 +  -q, --quiet      do not print progress messages
  4.3891 +  -d, --debug      don't remove temporary files
  4.3892 +      --recheck    update $as_me by reconfiguring in the same conditions
  4.3893 +  --file=FILE[:TEMPLATE]
  4.3894 +                   instantiate the configuration file FILE
  4.3895 +  --header=FILE[:TEMPLATE]
  4.3896 +                   instantiate the configuration header FILE
  4.3897 +
  4.3898 +Configuration files:
  4.3899 +$config_files
  4.3900 +
  4.3901 +Configuration headers:
  4.3902 +$config_headers
  4.3903 +
  4.3904 +Configuration commands:
  4.3905 +$config_commands
  4.3906 +
  4.3907 +Report bugs to <bug-autoconf@gnu.org>."
  4.3908 +_ACEOF
  4.3909 +
  4.3910 +cat >>$CONFIG_STATUS <<_ACEOF
  4.3911 +ac_cs_version="\\
  4.3912 +config.status
  4.3913 +configured by $0, generated by GNU Autoconf 2.57,
  4.3914 +  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
  4.3915 +
  4.3916 +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
  4.3917 +Free Software Foundation, Inc.
  4.3918 +This config.status script is free software; the Free Software Foundation
  4.3919 +gives unlimited permission to copy, distribute and modify it."
  4.3920 +srcdir=$srcdir
  4.3921 +INSTALL="$INSTALL"
  4.3922 +_ACEOF
  4.3923 +
  4.3924 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.3925 +# If no file are specified by the user, then we need to provide default
  4.3926 +# value.  By we need to know if files were specified by the user.
  4.3927 +ac_need_defaults=:
  4.3928 +while test $# != 0
  4.3929 +do
  4.3930 +  case $1 in
  4.3931 +  --*=*)
  4.3932 +    ac_option=`expr "x$1" : 'x\([^=]*\)='`
  4.3933 +    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
  4.3934 +    ac_shift=:
  4.3935 +    ;;
  4.3936 +  -*)
  4.3937 +    ac_option=$1
  4.3938 +    ac_optarg=$2
  4.3939 +    ac_shift=shift
  4.3940 +    ;;
  4.3941 +  *) # This is not an option, so the user has probably given explicit
  4.3942 +     # arguments.
  4.3943 +     ac_option=$1
  4.3944 +     ac_need_defaults=false;;
  4.3945 +  esac
  4.3946 +
  4.3947 +  case $ac_option in
  4.3948 +  # Handling of the options.
  4.3949 +_ACEOF
  4.3950 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.3951 +  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  4.3952 +    ac_cs_recheck=: ;;
  4.3953 +  --version | --vers* | -V )
  4.3954 +    echo "$ac_cs_version"; exit 0 ;;
  4.3955 +  --he | --h)
  4.3956 +    # Conflict between --help and --header
  4.3957 +    { { echo "$as_me:$LINENO: error: ambiguous option: $1
  4.3958 +Try \`$0 --help' for more information." >&5
  4.3959 +echo "$as_me: error: ambiguous option: $1
  4.3960 +Try \`$0 --help' for more information." >&2;}
  4.3961 +   { (exit 1); exit 1; }; };;
  4.3962 +  --help | --hel | -h )
  4.3963 +    echo "$ac_cs_usage"; exit 0 ;;
  4.3964 +  --debug | --d* | -d )
  4.3965 +    debug=: ;;
  4.3966 +  --file | --fil | --fi | --f )
  4.3967 +    $ac_shift
  4.3968 +    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
  4.3969 +    ac_need_defaults=false;;
  4.3970 +  --header | --heade | --head | --hea )
  4.3971 +    $ac_shift
  4.3972 +    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
  4.3973 +    ac_need_defaults=false;;
  4.3974 +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  4.3975 +  | -silent | --silent | --silen | --sile | --sil | --si | --s)
  4.3976 +    ac_cs_silent=: ;;
  4.3977 +
  4.3978 +  # This is an error.
  4.3979 +  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
  4.3980 +Try \`$0 --help' for more information." >&5
  4.3981 +echo "$as_me: error: unrecognized option: $1
  4.3982 +Try \`$0 --help' for more information." >&2;}
  4.3983 +   { (exit 1); exit 1; }; } ;;
  4.3984 +
  4.3985 +  *) ac_config_targets="$ac_config_targets $1" ;;
  4.3986 +
  4.3987 +  esac
  4.3988 +  shift
  4.3989 +done
  4.3990 +
  4.3991 +ac_configure_extra_args=
  4.3992 +
  4.3993 +if $ac_cs_silent; then
  4.3994 +  exec 6>/dev/null
  4.3995 +  ac_configure_extra_args="$ac_configure_extra_args --silent"
  4.3996 +fi
  4.3997 +
  4.3998 +_ACEOF
  4.3999 +cat >>$CONFIG_STATUS <<_ACEOF
  4.4000 +if \$ac_cs_recheck; then
  4.4001 +  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
  4.4002 +  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  4.4003 +fi
  4.4004 +
  4.4005 +_ACEOF
  4.4006 +
  4.4007 +
  4.4008 +
  4.4009 +
  4.4010 +
  4.4011 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4012 +for ac_config_target in $ac_config_targets
  4.4013 +do
  4.4014 +  case "$ac_config_target" in
  4.4015 +  # Handling of arguments.
  4.4016 +  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
  4.4017 +  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
  4.4018 +  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
  4.4019 +  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
  4.4020 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
  4.4021 +   { (exit 1); exit 1; }; };;
  4.4022 +  esac
  4.4023 +done
  4.4024 +
  4.4025 +# If the user did not use the arguments to specify the items to instantiate,
  4.4026 +# then the envvar interface is used.  Set only those that are not.
  4.4027 +# We use the long form for the default assignment because of an extremely
  4.4028 +# bizarre bug on SunOS 4.1.3.
  4.4029 +if $ac_need_defaults; then
  4.4030 +  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  4.4031 +  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  4.4032 +  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
  4.4033 +fi
  4.4034 +
  4.4035 +# Have a temporary directory for convenience.  Make it in the build tree
  4.4036 +# simply because there is no reason to put it here, and in addition,
  4.4037 +# creating and moving files from /tmp can sometimes cause problems.
  4.4038 +# Create a temporary directory, and hook for its removal unless debugging.
  4.4039 +$debug ||
  4.4040 +{
  4.4041 +  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  4.4042 +  trap '{ (exit 1); exit 1; }' 1 2 13 15
  4.4043 +}
  4.4044 +
  4.4045 +# Create a (secure) tmp directory for tmp files.
  4.4046 +
  4.4047 +{
  4.4048 +  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
  4.4049 +  test -n "$tmp" && test -d "$tmp"
  4.4050 +}  ||
  4.4051 +{
  4.4052 +  tmp=./confstat$$-$RANDOM
  4.4053 +  (umask 077 && mkdir $tmp)
  4.4054 +} ||
  4.4055 +{
  4.4056 +   echo "$me: cannot create a temporary directory in ." >&2
  4.4057 +   { (exit 1); exit 1; }
  4.4058 +}
  4.4059 +
  4.4060 +_ACEOF
  4.4061 +
  4.4062 +cat >>$CONFIG_STATUS <<_ACEOF
  4.4063 +
  4.4064 +#
  4.4065 +# CONFIG_FILES section.
  4.4066 +#
  4.4067 +
  4.4068 +# No need to generate the scripts if there are no CONFIG_FILES.
  4.4069 +# This happens for instance when ./config.status config.h
  4.4070 +if test -n "\$CONFIG_FILES"; then
  4.4071 +  # Protect against being on the right side of a sed subst in config.status.
  4.4072 +  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
  4.4073 +   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
  4.4074 +s,@SHELL@,$SHELL,;t t
  4.4075 +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
  4.4076 +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
  4.4077 +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
  4.4078 +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
  4.4079 +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
  4.4080 +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
  4.4081 +s,@exec_prefix@,$exec_prefix,;t t
  4.4082 +s,@prefix@,$prefix,;t t
  4.4083 +s,@program_transform_name@,$program_transform_name,;t t
  4.4084 +s,@bindir@,$bindir,;t t
  4.4085 +s,@sbindir@,$sbindir,;t t
  4.4086 +s,@libexecdir@,$libexecdir,;t t
  4.4087 +s,@datadir@,$datadir,;t t
  4.4088 +s,@sysconfdir@,$sysconfdir,;t t
  4.4089 +s,@sharedstatedir@,$sharedstatedir,;t t
  4.4090 +s,@localstatedir@,$localstatedir,;t t
  4.4091 +s,@libdir@,$libdir,;t t
  4.4092 +s,@includedir@,$includedir,;t t
  4.4093 +s,@oldincludedir@,$oldincludedir,;t t
  4.4094 +s,@infodir@,$infodir,;t t
  4.4095 +s,@mandir@,$mandir,;t t
  4.4096 +s,@build_alias@,$build_alias,;t t
  4.4097 +s,@host_alias@,$host_alias,;t t
  4.4098 +s,@target_alias@,$target_alias,;t t
  4.4099 +s,@DEFS@,$DEFS,;t t
  4.4100 +s,@ECHO_C@,$ECHO_C,;t t
  4.4101 +s,@ECHO_N@,$ECHO_N,;t t
  4.4102 +s,@ECHO_T@,$ECHO_T,;t t
  4.4103 +s,@LIBS@,$LIBS,;t t
  4.4104 +s,@CC@,$CC,;t t
  4.4105 +s,@CFLAGS@,$CFLAGS,;t t
  4.4106 +s,@LDFLAGS@,$LDFLAGS,;t t
  4.4107 +s,@CPPFLAGS@,$CPPFLAGS,;t t
  4.4108 +s,@ac_ct_CC@,$ac_ct_CC,;t t
  4.4109 +s,@EXEEXT@,$EXEEXT,;t t
  4.4110 +s,@OBJEXT@,$OBJEXT,;t t
  4.4111 +s,@build@,$build,;t t
  4.4112 +s,@build_cpu@,$build_cpu,;t t
  4.4113 +s,@build_vendor@,$build_vendor,;t t
  4.4114 +s,@build_os@,$build_os,;t t
  4.4115 +s,@host@,$host,;t t
  4.4116 +s,@host_cpu@,$host_cpu,;t t
  4.4117 +s,@host_vendor@,$host_vendor,;t t
  4.4118 +s,@host_os@,$host_os,;t t
  4.4119 +s,@target@,$target,;t t
  4.4120 +s,@target_cpu@,$target_cpu,;t t
  4.4121 +s,@target_vendor@,$target_vendor,;t t
  4.4122 +s,@target_os@,$target_os,;t t
  4.4123 +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
  4.4124 +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
  4.4125 +s,@INSTALL_DATA@,$INSTALL_DATA,;t t
  4.4126 +s,@CPP@,$CPP,;t t
  4.4127 +s,@EGREP@,$EGREP,;t t
  4.4128 +s,@GDBSERVER_DEPFILES@,$GDBSERVER_DEPFILES,;t t
  4.4129 +s,@GDBSERVER_LIBS@,$GDBSERVER_LIBS,;t t
  4.4130 +s,@USE_THREAD_DB@,$USE_THREAD_DB,;t t
  4.4131 +s,@LIBOBJS@,$LIBOBJS,;t t
  4.4132 +s,@LTLIBOBJS@,$LTLIBOBJS,;t t
  4.4133 +CEOF
  4.4134 +
  4.4135 +_ACEOF
  4.4136 +
  4.4137 +  cat >>$CONFIG_STATUS <<\_ACEOF
  4.4138 +  # Split the substitutions into bite-sized pieces for seds with
  4.4139 +  # small command number limits, like on Digital OSF/1 and HP-UX.
  4.4140 +  ac_max_sed_lines=48
  4.4141 +  ac_sed_frag=1 # Number of current file.
  4.4142 +  ac_beg=1 # First line for current file.
  4.4143 +  ac_end=$ac_max_sed_lines # Line after last line for current file.
  4.4144 +  ac_more_lines=:
  4.4145 +  ac_sed_cmds=
  4.4146 +  while $ac_more_lines; do
  4.4147 +    if test $ac_beg -gt 1; then
  4.4148 +      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
  4.4149 +    else
  4.4150 +      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
  4.4151 +    fi
  4.4152 +    if test ! -s $tmp/subs.frag; then
  4.4153 +      ac_more_lines=false
  4.4154 +    else
  4.4155 +      # The purpose of the label and of the branching condition is to
  4.4156 +      # speed up the sed processing (if there are no `@' at all, there
  4.4157 +      # is no need to browse any of the substitutions).
  4.4158 +      # These are the two extra sed commands mentioned above.
  4.4159 +      (echo ':t
  4.4160 +  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
  4.4161 +      if test -z "$ac_sed_cmds"; then
  4.4162 +  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
  4.4163 +      else
  4.4164 +  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
  4.4165 +      fi
  4.4166 +      ac_sed_frag=`expr $ac_sed_frag + 1`
  4.4167 +      ac_beg=$ac_end
  4.4168 +      ac_end=`expr $ac_end + $ac_max_sed_lines`
  4.4169 +    fi
  4.4170 +  done
  4.4171 +  if test -z "$ac_sed_cmds"; then
  4.4172 +    ac_sed_cmds=cat
  4.4173 +  fi
  4.4174 +fi # test -n "$CONFIG_FILES"
  4.4175 +
  4.4176 +_ACEOF
  4.4177 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4178 +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
  4.4179 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  4.4180 +  case $ac_file in
  4.4181 +  - | *:- | *:-:* ) # input from stdin
  4.4182 +        cat >$tmp/stdin
  4.4183 +        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  4.4184 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  4.4185 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  4.4186 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  4.4187 +  * )   ac_file_in=$ac_file.in ;;
  4.4188 +  esac
  4.4189 +
  4.4190 +  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
  4.4191 +  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
  4.4192 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  4.4193 +         X"$ac_file" : 'X\(//\)[^/]' \| \
  4.4194 +         X"$ac_file" : 'X\(//\)$' \| \
  4.4195 +         X"$ac_file" : 'X\(/\)' \| \
  4.4196 +         .     : '\(.\)' 2>/dev/null ||
  4.4197 +echo X"$ac_file" |
  4.4198 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  4.4199 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  4.4200 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  4.4201 +  	  /^X\(\/\).*/{ s//\1/; q; }
  4.4202 +  	  s/.*/./; q'`
  4.4203 +  { if $as_mkdir_p; then
  4.4204 +    mkdir -p "$ac_dir"
  4.4205 +  else
  4.4206 +    as_dir="$ac_dir"
  4.4207 +    as_dirs=
  4.4208 +    while test ! -d "$as_dir"; do
  4.4209 +      as_dirs="$as_dir $as_dirs"
  4.4210 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
  4.4211 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  4.4212 +         X"$as_dir" : 'X\(//\)[^/]' \| \
  4.4213 +         X"$as_dir" : 'X\(//\)$' \| \
  4.4214 +         X"$as_dir" : 'X\(/\)' \| \
  4.4215 +         .     : '\(.\)' 2>/dev/null ||
  4.4216 +echo X"$as_dir" |
  4.4217 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  4.4218 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  4.4219 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  4.4220 +  	  /^X\(\/\).*/{ s//\1/; q; }
  4.4221 +  	  s/.*/./; q'`
  4.4222 +    done
  4.4223 +    test ! -n "$as_dirs" || mkdir $as_dirs
  4.4224 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
  4.4225 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
  4.4226 +   { (exit 1); exit 1; }; }; }
  4.4227 +
  4.4228 +  ac_builddir=.
  4.4229 +
  4.4230 +if test "$ac_dir" != .; then
  4.4231 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  4.4232 +  # A "../" for each directory in $ac_dir_suffix.
  4.4233 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  4.4234 +else
  4.4235 +  ac_dir_suffix= ac_top_builddir=
  4.4236 +fi
  4.4237 +
  4.4238 +case $srcdir in
  4.4239 +  .)  # No --srcdir option.  We are building in place.
  4.4240 +    ac_srcdir=.
  4.4241 +    if test -z "$ac_top_builddir"; then
  4.4242 +       ac_top_srcdir=.
  4.4243 +    else
  4.4244 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  4.4245 +    fi ;;
  4.4246 +  [\\/]* | ?:[\\/]* )  # Absolute path.
  4.4247 +    ac_srcdir=$srcdir$ac_dir_suffix;
  4.4248 +    ac_top_srcdir=$srcdir ;;
  4.4249 +  *) # Relative path.
  4.4250 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  4.4251 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  4.4252 +esac
  4.4253 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
  4.4254 +# absolute.
  4.4255 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
  4.4256 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
  4.4257 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
  4.4258 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
  4.4259 +
  4.4260 +
  4.4261 +  case $INSTALL in
  4.4262 +  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
  4.4263 +  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
  4.4264 +  esac
  4.4265 +
  4.4266 +  if test x"$ac_file" != x-; then
  4.4267 +    { echo "$as_me:$LINENO: creating $ac_file" >&5
  4.4268 +echo "$as_me: creating $ac_file" >&6;}
  4.4269 +    rm -f "$ac_file"
  4.4270 +  fi
  4.4271 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
  4.4272 +  # use $as_me), people would be surprised to read:
  4.4273 +  #    /* config.h.  Generated by config.status.  */
  4.4274 +  if test x"$ac_file" = x-; then
  4.4275 +    configure_input=
  4.4276 +  else
  4.4277 +    configure_input="$ac_file.  "
  4.4278 +  fi
  4.4279 +  configure_input=$configure_input"Generated from `echo $ac_file_in |
  4.4280 +                                     sed 's,.*/,,'` by configure."
  4.4281 +
  4.4282 +  # First look for the input files in the build tree, otherwise in the
  4.4283 +  # src tree.
  4.4284 +  ac_file_inputs=`IFS=:
  4.4285 +    for f in $ac_file_in; do
  4.4286 +      case $f in
  4.4287 +      -) echo $tmp/stdin ;;
  4.4288 +      [\\/$]*)
  4.4289 +         # Absolute (can't be DOS-style, as IFS=:)
  4.4290 +         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  4.4291 +echo "$as_me: error: cannot find input file: $f" >&2;}
  4.4292 +   { (exit 1); exit 1; }; }
  4.4293 +         echo $f;;
  4.4294 +      *) # Relative
  4.4295 +         if test -f "$f"; then
  4.4296 +           # Build tree
  4.4297 +           echo $f
  4.4298 +         elif test -f "$srcdir/$f"; then
  4.4299 +           # Source tree
  4.4300 +           echo $srcdir/$f
  4.4301 +         else
  4.4302 +           # /dev/null tree
  4.4303 +           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  4.4304 +echo "$as_me: error: cannot find input file: $f" >&2;}
  4.4305 +   { (exit 1); exit 1; }; }
  4.4306 +         fi;;
  4.4307 +      esac
  4.4308 +    done` || { (exit 1); exit 1; }
  4.4309 +_ACEOF
  4.4310 +cat >>$CONFIG_STATUS <<_ACEOF
  4.4311 +  sed "$ac_vpsub
  4.4312 +$extrasub
  4.4313 +_ACEOF
  4.4314 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4315 +:t
  4.4316 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
  4.4317 +s,@configure_input@,$configure_input,;t t
  4.4318 +s,@srcdir@,$ac_srcdir,;t t
  4.4319 +s,@abs_srcdir@,$ac_abs_srcdir,;t t
  4.4320 +s,@top_srcdir@,$ac_top_srcdir,;t t
  4.4321 +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
  4.4322 +s,@builddir@,$ac_builddir,;t t
  4.4323 +s,@abs_builddir@,$ac_abs_builddir,;t t
  4.4324 +s,@top_builddir@,$ac_top_builddir,;t t
  4.4325 +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
  4.4326 +s,@INSTALL@,$ac_INSTALL,;t t
  4.4327 +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
  4.4328 +  rm -f $tmp/stdin
  4.4329 +  if test x"$ac_file" != x-; then
  4.4330 +    mv $tmp/out $ac_file
  4.4331 +  else
  4.4332 +    cat $tmp/out
  4.4333 +    rm -f $tmp/out
  4.4334 +  fi
  4.4335 +
  4.4336 +done
  4.4337 +_ACEOF
  4.4338 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4339 +
  4.4340 +#
  4.4341 +# CONFIG_HEADER section.
  4.4342 +#
  4.4343 +
  4.4344 +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  4.4345 +# NAME is the cpp macro being defined and VALUE is the value it is being given.
  4.4346 +#
  4.4347 +# ac_d sets the value in "#define NAME VALUE" lines.
  4.4348 +ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
  4.4349 +ac_dB='[ 	].*$,\1#\2'
  4.4350 +ac_dC=' '
  4.4351 +ac_dD=',;t'
  4.4352 +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  4.4353 +ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
  4.4354 +ac_uB='$,\1#\2define\3'
  4.4355 +ac_uC=' '
  4.4356 +ac_uD=',;t'
  4.4357 +
  4.4358 +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
  4.4359 +  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  4.4360 +  case $ac_file in
  4.4361 +  - | *:- | *:-:* ) # input from stdin
  4.4362 +        cat >$tmp/stdin
  4.4363 +        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  4.4364 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  4.4365 +  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
  4.4366 +        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
  4.4367 +  * )   ac_file_in=$ac_file.in ;;
  4.4368 +  esac
  4.4369 +
  4.4370 +  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
  4.4371 +echo "$as_me: creating $ac_file" >&6;}
  4.4372 +
  4.4373 +  # First look for the input files in the build tree, otherwise in the
  4.4374 +  # src tree.
  4.4375 +  ac_file_inputs=`IFS=:
  4.4376 +    for f in $ac_file_in; do
  4.4377 +      case $f in
  4.4378 +      -) echo $tmp/stdin ;;
  4.4379 +      [\\/$]*)
  4.4380 +         # Absolute (can't be DOS-style, as IFS=:)
  4.4381 +         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  4.4382 +echo "$as_me: error: cannot find input file: $f" >&2;}
  4.4383 +   { (exit 1); exit 1; }; }
  4.4384 +         echo $f;;
  4.4385 +      *) # Relative
  4.4386 +         if test -f "$f"; then
  4.4387 +           # Build tree
  4.4388 +           echo $f
  4.4389 +         elif test -f "$srcdir/$f"; then
  4.4390 +           # Source tree
  4.4391 +           echo $srcdir/$f
  4.4392 +         else
  4.4393 +           # /dev/null tree
  4.4394 +           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
  4.4395 +echo "$as_me: error: cannot find input file: $f" >&2;}
  4.4396 +   { (exit 1); exit 1; }; }
  4.4397 +         fi;;
  4.4398 +      esac
  4.4399 +    done` || { (exit 1); exit 1; }
  4.4400 +  # Remove the trailing spaces.
  4.4401 +  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
  4.4402 +
  4.4403 +_ACEOF
  4.4404 +
  4.4405 +# Transform confdefs.h into two sed scripts, `conftest.defines' and
  4.4406 +# `conftest.undefs', that substitutes the proper values into
  4.4407 +# config.h.in to produce config.h.  The first handles `#define'
  4.4408 +# templates, and the second `#undef' templates.
  4.4409 +# And first: Protect against being on the right side of a sed subst in
  4.4410 +# config.status.  Protect against being in an unquoted here document
  4.4411 +# in config.status.
  4.4412 +rm -f conftest.defines conftest.undefs
  4.4413 +# Using a here document instead of a string reduces the quoting nightmare.
  4.4414 +# Putting comments in sed scripts is not portable.
  4.4415 +#
  4.4416 +# `end' is used to avoid that the second main sed command (meant for
  4.4417 +# 0-ary CPP macros) applies to n-ary macro definitions.
  4.4418 +# See the Autoconf documentation for `clear'.
  4.4419 +cat >confdef2sed.sed <<\_ACEOF
  4.4420 +s/[\\&,]/\\&/g
  4.4421 +s,[\\$`],\\&,g
  4.4422 +t clear
  4.4423 +: clear
  4.4424 +s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
  4.4425 +t end
  4.4426 +s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
  4.4427 +: end
  4.4428 +_ACEOF
  4.4429 +# If some macros were called several times there might be several times
  4.4430 +# the same #defines, which is useless.  Nevertheless, we may not want to
  4.4431 +# sort them, since we want the *last* AC-DEFINE to be honored.
  4.4432 +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
  4.4433 +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
  4.4434 +rm -f confdef2sed.sed
  4.4435 +
  4.4436 +# This sed command replaces #undef with comments.  This is necessary, for
  4.4437 +# example, in the case of _POSIX_SOURCE, which is predefined and required
  4.4438 +# on some systems where configure will not decide to define it.
  4.4439 +cat >>conftest.undefs <<\_ACEOF
  4.4440 +s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  4.4441 +_ACEOF
  4.4442 +
  4.4443 +# Break up conftest.defines because some shells have a limit on the size
  4.4444 +# of here documents, and old seds have small limits too (100 cmds).
  4.4445 +echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
  4.4446 +echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
  4.4447 +echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
  4.4448 +echo '  :' >>$CONFIG_STATUS
  4.4449 +rm -f conftest.tail
  4.4450 +while grep . conftest.defines >/dev/null
  4.4451 +do
  4.4452 +  # Write a limited-size here document to $tmp/defines.sed.
  4.4453 +  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
  4.4454 +  # Speed up: don't consider the non `#define' lines.
  4.4455 +  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
  4.4456 +  # Work around the forget-to-reset-the-flag bug.
  4.4457 +  echo 't clr' >>$CONFIG_STATUS
  4.4458 +  echo ': clr' >>$CONFIG_STATUS
  4.4459 +  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
  4.4460 +  echo 'CEOF
  4.4461 +  sed -f $tmp/defines.sed $tmp/in >$tmp/out
  4.4462 +  rm -f $tmp/in
  4.4463 +  mv $tmp/out $tmp/in
  4.4464 +' >>$CONFIG_STATUS
  4.4465 +  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
  4.4466 +  rm -f conftest.defines
  4.4467 +  mv conftest.tail conftest.defines
  4.4468 +done
  4.4469 +rm -f conftest.defines
  4.4470 +echo '  fi # grep' >>$CONFIG_STATUS
  4.4471 +echo >>$CONFIG_STATUS
  4.4472 +
  4.4473 +# Break up conftest.undefs because some shells have a limit on the size
  4.4474 +# of here documents, and old seds have small limits too (100 cmds).
  4.4475 +echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
  4.4476 +rm -f conftest.tail
  4.4477 +while grep . conftest.undefs >/dev/null
  4.4478 +do
  4.4479 +  # Write a limited-size here document to $tmp/undefs.sed.
  4.4480 +  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
  4.4481 +  # Speed up: don't consider the non `#undef'
  4.4482 +  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
  4.4483 +  # Work around the forget-to-reset-the-flag bug.
  4.4484 +  echo 't clr' >>$CONFIG_STATUS
  4.4485 +  echo ': clr' >>$CONFIG_STATUS
  4.4486 +  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
  4.4487 +  echo 'CEOF
  4.4488 +  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
  4.4489 +  rm -f $tmp/in
  4.4490 +  mv $tmp/out $tmp/in
  4.4491 +' >>$CONFIG_STATUS
  4.4492 +  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
  4.4493 +  rm -f conftest.undefs
  4.4494 +  mv conftest.tail conftest.undefs
  4.4495 +done
  4.4496 +rm -f conftest.undefs
  4.4497 +
  4.4498 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4499 +  # Let's still pretend it is `configure' which instantiates (i.e., don't
  4.4500 +  # use $as_me), people would be surprised to read:
  4.4501 +  #    /* config.h.  Generated by config.status.  */
  4.4502 +  if test x"$ac_file" = x-; then
  4.4503 +    echo "/* Generated by configure.  */" >$tmp/config.h
  4.4504 +  else
  4.4505 +    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
  4.4506 +  fi
  4.4507 +  cat $tmp/in >>$tmp/config.h
  4.4508 +  rm -f $tmp/in
  4.4509 +  if test x"$ac_file" != x-; then
  4.4510 +    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
  4.4511 +      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
  4.4512 +echo "$as_me: $ac_file is unchanged" >&6;}
  4.4513 +    else
  4.4514 +      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
  4.4515 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  4.4516 +         X"$ac_file" : 'X\(//\)[^/]' \| \
  4.4517 +         X"$ac_file" : 'X\(//\)$' \| \
  4.4518 +         X"$ac_file" : 'X\(/\)' \| \
  4.4519 +         .     : '\(.\)' 2>/dev/null ||
  4.4520 +echo X"$ac_file" |
  4.4521 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  4.4522 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  4.4523 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  4.4524 +  	  /^X\(\/\).*/{ s//\1/; q; }
  4.4525 +  	  s/.*/./; q'`
  4.4526 +      { if $as_mkdir_p; then
  4.4527 +    mkdir -p "$ac_dir"
  4.4528 +  else
  4.4529 +    as_dir="$ac_dir"
  4.4530 +    as_dirs=
  4.4531 +    while test ! -d "$as_dir"; do
  4.4532 +      as_dirs="$as_dir $as_dirs"
  4.4533 +      as_dir=`(dirname "$as_dir") 2>/dev/null ||
  4.4534 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  4.4535 +         X"$as_dir" : 'X\(//\)[^/]' \| \
  4.4536 +         X"$as_dir" : 'X\(//\)$' \| \
  4.4537 +         X"$as_dir" : 'X\(/\)' \| \
  4.4538 +         .     : '\(.\)' 2>/dev/null ||
  4.4539 +echo X"$as_dir" |
  4.4540 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  4.4541 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  4.4542 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  4.4543 +  	  /^X\(\/\).*/{ s//\1/; q; }
  4.4544 +  	  s/.*/./; q'`
  4.4545 +    done
  4.4546 +    test ! -n "$as_dirs" || mkdir $as_dirs
  4.4547 +  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
  4.4548 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
  4.4549 +   { (exit 1); exit 1; }; }; }
  4.4550 +
  4.4551 +      rm -f $ac_file
  4.4552 +      mv $tmp/config.h $ac_file
  4.4553 +    fi
  4.4554 +  else
  4.4555 +    cat $tmp/config.h
  4.4556 +    rm -f $tmp/config.h
  4.4557 +  fi
  4.4558 +done
  4.4559 +_ACEOF
  4.4560 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4561 +
  4.4562 +#
  4.4563 +# CONFIG_COMMANDS section.
  4.4564 +#
  4.4565 +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
  4.4566 +  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
  4.4567 +  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
  4.4568 +  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
  4.4569 +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
  4.4570 +         X"$ac_dest" : 'X\(//\)[^/]' \| \
  4.4571 +         X"$ac_dest" : 'X\(//\)$' \| \
  4.4572 +         X"$ac_dest" : 'X\(/\)' \| \
  4.4573 +         .     : '\(.\)' 2>/dev/null ||
  4.4574 +echo X"$ac_dest" |
  4.4575 +    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
  4.4576 +  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
  4.4577 +  	  /^X\(\/\/\)$/{ s//\1/; q; }
  4.4578 +  	  /^X\(\/\).*/{ s//\1/; q; }
  4.4579 +  	  s/.*/./; q'`
  4.4580 +  ac_builddir=.
  4.4581 +
  4.4582 +if test "$ac_dir" != .; then
  4.4583 +  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
  4.4584 +  # A "../" for each directory in $ac_dir_suffix.
  4.4585 +  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
  4.4586 +else
  4.4587 +  ac_dir_suffix= ac_top_builddir=
  4.4588 +fi
  4.4589 +
  4.4590 +case $srcdir in
  4.4591 +  .)  # No --srcdir option.  We are building in place.
  4.4592 +    ac_srcdir=.
  4.4593 +    if test -z "$ac_top_builddir"; then
  4.4594 +       ac_top_srcdir=.
  4.4595 +    else
  4.4596 +       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
  4.4597 +    fi ;;
  4.4598 +  [\\/]* | ?:[\\/]* )  # Absolute path.
  4.4599 +    ac_srcdir=$srcdir$ac_dir_suffix;
  4.4600 +    ac_top_srcdir=$srcdir ;;
  4.4601 +  *) # Relative path.
  4.4602 +    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
  4.4603 +    ac_top_srcdir=$ac_top_builddir$srcdir ;;
  4.4604 +esac
  4.4605 +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
  4.4606 +# absolute.
  4.4607 +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
  4.4608 +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
  4.4609 +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
  4.4610 +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
  4.4611 +
  4.4612 +
  4.4613 +  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
  4.4614 +echo "$as_me: executing $ac_dest commands" >&6;}
  4.4615 +  case $ac_dest in
  4.4616 +    default ) case x$CONFIG_HEADERS in
  4.4617 +xconfig.h:config.in)
  4.4618 +echo > stamp-h ;;
  4.4619 +esac
  4.4620 + ;;
  4.4621 +  esac
  4.4622 +done
  4.4623 +_ACEOF
  4.4624 +
  4.4625 +cat >>$CONFIG_STATUS <<\_ACEOF
  4.4626 +
  4.4627 +{ (exit 0); exit 0; }
  4.4628 +_ACEOF
  4.4629 +chmod +x $CONFIG_STATUS
  4.4630 +ac_clean_files=$ac_clean_files_save
  4.4631 +
  4.4632 +
  4.4633 +# configure is writing to config.log, and then calls config.status.
  4.4634 +# config.status does its own redirection, appending to config.log.
  4.4635 +# Unfortunately, on DOS this fails, as config.log is still kept open
  4.4636 +# by configure, so config.status won't be able to write to it; its
  4.4637 +# output is simply discarded.  So we exec the FD to /dev/null,
  4.4638 +# effectively closing config.log, so it can be properly (re)opened and
  4.4639 +# appended to by config.status.  When coming back to configure, we
  4.4640 +# need to make the FD available again.
  4.4641 +if test "$no_create" != yes; then
  4.4642 +  ac_cs_success=:
  4.4643 +  ac_config_status_args=
  4.4644 +  test "$silent" = yes &&
  4.4645 +    ac_config_status_args="$ac_config_status_args --quiet"
  4.4646 +  exec 5>/dev/null
  4.4647 +  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  4.4648 +  exec 5>>config.log
  4.4649 +  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  4.4650 +  # would make configure fail if this is the last instruction.
  4.4651 +  $ac_cs_success || { (exit 1); exit 1; }
  4.4652 +fi
  4.4653 +
     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.in	Sat Jun 04 15:27:59 2005 +0000
     5.3 @@ -0,0 +1,121 @@
     5.4 +dnl Autoconf configure script for GDB server.
     5.5 +dnl Copyright 2000, 2002 Free Software Foundation, Inc.
     5.6 +dnl
     5.7 +dnl This file is part of GDB.
     5.8 +dnl
     5.9 +dnl This program is free software; you can redistribute it and/or modify
    5.10 +dnl it under the terms of the GNU General Public License as published by
    5.11 +dnl the Free Software Foundation; either version 2 of the License, or
    5.12 +dnl (at your option) any later version.
    5.13 +dnl
    5.14 +dnl This program is distributed in the hope that it will be useful,
    5.15 +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.16 +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.17 +dnl GNU General Public License for more details.
    5.18 +dnl
    5.19 +dnl You should have received a copy of the GNU General Public License
    5.20 +dnl along with this program; if not, write to the Free Software
    5.21 +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    5.22 +
    5.23 +dnl Process this file with autoconf to produce a configure script.
    5.24 +
    5.25 +AC_INIT(server.c)
    5.26 +AC_CONFIG_HEADER(config.h:config.in)
    5.27 +
    5.28 +AC_PROG_CC
    5.29 +
    5.30 +AC_CANONICAL_SYSTEM
    5.31 +
    5.32 +AC_PROG_INSTALL
    5.33 +
    5.34 +AC_HEADER_STDC
    5.35 +
    5.36 +AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
    5.37 +		 proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl
    5.38 +		 stdlib.h unistd.h)
    5.39 +
    5.40 +BFD_NEED_DECLARATION(strerror)
    5.41 +
    5.42 +. ${srcdir}/configure.srv
    5.43 +
    5.44 +if test "${srv_linux_usrregs}" = "yes"; then
    5.45 +  AC_DEFINE(HAVE_LINUX_USRREGS)
    5.46 +fi
    5.47 +
    5.48 +if test "${srv_linux_regsets}" = "yes"; then
    5.49 +  AC_MSG_CHECKING(for PTRACE_GETREGS)
    5.50 +  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getregs,
    5.51 +  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
    5.52 +		  [PTRACE_GETREGS;],
    5.53 +		  [gdbsrv_cv_have_ptrace_getregs=yes],
    5.54 +		  [gdbsrv_cv_have_ptrace_getregs=no])])
    5.55 +  AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getregs)
    5.56 +  if test "${gdbsrv_cv_have_ptrace_getregs}" = "yes"; then
    5.57 +    AC_DEFINE(HAVE_LINUX_REGSETS)
    5.58 +  fi
    5.59 +
    5.60 +  AC_MSG_CHECKING(for PTRACE_GETFPXREGS)
    5.61 +  AC_CACHE_VAL(gdbsrv_cv_have_ptrace_getfpxregs,
    5.62 +  [AC_TRY_COMPILE([#include <sys/ptrace.h>],
    5.63 +		  [PTRACE_GETFPXREGS;],
    5.64 +		  [gdbsrv_cv_have_ptrace_getfpxregs=yes],
    5.65 +		  [gdbsrv_cv_have_ptrace_getfpxregs=no])])
    5.66 +  AC_MSG_RESULT($gdbsrv_cv_have_ptrace_getfpxregs)
    5.67 +  if test "${gdbsrv_cv_have_ptrace_getfpxregs}" = "yes"; then
    5.68 +    AC_DEFINE(HAVE_PTRACE_GETFPXREGS)
    5.69 +  fi
    5.70 +fi
    5.71 +
    5.72 +if test "$ac_cv_header_sys_procfs_h" = yes; then
    5.73 +  BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t)
    5.74 +  BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t)
    5.75 +  BFD_HAVE_SYS_PROCFS_TYPE(prgregset_t)
    5.76 +  BFD_HAVE_SYS_PROCFS_TYPE(prfpregset_t)
    5.77 +
    5.78 +  dnl Check for broken prfpregset_t type
    5.79 +
    5.80 +  dnl For Linux/i386, glibc 2.1.3 was released with a bogus
    5.81 +  dnl prfpregset_t type (it's a typedef for the pointer to a struct
    5.82 +  dnl instead of the struct itself).  We detect this here, and work
    5.83 +  dnl around it in gdb_proc_service.h.
    5.84 +
    5.85 +  if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
    5.86 +    AC_MSG_CHECKING(whether prfpregset_t type is broken)
    5.87 +    AC_CACHE_VAL(gdb_cv_prfpregset_t_broken,
    5.88 +      [AC_TRY_RUN([#include <sys/procfs.h>
    5.89 +       int main ()
    5.90 +       {
    5.91 +         if (sizeof (prfpregset_t) == sizeof (void *))
    5.92 +           return 1;
    5.93 +         return 0;
    5.94 +       }],
    5.95 +       gdb_cv_prfpregset_t_broken=no,
    5.96 +       gdb_cv_prfpregset_t_broken=yes,
    5.97 +       gdb_cv_prfpregset_t_broken=yes)])
    5.98 +    AC_MSG_RESULT($gdb_cv_prfpregset_t_broken)
    5.99 +    if test $gdb_cv_prfpregset_t_broken = yes; then
   5.100 +      AC_DEFINE(PRFPREGSET_T_BROKEN)
   5.101 +    fi
   5.102 +  fi
   5.103 +
   5.104 +  BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t)
   5.105 +fi
   5.106 +
   5.107 +srv_thread_depfiles=
   5.108 +srv_libs=
   5.109 +USE_THREAD_DB=
   5.110 +
   5.111 +
   5.112 +GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
   5.113 +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc"
   5.114 +
   5.115 +AC_SUBST(GDBSERVER_DEPFILES)
   5.116 +AC_SUBST(GDBSERVER_LIBS)
   5.117 +AC_SUBST(USE_THREAD_DB)
   5.118 +
   5.119 +AC_OUTPUT(Makefile,
   5.120 +[case x$CONFIG_HEADERS in
   5.121 +xconfig.h:config.in)
   5.122 +echo > stamp-h ;;
   5.123 +esac
   5.124 +])
     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/configure.srv	Sat Jun 04 15:27:59 2005 +0000
     6.3 @@ -0,0 +1,75 @@
     6.4 +# Mappings from configuration triplets to gdbserver build options.
     6.5 +# This is invoked from the autoconf-generated configure script, to
     6.6 +# produce the appropriate Makefile substitutions.
     6.7 +
     6.8 +# This file sets the following shell variables:
     6.9 +#   srv_regobj		The register protocol appropriate for this target.
    6.10 +#   srv_tgtobj		Any other target-specific modules appropriate
    6.11 +#			for this target.
    6.12 +#
    6.13 +# In addition, on GNU/Linux the following shell variables will be set:
    6.14 +#   srv_linux_regsets	Set to "yes" if ptrace(PTRACE_GETREGS) and friends
    6.15 +#			may be available on this platform;  unset otherwise.
    6.16 +#			They will only be used if <sys/ptrace.h> defines
    6.17 +#			PTRACE_GETREGS.
    6.18 +#   srv_linux_usrregs	Set to "yes" if we can get at registers via
    6.19 +#			PTRACE_PEEKUSR / PTRACE_POKEUSR.
    6.20 +
    6.21 +# Input is taken from the "${target}" variable.
    6.22 +
    6.23 +case "${target}" in
    6.24 +  arm*-*-linux*)	srv_regobj=reg-arm.o
    6.25 +			srv_tgtobj="linux-xen-low.o linux-arm-low.o"
    6.26 +			srv_linux_usrregs=yes
    6.27 +			srv_linux_thread_db=yes
    6.28 +			;;
    6.29 +  i[34567]86-*-linux*)	srv_regobj=reg-i386-linux.o
    6.30 +			srv_tgtobj="linux-xen-low.o linux-i386-low.o i387-fp.o"
    6.31 +			srv_linux_usrregs=yes
    6.32 +			srv_linux_regsets=yes
    6.33 +			srv_linux_thread_db=yes
    6.34 +			;;
    6.35 +  ia64-*-linux*)	srv_regobj=reg-ia64.o
    6.36 +			srv_tgtobj="linux-low.o linux-ia64-low.o"
    6.37 +			srv_linux_usrregs=yes
    6.38 +			;;
    6.39 +  m68*-*-linux*)	srv_regobj=reg-m68k.o
    6.40 +			srv_tgtobj="linux-low.o linux-m68k-low.o"
    6.41 +			srv_linux_usrregs=yes
    6.42 +			;;
    6.43 +  mips*-*-linux*)	srv_regobj=reg-mips.o
    6.44 +			srv_tgtobj="linux-low.o linux-mips-low.o"
    6.45 +			srv_linux_usrregs=yes
    6.46 +			srv_linux_thread_db=yes
    6.47 +			;;
    6.48 +  powerpc*-*-linux*)	srv_regobj=reg-ppc.o
    6.49 +			srv_tgtobj="linux-low.o linux-ppc-low.o"
    6.50 +			srv_linux_usrregs=yes
    6.51 +			srv_linux_thread_db=yes
    6.52 +			;;
    6.53 +  s390-*-linux*)	srv_regobj=reg-s390.o
    6.54 +			srv_tgtobj="linux-low.o linux-s390-low.o"
    6.55 +			srv_linux_usrregs=yes
    6.56 +			;;
    6.57 +  s390x-*-linux*)	srv_regobj=reg-s390x.o
    6.58 +			srv_tgtobj="linux-low.o linux-s390-low.o"
    6.59 +			srv_linux_usrregs=yes
    6.60 +			;;
    6.61 +  sh*-*-linux*)		srv_regobj=reg-sh.o
    6.62 +			srv_tgtobj="linux-low.o linux-sh-low.o"
    6.63 +			srv_linux_usrregs=yes
    6.64 +			srv_linux_thread_db=yes
    6.65 +			;;
    6.66 +  x86_64-*-linux*)	srv_regobj=reg-x86-64.o
    6.67 +			srv_tgtobj="linux-low.o linux-x86-64-low.o i387-fp.o"
    6.68 +			srv_linux_regsets=yes
    6.69 +			;;
    6.70 +  xscale*-*-linux*)	srv_regobj=reg-arm.o
    6.71 +			srv_tgtobj="linux-low.o linux-arm-low.o"
    6.72 +			srv_linux_usrregs=yes
    6.73 +			srv_linux_thread_db=yes
    6.74 +			;;
    6.75 +  *)			echo "Error: target not supported by gdbserver."
    6.76 +			exit 1
    6.77 +			;;
    6.78 +esac
     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/linux-xen-low.c	Sat Jun 04 15:27:59 2005 +0000
     7.3 @@ -0,0 +1,556 @@
     7.4 +/* Low level interface to ptrace, for the remote server for GDB.
     7.5 +   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 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 +#include "linux-low.h"
    7.27 +
    7.28 +#include <sys/wait.h>
    7.29 +#include <stdio.h>
    7.30 +#include <sys/param.h>
    7.31 +#include <sys/dir.h>
    7.32 +#include <sys/ptrace.h>
    7.33 +#include <sys/user.h>
    7.34 +#include <signal.h>
    7.35 +#include <sys/ioctl.h>
    7.36 +#include <fcntl.h>
    7.37 +#include <string.h>
    7.38 +#include <stdlib.h>
    7.39 +#include <unistd.h>
    7.40 +#include <errno.h>
    7.41 +#include <xc.h>
    7.42 +#define TRACE_ENTER /* printf("enter %s\n", __FUNCTION__) */
    7.43 +long (*myptrace)(enum __ptrace_request, pid_t, long, long);
    7.44 +int (*myxcwait)(int domain, int *status, int options) ;
    7.45 +
    7.46 +
    7.47 +#define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
    7.48 +#define DOMFLAGS_SHUTDOWN  (1<<2) /* The guest OS has shut down.             */
    7.49 +#define DOMFLAGS_PAUSED    (1<<3) /* Currently paused by control software.   */
    7.50 +#define DOMFLAGS_BLOCKED   (1<<4) /* Currently blocked pending an event.     */
    7.51 +#define DOMFLAGS_RUNNING   (1<<5) /* Domain is currently running.            */
    7.52 +
    7.53 +
    7.54 +
    7.55 +struct inferior_list all_processes;
    7.56 +
    7.57 +
    7.58 +static int current_domain;
    7.59 +static int expect_signal = 0;
    7.60 +static int signal_to_send = 0; 
    7.61 +static void linux_resume (struct thread_resume *resume_info);
    7.62 +
    7.63 +int debug_threads;
    7.64 +int using_threads;
    7.65 +extern int isfile;
    7.66 +
    7.67 +struct pending_signals
    7.68 +{
    7.69 +  int signal;
    7.70 +  struct pending_signals *prev;
    7.71 +};
    7.72 +
    7.73 +#define PTRACE_ARG3_TYPE long
    7.74 +#define PTRACE_XFER_TYPE long
    7.75 +
    7.76 +static int use_regsets_p = 1;
    7.77 +
    7.78 +
    7.79 +#define pid_of(proc) ((proc)->head.id)
    7.80 +
    7.81 +/* FIXME: Delete eventually.  */
    7.82 +#define inferior_pid (pid_of (get_thread_process (current_inferior)))
    7.83 +
    7.84 +/* This function should only be called if the process got a SIGTRAP.
    7.85 +   The SIGTRAP could mean several things.
    7.86 +
    7.87 +   On i386, where decr_pc_after_break is non-zero:
    7.88 +   If we were single-stepping this process using PTRACE_SINGLESTEP,
    7.89 +   we will get only the one SIGTRAP (even if the instruction we
    7.90 +   stepped over was a breakpoint).  The value of $eip will be the
    7.91 +   next instruction.
    7.92 +   If we continue the process using PTRACE_CONT, we will get a
    7.93 +   SIGTRAP when we hit a breakpoint.  The value of $eip will be
    7.94 +   the instruction after the breakpoint (i.e. needs to be
    7.95 +   decremented).  If we report the SIGTRAP to GDB, we must also
    7.96 +   report the undecremented PC.  If we cancel the SIGTRAP, we
    7.97 +   must resume at the decremented PC.
    7.98 +
    7.99 +   (Presumably, not yet tested) On a non-decr_pc_after_break machine
   7.100 +   with hardware or kernel single-step:
   7.101 +   If we single-step over a breakpoint instruction, our PC will
   7.102 +   point at the following instruction.  If we continue and hit a
   7.103 +   breakpoint instruction, our PC will point at the breakpoint
   7.104 +   instruction.  */
   7.105 +#if 0
   7.106 +static CORE_ADDR
   7.107 +get_stop_pc (void)
   7.108 +{
   7.109 +  CORE_ADDR stop_pc = (*the_low_target.get_pc) ();
   7.110 +
   7.111 +  if (get_thread_process (current_inferior)->stepping)
   7.112 +    return stop_pc;
   7.113 +  else
   7.114 +    return stop_pc - the_low_target.decr_pc_after_break;
   7.115 +}
   7.116 +#endif
   7.117 +static void *
   7.118 +add_process (int pid)
   7.119 +{
   7.120 +  struct process_info *process;
   7.121 +
   7.122 +  process = (struct process_info *) malloc (sizeof (*process));
   7.123 +  memset (process, 0, sizeof (*process));
   7.124 +
   7.125 +  process->head.id = pid;
   7.126 +
   7.127 +  /* Default to tid == lwpid == pid.  */
   7.128 +  process->tid = pid;
   7.129 +  process->lwpid = pid;
   7.130 +
   7.131 +  add_inferior_to_list (&all_processes, &process->head);
   7.132 +
   7.133 +  return process;
   7.134 +}
   7.135 +
   7.136 +/* Start an inferior process and returns its pid.
   7.137 +   ALLARGS is a vector of program-name and args. */
   7.138 +
   7.139 +static int
   7.140 +linux_create_inferior (char *program, char **allargs)
   7.141 +{
   7.142 +
   7.143 +  fprintf (stderr, "Cannot exec %s: %s.\n", program,
   7.144 +	   strerror (errno));
   7.145 +  fflush (stderr);
   7.146 +  _exit (0177);
   7.147 +  /* NOT REACHED */
   7.148 +  return -1;
   7.149 +}
   7.150 +
   7.151 +int
   7.152 +linux_attach (int domain)
   7.153 +{
   7.154 +    struct process_info *new_process;
   7.155 +    current_domain = domain;
   7.156 +    if (myptrace (PTRACE_ATTACH, domain, 0, 0) != 0) {
   7.157 +	fprintf (stderr, "Cannot attach to domain %d: %s (%d)\n", domain,
   7.158 +		 strerror (errno), errno);
   7.159 +	fflush (stderr);
   7.160 +	_exit (0177);
   7.161 +    }
   7.162 +    
   7.163 +    new_process = (struct process_info *) add_process (domain);
   7.164 +    add_thread (domain, new_process);
   7.165 +
   7.166 +    /* Don't ignore the initial SIGSTOP if we just attached to this process.  */
   7.167 +    new_process->stop_expected = 0;
   7.168 +    
   7.169 +    return 0;
   7.170 +}
   7.171 +
   7.172 +/* Kill the inferior process.  Make us have no inferior.  */
   7.173 +
   7.174 +static void
   7.175 +linux_kill_one_process (struct inferior_list_entry *entry)
   7.176 +{
   7.177 +  struct thread_info *thread = (struct thread_info *) entry;
   7.178 +  struct process_info *process = get_thread_process (thread);
   7.179 +  myptrace (PTRACE_KILL, pid_of (process), 0, 0);
   7.180 +
   7.181 +}
   7.182 +
   7.183 +static void
   7.184 +linux_kill (void)
   7.185 +{
   7.186 +  for_each_inferior (&all_threads, linux_kill_one_process);
   7.187 +}
   7.188 +
   7.189 +
   7.190 +static void
   7.191 +linux_detach_one_process (struct inferior_list_entry *entry)
   7.192 +{
   7.193 +  struct thread_info *thread = (struct thread_info *) entry;
   7.194 +  struct process_info *process = get_thread_process (thread);
   7.195 +
   7.196 +  myptrace (PTRACE_DETACH, pid_of (process), 0, 0);
   7.197 +}
   7.198 +
   7.199 +
   7.200 +static void
   7.201 +linux_detach (void)
   7.202 +{
   7.203 +  for_each_inferior (&all_threads, linux_detach_one_process);
   7.204 +}
   7.205 +
   7.206 +/* Return nonzero if the given thread is still alive.  */
   7.207 +static int
   7.208 +linux_thread_alive (int tid)
   7.209 +{
   7.210 +    if (find_inferior_id (&all_threads, tid) != NULL)
   7.211 +	return 1;
   7.212 +    else
   7.213 +	return 0;
   7.214 +}
   7.215 +
   7.216 +/* Wait for process, returns status.  */
   7.217 +
   7.218 +static unsigned char
   7.219 +linux_wait (char *status)
   7.220 +{
   7.221 +  int w;
   7.222 +  if (myxcwait(current_domain, &w, 0))
   7.223 +      return -1;
   7.224 +  
   7.225 +  if (w & (DOMFLAGS_SHUTDOWN|DOMFLAGS_DYING)) {
   7.226 +      *status = 'W';
   7.227 +      return 0;
   7.228 +  }
   7.229 +
   7.230 +
   7.231 +  *status = 'T';
   7.232 +  if (expect_signal)
   7.233 +      return expect_signal;
   7.234 +  else
   7.235 +      return SIGTRAP;
   7.236 +
   7.237 +}
   7.238 +
   7.239 +static void
   7.240 +linux_resume (struct thread_resume *resume_info)
   7.241 +{
   7.242 +  int step = resume_info->step;
   7.243 +  TRACE_ENTER;
   7.244 +  expect_signal = resume_info->sig;
   7.245 +  for_each_inferior(&all_threads, regcache_invalidate_one);
   7.246 +
   7.247 +  myptrace (step ? PTRACE_SINGLESTEP : PTRACE_CONT, current_domain, 0, 0);
   7.248 +
   7.249 +}
   7.250 +
   7.251 +
   7.252 +static int
   7.253 +regsets_fetch_inferior_registers ()
   7.254 +{
   7.255 +  struct regset_info *regset;
   7.256 +  TRACE_ENTER;
   7.257 +  regset = target_regsets;
   7.258 +
   7.259 +  while (regset->size >= 0)
   7.260 +    {
   7.261 +      void *buf;
   7.262 +      int res;
   7.263 +
   7.264 +      if (regset->size == 0)
   7.265 +	{
   7.266 +	  regset ++;
   7.267 +	  continue;
   7.268 +	}
   7.269 +
   7.270 +      buf = malloc (regset->size);
   7.271 +      res = myptrace (regset->get_request, inferior_pid, 0, (PTRACE_XFER_TYPE)buf);
   7.272 +      if (res < 0)
   7.273 +	{
   7.274 +	  if (errno == EIO)
   7.275 +	    {
   7.276 +	      /* If we get EIO on the first regset, do not try regsets again.
   7.277 +		 If we get EIO on a later regset, disable that regset.  */
   7.278 +	      if (regset == target_regsets)
   7.279 +		{
   7.280 +		  use_regsets_p = 0;
   7.281 +		  return -1;
   7.282 +		}
   7.283 +	      else
   7.284 +		{
   7.285 +		  regset->size = 0;
   7.286 +		  continue;
   7.287 +		}
   7.288 +	    }
   7.289 +	  else
   7.290 +	    {
   7.291 +	      char s[256];
   7.292 +	      sprintf (s, "ptrace(regsets_fetch_inferior_registers) PID=%d",
   7.293 +		       inferior_pid);
   7.294 +	      perror (s);
   7.295 +	    }
   7.296 +	}
   7.297 +      regset->store_function (buf);
   7.298 +      regset ++;
   7.299 +    }
   7.300 +  return 0;
   7.301 +}
   7.302 +
   7.303 +static int
   7.304 +regsets_store_inferior_registers ()
   7.305 +{
   7.306 +  struct regset_info *regset;
   7.307 +  TRACE_ENTER;
   7.308 +  regset = target_regsets;
   7.309 +
   7.310 +  while (regset->size >= 0)
   7.311 +    {
   7.312 +      void *buf;
   7.313 +      int res;
   7.314 +
   7.315 +      if (regset->size == 0)
   7.316 +	{
   7.317 +	  regset ++;
   7.318 +	  continue;
   7.319 +	}
   7.320 +
   7.321 +      buf = malloc (regset->size);
   7.322 +      regset->fill_function (buf);
   7.323 +      res = myptrace (regset->set_request, inferior_pid, 0, (PTRACE_XFER_TYPE)buf);
   7.324 +      if (res < 0)
   7.325 +	{
   7.326 +	  if (errno == EIO)
   7.327 +	    {
   7.328 +	      /* If we get EIO on the first regset, do not try regsets again.
   7.329 +		 If we get EIO on a later regset, disable that regset.  */
   7.330 +	      if (regset == target_regsets)
   7.331 +		{
   7.332 +		  use_regsets_p = 0;
   7.333 +		  return -1;
   7.334 +		}
   7.335 +	      else
   7.336 +		{
   7.337 +		  regset->size = 0;
   7.338 +		  continue;
   7.339 +		}
   7.340 +	    }
   7.341 +	  else
   7.342 +	    {
   7.343 +#ifdef DEBUG
   7.344 +	      perror ("Warning: ptrace(regsets_store_inferior_registers)");
   7.345 +#endif
   7.346 +	    }
   7.347 +	}
   7.348 +      regset ++;
   7.349 +      free (buf);
   7.350 +    }
   7.351 +  return 0;
   7.352 +}
   7.353 +
   7.354 +
   7.355 +
   7.356 +
   7.357 +void
   7.358 +linux_fetch_registers (int regno)
   7.359 +{
   7.360 +  if (use_regsets_p)
   7.361 +    {
   7.362 +      if (regsets_fetch_inferior_registers () == 0)
   7.363 +	return;
   7.364 +    }
   7.365 +
   7.366 +}
   7.367 +
   7.368 +void
   7.369 +linux_store_registers (int regno)
   7.370 +{
   7.371 +  if (use_regsets_p)
   7.372 +    {
   7.373 +      if (regsets_store_inferior_registers () == 0)
   7.374 +	return;
   7.375 +    }
   7.376 +}
   7.377 +
   7.378 +
   7.379 +/* Copy LEN bytes from inferior's memory starting at MEMADDR
   7.380 +   to debugger memory starting at MYADDR.  */
   7.381 +
   7.382 +static int
   7.383 +linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
   7.384 +{
   7.385 +  register int i;
   7.386 +  /* Round starting address down to longword boundary.  */
   7.387 +  register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
   7.388 +  /* Round ending address up; get number of longwords that makes.  */
   7.389 +  register int count
   7.390 +    = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
   7.391 +      / sizeof (PTRACE_XFER_TYPE);
   7.392 +  /* Allocate buffer of that many longwords.  */
   7.393 +  register PTRACE_XFER_TYPE *buffer
   7.394 +    = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
   7.395 +
   7.396 +  TRACE_ENTER;
   7.397 +  /* Read all the longwords */
   7.398 +  for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
   7.399 +    {
   7.400 +      errno = 0;
   7.401 +      buffer[i] = myptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0);
   7.402 +      if (errno)
   7.403 +	return errno;
   7.404 +    }
   7.405 +
   7.406 +  /* Copy appropriate bytes out of the buffer.  */
   7.407 +  memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len);
   7.408 +
   7.409 +  return 0;
   7.410 +}
   7.411 +
   7.412 +/* Copy LEN bytes of data from debugger memory at MYADDR
   7.413 +   to inferior's memory at MEMADDR.
   7.414 +   On failure (cannot write the inferior)
   7.415 +   returns the value of errno.  */
   7.416 +
   7.417 +static int
   7.418 +linux_write_memory (CORE_ADDR memaddr, const char *myaddr, int len)
   7.419 +{
   7.420 +  register int i;
   7.421 +  /* Round starting address down to longword boundary.  */
   7.422 +  register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
   7.423 +  /* Round ending address up; get number of longwords that makes.  */
   7.424 +  register int count
   7.425 +  = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) / sizeof (PTRACE_XFER_TYPE);
   7.426 +  /* Allocate buffer of that many longwords.  */
   7.427 +  register PTRACE_XFER_TYPE *buffer = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
   7.428 +  extern int errno;
   7.429 +
   7.430 +  TRACE_ENTER;
   7.431 +
   7.432 +  /* Fill start and end extra bytes of buffer with existing memory data.  */
   7.433 +
   7.434 +  buffer[0] = myptrace (PTRACE_PEEKTEXT, inferior_pid,
   7.435 +		      (PTRACE_ARG3_TYPE) addr, 0);
   7.436 +
   7.437 +  if (count > 1)
   7.438 +    {
   7.439 +      buffer[count - 1]
   7.440 +	= myptrace (PTRACE_PEEKTEXT, inferior_pid,
   7.441 +		  (PTRACE_ARG3_TYPE) (addr + (count - 1)
   7.442 +				      * sizeof (PTRACE_XFER_TYPE)),
   7.443 +		  0);
   7.444 +    }
   7.445 +
   7.446 +  /* Copy data to be written over corresponding part of buffer */
   7.447 +
   7.448 +  memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), myaddr, len);
   7.449 +
   7.450 +  /* Write the entire buffer.  */
   7.451 +  for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
   7.452 +    {
   7.453 +      errno = 0;
   7.454 +      myptrace (PTRACE_POKETEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]);
   7.455 +      if (errno)
   7.456 +	return errno;
   7.457 +    }
   7.458 +
   7.459 +  return 0;
   7.460 +}
   7.461 +
   7.462 +static void
   7.463 +linux_look_up_symbols (void)
   7.464 +{
   7.465 +#if 0
   7.466 +  using_threads = thread_db_init ();
   7.467 +#endif
   7.468 +}
   7.469 +
   7.470 +static void
   7.471 +linux_send_signal (int signum)
   7.472 +{
   7.473 +  extern int signal_pid;
   7.474 +
   7.475 +  TRACE_ENTER;
   7.476 +  signal_to_send = signum;
   7.477 +  psignal(signum, "need to send ");
   7.478 +  if (cont_thread > 0)
   7.479 +    {
   7.480 +      struct process_info *process;
   7.481 +
   7.482 +      process = get_thread_process (current_inferior);
   7.483 +      kill (process->lwpid, signum);
   7.484 +    }
   7.485 +  else
   7.486 +    kill (signal_pid, signum);
   7.487 +}
   7.488 +
   7.489 +/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
   7.490 +   to debugger memory starting at MYADDR.  */
   7.491 +
   7.492 +static int
   7.493 +linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len)
   7.494 +{
   7.495 +  char filename[PATH_MAX];
   7.496 +  int fd, n;
   7.497 +
   7.498 +  TRACE_ENTER;
   7.499 +  snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid);
   7.500 +
   7.501 +  fd = open (filename, O_RDONLY);
   7.502 +  if (fd < 0)
   7.503 +    return -1;
   7.504 +
   7.505 +  if (offset != (CORE_ADDR) 0
   7.506 +      && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset)
   7.507 +    n = -1;
   7.508 +  else
   7.509 +    n = read (fd, myaddr, len);
   7.510 +
   7.511 +  close (fd);
   7.512 +
   7.513 +  return n;
   7.514 +}
   7.515 +
   7.516 +
   7.517 +static struct target_ops linux_xen_target_ops = {
   7.518 +  linux_create_inferior,
   7.519 +  linux_attach,
   7.520 +  linux_kill,
   7.521 +  linux_detach,
   7.522 +  linux_thread_alive,
   7.523 +  linux_resume,
   7.524 +  linux_wait,
   7.525 +  linux_fetch_registers,
   7.526 +  linux_store_registers,
   7.527 +  linux_read_memory,
   7.528 +  linux_write_memory,
   7.529 +  linux_look_up_symbols,
   7.530 +  linux_send_signal,
   7.531 +  linux_read_auxv,
   7.532 +};
   7.533 +
   7.534 +static void
   7.535 +linux_init_signals ()
   7.536 +{
   7.537 +  /* FIXME drow/2002-06-09: As above, we should check with LinuxThreads
   7.538 +     to find what the cancel signal actually is.  */
   7.539 +  signal (__SIGRTMIN+1, SIG_IGN);
   7.540 +}
   7.541 +
   7.542 +void
   7.543 +initialize_low (void)
   7.544 +{
   7.545 +
   7.546 +  set_target_ops (&linux_xen_target_ops);
   7.547 +  set_breakpoint_data (the_low_target.breakpoint,
   7.548 +		       the_low_target.breakpoint_len);
   7.549 +  init_registers ();
   7.550 +  linux_init_signals ();
   7.551 +  if (isfile) {
   7.552 +      myptrace = xc_ptrace_core;
   7.553 +      myxcwait = xc_waitdomain_core;
   7.554 +  } else {
   7.555 +      myptrace = xc_ptrace;
   7.556 +      myxcwait = xc_waitdomain;
   7.557 +  }
   7.558 +
   7.559 +}
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/server.c	Sat Jun 04 15:27:59 2005 +0000
     8.3 @@ -0,0 +1,639 @@
     8.4 +/* Main code for remote server for GDB.
     8.5 +   Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004
     8.6 +   Free Software Foundation, Inc.
     8.7 +
     8.8 +   This file is part of GDB.
     8.9 +
    8.10 +   This program is free software; you can redistribute it and/or modify
    8.11 +   it under the terms of the GNU General Public License as published by
    8.12 +   the Free Software Foundation; either version 2 of the License, or
    8.13 +   (at your option) any later version.
    8.14 +
    8.15 +   This program is distributed in the hope that it will be useful,
    8.16 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.17 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    8.18 +   GNU General Public License for more details.
    8.19 +
    8.20 +   You should have received a copy of the GNU General Public License
    8.21 +   along with this program; if not, write to the Free Software
    8.22 +   Foundation, Inc., 59 Temple Place - Suite 330,
    8.23 +   Boston, MA 02111-1307, USA.  */
    8.24 +
    8.25 +#include "server.h"
    8.26 +
    8.27 +#include <unistd.h>
    8.28 +#include <signal.h>
    8.29 +#include <sys/wait.h>
    8.30 +#include <sys/types.h>
    8.31 +#include <sys/stat.h>
    8.32 +#include <fcntl.h>
    8.33 +
    8.34 +int cont_thread;
    8.35 +int general_thread;
    8.36 +int step_thread;
    8.37 +int thread_from_wait;
    8.38 +int old_thread_from_wait;
    8.39 +int extended_protocol;
    8.40 +int server_waiting;
    8.41 +int isfile = 0;
    8.42 +
    8.43 +jmp_buf toplevel;
    8.44 +
    8.45 +/* The PID of the originally created or attached inferior.  Used to
    8.46 +   send signals to the process when GDB sends us an asynchronous interrupt
    8.47 +   (user hitting Control-C in the client), and to wait for the child to exit
    8.48 +   when no longer debugging it.  */
    8.49 +
    8.50 +int signal_pid;
    8.51 +
    8.52 +static unsigned char
    8.53 +start_inferior (char *argv[], char *statusptr)
    8.54 +{
    8.55 +  signal (SIGTTOU, SIG_DFL);
    8.56 +  signal (SIGTTIN, SIG_DFL);
    8.57 +
    8.58 +  signal_pid = create_inferior (argv[0], argv);
    8.59 +
    8.60 +  fprintf (stderr, "Process %s created; pid = %d\n", argv[0],
    8.61 +	   signal_pid);
    8.62 +
    8.63 +  signal (SIGTTOU, SIG_IGN);
    8.64 +  signal (SIGTTIN, SIG_IGN);
    8.65 +  tcsetpgrp (fileno (stderr), signal_pid);
    8.66 +
    8.67 +  /* Wait till we are at 1st instruction in program, return signal number.  */
    8.68 +  return mywait (statusptr, 0);
    8.69 +}
    8.70 +
    8.71 +static int
    8.72 +attach_inferior (int pid, char *statusptr, unsigned char *sigptr)
    8.73 +{
    8.74 +  /* myattach should return -1 if attaching is unsupported,
    8.75 +     0 if it succeeded, and call error() otherwise.  */
    8.76 +
    8.77 +  if (myattach (pid) != 0)
    8.78 +    return -1;
    8.79 +
    8.80 +  fprintf (stderr, "Attached; pid = %d\n", pid);
    8.81 +
    8.82 +  /* FIXME - It may be that we should get the SIGNAL_PID from the
    8.83 +     attach function, so that it can be the main thread instead of
    8.84 +     whichever we were told to attach to.  */
    8.85 +  signal_pid = pid;
    8.86 +
    8.87 +  *sigptr = mywait (statusptr, 0);
    8.88 +
    8.89 +  return 0;
    8.90 +}
    8.91 +
    8.92 +extern int remote_debug;
    8.93 +
    8.94 +/* Handle all of the extended 'q' packets.  */
    8.95 +void
    8.96 +handle_query (char *own_buf)
    8.97 +{
    8.98 +  static struct inferior_list_entry *thread_ptr;
    8.99 +
   8.100 +  if (strcmp ("qSymbol::", own_buf) == 0)
   8.101 +    {
   8.102 +      if (the_target->look_up_symbols != NULL)
   8.103 +	(*the_target->look_up_symbols) ();
   8.104 +
   8.105 +      strcpy (own_buf, "OK");
   8.106 +      return;
   8.107 +    }
   8.108 +
   8.109 +  if (strcmp ("qfThreadInfo", own_buf) == 0)
   8.110 +    {
   8.111 +      thread_ptr = all_threads.head;
   8.112 +      sprintf (own_buf, "m%x", thread_ptr->id);
   8.113 +      thread_ptr = thread_ptr->next;
   8.114 +      return;
   8.115 +    }
   8.116 +
   8.117 +  if (strcmp ("qsThreadInfo", own_buf) == 0)
   8.118 +    {
   8.119 +      if (thread_ptr != NULL)
   8.120 +	{
   8.121 +	  sprintf (own_buf, "m%x", thread_ptr->id);
   8.122 +	  thread_ptr = thread_ptr->next;
   8.123 +	  return;
   8.124 +	}
   8.125 +      else
   8.126 +	{
   8.127 +	  sprintf (own_buf, "l");
   8.128 +	  return;
   8.129 +	}
   8.130 +    }
   8.131 +
   8.132 +  if (the_target->read_auxv != NULL
   8.133 +      && strncmp ("qPart:auxv:read::", own_buf, 17) == 0)
   8.134 +    {
   8.135 +      char data[(PBUFSIZ - 1) / 2];
   8.136 +      CORE_ADDR ofs;
   8.137 +      unsigned int len;
   8.138 +      int n;
   8.139 +      decode_m_packet (&own_buf[17], &ofs, &len); /* "OFS,LEN" */
   8.140 +      if (len > sizeof data)
   8.141 +	len = sizeof data;
   8.142 +      n = (*the_target->read_auxv) (ofs, data, len);
   8.143 +      if (n == 0)
   8.144 +	write_ok (own_buf);
   8.145 +      else if (n < 0)
   8.146 +	write_enn (own_buf);
   8.147 +      else
   8.148 +	convert_int_to_ascii (data, own_buf, n);
   8.149 +      return;
   8.150 +    }
   8.151 +
   8.152 +  /* Otherwise we didn't know what packet it was.  Say we didn't
   8.153 +     understand it.  */
   8.154 +  own_buf[0] = 0;
   8.155 +}
   8.156 +
   8.157 +/* Parse vCont packets.  */
   8.158 +void
   8.159 +handle_v_cont (char *own_buf, char *status, unsigned char *signal)
   8.160 +{
   8.161 +  char *p, *q;
   8.162 +  int n = 0, i = 0;
   8.163 +  struct thread_resume *resume_info, default_action;
   8.164 +
   8.165 +  /* Count the number of semicolons in the packet.  There should be one
   8.166 +     for every action.  */
   8.167 +  p = &own_buf[5];
   8.168 +  while (p)
   8.169 +    {
   8.170 +      n++;
   8.171 +      p++;
   8.172 +      p = strchr (p, ';');
   8.173 +    }
   8.174 +  /* Allocate room for one extra action, for the default remain-stopped
   8.175 +     behavior; if no default action is in the list, we'll need the extra
   8.176 +     slot.  */
   8.177 +  resume_info = malloc ((n + 1) * sizeof (resume_info[0]));
   8.178 +
   8.179 +  default_action.thread = -1;
   8.180 +  default_action.leave_stopped = 1;
   8.181 +  default_action.step = 0;
   8.182 +  default_action.sig = 0;
   8.183 +
   8.184 +  p = &own_buf[5];
   8.185 +  i = 0;
   8.186 +  while (*p)
   8.187 +    {
   8.188 +      p++;
   8.189 +
   8.190 +      resume_info[i].leave_stopped = 0;
   8.191 +
   8.192 +      if (p[0] == 's' || p[0] == 'S')
   8.193 +	resume_info[i].step = 1;
   8.194 +      else if (p[0] == 'c' || p[0] == 'C')
   8.195 +	resume_info[i].step = 0;
   8.196 +      else
   8.197 +	goto err;
   8.198 +
   8.199 +      if (p[0] == 'S' || p[0] == 'C')
   8.200 +	{
   8.201 +	  int sig;
   8.202 +	  sig = strtol (p + 1, &q, 16);
   8.203 +	  if (p == q)
   8.204 +	    goto err;
   8.205 +	  p = q;
   8.206 +
   8.207 +	  if (!target_signal_to_host_p (sig))
   8.208 +	    goto err;
   8.209 +	  resume_info[i].sig = target_signal_to_host (sig);
   8.210 +	}
   8.211 +      else
   8.212 +	{
   8.213 +	  resume_info[i].sig = 0;
   8.214 +	  p = p + 1;
   8.215 +	}
   8.216 +
   8.217 +      if (p[0] == 0)
   8.218 +	{
   8.219 +	  resume_info[i].thread = -1;
   8.220 +	  default_action = resume_info[i];
   8.221 +
   8.222 +	  /* Note: we don't increment i here, we'll overwrite this entry
   8.223 +	     the next time through.  */
   8.224 +	}
   8.225 +      else if (p[0] == ':')
   8.226 +	{
   8.227 +	  resume_info[i].thread = strtol (p + 1, &q, 16);
   8.228 +	  if (p == q)
   8.229 +	    goto err;
   8.230 +	  p = q;
   8.231 +	  if (p[0] != ';' && p[0] != 0)
   8.232 +	    goto err;
   8.233 +
   8.234 +	  i++;
   8.235 +	}
   8.236 +    }
   8.237 +
   8.238 +  resume_info[i] = default_action;
   8.239 +
   8.240 +  /* Still used in occasional places in the backend.  */
   8.241 +  if (n == 1 && resume_info[0].thread != -1)
   8.242 +    cont_thread = resume_info[0].thread;
   8.243 +  else
   8.244 +    cont_thread = -1;
   8.245 +  set_desired_inferior (0);
   8.246 +
   8.247 +  (*the_target->resume) (resume_info);
   8.248 +
   8.249 +  free (resume_info);
   8.250 +
   8.251 +  *signal = mywait (status, 1);
   8.252 +  prepare_resume_reply (own_buf, *status, *signal);
   8.253 +  return;
   8.254 +
   8.255 +err:
   8.256 +  /* No other way to report an error... */
   8.257 +  strcpy (own_buf, "");
   8.258 +  free (resume_info);
   8.259 +  return;
   8.260 +}
   8.261 +
   8.262 +/* Handle all of the extended 'v' packets.  */
   8.263 +void
   8.264 +handle_v_requests (char *own_buf, char *status, unsigned char *signal)
   8.265 +{
   8.266 +  if (strncmp (own_buf, "vCont;", 6) == 0)
   8.267 +    {
   8.268 +      handle_v_cont (own_buf, status, signal);
   8.269 +      return;
   8.270 +    }
   8.271 +
   8.272 +  if (strncmp (own_buf, "vCont?", 6) == 0)
   8.273 +    {
   8.274 +      strcpy (own_buf, "vCont;c;C;s;S");
   8.275 +      return;
   8.276 +    }
   8.277 +
   8.278 +  /* Otherwise we didn't know what packet it was.  Say we didn't
   8.279 +     understand it.  */
   8.280 +  own_buf[0] = 0;
   8.281 +  return;
   8.282 +}
   8.283 +
   8.284 +void
   8.285 +myresume (int step, int sig)
   8.286 +{
   8.287 +  struct thread_resume resume_info[2];
   8.288 +  int n = 0;
   8.289 +
   8.290 +  if (step || sig || cont_thread > 0)
   8.291 +    {
   8.292 +      resume_info[0].thread
   8.293 +	= ((struct inferior_list_entry *) current_inferior)->id;
   8.294 +      resume_info[0].step = step;
   8.295 +      resume_info[0].sig = sig;
   8.296 +      resume_info[0].leave_stopped = 0;
   8.297 +      n++;
   8.298 +    }
   8.299 +  resume_info[n].thread = -1;
   8.300 +  resume_info[n].step = 0;
   8.301 +  resume_info[n].sig = 0;
   8.302 +  resume_info[n].leave_stopped = (cont_thread > 0);
   8.303 +
   8.304 +  (*the_target->resume) (resume_info);
   8.305 +}
   8.306 +
   8.307 +static int attached;
   8.308 +
   8.309 +static void
   8.310 +gdbserver_usage (void)
   8.311 +{
   8.312 +  error ("Usage:\tgdbserver COMM PROG [ARGS ...]\n"
   8.313 +	 "\tgdbserver COMM --attach PID\n"
   8.314 +	 "\tgdbserver COMM --file COREFILE\n"
   8.315 +	 "\n"
   8.316 +	 "COMM may either be a tty device (for serial debugging), or \n"
   8.317 +	 "HOST:PORT to listen for a TCP connection.\n");
   8.318 +}
   8.319 +
   8.320 +int
   8.321 +main (int argc, char *argv[])
   8.322 +{
   8.323 +  char ch, status, *own_buf, mem_buf[2000];
   8.324 +  int i = 0;
   8.325 +  unsigned char signal;
   8.326 +  unsigned int len;
   8.327 +  CORE_ADDR mem_addr;
   8.328 +  int bad_attach;
   8.329 +  int pid;
   8.330 +  char *arg_end;
   8.331 +
   8.332 +  if (setjmp (toplevel))
   8.333 +    {
   8.334 +      fprintf (stderr, "Exiting\n");
   8.335 +      exit (1);
   8.336 +    }
   8.337 +
   8.338 +  bad_attach = 0;
   8.339 +  pid = 0;
   8.340 +  attached = 0;
   8.341 +  if (argc >= 3 && strcmp (argv[2], "--attach") == 0)
   8.342 +    {
   8.343 +      if (argc == 4
   8.344 +	  && argv[3] != '\0'
   8.345 +	  && (pid = strtoul (argv[3], &arg_end, 10)) != 0
   8.346 +	  && *arg_end == '\0')
   8.347 +	{
   8.348 +	  ;
   8.349 +	}
   8.350 +      else
   8.351 +	bad_attach = 1;
   8.352 +    }
   8.353 +  else if (argc >= 3 && strcmp (argv[2], "--file") == 0)
   8.354 +    {
   8.355 +      if (argc == 4
   8.356 +	  && argv[3] != '\0')
   8.357 +	{
   8.358 +	  if ((pid = open(argv[3], O_RDONLY)) <= 0) 
   8.359 +	    bad_attach = 1;
   8.360 +	  else 
   8.361 +	    isfile = 1;
   8.362 +	}
   8.363 +      else
   8.364 +	bad_attach = 1;
   8.365 +    }
   8.366 +
   8.367 +  if (argc < 3 || bad_attach)
   8.368 +    gdbserver_usage();
   8.369 +
   8.370 +  initialize_low ();
   8.371 +
   8.372 +  own_buf = malloc (PBUFSIZ);
   8.373 +
   8.374 +  if (pid == 0)
   8.375 +    {
   8.376 +      /* Wait till we are at first instruction in program.  */
   8.377 +      signal = start_inferior (&argv[2], &status);
   8.378 +
   8.379 +      /* We are now stopped at the first instruction of the target process */
   8.380 +    }
   8.381 +  else
   8.382 +    {
   8.383 +      switch (attach_inferior (pid, &status, &signal))
   8.384 +	{
   8.385 +	case -1:
   8.386 +	  error ("Attaching not supported on this target");
   8.387 +	  break;
   8.388 +	default:
   8.389 +	  attached = 1;
   8.390 +	  break;
   8.391 +	}
   8.392 +    }
   8.393 +
   8.394 +  while (1)
   8.395 +    {
   8.396 +      remote_open (argv[1]);
   8.397 +
   8.398 +    restart:
   8.399 +      setjmp (toplevel);
   8.400 +      while (getpkt (own_buf) > 0)
   8.401 +	{
   8.402 +	  unsigned char sig;
   8.403 +	  i = 0;
   8.404 +	  ch = own_buf[i++];
   8.405 +	  switch (ch)
   8.406 +	    {
   8.407 +	    case 'q':
   8.408 +	      handle_query (own_buf);
   8.409 +	      break;
   8.410 +	    case 'd':
   8.411 +	      remote_debug = !remote_debug;
   8.412 +	      break;
   8.413 +	    case 'D':
   8.414 +	      fprintf (stderr, "Detaching from inferior\n");
   8.415 +	      detach_inferior ();
   8.416 +	      write_ok (own_buf);
   8.417 +	      putpkt (own_buf);
   8.418 +	      remote_close ();
   8.419 +
   8.420 +	      /* If we are attached, then we can exit.  Otherwise, we need to
   8.421 +		 hang around doing nothing, until the child is gone.  */
   8.422 +	      if (!attached)
   8.423 +		{
   8.424 +		  int status, ret;
   8.425 +
   8.426 +		  do {
   8.427 +		    ret = waitpid (signal_pid, &status, 0);
   8.428 +		    if (WIFEXITED (status) || WIFSIGNALED (status))
   8.429 +		      break;
   8.430 +		  } while (ret != -1 || errno != ECHILD);
   8.431 +		}
   8.432 +
   8.433 +	      exit (0);
   8.434 +
   8.435 +	    case '!':
   8.436 +	      if (attached == 0)
   8.437 +		{
   8.438 +		  extended_protocol = 1;
   8.439 +		  prepare_resume_reply (own_buf, status, signal);
   8.440 +		}
   8.441 +	      else
   8.442 +		{
   8.443 +		  /* We can not use the extended protocol if we are
   8.444 +		     attached, because we can not restart the running
   8.445 +		     program.  So return unrecognized.  */
   8.446 +		  own_buf[0] = '\0';
   8.447 +		}
   8.448 +	      break;
   8.449 +	    case '?':
   8.450 +	      prepare_resume_reply (own_buf, status, signal);
   8.451 +	      break;
   8.452 +	    case 'H':
   8.453 +	      switch (own_buf[1])
   8.454 +		{
   8.455 +		case 'g':
   8.456 +		  general_thread = strtol (&own_buf[2], NULL, 16);
   8.457 +		  write_ok (own_buf);
   8.458 +		  set_desired_inferior (1);
   8.459 +		  break;
   8.460 +		case 'c':
   8.461 +		  cont_thread = strtol (&own_buf[2], NULL, 16);
   8.462 +		  write_ok (own_buf);
   8.463 +		  break;
   8.464 +		case 's':
   8.465 +		  step_thread = strtol (&own_buf[2], NULL, 16);
   8.466 +		  write_ok (own_buf);
   8.467 +		  break;
   8.468 +		default:
   8.469 +		  /* Silently ignore it so that gdb can extend the protocol
   8.470 +		     without compatibility headaches.  */
   8.471 +		  own_buf[0] = '\0';
   8.472 +		  break;
   8.473 +		}
   8.474 +	      break;
   8.475 +	    case 'g':
   8.476 +	      set_desired_inferior (1);
   8.477 +	      registers_to_string (own_buf);
   8.478 +	      break;
   8.479 +	    case 'G':
   8.480 +	      set_desired_inferior (1);
   8.481 +	      registers_from_string (&own_buf[1]);
   8.482 +	      write_ok (own_buf);
   8.483 +	      break;
   8.484 +	    case 'm':
   8.485 +	      decode_m_packet (&own_buf[1], &mem_addr, &len);
   8.486 +	      if (read_inferior_memory (mem_addr, mem_buf, len) == 0)
   8.487 +		convert_int_to_ascii (mem_buf, own_buf, len);
   8.488 +	      else
   8.489 +		write_enn (own_buf);
   8.490 +	      break;
   8.491 +	    case 'M':
   8.492 +	      decode_M_packet (&own_buf[1], &mem_addr, &len, mem_buf);
   8.493 +	      if (write_inferior_memory (mem_addr, mem_buf, len) == 0)
   8.494 +		write_ok (own_buf);
   8.495 +	      else
   8.496 +		write_enn (own_buf);
   8.497 +	      break;
   8.498 +	    case 'C':
   8.499 +	      convert_ascii_to_int (own_buf + 1, &sig, 1);
   8.500 +	      if (target_signal_to_host_p (sig))
   8.501 +		signal = target_signal_to_host (sig);
   8.502 +	      else
   8.503 +		signal = 0;
   8.504 +	      set_desired_inferior (0);
   8.505 +	      myresume (0, signal);
   8.506 +	      signal = mywait (&status, 1);
   8.507 +	      prepare_resume_reply (own_buf, status, signal);
   8.508 +	      break;
   8.509 +	    case 'S':
   8.510 +	      convert_ascii_to_int (own_buf + 1, &sig, 1);
   8.511 +	      if (target_signal_to_host_p (sig))
   8.512 +		signal = target_signal_to_host (sig);
   8.513 +	      else
   8.514 +		signal = 0;
   8.515 +	      set_desired_inferior (0);
   8.516 +	      myresume (1, signal);
   8.517 +	      signal = mywait (&status, 1);
   8.518 +	      prepare_resume_reply (own_buf, status, signal);
   8.519 +	      break;
   8.520 +	    case 'c':
   8.521 +	      set_desired_inferior (0);
   8.522 +	      myresume (0, 0);
   8.523 +	      signal = mywait (&status, 1);
   8.524 +	      prepare_resume_reply (own_buf, status, signal);
   8.525 +	      break;
   8.526 +	    case 's':
   8.527 +	      set_desired_inferior (0);
   8.528 +	      myresume (1, 0);
   8.529 +	      signal = mywait (&status, 1);
   8.530 +	      prepare_resume_reply (own_buf, status, signal);
   8.531 +	      break;
   8.532 +	    case 'k':
   8.533 +	      fprintf (stderr, "Killing inferior\n");
   8.534 +	      kill_inferior ();
   8.535 +	      /* When using the extended protocol, we start up a new
   8.536 +	         debugging session.   The traditional protocol will
   8.537 +	         exit instead.  */
   8.538 +	      if (extended_protocol)
   8.539 +		{
   8.540 +		  write_ok (own_buf);
   8.541 +		  fprintf (stderr, "GDBserver restarting\n");
   8.542 +
   8.543 +		  /* Wait till we are at 1st instruction in prog.  */
   8.544 +		  signal = start_inferior (&argv[2], &status);
   8.545 +		  goto restart;
   8.546 +		  break;
   8.547 +		}
   8.548 +	      else
   8.549 +		{
   8.550 +		  exit (0);
   8.551 +		  break;
   8.552 +		}
   8.553 +	    case 'T':
   8.554 +	      if (mythread_alive (strtol (&own_buf[1], NULL, 16)))
   8.555 +		write_ok (own_buf);
   8.556 +	      else
   8.557 +		write_enn (own_buf);
   8.558 +	      break;
   8.559 +	    case 'R':
   8.560 +	      /* Restarting the inferior is only supported in the
   8.561 +	         extended protocol.  */
   8.562 +	      if (extended_protocol)
   8.563 +		{
   8.564 +		  kill_inferior ();
   8.565 +		  write_ok (own_buf);
   8.566 +		  fprintf (stderr, "GDBserver restarting\n");
   8.567 +
   8.568 +		  /* Wait till we are at 1st instruction in prog.  */
   8.569 +		  signal = start_inferior (&argv[2], &status);
   8.570 +		  goto restart;
   8.571 +		  break;
   8.572 +		}
   8.573 +	      else
   8.574 +		{
   8.575 +		  /* It is a request we don't understand.  Respond with an
   8.576 +		     empty packet so that gdb knows that we don't support this
   8.577 +		     request.  */
   8.578 +		  own_buf[0] = '\0';
   8.579 +		  break;
   8.580 +		}
   8.581 +	    case 'v':
   8.582 +	      /* Extended (long) request.  */
   8.583 +	      handle_v_requests (own_buf, &status, &signal);
   8.584 +	      break;
   8.585 +	    default:
   8.586 +	      /* It is a request we don't understand.  Respond with an
   8.587 +	         empty packet so that gdb knows that we don't support this
   8.588 +	         request.  */
   8.589 +	      own_buf[0] = '\0';
   8.590 +	      break;
   8.591 +	    }
   8.592 +
   8.593 +	  putpkt (own_buf);
   8.594 +
   8.595 +	  if (status == 'W')
   8.596 +	    fprintf (stderr,
   8.597 +		     "\nChild exited with status %d\n", signal);
   8.598 +	  if (status == 'X')
   8.599 +	    fprintf (stderr, "\nChild terminated with signal = 0x%x\n",
   8.600 +		     signal);
   8.601 +	  if (status == 'W' || status == 'X')
   8.602 +	    {
   8.603 +	      if (extended_protocol)
   8.604 +		{
   8.605 +		  fprintf (stderr, "Killing inferior\n");
   8.606 +		  kill_inferior ();
   8.607 +		  write_ok (own_buf);
   8.608 +		  fprintf (stderr, "GDBserver restarting\n");
   8.609 +
   8.610 +		  /* Wait till we are at 1st instruction in prog.  */
   8.611 +		  signal = start_inferior (&argv[2], &status);
   8.612 +		  goto restart;
   8.613 +		  break;
   8.614 +		}
   8.615 +	      else
   8.616 +		{
   8.617 +		  fprintf (stderr, "GDBserver exiting\n");
   8.618 +		  exit (0);
   8.619 +		}
   8.620 +	    }
   8.621 +	}
   8.622 +
   8.623 +      /* We come here when getpkt fails.
   8.624 +
   8.625 +         For the extended remote protocol we exit (and this is the only
   8.626 +         way we gracefully exit!).
   8.627 +
   8.628 +         For the traditional remote protocol close the connection,
   8.629 +         and re-open it at the top of the loop.  */
   8.630 +      if (extended_protocol)
   8.631 +	{
   8.632 +	  remote_close ();
   8.633 +	  exit (0);
   8.634 +	}
   8.635 +      else
   8.636 +	{
   8.637 +	  fprintf (stderr, "Remote side has terminated connection.  "
   8.638 +			   "GDBserver will reopen the connection.\n");
   8.639 +	  remote_close ();
   8.640 +	}
   8.641 +    }
   8.642 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/mkbuildtree	Sat Jun 04 15:27:59 2005 +0000
     9.3 @@ -0,0 +1,115 @@
     9.4 +#!/bin/bash
     9.5 +
     9.6 +# mkbuildtree <build tree>
     9.7 +#
     9.8 +# Creates symbolic links in <build tree> for the sparse tree
     9.9 +# in the current directory.
    9.10 +
    9.11 +# Script to determine the relative path between two directories.
    9.12 +# Copyright (c) D. J. Hawkey Jr. 2002
    9.13 +# Fixed for Xen project by K. Fraser in 2003.  
    9.14 +abs_to_rel ()
    9.15 +{
    9.16 +	local CWD SRCPATH
    9.17 +                
    9.18 +	if [ "$1" != "/" -a "${1##*[^/]}" = "/" ]; then
    9.19 +		SRCPATH=${1%?}
    9.20 +	else
    9.21 +		SRCPATH=$1
    9.22 +	fi
    9.23 +	if [ "$2" != "/" -a "${2##*[^/]}" = "/" ]; then
    9.24 +		DESTPATH=${2%?}
    9.25 +	else
    9.26 +		DESTPATH=$2
    9.27 +	fi
    9.28 +
    9.29 +	CWD=$PWD
    9.30 +	[ "${1%%[^/]*}" != "/" ] && cd $1 && SRCPATH=$PWD
    9.31 +	[ "${2%%[^/]*}" != "/" ] && cd $2 && DESTPATH=$PWD
    9.32 +	[ "$CWD" != "$PWD" ] && cd $CWD
    9.33 +
    9.34 +	BASEPATH=$SRCPATH
    9.35 +
    9.36 +	[ "$SRCPATH" = "$DESTPATH" ] && DESTPATH="." && return
    9.37 +	[ "$SRCPATH" = "/" ] && DESTPATH=${DESTPATH#?} && return
    9.38 +
    9.39 +	while [ "$BASEPATH/" != "${DESTPATH%${DESTPATH#$BASEPATH/}}" ]; do
    9.40 +          BASEPATH=${BASEPATH%/*}
    9.41 +	done
    9.42 +
    9.43 +	SRCPATH=${SRCPATH#$BASEPATH}
    9.44 +        DESTPATH=${DESTPATH#$BASEPATH}
    9.45 +        DESTPATH=${DESTPATH#?}
    9.46 +	while [ -n "$SRCPATH" ]; do
    9.47 +		SRCPATH=${SRCPATH%/*}
    9.48 +		DESTPATH="../$DESTPATH"
    9.49 +	done
    9.50 +
    9.51 +	[ -z "$BASEPATH" ] && BASEPATH="/"
    9.52 +	[ "${DESTPATH##*[^/]}" = "/" ] && DESTPATH=${DESTPATH%?}
    9.53 +}
    9.54 +
    9.55 +# relative_lndir <target_dir>
    9.56 +# Creates a tree of symlinks in the current working directory that mirror
    9.57 +# real files in <target_dir>. <target_dir> should be relative to the current
    9.58 +# working directory. Symlinks in <target_dir> are ignored. Source-control files
    9.59 +# are ignored.
    9.60 +relative_lndir ()
    9.61 +{
    9.62 +  local SYMLINK_DIR REAL_DIR pref i j
    9.63 +  SYMLINK_DIR=$PWD
    9.64 +  REAL_DIR=$1
    9.65 +  (
    9.66 +  cd $REAL_DIR
    9.67 +  for i in `find . -type d | grep -v SCCS`; do
    9.68 +    [ -d $SYMLINK_DIR/$i ] || mkdir -p $SYMLINK_DIR/$i
    9.69 +    (
    9.70 +    cd $i
    9.71 +    pref=`echo $i | sed -e 's#/[^/]*#../#g' -e 's#^\.##'`
    9.72 +    for j in `find . -type f -o -type l -maxdepth 1`; do
    9.73 +      ln -sf ${pref}${REAL_DIR}/$i/$j ${SYMLINK_DIR}/$i/$j
    9.74 +    done
    9.75 +    )
    9.76 +  done
    9.77 +  )
    9.78 +}
    9.79 +
    9.80 +[ "$1" == "" ] && { echo "Syntax: $0 <linux tree to xenify>"; exit 1; }
    9.81 +
    9.82 +# Get absolute path to the destination directory
    9.83 +pushd . >/dev/null
    9.84 +cd ${1}
    9.85 +AD=$PWD
    9.86 +popd >/dev/null
    9.87 +  
    9.88 +# Get absolute path to the source directory
    9.89 +AS=`pwd`
    9.90 +
    9.91 +# Get name of sparse directory
    9.92 +SDN=$(basename $AS)
    9.93 +
    9.94 +# Get path to source, relative to destination
    9.95 +abs_to_rel ${AD} ${AS}
    9.96 +RS=$DESTPATH
    9.97 +
    9.98 +# We now work from the destination directory
    9.99 +cd ${AD}
   9.100 +
   9.101 +# Remove old symlinks
   9.102 +find sys -type l | while read f
   9.103 +do
   9.104 +  case $(readlink $f) in
   9.105 +  */$SDN/*)
   9.106 +    rm -f $f
   9.107 +    ;;
   9.108 +  esac
   9.109 +done
   9.110 +
   9.111 +if [ -f ${AD}/BUILDING ]; then
   9.112 +  # Create symlinks of files and directories which exist in the sparse source
   9.113 +  (cd sys && relative_lndir ../${RS}/sys)
   9.114 +else
   9.115 +  # Create symlinks of files and directories which exist in the sparse source
   9.116 +  relative_lndir ${RS}
   9.117 +  rm -f mkbuildtree
   9.118 +fi
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tools/debugger/gdb/gdbbuild	Sat Jun 04 15:27:59 2005 +0000
    10.3 @@ -0,0 +1,23 @@
    10.4 +#!/bin/sh
    10.5 +
    10.6 +XENROOT=`bk root`
    10.7 +export XENROOT
    10.8 +
    10.9 +cd $XENROOT/tools/debugger/gdb
   10.10 +rm -rf gdb-6.2.1  gdb-6.2.1-linux-i386-xen
   10.11 +# FIXME:cw this should be smarter
   10.12 +wget -c ftp://ftp.gnu.org/gnu/gdb/gdb-6.2.1.tar.bz2
   10.13 +tar xjf gdb-6.2.1.tar.bz2
   10.14 +
   10.15 +cd $XENROOT/tools/debugger/gdb/gdb-6.2.1-xen-sparse
   10.16 +./mkbuildtree ../gdb-6.2.1
   10.17 +
   10.18 +mkdir $XENROOT/tools/debugger/gdb/gdb-6.2.1-linux-i386-xen
   10.19 +cd $XENROOT/tools/debugger/gdb/gdb-6.2.1-linux-i386-xen
   10.20 +../gdb-6.2.1/configure
   10.21 +# some people don't have gmake
   10.22 +if which gmake ; then
   10.23 +    gmake -j4
   10.24 +else
   10.25 +    make -j4
   10.26 +fi
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/tools/debugger/libxendebug/Makefile	Sat Jun 04 15:27:59 2005 +0000
    11.3 @@ -0,0 +1,72 @@
    11.4 +
    11.5 +INSTALL		= install
    11.6 +INSTALL_PROG	= $(INSTALL) -m0755
    11.7 +INSTALL_DATA	= $(INSTALL) -m0644
    11.8 +INSTALL_DIR	= $(INSTALL) -d -m0755
    11.9 +
   11.10 +MAJOR    = 3.0
   11.11 +MINOR    = 0
   11.12 +
   11.13 +CC       = gcc
   11.14 +
   11.15 +XEN_ROOT = ../../..
   11.16 +include $(XEN_ROOT)/tools/Rules.mk
   11.17 +
   11.18 +SRCS     := xendebug.c
   11.19 +
   11.20 +CFLAGS   += -Wall -Werror -O3 -fno-strict-aliasing
   11.21 +CFLAGS   += $(INCLUDES) -I. -I$(XEN_ROOT)/tools/libxc
   11.22 +# Get gcc to generate the dependencies for us.
   11.23 +CFLAGS   += -Wp,-MD,.$(@F).d
   11.24 +DEPS     = .*.d
   11.25 +
   11.26 +LDFLAGS  += -L$(XEN_ROOT)/tools/libxc -lxc
   11.27 +
   11.28 +LIB_OBJS := $(patsubst %.c,%.o,$(SRCS))
   11.29 +PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS))
   11.30 +
   11.31 +LIB      := libxendebug.a libxendebug.so
   11.32 +LIB      += libxendebug.so.$(MAJOR) libxendebug.so.$(MAJOR).$(MINOR)
   11.33 +
   11.34 +all: build
   11.35 +build:
   11.36 +	$(MAKE) $(LIB)
   11.37 +
   11.38 +install: build
   11.39 +	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   11.40 +	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
   11.41 +	$(INSTALL_PROG) libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   11.42 +	$(INSTALL_DATA) libxendebug.a $(DESTDIR)/usr/$(LIBDIR)
   11.43 +	ln -sf libxendebug.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so.$(MAJOR)
   11.44 +	ln -sf libxendebug.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxendebug.so
   11.45 +	$(INSTALL_DATA) xendebug.h $(DESTDIR)/usr/include
   11.46 +
   11.47 +.PHONY: TAGS clean rpm install all
   11.48 +
   11.49 +TAGS:
   11.50 +	etags -t $(SRCS) *.h
   11.51 +
   11.52 +clean:
   11.53 +	rm -rf *.a *.so* *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen
   11.54 +
   11.55 +rpm: build
   11.56 +	rm -rf staging
   11.57 +	mkdir staging
   11.58 +	mkdir staging/i386
   11.59 +	rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
   11.60 +		--define "_rpmdir$$PWD/staging" -bb rpm.spec
   11.61 +	mv staging/i386/*.rpm .
   11.62 +	rm -rf staging
   11.63 +
   11.64 +libxendebug.a: $(LIB_OBJS)
   11.65 +	$(AR) rc $@ $^
   11.66 +
   11.67 +libxendebug.so: libxendebug.so.$(MAJOR)
   11.68 +	ln -sf $< $@
   11.69 +libxendebug.so.$(MAJOR): libxendebug.so.$(MAJOR).$(MINOR)
   11.70 +	ln -sf $< $@
   11.71 +
   11.72 +libxendebug.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
   11.73 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxendebug.so.$(MAJOR) -shared -o $@ $^
   11.74 +
   11.75 +-include $(DEPS)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/tools/debugger/libxendebug/list.h	Sat Jun 04 15:27:59 2005 +0000
    12.3 @@ -0,0 +1,186 @@
    12.4 +#ifndef _LINUX_LIST_H
    12.5 +#define _LINUX_LIST_H
    12.6 +
    12.7 +/*
    12.8 + * Simple doubly linked list implementation.
    12.9 + *
   12.10 + * Some of the internal functions ("__xxx") are useful when
   12.11 + * manipulating whole lists rather than single entries, as
   12.12 + * sometimes we already know the next/prev entries and we can
   12.13 + * generate better code by using them directly rather than
   12.14 + * using the generic single-entry routines.
   12.15 + */
   12.16 +
   12.17 +struct list_head {
   12.18 +	struct list_head *next, *prev;
   12.19 +};
   12.20 +
   12.21 +#define LIST_HEAD_INIT(name) { &(name), &(name) }
   12.22 +
   12.23 +#define LIST_HEAD(name) \
   12.24 +	struct list_head name = LIST_HEAD_INIT(name)
   12.25 +
   12.26 +#define INIT_LIST_HEAD(ptr) do { \
   12.27 +	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
   12.28 +} while (0)
   12.29 +
   12.30 +/*
   12.31 + * Insert a new entry between two known consecutive entries. 
   12.32 + *
   12.33 + * This is only for internal list manipulation where we know
   12.34 + * the prev/next entries already!
   12.35 + */
   12.36 +static __inline__ void __list_add(struct list_head * new,
   12.37 +	struct list_head * prev,
   12.38 +	struct list_head * next)
   12.39 +{
   12.40 +	next->prev = new;
   12.41 +	new->next = next;
   12.42 +	new->prev = prev;
   12.43 +	prev->next = new;
   12.44 +}
   12.45 +
   12.46 +/**
   12.47 + * list_add - add a new entry
   12.48 + * @new: new entry to be added
   12.49 + * @head: list head to add it after
   12.50 + *
   12.51 + * Insert a new entry after the specified head.
   12.52 + * This is good for implementing stacks.
   12.53 + */
   12.54 +static __inline__ void list_add(struct list_head *new, struct list_head *head)
   12.55 +{
   12.56 +	__list_add(new, head, head->next);
   12.57 +}
   12.58 +
   12.59 +/**
   12.60 + * list_add_tail - add a new entry
   12.61 + * @new: new entry to be added
   12.62 + * @head: list head to add it before
   12.63 + *
   12.64 + * Insert a new entry before the specified head.
   12.65 + * This is useful for implementing queues.
   12.66 + */
   12.67 +static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
   12.68 +{
   12.69 +	__list_add(new, head->prev, head);
   12.70 +}
   12.71 +
   12.72 +/*
   12.73 + * Delete a list entry by making the prev/next entries
   12.74 + * point to each other.
   12.75 + *
   12.76 + * This is only for internal list manipulation where we know
   12.77 + * the prev/next entries already!
   12.78 + */
   12.79 +static __inline__ void __list_del(struct list_head * prev,
   12.80 +				  struct list_head * next)
   12.81 +{
   12.82 +	next->prev = prev;
   12.83 +	prev->next = next;
   12.84 +}
   12.85 +
   12.86 +/**
   12.87 + * list_del - deletes entry from list.
   12.88 + * @entry: the element to delete from the list.
   12.89 + * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
   12.90 + */
   12.91 +static __inline__ void list_del(struct list_head *entry)
   12.92 +{
   12.93 +	__list_del(entry->prev, entry->next);
   12.94 +}
   12.95 +
   12.96 +/**
   12.97 + * list_del_init - deletes entry from list and reinitialize it.
   12.98 + * @entry: the element to delete from the list.
   12.99 + */
  12.100 +static __inline__ void list_del_init(struct list_head *entry)
  12.101 +{
  12.102 +	__list_del(entry->prev, entry->next);
  12.103 +	INIT_LIST_HEAD(entry); 
  12.104 +}
  12.105 +
  12.106 +/**
  12.107 + * list_empty - tests whether a list is empty
  12.108 + * @head: the list to test.
  12.109 + */
  12.110 +static __inline__ int list_empty(struct list_head *head)
  12.111 +{
  12.112 +	return head->next == head;
  12.113 +}
  12.114 +
  12.115 +/**
  12.116 + * list_splice - join two lists
  12.117 + * @list: the new list to add.
  12.118 + * @head: the place to add it in the first list.
  12.119 + */
  12.120 +static __inline__ void list_splice(struct list_head *list, struct list_head *head)
  12.121 +{
  12.122 +	struct list_head *first = list->next;
  12.123 +
  12.124 +	if (first != list) {
  12.125 +		struct list_head *last = list->prev;
  12.126 +		struct list_head *at = head->next;
  12.127 +
  12.128 +		first->prev = head;
  12.129 +		head->next = first;
  12.130 +
  12.131 +		last->next = at;
  12.132 +		at->prev = last;
  12.133 +	}
  12.134 +}
  12.135 +
  12.136 +/**
  12.137 + * list_entry - get the struct for this entry
  12.138 + * @ptr:	the &struct list_head pointer.
  12.139 + * @type:	the type of the struct this is embedded in.
  12.140 + * @member:	the name of the list_struct within the struct.
  12.141 + */
  12.142 +#define list_entry(ptr, type, member) \
  12.143 +	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
  12.144 +
  12.145 +/**
  12.146 + * list_for_each	-	iterate over a list
  12.147 + * @pos:	the &struct list_head to use as a loop counter.
  12.148 + * @head:	the head for your list.
  12.149 + */
  12.150 +#define list_for_each(pos, head) \
  12.151 +	for (pos = (head)->next; pos != (head); pos = pos->next)
  12.152 +        	
  12.153 +/**
  12.154 + * list_for_each_safe	-	iterate over a list safe against removal of list entry
  12.155 + * @pos:	the &struct list_head to use as a loop counter.
  12.156 + * @n:		another &struct list_head to use as temporary storage
  12.157 + * @head:	the head for your list.
  12.158 + */
  12.159 +#define list_for_each_safe(pos, n, head) \
  12.160 +	for (pos = (head)->next, n = pos->next; pos != (head); \
  12.161 +		pos = n, n = pos->next)
  12.162 +
  12.163 +/**
  12.164 + * list_for_each_entry	-	iterate over list of given type
  12.165 + * @pos:	the type * to use as a loop counter.
  12.166 + * @head:	the head for your list.
  12.167 + * @member:	the name of the list_struct within the struct.
  12.168 + */
  12.169 +#define list_for_each_entry(pos, head, member)				\
  12.170 +	for (pos = list_entry((head)->next, typeof(*pos), member),	\
  12.171 +		     prefetch(pos->member.next);			\
  12.172 +	     &pos->member != (head); 					\
  12.173 +	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
  12.174 +		     prefetch(pos->member.next))
  12.175 +
  12.176 +/**
  12.177 + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
  12.178 + * @pos:	the type * to use as a loop counter.
  12.179 + * @n:		another type * to use as temporary storage
  12.180 + * @head:	the head for your list.
  12.181 + * @member:	the name of the list_struct within the struct.
  12.182 + */
  12.183 +#define list_for_each_entry_safe(pos, n, head, member)			\
  12.184 +	for (pos = list_entry((head)->next, typeof(*pos), member),	\
  12.185 +		n = list_entry(pos->member.next, typeof(*pos), member);	\
  12.186 +	     &pos->member != (head); 					\
  12.187 +	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
  12.188 +#endif /* _LINUX_LIST_H */
  12.189 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tools/debugger/libxendebug/xendebug.c	Sat Jun 04 15:27:59 2005 +0000
    13.3 @@ -0,0 +1,599 @@
    13.4 +/*
    13.5 + * xendebug.c
    13.6 + *
    13.7 + * alex ho
    13.8 + * http://www.cl.cam.ac.uk/netos/pdb
    13.9 + *
   13.10 + * xendebug_memory_page adapted from xc_ptrace.c
   13.11 + */
   13.12 +
   13.13 +#include <stdio.h>
   13.14 +#include <stdlib.h>
   13.15 +#include <string.h>
   13.16 +#include <errno.h>
   13.17 +#include <sys/mman.h>
   13.18 +#include <xc.h>
   13.19 +#include "list.h"
   13.20 +
   13.21 +#if defined(__i386__)
   13.22 +#define L1_PAGETABLE_SHIFT       12
   13.23 +#define L2_PAGETABLE_SHIFT       22
   13.24 +#elif defined(__x86_64__)
   13.25 +#define L1_PAGETABLE_SHIFT      12
   13.26 +#define L2_PAGETABLE_SHIFT      21
   13.27 +#define L3_PAGETABLE_SHIFT      30
   13.28 +#define L4_PAGETABLE_SHIFT      39
   13.29 +#endif
   13.30 +
   13.31 +#define PAGE_SHIFT L1_PAGETABLE_SHIFT
   13.32 +#define PAGE_SIZE  (1UL<<PAGE_SHIFT)
   13.33 +#define PAGE_MASK  (~(PAGE_SIZE - 1))
   13.34 +
   13.35 +/* from xen/include/asm-x86/processor.h */
   13.36 +#define X86_EFLAGS_TF	0x00000100 /* Trap Flag */
   13.37 +
   13.38 +typedef int boolean;
   13.39 +#define true 1
   13.40 +#define false 0
   13.41 +
   13.42 +
   13.43 +typedef struct bwcpoint                           /* break/watch/catch point */
   13.44 +{
   13.45 +    struct list_head list;
   13.46 +    memory_t address;
   13.47 +    u32 domain;
   13.48 +    u16 vcpu;
   13.49 +    u8 old_value;                             /* old value for software bkpt */
   13.50 +} bwcpoint_t, *bwcpoint_p;
   13.51 +
   13.52 +static bwcpoint_t bwcpoint_list;
   13.53 +
   13.54 +
   13.55 +
   13.56 +typedef struct domain_context                 /* local cache of domain state */
   13.57 +{
   13.58 +    struct list_head     list;
   13.59 +    u32                  domid;
   13.60 +    boolean              valid[MAX_VIRT_CPUS];
   13.61 +    vcpu_guest_context_t context[MAX_VIRT_CPUS];
   13.62 +
   13.63 +    long            total_pages;
   13.64 +    unsigned long  *page_array;
   13.65 +
   13.66 +    unsigned long   cr3_phys[MAX_VIRT_CPUS];
   13.67 +    unsigned long  *cr3_virt[MAX_VIRT_CPUS];
   13.68 +    unsigned long   pde_phys[MAX_VIRT_CPUS];     
   13.69 +    unsigned long  *pde_virt[MAX_VIRT_CPUS];
   13.70 +    unsigned long   page_phys[MAX_VIRT_CPUS];     
   13.71 +    unsigned long  *page_virt[MAX_VIRT_CPUS];
   13.72 +    int             page_perm[MAX_VIRT_CPUS];
   13.73 +} domain_context_t, *domain_context_p;
   13.74 +
   13.75 +static domain_context_t domain_context_list;
   13.76 +
   13.77 +/* initialization */
   13.78 +
   13.79 +static boolean xendebug_initialized = false;
   13.80 +
   13.81 +static __inline__ void
   13.82 +xendebug_initialize()
   13.83 +{
   13.84 +    if ( !xendebug_initialized )
   13.85 +    {
   13.86 +        memset((void *) &domain_context_list, 0, sizeof(domain_context_t));
   13.87 +        INIT_LIST_HEAD(&domain_context_list.list);
   13.88 +
   13.89 +        memset((void *) &bwcpoint_list, 0, sizeof(bwcpoint_t));
   13.90 +        INIT_LIST_HEAD(&bwcpoint_list.list);
   13.91 +
   13.92 +        xendebug_initialized = true;
   13.93 +    }
   13.94 +}
   13.95 +
   13.96 +/**************/
   13.97 +
   13.98 +static domain_context_p
   13.99 +xendebug_domain_context_search (u32 domid)
  13.100 +{
  13.101 +    struct list_head *entry;
  13.102 +    domain_context_p  ctxt;
  13.103 +
  13.104 +    list_for_each(entry, &domain_context_list.list)
  13.105 +    {
  13.106 +        ctxt = list_entry(entry, domain_context_t, list);
  13.107 +        if ( domid == ctxt->domid )
  13.108 +            return ctxt;
  13.109 +    }
  13.110 +    return (domain_context_p)NULL;
  13.111 +}
  13.112 +
  13.113 +static __inline__ domain_context_p
  13.114 +xendebug_get_context (int xc_handle, u32 domid, u32 vcpu)
  13.115 +{
  13.116 +    int rc;
  13.117 +    domain_context_p ctxt;
  13.118 +
  13.119 +    xendebug_initialize();
  13.120 +
  13.121 +    if ( (ctxt = xendebug_domain_context_search(domid)) == NULL)
  13.122 +        return NULL;
  13.123 +
  13.124 +    if ( !ctxt->valid[vcpu] )
  13.125 +    {
  13.126 +        if ( (rc = xc_domain_get_vcpu_context(xc_handle, domid, vcpu, 
  13.127 +                                              &ctxt->context[vcpu])) )
  13.128 +            return NULL;
  13.129 +
  13.130 +        ctxt->valid[vcpu] = true;
  13.131 +    }
  13.132 +
  13.133 +    return ctxt;
  13.134 +}
  13.135 +
  13.136 +static __inline__ int
  13.137 +xendebug_set_context (int xc_handle, domain_context_p ctxt, u32 vcpu)
  13.138 +{
  13.139 +    dom0_op_t op;
  13.140 +    int rc;
  13.141 +
  13.142 +    if ( !ctxt->valid[vcpu] )
  13.143 +        return -EINVAL;
  13.144 +
  13.145 +    op.interface_version = DOM0_INTERFACE_VERSION;
  13.146 +    op.cmd = DOM0_SETDOMAININFO;
  13.147 +    op.u.setdomaininfo.domain = ctxt->domid;
  13.148 +    op.u.setdomaininfo.vcpu = vcpu;
  13.149 +    op.u.setdomaininfo.ctxt = &ctxt->context[vcpu];
  13.150 +
  13.151 +    if ( (rc = mlock(&ctxt->context[vcpu], sizeof(vcpu_guest_context_t))) )
  13.152 +        return rc;
  13.153 +
  13.154 +    rc = xc_dom0_op(xc_handle, &op);
  13.155 +    (void) munlock(&ctxt->context[vcpu], sizeof(vcpu_guest_context_t));
  13.156 +
  13.157 +    return rc;
  13.158 +}
  13.159 +
  13.160 +/**************/
  13.161 +
  13.162 +int
  13.163 +xendebug_attach(int xc_handle,
  13.164 +                u32 domid,
  13.165 +                u32 vcpu)
  13.166 +{
  13.167 +    domain_context_p ctxt;
  13.168 +
  13.169 +    xendebug_initialize();
  13.170 +
  13.171 +    if ( (ctxt = malloc(sizeof(domain_context_t))) == NULL )
  13.172 +        return -1;
  13.173 +    memset(ctxt, 0, sizeof(domain_context_t));
  13.174 +    
  13.175 +    ctxt->domid = domid;
  13.176 +    list_add(&ctxt->list, &domain_context_list.list);
  13.177 +
  13.178 +    return xc_domain_pause(xc_handle, domid);
  13.179 +}
  13.180 +
  13.181 +int
  13.182 +xendebug_detach(int xc_handle,
  13.183 +                u32 domid,
  13.184 +                u32 vcpu)
  13.185 +{
  13.186 +    domain_context_p ctxt;
  13.187 +    
  13.188 +    xendebug_initialize();
  13.189 +
  13.190 +    if ( (ctxt = xendebug_domain_context_search (domid)) == NULL)
  13.191 +        return -EINVAL;
  13.192 +
  13.193 +    list_del(&ctxt->list);
  13.194 +
  13.195 +    if ( ctxt->page_array ) free(ctxt->page_array);
  13.196 +
  13.197 +    free(ctxt);
  13.198 +
  13.199 +    return xc_domain_unpause(xc_handle, domid);
  13.200 +}
  13.201 +
  13.202 +int
  13.203 +xendebug_read_registers(int xc_handle,
  13.204 +                        u32 domid,
  13.205 +                        u32 vcpu,
  13.206 +                        cpu_user_regs_t **regs)
  13.207 +{
  13.208 +    domain_context_p ctxt;
  13.209 +    int rc = -1;
  13.210 +
  13.211 +    xendebug_initialize();
  13.212 +
  13.213 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.214 +    if (ctxt)
  13.215 +    {
  13.216 +        *regs = &ctxt->context[vcpu].user_regs;
  13.217 +        rc = 0;
  13.218 +    }
  13.219 +
  13.220 +    return rc;
  13.221 +}
  13.222 +
  13.223 +int
  13.224 +xendebug_read_fpregisters (int xc_handle,
  13.225 +                           u32 domid,
  13.226 +                           u32 vcpu,
  13.227 +                           char **regs)
  13.228 +{
  13.229 +    domain_context_p ctxt;
  13.230 +    int rc = -1;
  13.231 +
  13.232 +    xendebug_initialize();
  13.233 +
  13.234 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.235 +    if (ctxt)
  13.236 +    {
  13.237 +        *regs = ctxt->context[vcpu].fpu_ctxt.x;
  13.238 +        rc = 0;
  13.239 +    }
  13.240 +
  13.241 +    return rc;
  13.242 +}
  13.243 +
  13.244 +int
  13.245 +xendebug_write_registers(int xc_handle,
  13.246 +                         u32 domid,
  13.247 +                         u32 vcpu,
  13.248 +                         cpu_user_regs_t *regs)
  13.249 +{
  13.250 +    domain_context_p ctxt;
  13.251 +    int rc = -1;
  13.252 +
  13.253 +    xendebug_initialize();
  13.254 +
  13.255 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.256 +    if (ctxt)
  13.257 +    {
  13.258 +        memcpy(&ctxt->context[vcpu].user_regs, regs, sizeof(cpu_user_regs_t));
  13.259 +        rc = xendebug_set_context(xc_handle, ctxt, vcpu);
  13.260 +    }
  13.261 +    
  13.262 +    return rc;
  13.263 +}
  13.264 +
  13.265 +int
  13.266 +xendebug_step(int xc_handle,
  13.267 +              u32 domid,
  13.268 +              u32 vcpu)
  13.269 +{
  13.270 +    domain_context_p ctxt;
  13.271 +    int rc;
  13.272 +
  13.273 +    xendebug_initialize();
  13.274 +
  13.275 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.276 +    if (!ctxt) return -EINVAL;
  13.277 +
  13.278 +    ctxt->context[vcpu].user_regs.eflags |= X86_EFLAGS_TF;
  13.279 +
  13.280 +    if ( (rc = xendebug_set_context(xc_handle, ctxt, vcpu)) )
  13.281 +        return rc;
  13.282 +
  13.283 +    ctxt->valid[vcpu] = false;
  13.284 +    return xc_domain_unpause(xc_handle, domid);
  13.285 +}
  13.286 +
  13.287 +int
  13.288 +xendebug_continue(int xc_handle,
  13.289 +                  u32 domid,
  13.290 +                  u32 vcpu)
  13.291 +{
  13.292 +    domain_context_p ctxt;
  13.293 +    int rc;
  13.294 +
  13.295 +    xendebug_initialize();
  13.296 +
  13.297 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.298 +    if (!ctxt) return -EINVAL;
  13.299 +
  13.300 +    if ( ctxt->context[vcpu].user_regs.eflags & X86_EFLAGS_TF )
  13.301 +    {
  13.302 +        ctxt->context[vcpu].user_regs.eflags &= ~X86_EFLAGS_TF;
  13.303 +        if ( (rc = xendebug_set_context(xc_handle, ctxt, vcpu)) )
  13.304 +            return rc;
  13.305 +    }
  13.306 +    ctxt->valid[vcpu] = false;
  13.307 +    return xc_domain_unpause(xc_handle, domid);
  13.308 +}
  13.309 +
  13.310 +/*************************************************/
  13.311 +
  13.312 +#define vtopdi(va) ((va) >> L2_PAGETABLE_SHIFT)
  13.313 +#define vtopti(va) (((va) >> PAGE_SHIFT) & 0x3ff)
  13.314 +
  13.315 +/* access to one page */
  13.316 +static int
  13.317 +xendebug_memory_page (domain_context_p ctxt, int xc_handle, u32 vcpu,
  13.318 +                      int protection, memory_t address, int length, u8 *buffer)
  13.319 +{
  13.320 +    vcpu_guest_context_t *vcpu_ctxt = &ctxt->context[vcpu];
  13.321 +    unsigned long pde, page;
  13.322 +    unsigned long va = (unsigned long)address;
  13.323 +    void *ptr;
  13.324 +    long pages;
  13.325 +
  13.326 +    pages = xc_get_tot_pages(xc_handle, ctxt->domid);
  13.327 +
  13.328 +    if ( ctxt->total_pages != pages )
  13.329 +    {
  13.330 +        if ( ctxt->total_pages > 0 ) free( ctxt->page_array );
  13.331 +        ctxt->total_pages = pages;
  13.332 +
  13.333 +        ctxt->page_array = malloc(pages * sizeof(unsigned long));
  13.334 +        if ( ctxt->page_array == NULL )
  13.335 +        {
  13.336 +            printf("Could not allocate memory\n");
  13.337 +            return 0;
  13.338 +        }
  13.339 +
  13.340 +        if ( xc_get_pfn_list(xc_handle, ctxt->domid, ctxt->page_array,pages) !=
  13.341 +                pages )
  13.342 +        {
  13.343 +            printf("Could not get the page frame list\n");
  13.344 +            return 0;
  13.345 +        }
  13.346 +    }
  13.347 +
  13.348 +    if ( vcpu_ctxt->pt_base != ctxt->cr3_phys[vcpu]) 
  13.349 +    {
  13.350 +        ctxt->cr3_phys[vcpu] = vcpu_ctxt->pt_base;
  13.351 +        if ( ctxt->cr3_virt[vcpu] )
  13.352 +            munmap(ctxt->cr3_virt[vcpu], PAGE_SIZE);
  13.353 +        ctxt->cr3_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid,
  13.354 +                    PAGE_SIZE, PROT_READ, ctxt->cr3_phys[vcpu] >> PAGE_SHIFT);
  13.355 +        if ( ctxt->cr3_virt[vcpu] == NULL )
  13.356 +            return 0;
  13.357 +    } 
  13.358 +
  13.359 +
  13.360 +    if ( (pde = ctxt->cr3_virt[vcpu][vtopdi(va)]) == 0) /* logical address */
  13.361 +        return 0;
  13.362 +    if (ctxt->context[vcpu].flags & VGCF_VMX_GUEST)
  13.363 +        pde = ctxt->page_array[pde >> PAGE_SHIFT] << PAGE_SHIFT;
  13.364 +    if (pde != ctxt->pde_phys[vcpu]) 
  13.365 +    {
  13.366 +        ctxt->pde_phys[vcpu] = pde;
  13.367 +        if ( ctxt->pde_virt[vcpu])
  13.368 +            munmap(ctxt->pde_virt[vcpu], PAGE_SIZE);
  13.369 +        ctxt->pde_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid,
  13.370 +                    PAGE_SIZE, PROT_READ, ctxt->pde_phys[vcpu] >> PAGE_SHIFT);
  13.371 +        if ( ctxt->pde_virt[vcpu] == NULL )
  13.372 +            return 0;
  13.373 +    }
  13.374 +
  13.375 +    if ((page = ctxt->pde_virt[vcpu][vtopti(va)]) == 0) /* logical address */
  13.376 +        return 0;
  13.377 +    if (ctxt->context[vcpu].flags & VGCF_VMX_GUEST)
  13.378 +        page = ctxt->page_array[page >> PAGE_SHIFT] << PAGE_SHIFT;
  13.379 +    if (page != ctxt->page_phys[vcpu] || protection != ctxt->page_perm[vcpu]) 
  13.380 +    {
  13.381 +        ctxt->page_phys[vcpu] = page;
  13.382 +        if (ctxt->page_virt[vcpu])
  13.383 +            munmap(ctxt->page_virt[vcpu], PAGE_SIZE);
  13.384 +        ctxt->page_virt[vcpu] = xc_map_foreign_range(xc_handle, ctxt->domid, 
  13.385 +                  PAGE_SIZE, protection, ctxt->page_phys[vcpu] >> PAGE_SHIFT);
  13.386 +        if ( ctxt->page_virt[vcpu] == NULL )
  13.387 +        {
  13.388 +            printf("cr3 %lx pde %lx page %lx pti %lx\n", 
  13.389 +                   vcpu_ctxt->pt_base, pde, page, vtopti(va));
  13.390 +            ctxt->page_phys[vcpu] = 0;
  13.391 +            return 0;
  13.392 +        }
  13.393 +        ctxt->page_perm[vcpu] = protection;
  13.394 +    }	
  13.395 +
  13.396 +    ptr = (void *)( (unsigned long)ctxt->page_virt[vcpu] |
  13.397 +                    (va & ~PAGE_MASK) );
  13.398 +
  13.399 +    if ( protection & PROT_WRITE )
  13.400 +    {
  13.401 +        memcpy(ptr, buffer, length);
  13.402 +    }
  13.403 +    else
  13.404 +    {
  13.405 +        memcpy(buffer, ptr, length);
  13.406 +    }
  13.407 +
  13.408 +    return length;
  13.409 +}
  13.410 +
  13.411 +/* divide a memory operation into accesses to individual pages */
  13.412 +static int
  13.413 +xendebug_memory_op (domain_context_p ctxt, int xc_handle, u32 vcpu,
  13.414 +                    int protection, memory_t address, int length, u8 *buffer)
  13.415 +{
  13.416 +    int      remain;              /* number of bytes to touch past this page */
  13.417 +    int      bytes   = 0;
  13.418 +
  13.419 +    while ( (remain = (address + length - 1) - (address | (PAGE_SIZE-1))) > 0)
  13.420 +    {
  13.421 +        bytes += xendebug_memory_page(ctxt, xc_handle, vcpu, protection,
  13.422 +                                      address, length - remain, buffer);
  13.423 +        buffer += (length - remain);
  13.424 +        length = remain;
  13.425 +        address = (address | (PAGE_SIZE - 1)) + 1;
  13.426 +    }
  13.427 +
  13.428 +    bytes += xendebug_memory_page(ctxt, xc_handle, vcpu, protection,
  13.429 +                                  address, length, buffer);
  13.430 +
  13.431 +    return bytes;
  13.432 +}
  13.433 +
  13.434 +int
  13.435 +xendebug_read_memory(int xc_handle,
  13.436 +                     u32 domid,
  13.437 +                     u32 vcpu,
  13.438 +                     memory_t address,
  13.439 +                     u32 length,
  13.440 +                     u8 *data)
  13.441 +{
  13.442 +    domain_context_p ctxt;
  13.443 +
  13.444 +    xendebug_initialize();
  13.445 +
  13.446 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.447 +
  13.448 +    xendebug_memory_op(ctxt, xc_handle, vcpu, PROT_READ, 
  13.449 +                       address, length, data);
  13.450 +
  13.451 +    return 0;
  13.452 +}
  13.453 +
  13.454 +int
  13.455 +xendebug_write_memory(int xc_handle,
  13.456 +                      u32 domid,
  13.457 +                      u32 vcpu,
  13.458 +                      memory_t address,
  13.459 +                      u32 length,
  13.460 +                      u8 *data)
  13.461 +{
  13.462 +    domain_context_p ctxt;
  13.463 +
  13.464 +    xendebug_initialize();
  13.465 +
  13.466 +    ctxt = xendebug_get_context(xc_handle, domid, vcpu);
  13.467 +    xendebug_memory_op(ctxt, xc_handle, vcpu, PROT_READ | PROT_WRITE,
  13.468 +
  13.469 +                       address, length, data);
  13.470 +
  13.471 +    return 0;
  13.472 +}
  13.473 +
  13.474 +int
  13.475 +xendebug_insert_memory_breakpoint(int xc_handle,
  13.476 +                                  u32 domid,
  13.477 +                                  u32 vcpu,
  13.478 +                                  memory_t address,
  13.479 +                                  u32 length)
  13.480 +{
  13.481 +    bwcpoint_p bkpt;
  13.482 +    u8 breakpoint_opcode = 0xcc;
  13.483 +
  13.484 +    printf("insert breakpoint %d:%lx %d\n",
  13.485 +            domid, address, length);
  13.486 +
  13.487 +    xendebug_initialize();
  13.488 +
  13.489 +    bkpt = malloc(sizeof(bwcpoint_t));
  13.490 +    if ( bkpt == NULL )
  13.491 +    {
  13.492 +        printf("error: breakpoint length should be 1\n");
  13.493 +        return -1;
  13.494 +    }
  13.495 +
  13.496 +    if ( length != 1 )
  13.497 +    {
  13.498 +        printf("error: breakpoint length should be 1\n");
  13.499 +        free(bkpt);
  13.500 +        return -1;
  13.501 +    }
  13.502 +
  13.503 +    bkpt->address = address;
  13.504 +    bkpt->domain  = domid;
  13.505 +
  13.506 +    xendebug_read_memory(xc_handle, domid, vcpu, address, 1,
  13.507 +                         &bkpt->old_value);
  13.508 +
  13.509 +    xendebug_write_memory(xc_handle, domid, vcpu, address, 1, 
  13.510 +                          &breakpoint_opcode);
  13.511 +    
  13.512 +    list_add(&bkpt->list, &bwcpoint_list.list);
  13.513 +
  13.514 +    printf("breakpoint_set %d:%lx 0x%x\n",
  13.515 +           domid, address, bkpt->old_value);
  13.516 +
  13.517 +    return 0;
  13.518 +}
  13.519 +
  13.520 +int
  13.521 +xendebug_remove_memory_breakpoint(int xc_handle,
  13.522 +                                  u32 domid,
  13.523 +                                  u32 vcpu,
  13.524 +                                  memory_t address,
  13.525 +                                  u32 length)
  13.526 +{
  13.527 +    bwcpoint_p bkpt = NULL;
  13.528 +
  13.529 +    printf ("remove breakpoint %d:%lx\n",
  13.530 +            domid, address);
  13.531 +
  13.532 +    struct list_head *entry;
  13.533 +    list_for_each(entry, &bwcpoint_list.list)
  13.534 +    {
  13.535 +        bkpt = list_entry(entry, bwcpoint_t, list);
  13.536 +        if ( domid == bkpt->domain && address == bkpt->address )
  13.537 +            break;
  13.538 +    }
  13.539 +    
  13.540 +    if (bkpt == &bwcpoint_list || bkpt == NULL)
  13.541 +    {
  13.542 +        printf ("error: no breakpoint found\n");
  13.543 +        return -1;
  13.544 +    }
  13.545 +
  13.546 +    list_del(&bkpt->list);
  13.547 +
  13.548 +    xendebug_write_memory(xc_handle, domid, vcpu, address, 1, 
  13.549 +                          &bkpt->old_value);
  13.550 +
  13.551 +    free(bkpt);
  13.552 +    return 0;
  13.553 +}
  13.554 +
  13.555 +int
  13.556 +xendebug_query_domain_stop(int xc_handle, int *dom_list, int dom_list_size)
  13.557 +{
  13.558 +    xc_dominfo_t *info;
  13.559 +    u32 first_dom = 0;
  13.560 +    int max_doms = 1024;
  13.561 +    int nr_doms, loop;
  13.562 +    int count = 0;
  13.563 +
  13.564 +    if ( (info = malloc(max_doms * sizeof(xc_dominfo_t))) == NULL )
  13.565 +        return -ENOMEM;
  13.566 +
  13.567 +    nr_doms = xc_domain_getinfo(xc_handle, first_dom, max_doms, info);
  13.568 +
  13.569 +    for (loop = 0; loop < nr_doms; loop++)
  13.570 +    {
  13.571 +        printf ("domid: %d", info[loop].domid);
  13.572 +        printf (" %c%c%c%c%c%c",
  13.573 +                info[loop].dying ? 'D' : '-',
  13.574 +                info[loop].crashed ? 'C' : '-',
  13.575 +                info[loop].shutdown ? 'S' : '-',
  13.576 +                info[loop].paused ? 'P' : '-',
  13.577 +                info[loop].blocked ? 'B' : '-',
  13.578 +                info[loop].running ? 'R' : '-');
  13.579 +        printf (" pages: %ld, vcpus %d", 
  13.580 +                info[loop].nr_pages, info[loop].vcpus);
  13.581 +        printf ("\n");
  13.582 +
  13.583 +        if ( info[loop].paused && count < dom_list_size)
  13.584 +        {
  13.585 +            dom_list[count++] = info[loop].domid;
  13.586 +        }
  13.587 +    }
  13.588 +
  13.589 +    free(info);
  13.590 +
  13.591 +    return count;
  13.592 +}
  13.593 +
  13.594 +/*
  13.595 + * Local variables:
  13.596 + * mode: C
  13.597 + * c-set-style: "BSD"
  13.598 + * c-basic-offset: 4
  13.599 + * tab-width: 4
  13.600 + * indent-tabs-mode: nil
  13.601 + * End:
  13.602 + */
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tools/debugger/libxendebug/xendebug.h	Sat Jun 04 15:27:59 2005 +0000
    14.3 @@ -0,0 +1,78 @@
    14.4 +/*
    14.5 + * xendebug.h
    14.6 + *
    14.7 + * alex ho
    14.8 + * http://www.cl.cam.ac.uk/netos/pdb
    14.9 + *
   14.10 + */
   14.11 +
   14.12 +#ifndef _XENDEBUG_H_DEFINED
   14.13 +#define _XENDEBUG_H_DEFINED
   14.14 +
   14.15 +#include <xc.h>
   14.16 +
   14.17 +int xendebug_attach(int xc_handle,
   14.18 +		    u32 domid,
   14.19 +		    u32 vcpu);
   14.20 +
   14.21 +int xendebug_detach(int xc_handle,
   14.22 +		    u32 domid,
   14.23 +		    u32 vcpu);
   14.24 +
   14.25 +int xendebug_read_registers(int xc_handle,
   14.26 +			    u32 domid,
   14.27 +			    u32 vcpu,
   14.28 +			    cpu_user_regs_t **regs);
   14.29 +
   14.30 +int xendebug_read_fpregisters (int xc_handle,
   14.31 +			       u32 domid,
   14.32 +			       u32 vcpu,
   14.33 +			       char **regs);
   14.34 +
   14.35 +int xendebug_write_registers(int xc_handle,
   14.36 +			     u32 domid,
   14.37 +			     u32 vcpu,
   14.38 +			     cpu_user_regs_t *regs);
   14.39 +
   14.40 +int xendebug_step(int xc_handle,
   14.41 +		  u32 domid,
   14.42 +		  u32 vcpu);
   14.43 +
   14.44 +int xendebug_continue(int xc_handle,
   14.45 +		      u32 domid,
   14.46 +		      u32 vcpu);
   14.47 +
   14.48 +int xendebug_read_memory(int xc_handle,
   14.49 +			 u32 domid,
   14.50 +			 u32 vcpu,
   14.51 +			 memory_t address,
   14.52 +			 u32 length,
   14.53 +			 u8 *data);
   14.54 +
   14.55 +
   14.56 +int xendebug_write_memory(int xc_handle,
   14.57 +			  u32 domid,
   14.58 +			  u32 vcpu,
   14.59 +			  memory_t address,
   14.60 +			  u32 length,
   14.61 +			  u8 *data);
   14.62 +
   14.63 +
   14.64 +int xendebug_insert_memory_breakpoint(int xc_handle,
   14.65 +				      u32 domid,
   14.66 +				      u32 vcpu,
   14.67 +				      memory_t address,
   14.68 +				      u32 length);
   14.69 +
   14.70 +int xendebug_remove_memory_breakpoint(int xc_handle,
   14.71 +				      u32 domid,
   14.72 +				      u32 vcpu,
   14.73 +				      memory_t address,
   14.74 +				      u32 length);
   14.75 +
   14.76 +int xendebug_query_domain_stop(int xc_handle,
   14.77 +			       int *dom_list, 
   14.78 +			       int dom_list_size);
   14.79 +
   14.80 +
   14.81 +#endif /* _XENDEBUG_H_DEFINED */
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tools/debugger/pdb/Domain.ml	Sat Jun 04 15:27:59 2005 +0000
    15.3 @@ -0,0 +1,63 @@
    15.4 +(** Domain.ml
    15.5 + *
    15.6 + *  domain context implementation
    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 +  mutable domain : int;
   15.19 +  mutable execution_domain : int
   15.20 +}
   15.21 +
   15.22 +let default_context = { domain = 0; execution_domain = 0 }
   15.23 +
   15.24 +let new_context dom exec_dom = {domain = dom; execution_domain = exec_dom}
   15.25 +
   15.26 +let set_domain ctx value =
   15.27 +  ctx.domain <- value;
   15.28 +  print_endline (Printf.sprintf "ctx.domain <- %d" ctx.domain)
   15.29 +
   15.30 +let set_execution_domain ctx value =
   15.31 +  ctx.execution_domain <- value;
   15.32 +  print_endline (Printf.sprintf "ctx.execution_domain <- %d"
   15.33 +		 ctx.execution_domain)
   15.34 +
   15.35 +let get_domain ctx =
   15.36 +  ctx.domain
   15.37 +
   15.38 +let get_execution_domain ctx =
   15.39 +  ctx.execution_domain
   15.40 +
   15.41 +let string_of_context ctx =
   15.42 +      Printf.sprintf "{domain} domain: %d, execution_domain: %d"
   15.43 +                      ctx.domain  ctx.execution_domain
   15.44 +
   15.45 +external read_registers : context_t -> registers = "read_registers"
   15.46 +external write_register : context_t -> register -> int32 -> unit =
   15.47 +  "write_register"
   15.48 +external read_memory : context_t -> int32 -> int -> int list = 
   15.49 +  "read_memory"
   15.50 +external write_memory : context_t -> int32 -> int list -> unit = 
   15.51 +  "write_memory"
   15.52 +	
   15.53 +external continue : context_t -> unit = "continue_target"
   15.54 +external step : context_t -> unit = "step_target"
   15.55 +
   15.56 +external insert_memory_breakpoint : context_t -> int32 -> int -> unit = 
   15.57 +  "insert_memory_breakpoint"
   15.58 +external remove_memory_breakpoint : context_t -> int32 -> int -> unit = 
   15.59 +  "remove_memory_breakpoint"
   15.60 +
   15.61 +external attach_debugger : int -> int -> unit = "attach_debugger"
   15.62 +external detach_debugger : int -> int -> unit = "detach_debugger"
   15.63 +external pause_target : int -> unit = "pause_target"
   15.64 +
   15.65 +let pause ctx =
   15.66 +  pause_target ctx.domain
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/debugger/pdb/Domain.mli	Sat Jun 04 15:27:59 2005 +0000
    16.3 @@ -0,0 +1,38 @@
    16.4 +(** Domain.mli
    16.5 + *
    16.6 + *  domain context interface
    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 +open Int32
   16.14 +open Intel
   16.15 +
   16.16 +type context_t
   16.17 +
   16.18 +val default_context : context_t
   16.19 +val new_context : int -> int -> context_t 
   16.20 +
   16.21 +val set_domain : context_t -> int -> unit
   16.22 +val get_domain : context_t -> int
   16.23 +val set_execution_domain : context_t -> int -> unit
   16.24 +val get_execution_domain : context_t -> int
   16.25 +
   16.26 +val string_of_context : context_t -> string
   16.27 +
   16.28 +val read_registers : context_t -> registers
   16.29 +val write_register : context_t -> register -> int32 -> unit
   16.30 +val read_memory : context_t -> int32 -> int -> int list
   16.31 +val write_memory : context_t -> int32 -> int list -> unit
   16.32 +	
   16.33 +val continue : context_t -> unit
   16.34 +val step : context_t -> unit
   16.35 +
   16.36 +val insert_memory_breakpoint : context_t -> int32 -> int -> unit
   16.37 +val remove_memory_breakpoint : context_t -> int32 -> int -> unit
   16.38 +
   16.39 +val attach_debugger : int -> int -> unit
   16.40 +val detach_debugger : int -> int -> unit
   16.41 +val pause : context_t -> unit
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/debugger/pdb/Intel.ml	Sat Jun 04 15:27:59 2005 +0000
    17.3 @@ -0,0 +1,71 @@
    17.4 +(** Intel.ml
    17.5 + *
    17.6 + *  various sundry Intel x86 definitions
    17.7 + *
    17.8 + *  @author copyright (c) 2005 alex ho
    17.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   17.10 + *  @version 1
   17.11 + *)
   17.12 +
   17.13 +
   17.14 +type register =
   17.15 +  | EBX
   17.16 +  | ECX
   17.17 +  | EDX
   17.18 +  | ESI
   17.19 +  | EDI
   17.20 +  | EBP
   17.21 +  | EAX
   17.22 +  | Error_code
   17.23 +  | Entry_vector
   17.24 +  | EIP
   17.25 +  | CS
   17.26 +  | EFLAGS
   17.27 +  | ESP
   17.28 +  | SS
   17.29 +  | ES
   17.30 +  | DS
   17.31 +  | FS
   17.32 +  | GS
   17.33 +
   17.34 +type registers =
   17.35 +    { ebx : int32;
   17.36 +      ecx : int32;
   17.37 +      edx : int32;
   17.38 +      esi : int32;
   17.39 +      edi : int32;
   17.40 +      ebp : int32;
   17.41 +      eax : int32;
   17.42 +      error_code : int32;
   17.43 +      entry_vector : int32;
   17.44 +      eip : int32;
   17.45 +      cs : int32;
   17.46 +      eflags : int32;
   17.47 +      esp : int32;
   17.48 +      ss : int32;
   17.49 +      es : int32;
   17.50 +      ds : int32;
   17.51 +      fs : int32;
   17.52 +      gs : int32
   17.53 +    }
   17.54 +
   17.55 +let null_registers =
   17.56 +  { ebx = 0l;
   17.57 +    ecx = 0l;
   17.58 +    edx = 0l;
   17.59 +    esi = 0l;
   17.60 +    edi = 0l;
   17.61 +    ebp = 0l;
   17.62 +    eax = 0l;
   17.63 +    error_code = 0l;
   17.64 +    entry_vector = 0l;
   17.65 +    eip = 0l;
   17.66 +    cs = 0l;
   17.67 +    eflags = 0l;
   17.68 +    esp = 0l;
   17.69 +    ss = 0l;
   17.70 +    es = 0l;
   17.71 +    ds = 0l;
   17.72 +    fs = 0l;
   17.73 +    gs = 0l
   17.74 +  }
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/debugger/pdb/Makefile	Sat Jun 04 15:27:59 2005 +0000
    18.3 @@ -0,0 +1,56 @@
    18.4 +OCAMLMAKEFILE = OCamlMakefile
    18.5 +
    18.6 +XEN_ROOT    = ../../..
    18.7 +include $(XEN_ROOT)/tools/Rules.mk
    18.8 +
    18.9 +# overwrite LDFLAGS from xen/tool/Rules.mk
   18.10 +# otherwise, ocamlmktop gets confused.
   18.11 +LDFLAGS     =
   18.12 +
   18.13 +OCAML_ROOT=/usr/local
   18.14 +# force ocaml 3.08
   18.15 +# OCAML_ROOT  = /anfs/nos1/ach61/ocaml
   18.16 +
   18.17 +OCAMLC      = $(OCAML_ROOT)/bin/ocamlc
   18.18 +OCAMLMKTOP  = $(OCAML_ROOT)/bin/ocamlmktop
   18.19 +OCAMLLIBPATH= $(OCAML_ROOT)/lib/ocaml
   18.20 +
   18.21 +INCLUDES   += -I $(XEN_XC)
   18.22 +INCLUDES   += -I $(XEN_LIBXC)
   18.23 +INCLUDES   += -I ../libxendebug
   18.24 +INCLUDES   += -I $(OCAML_ROOT)/lib/ocaml
   18.25 +
   18.26 +CFLAGS     += $(INCLUDES)
   18.27 +CFLAGS     += -Wall
   18.28 +CFLAGS     += -Werror
   18.29 +CFLAGS     += -g
   18.30 +
   18.31 +CLIBS      += xc
   18.32 +CLIBS      += xendebug
   18.33 +CLIBS      += pdb
   18.34 +
   18.35 +LIBDIRS    += $(XEN_LIBXC)
   18.36 +LIBDIRS    += $(XEN_LIBXUTIL)
   18.37 +LIBDIRS    += ../libxendebug
   18.38 +LIBDIRS    += .
   18.39 +
   18.40 +LIBS       += unix str
   18.41 +
   18.42 +PRE_TARGETS = libpdb.a
   18.43 +
   18.44 +all : bc
   18.45 +
   18.46 +libpdb.a : pdb_xen.o
   18.47 +	ar rc $@ $^
   18.48 +	ranlib $@
   18.49 +
   18.50 +SOURCES    += pdb_caml_xc.c pdb_xen.c
   18.51 +SOURCES    += Util.ml Intel.ml 
   18.52 +SOURCES    += evtchn.ml evtchn.mli
   18.53 +SOURCES    += Domain.ml  Process.ml
   18.54 +SOURCES    += Domain.mli Process.mli
   18.55 +SOURCES    += PDB.ml debugger.ml server.ml
   18.56 +RESULT      = pdb
   18.57 +
   18.58 +include $(OCAMLMAKEFILE)
   18.59 +
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tools/debugger/pdb/OCamlMakefile	Sat Jun 04 15:27:59 2005 +0000
    19.3 @@ -0,0 +1,1149 @@
    19.4 +###########################################################################
    19.5 +#                              OCamlMakefile
    19.6 +#                  Copyright (C) 1999-2004  Markus Mottl
    19.7 +#
    19.8 +#                             For updates see:
    19.9 +#                http://www.oefai.at/~markus/ocaml_sources
   19.10 +#
   19.11 +#        $Id: OCamlMakefile,v 1.1 2005/05/19 09:30:48 root Exp $
   19.12 +#
   19.13 +###########################################################################
   19.14 +
   19.15 +# Modified by damien for .glade.ml compilation
   19.16 +
   19.17 +# Set these variables to the names of the sources to be processed and
   19.18 +# the result variable. Order matters during linkage!
   19.19 +
   19.20 +ifndef SOURCES
   19.21 +  SOURCES := foo.ml
   19.22 +endif
   19.23 +export SOURCES
   19.24 +
   19.25 +ifndef RES_CLIB_SUF
   19.26 +  RES_CLIB_SUF := _stubs
   19.27 +endif
   19.28 +export RES_CLIB_SUF
   19.29 +
   19.30 +ifndef RESULT
   19.31 +  RESULT := foo
   19.32 +endif
   19.33 +export RESULT
   19.34 +
   19.35 +export LIB_PACK_NAME
   19.36 +
   19.37 +ifndef DOC_FILES
   19.38 +  DOC_FILES := $(filter %.mli, $(SOURCES))
   19.39 +endif
   19.40 +export DOC_FILES
   19.41 +
   19.42 +export BCSUFFIX
   19.43 +export NCSUFFIX
   19.44 +
   19.45 +ifndef TOPSUFFIX
   19.46 +  TOPSUFFIX := .top
   19.47 +endif
   19.48 +export TOPSUFFIX
   19.49 +
   19.50 +# Eventually set include- and library-paths, libraries to link,
   19.51 +# additional compilation-, link- and ocamlyacc-flags
   19.52 +# Path- and library information needs not be written with "-I" and such...
   19.53 +# Define THREADS if you need it, otherwise leave it unset (same for
   19.54 +# USE_CAMLP4)!
   19.55 +
   19.56 +export THREADS
   19.57 +export VMTHREADS
   19.58 +export ANNOTATE
   19.59 +export USE_CAMLP4
   19.60 +
   19.61 +export INCDIRS
   19.62 +export LIBDIRS
   19.63 +export EXTLIBDIRS
   19.64 +export RESULTDEPS
   19.65 +export OCAML_DEFAULT_DIRS
   19.66 +
   19.67 +export LIBS
   19.68 +export CLIBS
   19.69 +
   19.70 +export OCAMLFLAGS
   19.71 +export OCAMLNCFLAGS
   19.72 +export OCAMLBCFLAGS
   19.73 +
   19.74 +export OCAMLLDFLAGS
   19.75 +export OCAMLNLDFLAGS
   19.76 +export OCAMLBLDFLAGS
   19.77 +
   19.78 +ifndef OCAMLCPFLAGS
   19.79 +  OCAMLCPFLAGS := a
   19.80 +endif
   19.81 +
   19.82 +export OCAMLCPFLAGS
   19.83 +
   19.84 +export PPFLAGS
   19.85 +
   19.86 +export YFLAGS
   19.87 +export IDLFLAGS
   19.88 +
   19.89 +export OCAMLDOCFLAGS
   19.90 +
   19.91 +export OCAMLFIND_INSTFLAGS
   19.92 +
   19.93 +export DVIPSFLAGS
   19.94 +
   19.95 +export STATIC
   19.96 +
   19.97 +# Add a list of optional trash files that should be deleted by "make clean"
   19.98 +export TRASH
   19.99 +
  19.100 +####################  variables depending on your OCaml-installation
  19.101 +
  19.102 +ifdef MINGW
  19.103 +  export MINGW
  19.104 +  WIN32   := 1
  19.105 +  CFLAGS_WIN32 := -mno-cygwin
  19.106 +endif
  19.107 +ifdef MSVC
  19.108 +  export MSVC
  19.109 +  WIN32   := 1
  19.110 +  ifndef STATIC
  19.111 +    CPPFLAGS_WIN32 := -DCAML_DLL
  19.112 +  endif
  19.113 +  CFLAGS_WIN32 += -nologo
  19.114 +  EXT_OBJ := obj
  19.115 +  EXT_LIB := lib
  19.116 +  ifeq ($(CC),gcc)
  19.117 +    # work around GNU Make default value
  19.118 +    ifdef THREADS
  19.119 +      CC := cl -MT
  19.120 +    else
  19.121 +      CC := cl
  19.122 +    endif
  19.123 +  endif
  19.124 +  ifeq ($(CXX),g++)
  19.125 +    # work around GNU Make default value
  19.126 +    CXX := $(CC)
  19.127 +  endif
  19.128 +  CFLAG_O := -Fo
  19.129 +endif
  19.130 +ifdef WIN32
  19.131 +  EXT_CXX := cpp
  19.132 +  EXE     := .exe
  19.133 +endif
  19.134 +
  19.135 +ifndef EXT_OBJ
  19.136 +  EXT_OBJ := o
  19.137 +endif
  19.138 +ifndef EXT_LIB
  19.139 +  EXT_LIB := a
  19.140 +endif
  19.141 +ifndef EXT_CXX
  19.142 +  EXT_CXX := cc
  19.143 +endif
  19.144 +ifndef EXE
  19.145 +  EXE := # empty
  19.146 +endif
  19.147 +ifndef CFLAG_O
  19.148 +  CFLAG_O := -o # do not delete this comment (preserves trailing whitespace)!
  19.149 +endif
  19.150 +
  19.151 +export CC
  19.152 +export CXX
  19.153 +export CFLAGS
  19.154 +export CXXFLAGS
  19.155 +export LDFLAGS
  19.156 +export CPPFLAGS
  19.157 +
  19.158 +ifndef RPATH_FLAG
  19.159 +  RPATH_FLAG := -R
  19.160 +endif
  19.161 +export RPATH_FLAG
  19.162 +
  19.163 +ifndef MSVC
  19.164 +ifndef PIC_CFLAGS
  19.165 +  PIC_CFLAGS := -fPIC
  19.166 +endif
  19.167 +ifndef PIC_CPPFLAGS
  19.168 +  PIC_CPPFLAGS := -DPIC
  19.169 +endif
  19.170 +endif
  19.171 +
  19.172 +export PIC_CFLAGS
  19.173 +export PIC_CPPFLAGS
  19.174 +
  19.175 +BCRESULT  := $(addsuffix $(BCSUFFIX), $(RESULT))
  19.176 +NCRESULT  := $(addsuffix $(NCSUFFIX), $(RESULT))
  19.177 +TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT))
  19.178 +
  19.179 +ifndef OCAMLFIND
  19.180 +  OCAMLFIND := ocamlfind
  19.181 +endif
  19.182 +export OCAMLFIND
  19.183 +
  19.184 +ifndef OCAMLC
  19.185 +  OCAMLC := ocamlc
  19.186 +endif
  19.187 +export OCAMLC
  19.188 +
  19.189 +ifndef OCAMLOPT
  19.190 +  OCAMLOPT := ocamlopt
  19.191 +endif
  19.192 +export OCAMLOPT
  19.193 +
  19.194 +ifndef OCAMLMKTOP
  19.195 +  OCAMLMKTOP := ocamlmktop
  19.196 +endif
  19.197 +export OCAMLMKTOP
  19.198 +
  19.199 +ifndef OCAMLCP
  19.200 +  OCAMLCP := ocamlcp
  19.201 +endif
  19.202 +export OCAMLCP
  19.203 +
  19.204 +ifndef OCAMLDEP
  19.205 +  OCAMLDEP := ocamldep
  19.206 +endif
  19.207 +export OCAMLDEP
  19.208 +
  19.209 +ifndef OCAMLLEX
  19.210 +  OCAMLLEX := ocamllex
  19.211 +endif
  19.212 +export OCAMLLEX
  19.213 +
  19.214 +ifndef OCAMLYACC
  19.215 +  OCAMLYACC := ocamlyacc
  19.216 +endif
  19.217 +export OCAMLYACC
  19.218 +
  19.219 +ifndef OCAMLMKLIB
  19.220 +  OCAMLMKLIB := ocamlmklib
  19.221 +endif
  19.222 +export OCAMLMKLIB
  19.223 +
  19.224 +ifndef OCAML_GLADECC
  19.225 +  OCAML_GLADECC := lablgladecc2
  19.226 +endif
  19.227 +export OCAML_GLADECC
  19.228 +
  19.229 +ifndef OCAML_GLADECC_FLAGS
  19.230 +  OCAML_GLADECC_FLAGS :=
  19.231 +endif
  19.232 +export OCAML_GLADECC_FLAGS
  19.233 +
  19.234 +ifndef CAMELEON_REPORT
  19.235 +  CAMELEON_REPORT := report
  19.236 +endif
  19.237 +export CAMELEON_REPORT
  19.238 +
  19.239 +ifndef CAMELEON_REPORT_FLAGS
  19.240 +  CAMELEON_REPORT_FLAGS :=
  19.241 +endif
  19.242 +export CAMELEON_REPORT_FLAGS
  19.243 +
  19.244 +ifndef CAMELEON_ZOGGY
  19.245 +  CAMELEON_ZOGGY := camlp4o pa_zog.cma pr_o.cmo
  19.246 +endif
  19.247 +export CAMELEON_ZOGGY
  19.248 +
  19.249 +ifndef CAMELEON_ZOGGY_FLAGS
  19.250 +  CAMELEON_ZOGGY_FLAGS :=
  19.251 +endif
  19.252 +export CAMELEON_ZOGGY_FLAGS
  19.253 +
  19.254 +ifndef OXRIDL
  19.255 +  OXRIDL := oxridl
  19.256 +endif
  19.257 +export OXRIDL
  19.258 +
  19.259 +ifndef CAMLIDL
  19.260 +  CAMLIDL := camlidl
  19.261 +endif
  19.262 +export CAMLIDL
  19.263 +
  19.264 +ifndef CAMLIDLDLL
  19.265 +  CAMLIDLDLL := camlidldll
  19.266 +endif
  19.267 +export CAMLIDLDLL
  19.268 +
  19.269 +ifndef NOIDLHEADER
  19.270 +  MAYBE_IDL_HEADER := -header
  19.271 +endif
  19.272 +export NOIDLHEADER
  19.273 +
  19.274 +export NO_CUSTOM
  19.275 +
  19.276 +ifndef CAMLP4
  19.277 +  CAMLP4 := camlp4
  19.278 +endif
  19.279 +export CAMLP4
  19.280 +
  19.281 +ifndef REAL_OCAMLFIND
  19.282 +  ifdef PACKS
  19.283 +    ifndef CREATE_LIB
  19.284 +      ifdef THREADS
  19.285 +	PACKS += threads
  19.286 +      endif
  19.287 +    endif
  19.288 +    empty :=
  19.289 +    space := $(empty) $(empty)
  19.290 +    comma := ,
  19.291 +    ifdef PREDS
  19.292 +      PRE_OCAML_FIND_PREDICATES := $(subst $(space),$(comma),$(PREDS))
  19.293 +      PRE_OCAML_FIND_PACKAGES := $(subst $(space),$(comma),$(PACKS))
  19.294 +      OCAML_FIND_PREDICATES := -predicates $(PRE_OCAML_FIND_PREDICATES)
  19.295 +  #    OCAML_DEP_PREDICATES := -syntax $(PRE_OCAML_FIND_PREDICATES)
  19.296 +      OCAML_FIND_PACKAGES := $(OCAML_FIND_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
  19.297 +      OCAML_DEP_PACKAGES := $(OCAML_DEP_PREDICATES) -package $(PRE_OCAML_FIND_PACKAGES)
  19.298 +    else
  19.299 +      OCAML_FIND_PACKAGES := -package $(subst $(space),$(comma),$(PACKS))
  19.300 +      OCAML_DEP_PACKAGES :=
  19.301 +    endif
  19.302 +    OCAML_FIND_LINKPKG := -linkpkg
  19.303 +    REAL_OCAMLFIND := $(OCAMLFIND)
  19.304 +  endif
  19.305 +endif
  19.306 +
  19.307 +export OCAML_FIND_PACKAGES
  19.308 +export OCAML_DEP_PACKAGES
  19.309 +export OCAML_FIND_LINKPKG
  19.310 +export REAL_OCAMLFIND
  19.311 +
  19.312 +ifndef OCAMLDOC
  19.313 +  OCAMLDOC := ocamldoc
  19.314 +endif
  19.315 +export OCAMLDOC
  19.316 +
  19.317 +ifndef LATEX
  19.318 +  LATEX := latex
  19.319 +endif
  19.320 +export LATEX
  19.321 +
  19.322 +ifndef DVIPS
  19.323 +  DVIPS := dvips
  19.324 +endif
  19.325 +export DVIPS
  19.326 +
  19.327 +ifndef PS2PDF
  19.328 +  PS2PDF := ps2pdf
  19.329 +endif
  19.330 +export PS2PDF
  19.331 +
  19.332 +ifndef OCAMLMAKEFILE
  19.333 +  OCAMLMAKEFILE := OCamlMakefile
  19.334 +endif
  19.335 +export OCAMLMAKEFILE
  19.336 +
  19.337 +ifndef OCAMLLIBPATH
  19.338 +  OCAMLLIBPATH := \
  19.339 +    $(shell $(OCAMLC) 2>/dev/null -where || echo /usr/local/lib/ocaml)
  19.340 +endif
  19.341 +export OCAMLLIBPATH
  19.342 +
  19.343 +ifndef OCAML_LIB_INSTALL
  19.344 +  OCAML_LIB_INSTALL := $(OCAMLLIBPATH)/contrib
  19.345 +endif
  19.346 +export OCAML_LIB_INSTALL
  19.347 +
  19.348 +###########################################################################
  19.349 +
  19.350 +####################  change following sections only if
  19.351 +####################    you know what you are doing!
  19.352 +
  19.353 +# delete target files when a build command fails
  19.354 +.PHONY: .DELETE_ON_ERROR
  19.355 +.DELETE_ON_ERROR:
  19.356 +
  19.357 +# for pedants using "--warn-undefined-variables"
  19.358 +export MAYBE_IDL
  19.359 +export REAL_RESULT
  19.360 +export CAMLIDLFLAGS
  19.361 +export THREAD_FLAG
  19.362 +export RES_CLIB
  19.363 +export MAKEDLL
  19.364 +export ANNOT_FLAG
  19.365 +export C_OXRIDL
  19.366 +export SUBPROJS
  19.367 +export CFLAGS_WIN32
  19.368 +export CPPFLAGS_WIN32
  19.369 +
  19.370 +INCFLAGS :=
  19.371 +
  19.372 +SHELL := /bin/sh
  19.373 +
  19.374 +MLDEPDIR := ._d
  19.375 +BCDIDIR  := ._bcdi
  19.376 +NCDIDIR  := ._ncdi
  19.377 +
  19.378 +FILTER_EXTNS := %.mli %.ml %.mll %.mly %.idl %.oxridl %.c %.$(EXT_CXX) %.rep %.zog %.glade
  19.379 +
  19.380 +FILTERED     := $(filter $(FILTER_EXTNS), $(SOURCES))
  19.381 +SOURCE_DIRS  := $(filter-out ./, $(sort $(dir $(FILTERED))))
  19.382 +
  19.383 +FILTERED_REP := $(filter %.rep, $(FILTERED))
  19.384 +DEP_REP      := $(FILTERED_REP:%.rep=$(MLDEPDIR)/%.d)
  19.385 +AUTO_REP     := $(FILTERED_REP:.rep=.ml)
  19.386 +
  19.387 +FILTERED_ZOG := $(filter %.zog, $(FILTERED))
  19.388 +DEP_ZOG      := $(FILTERED_ZOG:%.zog=$(MLDEPDIR)/%.d)
  19.389 +AUTO_ZOG     := $(FILTERED_ZOG:.zog=.ml)
  19.390 +
  19.391 +FILTERED_GLADE := $(filter %.glade, $(FILTERED))
  19.392 +DEP_GLADE      := $(FILTERED_GLADE:%.glade=$(MLDEPDIR)/%.d)
  19.393 +AUTO_GLADE     := $(FILTERED_GLADE:.glade=.ml)
  19.394 +
  19.395 +FILTERED_ML  := $(filter %.ml, $(FILTERED))
  19.396 +DEP_ML       := $(FILTERED_ML:%.ml=$(MLDEPDIR)/%.d)
  19.397 +
  19.398 +FILTERED_MLI := $(filter %.mli, $(FILTERED))
  19.399 +DEP_MLI      := $(FILTERED_MLI:.mli=.di)
  19.400 +
  19.401 +FILTERED_MLL := $(filter %.mll, $(FILTERED))
  19.402 +DEP_MLL      := $(FILTERED_MLL:%.mll=$(MLDEPDIR)/%.d)
  19.403 +AUTO_MLL     := $(FILTERED_MLL:.mll=.ml)
  19.404 +
  19.405 +FILTERED_MLY := $(filter %.mly, $(FILTERED))
  19.406 +DEP_MLY      := $(FILTERED_MLY:%.mly=$(MLDEPDIR)/%.d) $(FILTERED_MLY:.mly=.di)
  19.407 +AUTO_MLY     := $(FILTERED_MLY:.mly=.mli) $(FILTERED_MLY:.mly=.ml)
  19.408 +
  19.409 +FILTERED_IDL := $(filter %.idl, $(FILTERED))
  19.410 +DEP_IDL      := $(FILTERED_IDL:%.idl=$(MLDEPDIR)/%.d) $(FILTERED_IDL:.idl=.di)
  19.411 +C_IDL        := $(FILTERED_IDL:%.idl=%_stubs.c)
  19.412 +ifndef NOIDLHEADER
  19.413 + C_IDL += $(FILTERED_IDL:.idl=.h)
  19.414 +endif
  19.415 +OBJ_C_IDL    := $(FILTERED_IDL:%.idl=%_stubs.$(EXT_OBJ))
  19.416 +AUTO_IDL     := $(FILTERED_IDL:.idl=.mli) $(FILTERED_IDL:.idl=.ml) $(C_IDL)
  19.417 +
  19.418 +FILTERED_OXRIDL := $(filter %.oxridl, $(FILTERED))
  19.419 +DEP_OXRIDL      := $(FILTERED_OXRIDL:%.oxridl=$(MLDEPDIR)/%.d) $(FILTERED_OXRIDL:.oxridl=.di)
  19.420 +AUTO_OXRIDL     := $(FILTERED_OXRIDL:.oxridl=.mli) $(FILTERED_OXRIDL:.oxridl=.ml) $(C_OXRIDL)
  19.421 +
  19.422 +FILTERED_C_CXX := $(filter %.c %.$(EXT_CXX), $(FILTERED))
  19.423 +OBJ_C_CXX      := $(FILTERED_C_CXX:.c=.$(EXT_OBJ))
  19.424 +OBJ_C_CXX      := $(OBJ_C_CXX:.$(EXT_CXX)=.$(EXT_OBJ))
  19.425 +
  19.426 +PRE_TARGETS  += $(AUTO_MLL) $(AUTO_MLY) $(AUTO_IDL) $(AUTO_OXRIDL) $(AUTO_ZOG) $(AUTO_REP) $(AUTO_GLADE)
  19.427 +
  19.428 +ALL_DEPS     := $(DEP_ML) $(DEP_MLI) $(DEP_MLL) $(DEP_MLY) $(DEP_IDL) $(DEP_OXRIDL) $(DEP_ZOG) $(DEP_REP) $(DEP_GLADE)
  19.429 +
  19.430 +MLDEPS       := $(filter %.d, $(ALL_DEPS))
  19.431 +MLIDEPS      := $(filter %.di, $(ALL_DEPS))
  19.432 +BCDEPIS      := $(MLIDEPS:%.di=$(BCDIDIR)/%.di)
  19.433 +NCDEPIS      := $(MLIDEPS:%.di=$(NCDIDIR)/%.di)
  19.434 +
  19.435 +ALLML        := $(filter %.mli %.ml %.mll %.mly %.idl %.oxridl %.rep %.zog %.glade, $(FILTERED))
  19.436 +
  19.437 +IMPLO_INTF   := $(ALLML:%.mli=%.mli.__)
  19.438 +IMPLO_INTF   := $(foreach file, $(IMPLO_INTF), \
  19.439 +                  $(basename $(file)).cmi $(basename $(file)).cmo)
  19.440 +IMPLO_INTF   := $(filter-out %.mli.cmo, $(IMPLO_INTF))
  19.441 +IMPLO_INTF   := $(IMPLO_INTF:%.mli.cmi=%.cmi)
  19.442 +
  19.443 +IMPLX_INTF   := $(IMPLO_INTF:.cmo=.cmx)
  19.444 +
  19.445 +INTF         := $(filter %.cmi, $(IMPLO_INTF))
  19.446 +IMPL_CMO     := $(filter %.cmo, $(IMPLO_INTF))
  19.447 +IMPL_CMX     := $(IMPL_CMO:.cmo=.cmx)
  19.448 +IMPL_ASM     := $(IMPL_CMO:.cmo=.asm)
  19.449 +IMPL_S       := $(IMPL_CMO:.cmo=.s)
  19.450 +
  19.451 +OBJ_LINK     := $(OBJ_C_IDL) $(OBJ_C_CXX)
  19.452 +OBJ_FILES    := $(IMPL_CMO:.cmo=.$(EXT_OBJ)) $(OBJ_LINK)
  19.453 +
  19.454 +EXECS        := $(addsuffix $(EXE), \
  19.455 +                            $(sort $(TOPRESULT) $(BCRESULT) $(NCRESULT)))
  19.456 +ifdef WIN32
  19.457 +  EXECS      += $(BCRESULT).dll $(NCRESULT).dll
  19.458 +endif
  19.459 +
  19.460 +CLIB_BASE    := $(RESULT)$(RES_CLIB_SUF)
  19.461 +ifneq ($(strip $(OBJ_LINK)),)
  19.462 +  RES_CLIB     := lib$(CLIB_BASE).$(EXT_LIB)
  19.463 +endif
  19.464 +
  19.465 +ifdef WIN32
  19.466 +DLLSONAME := $(CLIB_BASE).dll
  19.467 +else
  19.468 +DLLSONAME := dll$(CLIB_BASE).so
  19.469 +endif
  19.470 +
  19.471 +NONEXECS     := $(INTF) $(IMPL_CMO) $(IMPL_CMX) $(IMPL_ASM) $(IMPL_S) \
  19.472 +		$(OBJ_FILES) $(PRE_TARGETS) $(BCRESULT).cma $(NCRESULT).cmxa \
  19.473 +		$(NCRESULT).$(EXT_LIB) $(BCRESULT).cmi $(BCRESULT).cmo \
  19.474 +		$(NCRESULT).cmi $(NCRESULT).cmx $(NCRESULT).o \
  19.475 +		$(RES_CLIB) $(IMPL_CMO:.cmo=.annot) \
  19.476 +		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(LIB_PACK_NAME).cmx $(LIB_PACK_NAME).o
  19.477 +
  19.478 +ifndef STATIC
  19.479 +  NONEXECS += $(DLLSONAME)
  19.480 +endif
  19.481 +
  19.482 +ifndef LIBINSTALL_FILES
  19.483 +  LIBINSTALL_FILES := $(RESULT).mli $(RESULT).cmi $(RESULT).cma \
  19.484 +		      $(RESULT).cmxa $(RESULT).$(EXT_LIB) $(RES_CLIB)
  19.485 +  ifndef STATIC
  19.486 +    ifneq ($(strip $(OBJ_LINK)),)
  19.487 +      LIBINSTALL_FILES += $(DLLSONAME)
  19.488 +    endif
  19.489 +  endif
  19.490 +endif
  19.491 +
  19.492 +export LIBINSTALL_FILES
  19.493 +
  19.494 +ifdef WIN32
  19.495 +  # some extra stuff is created while linking DLLs
  19.496 +  NONEXECS   += $(BCRESULT).$(EXT_LIB) $(BCRESULT).exp $(NCRESULT).exp $(CLIB_BASE).exp $(CLIB_BASE).lib
  19.497 +endif
  19.498 +
  19.499 +TARGETS      := $(EXECS) $(NONEXECS)
  19.500 +
  19.501 +# If there are IDL-files
  19.502 +ifneq ($(strip $(FILTERED_IDL)),)
  19.503 +  MAYBE_IDL := -cclib -lcamlidl
  19.504 +endif
  19.505 +
  19.506 +ifdef USE_CAMLP4
  19.507 +  CAMLP4PATH := \
  19.508 +    $(shell $(CAMLP4) -where 2>/dev/null || echo /usr/local/lib/camlp4)
  19.509 +  INCFLAGS := -I $(CAMLP4PATH)
  19.510 +  CINCFLAGS := -I$(CAMLP4PATH)
  19.511 +endif
  19.512 +
  19.513 +DINCFLAGS := $(INCFLAGS) $(SOURCE_DIRS:%=-I %) $(OCAML_DEFAULT_DIRS:%=-I %)
  19.514 +INCFLAGS := $(DINCFLAGS) $(INCDIRS:%=-I %)
  19.515 +CINCFLAGS += $(SOURCE_DIRS:%=-I%) $(INCDIRS:%=-I%) $(OCAML_DEFAULT_DIRS:%=-I%)
  19.516 +
  19.517 +ifndef MSVC
  19.518 +CLIBFLAGS += $(SOURCE_DIRS:%=-L%) $(LIBDIRS:%=-L%) \
  19.519 +             $(EXTLIBDIRS:%=-L%) $(EXTLIBDIRS:%=-Wl,$(RPATH_FLAG)%) \
  19.520 +             $(OCAML_DEFAULT_DIRS:%=-L%)
  19.521 +endif
  19.522 +
  19.523 +ifndef PROFILING
  19.524 +  INTF_OCAMLC := $(OCAMLC)
  19.525 +else
  19.526 +  ifndef THREADS
  19.527 +    INTF_OCAMLC := $(OCAMLCP) -p $(OCAMLCPFLAGS)
  19.528 +  else
  19.529 +    # OCaml does not support profiling byte code
  19.530 +    # with threads (yet), therefore we force an error.
  19.531 +    ifndef REAL_OCAMLC
  19.532 +      $(error Profiling of multithreaded byte code not yet supported by OCaml)
  19.533 +    endif
  19.534 +    INTF_OCAMLC := $(OCAMLC)
  19.535 +  endif
  19.536 +endif
  19.537 +
  19.538 +ifndef MSVC
  19.539 +COMMON_LDFLAGS := $(LDFLAGS:%=-ccopt %) $(SOURCE_DIRS:%=-ccopt -L%) \
  19.540 +		  $(LIBDIRS:%=-ccopt -L%) $(EXTLIBDIRS:%=-ccopt -L%) \
  19.541 +		  $(EXTLIBDIRS:%=-ccopt -Wl,$(RPATH_FLAG)%) \
  19.542 +		  $(OCAML_DEFAULT_DIRS:%=-ccopt -L%)
  19.543 +else
  19.544 +COMMON_LDFLAGS := -ccopt "/link -NODEFAULTLIB:LIBC $(LDFLAGS:%=%) $(SOURCE_DIRS:%=-LIBPATH:%) \
  19.545 +		  $(LIBDIRS:%=-LIBPATH:%) $(EXTLIBDIRS:%=-LIBPATH:%) \
  19.546 +		  $(OCAML_DEFAULT_DIRS:%=-LIBPATH:%) "
  19.547 +endif
  19.548 +
  19.549 +CLIBS_OPTS := $(CLIBS:%=-cclib -l%)
  19.550 +ifdef MSVC
  19.551 +  ifndef STATIC
  19.552 +  # MSVC libraries do not have 'lib' prefix
  19.553 +  CLIBS_OPTS := $(CLIBS:%=-cclib %.lib)
  19.554 +  endif
  19.555 +endif
  19.556 +
  19.557 +ifneq ($(strip $(OBJ_LINK)),)
  19.558 +  ifdef CREATE_LIB
  19.559 +    OBJS_LIBS := -cclib -l$(CLIB_BASE) $(CLIBS_OPTS) $(MAYBE_IDL)
  19.560 +  else
  19.561 +    OBJS_LIBS := $(OBJ_LINK) $(CLIBS_OPTS) $(MAYBE_IDL)
  19.562 +  endif
  19.563 +else
  19.564 +  OBJS_LIBS := $(CLIBS_OPTS) $(MAYBE_IDL)
  19.565 +endif
  19.566 +
  19.567 +# If we have to make byte-code
  19.568 +ifndef REAL_OCAMLC
  19.569 +  BYTE_OCAML := y
  19.570 +
  19.571 +  # EXTRADEPS is added dependencies we have to insert for all
  19.572 +  # executable files we generate.  Ideally it should be all of the
  19.573 +  # libraries we use, but it's hard to find the ones that get searched on
  19.574 +  # the path since I don't know the paths built into the compiler, so
  19.575 +  # just include the ones with slashes in their names.
  19.576 +  EXTRADEPS := $(addsuffix .cma,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
  19.577 +  SPECIAL_OCAMLFLAGS := $(OCAMLBCFLAGS)
  19.578 +
  19.579 +  REAL_OCAMLC := $(INTF_OCAMLC)
  19.580 +
  19.581 +  REAL_IMPL := $(IMPL_CMO)
  19.582 +  REAL_IMPL_INTF := $(IMPLO_INTF)
  19.583 +  IMPL_SUF := .cmo
  19.584 +
  19.585 +  DEPFLAGS  :=
  19.586 +  MAKE_DEPS := $(MLDEPS) $(BCDEPIS)
  19.587 +
  19.588 +  ifdef CREATE_LIB
  19.589 +    CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
  19.590 +    CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
  19.591 +    ifndef STATIC
  19.592 +      ifneq ($(strip $(OBJ_LINK)),)
  19.593 +	MAKEDLL := $(DLLSONAME)
  19.594 +	ALL_LDFLAGS := -dllib $(DLLSONAME)
  19.595 +      endif
  19.596 +    endif
  19.597 +  endif
  19.598 +
  19.599 +  ifndef NO_CUSTOM
  19.600 +    ifneq "$(strip $(OBJ_LINK) $(THREADS) $(MAYBE_IDL) $(CLIBS))" ""
  19.601 +      ALL_LDFLAGS += -custom
  19.602 +    endif
  19.603 +  endif
  19.604 +
  19.605 +  ALL_LDFLAGS += $(INCFLAGS) $(OCAMLLDFLAGS) $(OCAMLBLDFLAGS) \
  19.606 +                 $(COMMON_LDFLAGS) $(LIBS:%=%.cma)
  19.607 +  CAMLIDLDLLFLAGS :=
  19.608 +
  19.609 +  ifdef THREADS
  19.610 +    ifdef VMTHREADS
  19.611 +      THREAD_FLAG := -vmthread
  19.612 +    else
  19.613 +      THREAD_FLAG := -thread
  19.614 +    endif
  19.615 +    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
  19.616 +    ifndef CREATE_LIB
  19.617 +      ifndef REAL_OCAMLFIND
  19.618 +        ALL_LDFLAGS := unix.cma threads.cma $(ALL_LDFLAGS)
  19.619 +      endif
  19.620 +    endif
  19.621 +  endif
  19.622 +
  19.623 +# we have to make native-code
  19.624 +else
  19.625 +  EXTRADEPS := $(addsuffix .cmxa,$(foreach i,$(LIBS),$(if $(findstring /,$(i)),$(i))))
  19.626 +  ifndef PROFILING
  19.627 +    SPECIAL_OCAMLFLAGS := $(OCAMLNCFLAGS)
  19.628 +    PLDFLAGS :=
  19.629 +  else
  19.630 +    SPECIAL_OCAMLFLAGS := -p $(OCAMLNCFLAGS)
  19.631 +    PLDFLAGS := -p
  19.632 +  endif
  19.633 +
  19.634 +  REAL_IMPL := $(IMPL_CMX)
  19.635 +  REAL_IMPL_INTF := $(IMPLX_INTF)
  19.636 +  IMPL_SUF := .cmx
  19.637 +
  19.638 +  CPPFLAGS := -DNATIVE_CODE $(CPPFLAGS)
  19.639 +
  19.640 +  DEPFLAGS  := -native
  19.641 +  MAKE_DEPS := $(MLDEPS) $(NCDEPIS)
  19.642 +
  19.643 +  ALL_LDFLAGS := $(PLDFLAGS) $(INCFLAGS) $(OCAMLLDFLAGS) \
  19.644 +                 $(OCAMLNLDFLAGS) $(COMMON_LDFLAGS)
  19.645 +  CAMLIDLDLLFLAGS := -opt
  19.646 +
  19.647 +  ifndef CREATE_LIB
  19.648 +    ALL_LDFLAGS += $(LIBS:%=%.cmxa)
  19.649 +  else
  19.650 +    CFLAGS := $(PIC_CFLAGS) $(CFLAGS)
  19.651 +    CPPFLAGS := $(PIC_CPPFLAGS) $(CPPFLAGS)
  19.652 +  endif
  19.653 +
  19.654 +  ifdef THREADS
  19.655 +    THREAD_FLAG := -thread
  19.656 +    ALL_LDFLAGS := $(THREAD_FLAG) $(ALL_LDFLAGS)
  19.657 +    ifndef CREATE_LIB
  19.658 +      ifndef REAL_OCAMLFIND
  19.659 +        ALL_LDFLAGS := unix.cmxa threads.cmxa $(ALL_LDFLAGS)
  19.660 +      endif
  19.661 +    endif
  19.662 +  endif
  19.663 +endif
  19.664 +
  19.665 +export MAKE_DEPS
  19.666 +
  19.667 +ifdef ANNOTATE
  19.668 +  ANNOT_FLAG := -dtypes
  19.669 +else
  19.670 +endif
  19.671 +
  19.672 +ALL_OCAMLCFLAGS := $(THREAD_FLAG) $(ANNOT_FLAG) $(OCAMLFLAGS) \
  19.673 +                   $(INCFLAGS) $(SPECIAL_OCAMLFLAGS)
  19.674 +
  19.675 +ifdef make_deps
  19.676 +  -include $(MAKE_DEPS)
  19.677 +  PRE_TARGETS :=
  19.678 +endif
  19.679 +
  19.680 +###########################################################################
  19.681 +# USER RULES
  19.682 +
  19.683 +# Call "OCamlMakefile QUIET=" to get rid of all of the @'s.
  19.684 +QUIET=@
  19.685 +
  19.686 +# generates byte-code (default)
  19.687 +byte-code:		$(PRE_TARGETS)
  19.688 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  19.689 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  19.690 +bc:	byte-code
  19.691 +
  19.692 +byte-code-nolink:	$(PRE_TARGETS)
  19.693 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  19.694 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  19.695 +bcnl:	byte-code-nolink
  19.696 +
  19.697 +top:			$(PRE_TARGETS)
  19.698 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(TOPRESULT) \
  19.699 +				REAL_RESULT="$(BCRESULT)" make_deps=yes
  19.700 +
  19.701 +# generates native-code
  19.702 +
  19.703 +native-code:		$(PRE_TARGETS)
  19.704 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
  19.705 +				REAL_RESULT="$(NCRESULT)" \
  19.706 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.707 +				make_deps=yes
  19.708 +nc:	native-code
  19.709 +
  19.710 +native-code-nolink:	$(PRE_TARGETS)
  19.711 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  19.712 +				REAL_RESULT="$(NCRESULT)" \
  19.713 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.714 +				make_deps=yes
  19.715 +ncnl:	native-code-nolink
  19.716 +
  19.717 +# generates byte-code libraries
  19.718 +byte-code-library:	$(PRE_TARGETS)
  19.719 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.720 +				$(RES_CLIB) $(BCRESULT).cma \
  19.721 +				REAL_RESULT="$(BCRESULT)" \
  19.722 +				CREATE_LIB=yes \
  19.723 +				make_deps=yes
  19.724 +bcl:	byte-code-library
  19.725 +
  19.726 +# generates native-code libraries
  19.727 +native-code-library:	$(PRE_TARGETS)
  19.728 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.729 +				$(RES_CLIB) $(NCRESULT).cmxa \
  19.730 +				REAL_RESULT="$(NCRESULT)" \
  19.731 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.732 +				CREATE_LIB=yes \
  19.733 +				make_deps=yes
  19.734 +ncl:	native-code-library
  19.735 +
  19.736 +ifdef WIN32
  19.737 +# generates byte-code dll
  19.738 +byte-code-dll:		$(PRE_TARGETS)
  19.739 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.740 +				$(RES_CLIB) $(BCRESULT).dll \
  19.741 +				REAL_RESULT="$(BCRESULT)" \
  19.742 +				make_deps=yes
  19.743 +bcd:	byte-code-dll
  19.744 +
  19.745 +# generates native-code dll
  19.746 +native-code-dll:	$(PRE_TARGETS)
  19.747 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.748 +				$(RES_CLIB) $(NCRESULT).dll \
  19.749 +				REAL_RESULT="$(NCRESULT)" \
  19.750 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.751 +				make_deps=yes
  19.752 +ncd:	native-code-dll
  19.753 +endif
  19.754 +
  19.755 +# generates byte-code with debugging information
  19.756 +debug-code:		$(PRE_TARGETS)
  19.757 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  19.758 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  19.759 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  19.760 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  19.761 +dc:	debug-code
  19.762 +
  19.763 +debug-code-nolink:	$(PRE_TARGETS)
  19.764 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
  19.765 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  19.766 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  19.767 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  19.768 +dcnl:	debug-code-nolink
  19.769 +
  19.770 +# generates byte-code libraries with debugging information
  19.771 +debug-code-library:	$(PRE_TARGETS)
  19.772 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.773 +				$(RES_CLIB) $(BCRESULT).cma \
  19.774 +				REAL_RESULT="$(BCRESULT)" make_deps=yes \
  19.775 +				CREATE_LIB=yes \
  19.776 +				OCAMLFLAGS="-g $(OCAMLFLAGS)" \
  19.777 +				OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
  19.778 +dcl:	debug-code-library
  19.779 +
  19.780 +# generates byte-code for profiling
  19.781 +profiling-byte-code:		$(PRE_TARGETS)
  19.782 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \
  19.783 +				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
  19.784 +				make_deps=yes
  19.785 +pbc:	profiling-byte-code
  19.786 +
  19.787 +# generates native-code
  19.788 +
  19.789 +profiling-native-code:		$(PRE_TARGETS)
  19.790 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
  19.791 +				REAL_RESULT="$(NCRESULT)" \
  19.792 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.793 +				PROFILING="y" \
  19.794 +				make_deps=yes
  19.795 +pnc:	profiling-native-code
  19.796 +
  19.797 +# generates byte-code libraries
  19.798 +profiling-byte-code-library:	$(PRE_TARGETS)
  19.799 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.800 +				$(RES_CLIB) $(BCRESULT).cma \
  19.801 +				REAL_RESULT="$(BCRESULT)" PROFILING="y" \
  19.802 +				CREATE_LIB=yes \
  19.803 +				make_deps=yes
  19.804 +pbcl:	profiling-byte-code-library
  19.805 +
  19.806 +# generates native-code libraries
  19.807 +profiling-native-code-library:	$(PRE_TARGETS)
  19.808 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.809 +				$(RES_CLIB) $(NCRESULT).cmxa \
  19.810 +				REAL_RESULT="$(NCRESULT)" PROFILING="y" \
  19.811 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.812 +				CREATE_LIB=yes \
  19.813 +				make_deps=yes
  19.814 +pncl:	profiling-native-code-library
  19.815 +
  19.816 +# packs byte-code objects
  19.817 +pack-byte-code:			$(PRE_TARGETS)
  19.818 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT).cmo \
  19.819 +				REAL_RESULT="$(BCRESULT)" \
  19.820 +				PACK_LIB=yes make_deps=yes
  19.821 +pabc:	pack-byte-code
  19.822 +
  19.823 +# packs native-code objects
  19.824 +pack-native-code:		$(PRE_TARGETS)
  19.825 +			$(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
  19.826 +				$(NCRESULT).cmx $(NCRESULT).o \
  19.827 +				REAL_RESULT="$(NCRESULT)" \
  19.828 +				REAL_OCAMLC="$(OCAMLOPT)" \
  19.829 +				PACK_LIB=yes make_deps=yes
  19.830 +panc:	pack-native-code
  19.831 +
  19.832 +# generates HTML-documentation
  19.833 +htdoc:	doc/$(RESULT)/html
  19.834 +
  19.835 +# generates Latex-documentation
  19.836 +ladoc:	doc/$(RESULT)/latex
  19.837 +
  19.838 +# generates PostScript-documentation
  19.839 +psdoc:	doc/$(RESULT)/latex/doc.ps
  19.840 +
  19.841 +# generates PDF-documentation
  19.842 +pdfdoc:	doc/$(RESULT)/latex/doc.pdf
  19.843 +
  19.844 +# generates all supported forms of documentation
  19.845 +doc: htdoc ladoc psdoc pdfdoc
  19.846 +
  19.847 +###########################################################################
  19.848 +# LOW LEVEL RULES
  19.849 +
  19.850 +$(REAL_RESULT):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS) $(RESULTDEPS)
  19.851 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) \
  19.852 +				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
  19.853 +				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
  19.854 +				$(REAL_IMPL)
  19.855 +
  19.856 +nolink:			$(REAL_IMPL_INTF) $(OBJ_LINK)
  19.857 +
  19.858 +ifdef WIN32
  19.859 +$(REAL_RESULT).dll:	$(REAL_IMPL_INTF) $(OBJ_LINK)
  19.860 +			$(CAMLIDLDLL) $(CAMLIDLDLLFLAGS) $(OBJ_LINK) $(CLIBS) \
  19.861 +				-o $@ $(REAL_IMPL)
  19.862 +endif
  19.863 +
  19.864 +%$(TOPSUFFIX):		$(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
  19.865 +			$(REAL_OCAMLFIND) $(OCAMLMKTOP) \
  19.866 +				$(OCAML_FIND_PACKAGES) $(OCAML_FIND_LINKPKG) \
  19.867 +				$(ALL_LDFLAGS) $(OBJS_LIBS) -o $@$(EXE) \
  19.868 +				$(REAL_IMPL)
  19.869 +
  19.870 +.SUFFIXES:		.mli .ml .cmi .cmo .cmx .cma .cmxa .$(EXT_OBJ) \
  19.871 +                        .mly .di .d .$(EXT_LIB) .idl %.oxridl .c .$(EXT_CXX) .h .so \
  19.872 +                        .rep .zog .glade
  19.873 +
  19.874 +ifndef STATIC
  19.875 +ifdef MINGW
  19.876 +$(DLLSONAME):		$(OBJ_LINK)
  19.877 +			$(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \
  19.878 +			-Wl,--whole-archive $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \
  19.879 +			 $(OCAMLLIBPATH)/ocamlrun.a \
  19.880 +			-Wl,--export-all-symbols \
  19.881 +			-Wl,--no-whole-archive
  19.882 +else
  19.883 +ifdef MSVC
  19.884 +$(DLLSONAME):		$(OBJ_LINK)
  19.885 +			link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \
  19.886 +			 $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \
  19.887 +			 $(OCAMLLIBPATH)/ocamlrun.lib
  19.888 +
  19.889 +else
  19.890 +$(DLLSONAME):		$(OBJ_LINK)
  19.891 +			$(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \
  19.892 +				-o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \
  19.893 +				$(OCAMLMKLIB_FLAGS)
  19.894 +endif
  19.895 +endif
  19.896 +endif
  19.897 +
  19.898 +ifndef LIB_PACK_NAME
  19.899 +$(RESULT).cma:		$(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
  19.900 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
  19.901 +				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(REAL_IMPL)
  19.902 +
  19.903 +$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(REAL_IMPL_INTF) $(EXTRADEPS) $(RESULTDEPS)
  19.904 +			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
  19.905 +				$(OCAMLNLDFLAGS) -o $@ $(REAL_IMPL)
  19.906 +else
  19.907 +ifdef BYTE_OCAML
  19.908 +$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo: $(REAL_IMPL_INTF)
  19.909 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmo $(REAL_IMPL)
  19.910 +else
  19.911 +$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx: $(REAL_IMPL_INTF)
  19.912 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack -o $(LIB_PACK_NAME).cmx $(REAL_IMPL)
  19.913 +endif
  19.914 +
  19.915 +$(RESULT).cma:		$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmo $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS)
  19.916 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -a $(ALL_LDFLAGS) \
  19.917 +				$(OBJS_LIBS) -o $@ $(OCAMLBLDFLAGS) $(LIB_PACK_NAME).cmo
  19.918 +
  19.919 +$(RESULT).cmxa $(RESULT).$(EXT_LIB):	$(LIB_PACK_NAME).cmi $(LIB_PACK_NAME).cmx $(EXTRADEPS) $(RESULTDEPS)
  19.920 +			$(REAL_OCAMLFIND) $(OCAMLOPT) -a $(ALL_LDFLAGS) $(OBJS_LIBS) \
  19.921 +				$(OCAMLNLDFLAGS) -o $@ $(LIB_PACK_NAME).cmx
  19.922 +endif
  19.923 +
  19.924 +$(RES_CLIB): 		$(OBJ_LINK)
  19.925 +ifndef MSVC
  19.926 +  ifneq ($(strip $(OBJ_LINK)),)
  19.927 +		      $(AR) rcs $@ $(OBJ_LINK)
  19.928 +  endif
  19.929 +else
  19.930 +  ifneq ($(strip $(OBJ_LINK)),)
  19.931 +			lib -nologo -debugtype:cv -out:$(RES_CLIB) $(OBJ_LINK)
  19.932 +  endif
  19.933 +endif
  19.934 +
  19.935 +.mli.cmi: $(EXTRADEPS)
  19.936 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
  19.937 +			if [ -z "$$pp" ]; then \
  19.938 +			  echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.939 +				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
  19.940 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  19.941 +			  $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.942 +				-c $(THREAD_FLAG) $(ANNOT_FLAG) \
  19.943 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  19.944 +			else \
  19.945 +			    echo $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.946 +				-c -pp \"$$pp $(PPFLAGS)\" $(THREAD_FLAG) $(ANNOT_FLAG) \
  19.947 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  19.948 +			    $(REAL_OCAMLFIND) $(INTF_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.949 +				-c -pp "$$pp $(PPFLAGS)" $(THREAD_FLAG) $(ANNOT_FLAG) \
  19.950 +				$(OCAMLFLAGS) $(INCFLAGS) $<; \
  19.951 +			fi
  19.952 +
  19.953 +.ml.cmi .ml.$(EXT_OBJ) .ml.cmx .ml.cmo: $(EXTRADEPS)
  19.954 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
  19.955 +			if [ -z "$$pp" ]; then \
  19.956 +			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.957 +				-c $(ALL_OCAMLCFLAGS) $<; \
  19.958 +			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.959 +				-c $(ALL_OCAMLCFLAGS) $<; \
  19.960 +			else \
  19.961 +			  echo $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.962 +				-c -pp \"$$pp $(PPFLAGS)\" $(ALL_OCAMLCFLAGS) $<; \
  19.963 +			  $(REAL_OCAMLFIND) $(REAL_OCAMLC) $(OCAML_FIND_PACKAGES) \
  19.964 +				-c -pp "$$pp $(PPFLAGS)" $(ALL_OCAMLCFLAGS) $<; \
  19.965 +			fi
  19.966 +
  19.967 +ifdef PACK_LIB
  19.968 +$(REAL_RESULT).cmo $(REAL_RESULT).cmx $(REAL_RESULT).o: $(REAL_IMPL_INTF) $(OBJ_LINK) $(EXTRADEPS)
  19.969 +			$(REAL_OCAMLFIND) $(REAL_OCAMLC) -pack $(ALL_LDFLAGS) \
  19.970 +				$(OBJS_LIBS) -o $@ $(REAL_IMPL)
  19.971 +endif
  19.972 +
  19.973 +.PRECIOUS:		%.ml
  19.974 +%.ml:			%.mll
  19.975 +			$(OCAMLLEX) $<
  19.976 +
  19.977 +.PRECIOUS:              %.ml %.mli
  19.978 +%.ml %.mli:             %.mly
  19.979 +			$(OCAMLYACC) $(YFLAGS) $<
  19.980 +			$(QUIET)pp=`sed -n -e 's/.*(\*pp \([^*]*\) \*).*/\1/p;q' $<`; \
  19.981 +			if [ ! -z "$$pp" ]; then \
  19.982 +			  mv $*.ml $*.ml.temporary; \
  19.983 +			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.ml; \
  19.984 +			  cat $*.ml.temporary >> $*.ml; \
  19.985 +			  rm $*.ml.temporary; \
  19.986 +			  mv $*.mli $*.mli.temporary; \
  19.987 +			  echo "(*pp $$pp $(PPFLAGS)*)" > $*.mli; \
  19.988 +			  cat $*.mli.temporary >> $*.mli; \
  19.989 +			  rm $*.mli.temporary; \
  19.990 +			fi
  19.991 +
  19.992 +
  19.993 +.PRECIOUS:		%.ml
  19.994 +%.ml:			%.rep
  19.995 +			$(CAMELEON_REPORT) $(CAMELEON_REPORT_FLAGS) -gen $<
  19.996 +
  19.997 +.PRECIOUS:		%.ml
  19.998 +%.ml:			%.zog
  19.999 +			$(CAMELEON_ZOGGY)  $(CAMELEON_ZOGGY_FLAGS) -impl $< > $@
 19.1000 +
 19.1001 +.PRECIOUS:		%.ml
 19.1002 +%.ml:			%.glade
 19.1003 +			$(OCAML_GLADECC)  $(OCAML_GLADECC_FLAGS) $< > $@
 19.1004 +
 19.1005 +.PRECIOUS:		%.ml %.mli
 19.1006 +%.ml %.mli:		%.oxridl
 19.1007 +			$(OXRIDL) $<
 19.1008 +
 19.1009 +.PRECIOUS:		%.ml %.mli %_stubs.c %.h
 19.1010 +%.ml %.mli %_stubs.c %.h:		%.idl
 19.1011 +			$(CAMLIDL) $(MAYBE_IDL_HEADER) $(IDLFLAGS) \
 19.1012 +				$(CAMLIDLFLAGS) $<
 19.1013 +			$(QUIET)if [ $(NOIDLHEADER) ]; then touch $*.h; fi
 19.1014 +
 19.1015 +.c.$(EXT_OBJ):
 19.1016 +			$(OCAMLC) -c -cc "$(CC)" -ccopt "$(CFLAGS) \
 19.1017 +				$(CPPFLAGS) $(CPPFLAGS_WIN32) \
 19.1018 +				$(CFLAGS_WIN32) $(CINCFLAGS) $(CFLAG_O)$@ " $< 
 19.1019 +
 19.1020 +.$(EXT_CXX).$(EXT_OBJ):
 19.1021 +			$(CXX) -c $(CXXFLAGS) $(CINCFLAGS) $(CPPFLAGS) \
 19.1022 +				-I'$(OCAMLLIBPATH)' \
 19.1023 +				$< $(CFLAG_O)$@
 19.1024 +
 19.1025 +$(MLDEPDIR)/%.d:	%.ml
 19.1026 +			$(QUIET)echo making $@ from $<
 19.1027 +			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
 19.1028 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 19.1029 +			if [ -z "$$pp" ]; then \
 19.1030 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
 19.1031 +				$(DINCFLAGS) $< > $@; \
 19.1032 +			else \
 19.1033 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(OCAML_DEP_PACKAGES) \
 19.1034 +				-pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
 19.1035 +			fi
 19.1036 +
 19.1037 +$(BCDIDIR)/%.di $(NCDIDIR)/%.di:	%.mli
 19.1038 +			$(QUIET)echo making $@ from $<
 19.1039 +			$(QUIET)if [ ! -d $(@D) ]; then mkdir -p $(@D); fi
 19.1040 +			$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 19.1041 +			if [ -z "$$pp" ]; then \
 19.1042 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) $(DINCFLAGS) $< > $@; \
 19.1043 +			else \
 19.1044 +			  $(REAL_OCAMLFIND) $(OCAMLDEP) $(DEPFLAGS) \
 19.1045 +			    -pp "$$pp $(PPFLAGS)" $(DINCFLAGS) $< > $@; \
 19.1046 +			fi
 19.1047 +
 19.1048 +doc/$(RESULT)/html: $(DOC_FILES)
 19.1049 +	rm -rf $@
 19.1050 +	mkdir -p $@
 19.1051 +	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 19.1052 +	if [ -z "$$pp" ]; then \
 19.1053 +	  echo $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 19.1054 +	  $(OCAMLDOC) -html -d $@ $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES); \
 19.1055 +	else \
 19.1056 +	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -html -d $@ $(OCAMLDOCFLAGS) \
 19.1057 +	  	$(INCFLAGS) $(DOC_FILES); \
 19.1058 +	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -html -d $@ $(OCAMLDOCFLAGS) \
 19.1059 +	  	$(INCFLAGS) $(DOC_FILES); \
 19.1060 +	fi
 19.1061 +
 19.1062 +doc/$(RESULT)/latex: $(DOC_FILES)
 19.1063 +	rm -rf $@
 19.1064 +	mkdir -p $@
 19.1065 +	$(QUIET)pp=`sed -n -e '/^#/d' -e 's/(\*pp \([^*]*\) \*)/\1/p;q' $<`; \
 19.1066 +	if [ -z "$$pp" ]; then \
 19.1067 +	  echo $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) \
 19.1068 +	  	$(DOC_FILES) -o $@/doc.tex; \
 19.1069 +	  $(OCAMLDOC) -latex $(OCAMLDOCFLAGS) $(INCFLAGS) $(DOC_FILES) \
 19.1070 +	  	-o $@/doc.tex; \
 19.1071 +	else \
 19.1072 +	  echo $(OCAMLDOC) -pp \"$$pp $(PPFLAGS)\" -latex $(OCAMLDOCFLAGS) \
 19.1073 +	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
 19.1074 +	  $(OCAMLDOC) -pp "$$pp $(PPFLAGS)" -latex $(OCAMLDOCFLAGS) \
 19.1075 +	  	$(INCFLAGS) $(DOC_FILES) -o $@/doc.tex; \
 19.1076 +	fi
 19.1077 +
 19.1078 +doc/$(RESULT)/latex/doc.ps: doc/$(RESULT)/latex
 19.1079 +	cd doc/$(RESULT)/latex && \
 19.1080 +	  $(LATEX) doc.tex && \
 19.1081 +	  $(LATEX) doc.tex && \
 19.1082 +	  $(DVIPS) $(DVIPSFLAGS) doc.dvi -o $(@F)
 19.1083 +
 19.1084 +doc/$(RESULT)/latex/doc.pdf: doc/$(RESULT)/latex/doc.ps
 19.1085 +	cd doc/$(RESULT)/latex && $(PS2PDF) $(<F)
 19.1086 +
 19.1087 +define make_subproj
 19.1088 +.PHONY:
 19.1089 +subproj_$(1):
 19.1090 +	$$(eval $$(call PROJ_$(1)))
 19.1091 +	$(QUIET)if [ "$(SUBTARGET)" != "all" ]; then \
 19.1092 +	  $(MAKE) -f $(OCAMLMAKEFILE) $(SUBTARGET); \
 19.1093 +	fi
 19.1094 +endef
 19.1095 +
 19.1096 +$(foreach subproj,$(SUBPROJS),$(eval $(call make_subproj,$(subproj))))
 19.1097 +
 19.1098 +.PHONY:
 19.1099 +subprojs: $(SUBPROJS:%=subproj_%)
 19.1100 +
 19.1101 +###########################################################################
 19.1102 +# (UN)INSTALL RULES FOR LIBRARIES
 19.1103 +
 19.1104 +.PHONY: libinstall
 19.1105 +libinstall:	all
 19.1106 +	$(QUIET)printf "\nInstalling library with ocamlfind\n"
 19.1107 +	$(OCAMLFIND) install $(OCAMLFIND_INSTFLAGS) $(RESULT) META $(LIBINSTALL_FILES)
 19.1108 +	$(QUIET)printf "\nInstallation successful.\n"
 19.1109 +
 19.1110 +.PHONY: libuninstall
 19.1111 +libuninstall:
 19.1112 +	$(QUIET)printf "\nUninstalling library with ocamlfind\n"
 19.1113 +	$(OCAMLFIND) remove $(OCAMLFIND_INSTFLAGS) $(RESULT)
 19.1114 +	$(QUIET)printf "\nUninstallation successful.\n"
 19.1115 +
 19.1116 +.PHONY: rawinstall
 19.1117 +rawinstall:	all
 19.1118 +	$(QUIET)printf "\nInstalling library to: $(OCAML_LIB_INSTALL)\n"
 19.1119 +	-install -d $(OCAML_LIB_INSTALL)
 19.1120 +	for i in $(LIBINSTALL_FILES); do \
 19.1121 +	  if [ -f $$i ]; then \
 19.1122 +	    install -c -m 0644 $$i $(OCAML_LIB_INSTALL); \
 19.1123 +	  fi; \
 19.1124 +	done
 19.1125 +	$(QUIET)printf "\nInstallation successful.\n"
 19.1126 +
 19.1127 +.PHONY: rawuninstall
 19.1128 +rawuninstall:
 19.1129 +	$(QUIET)printf "\nUninstalling library from: $(OCAML_LIB_INSTALL)\n"
 19.1130 +	cd $(OCAML_LIB_INSTALL) && rm $(notdir $(LIBINSTALL_FILES))
 19.1131 +	$(QUIET)printf "\nUninstallation successful.\n"
 19.1132 +
 19.1133 +###########################################################################
 19.1134 +# MAINTAINANCE RULES
 19.1135 +
 19.1136 +.PHONY:	clean
 19.1137 +clean::
 19.1138 +	rm -f $(TARGETS) $(TRASH)
 19.1139 +	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
 19.1140 +
 19.1141 +.PHONY:	cleanup
 19.1142 +cleanup::
 19.1143 +	rm -f $(NONEXECS) $(TRASH)
 19.1144 +	rm -rf $(BCDIDIR) $(NCDIDIR) $(MLDEPDIR)
 19.1145 +
 19.1146 +.PHONY: clean-doc
 19.1147 +clean-doc::
 19.1148 +	rm -rf doc
 19.1149 +
 19.1150 +.PHONY: nobackup
 19.1151 +nobackup:
 19.1152 +	rm -f *.bak *~ *.dup
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tools/debugger/pdb/PDB.ml	Sat Jun 04 15:27:59 2005 +0000
    20.3 @@ -0,0 +1,180 @@
    20.4 +(** PDB.ml
    20.5 + *
    20.6 + *  Dispatch debugger commands to the appropriate context
    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 +exception Unimplemented of string
   20.14 +exception Unknown_context of string
   20.15 +exception Unknown_domain
   20.16 +
   20.17 +type context_t =
   20.18 +  | Void
   20.19 +  | Event_channel
   20.20 +  | Domain of Domain.context_t
   20.21 +  | Process of Process.context_t
   20.22 +
   20.23 +let string_of_context ctx =
   20.24 +  match ctx with
   20.25 +  | Void -> "{void}"
   20.26 +  | Event_channel -> "{event channel}"
   20.27 +  | Domain d  -> Domain.string_of_context d
   20.28 +  | Process p -> Process.string_of_context p
   20.29 +
   20.30 +
   20.31 +
   20.32 +let read_registers ctx =
   20.33 +  match ctx with
   20.34 +  | Domain d  -> Domain.read_registers d 
   20.35 +  | _ -> Intel.null_registers
   20.36 +
   20.37 +let write_register ctx register value =
   20.38 +  match ctx with
   20.39 +  | Domain d  -> Domain.write_register d register value
   20.40 +  | _ -> raise (Unimplemented "write register")
   20.41 +
   20.42 +
   20.43 +let read_memory ctx addr len =
   20.44 +  match ctx with
   20.45 +  | Domain d  -> Domain.read_memory d addr len
   20.46 +  | _ -> raise (Unimplemented "read memory")
   20.47 +
   20.48 +let write_memory ctx addr values =
   20.49 +  match ctx with
   20.50 +  | Domain d  -> Domain.write_memory d addr values
   20.51 +  | _ -> raise (Unimplemented "write memory")
   20.52 +
   20.53 +
   20.54 +let continue ctx =
   20.55 +  match ctx with
   20.56 +  | Domain d  -> Domain.continue d
   20.57 +  | _ -> raise (Unimplemented "continue")
   20.58 +
   20.59 +let step ctx =
   20.60 +  match ctx with
   20.61 +  | Domain d  -> Domain.step d
   20.62 +  | _ -> raise (Unimplemented "step")
   20.63 +
   20.64 +
   20.65 +let insert_memory_breakpoint ctx addr len =
   20.66 +  match ctx with
   20.67 +  | Domain d  -> Domain.insert_memory_breakpoint d addr len
   20.68 +  | _ -> raise (Unimplemented "insert memory breakpoint")
   20.69 +
   20.70 +let remove_memory_breakpoint ctx addr len =
   20.71 +  match ctx with
   20.72 +  | Domain d  -> Domain.remove_memory_breakpoint d addr len
   20.73 +  | _ -> raise (Unimplemented "remove memory breakpoint")
   20.74 +
   20.75 +
   20.76 +let pause ctx =
   20.77 +  match ctx with
   20.78 +  | Domain d  -> Domain.pause d
   20.79 +  | _ -> raise (Unimplemented "pause target")
   20.80 +
   20.81 +
   20.82 +let attach_debugger ctx =
   20.83 +  match ctx with
   20.84 +  | Domain d  -> Domain.attach_debugger (Domain.get_domain d) 
   20.85 +	                                (Domain.get_execution_domain d)
   20.86 +  | _ -> raise (Unimplemented "attach debugger")
   20.87 +
   20.88 +let detach_debugger ctx =
   20.89 +  match ctx with
   20.90 +  | Domain d  -> Domain.detach_debugger (Domain.get_domain d) 
   20.91 +	                                (Domain.get_execution_domain d)
   20.92 +  | _ -> raise (Unimplemented "detach debugger")
   20.93 +
   20.94 +external open_debugger : unit -> unit = "open_context"
   20.95 +external close_debugger : unit -> unit = "close_context"
   20.96 +
   20.97 +(* this is just the domains right now... expand to other contexts later *)
   20.98 +external debugger_status : unit -> unit = "debugger_status"
   20.99 +
  20.100 +
  20.101 +(***********************************************************)
  20.102 +
  20.103 +
  20.104 +let hash = Hashtbl.create 10
  20.105 +
  20.106 +let debug_contexts () =
  20.107 +  print_endline "context list:";
  20.108 +  let print_context key ctx = 
  20.109 +    match ctx with
  20.110 +    | Void -> print_endline (Printf.sprintf "  [%s] {void}" 
  20.111 +			       (Util.get_connection_info key))
  20.112 +    | Event_channel -> print_endline (Printf.sprintf "  [%s] {event_channel}" 
  20.113 +			       (Util.get_connection_info key))
  20.114 +    | Process p -> print_endline (Printf.sprintf "  [%s] %s" 
  20.115 +				    (Util.get_connection_info key)
  20.116 +				    (Process.string_of_context p))
  20.117 +    | Domain d -> print_endline (Printf.sprintf "  [%s] %s" 
  20.118 +				   (Util.get_connection_info key)
  20.119 +				   (Domain.string_of_context d))
  20.120 +  in
  20.121 +  Hashtbl.iter print_context hash
  20.122 +
  20.123 +(** add_context : add a new context to the hash table.
  20.124 + *  if there is an existing context for the same key then it 
  20.125 + *  is first removed implictly by the hash table replace function.
  20.126 + *)
  20.127 +let add_context (key:Unix.file_descr) context params =
  20.128 +  match context with
  20.129 +  | "void" -> Hashtbl.replace hash key Void
  20.130 +  | "event channel" -> Hashtbl.replace hash key Event_channel
  20.131 +  | "domain" -> 
  20.132 +      begin
  20.133 +	match params with
  20.134 +	| dom::exec_dom::_ ->
  20.135 +            let d = Domain(Domain.new_context dom exec_dom) in
  20.136 +	    attach_debugger d;
  20.137 +            Hashtbl.replace hash key d
  20.138 +	| _ -> failwith "bogus parameters to domain context"
  20.139 +      end
  20.140 +  | "process" -> 
  20.141 +      begin
  20.142 +	match params with
  20.143 +	| dom::pid::_ ->
  20.144 +	    let p = Process.new_context dom pid in
  20.145 +	    Hashtbl.replace hash key (Process(p))
  20.146 +	| _ -> failwith "bogus parameters to process context"
  20.147 +      end
  20.148 +  | _ -> raise (Unknown_context context)
  20.149 +
  20.150 +let add_default_context sock =
  20.151 +  add_context sock "void" []
  20.152 +
  20.153 +let find_context key =
  20.154 +  try
  20.155 +    Hashtbl.find hash key
  20.156 +  with
  20.157 +    Not_found ->
  20.158 +      print_endline "error: (find_context) PDB context not found";
  20.159 +      raise Not_found
  20.160 +
  20.161 +let delete_context key =
  20.162 +  Hashtbl.remove hash key
  20.163 +
  20.164 +(** find_domain : Locate the context(s) matching a particular domain 
  20.165 + *  and execution_domain pair.
  20.166 + *)
  20.167 +
  20.168 +let find_domain dom exec_dom =
  20.169 +    let find key ctx list =
  20.170 +      match ctx with
  20.171 +      |	Domain d ->
  20.172 +	  if (((Domain.get_domain d) = dom) &&
  20.173 +	      ((Domain.get_execution_domain d) = exec_dom))
  20.174 +	  then
  20.175 +	    key :: list
  20.176 +	  else
  20.177 +	    list
  20.178 +      | _ -> list
  20.179 +    in
  20.180 +    let sock_list = Hashtbl.fold find hash [] in
  20.181 +    match sock_list with
  20.182 +    | hd::tl -> hd
  20.183 +    | [] -> raise Unknown_domain
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/debugger/pdb/Process.ml	Sat Jun 04 15:27:59 2005 +0000
    21.3 @@ -0,0 +1,39 @@
    21.4 +(** Process.ml
    21.5 + *
    21.6 + *  process context implementation
    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 +open Int32
   21.14 +open Intel
   21.15 +
   21.16 +type context_t =
   21.17 +{
   21.18 +  mutable domain : int;
   21.19 +  mutable process : int;
   21.20 +}
   21.21 +
   21.22 +let default_context = { domain = 0; process = 0 }
   21.23 +
   21.24 +let new_context dom proc = { domain = dom; process = proc }
   21.25 +
   21.26 +let string_of_context ctx =
   21.27 +  Printf.sprintf "{process} domain: %d, process: %d"
   21.28 +                 ctx.domain  ctx.process
   21.29 +
   21.30 +let set_domain ctx value =
   21.31 +  ctx.domain <- value;
   21.32 +  print_endline (Printf.sprintf "ctx.domain <- %d" ctx.domain)
   21.33 +
   21.34 +let set_process ctx value =
   21.35 +  ctx.process <- value;
   21.36 +  print_endline (Printf.sprintf "ctx.process <- %d" ctx.process)
   21.37 +
   21.38 +let get_domain ctx =
   21.39 +  ctx.domain
   21.40 +
   21.41 +let get_process ctx =
   21.42 +  ctx.process
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tools/debugger/pdb/Process.mli	Sat Jun 04 15:27:59 2005 +0000
    22.3 @@ -0,0 +1,20 @@
    22.4 +(** Process.mli
    22.5 + *
    22.6 + *  process context interface
    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 +type context_t
   22.14 +
   22.15 +val default_context : context_t
   22.16 +val new_context : int -> int -> context_t
   22.17 +
   22.18 +val set_domain : context_t -> int -> unit
   22.19 +val get_domain : context_t -> int
   22.20 +val set_process : context_t -> int -> unit
   22.21 +val get_process : context_t -> int
   22.22 +
   22.23 +val string_of_context : context_t -> string
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/debugger/pdb/Util.ml	Sat Jun 04 15:27:59 2005 +0000
    23.3 @@ -0,0 +1,153 @@
    23.4 +(** Util.ml
    23.5 + *
    23.6 + *  various utility functions
    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 +let int_of_hexchar h = 
   23.14 +  let i = int_of_char h in
   23.15 +  match h with
   23.16 +  | '0' .. '9' -> i - (int_of_char '0')
   23.17 +  | 'a' .. 'f' -> i - (int_of_char 'a') + 10
   23.18 +  | 'A' .. 'F' -> i - (int_of_char 'A') + 10
   23.19 +  | _ -> raise (Invalid_argument "unknown hex character")
   23.20 +
   23.21 +let hexchar_of_int i = 
   23.22 +  let hexchars = [| '0'; '1'; '2'; '3'; '4'; '5'; '6'; '7';
   23.23 +		    '8'; '9'; 'a'; 'b'; 'c'; 'd'; 'e'; 'f' |]
   23.24 +  in
   23.25 +  hexchars.(i)
   23.26 +
   23.27 +
   23.28 +(** flip the bytes of a four byte int 
   23.29 + *)
   23.30 +
   23.31 +let flip_int num =
   23.32 +  let a = num mod 256
   23.33 +  and b = (num / 256) mod 256
   23.34 +  and c = (num / (256 * 256)) mod 256
   23.35 +  and d = (num / (256 * 256 * 256)) in
   23.36 +  (a * 256 * 256 * 256) + (b * 256 * 256) + (c * 256) + d
   23.37 +
   23.38 +    
   23.39 +let flip_int32 num =
   23.40 +  let a = Int32.logand num 0xffl
   23.41 +  and b = Int32.logand (Int32.shift_right_logical num 8)  0xffl
   23.42 +  and c = Int32.logand (Int32.shift_right_logical num 16) 0xffl
   23.43 +  and d =              (Int32.shift_right_logical num 24)       in
   23.44 +  (Int32.logor
   23.45 +     (Int32.logor (Int32.shift_left a 24) (Int32.shift_left b 16))
   23.46 +     (Int32.logor (Int32.shift_left c 8)  d))
   23.47 +
   23.48 +
   23.49 +let int_list_of_string_list list =
   23.50 +  List.map (fun x -> int_of_string x) list
   23.51 +    
   23.52 +let int_list_of_string str len =
   23.53 +  let array_of_string s =
   23.54 +    let int_array = Array.make len 0 in
   23.55 +    for loop = 0 to len - 1 do
   23.56 +      int_array.(loop) <- (Char.code s.[loop]);
   23.57 +    done;
   23.58 +    int_array
   23.59 +  in
   23.60 +  Array.to_list (array_of_string str)
   23.61 +
   23.62 +
   23.63 +(* remove leading and trailing whitespace from a string *)
   23.64 +
   23.65 +let chomp str =
   23.66 +  let head = Str.regexp "^[ \t\r\n]+" in
   23.67 +  let tail = Str.regexp "[ \t\r\n]+$" in
   23.68 +  let str = Str.global_replace head "" str in
   23.69 +  Str.global_replace tail "" str
   23.70 +
   23.71 +(* Stupid little parser for    "<key>=<value>[,<key>=<value>]*"
   23.72 +   It first chops the entire command at each ',', so no ',' in key or value!
   23.73 +   Mucked to return a list of words for "value"
   23.74 + *)
   23.75 +
   23.76 +let list_of_string str =
   23.77 +  let delim c = Str.regexp ("[ \t]*" ^ c ^ "[ \t]*") in
   23.78 +  let str_list = Str.split (delim " ") str in
   23.79 +  List.map (fun x -> chomp(x)) str_list
   23.80 +
   23.81 +let little_parser fn str =
   23.82 +  let delim c = Str.regexp ("[ \t]*" ^ c ^ "[ \t]*") in
   23.83 +  let str_list = Str.split (delim ",") str in
   23.84 +  let pair s =
   23.85 +    match Str.split (delim "=") s with
   23.86 +    | [key;value] -> fn (chomp key) (list_of_string value)
   23.87 +    | [key] -> fn (chomp key) []
   23.88 +    | _ -> failwith (Printf.sprintf "error: (little_parser) parse error [%s]" str)
   23.89 +  in
   23.90 +  List.iter pair str_list
   23.91 +
   23.92 +(* boolean list membership test *)
   23.93 +let not_list_member the_list element =
   23.94 +  try 
   23.95 +    List.find (fun x -> x = element) the_list;
   23.96 +    false
   23.97 +  with
   23.98 +    Not_found -> true
   23.99 +
  23.100 +(* a very inefficient way to remove the elements of one list from another *)
  23.101 +let list_remove the_list remove_list =
  23.102 +  List.filter (not_list_member remove_list) the_list
  23.103 +
  23.104 +(* get a description of a file descriptor *)
  23.105 +let get_connection_info fd =
  23.106 +  let get_local_info fd =
  23.107 +    let sockname = Unix.getsockname fd in
  23.108 +    match sockname with
  23.109 +    | Unix.ADDR_UNIX(s) -> s
  23.110 +    | Unix.ADDR_INET(a,p) -> ((Unix.string_of_inet_addr a) ^ ":" ^
  23.111 +			      (string_of_int p))
  23.112 +  and get_remote_info fd =
  23.113 +    let sockname = Unix.getpeername fd in 
  23.114 +    match sockname with
  23.115 +    | Unix.ADDR_UNIX(s) -> s
  23.116 +    | Unix.ADDR_INET(a,p) -> ((Unix.string_of_inet_addr a) ^ ":" ^
  23.117 +			      (string_of_int p))
  23.118 +  in
  23.119 +  try
  23.120 +    get_remote_info fd
  23.121 +  with
  23.122 +  | Unix.Unix_error (Unix.ENOTSOCK, s1, s2) -> 
  23.123 +      let s = Unix.fstat fd in
  23.124 +      Printf.sprintf "dev: %d, inode: %d" s.Unix.st_dev s.Unix.st_ino
  23.125 +  | _ -> get_local_info fd
  23.126 +
  23.127 +
  23.128 +(* really write a string *)
  23.129 +let really_write fd str =
  23.130 +  let strlen = String.length str in
  23.131 +  let sent = ref 0 in
  23.132 +  while (!sent < strlen) do
  23.133 +    sent := !sent + (Unix.write fd str !sent (strlen - !sent))
  23.134 +  done
  23.135 +
  23.136 +let write_character fd ch =
  23.137 +  let str = String.create 1 in
  23.138 +  str.[0] <- ch;
  23.139 +  really_write fd str
  23.140 +
  23.141 +
  23.142 +
  23.143 +let send_reply fd reply =
  23.144 +  let checksum = ref 0 in
  23.145 +  write_character fd '$';
  23.146 +  for loop = 0 to (String.length reply) - 1 do
  23.147 +    write_character fd reply.[loop];
  23.148 +    checksum := !checksum + int_of_char reply.[loop]
  23.149 +  done;
  23.150 +  write_character fd '#';
  23.151 +  write_character fd (hexchar_of_int ((!checksum mod 256) / 16));
  23.152 +  write_character fd (hexchar_of_int ((!checksum mod 256) mod 16))
  23.153 +  (*
  23.154 +   * BUG NEED TO LISTEN FOR REPLY +/- AND POSSIBLY RE-TRANSMIT
  23.155 +   *)
  23.156 +
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tools/debugger/pdb/debugger.ml	Sat Jun 04 15:27:59 2005 +0000
    24.3 @@ -0,0 +1,315 @@
    24.4 +(** debugger.ml
    24.5 + *
    24.6 + *  main debug functionality
    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 +open Intel
   24.14 +open PDB
   24.15 +open Util
   24.16 +open Str
   24.17 +
   24.18 +(** a few debugger commands such as step 's' and continue 'c' do 
   24.19 + *  not immediately return a response to the debugger.  in these 
   24.20 + *  cases we raise No_reply instead. 
   24.21 + *)
   24.22 +exception No_reply
   24.23 +
   24.24 +let initialize_debugger () =
   24.25 +  ()
   24.26 +
   24.27 +let exit_debugger () =
   24.28 +  ()
   24.29 +
   24.30 +
   24.31 +(**
   24.32 +   Detach Command
   24.33 +   Note: response is ignored by gdb.  We leave the context in the
   24.34 +   hash.  It will be cleaned up with the socket is closed.
   24.35 + *)
   24.36 +let gdb_detach ctx =
   24.37 +  PDB.detach_debugger ctx;
   24.38 +  raise No_reply
   24.39 +
   24.40 +(**
   24.41 +   Kill Command
   24.42 +   Note: response is ignored by gdb.  We leave the context in the
   24.43 +   hash.  It will be cleaned up with the socket is closed.
   24.44 + *)
   24.45 +let gdb_kill () =
   24.46 +  ""
   24.47 +
   24.48 +
   24.49 +
   24.50 +(**
   24.51 +   Continue Command.
   24.52 +   resume the target
   24.53 + *)
   24.54 +let gdb_continue ctx =
   24.55 +  PDB.continue ctx;
   24.56 +  raise No_reply
   24.57 +
   24.58 +(**
   24.59 +   Step Command.
   24.60 +   single step the target
   24.61 + *)
   24.62 +let gdb_step ctx =
   24.63 +  PDB.step ctx;
   24.64 +  raise No_reply
   24.65 +
   24.66 +
   24.67 +(**
   24.68 +   Read Registers Command.
   24.69 +   returns 16 4-byte registers in a particular defined by gdb.
   24.70 + *)
   24.71 +let gdb_read_registers ctx =
   24.72 +  let regs = PDB.read_registers ctx in
   24.73 +  let str = 
   24.74 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eax)) ^
   24.75 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ecx)) ^
   24.76 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.edx)) ^
   24.77 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ebx)) ^
   24.78 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.esp)) ^
   24.79 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ebp)) ^
   24.80 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.esi)) ^
   24.81 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.edi)) ^
   24.82 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eip)) ^
   24.83 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.eflags)) ^
   24.84 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.cs)) ^
   24.85 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ss)) ^
   24.86 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.ds)) ^
   24.87 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.es)) ^
   24.88 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.fs)) ^
   24.89 +    (Printf.sprintf "%08lx" (Util.flip_int32 regs.gs)) in
   24.90 +  str
   24.91 +      
   24.92 +(**
   24.93 +   Set Thread Command
   24.94 + *)
   24.95 +let gdb_set_thread command =
   24.96 +  "OK"
   24.97 +
   24.98 +
   24.99 +(**
  24.100 +   Read Memory Packets
  24.101 + *)
  24.102 +let gdb_read_memory ctx command =
  24.103 +  let int_list_to_string i str =
  24.104 +    (Printf.sprintf "%02x" i) ^ str
  24.105 +  in
  24.106 +  let read_mem addr len =
  24.107 +    try
  24.108 +      let mem = PDB.read_memory ctx addr len  in
  24.109 +      List.fold_right int_list_to_string mem ""
  24.110 +    with
  24.111 +      Failure s -> "E02"
  24.112 +  in
  24.113 +  Scanf.sscanf command "m%lx,%d" read_mem
  24.114 +
  24.115 +
  24.116 +
  24.117 +(**
  24.118 +   Write Memory Packets
  24.119 + *)
  24.120 +let gdb_write_memory ctx command =
  24.121 +  let write_mem addr len =
  24.122 +    print_endline (Printf.sprintf "  gdb_write_memory %lx %x\n" addr len);
  24.123 +    print_endline (Printf.sprintf "  [[ unimplemented ]]\n")
  24.124 +  in
  24.125 +  Scanf.sscanf command "M%lx,%d" write_mem;
  24.126 +  "OK"
  24.127 +
  24.128 +
  24.129 +
  24.130 +(**
  24.131 +   Write Register Packets
  24.132 + *)
  24.133 +let gdb_write_register ctx command =
  24.134 +  let write_reg reg goofy_val =
  24.135 +    let new_val = Util.flip_int32 goofy_val in
  24.136 +    match reg with
  24.137 +    |  0 -> PDB.write_register ctx EAX new_val
  24.138 +    |  1 -> PDB.write_register ctx ECX new_val
  24.139 +    |  2 -> PDB.write_register ctx EDX new_val
  24.140 +    |  3 -> PDB.write_register ctx EBX new_val
  24.141 +    |  4 -> PDB.write_register ctx ESP new_val
  24.142 +    |  5 -> PDB.write_register ctx EBP new_val
  24.143 +    |  6 -> PDB.write_register ctx ESI new_val
  24.144 +    |  7 -> PDB.write_register ctx EDI new_val
  24.145 +    |  8 -> PDB.write_register ctx EIP new_val
  24.146 +    |  9 -> PDB.write_register ctx EFLAGS new_val
  24.147 +    | 10 -> PDB.write_register ctx CS new_val
  24.148 +    | 11 -> PDB.write_register ctx SS new_val
  24.149 +    | 12 -> PDB.write_register ctx DS new_val
  24.150 +    | 13 -> PDB.write_register ctx ES new_val
  24.151 +    | 14 -> PDB.write_register ctx FS new_val
  24.152 +    | 15 -> PDB.write_register ctx GS new_val
  24.153 +    | _  -> print_endline (Printf.sprintf "write unknown register [%d]" reg)
  24.154 +  in
  24.155 +  Scanf.sscanf command "P%x=%lx" write_reg;
  24.156 +  "OK"
  24.157 +
  24.158 +
  24.159 +(**
  24.160 +   General Query Packets
  24.161 + *)
  24.162 +let gdb_query command =
  24.163 +  match command with
  24.164 +  | "qC" -> ""
  24.165 +  | "qOffsets" -> ""
  24.166 +  | "qSymbol::" -> ""
  24.167 +  | _ -> 
  24.168 +      print_endline (Printf.sprintf "unknown gdb query packet [%s]" command);
  24.169 +      "E01"
  24.170 +
  24.171 +
  24.172 +(**
  24.173 +   Write Memory Binary Packets
  24.174 + *)
  24.175 +let gdb_write_memory_binary ctx command =
  24.176 +  let write_mem addr len =
  24.177 +    let pos = Str.search_forward (Str.regexp ":") command 0 in
  24.178 +    let txt = Str.string_after command (pos + 1) in
  24.179 +    PDB.write_memory ctx addr (int_list_of_string txt len)
  24.180 +  in
  24.181 +  Scanf.sscanf command "X%lx,%d" write_mem;
  24.182 +  "OK"
  24.183 +
  24.184 +
  24.185 +
  24.186 +(**
  24.187 +   Last Signal Command
  24.188 + *)
  24.189 +let gdb_last_signal =
  24.190 +  "S00"
  24.191 +
  24.192 +
  24.193 +
  24.194 +
  24.195 +(**
  24.196 +   Process PDB extensions to the GDB serial protocol.
  24.197 +   Changes the mutable context state.
  24.198 + *)
  24.199 +let pdb_extensions command sock =
  24.200 +  let process_extension key value =
  24.201 +    (* since this command can change the context, we need to grab it each time *)
  24.202 +    let ctx = PDB.find_context sock in
  24.203 +    match key with
  24.204 +    | "status" ->
  24.205 +	print_endline (string_of_context ctx);
  24.206 +	PDB.debug_contexts ();
  24.207 +	debugger_status ()
  24.208 +    | "context" ->
  24.209 +        PDB.add_context sock (List.hd value) 
  24.210 +                             (int_list_of_string_list (List.tl value))
  24.211 +    | _ -> failwith (Printf.sprintf "unknown pdb extension command [%s:%s]" 
  24.212 +		                    key (List.hd value))
  24.213 +  in
  24.214 +  try
  24.215 +    Util.little_parser process_extension 
  24.216 +                       (String.sub command 1 ((String.length command) - 1));
  24.217 +    "OK"
  24.218 +  with
  24.219 +  | Unknown_context s -> 
  24.220 +      print_endline (Printf.sprintf "unknown context [%s]" s);
  24.221 +      "E01"
  24.222 +  | Failure s -> "E01"
  24.223 +
  24.224 +
  24.225 +(**
  24.226 +   Insert Breakpoint or Watchpoint Packet
  24.227 + *)
  24.228 +let gdb_insert_bwcpoint ctx command =
  24.229 +  let insert cmd addr length =
  24.230 +    try
  24.231 +      match cmd with
  24.232 +      | 0 -> PDB.insert_memory_breakpoint ctx addr length; "OK"
  24.233 +      | _ -> ""
  24.234 +    with
  24.235 +      Failure s -> "E03"
  24.236 +  in
  24.237 +  Scanf.sscanf command "Z%d,%lx,%d" insert
  24.238 +
  24.239 +(**
  24.240 +   Remove Breakpoint or Watchpoint Packet
  24.241 + *)
  24.242 +let gdb_remove_bwcpoint ctx command =
  24.243 +  let insert cmd addr length =
  24.244 +    try
  24.245 +      match cmd with
  24.246 +      | 0 -> PDB.remove_memory_breakpoint ctx addr length; "OK"
  24.247 +      | _ -> ""
  24.248 +    with
  24.249 +      Failure s -> "E04"
  24.250 +  in
  24.251 +  Scanf.sscanf command "z%d,%lx,%d" insert
  24.252 +
  24.253 +(**
  24.254 +   Do Work!
  24.255 +
  24.256 +   @param command  char list
  24.257 + *)
  24.258 +
  24.259 +let process_command command sock =
  24.260 +  let ctx = PDB.find_context sock in
  24.261 +  try
  24.262 +    match command.[0] with
  24.263 +    | 'c' -> gdb_continue ctx
  24.264 +    | 'D' -> gdb_detach ctx
  24.265 +    | 'g' -> gdb_read_registers ctx
  24.266 +    | 'H' -> gdb_set_thread command
  24.267 +    | 'k' -> gdb_kill ()
  24.268 +    | 'm' -> gdb_read_memory ctx command
  24.269 +    | 'M' -> gdb_write_memory ctx command
  24.270 +    | 'P' -> gdb_write_register ctx command
  24.271 +    | 'q' -> gdb_query command
  24.272 +    | 's' -> gdb_step ctx
  24.273 +    | 'x' -> pdb_extensions command sock
  24.274 +    | 'X' -> gdb_write_memory_binary ctx command
  24.275 +    | '?' -> gdb_last_signal
  24.276 +    | 'z' -> gdb_remove_bwcpoint ctx command
  24.277 +    | 'Z' -> gdb_insert_bwcpoint ctx command
  24.278 +    | _ -> 
  24.279 +	print_endline (Printf.sprintf "unknown gdb command [%s]" command);
  24.280 +	""
  24.281 +  with
  24.282 +    Unimplemented s ->
  24.283 +      print_endline (Printf.sprintf "loser. unimplemented command [%s][%s]" 
  24.284 +		                    command s);
  24.285 +      ""
  24.286 +
  24.287 +
  24.288 +(**
  24.289 +   process_evtchn  
  24.290 +
  24.291 +   This is called each time a virq_pdb is sent from xen to dom 0.
  24.292 +   It is sent by Xen when a domain hits a breakpoint. 
  24.293 +
  24.294 +   Think of this as the continuation function for a "c" or "s" command.
  24.295 +*)
  24.296 +
  24.297 +external query_domain_stop : unit -> (int * int) list = "query_domain_stop"
  24.298 +(* returns a list of paused domains : () -> (domain, vcpu) list *)
  24.299 +
  24.300 +let process_evtchn fd =
  24.301 +  let channel = Evtchn.read fd in
  24.302 +  let find_pair (dom, vcpu) =
  24.303 +    print_endline (Printf.sprintf "checking %d.%d" dom vcpu);
  24.304 +    try
  24.305 +      let sock = PDB.find_domain dom vcpu in
  24.306 +      true
  24.307 +    with
  24.308 +      Unknown_domain -> false
  24.309 +  in
  24.310 +  let dom_list = query_domain_stop () in
  24.311 +  let (dom, vcpu) = List.find find_pair dom_list in
  24.312 +  let vec = 3 in
  24.313 +  let sock = PDB.find_domain dom vcpu in
  24.314 +  print_endline (Printf.sprintf "handle bkpt d:%d ed:%d v:%d  %s" 
  24.315 +		   dom vcpu vec (Util.get_connection_info sock));
  24.316 +  Util.send_reply sock "S05";
  24.317 +  Evtchn.unmask fd channel                                (* allow next virq *)
  24.318 +  
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tools/debugger/pdb/evtchn.ml	Sat Jun 04 15:27:59 2005 +0000
    25.3 @@ -0,0 +1,32 @@
    25.4 +(** evtchn.ml
    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 +let dev_name = "/dev/xen/evtchn"                          (* EVTCHN_DEV_NAME *)
   25.14 +let dev_major = 10                                       (* EVTCHN_DEV_MAJOR *)
   25.15 +let dev_minor = 201                                      (* EVTCHN_DEV_MINOR *)
   25.16 +
   25.17 +let virq_pdb = 6                                      (* as defined VIRQ_PDB *)
   25.18 +
   25.19 +external bind_virq : int -> int = "evtchn_bind_virq"
   25.20 +external bind : Unix.file_descr -> int -> unit = "evtchn_bind"
   25.21 +external unbind : Unix.file_descr -> int -> unit = "evtchn_unbind"
   25.22 +external ec_open : string -> int -> int -> Unix.file_descr = "evtchn_open"
   25.23 +external read : Unix.file_descr -> int = "evtchn_read"
   25.24 +external ec_close : Unix.file_descr -> unit = "evtchn_close"
   25.25 +external unmask : Unix.file_descr -> int -> unit = "evtchn_unmask"
   25.26 +
   25.27 +let setup () =
   25.28 +  let port = bind_virq virq_pdb in
   25.29 +  let fd = ec_open dev_name dev_major dev_minor in
   25.30 +  bind fd port;
   25.31 +  fd
   25.32 +
   25.33 +let teardown fd =
   25.34 +  unbind fd virq_pdb;
   25.35 +  ec_close fd
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/tools/debugger/pdb/evtchn.mli	Sat Jun 04 15:27:59 2005 +0000
    26.3 @@ -0,0 +1,14 @@
    26.4 +(** evtchn.mli
    26.5 + *
    26.6 + *  event channel interface
    26.7 + *
    26.8 + *  @author copyright (c) 2005 alex ho
    26.9 + *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
   26.10 + *  @version 1
   26.11 + *)
   26.12 +
   26.13 +
   26.14 +val setup : unit -> Unix.file_descr
   26.15 +val read : Unix.file_descr -> int
   26.16 +val teardown : Unix.file_descr -> unit
   26.17 +val unmask : Unix.file_descr -> int -> unit
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/tools/debugger/pdb/pdb_caml_xc.c	Sat Jun 04 15:27:59 2005 +0000
    27.3 @@ -0,0 +1,732 @@
    27.4 +/*
    27.5 + * pdb_caml_xc.c
    27.6 + *
    27.7 + * http://www.cl.cam.ac.uk/netos/pdb
    27.8 + *
    27.9 + * OCaml to libxc interface library for PDB
   27.10 + */
   27.11 +
   27.12 +#include <xc.h>
   27.13 +#include <xendebug.h>
   27.14 +#include <errno.h>
   27.15 +#include <stdio.h>
   27.16 +#include <stdlib.h>
   27.17 +#include <string.h>
   27.18 +#include <sys/mman.h>
   27.19 +#include <caml/alloc.h>
   27.20 +#include <caml/fail.h>
   27.21 +#include <caml/memory.h>
   27.22 +#include <caml/mlvalues.h>
   27.23 +
   27.24 +int pdb_evtchn_bind_virq (int xc_handle, int virq, int *port);
   27.25 +int xen_evtchn_bind (int evtchn_fd, int idx);
   27.26 +int xen_evtchn_unbind (int evtchn_fd, int idx);
   27.27 +
   27.28 +/* this order comes from xen/include/public/arch-x86_32.h */
   27.29 +enum x86_registers { PDB_EBX, PDB_ECX, PDB_EDX, PDB_ESI, PDB_EDI,
   27.30 +                     PDB_EBP, PDB_EAX, PDB_Error_code, PDB_Entry_vector, 
   27.31 +                     PDB_EIP, PDB_CS, PDB_EFLAGS, PDB_ESP, PDB_SS,
   27.32 +                     PDB_ES, PDB_DS, PDB_FS, PDB_GS };
   27.33 +
   27.34 +static void dump_regs (cpu_user_regs_t *ctx);
   27.35 +
   27.36 +static int xc_handle = -1;
   27.37 +
   27.38 +typedef struct
   27.39 +{
   27.40 +    int domain;
   27.41 +    int vcpu;
   27.42 +} context_t;
   27.43 +
   27.44 +#define decode_context(_ctx, _ocaml)   \
   27.45 +{  \
   27.46 +    (_ctx)->domain = Int_val(Field((_ocaml),0));  \
   27.47 +    (_ctx)->vcpu = Int_val(Field((_ocaml),1));  \
   27.48 +}
   27.49 +
   27.50 +#define encode_context(_ctx, _ocaml)  \
   27.51 +{  \
   27.52 +    (_ocaml) = caml_alloc_tuple(2);  \
   27.53 +    Store_field((_ocaml), 0, Val_int((_ctx)->domain));  \
   27.54 +    Store_field((_ocaml), 1, Val_int((_ctx)->vcpu));  \
   27.55 +}
   27.56 +
   27.57 +
   27.58 +/****************************************************************************/
   27.59 +
   27.60 +/*
   27.61 + * open_context : unit -> unit
   27.62 + */
   27.63 +value
   27.64 +open_context (value unit)
   27.65 +{
   27.66 +    CAMLparam1(unit);
   27.67 +
   27.68 +    xc_handle = xc_interface_open();
   27.69 +
   27.70 +    if ( xc_handle < 0 )
   27.71 +    {
   27.72 +        fprintf(stderr, "(pdb) error opening xc interface: %d (%s)\n",
   27.73 +                errno, strerror(errno));
   27.74 +    }
   27.75 +
   27.76 +    CAMLreturn(Val_unit);
   27.77 +}
   27.78 +
   27.79 +/*
   27.80 + * close_context : unit -> unit
   27.81 + */
   27.82 +value
   27.83 +close_context (value unit)
   27.84 +{
   27.85 +    CAMLparam1(unit);
   27.86 +    int rc;
   27.87 +    
   27.88 +    if ( (rc = xc_interface_close(xc_handle)) < 0 )
   27.89 +    {
   27.90 +        fprintf(stderr, "(pdb) error closing xc interface: %d (%s)\n",
   27.91 +                errno, strerror(errno));
   27.92 +    }
   27.93 +
   27.94 +    CAMLreturn(Val_unit);
   27.95 +}
   27.96 +
   27.97 +/*
   27.98 + * read_registers : context_t -> int32
   27.99 + */
  27.100 +value
  27.101 +read_registers (value context)
  27.102 +{
  27.103 +    CAMLparam1(context);
  27.104 +    CAMLlocal1(result);
  27.105 +
  27.106 +    cpu_user_regs_t *regs;
  27.107 +    context_t ctx;
  27.108 +
  27.109 +    decode_context(&ctx, context);
  27.110 +
  27.111 +    if ( xendebug_read_registers(xc_handle, ctx.domain, ctx.vcpu, &regs) )
  27.112 +    {
  27.113 +        printf("(pdb) read registers error!\n");  fflush(stdout);
  27.114 +        failwith("read registers error");
  27.115 +    }
  27.116 +
  27.117 +    dump_regs(regs);
  27.118 +
  27.119 +    result = caml_alloc_tuple(18);                                  /* FIXME */
  27.120 +
  27.121 +    Store_field(result,  0, caml_copy_int32(regs->ebx));
  27.122 +    Store_field(result,  1, caml_copy_int32(regs->ecx));
  27.123 +    Store_field(result,  2, caml_copy_int32(regs->edx));
  27.124 +    Store_field(result,  3, caml_copy_int32(regs->esi));
  27.125 +    Store_field(result,  4, caml_copy_int32(regs->edi));
  27.126 +    Store_field(result,  5, caml_copy_int32(regs->ebp));
  27.127 +    Store_field(result,  6, caml_copy_int32(regs->eax));
  27.128 +    Store_field(result,  7, caml_copy_int32(regs->error_code));        /* 16 */
  27.129 +    Store_field(result,  8, caml_copy_int32(regs->entry_vector));      /* 16 */
  27.130 +    Store_field(result,  9, caml_copy_int32(regs->eip));
  27.131 +    Store_field(result, 10, caml_copy_int32(regs->cs));                /* 16 */
  27.132 +    Store_field(result, 11, caml_copy_int32(regs->eflags));
  27.133 +    Store_field(result, 12, caml_copy_int32(regs->esp));
  27.134 +    Store_field(result, 13, caml_copy_int32(regs->ss));                /* 16 */
  27.135 +    Store_field(result, 14, caml_copy_int32(regs->es));                /* 16 */
  27.136 +    Store_field(result, 15, caml_copy_int32(regs->ds));                /* 16 */
  27.137 +    Store_field(result, 16, caml_copy_int32(regs->fs));                /* 16 */
  27.138 +    Store_field(result, 17, caml_copy_int32(regs->gs));                /* 16 */
  27.139 +
  27.140 +    CAMLreturn(result);
  27.141 +}
  27.142 +
  27.143 +
  27.144 +/*
  27.145 + * write_register : context_t -> register -> int32 -> unit
  27.146 + */
  27.147 +value
  27.148 +write_register (value context, value reg, value newval)
  27.149 +{
  27.150 +    CAMLparam3(context, reg, newval);
  27.151 +
  27.152 +    int my_reg = Int_val(reg);
  27.153 +    int val = Int32_val(newval);
  27.154 +
  27.155 +    context_t ctx;
  27.156 +    cpu_user_regs_t *regs;
  27.157 +
  27.158 +    printf("(pdb) write register\n");
  27.159 +
  27.160 +    decode_context(&ctx, context);
  27.161 +
  27.162 +    if ( xendebug_read_registers(xc_handle, ctx.domain, ctx.vcpu, &regs) )
  27.163 +    {
  27.164 +        printf("(pdb) write register (get) error!\n");  fflush(stdout);
  27.165 +        failwith("write register error");
  27.166 +    }
  27.167 +
  27.168 +    switch (my_reg)
  27.169 +    {
  27.170 +    case PDB_EBX: regs->ebx = val; break;
  27.171 +    case PDB_ECX: regs->ecx = val; break;
  27.172 +    case PDB_EDX: regs->edx = val; break;
  27.173 +    case PDB_ESI: regs->esi = val; break;