Dynamic classloader implemented (buggy).
Thread.sleep implemented.
## Process this file with automake to produce Makefile.in
-# $Id: Makefile.am 135 1999-10-04 10:35:09Z roman $
+# $Id: Makefile.am 136 1999-11-09 11:33:46Z schani $
MAINTAINERCLEANFILES = Makefile.in configure
SUBDIRS = toolbox mm alpha jit comp nat threads mips tst doc narray
java.lang.ClassLoader \
java.lang.Class \
java.lang.Compiler \
+ java.lang.Integer \
java.lang.Double \
java.lang.Float \
java.lang.Math \
java.math.BigInteger \
java.net.InetAddress \
java.net.InetAddressImpl \
+ java.net.DatagramPacket \
+ java.net.PlainDatagramSocketImpl \
+ java.net.SocketImpl \
+ java.net.PlainSocketImpl \
+ java.net.SocketInputStream \
+ java.net.SocketOutputStream \
java.security.PrivilegedActionException \
java.security.PrivilegedAction \
java.security.PrivilegedExceptionAction \
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# $Id: Makefile.in 135 1999-10-04 10:35:09Z roman $
+# $Id: Makefile.in 136 1999-11-09 11:33:46Z schani $
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
EXTRA_DIST = html/cacaoinstall.html html/cacaoman.html html/index.html
-CLEANFILES = @SYSDEP_DIR@/asmpart.o \
- @SYSDEP_DIR@/asmpart.s \
- @SYSDEP_DIR@/offsets.h \
- nativetable.hh \
- nativetypes.hh
+CLEANFILES = @SYSDEP_DIR@/asmpart.o @SYSDEP_DIR@/asmpart.s @SYSDEP_DIR@/offsets.h nativetable.hh nativetypes.hh
+
bin_PROGRAMS = cacao
noinst_PROGRAMS = cacaoh
-INCLUDES=-I/usr/include -I$(top_srcdir)/@SYSDEP_DIR@ -I$(top_srcdir)/jit -I@SYSDEP_DIR@ -I$(top_srcdir)
-
-cacao_SOURCES = \
- asmpart.h \
- builtin.c \
- builtin.h \
- callargs.h \
- @COMPILER_SOURCES@ \
- global.h \
- jit.c \
- jit.h \
- loader.c \
- loader.h \
- main.c \
- native.c \
- native.h \
- tables.c \
- tables.h
-
-EXTRA_cacao_SOURCES = \
- compiler.c \
- compiler.h
-
-cacao_LDADD = \
- @SYSDEP_DIR@/asmpart.o \
- @COMPILER_OBJECTS@ \
- toolbox/libtoolbox.a \
- @GC_OBJ@ \
- @THREAD_OBJ@
-
-cacao_DEPENDENCIES = \
- @SYSDEP_DIR@/asmpart.o \
- @COMPILER_OBJECTS@ \
- toolbox/libtoolbox.a \
- @GC_OBJ@ \
- @THREAD_OBJ@
+INCLUDES = -I/usr/include -I$(top_srcdir)/@SYSDEP_DIR@ -I$(top_srcdir)/jit -I@SYSDEP_DIR@ -I$(top_srcdir)
+
+cacao_SOURCES = asmpart.h builtin.c builtin.h callargs.h @COMPILER_SOURCES@ global.h jit.c jit.h loader.c loader.h main.c native.c native.h tables.c tables.h
+
+
+EXTRA_cacao_SOURCES = compiler.c compiler.h
+
+
+cacao_LDADD = @SYSDEP_DIR@/asmpart.o @COMPILER_OBJECTS@ toolbox/libtoolbox.a @GC_OBJ@ @THREAD_OBJ@
+
+
+cacao_DEPENDENCIES = @SYSDEP_DIR@/asmpart.o @COMPILER_OBJECTS@ toolbox/libtoolbox.a @GC_OBJ@ @THREAD_OBJ@
+
cacaoh_SOURCES = headers.c tables.c loader.c builtin.c
cacaoh_LDADD = toolbox/libtoolbox.a @GC_OBJ@ @THREAD_OBJ@
cacaoh_OBJECTS = headers.o tables.o loader.o builtin.o
cacaoh_LDFLAGS =
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS acconfig.h aclocal.m4 config.guess config.h.in \
-config.sub configure configure.in install-sh missing mkinstalldirs \
-stamp-h.in
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
+Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.guess \
+config.h.in config.sub configure configure.in install-sh missing \
+mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
+TAR = gtar
+GZIP_ENV = --best
DEP_FILES = .deps/builtin.P .deps/compiler.P .deps/headers.P \
.deps/jit.P .deps/loader.P .deps/main.P .deps/native.P .deps/tables.P
SOURCES = $(cacao_SOURCES) $(EXTRA_cacao_SOURCES) $(cacaoh_SOURCES)
OBJECTS = $(cacao_OBJECTS) $(cacaoh_OBJECTS)
-all: all-recursive-am all-am
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL)
-config.status: $(srcdir)/configure
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
- @:
+ @if test ! -f $@; then \
+ rm -f stamp-h; \
+ $(MAKE) stamp-h; \
+ else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
- @echo timestamp > stamp-h
+ @echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+ @if test ! -f $@; then \
+ rm -f $(srcdir)/stamp-h.in; \
+ $(MAKE) $(srcdir)/stamp-h.in; \
+ else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in
+ @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ echo " $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
mostlyclean-noinstPROGRAMS:
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
- done && test -z "$$fail"
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
- target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
- (cd $$subdir && $(MAKE) $$target) \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) tags); \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
# tarfile.
distcheck: dist
-rm -rf $(distdir)
- GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
- && $(MAKE) \
- && $(MAKE) dvi \
- && $(MAKE) check \
- && $(MAKE) install \
- && $(MAKE) installcheck \
- && $(MAKE) dist
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
- @echo "========================"; \
- echo "$(distdir).tar.gz is ready for distribution"; \
- echo "========================"
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
- GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
$(mkinstalldirs) $(distdir)/html
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
for subdir in $(SUBDIRS); do \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
|| exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
clean-depend:
distclean-depend:
+ -rm -rf .deps
maintainer-clean-depend:
- -rm -rf .deps
%.o: %.c
@echo '$(COMPILE) -c $<'; \
- $(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
- $(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
- @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
- < .deps/$(*F).p > .deps/$(*F).P
- @-rm -f .deps/$(*F).p
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
info: info-recursive
+dvi-am:
dvi: dvi-recursive
-check: all-am
- $(MAKE) check-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
installcheck: installcheck-recursive
all-recursive-am: config.h
- $(MAKE) all-recursive
-
-all-am: Makefile $(PROGRAMS) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am: install-binPROGRAMS
+install-exec: install-exec-recursive
-uninstall-am: uninstall-binPROGRAMS
-
-install-exec: install-exec-recursive install-exec-am
- @$(NORMAL_INSTALL)
-
+install-data-am:
install-data: install-data-recursive
- @$(NORMAL_INSTALL)
-
-install: install-recursive install-exec-am
- @:
-
-uninstall: uninstall-recursive uninstall-am
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS) config.h
+all-redirect: all-recursive-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs: installdirs-recursive
- $(mkinstalldirs) $(DATADIR)$(bindir)
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
+mostlyclean: mostlyclean-recursive
+
clean-am: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS \
clean-compile clean-tags clean-depend clean-generic \
mostlyclean-am
+clean: clean-recursive
+
distclean-am: distclean-hdr distclean-binPROGRAMS \
distclean-noinstPROGRAMS distclean-compile \
distclean-tags distclean-depend distclean-generic \
clean-am
+distclean: distclean-recursive
+ -rm -f config.status
+
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
-
-mostlyclean: mostlyclean-recursive mostlyclean-am
-
-clean: clean-recursive clean-am
-
-distclean: distclean-recursive distclean-am
- -rm -f config.status
-
-maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir \
mostlyclean-depend distclean-depend clean-depend \
-maintainer-clean-depend info dvi installcheck all-recursive-am all-am \
-install-exec-am uninstall-am install-exec install-data install \
-uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck all-recursive-am install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
native.c: nativetypes.hh @SYSDEP_DIR@/offsets.h nativetable.hh
java.lang.ClassLoader \
java.lang.Class \
java.lang.Compiler \
+ java.lang.Integer \
java.lang.Double \
java.lang.Float \
java.lang.Math \
java.math.BigInteger \
java.net.InetAddress \
java.net.InetAddressImpl \
+ java.net.DatagramPacket \
+ java.net.PlainDatagramSocketImpl \
+ java.net.SocketImpl \
+ java.net.PlainSocketImpl \
+ java.net.SocketInputStream \
+ java.net.SocketOutputStream \
java.security.PrivilegedActionException \
java.security.PrivilegedAction \
java.security.PrivilegedExceptionAction \
-dnl aclocal.m4 generated automatically by aclocal 1.3
+dnl aclocal.m4 generated automatically by aclocal 1.4a
-dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
-dnl This Makefile.in is free software; the Free Software Foundation
+dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AM_PROG_INSTALL])
+[AC_REQUIRE([AC_PROG_INSTALL])
+dnl We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
-
-# serial 1
-
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_REQUIRE([AC_PROG_INSTALL])
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
-
#
# Check to make sure that the build environment is sane.
#
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
THREAD_OBJ = @THREAD_OBJ@
VERSION = @VERSION@
-EXTRA_DIST = asmpart.c disass.c cray.c gen.c ngen.c \
- defines.h native-math.h ngen.h sigcontext.h \
- types.h threads.h
+EXTRA_DIST = asmpart.c disass.c cray.c gen.c ngen.c defines.h native-math.h ngen.h sigcontext.h types.h threads.h
+
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu alpha/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu alpha/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
-clean: clean-generic mostlyclean
+clean: clean-am
-distclean: distclean-generic clean
- -rm -f config.status
+distclean-am: distclean-generic clean-am
-maintainer-clean: maintainer-clean-generic distclean
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
Authors: Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
Reinhard Grafl EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: ngen.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: ngen.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
M_CMPULT(REG_ZERO, REG_ITMP1, d); /* REG_ITMP1 != 0 */
}
else { /* class */
+/*
s2 = super->vftbl->diffval;
M_BEQZ(s1, 4 + (s2 > 255));
M_ALD(REG_ITMP1, s1, OFFSET(java_objectheader, vftbl));
M_LDA(REG_ITMP2, REG_ZERO, s2);
M_CMPULE(REG_ITMP1, REG_ITMP2, d);
}
+*/
+ M_BEQZ(s1, 7);
+ M_ALD(REG_ITMP1, s1, OFFSET(java_objectheader, vftbl));
+ a = dseg_addaddress ((void*) super->vftbl);
+ M_ALD(REG_ITMP2, REG_PV, a);
+ M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl, baseval));
+ M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl, baseval));
+ M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl, diffval));
+ M_ISUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
+ M_CMPULE(REG_ITMP1, REG_ITMP2, d);
}
}
else
mcode_addxcastrefs(mcodeptr);
}
else { /* class */
+/*
s2 = super->vftbl->diffval;
M_BEQZ(s1, 4 + (s2 != 0) + (s2 > 255));
M_ALD(REG_ITMP1, s1, OFFSET(java_objectheader, vftbl));
M_CMPULE(REG_ITMP1, REG_ITMP2, REG_ITMP2);
M_BEQZ(REG_ITMP2, 0);
}
+*/
+ M_BEQZ(s1, 8 + (d == REG_ITMP3));
+ M_ALD(REG_ITMP1, s1, OFFSET(java_objectheader, vftbl));
+ a = dseg_addaddress ((void*) super->vftbl);
+ M_ALD(REG_ITMP2, REG_PV, a);
+ M_ILD(REG_ITMP1, REG_ITMP1, OFFSET(vftbl, baseval));
+ if (d != REG_ITMP3) {
+ M_ILD(REG_ITMP3, REG_ITMP2, OFFSET(vftbl, baseval));
+ M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl, diffval));
+ M_ISUB(REG_ITMP1, REG_ITMP3, REG_ITMP1);
+ }
+ else {
+ M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl, baseval));
+ M_ISUB(REG_ITMP1, REG_ITMP2, REG_ITMP1);
+ M_ALD(REG_ITMP2, REG_PV, a);
+ M_ILD(REG_ITMP2, REG_ITMP2, OFFSET(vftbl, diffval));
+ }
+ M_CMPULE(REG_ITMP1, REG_ITMP2, REG_ITMP2);
+ M_BEQZ(REG_ITMP2, 0);
mcode_addxcastrefs(mcodeptr);
}
}
return (sub->vftbl->interfacetablelength > super->index) &&
(sub->vftbl->interfacetable[-super->index] != NULL);
+ /*
while (sub != 0)
if (sub == super)
return 1;
else
sub = sub->super;
-
+
return 0;
+ */
- /*
return (unsigned) (sub->vftbl->baseval - super->vftbl->baseval) <=
(unsigned) (super->vftbl->diffval);
- */
}
s4 builtin_checkcast(java_objectheader *obj, classinfo *class)
{
- #ifdef DEBUG
+#ifdef DEBUG
log_text ("builtin_checkcast called");
- #endif
+#endif
if (obj == NULL)
return 1;
if (builtin_isanysubclass (obj->vftbl->class, class))
return 1;
- #if DEBUG
+ /* #if DEBUG */
printf ("#### checkcast failed ");
utf_display (obj->vftbl->class->name);
printf (" -> ");
utf_display (class->name);
printf ("\n");
- #endif
+ /* #endif */
return 0;
}
if (!o) return 1;
if (o->vftbl->class != class_array) {
+#ifdef DEBUG
+ printf ("#### checkarraycast failed 1\n");
+#endif
return 0;
}
if (a->arraytype != desc->arraytype) {
+#ifdef DEBUG
+ printf ("#### checkarraycast failed 2\n");
+#endif
return 0;
}
switch (a->arraytype) {
case ARRAYTYPE_OBJECT: {
java_objectarray *oa = (java_objectarray*) o;
- return builtin_isanysubclass (oa->elementtype, desc->objectclass);
+ int result = builtin_isanysubclass (oa->elementtype, desc->objectclass);
+
+#ifdef DEBUG
+ if (!result)
+ printf ("#### checkarraycast failed 3\n");
+#endif
+ return result;
}
case ARRAYTYPE_ARRAY: {
java_arrayarray *aa = (java_arrayarray*) o;
- return builtin_descriptorscompatible
- (aa->elementdescriptor, desc->elementdescriptor);
+ int result = builtin_descriptorscompatible
+ (aa->elementdescriptor, desc->elementdescriptor);
+
+#ifdef DEBUG
+ if (!result)
+ printf ("#### checkarraycast failed 4\n");
+#endif
+ return result;
}
default:
return 1;
{
java_objectheader *o;
+ class_init(c);
+
#ifdef SIZE_FROM_CLASSINFO
c->alignedsize = align_size(c->instancesize);
o = heap_allocate ( c->alignedsize, true, c->finalizer );
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
THREAD_OBJ = @THREAD_OBJ@
VERSION = @VERSION@
-EXTRA_DIST = block.c local.c parse.c reg.c stack.c var.c \
- defines.c mcode.c pcmd.c regalloc.c tools.c
+EXTRA_DIST = block.c local.c parse.c reg.c stack.c var.c defines.c mcode.c pcmd.c regalloc.c tools.c
+
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu comp/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu comp/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
-clean: clean-generic mostlyclean
+clean: clean-am
-distclean: distclean-generic clean
- -rm -f config.status
+distclean-am: distclean-generic clean-am
-maintainer-clean: maintainer-clean-generic distclean
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
#undef EXTERNAL_OVERFLOW
#undef DONT_FREE_FIRST
-/* Make automake happy */
-#undef PACKAGE
-#undef VERSION
-
/* sysdep */
#undef SYSDEP_DIR
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.12
+# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.12"
+ echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
+ac_exeext=
+ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
# Make sure we can run config.sub.
-if $ac_config_sub sun4 >/dev/null 2>&1; then :
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:553: checking host system type" >&5
+echo "configure:556: checking host system type" >&5
host_alias=$host
case "$host_alias" in
NONE)
case $nonopt in
NONE)
- if host_alias=`$ac_config_guess`; then :
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
fi ;;
*) host_alias=$nonopt ;;
esac ;;
esac
-host=`$ac_config_sub $host_alias`
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:585: checking for a BSD compatible install" >&5
+echo "configure:589: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
- IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
if test -f $ac_dir/$ac_prog; then
if test $ac_prog = install &&
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
:
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:638: checking whether build environment is sane" >&5
+echo "configure:642: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:695: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:699: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
fi
+
PACKAGE=cacao
VERSION=0.40
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:741: checking for working aclocal" >&5
+echo "configure:746: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:754: checking for working autoconf" >&5
+echo "configure:759: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:767: checking for working automake" >&5
+echo "configure:772: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:780: checking for working autoheader" >&5
+echo "configure:785: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:793: checking for working makeinfo" >&5
+echo "configure:798: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:850: checking for $ac_word" >&5
+echo "configure:855: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:879: checking for $ac_word" >&5
+echo "configure:885: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_prog_rejected=no
- for ac_dir in $PATH; do
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
echo "$ac_t""no" 1>&6
fi
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:936: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:968: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
-ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
-cat > conftest.$ac_ext <<EOF
-#line 937 "configure"
+cat > conftest.$ac_ext << EOF
+
+#line 979 "configure"
#include "confdefs.h"
+
main(){return(0);}
EOF
-if { (eval echo configure:941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:961: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1010: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:966: checking whether we are using GNU C" >&5
+echo "configure:1015: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
if test $ac_cv_prog_gcc = yes; then
GCC=yes
- ac_test_CFLAGS="${CFLAGS+set}"
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS=
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:990: checking whether ${CC-cc} accepts -g" >&5
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1043: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
- if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
- elif test $ac_cv_prog_cc_g = yes; then
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
- CFLAGS="-O2"
+ CFLAGS="-g"
fi
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
fi
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1020: checking for $ac_word" >&5
+echo "configure:1077: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_RANLIB="ranlib"
echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:1048: checking for sin in -lm" >&5
+echo "configure:1106: checking for sin in -lm" >&5
ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1056 "configure"
+#line 1114 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
sin()
; return 0; }
EOF
-if { (eval echo configure:1067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1100: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1158: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1105 "configure"
+#line 1163 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1171: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1138: checking for opendir in -ldir" >&5
+echo "configure:1196: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1146 "configure"
+#line 1204 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1179: checking for opendir in -lx" >&5
+echo "configure:1237: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1187 "configure"
+#line 1245 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1221: checking how to run the C preprocessor" >&5
+echo "configure:1279: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1236 "configure"
+#line 1294 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1311 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1328 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
else
fi
rm -f conftest*
fi
+rm -f conftest*
+fi
rm -f conftest*
ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1282: checking for ANSI C header files" >&5
+echo "configure:1359: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1287 "configure"
+#line 1364 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_cv_header_stdc=yes
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1312 "configure"
+#line 1389 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1330 "configure"
+#line 1407 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1351 "configure"
+#line 1428 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1389: checking for $ac_hdr" >&5
+echo "configure:1466: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1394 "configure"
+#line 1471 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1399: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1427: checking for working const" >&5
+echo "configure:1504: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1432 "configure"
+#line 1509 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1502: checking for inline" >&5
+echo "configure:1579: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1509 "configure"
+#line 1586 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
esac
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1542: checking for off_t" >&5
+echo "configure:1619: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1547 "configure"
+#line 1624 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_off_t=yes
else
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1575: checking for size_t" >&5
+echo "configure:1652: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1580 "configure"
+#line 1657 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
rm -rf conftest*
ac_cv_type_size_t=yes
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1608: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1685: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1613 "configure"
+#line 1690 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1643: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1720: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1648 "configure"
+#line 1725 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:1656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1733: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1679: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1756: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1685 "configure"
+#line 1762 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1703 "configure"
+#line 1780 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:1725: checking for 8-bit clean memcmp" >&5
+echo "configure:1802: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 1733 "configure"
+#line 1810 "configure"
#include "confdefs.h"
main()
}
EOF
-if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
fi
echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
-test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o"
+test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1764: checking for $ac_hdr" >&5
+echo "configure:1841: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1846 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
+{ (eval echo configure:1851: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1803: checking for $ac_func" >&5
+echo "configure:1880: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1808 "configure"
+#line 1885 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1856: checking for working mmap" >&5
+echo "configure:1933: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 1864 "configure"
+#line 1941 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
}
EOF
-if { (eval echo configure:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2027: checking return type of signal handlers" >&5
+echo "configure:2104: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2032 "configure"
+#line 2109 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:2049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
for ac_func in getcwd gettimeofday mkdir mktime select socket
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2070: checking for $ac_func" >&5
+echo "configure:2147: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2075 "configure"
+#line 2152 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:2098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
if test $ac_cv_func_mmap_fixed_mapped = yes; then
echo $ac_n "checking whether MAP_FAILED is defined""... $ac_c" 1>&6
-echo "configure:2125: checking whether MAP_FAILED is defined" >&5
+echo "configure:2202: checking whether MAP_FAILED is defined" >&5
if eval "test \"`echo '$''{'ac_cv_map_failed'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2130 "configure"
+#line 2207 "configure"
#include "confdefs.h"
#include <sys/mman.h>
#ifdef MAP_FAILED
echo "$ac_t""$ac_cv_map_failed" 1>&6
echo $ac_n "checking whether MAP_ANONYMOUS is defined""... $ac_c" 1>&6
-echo "configure:2152: checking whether MAP_ANONYMOUS is defined" >&5
+echo "configure:2229: checking whether MAP_ANONYMOUS is defined" >&5
if eval "test \"`echo '$''{'ac_cv_map_anonymous'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2157 "configure"
+#line 2234 "configure"
#include "confdefs.h"
#include <sys/mman.h>
#ifdef MAP_ANONYMOUS
echo $ac_n "checking whether to include threads support""... $ac_c" 1>&6
-echo "configure:2209: checking whether to include threads support" >&5
+echo "configure:2286: checking whether to include threads support" >&5
if test x"$enable_threads" = "xno"; then
echo "$ac_t""no" 1>&6
else
fi
echo $ac_n "checking which garbage collector to use""... $ac_c" 1>&6
-echo "configure:2235: checking which garbage collector to use" >&5
+echo "configure:2312: checking which garbage collector to use" >&5
if test x"$enable_gc2" = "xno"; then
echo "$ac_t""old garbage collector" 1>&6
GC_OBJ="mm/libmm_old.a"
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
- case `(ac_space=' '; set) 2>&1` in
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.12"
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
+s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@PACKAGE@%$PACKAGE%g
s%@VERSION@%$VERSION%g
s%@ACLOCAL@%$ACLOCAL%g
Changes: Mark Probst EMAIL: cacao@complang.tuwien.ac.at
Philipp Tomsich EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: headers.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: headers.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
+#define CACAOH
+
#include "config.h" /* phil */
#include "global.h"
#include "tables.h"
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu jit/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu jit/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
-clean: clean-generic mostlyclean
+mostlyclean: mostlyclean-am
-distclean: distclean-generic clean
- -rm -f config.status
+clean-am: clean-generic mostlyclean-am
-maintainer-clean: maintainer-clean-generic distclean
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
Author: Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: parse.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: parse.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
BUILTIN2((functionptr) asm_builtin_checkarraycast, TYPE_ADR);
}
else { /* object type cast-check */
+ /*
+ LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
+ BUILTIN2((functionptr) asm_builtin_checkcast, TYPE_ADR);
+ */
OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
}
break;
BUILTIN2((functionptr) builtin_arrayinstanceof, TYPE_INT);
}
else { /* object type cast-check */
- OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
+ /*
+ LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
+ BUILTIN2((functionptr) builtin_instanceof, TYPE_INT);
+ */
+ OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
}
break;
jobject GetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.a;
}
jboolean GetStaticBooleanField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jbyte GetStaticByteField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jchar GetStaticCharField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jshort GetStaticShortField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jint GetStaticIntField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jlong GetStaticLongField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.l;
}
jfloat GetStaticFloatField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.f;
}
jdouble GetStaticDoubleField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.d;
}
void SetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value)
{
+ class_init(clazz);
fieldID->value.a = value;
}
void SetStaticBooleanField (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticByteField (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticCharField (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticShortField (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticIntField (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticLongField (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value)
{
+ class_init(clazz);
fieldID->value.l = value;
}
void SetStaticFloatField (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value)
{
+ class_init(clazz);
fieldID->value.f = value;
}
void SetStaticDoubleField (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value)
{
+ class_init(clazz);
fieldID->value.d = value;
}
&DeleteWeakGlobalRef,
&ExceptionCheck
};
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
}
sprintf (logtext,"Can not open class file '%s'", filename);
- error();
+ dolog();
return false;
}
/******************* Funktionen fuer den Class-loader generell ****************/
/******************************************************************************/
+static int loader_inited = 0;
/********************* Funktion: loader_load ***********************************
loadingtime += (stoptime-starttime);
}
+ if (loader_inited)
+ loader_compute_subclasses();
+
intsRestore(); /* schani */
return top;
proto_java_lang_ThreadDeath = /* schani */
builtin_new(class_java_lang_ThreadDeath);
heap_addreference ( (void**) &proto_java_lang_ThreadDeath);
+
+ loader_inited = 1;
}
intsRestore(); /* schani */
}
-static s4 classvalue = 0;
+static s4 classvalue;
static void loader_compute_class_values (classinfo *c)
{
intsDisable(); /* schani */
+ c = list_first (&linkedclasses);
+ while (c) {
+ if (!(c->flags & ACC_INTERFACE)) {
+ c->nextsub = 0;
+ c->sub = 0;
+ }
+ c = list_next (&linkedclasses, c);
+ }
+
c = list_first (&linkedclasses);
while (c) {
if (!(c->flags & ACC_INTERFACE) && (c->super != NULL)) {
c = list_next (&linkedclasses, c);
}
+ classvalue = 0;
loader_compute_class_values(class_java_lang_Object);
intsRestore(); /* schani */
Mark Probst EMAIL: cacao@complang.tuwien.ac.at
Philipp Tomsich EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: main.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: main.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
topclass = loader_load ( utf_new_char (cp) );
- loader_compute_subclasses();
-
gc_init();
#ifdef USE_THREADS
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
THREAD_OBJ = @THREAD_OBJ@
VERSION = @VERSION@
-EXTRA_DIST = asmpart.c calling.doc defines.h disass.c \
- native-math.h ngen.c ngen.h threads.h types.h
+EXTRA_DIST = asmpart.c calling.doc defines.h disass.c native-math.h ngen.c ngen.h threads.h types.h
+
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu mips/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mips/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+clean-am: clean-generic mostlyclean-am
-clean: clean-generic mostlyclean
+clean: clean-am
-distclean: distclean-generic clean
- -rm -f config.status
+distclean-am: distclean-generic clean-am
-maintainer-clean: maintainer-clean-generic distclean
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
noinst_LIBRARIES = libmm_new.a libmm_old.a
-libmm_new_a_SOURCES = allocator2.c allocator.h \
- bitmap2.c bitmap2.h \
- heap2.c \
- lifespan.c lifespan.h \
- mm.h
+libmm_new_a_SOURCES = allocator2.c allocator.h bitmap2.c bitmap2.h heap2.c lifespan.c lifespan.h mm.h
+
libmm_old_a_SOURCES = heap.old.c
-INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
libmm_old_a_OBJECTS = heap.old.o
AR = ar
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
+TAR = gtar
+GZIP_ENV = --best
DEP_FILES = .deps/allocator2.P .deps/bitmap2.P .deps/heap.old.P \
.deps/heap2.P .deps/lifespan.P
SOURCES = $(libmm_new_a_SOURCES) $(libmm_old_a_SOURCES)
OBJECTS = $(libmm_new_a_OBJECTS) $(libmm_old_a_OBJECTS)
-all: Makefile $(LIBRARIES)
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu mm/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mm/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
clean-depend:
distclean-depend:
+ -rm -rf .deps
maintainer-clean-depend:
- -rm -rf .deps
%.o: %.c
@echo '$(COMPILE) -c $<'; \
- $(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
- $(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
- @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
- < .deps/$(*F).p > .deps/$(*F).P
- @-rm -f .deps/$(*F).p
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile $(LIBRARIES)
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
-clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
- clean-generic mostlyclean
+mostlyclean: mostlyclean-am
+
+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
-distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
- distclean-depend distclean-generic clean
- -rm -f config.status
+clean: clean-am
-maintainer-clean: maintainer-clean-noinstLIBRARIES \
+distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
- distclean
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+maintainer-clean: maintainer-clean-am
+
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend info dvi \
-installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
while (curr) {
if (curr->address) {
if (!bitmap_testbit(mark_bits, curr->address)) {
+ int b;
#ifdef FINALIZER_COUNTING
++gc_finalizers_executed;
#endif
+ b = blockInts;
+ blockInts = 0;
asm_calljavamethod(((java_objectheader*)curr->address)->vftbl->class->finalizer,
curr->address, NULL, NULL, NULL);
+ blockInts = b;
curr->address = 0;
}
}
* Method: forName0
* Signature: (Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
*/
-JNIEXPORT struct java_lang_Class* JNICALL Java_java_lang_Class_forName0 ( JNIEnv *env , struct java_lang_String* s, s4 initialize, struct java_lang_ClassLoader* par3)
+JNIEXPORT struct java_lang_Class* JNICALL Java_java_lang_Class_forName0 ( JNIEnv *env , struct java_lang_String* s, s4 initialize, struct java_lang_ClassLoader* loader)
{
classinfo *c;
utf *u;
u4 i;
+ if (runverbose)
+ {
+ log_text("Java_java_lang_Class_forName0 called");
+ log_text(javastring_tochar((java_objectheader*)s));
+ }
+
/* illegal argument */
if (!s) return NULL;
/* arrayclasses, e.g. [Ljava.lang.String; */
c = create_array_class(javastring_toutf(s, true));
+ assert(c != 0);
} else
{
u = javastring_toutf(s, true);
if ( !(c = class_get(u)) ) {
-
- /* class was not found, raise exception */
- exceptionptr =
- native_new_and_init (class_java_lang_ClassNotFoundException);
-
- return NULL;
+ methodinfo *method;
+ java_lang_Class *class;
+
+ /* class was not found. first check whether we can load it */
+ method = class_findmethod(loader->header.vftbl->class,
+ utf_new_char("loadClass"),
+ utf_new_char("(Ljava/lang/String;)Ljava/lang/Class;"));
+ if (method == NULL)
+ {
+ log_text("could not find method");
+ exceptionptr = native_new_and_init (class_java_lang_ClassNotFoundException);
+ return NULL;
+ }
+
+ c = (classinfo*)asm_calljavafunction(method, loader, s, NULL, NULL);
+
+ if (c == NULL)
+ {
+ /* class was not loaded. raise exception */
+ exceptionptr =
+ native_new_and_init (class_java_lang_ClassNotFoundException);
+ return NULL;
+ }
}
}
/* save type in slot-field for faster processing */
setfield_critical(c,o,"slot", "I", jint, (jint) f->descriptor->text[0]);
setfield_critical(c,o,"name", "Ljava/lang/String;", jstring, (jstring) name);
- setfield_critical(c,o,"type", "Ljava/lang/Class;", jclass, c);
+ setfield_critical(c,o,"type", "Ljava/lang/Class;", jclass, fieldtype);
return o;
}
{
classinfo *c;
+ log_text("Java_java_lang_ClassLoader_defineClass0 called");
+
/* call JNI-function to load the class */
c = env->DefineClass(env, javastring_tochar((java_objectheader*) name), (jobject) this, (const jbyte *) &buf[off], len);
use_class_as_object (c);
*/
JNIEXPORT struct java_lang_Class* JNICALL Java_java_lang_ClassLoader_findBootstrapClass ( JNIEnv *env , struct java_lang_ClassLoader* this, struct java_lang_String* name)
{
- /* load the class */
- return Java_java_lang_Class_forName0(env,name,0,this);
+ classinfo *c;
+ bool result;
+ utf *transformed_name;
+
+ if (runverbose)
+ {
+ log_text("Java_java_lang_ClassLoader_findBootstrapClass called");
+ log_text(javastring_tochar((java_objectheader*)name));
+ }
+
+ /* check whether the class exists */
+ transformed_name = javastring_toutf(name, true);
+ result = suck_start(transformed_name);
+ /* suck_stop(); */
+
+ if (!result)
+ {
+ log_text("could not find class");
+ exceptionptr = native_new_and_init(class_java_lang_ClassNotFoundException);
+ return NULL;
+ }
+
+ /* load the class */
+ c = loader_load(transformed_name);
+
+ if (c == NULL)
+ {
+ log_text("could not load class");
+ exceptionptr = native_new_and_init(class_java_lang_ClassNotFoundException);
+ return NULL;
+ }
+
+ use_class_as_object(c);
+
+ return (java_lang_Class*)c;
}
/*
*/
JNIEXPORT struct java_lang_Class* JNICALL Java_java_lang_ClassLoader_findLoadedClass ( JNIEnv *env , struct java_lang_ClassLoader* this, struct java_lang_String* name)
{
- return Java_java_lang_Class_forName0(env,name,0,this);
+ classinfo *class;
+
+ if (runverbose)
+ log_text("Java_java_lang_ClassLoader_findLoadedClass called");
+
+ class = class_get(javastring_toutf(name, true));
+ if (class == NULL)
+ return NULL;
+
+ use_class_as_object(class);
+
+ return (java_lang_Class*)class;
}
/*
--- /dev/null
+/* class: java/net/DatagramPacket */
+
+/*
+ * Class: java/net/DatagramPacket
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_DatagramPacket_init (JNIEnv *env )
+{
+ if (runverbose)
+ log_text("Java_java_net_DatagramPacket_init called");
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/DatagramPacket */
+
+typedef struct java_net_DatagramPacket {
+ java_objectheader header;
+ java_bytearray* buf;
+ s4 offset;
+ s4 length;
+ struct java_net_InetAddress* address;
+ s4 port;
+} java_net_DatagramPacket;
+
+/*
+ * Class: java/net/DatagramPacket
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_DatagramPacket_init (JNIEnv *env );
/* The fieldid is used to retrieve the value, for primitive types a new
object for wrapping the primitive type is created. */
- if (st || obj)
+ if (st || obj)
switch (this->slot) {
case 'I' : {
/* create wrapping class */
*/
JNIEXPORT void JNICALL Java_java_net_InetAddress_init (JNIEnv *env )
{
- log_text("Java_java_net_InetAddress_init called");
-
+ if (runverbose)
+ log_text("Java_java_net_InetAddress_init called");
}
/* class: java/net/InetAddressImpl */
+#include <netinet/in.h>
+#include <netdb.h>
+
+#define HOSTNMSZ 80
+
/*
* Class: java/net/InetAddressImpl
* Method: getHostByAddr
* Signature: (I)Ljava/lang/String;
*/
-JNIEXPORT struct java_lang_String* JNICALL Java_java_net_InetAddressImpl_getHostByAddr (JNIEnv *env , struct java_net_InetAddressImpl* this , s4 par1)
+JNIEXPORT struct java_lang_String* JNICALL Java_java_net_InetAddressImpl_getHostByAddr (JNIEnv *env , struct java_net_InetAddressImpl* this , s4 addr)
{
- log_text("Java_java_net_InetAddressImpl_getHostByAddr called");
+ struct hostent* ent;
+
+ if (runverbose)
+ log_text("Java_java_net_InetAddressImpl_getHostByAddr called");
+
+ addr = htonl(addr);
+ ent = gethostbyaddr((char*)&addr, sizeof(s4), AF_INET);
+ if (ent == 0) {
+ exceptionptr = native_new_and_init (class_java_net_UnknownHostException);
+ return 0;
+ }
+
+ return (java_lang_String*)javastring_new_char((char*)ent->h_name);
}
/*
*/
JNIEXPORT s4 JNICALL Java_java_net_InetAddressImpl_getInetFamily (JNIEnv *env , struct java_net_InetAddressImpl* this )
{
- log_text("Java_java_net_InetAddressImpl_getInetFamily called");
+ if (runverbose)
+ log_text("Java_java_net_InetAddressImpl_getInetFamily called");
+
+ return (AF_INET);
}
/*
*/
JNIEXPORT struct java_lang_String* JNICALL Java_java_net_InetAddressImpl_getLocalHostName (JNIEnv *env , struct java_net_InetAddressImpl* this )
{
- log_text("Java_java_net_InetAddressImpl_getLocalHostName called");
+ char hostname[HOSTNMSZ];
+
+ if (runverbose)
+ log_text("Java_java_net_InetAddressImpl_getLocalHostName called");
+
+ if (gethostname(hostname, HOSTNMSZ-1) < 0) {
+ return (java_lang_String*)javastring_new_char("localhost");
+ }
+ return (java_lang_String*)javastring_new_char(hostname);
}
/*
* Method: lookupAllHostAddr
* Signature: (Ljava/lang/String;)[[B
*/
-JNIEXPORT java_arrayarray* JNICALL Java_java_net_InetAddressImpl_lookupAllHostAddr (JNIEnv *env , struct java_net_InetAddressImpl* this , struct java_lang_String* par1)
+JNIEXPORT java_arrayarray* JNICALL Java_java_net_InetAddressImpl_lookupAllHostAddr (JNIEnv *env , struct java_net_InetAddressImpl* this , struct java_lang_String* str)
{
- log_text("Java_java_net_InetAddressImpl_lookupAllHostAddr called");
+ char *name;
+ struct hostent* ent;
+ java_arrayarray *array;
+ int i;
+ int alength;
+ constant_arraydescriptor arraydesc;
+
+ if (runverbose)
+ log_text("Java_java_net_InetAddressImpl_lookupAllHostAddr called");
+
+ name = javastring_tochar((java_objectheader*)str);
+
+ ent = gethostbyname(name);
+ if (ent == 0) {
+ exceptionptr = native_new_and_init (class_java_net_UnknownHostException);
+ return 0;
+ }
+
+ for (alength = 0; ent->h_addr_list[alength]; alength++)
+ ;
+
+ arraydesc.arraytype = ARRAYTYPE_BYTE;
+ array = builtin_newarray_array(alength, &arraydesc);
+ assert(array != 0);
+
+ for (i = 0; i < alength; i++) {
+ java_bytearray *obj;
+
+ /* Copy in the network address */
+ obj = builtin_newarray_byte(sizeof(s4));
+ assert(obj != 0);
+ *(s4*)obj->data = *(s4*)ent->h_addr_list[i];
+ array->data[i] = (java_arrayheader*)obj;
+ }
+
+ return array;
}
/*
*/
JNIEXPORT void JNICALL Java_java_net_InetAddressImpl_makeAnyLocalAddress (JNIEnv *env , struct java_net_InetAddressImpl* this , struct java_net_InetAddress* par1)
{
- log_text("Java_java_net_InetAddressImpl_makeAnyLocalAddress called");
-}
+ if (runverbose)
+ log_text("Java_java_net_InetAddressImpl_makeAnyLocalAddress called");
+ /* par1->hostName = 0; */
+ par1->address = htonl(INADDR_ANY);
+ par1->family = AF_INET;
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/lang/Integer */
+
+typedef struct java_lang_Integer {
+ java_objectheader header;
+ s4 value;
+} java_lang_Integer;
+
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu nat/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nat/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
-clean: clean-generic mostlyclean
+mostlyclean: mostlyclean-am
-distclean: distclean-generic clean
- -rm -f config.status
+clean-am: clean-generic mostlyclean-am
-maintainer-clean: maintainer-clean-generic distclean
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
size = sizeof(java_arrayheader)
+ array->size * multiplicator[array->arraytype];
+ if (array->arraytype == ARRAYTYPE_OBJECT /* elementtype */
+ || array->arraytype == ARRAYTYPE_ARRAY) /* elementdescriptor */
+ size += sizeof(void*);
if (array->arraytype==ARRAYTYPE_OBJECT || array->arraytype==ARRAYTYPE_OBJECT)
size+=sizeof(void*);
--- /dev/null
+/* class: java/net/PlainDatagramSocketImpl */
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: bind
+ * Signature: (ILjava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_bind (JNIEnv *env,
+ struct java_net_PlainDatagramSocketImpl* this,
+ s4 port, struct java_net_InetAddress* laddr)
+{
+ int r;
+ struct sockaddr_in addr;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_bind called");
+
+#if defined(BSD44)
+ addr.sin_len = sizeof(addr);
+#endif
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ addr.sin_addr.s_addr = htonl(laddr->address);
+
+ r = bind(this->fd->fd, (struct sockaddr*)&addr, sizeof(addr));
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+
+ this->localPort = addr.sin_port; /* is this correct? */
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: datagramSocketClose
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_datagramSocketClose (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this)
+{
+ int r;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_datagramSocketClose called");
+
+ if (this->fd->fd != -1) {
+ r = close(this->fd->fd);
+ this->fd->fd = -1;
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+ }
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: datagramSocketCreate
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this)
+{
+ int fd;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate called");
+
+ fd = threadedSocket(AF_INET, SOCK_DGRAM, 0);
+ this->fd->fd = fd;
+ if (fd < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: getTTL
+ * Signature: ()B
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainDatagramSocketImpl_getTTL (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this)
+{
+ return Java_java_net_PlainDatagramSocketImpl_getTimeToLive(env, this);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: getTimeToLive
+ * Signature: ()I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainDatagramSocketImpl_getTimeToLive (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this)
+{
+ int ttl;
+ int size = sizeof(int);
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_getTimeToLive called");
+
+ if (getsockopt(this->fd->fd, IPPROTO_IP, IP_TTL, &ttl, &size) == -1)
+ {
+ exceptionptr = native_new_and_init(class_java_io_IOException);
+ return 0;
+ }
+
+ return ttl;
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_init (JNIEnv *env )
+{
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_init called");
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: join
+ * Signature: (Ljava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_join (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* addr)
+{
+ struct ip_mreq mreq;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_join called");
+
+ mreq.imr_multiaddr.s_addr = htonl(addr->address);
+ mreq.imr_interface.s_addr = INADDR_ANY;
+
+ if (setsockopt(this->fd->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(struct ip_mreq)) == -1)
+ exceptionptr = native_new_and_init(class_java_io_IOException);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: leave
+ * Signature: (Ljava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_leave (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* addr)
+{
+ struct ip_mreq mreq;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_leave called");
+
+ mreq.imr_multiaddr.s_addr = htonl(addr->address);
+ mreq.imr_interface.s_addr = INADDR_ANY;
+
+ if (setsockopt(this->fd->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(struct ip_mreq)) == -1)
+ exceptionptr = native_new_and_init(class_java_io_IOException);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: peek
+ * Signature: (Ljava/net/InetAddress;)I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainDatagramSocketImpl_peek (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* addr)
+{
+ int r;
+ struct sockaddr_in saddr;
+ int alen = sizeof(saddr);
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_peek called");
+
+ r = threadedRecvfrom(this->fd->fd, 0, 0, MSG_PEEK, (struct sockaddr*)&saddr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+
+ addr->address = ntohl(saddr.sin_addr.s_addr);
+
+ return (r);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: receive
+ * Signature: (Ljava/net/DatagramPacket;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_receive (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this, struct java_net_DatagramPacket* pkt)
+{
+ int r;
+ struct sockaddr_in addr;
+ int alen = sizeof(addr);
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_receive called");
+
+ r = threadedRecvfrom(this->fd->fd, pkt->buf->data, pkt->length, 0, (struct sockaddr*)&addr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+
+ pkt->length = r;
+ pkt->port = ntohs(addr.sin_port);
+ if (pkt->address == 0)
+ pkt->address = (java_net_InetAddress*)native_new_and_init(loader_load(utf_new_char("java/net/InetAddress")));
+ pkt->address->address = ntohl(addr.sin_addr.s_addr);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: send
+ * Signature: (Ljava/net/DatagramPacket;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_send (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this, struct java_net_DatagramPacket* pkt)
+{
+ int r;
+ struct sockaddr_in addr;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_send called");
+
+#if defined(BSD44)
+ addr.sin_len = sizeof(addr);
+#endif
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(pkt->port);
+ addr.sin_addr.s_addr = htonl(pkt->address->address);
+
+ r = threadedSendto(this->fd->fd, pkt->buf->data, pkt->length, 0, (struct sockaddr*)&addr, sizeof(addr));
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_net_SocketException);
+ return;
+ }
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: setTTL
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_setTTL (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this, s4 ttl)
+{
+ Java_java_net_PlainDatagramSocketImpl_setTimeToLive(env, this, ttl);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: setTimeToLive
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_setTimeToLive (JNIEnv *env, struct java_net_PlainDatagramSocketImpl* this, s4 ttl)
+{
+ int optval = ttl;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_setTimeToLive called");
+
+ if (setsockopt(this->fd->fd, IPPROTO_IP, IP_TTL, &optval, sizeof(int)) == -1)
+ exceptionptr = native_new_and_init(class_java_io_IOException);
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: socketGetOption
+ * Signature: (I)I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainDatagramSocketImpl_socketGetOption (JNIEnv *env,
+ struct java_net_PlainDatagramSocketImpl* this, s4 opt)
+{
+ int level;
+ int optname;
+ void *optval;
+ int optlen;
+
+ int intopt;
+ struct in_addr in_addr;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_bind called");
+
+ switch (opt)
+ {
+ case /* SO_SNDBUF */ 0x1001 :
+ case /* SO_RCVBUF */ 0x1002 :
+ level = SOL_SOCKET;
+ optname = (opt == 0x1001) ? SO_SNDBUF : SO_RCVBUF;
+ optval = &intopt;
+ optlen = sizeof(int);
+ break;
+
+ case /* IP_MULTICAST_IF */ 0x10 :
+ level = IPPROTO_IP;
+ optname = IP_MULTICAST_IF;
+ optval = &in_addr;
+ optlen = sizeof(struct in_addr);
+ break;
+
+ case /* SO_BINDADDR */ 0x000f :
+ {
+ struct sockaddr_in sockaddr;
+ int size = sizeof(struct sockaddr_in);
+
+ if (getsockname(this->fd->fd, &sockaddr, &size) == -1)
+ {
+ exceptionptr = native_new_and_init(class_java_net_SocketException);
+ return 0;
+ }
+
+ return ntohl(sockaddr.sin_addr.s_addr);
+ }
+ break;
+
+ default :
+ assert(0);
+ }
+
+ if (getsockopt(this->fd->fd, level, optname, optval, &optlen) == -1)
+ exceptionptr = native_new_and_init(class_java_net_SocketException);
+
+ switch (optname)
+ {
+ case SO_SNDBUF :
+ case SO_RCVBUF :
+ return intopt;
+
+ case IP_MULTICAST_IF :
+ return in_addr.s_addr;
+ }
+
+ assert(0);
+
+ return 0;
+}
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: socketSetOption
+ * Signature: (ILjava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainDatagramSocketImpl_socketSetOption (JNIEnv *env,
+ struct java_net_PlainDatagramSocketImpl* this, s4 opt, struct java_lang_Object* obj)
+{
+ int level;
+ int optname;
+ void *optval;
+ int optlen;
+
+ int flag;
+ int bufsize;
+ struct in_addr in_addr;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainDatagramSocketImpl_socketSetOption called");
+
+ switch (opt)
+ {
+ case /* SO_REUSEADDR */ 0x04 :
+ flag = ((java_lang_Integer*)obj)->value;
+
+ level = SOL_SOCKET;
+ optname = SO_REUSEADDR;
+ optval = &flag;
+ optlen = sizeof(int);
+ break;
+
+ case /* SO_SNDBUF */ 0x1001 :
+ case /* SO_RCVBUF */ 0x1002 :
+ bufsize = ((java_lang_Integer*)obj)->value;
+
+ level = SOL_SOCKET;
+ optname = (opt == 0x1001) ? SO_SNDBUF : SO_RCVBUF;
+ optval = &level;
+ optlen = sizeof(int);
+ break;
+
+ case /* IP_MULTICAST_IF */ 0x10 :
+ in_addr.s_addr = ((java_net_InetAddress*)obj)->address;
+
+ level = IPPROTO_IP;
+ optname = IP_MULTICAST_IF;
+ optval = &in_addr;
+ optlen = sizeof(struct in_addr);
+ break;
+
+ default :
+ assert(0);
+ }
+
+ if (setsockopt(this->fd->fd, level, optname, optval, optlen) == -1)
+ exceptionptr = native_new_and_init(class_java_net_SocketException);
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/PlainDatagramSocketImpl */
+
+typedef struct java_net_PlainDatagramSocketImpl {
+ java_objectheader header;
+ s4 localPort;
+ struct java_io_FileDescriptor* fd;
+ s4 timeout;
+} java_net_PlainDatagramSocketImpl;
+
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: bind
+ * Signature: (ILjava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_bind (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , s4 par1, struct java_net_InetAddress* par2);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: datagramSocketClose
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_datagramSocketClose (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this );
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: datagramSocketCreate
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this );
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: getTTL
+ * Signature: ()B
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainDatagramSocketImpl_getTTL (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this );
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: getTimeToLive
+ * Signature: ()I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainDatagramSocketImpl_getTimeToLive (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this );
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_init (JNIEnv *env );
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: join
+ * Signature: (Ljava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_join (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: leave
+ * Signature: (Ljava/net/InetAddress;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_leave (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: peek
+ * Signature: (Ljava/net/InetAddress;)I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainDatagramSocketImpl_peek (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_InetAddress* par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: receive
+ * Signature: (Ljava/net/DatagramPacket;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_receive (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_DatagramPacket* par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: send
+ * Signature: (Ljava/net/DatagramPacket;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_send (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , struct java_net_DatagramPacket* par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: setTTL
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_setTTL (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: setTimeToLive
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_setTimeToLive (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: socketGetOption
+ * Signature: (I)I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainDatagramSocketImpl_socketGetOption (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainDatagramSocketImpl
+ * Method: socketSetOption
+ * Signature: (ILjava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainDatagramSocketImpl_socketSetOption (JNIEnv *env , struct java_net_PlainDatagramSocketImpl* this , s4 par1, struct java_lang_Object* par2);
--- /dev/null
+/* class: java/net/PlainSocketImpl */
+
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+#include <asm/termios.h> /* a little linux-centric maybe?? (should be in autoconf) */
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: initProto
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_initProto (JNIEnv *env )
+{
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_initProto called");
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketAccept
+ * Signature: (Ljava/net/SocketImpl;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketAccept (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_SocketImpl* sock)
+{
+ int r;
+ int alen;
+ struct sockaddr_in addr;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketAccept called");
+
+ alen = sizeof(addr);
+#if defined(BSD44)
+ addr.sin_len = sizeof(addr);
+#endif
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(sock->localport);
+ addr.sin_addr.s_addr = htonl(sock->address->address);
+
+ r = threadedAccept(this->fd->fd, (struct sockaddr*)&addr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+ sock->fd->fd = r;
+
+ /* Enter information into socket object */
+ alen = sizeof(addr);
+ r = getpeername(r, (struct sockaddr*)&addr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+
+ sock->address->address = ntohl(addr.sin_addr.s_addr);
+ sock->port = ntohs(addr.sin_port);
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketAvailable
+ * Signature: ()I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainSocketImpl_socketAvailable (JNIEnv *env , struct java_net_PlainSocketImpl* this )
+{
+ int r;
+ int len;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketAvailable called");
+
+ r = ioctl(this->fd->fd, FIONREAD, &len);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return 0;
+ }
+ return (s4)len;
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketBind
+ * Signature: (Ljava/net/InetAddress;I)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketBind (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_InetAddress* laddr, s4 lport)
+{
+ int r;
+ struct sockaddr_in addr;
+ int fd;
+ int on = 1;
+ int alen;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketBind called");
+
+#if defined(BSD44)
+ addr.sin_len = sizeof(addr);
+#endif
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(lport);
+ addr.sin_addr.s_addr = htonl(laddr->address);
+
+ fd = this->fd->fd;
+
+ /* Allow rebinding to socket - ignore errors */
+ (void)setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
+ r = bind(fd, (struct sockaddr*)&addr, sizeof(addr));
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+
+ /* Enter information into socket object */
+ this->address = laddr;
+ if (lport == 0) {
+ alen = sizeof(addr);
+ r = getsockname(fd, (struct sockaddr*)&addr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+ lport = ntohs(addr.sin_port);
+ }
+ this->localport = lport;
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketClose
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketClose (JNIEnv *env , struct java_net_PlainSocketImpl* this)
+{
+ int r;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketClose called");
+
+ if (this->fd->fd != -1) {
+ r = close(this->fd->fd);
+ this->fd->fd = -1;
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+ }
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketConnect
+ * Signature: (Ljava/net/InetAddress;I)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketConnect (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_InetAddress* daddr, s4 dport)
+{
+ int fd;
+ int r;
+ struct sockaddr_in addr;
+ int alen;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketConnect called");
+
+#if defined(BSD44)
+ addr.sin_len = sizeof(addr);
+#endif
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(dport);
+ addr.sin_addr.s_addr = htonl(daddr->address);
+
+ fd = this->fd->fd;
+ r = threadedConnect(fd, (struct sockaddr*)&addr, sizeof(addr));
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+
+ /* Enter information into socket object */
+ alen = sizeof(addr);
+ r = getsockname(fd, (struct sockaddr*)&addr, &alen);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+
+ this->address = daddr;
+ this->port = dport;
+ this->localport = ntohs(addr.sin_port);
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketCreate
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketCreate (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 /* bool */ stream)
+{
+ int fd;
+ int type;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketCreate called");
+
+ if (stream == 0) {
+ type = SOCK_DGRAM;
+ }
+ else {
+ type = SOCK_STREAM;
+ }
+
+ fd = threadedSocket(AF_INET, type, 0);
+ if (fd < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+ this->fd->fd = fd;
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketGetOption
+ * Signature: (I)I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_PlainSocketImpl_socketGetOption (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 opt)
+{
+ int level;
+ int optname;
+ void *optval;
+ int optlen;
+
+ struct linger linger;
+ int intopt;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketGetOption called");
+
+ switch (opt)
+ {
+ case /* SO_LINGER */ 0x0080 :
+ level = SOL_SOCKET;
+ optname = SO_LINGER;
+ optval = &linger;
+ optlen = sizeof(struct linger);
+ break;
+
+ case /* TCP_NODELAY */ 0x0001 :
+ level = IPPROTO_TCP;
+ optname = TCP_NODELAY;
+ optval = &intopt;
+ optlen = sizeof(int);
+ break;
+
+ case /* SO_SNDBUF */ 0x1001 :
+ case /* SO_RCVBUF */ 0x1002 :
+ level = SOL_SOCKET;
+ optname = (opt == 0x1001) ? SO_SNDBUF : SO_RCVBUF;
+ optval = &intopt;
+ optlen = sizeof(int);
+ break;
+
+ case /* SO_BINDADDR */ 0x000f :
+ return this->address->address;
+
+ default :
+ assert(0);
+ }
+
+ if (getsockopt(this->fd->fd, level, optname, optval, &optlen) == -1)
+ exceptionptr = native_new_and_init(class_java_net_SocketException);
+
+ switch (optname)
+ {
+ case SO_LINGER :
+ if (linger.l_onoff)
+ return linger.l_linger;
+ return -1;
+
+ case TCP_NODELAY :
+ if (intopt)
+ return 1;
+ return -1; /* -1 == false? */
+
+ case SO_SNDBUF :
+ case SO_RCVBUF :
+ return intopt;
+ }
+
+ assert(0);
+
+ return 0;
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketListen
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketListen (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 count)
+{
+ int r;
+
+ if (runverbose)
+ log_text("java_net_PlainSocketImpl_socketListen called");
+
+ r = listen(this->fd->fd, count);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+}
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketSetOption
+ * Signature: (IZLjava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_PlainSocketImpl_socketSetOption (JNIEnv *env,
+ struct java_net_PlainSocketImpl* this , s4 cmd, s4 /* bool */ on, struct java_lang_Object* value)
+{
+ int level;
+ int optname;
+ void *optval;
+ int optlen;
+
+ struct linger linger;
+ int nodelay;
+ int bufsize;
+
+ if (runverbose)
+ log_text("Java_java_net_PlainSocketImpl_socketSetOption called");
+
+ switch (cmd)
+ {
+ case /* SO_LINGER */ 0x0080 :
+ if (on)
+ {
+ linger.l_onoff = 1;
+ linger.l_linger = ((java_lang_Integer*)value)->value;
+ }
+ else
+ linger.l_onoff = 0;
+
+ level = SOL_SOCKET;
+ optname = SO_LINGER;
+ optval = &linger;
+ optlen = sizeof(struct linger);
+ break;
+
+ case /* TCP_NODELAY */ 0x0001 :
+ nodelay = on ? 1 : 0;
+
+ level = IPPROTO_TCP;
+ optname = TCP_NODELAY;
+ optval = &nodelay;
+ optlen = sizeof(int);
+ break;
+
+ case /* SO_SNDBUF */ 0x1001 :
+ case /* SO_RCVBUF */ 0x1002 :
+ bufsize = ((java_lang_Integer*)value)->value;
+
+ level = SOL_SOCKET;
+ optname = (cmd == 0x1001) ? SO_SNDBUF : SO_RCVBUF;
+ optval = &bufsize;
+ optlen = sizeof(int);
+ break;
+
+ default :
+ assert(0);
+ }
+
+ if (setsockopt(this->fd->fd, level, optname, optval, optlen) == -1)
+ exceptionptr = native_new_and_init(class_java_net_SocketException);
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/PlainSocketImpl */
+
+typedef struct java_net_PlainSocketImpl {
+ java_objectheader header;
+ struct java_io_FileDescriptor* fd;
+ struct java_net_InetAddress* address;
+ s4 port;
+ s4 localport;
+ s4 timeout;
+} java_net_PlainSocketImpl;
+
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: initProto
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_initProto (JNIEnv *env );
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketAccept
+ * Signature: (Ljava/net/SocketImpl;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketAccept (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_SocketImpl* par1);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketAvailable
+ * Signature: ()I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainSocketImpl_socketAvailable (JNIEnv *env , struct java_net_PlainSocketImpl* this );
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketBind
+ * Signature: (Ljava/net/InetAddress;I)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketBind (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_InetAddress* par1, s4 par2);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketClose
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketClose (JNIEnv *env , struct java_net_PlainSocketImpl* this );
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketConnect
+ * Signature: (Ljava/net/InetAddress;I)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketConnect (JNIEnv *env , struct java_net_PlainSocketImpl* this , struct java_net_InetAddress* par1, s4 par2);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketCreate
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketCreate (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketGetOption
+ * Signature: (I)I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_PlainSocketImpl_socketGetOption (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketListen
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketListen (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 par1);
+/*
+ * Class: java/net/PlainSocketImpl
+ * Method: socketSetOption
+ * Signature: (IZLjava/lang/Object;)V
+ */
+JNIEXPORT void JNICALL Java_java_net_PlainSocketImpl_socketSetOption (JNIEnv *env , struct java_net_PlainSocketImpl* this , s4 par1, s4 par2, struct java_lang_Object* par3);
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/SocketImpl */
+
+typedef struct java_net_SocketImpl {
+ java_objectheader header;
+ struct java_io_FileDescriptor* fd;
+ struct java_net_InetAddress* address;
+ s4 port;
+ s4 localport;
+} java_net_SocketImpl;
+
--- /dev/null
+/* class: java/net/SocketInputStream */
+
+/*
+ * Class: java/net/SocketInputStream
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_SocketInputStream_init (JNIEnv *env )
+{
+ if (runverbose)
+ log_text("Java_java_net_SocketInputStream_initProto called");
+}
+
+/*
+ * Class: java/net/SocketInputStream
+ * Method: socketRead
+ * Signature: ([BII)I
+ */
+JNIEXPORT s4 JNICALL
+Java_java_net_SocketInputStream_socketRead (JNIEnv *env, struct java_net_SocketInputStream* this, java_bytearray* buf, s4 offset, s4 len)
+{
+ int r;
+
+ if (runverbose)
+ log_text("Java_java_net_SocketInputStream_socketRead called");
+
+ assert(blockInts == 0);
+
+ r = threadedRead(this->impl->fd->fd, &buf->data[offset], len);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return 0;
+ }
+ else if (r == 0) {
+ return (-1); /* EOF */
+ }
+ else {
+ return (r);
+ }
+
+ assert(blockInts == 0);
+
+ return 0;
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/SocketInputStream */
+
+typedef struct java_net_SocketInputStream {
+ java_objectheader header;
+ struct java_io_FileDescriptor* fd;
+ s4 eof;
+ struct java_net_SocketImpl* impl;
+ java_bytearray* temp;
+} java_net_SocketInputStream;
+
+/*
+ * Class: java/net/SocketInputStream
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_SocketInputStream_init (JNIEnv *env );
+/*
+ * Class: java/net/SocketInputStream
+ * Method: socketRead
+ * Signature: ([BII)I
+ */
+JNIEXPORT s4 JNICALL Java_java_net_SocketInputStream_socketRead (JNIEnv *env , struct java_net_SocketInputStream* this , java_bytearray* par1, s4 par2, s4 par3);
--- /dev/null
+/* class: java/net/SocketOutputStream */
+
+/*
+ * Class: java/net/SocketOutputStream
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_SocketOutputStream_init (JNIEnv *env )
+{
+ if (runverbose)
+ log_text("Java_java_net_SocketOutputStream_init called");
+}
+
+/*
+ * Class: java/net/SocketOutputStream
+ * Method: socketWrite
+ * Signature: ([BII)V
+ */
+JNIEXPORT void JNICALL
+Java_java_net_SocketOutputStream_socketWrite (JNIEnv *env, struct java_net_SocketOutputStream* this, java_bytearray* buf, s4 offset, s4 len)
+{
+ int r;
+
+ if (runverbose)
+ log_text("Java_java_net_SocketOutputStream_socketWrite called");
+
+ assert(blockInts == 0);
+
+ if (this->impl->fd->fd < 0) {
+ /* exceptionptr = native_new_and_init (class_java_io_IOException); */
+ return;
+ }
+ r = threadedWrite(this->impl->fd->fd, &buf->data[offset], len);
+ if (r < 0) {
+ exceptionptr = native_new_and_init (class_java_io_IOException);
+ return;
+ }
+ assert(r == len);
+
+ assert(blockInts == 0);
+}
--- /dev/null
+/* This file is machine generated, don't edit it !*/
+
+/* Structure information for class: java/net/SocketOutputStream */
+
+typedef struct java_net_SocketOutputStream {
+ java_objectheader header;
+ struct java_io_FileDescriptor* fd;
+ struct java_net_SocketImpl* impl;
+ java_bytearray* temp;
+} java_net_SocketOutputStream;
+
+/*
+ * Class: java/net/SocketOutputStream
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_java_net_SocketOutputStream_init (JNIEnv *env );
+/*
+ * Class: java/net/SocketOutputStream
+ * Method: socketWrite
+ * Signature: ([BII)V
+ */
+JNIEXPORT void JNICALL Java_java_net_SocketOutputStream_socketWrite (JNIEnv *env , struct java_net_SocketOutputStream* this , java_bytearray* par1, s4 par2, s4 par3);
}
#define MAXPROPS 100
-static int activeprops = 16;
+static int activeprops = 15;
static char *proplist[MAXPROPS][2] = {
{ "java.class.path", NULL },
{ "user.home", NULL },
{ "user.name", NULL },
{ "user.dir", NULL },
-
- { "impl.prefix", "" },
{ "java.class.version", "45.3" },
{ "java.version", "cacao:0.3" },
JNIEXPORT struct java_lang_String* JNICALL Java_java_lang_System_mapLibraryName (JNIEnv *env , struct java_lang_String* s)
{
char somefile[MAXSTRINGSIZE];
+ char *java_home;
/* return name of any file that exists (relative to root),
so ClassLoader believes we dynamically load the native library */
if (strlen(classpath)+24>MAXSTRINGSIZE)
panic("filename too long");
- strcpy(somefile,getenv("JAVA_HOME"));
+ java_home = getenv("JAVA_HOME");
+ if (java_home == 0)
+ java_home = "/tmp";
+ strcpy(somefile,java_home);
strcat(somefile,"/dummy");
return (java_lang_String* ) javastring_new_char(&somefile[1]);
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_countStackFrames ( JNIEnv *env , struct java_lang_Thread* this)
{
- log_text ("java_lang_Thread_countStackFrames called");
- return 0; /* not yet implemented */
+ log_text ("java_lang_Thread_countStackFrames called");
+ return 0; /* not yet implemented */
}
/*
JNIEXPORT void JNICALL Java_java_lang_Thread_interrupt0 ( JNIEnv *env , struct java_lang_Thread* this)
{
log_text("Java_java_lang_Thread_interrupt0 called");
+ /* not yet implemented */
}
/*
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_isAlive ( JNIEnv *env , struct java_lang_Thread* this)
{
- if (runverbose)
- log_text ("java_lang_Thread_isAlive called");
-
- #ifdef USE_THREADS
- return aliveThread((thread*)this);
- #else
- return 0;
- #endif
+ if (runverbose)
+ log_text ("java_lang_Thread_isAlive called");
+
+#ifdef USE_THREADS
+ return aliveThread((thread*)this);
+#else
+ return 0;
+#endif
}
/*
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_isInterrupted ( JNIEnv *env , struct java_lang_Thread* this, s4 par1)
{
- log_text("Java_java_lang_Thread_isInterrupted called");
+ log_text("Java_java_lang_Thread_isInterrupted called");
+ return 0; /* not yet implemented */
}
/*
*/
JNIEXPORT void JNICALL Java_java_lang_Thread_resume0 ( JNIEnv *env , struct java_lang_Thread* this)
{
- if (runverbose)
- log_text ("java_lang_Thread_resume0 called");
+ if (runverbose)
+ log_text ("java_lang_Thread_resume0 called");
- #ifdef USE_THREADS
- resumeThread((thread*)this);
- #endif
+#ifdef USE_THREADS
+ resumeThread((thread*)this);
+#endif
}
/*
*/
JNIEXPORT void JNICALL Java_java_lang_Thread_setPriority0 ( JNIEnv *env , struct java_lang_Thread* this, s4 par1)
{
- if (runverbose)
- log_text ("java_lang_Thread_setPriority0 called");
+ if (runverbose)
+ log_text ("java_lang_Thread_setPriority0 called");
- #ifdef USE_THREADS
- setPriorityThread((thread*)this, par1);
- #endif
+#ifdef USE_THREADS
+ setPriorityThread((thread*)this, par1);
+#endif
}
/*
* Method: sleep
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_java_lang_Thread_sleep ( JNIEnv *env , s8 par1)
+JNIEXPORT void JNICALL Java_java_lang_Thread_sleep (JNIEnv *env, s8 millis)
{
- if (runverbose)
- log_text ("java_lang_Thread_sleep called");
+ if (runverbose)
+ log_text ("java_lang_Thread_sleep called");
- #ifdef USE_THREADS
- yieldThread();
- #endif
-
- /* not yet implemented */
+#ifdef USE_THREADS
+ sleepThread(millis);
+#endif
}
/*
#include <assert.h>
#include <sys/time.h>
-#include "../threads/thread.h" /* schani */
-#include "../threads/locks.h"
+#include "threads/thread.h" /* schani */
+#include "threads/locks.h"
/* INCLUDE-Files fuer IO-Funktionen */
static classinfo *class_java_io_IOException;
static classinfo *class_java_io_UnixFileSystem;
static classinfo *class_java_security_PrivilegedActionException;
+static classinfo *class_java_net_UnknownHostException;
+static classinfo *class_java_net_SocketException;
static classinfo *class_java_lang_NoSuchMethodException;
static classinfo *class_java_lang_Double;
static classinfo *class_java_lang_Float;
#include "nat/BigInteger.c"
#include "nat/InetAddress.c"
#include "nat/InetAddressImpl.c"
+#include "nat/DatagramPacket.c"
+#include "nat/PlainDatagramSocketImpl.c"
+#include "nat/PlainSocketImpl.c"
+#include "nat/SocketInputStream.c"
+#include "nat/SocketOutputStream.c"
#include "nat/AccessController.c"
#include "nat/ClassLoader_NativeLibrary.c"
#include "nat/UnixFileSystem.c"
class_new ( utf_new_char ("java/lang/ClassLoader") );
class_java_security_PrivilegedActionException =
class_new( utf_new_char("java/security/PrivilegedActionException"));
+ class_java_net_UnknownHostException =
+ loader_load( utf_new_char ("java/net/UnknownHostException") );
+ class_java_net_SocketException =
+ loader_load( utf_new_char ("java/net/SocketException") );
class_java_lang_IllegalArgumentException =
class_new( utf_new_char("java/lang/IllegalArgumentException"));
class_java_lang_ArrayIndexOutOfBoundsException =
Mark Probst EMAIL: cacao@complang.tuwien.ac.at
Philipp Tomsich EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: cacao.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: cacao.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
topclass = loader_load ( utf_new_char (cp) );
- loader_compute_subclasses();
-
gc_init();
#ifdef USE_THREADS
Changes: Mark Probst EMAIL: cacao@complang.tuwien.ac.at
Philipp Tomsich EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: headers.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: headers.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
+#define CACAOH
+
#include "config.h" /* phil */
#include "global.h"
#include "tables.h"
jobject GetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.a;
}
jboolean GetStaticBooleanField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jbyte GetStaticByteField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jchar GetStaticCharField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jshort GetStaticShortField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jint GetStaticIntField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.i;
}
jlong GetStaticLongField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.l;
}
jfloat GetStaticFloatField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.f;
}
jdouble GetStaticDoubleField (JNIEnv *env, jclass clazz, jfieldID fieldID)
{
+ class_init(clazz);
return fieldID->value.d;
}
void SetStaticObjectField (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value)
{
+ class_init(clazz);
fieldID->value.a = value;
}
void SetStaticBooleanField (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticByteField (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticCharField (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticShortField (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticIntField (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value)
{
+ class_init(clazz);
fieldID->value.i = value;
}
void SetStaticLongField (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value)
{
+ class_init(clazz);
fieldID->value.l = value;
}
void SetStaticFloatField (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value)
{
+ class_init(clazz);
fieldID->value.f = value;
}
void SetStaticDoubleField (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value)
{
+ class_init(clazz);
fieldID->value.d = value;
}
&DeleteWeakGlobalRef,
&ExceptionCheck
};
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
#include <assert.h>
#include <sys/time.h>
-#include "../threads/thread.h" /* schani */
-#include "../threads/locks.h"
+#include "threads/thread.h" /* schani */
+#include "threads/locks.h"
/* INCLUDE-Files fuer IO-Funktionen */
static classinfo *class_java_io_IOException;
static classinfo *class_java_io_UnixFileSystem;
static classinfo *class_java_security_PrivilegedActionException;
+static classinfo *class_java_net_UnknownHostException;
+static classinfo *class_java_net_SocketException;
static classinfo *class_java_lang_NoSuchMethodException;
static classinfo *class_java_lang_Double;
static classinfo *class_java_lang_Float;
#include "nat/BigInteger.c"
#include "nat/InetAddress.c"
#include "nat/InetAddressImpl.c"
+#include "nat/DatagramPacket.c"
+#include "nat/PlainDatagramSocketImpl.c"
+#include "nat/PlainSocketImpl.c"
+#include "nat/SocketInputStream.c"
+#include "nat/SocketOutputStream.c"
#include "nat/AccessController.c"
#include "nat/ClassLoader_NativeLibrary.c"
#include "nat/UnixFileSystem.c"
class_new ( utf_new_char ("java/lang/ClassLoader") );
class_java_security_PrivilegedActionException =
class_new( utf_new_char("java/security/PrivilegedActionException"));
+ class_java_net_UnknownHostException =
+ loader_load( utf_new_char ("java/net/UnknownHostException") );
+ class_java_net_SocketException =
+ loader_load( utf_new_char ("java/net/SocketException") );
class_java_lang_IllegalArgumentException =
class_new( utf_new_char("java/lang/IllegalArgumentException"));
class_java_lang_ArrayIndexOutOfBoundsException =
/* The fieldid is used to retrieve the value, for primitive types a new
object for wrapping the primitive type is created. */
- if (st || obj)
+ if (st || obj)
switch (this->slot) {
case 'I' : {
/* create wrapping class */
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_countStackFrames ( JNIEnv *env , struct java_lang_Thread* this)
{
- log_text ("java_lang_Thread_countStackFrames called");
- return 0; /* not yet implemented */
+ log_text ("java_lang_Thread_countStackFrames called");
+ return 0; /* not yet implemented */
}
/*
JNIEXPORT void JNICALL Java_java_lang_Thread_interrupt0 ( JNIEnv *env , struct java_lang_Thread* this)
{
log_text("Java_java_lang_Thread_interrupt0 called");
+ /* not yet implemented */
}
/*
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_isAlive ( JNIEnv *env , struct java_lang_Thread* this)
{
- if (runverbose)
- log_text ("java_lang_Thread_isAlive called");
-
- #ifdef USE_THREADS
- return aliveThread((thread*)this);
- #else
- return 0;
- #endif
+ if (runverbose)
+ log_text ("java_lang_Thread_isAlive called");
+
+#ifdef USE_THREADS
+ return aliveThread((thread*)this);
+#else
+ return 0;
+#endif
}
/*
*/
JNIEXPORT s4 JNICALL Java_java_lang_Thread_isInterrupted ( JNIEnv *env , struct java_lang_Thread* this, s4 par1)
{
- log_text("Java_java_lang_Thread_isInterrupted called");
+ log_text("Java_java_lang_Thread_isInterrupted called");
+ return 0; /* not yet implemented */
}
/*
*/
JNIEXPORT void JNICALL Java_java_lang_Thread_resume0 ( JNIEnv *env , struct java_lang_Thread* this)
{
- if (runverbose)
- log_text ("java_lang_Thread_resume0 called");
+ if (runverbose)
+ log_text ("java_lang_Thread_resume0 called");
- #ifdef USE_THREADS
- resumeThread((thread*)this);
- #endif
+#ifdef USE_THREADS
+ resumeThread((thread*)this);
+#endif
}
/*
*/
JNIEXPORT void JNICALL Java_java_lang_Thread_setPriority0 ( JNIEnv *env , struct java_lang_Thread* this, s4 par1)
{
- if (runverbose)
- log_text ("java_lang_Thread_setPriority0 called");
+ if (runverbose)
+ log_text ("java_lang_Thread_setPriority0 called");
- #ifdef USE_THREADS
- setPriorityThread((thread*)this, par1);
- #endif
+#ifdef USE_THREADS
+ setPriorityThread((thread*)this, par1);
+#endif
}
/*
* Method: sleep
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_java_lang_Thread_sleep ( JNIEnv *env , s8 par1)
+JNIEXPORT void JNICALL Java_java_lang_Thread_sleep (JNIEnv *env, s8 millis)
{
- if (runverbose)
- log_text ("java_lang_Thread_sleep called");
+ if (runverbose)
+ log_text ("java_lang_Thread_sleep called");
- #ifdef USE_THREADS
- yieldThread();
- #endif
-
- /* not yet implemented */
+#ifdef USE_THREADS
+ sleepThread(millis);
+#endif
}
/*
return (ptr - buf);
}
+/*
+ * Receive, but only if we can.
+ */
+int
+threadedRecvfrom (int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen)
+{
+ int r;
+
+ DBG( printf("threadedRecvfrom\n"); )
+
+#if defined(BLOCKING_CALLS)
+ blockOnFile(fd, TH_READ);
+#endif
+ for (;;)
+ {
+ r = recvfrom(fd, buf, len, flags, addr, addrlen);
+ if (r < 0
+ && (errno == EAGAIN || errno == EWOULDBLOCK
+ || errno == EINTR))
+ {
+ blockOnFile(fd, TH_READ);
+ continue;
+ }
+ return (r);
+ }
+}
+
+/*
+ * Send, but only if we can.
+ */
+int
+threadedSendto (int fd, void *buf, size_t len, int flags, struct sockaddr *addr, int addrlen)
+{
+ int r;
+
+ DBG( printf("threadedSendto\n"); )
+
+#if defined(BLOCKING_CALLS)
+ blockOnFile(fd, TH_WRITE);
+#endif
+ for (;;)
+ {
+ r = sendto(fd, buf, len, flags, addr, addrlen);
+ if (r < 0
+ && (errno == EAGAIN || errno == EWOULDBLOCK
+ || errno == EINTR))
+ {
+ blockOnFile(fd, TH_WRITE);
+ continue;
+ }
+ return (r);
+ }
+}
+
/*
* An attempt to access a file would block, so suspend the thread until
* it will happen.
{
maxFd = fd;
}
+
if (op == TH_READ)
{
FD_SET(fd, &readsPending);
thread* tid;
thread* ntid;
int i;
- int b;
+ s8 time = -1;
+ struct timeval tv;
+ struct timeval *timeout;
+
+ assert(blockInts > 0);
DBG( printf("checkEvents block:%d\n", block); )
+ if (sleepThreads != 0)
+ {
+ time = currentTime();
+ while (sleepThreads != 0 && time >= CONTEXT(sleepThreads).time)
+ {
+ tid = sleepThreads;
+ sleepThreads = sleepThreads->next;
+ tid->next = 0;
+
+ iresumeThread(tid);
+ }
+ }
+
+ if (block)
+ {
+ if (sleepThreads != 0)
+ {
+ s8 wait_time = CONTEXT(sleepThreads).time - time;
+
+ tv.tv_sec = wait_time / 1000;
+ tv.tv_usec = (wait_time % 1000) * 1000;
+ timeout = &tv;
+ }
+ else
+ timeout = 0;
+ }
+ else
+ {
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ timeout = &tv;
+ }
+
#if defined(FD_COPY)
FD_COPY(&readsPending, &rd);
FD_COPY(&writesPending, &wr);
memcpy(&wr, &writesPending, sizeof(wr));
#endif
- /*
- * If select() is called with indefinite wait, we have to make sure
- * we can get interrupted by timer events.
- */
- if (block == true)
- {
- b = blockInts;
- blockInts = 0;
- r = select(maxFd+1, &rd, &wr, 0, 0);
- blockInts = b;
- }
- else
- {
- r = select(maxFd+1, &rd, &wr, 0, &tm);
- }
+ r = select(maxFd+1, &rd, &wr, 0, timeout);
/* We must be holding off interrupts before we start playing with
* the read and write queues. This should be already done but a
DBG( printf("Select returns %d\n", r); )
+ /* Some threads may have finished sleeping.
+ */
+ if (block && sleepThreads != 0)
+ {
+ time = currentTime();
+ while (sleepThreads != 0 && time >= CONTEXT(sleepThreads).time)
+ {
+ tid = sleepThreads;
+ sleepThreads = sleepThreads->next;
+ tid->next = 0;
+
+ iresumeThread(tid);
+ }
+ }
+
for (i = 0; r > 0 && i <= maxFd; i++)
{
if (readQ[i] != 0 && FD_ISSET(i, &rd))
int threadedAccept(int fd, struct sockaddr* addr, int* len);
int threadedRead(int fd, char* buf, int len);
int threadedWrite(int fd, char* buf, int len);
+int threadedRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen);
+int threadedSendto(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t addrlen);
#else
#define threadedFileDescriptor(fd)
#define threadedRead(fd,buf,len) read(fd,buf,len)
#include <sys/types.h>
#include <sys/mman.h> /* for mprotect */
#include <unistd.h>
+#include <signal.h>
+#include <sys/time.h>
#include "thread.h"
#include "locks.h"
thread* threadQtail[MAX_THREAD_PRIO + 1];
thread* liveThreads = NULL;
-thread* alarmList;
+thread* sleepThreads = NULL;
int blockInts;
bool needReschedule;
/* Setup default thread stack size - this can be overwritten if required */
int threadStackSize = THREADSTACKSIZE;
+/* Pointer to the stack of the last killed thread. The free is delayed. */
+void *stack_to_be_freed = 0;
+
static thread* startDaemon(void* func, char* nm, int stackSize);
/*
result;
unsigned long pageBegin;
- CONTEXT(tid).stackMem = malloc(size + 2 * pageSize);
+ assert(stack_to_be_freed == 0);
+
+ CONTEXT(tid).stackMem = malloc(size + 4 * pageSize);
assert(CONTEXT(tid).stackMem != 0);
CONTEXT(tid).stackEnd = CONTEXT(tid).stackMem + size + 2 * pageSize;
}
/*
- * Free the stack for a thread
+ * Mark the stack for a thread to be freed. We cannot free the stack
+ * immediately because it is still in use!
*/
void
freeThreadStack (thread *tid)
pageBegin = (unsigned long)(CONTEXT(tid).stackMem) + pageSize - 1;
pageBegin = pageBegin - pageBegin % pageSize;
-
+
result = mprotect((void*)pageBegin, pageSize,
PROT_READ | PROT_WRITE | PROT_EXEC);
assert(result == 0);
- free(CONTEXT(tid).stackMem);
+ assert(stack_to_be_freed == 0);
+
+ stack_to_be_freed = CONTEXT(tid).stackMem;
}
CONTEXT(tid).stackMem = 0;
CONTEXT(tid).stackBase = 0;
thread *the_main_thread;
int i;
+ signal(SIGPIPE, SIG_IGN);
+
initLocks();
for (i = 0; i < MAXTHREADS; ++i) {
the_main_thread->daemon = 0;
the_main_thread->stillborn = 0;
the_main_thread->target = 0;
- the_main_thread->interruptRequested = 0;
- the_main_thread->group =
- (threadGroup*)builtin_new(loader_load(utf_new_char("java/lang/ThreadGroup")));
- /* we should call the constructor */
+
+ the_main_thread->contextClassLoader = 0;
+ the_main_thread->inheritedAccessControlContext = 0;
+ the_main_thread->values = 0;
+
+ /* Allocate and init ThreadGroup */
+ the_main_thread->group = (threadGroup*)native_new_and_init(loader_load(utf_new_char("java/lang/ThreadGroup")));
assert(the_main_thread->group != 0);
talive++;
if (i == MAXTHREADS)
panic("Too many threads");
+ assert(tid->priority >= MIN_THREAD_PRIO && tid->priority <= MAX_THREAD_PRIO);
+
tid->PrivateInfo = i + 1;
CONTEXT(tid).free = false;
CONTEXT(tid).thread = tid;
tid->daemon = 1;
tid->stillborn = 0;
tid->target = 0;
- tid->interruptRequested = 0;
tid->group = 0;
/* Construct the initial restore point. */
* (which is set by suspendThread(.))
*/
void
-resumeThread(thread* tid)
+resumeThread (thread* tid)
{
if ((CONTEXT(tid).flags & THREAD_FLAGS_USER_SUSPEND) != 0)
{
{
thread** ntid;
+ assert(prio >= MIN_THREAD_PRIO && prio <= MAX_THREAD_PRIO);
+
if (tid->PrivateInfo == 0) {
tid->priority = prio;
return;
intsRestore();
}
+/*
+ * Get the current time in milliseconds since 1970-01-01.
+ */
+s8
+currentTime (void)
+{
+ struct timeval tv;
+ s8 time;
+
+ gettimeofday(&tv, 0);
+
+ time = tv.tv_sec;
+ time *= 1000;
+ time += tv.tv_usec / 1000;
+
+ return time;
+}
+
+/*
+ * Put a thread to sleep.
+ */
+void
+sleepThread (s8 time)
+{
+ thread** tidp;
+
+ /* Sleep for no time */
+ if (time <= 0) {
+ return;
+ }
+
+ intsDisable();
+
+ /* Get absolute time */
+ CONTEXT(currentThread).time = time + currentTime();
+
+ /* Find place in alarm list */
+ for (tidp = &sleepThreads; (*tidp) != 0; tidp = &(*tidp)->next)
+ {
+ if (CONTEXT(*tidp).time > CONTEXT(currentThread).time)
+ break;
+ }
+
+ /* Suspend thread on it */
+ suspendOnQThread(currentThread, tidp);
+
+ intsRestore();
+}
+
/*
* Is this thread alive?
*/
exceptionptr = CONTEXT(currentThread).exceptionptr;
+ if (stack_to_be_freed != 0)
+ {
+ free(stack_to_be_freed);
+ stack_to_be_freed = 0;
+ }
+
/* Alarm signal may be blocked - if so
* unblock it.
*/
s4 maxPrio;
s4 destroyed;
s4 daemon;
+ s4 vmAllowSuspension;
s4 nthreads;
java_objectheader* threads;
s4 ngroups;
s4 priority;
struct _thread* next;
s8 PrivateInfo;
- struct java_lang_Object* eetop; /* ??? */
s4 single_step;
s4 daemon;
s4 stillborn;
java_objectheader* target;
- s4 interruptRequested;
threadGroup* group;
+ java_objectheader* contextClassLoader;
+ java_objectheader* inheritedAccessControlContext;
+ java_objectheader* values;
} thread;
-void initThreads(u1 *stackbottom);
-void clear_thread_flags(void);
-void startThread(thread*);
-void resumeThread(thread*);
-void iresumeThread(thread*);
-void suspendThread(thread*);
-void suspendOnQThread(thread*, thread**);
-void yieldThread(void);
-void killThread(thread*);
-void setPriorityThread(thread*, int);
+void initThreads (u1 *stackbottom);
+void clear_thread_flags (void);
+void startThread (thread*);
+void resumeThread (thread*);
+void iresumeThread (thread*);
+void suspendThread (thread*);
+void suspendOnQThread (thread*, thread**);
+void yieldThread (void);
+void killThread (thread*);
+void setPriorityThread (thread*, int);
-void sleepThread(s8);
-bool aliveThread(thread*);
-long framesThread(thread*);
+s8 currentTime (void);
+void sleepThread (s8);
+bool aliveThread (thread*);
+long framesThread (thread*);
-void reschedule(void);
+void reschedule (void);
-void checkEvents(bool block);
+void checkEvents (bool block);
extern int blockInts;
extern bool needReschedule;
extern int threadStackSize;
extern thread *liveThreads;
+extern thread *sleepThreads;
extern thread *threadQhead[MAX_THREAD_PRIO + 1];
return (sub->vftbl->interfacetablelength > super->index) &&
(sub->vftbl->interfacetable[-super->index] != NULL);
+ /*
while (sub != 0)
if (sub == super)
return 1;
else
sub = sub->super;
-
+
return 0;
+ */
- /*
return (unsigned) (sub->vftbl->baseval - super->vftbl->baseval) <=
(unsigned) (super->vftbl->diffval);
- */
}
s4 builtin_checkcast(java_objectheader *obj, classinfo *class)
{
- #ifdef DEBUG
+#ifdef DEBUG
log_text ("builtin_checkcast called");
- #endif
+#endif
if (obj == NULL)
return 1;
if (builtin_isanysubclass (obj->vftbl->class, class))
return 1;
- #if DEBUG
+ /* #if DEBUG */
printf ("#### checkcast failed ");
utf_display (obj->vftbl->class->name);
printf (" -> ");
utf_display (class->name);
printf ("\n");
- #endif
+ /* #endif */
return 0;
}
if (!o) return 1;
if (o->vftbl->class != class_array) {
+#ifdef DEBUG
+ printf ("#### checkarraycast failed 1\n");
+#endif
return 0;
}
if (a->arraytype != desc->arraytype) {
+#ifdef DEBUG
+ printf ("#### checkarraycast failed 2\n");
+#endif
return 0;
}
switch (a->arraytype) {
case ARRAYTYPE_OBJECT: {
java_objectarray *oa = (java_objectarray*) o;
- return builtin_isanysubclass (oa->elementtype, desc->objectclass);
+ int result = builtin_isanysubclass (oa->elementtype, desc->objectclass);
+
+#ifdef DEBUG
+ if (!result)
+ printf ("#### checkarraycast failed 3\n");
+#endif
+ return result;
}
case ARRAYTYPE_ARRAY: {
java_arrayarray *aa = (java_arrayarray*) o;
- return builtin_descriptorscompatible
- (aa->elementdescriptor, desc->elementdescriptor);
+ int result = builtin_descriptorscompatible
+ (aa->elementdescriptor, desc->elementdescriptor);
+
+#ifdef DEBUG
+ if (!result)
+ printf ("#### checkarraycast failed 4\n");
+#endif
+ return result;
}
default:
return 1;
{
java_objectheader *o;
+ class_init(c);
+
#ifdef SIZE_FROM_CLASSINFO
c->alignedsize = align_size(c->instancesize);
o = heap_allocate ( c->alignedsize, true, c->finalizer );
Author: Andreas Krall EMAIL: cacao@complang.tuwien.ac.at
- Last Change: $Id: parse.c 135 1999-10-04 10:35:09Z roman $
+ Last Change: $Id: parse.c 136 1999-11-09 11:33:46Z schani $
*******************************************************************************/
BUILTIN2((functionptr) asm_builtin_checkarraycast, TYPE_ADR);
}
else { /* object type cast-check */
+ /*
+ LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
+ BUILTIN2((functionptr) asm_builtin_checkcast, TYPE_ADR);
+ */
OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
}
break;
BUILTIN2((functionptr) builtin_arrayinstanceof, TYPE_INT);
}
else { /* object type cast-check */
- OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
+ /*
+ LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
+ BUILTIN2((functionptr) builtin_instanceof, TYPE_INT);
+ */
+ OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
}
break;
}
sprintf (logtext,"Can not open class file '%s'", filename);
- error();
+ dolog();
return false;
}
/******************* Funktionen fuer den Class-loader generell ****************/
/******************************************************************************/
+static int loader_inited = 0;
/********************* Funktion: loader_load ***********************************
loadingtime += (stoptime-starttime);
}
+ if (loader_inited)
+ loader_compute_subclasses();
+
intsRestore(); /* schani */
return top;
proto_java_lang_ThreadDeath = /* schani */
builtin_new(class_java_lang_ThreadDeath);
heap_addreference ( (void**) &proto_java_lang_ThreadDeath);
+
+ loader_inited = 1;
}
intsRestore(); /* schani */
}
-static s4 classvalue = 0;
+static s4 classvalue;
static void loader_compute_class_values (classinfo *c)
{
intsDisable(); /* schani */
+ c = list_first (&linkedclasses);
+ while (c) {
+ if (!(c->flags & ACC_INTERFACE)) {
+ c->nextsub = 0;
+ c->sub = 0;
+ }
+ c = list_next (&linkedclasses, c);
+ }
+
c = list_first (&linkedclasses);
while (c) {
if (!(c->flags & ACC_INTERFACE) && (c->super != NULL)) {
c = list_next (&linkedclasses, c);
}
+ classvalue = 0;
loader_compute_class_values(class_java_lang_Object);
intsRestore(); /* schani */
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
-all: Makefile
-
+TAR = gtar
+GZIP_ENV = --best
+all: all-redirect
.SUFFIXES:
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu tst/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu tst/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-generic
+mostlyclean-am: mostlyclean-generic
-clean: clean-generic mostlyclean
+mostlyclean: mostlyclean-am
-distclean: distclean-generic clean
- -rm -f config.status
+clean-am: clean-generic mostlyclean-am
-maintainer-clean: maintainer-clean-generic distclean
+clean: clean-am
+
+distclean-am: distclean-generic clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-generic distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-.PHONY: tags distdir info dvi installcheck install-exec install-data \
-install uninstall all installdirs mostlyclean-generic distclean-generic \
-clean-generic maintainer-clean-generic clean mostlyclean distclean \
-maintainer-clean
+maintainer-clean: maintainer-clean-am
+
+.PHONY: tags distdir info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
check:
--- /dev/null
+import java.net.*;
+import java.io.*;
+
+public class DemoClient extends Thread
+{
+ public static void main(String[] args)
+ {
+ DemoClient app = new DemoClient();
+ app.start();
+ }
+
+ public void run()
+ {
+ Socket newSocket;
+
+ try {
+ newSocket = new Socket("localhost", 5758);
+ System.out.println("Client connected to server.");
+ DataOutputStream outStream = new DataOutputStream(
+ newSocket.getOutputStream());
+ outStream.writeInt(12345);
+ System.exit(0);
+ } catch (Exception oops) {
+ System.out.println("Error connecting to server");
+ return;
+ }
+ }
+}
--- /dev/null
+import java.net.*;
+import java.io.*;
+
+public class DemoServer extends Thread
+{
+ ServerSocket listenSock;
+
+ public static void main(String[] args)
+ {
+ DemoServer app = new DemoServer();
+ app.start();
+ }
+
+ public DemoServer()
+ {
+ }
+
+ public void run()
+ {
+ Socket newSocket;
+
+ try {
+ listenSock = new ServerSocket(5758);
+ System.out.println(listenSock.toString());
+ } catch (Exception hell) {
+ System.out.println("Error setting up listen socket:\n");
+ System.out.println(hell);
+ return;
+ }
+
+ while (true)
+ {
+ try {
+ System.out.println("Trying accept");
+ newSocket = listenSock.accept();
+ System.out.println("Accept returned");
+ } catch (Exception badAccept) {
+ continue;
+ }
+ System.out.println("Accepted new client");
+
+ try {
+ DataInputStream inStream = new DataInputStream(
+ newSocket.getInputStream());
+ System.out.println("Client send "+inStream.readInt());
+ newSocket.close();
+ } catch (Exception oops) {
+ System.out.println("Error reading from client");
+ System.out.println(oops);
+ }
+ }
+ }
+}
--- /dev/null
+This is a test file.
--- /dev/null
+// File: GenericServer.java
+// Author: Thomas Lea (leat@goodnet.com, http://www.goodnet.com/~leat)
+// Date: 12/7/95
+// Version: 1.0 (for Beta JDK API)
+//
+// Copyright (c) 1995 Thomas Lea. All Rights Reserved.
+//
+
+
+// Please feel free to take this program and modify it to your hearts content.
+// The only thing I ask is that my name and the above version/copyright
+// information stay at the top of this module.
+
+import java.net.*;
+import java.io.*;
+import java.util.Vector;
+
+class GenericServer
+{
+ private static final int DEFAULT_PORT=8887;
+ private ConnectionManager cm = null;
+
+ public GenericServer(int port)
+ {
+ System.out.println("Server is initializing to port " + port);
+
+ cm = new ConnectionManager(port);
+ cm.start();
+ }
+
+ public static void main(String args[])
+ {
+ int server_port;
+
+ try
+ {
+ server_port = Integer.parseInt(args[0],10);
+ }
+ catch(Exception e)
+ {
+ System.out.println("Defaulting to port " + DEFAULT_PORT);
+ server_port = DEFAULT_PORT;
+ }
+ new GenericServer(server_port);
+ }
+}
+
+// Waits for a connection then spawns a ServerConnection to deal with it
+class ConnectionManager extends Thread
+{
+ private static int _port;
+ private static Vector _my_threads = new Vector(5,2);
+ //size of 5 initially, grow by 2
+ private ServerSocket _main_socket = null;
+
+ public ConnectionManager(int port)
+ {
+ _port = port;
+ }
+
+ public void run()
+ {
+ serveRequests();
+ }
+
+ private void serveRequests()
+ {
+ try {_main_socket = new ServerSocket(_port);}
+ catch(Exception e) { System.err.println(e); System.exit(1);}
+
+ ServerConnection temp_sc = null;
+
+ while (true)
+ {
+ try
+ {
+ Socket this_connection = _main_socket.accept();
+
+ temp_sc = new ServerConnection(this_connection);
+ temp_sc.start();
+ _my_threads.addElement(temp_sc);
+
+ //clean up the vector if needed
+ for(int i=0;i<ConnectionManager._my_threads.size();i++)
+ if(!((ServerConnection)(_my_threads.elementAt(i))).isAlive())
+ _my_threads.removeElementAt(i);
+ }
+ catch(Exception e)
+ {
+ System.err.println("Exception:\n" + e);
+ }
+ }
+ }
+}
+
+class ServerConnection extends Thread
+{
+ private Socket _mysocket;
+ private PrintStream _output;
+ private InputStream _input;
+ FileInputStream _dis;
+
+ public ServerConnection(Socket s)
+ {
+ _mysocket = s;
+ }
+
+ private void doServerWork()
+ {
+ //This is where the server actually does its work.
+ //when this method finishes, the socket will be closed
+ //and this thread will exit.
+
+ //This is just some junk... put your real work here.
+ try
+ {
+ byte b[] = new byte[1024];
+ int nbytes = _input.read(b,0,1024);
+ String str = new String(b,0,0,nbytes);
+
+ _dis = new FileInputStream("FILE.HTM");
+ StringBuffer buf = new StringBuffer(4096);
+
+ System.out.println("Received for server: " + str);
+
+ nbytes = _dis.available();
+ _output.println("HTTP/1.0 200 OK");
+ _output.println("MIME-Version: 1.0");
+ _output.println("Date: 22Dec95");
+ _output.println("Server: Java_Server_0.01");
+ _output.println("Content-type: text/html");
+// _output.println("Content-Length: 76");
+ _output.println("");
+// _output.println("<HEAD><TITLE>Clock 2.0 Title</TITLE></HEAD><BODY>");
+// _output.println("<H1>Clock 2.0</H1>");
+ b = new byte[nbytes];
+ _dis.read(b, 0, nbytes);
+ str = new String(b, 0, 0, nbytes);
+ _output.println(str);
+// _output.println("</BODY>");
+ _output.println("");
+// for(int i=0;i<10;i++)
+// {
+// _output.println("This is a message from the server");
+// sleep((int)(Math.random() * 4000));
+// }
+ }
+ catch(Exception e)
+ {
+ }
+ }
+
+ public void run()
+ {
+ System.out.println("Connected to: " +
+ _mysocket.getInetAddress() +":"+ _mysocket.getPort());
+ try
+ {
+ _output = new PrintStream(_mysocket.getOutputStream());
+ _input = _mysocket.getInputStream();
+
+ //Lets get busy!
+ doServerWork();
+
+ //We are outta here....
+ _mysocket.close();
+ }
+ catch ( Exception e )
+ {
+ System.err.println( "Exception:\n" + e );
+ }
+
+ System.out.println("Disconnecting: " + _mysocket.toString());
+ stop();
+ }
+}
--- /dev/null
+import java.security.AccessController;
+import sun.security.action.*;
+import java.io.File;
+
+public class classloader {
+ private static String[] initializePath(String propname) {
+ String ldpath = System.getProperty(propname, "");
+ String ps = File.pathSeparator;
+ int ldlen = ldpath.length();
+ int i, j, n;
+ // Count the separators in the path
+ i = ldpath.indexOf(ps);
+ n = 0;
+ while (i >= 0) {
+ n++;
+ i = ldpath.indexOf(ps, i+1);
+ }
+
+ // allocate the array of paths - n :'s = n + 1 path elements
+ String[] paths = new String[n + 1];
+
+ // Fill the array with paths from the ldpath
+ n = i = 0;
+ j = ldpath.indexOf(ps);
+ while (j >= 0) {
+ if (j - i > 0) {
+ paths[n++] = ldpath.substring(i, j);
+ } else if (j - i == 0) {
+ paths[n++] = ".";
+ }
+ i = j + 1;
+ j = ldpath.indexOf(ps, i);
+ }
+ paths[n] = ldpath.substring(i, ldlen);
+ return paths;
+ }
+
+ public static void main (String args[]) {
+ /*
+ String dirs[] = initializePath("sun.boot.library.path");
+
+ System.out.println("length: " + dirs.length);
+ for (int i = 0; i < dirs.length; ++i) {
+ System.out.println(dirs[i]);
+ }
+ */
+ AccessController.doPrivileged(new LoadLibraryAction("net"));
+ }
+}
--- /dev/null
+import java.net.*;
+import java.io.*;
+
+class ServerThread extends Thread
+{
+ httpd server;
+
+ ServerThread (httpd the_server)
+ {
+ server = the_server;
+ }
+
+ synchronized void wait_till_finished ()
+ {
+ try
+ {
+ wait();
+ }
+ catch (Exception exc)
+ {
+ System.out.println("Exception " + exc + " in wait");
+ }
+ }
+
+ boolean is_info_line (String str)
+ {
+ return str.startsWith("User-Agent: ") || str.startsWith("Host: ")
+ || str.startsWith("Accept: ");
+ }
+
+ static void write_string (OutputStream os, String str) throws IOException
+ {
+ byte buf[] = new byte[str.length()];
+
+ str.getBytes(0, str.length(), buf, 0);
+ os.write(buf);
+ }
+
+ synchronized void handle_request (Socket socket)
+ {
+ System.out.println("begin handle_request");
+
+ try
+ {
+ InputStream is = socket.getInputStream();
+ DataInputStream dis = new DataInputStream(is);
+ String request;
+
+ request = dis.readLine();
+ if (request.startsWith("GET "))
+ {
+ String doc = request.substring(4);
+
+ System.out.println("request: " + doc);
+
+ boolean is_10 = false;
+
+ if (doc.endsWith(" HTTP/1.0"))
+ {
+ is_10 = true;
+
+ String info;
+
+ do
+ {
+ info = dis.readLine();
+ } while (is_info_line(info));
+
+ doc = doc.substring(0, doc.length() - 9);
+ }
+
+ String filename = httpd.document_root + doc;
+ File file = new File(filename);
+
+ if (file.isDirectory())
+ file = new File(filename + "/index.html");
+ if (file.exists() && file.isFile() && file.canRead())
+ {
+ OutputStream os = socket.getOutputStream();
+
+ System.out.println("kurde 1");
+
+ FileInputStream fis = new FileInputStream(file);
+
+ System.out.println("kurde 2");
+ System.out.println("kurde 2a");
+
+ byte buffer[] = new byte[8192];
+ byte heusl[] = new byte[8192];
+
+ System.out.println("kurde 3");
+
+ if (is_10)
+ write_string(os,
+ "HTTP/1.0 200 OK\n"
+ //+ "Content-Length: " + file.length() + "\n"
+ + "Content-Type: text/html\n"
+ + "Server: Schani's Kurden-Server\n"
+ + "\n");
+
+ System.out.println("begin copy");
+
+ int result;
+
+ do
+ {
+ result = fis.read(buffer);
+ if (result > 0)
+ os.write(buffer, 0, result);
+ } while (result != -1);
+ System.out.println("end copy");
+
+ fis.close();
+ }
+ else if (is_10)
+ write_string(socket.getOutputStream(),
+ "HTTP/1.0 404 Not Found\n"
+ + "\n");
+ }
+ else
+ System.out.println("malformed request: " + request);
+ }
+ catch (Exception exc)
+ {
+ System.out.println("Exception " + exc + " in thread");
+ }
+
+ try
+ {
+ InputStream is = socket.getInputStream();
+ int len;
+
+ while ((len = is.available()) > 0)
+ {
+ for (int i = 0; i < len; ++i)
+ is.read();
+ }
+
+ socket.close();
+ }
+ catch (Exception exc)
+ {
+ System.out.println("Exception " + exc + " in close");
+ }
+
+ server.thread_ready(this);
+ notify();
+
+ System.out.println("end handle_request");
+ }
+}
+
+public class httpd
+{
+
+ static String document_root = "/nethome/hansolo/schani/public_html";
+ static int num_threads = 10;
+
+ ServerThread threads[] = null;
+ boolean threads_ready[] = null;
+
+ void run ()
+ {
+ threads = new ServerThread[num_threads];
+ threads_ready = new boolean[num_threads];
+
+ for (int i = 0; i < num_threads; ++i)
+ {
+ threads[i] = new ServerThread(this);
+ threads_ready[i] = true;
+ }
+
+ try
+ {
+ ServerSocket ss = new ServerSocket(8001, 5);
+
+ while (true)
+ {
+ Socket socket = ss.accept();
+ ServerThread thread = get_ready_thread();
+
+ thread.handle_request(socket);
+ }
+ }
+ catch (Exception exc)
+ {
+ System.out.println("Exception " + exc);
+ }
+ }
+
+ public static void main (String args[])
+ {
+ new httpd().run();
+ }
+
+ synchronized void thread_ready (ServerThread thread)
+ {
+ for (int i = 0; i < num_threads; ++i)
+ if (threads[i] == thread)
+ {
+ threads_ready[i] = true;
+ break;
+ }
+ }
+
+ ServerThread get_ready_thread ()
+ {
+ for (int i = 0; i < num_threads; ++i)
+ if (threads_ready[i])
+ {
+ threads_ready[i] = false;
+ return threads[i];
+ }
+
+ threads[0].wait_till_finished();
+ threads_ready[0] = false;
+ return threads[0];
+ }
+}
--- /dev/null
+import java.lang.*;
+import java.net.*;
+import java.io.*;
+class socktest {
+ public static void main(String argv[]) {
+ try {
+ ServerSocket ss = new ServerSocket(0);
+ Socket s = new Socket("quinta", 23);
+ InetAddress a1 = InetAddress.getByName("quinta");
+ InetAddress a2 = InetAddress.getLocalHost();
+
+ System.out.println(ss);
+ System.out.println(s);
+ System.out.println(a1);
+ System.out.println(a2);
+ } catch (IOException e) {
+ System.out.println("error: "+e);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
+ * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+ * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ */
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+public class QuoteClient {
+ public static void main(String[] args) throws IOException {
+
+ if (args.length != 1) {
+ System.out.println("Usage: java QuoteClient <hostname>");
+ return;
+ }
+
+ // get a datagram socket
+ DatagramSocket socket = new DatagramSocket();
+
+ // send request
+ byte[] buf = new byte[256];
+ InetAddress address = InetAddress.getByName(args[0]);
+ DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 4445);
+ socket.send(packet);
+
+ // get response
+ packet = new DatagramPacket(buf, buf.length);
+ socket.receive(packet);
+
+ // display response
+ String received = new String(packet.getData(), 0);
+ System.out.println("Quote of the Moment: " + received);
+
+ socket.close();
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
+ * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+ * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ */
+public class QuoteServer {
+ public static void main(String[] args) throws java.io.IOException {
+ QuoteServerThread thread = new QuoteServerThread();
+
+ thread.start();
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
+ * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+ * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+ */
+import java.io.*;
+import java.net.*;
+import java.util.*;
+
+public class QuoteServerThread extends Thread {
+
+ protected DatagramSocket socket = null;
+ protected BufferedReader in = null;
+ protected boolean moreQuotes = true;
+
+ public QuoteServerThread() throws IOException {
+ this("QuoteServerThread");
+ }
+
+ public QuoteServerThread(String name) throws IOException {
+ super(name);
+
+ try {
+ socket = new DatagramSocket(4445);
+ } catch (Exception exc) {
+ System.err.println("Could not create socket: " + exc);
+ }
+
+ try {
+ in = new BufferedReader(new FileReader("one-liners.txt"));
+ } catch (FileNotFoundException e) {
+ System.err.println("Could not open quote file. Serving time instead.");
+ }
+ }
+
+ public void run() {
+
+ while (moreQuotes) {
+ try {
+ byte[] buf = new byte[256];
+
+ // receive request
+ DatagramPacket packet = new DatagramPacket(buf, buf.length);
+ socket.receive(packet);
+
+ // figure out response
+ String dString = null;
+ if (in == null)
+ dString = new Date().toString();
+ else
+ dString = getNextQuote();
+ buf = dString.getBytes();
+
+ // send the response to the client at "address" and "port"
+ InetAddress address = packet.getAddress();
+ int port = packet.getPort();
+ packet = new DatagramPacket(buf, buf.length, address, port);
+ socket.send(packet);
+ } catch (IOException e) {
+ e.printStackTrace();
+ moreQuotes = false;
+ }
+ }
+ socket.close();
+ }
+
+ protected String getNextQuote() {
+ String returnValue = null;
+ try {
+ if ((returnValue = in.readLine()) == null) {
+ in.close();
+ moreQuotes = false;
+ returnValue = "No more quotes. Goodbye.";
+ }
+ } catch (IOException e) {
+ returnValue = "IOException occurred in server.";
+ }
+ return returnValue;
+ }
+}
--- /dev/null
+Life is wonderful. Without it we'd all be dead.
+Daddy, why doesn't this magnet pick up this floppy disk?
+Give me ambiguity or give me something else.
+I.R.S.: We've got what it takes to take what you've got!
+We are born naked, wet and hungry. Then things get worse.
+Make it idiot proof and someone will make a better idiot.
+He who laughs last thinks slowest!
+Always remember you're unique, just like everyone else.
+"More hay, Trigger?" "No thanks, Roy, I'm stuffed!"
+A flashlight is a case for holding dead batteries.
+Lottery: A tax on people who are bad at math.
+Error, no keyboard - press F1 to continue.
+There's too much blood in my caffeine system.
+Artificial Intelligence usually beats real stupidity.
+Hard work has a future payoff. Laziness pays off now.
+"Very funny, Scotty. Now beam down my clothes."
+Puritanism: The haunting fear that someone, somewhere may be happy.
+Consciousness: that annoying time between naps.
+Don't take life too seriously, you won't get out alive.
+I don't suffer from insanity. I enjoy every minute of it.
+Better to understand a little than to misunderstand a lot.
+The gene pool could use a little chlorine.
+When there's a will, I want to be in it.
+Okay, who put a "stop payment" on my reality check?
+We have enough youth, how about a fountain of SMART?
+Programming is an art form that fights back.
+"Daddy, what does FORMATTING DRIVE C mean?"
+All wiyht. Rho sritched mg kegtops awound?
+My mail reader can beat up your mail reader.
+Never forget: 2 + 2 = 5 for extremely large values of 2.
+Nobody has ever, ever, EVER learned all of WordPerfect.
+To define recursion, we must first define recursion.
+Good programming is 99% sweat and 1% coffee.
--- /dev/null
+import java.net.*;
+
+public class urltest {
+ public static void main (String args[])
+ {
+ String classes[] =
+ {
+ "w3c.jigsaw.http.httpd",
+ "sun.net.www.protocol.http.Handler",
+ "w3c.tools.store.AttributeHolder",
+ "w3c.tools.store.ResourceStoreState",
+ "w3c.tools.store.Resource",
+ "w3c.jigsaw.formedit.GenericResourceEditor",
+ "w3c.tools.store.BooleanAttribute",
+ "w3c.jigsaw.forms.BooleanField",
+ "w3c.jigsaw.auth.PasswordAttribute",
+ "w3c.jigsaw.auth.PasswordField",
+ "w3c.www.http.HttpCacheControl",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpCaseTokenList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpInteger",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpContentRange",
+ "w3c.www.http.HttpMimeType",
+ "w3c.www.http.HttpEntityTag",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpInteger",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpChallenge",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpWarningList",
+ "w3c.www.http.HttpChallenge",
+ "w3c.tools.store.Resource",
+ "java.lang.Object",
+ "w3c.tools.store.ResourceStore",
+ "w3c.jigsaw.auth.AuthRealm",
+ "w3c.jigsaw.http.httpd",
+ "w3c.jigsaw.resources.ResourceFilter",
+ "w3c.jigsaw.resources.FilteredResource",
+ "w3c.jigsaw.auth.AuthUser",
+ "w3c.jigsaw.auth.AuthFilter",
+ "w3c.jigsaw.resources.HTTPResource",
+ "w3c.tools.store.Resource",
+ "w3c.jigsaw.http.httpd",
+ "w3c.jigsaw.config.PropertySet",
+ "w3c.www.http.HttpAcceptList",
+ "w3c.www.http.HttpAcceptCharsetList",
+ "w3c.www.http.HttpTokenList",
+ "w3c.www.http.HttpAcceptLanguageList",
+ "w3c.www.http.HttpCredential",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpEntityTagList",
+ "w3c.www.http.HttpEntityTagList",
+ "w3c.www.http.HttpDate",
+ "w3c.www.http.HttpInteger",
+ "w3c.www.http.HttpCredential",
+ "w3c.www.http.HttpRangeList",
+ "w3c.www.http.HttpString",
+ "w3c.www.http.HttpString",
+ "w3c.jigsaw.http.GeneralProp",
+ "w3c.jigsaw.http.LoggingProp",
+ "w3c.jigsaw.indexer.Directory",
+ "w3c.jigsaw.resources.NegotiatedResource"
+ };
+
+ try
+ {
+ Object handler;
+
+ for (int i = 0; i < classes.length; ++i)
+ Class.forName(classes[i]).newInstance();
+
+ URL url = new URL("http://www.schani.net/");
+
+ System.out.println("url " + url.toString());
+
+ handler = Class.forName("sun.net.www.protocol.http.Handler").newInstance();
+
+ URLStreamHandler h;
+
+ System.out.println("before");
+ h = (java.net.URLStreamHandler)handler;
+ System.out.println("after");
+
+ handler = Class.forName("sun.net.www.protocol.http.Handler").newInstance();
+
+ System.out.println("before");
+ h = (java.net.URLStreamHandler)handler;
+ System.out.println("after");
+ }
+ catch (Exception exc)
+ {
+ }
+ }
+}
--- /dev/null
+import java.io.*;
+import java.net.*;
+
+class whatip2 {
+ static void output (InetAddress addr) {
+ if (addr == null) {
+ System.out.println("address is null");
+ } else {
+ System.out.println("inet address is " + addr.toString() );
+ }
+ }
+
+ public static void main(String a[]) throws IOException {
+ try {
+ System.out.println("hostname is " + a[0] );
+
+ output(InetAddress.getByName (a[0]));
+
+ output(InetAddress.getLocalHost());
+ }
+ catch (Throwable t) {
+ System.out.println("Catched error " + t.toString() );
+ }
+ }
+}
--- /dev/null
+import java.util.*;
+
+public class sleep extends Thread {
+
+ public sleep (String name) {
+ super(name);
+ }
+
+ public void run() {
+ Random random = new Random();
+
+ try {
+ for (int i = 0; i < 10; ++i) {
+ System.out.println(getName());
+ sleep((long)(random.nextFloat() * 1000));
+ }
+ } catch (Exception exc) {
+ System.out.println("Exception: " + exc);
+ }
+ }
+
+ public static void main (String args[]) {
+ sleep t1 = new sleep("a");
+ sleep t2 = new sleep("b");
+
+ t1.start();
+ t2.start();
+ }
+}
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
noinst_LIBRARIES = @LIBTHREAD@
EXTRA_LIBRARIES = libthreads.a
-libthreads_a_SOURCES = locks.c locks.h \
- thread.c thread.h \
- threadio.c threadio.h
+libthreads_a_SOURCES = locks.c locks.h thread.c thread.h threadio.c threadio.h
-INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
+
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
libthreads_a_OBJECTS = locks.o thread.o threadio.o
AR = ar
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
+TAR = gtar
+GZIP_ENV = --best
DEP_FILES = .deps/locks.P .deps/thread.P .deps/threadio.P
SOURCES = $(libthreads_a_SOURCES)
OBJECTS = $(libthreads_a_OBJECTS)
-all: Makefile $(LIBRARIES)
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu threads/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu threads/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
clean-depend:
distclean-depend:
+ -rm -rf .deps
maintainer-clean-depend:
- -rm -rf .deps
%.o: %.c
@echo '$(COMPILE) -c $<'; \
- $(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
- $(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
- @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
- < .deps/$(*F).p > .deps/$(*F).P
- @-rm -f .deps/$(*F).p
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile $(LIBRARIES)
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
-clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
- clean-generic mostlyclean
+mostlyclean: mostlyclean-am
+
+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
-distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
- distclean-depend distclean-generic clean
- -rm -f config.status
+clean: clean-am
-maintainer-clean: maintainer-clean-noinstLIBRARIES \
+distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
- distclean
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+maintainer-clean: maintainer-clean-am
+
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend info dvi \
-installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
/* ------------------------ thread.c -------------------------- */
-/*
- * Put a thread to sleep.
- */
-void
-sleepThread(int64 time)
-{
- thread** tidp;
-
- /* Sleep for no time */
- if (time == 0) {
- return;
- }
-
- intsDisable();
-
- /* Get absolute time */
- currentThread->PrivateInfo->time = time + currentTime();
-
- /* Find place in alarm list */
- for (tidp = &alarmList; (*tidp) != 0; tidp = &(*tidp)->next) {
- if ((*tidp)->PrivateInfo->time > currentThread->PrivateInfo->time) {
- break;
- }
- }
-
- /* If I'm head of alarm list, restart alarm */
- if (tidp == &alarmList) {
- MALARM(time);
- }
-
- /* Suspend thread on it */
- suspendOnQThread(currentThread, tidp);
-
- intsRestore();
-}
-
/*
* Handle alarm.
* This routine uses a different meaning of "blockInts". Formerly, it was just
#include <sys/types.h>
#include <sys/mman.h> /* for mprotect */
#include <unistd.h>
+#include <signal.h>
+#include <sys/time.h>
#include "thread.h"
#include "locks.h"
thread* threadQtail[MAX_THREAD_PRIO + 1];
thread* liveThreads = NULL;
-thread* alarmList;
+thread* sleepThreads = NULL;
int blockInts;
bool needReschedule;
/* Setup default thread stack size - this can be overwritten if required */
int threadStackSize = THREADSTACKSIZE;
+/* Pointer to the stack of the last killed thread. The free is delayed. */
+void *stack_to_be_freed = 0;
+
static thread* startDaemon(void* func, char* nm, int stackSize);
/*
result;
unsigned long pageBegin;
- CONTEXT(tid).stackMem = malloc(size + 2 * pageSize);
+ assert(stack_to_be_freed == 0);
+
+ CONTEXT(tid).stackMem = malloc(size + 4 * pageSize);
assert(CONTEXT(tid).stackMem != 0);
CONTEXT(tid).stackEnd = CONTEXT(tid).stackMem + size + 2 * pageSize;
}
/*
- * Free the stack for a thread
+ * Mark the stack for a thread to be freed. We cannot free the stack
+ * immediately because it is still in use!
*/
void
freeThreadStack (thread *tid)
pageBegin = (unsigned long)(CONTEXT(tid).stackMem) + pageSize - 1;
pageBegin = pageBegin - pageBegin % pageSize;
-
+
result = mprotect((void*)pageBegin, pageSize,
PROT_READ | PROT_WRITE | PROT_EXEC);
assert(result == 0);
- free(CONTEXT(tid).stackMem);
+ assert(stack_to_be_freed == 0);
+
+ stack_to_be_freed = CONTEXT(tid).stackMem;
}
CONTEXT(tid).stackMem = 0;
CONTEXT(tid).stackBase = 0;
thread *the_main_thread;
int i;
+ signal(SIGPIPE, SIG_IGN);
+
initLocks();
for (i = 0; i < MAXTHREADS; ++i) {
the_main_thread->daemon = 0;
the_main_thread->stillborn = 0;
the_main_thread->target = 0;
- the_main_thread->interruptRequested = 0;
- the_main_thread->group =
- (threadGroup*)builtin_new(loader_load(utf_new_char("java/lang/ThreadGroup")));
- /* we should call the constructor */
+
+ the_main_thread->contextClassLoader = 0;
+ the_main_thread->inheritedAccessControlContext = 0;
+ the_main_thread->values = 0;
+
+ /* Allocate and init ThreadGroup */
+ the_main_thread->group = (threadGroup*)native_new_and_init(loader_load(utf_new_char("java/lang/ThreadGroup")));
assert(the_main_thread->group != 0);
talive++;
if (i == MAXTHREADS)
panic("Too many threads");
+ assert(tid->priority >= MIN_THREAD_PRIO && tid->priority <= MAX_THREAD_PRIO);
+
tid->PrivateInfo = i + 1;
CONTEXT(tid).free = false;
CONTEXT(tid).thread = tid;
tid->daemon = 1;
tid->stillborn = 0;
tid->target = 0;
- tid->interruptRequested = 0;
tid->group = 0;
/* Construct the initial restore point. */
* (which is set by suspendThread(.))
*/
void
-resumeThread(thread* tid)
+resumeThread (thread* tid)
{
if ((CONTEXT(tid).flags & THREAD_FLAGS_USER_SUSPEND) != 0)
{
{
thread** ntid;
+ assert(prio >= MIN_THREAD_PRIO && prio <= MAX_THREAD_PRIO);
+
if (tid->PrivateInfo == 0) {
tid->priority = prio;
return;
intsRestore();
}
+/*
+ * Get the current time in milliseconds since 1970-01-01.
+ */
+s8
+currentTime (void)
+{
+ struct timeval tv;
+ s8 time;
+
+ gettimeofday(&tv, 0);
+
+ time = tv.tv_sec;
+ time *= 1000;
+ time += tv.tv_usec / 1000;
+
+ return time;
+}
+
+/*
+ * Put a thread to sleep.
+ */
+void
+sleepThread (s8 time)
+{
+ thread** tidp;
+
+ /* Sleep for no time */
+ if (time <= 0) {
+ return;
+ }
+
+ intsDisable();
+
+ /* Get absolute time */
+ CONTEXT(currentThread).time = time + currentTime();
+
+ /* Find place in alarm list */
+ for (tidp = &sleepThreads; (*tidp) != 0; tidp = &(*tidp)->next)
+ {
+ if (CONTEXT(*tidp).time > CONTEXT(currentThread).time)
+ break;
+ }
+
+ /* Suspend thread on it */
+ suspendOnQThread(currentThread, tidp);
+
+ intsRestore();
+}
+
/*
* Is this thread alive?
*/
exceptionptr = CONTEXT(currentThread).exceptionptr;
+ if (stack_to_be_freed != 0)
+ {
+ free(stack_to_be_freed);
+ stack_to_be_freed = 0;
+ }
+
/* Alarm signal may be blocked - if so
* unblock it.
*/
s4 maxPrio;
s4 destroyed;
s4 daemon;
+ s4 vmAllowSuspension;
s4 nthreads;
java_objectheader* threads;
s4 ngroups;
s4 priority;
struct _thread* next;
s8 PrivateInfo;
- struct java_lang_Object* eetop; /* ??? */
s4 single_step;
s4 daemon;
s4 stillborn;
java_objectheader* target;
- s4 interruptRequested;
threadGroup* group;
+ java_objectheader* contextClassLoader;
+ java_objectheader* inheritedAccessControlContext;
+ java_objectheader* values;
} thread;
-void initThreads(u1 *stackbottom);
-void clear_thread_flags(void);
-void startThread(thread*);
-void resumeThread(thread*);
-void iresumeThread(thread*);
-void suspendThread(thread*);
-void suspendOnQThread(thread*, thread**);
-void yieldThread(void);
-void killThread(thread*);
-void setPriorityThread(thread*, int);
+void initThreads (u1 *stackbottom);
+void clear_thread_flags (void);
+void startThread (thread*);
+void resumeThread (thread*);
+void iresumeThread (thread*);
+void suspendThread (thread*);
+void suspendOnQThread (thread*, thread**);
+void yieldThread (void);
+void killThread (thread*);
+void setPriorityThread (thread*, int);
-void sleepThread(s8);
-bool aliveThread(thread*);
-long framesThread(thread*);
+s8 currentTime (void);
+void sleepThread (s8);
+bool aliveThread (thread*);
+long framesThread (thread*);
-void reschedule(void);
+void reschedule (void);
-void checkEvents(bool block);
+void checkEvents (bool block);
extern int blockInts;
extern bool needReschedule;
extern int threadStackSize;
extern thread *liveThreads;
+extern thread *sleepThreads;
extern thread *threadQhead[MAX_THREAD_PRIO + 1];
return (ptr - buf);
}
+/*
+ * Receive, but only if we can.
+ */
+int
+threadedRecvfrom (int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen)
+{
+ int r;
+
+ DBG( printf("threadedRecvfrom\n"); )
+
+#if defined(BLOCKING_CALLS)
+ blockOnFile(fd, TH_READ);
+#endif
+ for (;;)
+ {
+ r = recvfrom(fd, buf, len, flags, addr, addrlen);
+ if (r < 0
+ && (errno == EAGAIN || errno == EWOULDBLOCK
+ || errno == EINTR))
+ {
+ blockOnFile(fd, TH_READ);
+ continue;
+ }
+ return (r);
+ }
+}
+
+/*
+ * Send, but only if we can.
+ */
+int
+threadedSendto (int fd, void *buf, size_t len, int flags, struct sockaddr *addr, int addrlen)
+{
+ int r;
+
+ DBG( printf("threadedSendto\n"); )
+
+#if defined(BLOCKING_CALLS)
+ blockOnFile(fd, TH_WRITE);
+#endif
+ for (;;)
+ {
+ r = sendto(fd, buf, len, flags, addr, addrlen);
+ if (r < 0
+ && (errno == EAGAIN || errno == EWOULDBLOCK
+ || errno == EINTR))
+ {
+ blockOnFile(fd, TH_WRITE);
+ continue;
+ }
+ return (r);
+ }
+}
+
/*
* An attempt to access a file would block, so suspend the thread until
* it will happen.
{
maxFd = fd;
}
+
if (op == TH_READ)
{
FD_SET(fd, &readsPending);
thread* tid;
thread* ntid;
int i;
- int b;
+ s8 time = -1;
+ struct timeval tv;
+ struct timeval *timeout;
+
+ assert(blockInts > 0);
DBG( printf("checkEvents block:%d\n", block); )
+ if (sleepThreads != 0)
+ {
+ time = currentTime();
+ while (sleepThreads != 0 && time >= CONTEXT(sleepThreads).time)
+ {
+ tid = sleepThreads;
+ sleepThreads = sleepThreads->next;
+ tid->next = 0;
+
+ iresumeThread(tid);
+ }
+ }
+
+ if (block)
+ {
+ if (sleepThreads != 0)
+ {
+ s8 wait_time = CONTEXT(sleepThreads).time - time;
+
+ tv.tv_sec = wait_time / 1000;
+ tv.tv_usec = (wait_time % 1000) * 1000;
+ timeout = &tv;
+ }
+ else
+ timeout = 0;
+ }
+ else
+ {
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ timeout = &tv;
+ }
+
#if defined(FD_COPY)
FD_COPY(&readsPending, &rd);
FD_COPY(&writesPending, &wr);
memcpy(&wr, &writesPending, sizeof(wr));
#endif
- /*
- * If select() is called with indefinite wait, we have to make sure
- * we can get interrupted by timer events.
- */
- if (block == true)
- {
- b = blockInts;
- blockInts = 0;
- r = select(maxFd+1, &rd, &wr, 0, 0);
- blockInts = b;
- }
- else
- {
- r = select(maxFd+1, &rd, &wr, 0, &tm);
- }
+ r = select(maxFd+1, &rd, &wr, 0, timeout);
/* We must be holding off interrupts before we start playing with
* the read and write queues. This should be already done but a
DBG( printf("Select returns %d\n", r); )
+ /* Some threads may have finished sleeping.
+ */
+ if (block && sleepThreads != 0)
+ {
+ time = currentTime();
+ while (sleepThreads != 0 && time >= CONTEXT(sleepThreads).time)
+ {
+ tid = sleepThreads;
+ sleepThreads = sleepThreads->next;
+ tid->next = 0;
+
+ iresumeThread(tid);
+ }
+ }
+
for (i = 0; r > 0 && i <= maxFd; i++)
{
if (readQ[i] != 0 && FD_ISSET(i, &rd))
int threadedAccept(int fd, struct sockaddr* addr, int* len);
int threadedRead(int fd, char* buf, int len);
int threadedWrite(int fd, char* buf, int len);
+int threadedRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t *addrlen);
+int threadedSendto(int fd, void *buf, size_t len, int flags, struct sockaddr *addr, socklen_t addrlen);
#else
#define threadedFileDescriptor(fd)
#define threadedRead(fd,buf,len) read(fd,buf,len)
-# Makefile.in generated automatically by automake 1.3 from Makefile.am
+# Makefile.in generated automatically by automake 1.4a from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# PARTICULAR PURPOSE.
-SHELL = /bin/sh
+SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
includedir = @includedir@
oldincludedir = /usr/include
-DISTDIR =
+DESTDIR =
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_FLAG =
transform = @program_transform_name@
NORMAL_INSTALL = :
noinst_LIBRARIES = libtoolbox.a
-libtoolbox_a_SOURCES = memory.c memory.h \
- loging.c loging.h \
- chain.c chain.h \
- tree.c tree.h \
- list.c list.h
+libtoolbox_a_SOURCES = memory.c memory.h loging.c loging.h chain.c chain.h tree.c tree.h list.c list.h
-INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
+
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/@SYSDEP_DIR@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
libtoolbox_a_OBJECTS = memory.o loging.o chain.o tree.o list.o
AR = ar
CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
-GZIP = --best
+TAR = gtar
+GZIP_ENV = --best
DEP_FILES = .deps/chain.P .deps/list.P .deps/loging.P .deps/memory.P \
.deps/tree.P
SOURCES = $(libtoolbox_a_SOURCES)
OBJECTS = $(libtoolbox_a_OBJECTS)
-all: Makefile $(LIBRARIES)
-
+all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu toolbox/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+ && mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu toolbox/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -d $$d/$$file; then \
+ cp -pr $$d/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
done
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
clean-depend:
distclean-depend:
+ -rm -rf .deps
maintainer-clean-depend:
- -rm -rf .deps
%.o: %.c
@echo '$(COMPILE) -c $<'; \
- $(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
%.lo: %.c
@echo '$(LTCOMPILE) -c $<'; \
- $(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
- @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
- < .deps/$(*F).p > .deps/$(*F).P
- @-rm -f .deps/$(*F).p
-info:
-dvi:
-check: all
- $(MAKE)
-installcheck:
-install-exec:
- @$(NORMAL_INSTALL)
-
-install-data:
- @$(NORMAL_INSTALL)
-
-install: install-exec install-data all
- @:
-
-uninstall:
-
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am:
+install-exec: install-exec-am
+
+install-data-am:
+install-data: install-data-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am:
+uninstall: uninstall-am
+all-am: Makefile $(LIBRARIES)
+all-redirect: all-am
install-strip:
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
installdirs:
mostlyclean-generic:
- -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
-mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
+mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
-clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
- clean-generic mostlyclean
+mostlyclean: mostlyclean-am
+
+clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
-distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
- distclean-depend distclean-generic clean
- -rm -f config.status
+clean: clean-am
-maintainer-clean: maintainer-clean-noinstLIBRARIES \
+distclean-am: distclean-noinstLIBRARIES distclean-compile \
+ distclean-tags distclean-depend distclean-generic \
+ clean-am
+
+distclean: distclean-am
+
+maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
- distclean
+ distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
+maintainer-clean: maintainer-clean-am
+
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
-distclean-depend clean-depend maintainer-clean-depend info dvi \
-installcheck install-exec install-data install uninstall all \
-installdirs mostlyclean-generic distclean-generic clean-generic \
+distclean-depend clean-depend maintainer-clean-depend info-am info \
+dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean