summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile544
-rwxr-xr-xtools/Makefile.am102
-rw-r--r--tools/Makefile.in544
-rw-r--r--tools/gnu/classpath/tools/giop/GRMIC.java225
-rw-r--r--tools/gnu/classpath/tools/giop/GRMIC.txt26
-rw-r--r--tools/gnu/classpath/tools/giop/README7
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/CompilationError.java68
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/Generator.java139
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/GiopIo.java128
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java451
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java275
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav152
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav47
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav33
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav32
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav181
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav9
-rw-r--r--tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav8
18 files changed, 2971 insertions, 0 deletions
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 000000000..ca9fb6b7e
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# tools/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+srcdir = .
+top_srcdir = ..
+
+pkgdatadir = $(datadir)/classpath
+pkglibdir = $(libdir)/classpath
+pkgincludedir = $(includedir)/classpath
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = /usr/bin/install -c
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-redhat-linux-gnu
+host_triplet = i686-redhat-linux-gnu
+target_triplet = i686-redhat-linux-gnu
+subdir = tools
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acattribute.m4 \
+ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(TOOLSdir)"
+TOOLSDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(TOOLS_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/audriusa/workspace/classpath/missing --run aclocal-1.9
+AMDEP_FALSE = #
+AMDEP_TRUE =
+AMTAR = ${SHELL} /home/audriusa/workspace/classpath/missing --run tar
+AR = ar
+AUTOCONF = ${SHELL} /home/audriusa/workspace/classpath/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/audriusa/workspace/classpath/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/audriusa/workspace/classpath/missing --run automake-1.9
+AWK = gawk
+BUILD_CLASS_FILES_FALSE =
+BUILD_CLASS_FILES_TRUE = #
+CAIRO_CFLAGS =
+CAIRO_LIBS =
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+CLASSPATH_INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/native/jni/classpath -I$(top_srcdir)/native/target/Linux -I$(top_srcdir)/native/target/generic
+CLASSPATH_MODULE = -module -version-info 0:0:0 -no-undefined
+CP = /bin/cp
+CPP = gcc -E
+CPPFLAGS =
+CREATE_ALSA_LIBRARIES_FALSE = #
+CREATE_ALSA_LIBRARIES_TRUE =
+CREATE_API_DOCS_FALSE =
+CREATE_API_DOCS_TRUE = #
+CREATE_CORE_JNI_LIBRARIES_FALSE = #
+CREATE_CORE_JNI_LIBRARIES_TRUE =
+CREATE_DSSI_LIBRARIES_FALSE =
+CREATE_DSSI_LIBRARIES_TRUE = #
+CREATE_GTK_PEER_LIBRARIES_FALSE = #
+CREATE_GTK_PEER_LIBRARIES_TRUE =
+CREATE_JNI_HEADERS_FALSE =
+CREATE_JNI_HEADERS_TRUE = #
+CREATE_JNI_LIBRARIES_FALSE = #
+CREATE_JNI_LIBRARIES_TRUE =
+CREATE_QT_PEER_LIBRARIES_FALSE =
+CREATE_QT_PEER_LIBRARIES_TRUE = #
+CREATE_XMLJ_LIBRARY_FALSE =
+CREATE_XMLJ_LIBRARY_TRUE = #
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DATE = /bin/date
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+ECJ = /usr/bin/ecj
+EGREP = grep -E
+ERROR_CFLAGS =
+EXAMPLESDIR = examples
+EXEEXT =
+F77 = f95
+FASTJAR = /usr/bin/fastjar
+FFLAGS = -g -O2
+FIND = /usr/bin/find
+FOUND_ECJ_FALSE =
+FOUND_ECJ_TRUE = #
+FOUND_GCJX_FALSE =
+FOUND_GCJX_TRUE = #
+FOUND_GCJ_FALSE =
+FOUND_GCJ_TRUE = #
+FOUND_JIKES_FALSE = #
+FOUND_JIKES_TRUE =
+FOUND_KJC_FALSE =
+FOUND_KJC_TRUE = #
+GCJ = /usr/bin/gcj
+GCJX =
+GJDOC =
+GTK_CAIRO_ENABLED = false
+GTK_CAIRO_FALSE =
+GTK_CAIRO_TRUE = #
+GTK_CFLAGS = -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/config -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
+GTK_LIBS = -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgthread-2.0 -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
+INIT_LOAD_LIBRARY = true
+INSTALL_CLASS_FILES_FALSE =
+INSTALL_CLASS_FILES_TRUE = #
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_GLIBJ_ZIP_FALSE = #
+INSTALL_GLIBJ_ZIP_TRUE =
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
+JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = false
+JAY =
+JAY_SKELETON =
+JIKES = /usr/bin/jikes
+JIKESENCODING = -encoding UTF-8
+JIKESWARNINGS = +Pno-switchcheck +Pno-shadow
+KJC =
+LDFLAGS =
+LIBDEBUG = false
+LIBICONV =
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBVERSION = 0:0:0
+LN_S = ln -s
+LTLIBICONV =
+LTLIBOBJS =
+MAINT = #
+MAINTAINER_MODE_FALSE =
+MAINTAINER_MODE_TRUE = #
+MAKEINFO = ${SHELL} /home/audriusa/workspace/classpath/missing --run makeinfo
+MKDIR = /bin/mkdir
+MOC =
+OBJEXT = o
+PACKAGE = classpath
+PACKAGE_BUGREPORT = classpath@gnu.org
+PACKAGE_NAME = GNU Classpath
+PACKAGE_STRING = GNU Classpath 0.21-pre
+PACKAGE_TARNAME = classpath
+PACKAGE_VERSION = 0.21-pre
+PANGOFT2_CFLAGS = -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
+PANGOFT2_LIBS = -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+QT_CFLAGS =
+QT_LIBS =
+RANLIB = ranlib
+REGEN_PARSERS_FALSE =
+REGEN_PARSERS_TRUE = #
+REMOVE =
+SET_MAKE =
+SHELL = /bin/sh
+STRICT_WARNING_CFLAGS = -Wstrict-prototypes
+STRIP = strip
+USER_CLASSLIB =
+USER_JAVAH = /usr/bin/gcjh
+USER_SPECIFIED_CLASSLIB_FALSE =
+USER_SPECIFIED_CLASSLIB_TRUE = #
+USER_SPECIFIED_JAVAH_FALSE = #
+USER_SPECIFIED_JAVAH_TRUE =
+VERSION = 0.21-pre
+WARNING_CFLAGS = -pedantic -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long
+XML_CFLAGS =
+XML_LIBS =
+XSLT_CFLAGS =
+XSLT_LIBS =
+X_CFLAGS = -I/usr/X11R6/include
+X_EXTRA_LIBS =
+X_LIBS = -L/usr/X11R6/lib
+X_PRE_LIBS = -lSM -lICE
+ZIP =
+ac_ct_AR = ar
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_F77 = f95
+ac_ct_RANLIB = ranlib
+ac_ct_STRIP = strip
+am__fastdepCC_FALSE = #
+am__fastdepCC_TRUE =
+am__fastdepCXX_FALSE = #
+am__fastdepCXX_TRUE =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = tar --format=ustar -chf - "$$tardir"
+am__untar = tar -xf -
+bindir = ${exec_prefix}/bin
+build = i686-redhat-linux-gnu
+build_alias =
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = redhat
+datadir = ${prefix}/share
+default_toolkit = gnu.java.awt.peer.gtk.GtkToolkit
+exec_prefix = ${prefix}
+glibjdir = ${datadir}/${PACKAGE}
+host = i686-redhat-linux-gnu
+host_alias =
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = redhat
+includedir = ${prefix}/include
+infodir = ${prefix}/info
+install_sh = /home/audriusa/workspace/classpath/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localstatedir = ${prefix}/var
+mandir = ${prefix}/man
+mkdir_p = mkdir -p --
+nativelibdir = ${libdir}/${PACKAGE}
+oldincludedir = /usr/include
+prefix = /usr/local/classpath
+program_transform_name = s,x,x,
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+sysconfdir = ${prefix}/etc
+target = i686-redhat-linux-gnu
+target_alias =
+target_cpu = x86
+target_os = linux-gnu
+target_vendor = redhat
+vm_classes = ${top_srcdir}/vm/reference
+##JCOMPILER = $(ECJ) -bootclasspath '$(top_builddir)/lib' -classpath .
+##JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath $(top_builddir)/lib:.
+JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
+
+# Setup the compiler to use the GNU Classpath library we just build
+#JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
+
+# All our example java source files
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+
+# The zip files with classes we want to produce.
+TOOLS_ZIP = tools.zip
+
+# Extra objects that will not exist until configure-time
+BUILT_SOURCES = $(TOOLS_ZIP)
+
+# the templates that must be included into the generated zip file
+TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/GRMIC.txt $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
+
+# The tool specific README files.
+READMES = $(srcdir)/gnu/classpath/tools/giop/README.txt
+
+# All the files we find "interesting"
+ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(READMES)
+
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP) README
+
+# Where we want these data files installed.
+TOOLSdir = $(pkgdatadir)/tools
+
+# Make sure everything is included in the distribution.
+EXTRA_DIST = README Makefile.am
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tools/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-TOOLSDATA: $(TOOLS_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(TOOLSdir)" || $(mkdir_p) "$(DESTDIR)$(TOOLSdir)"
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(TOOLSDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ $(TOOLSDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+
+uninstall-TOOLSDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(TOOLSdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-TOOLSDATA install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-TOOLSDATA uninstall-info-am uninstall-local
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local dist-hook distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-TOOLSDATA install-am install-data \
+ install-data-am install-data-local install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-TOOLSDATA uninstall-am uninstall-info-am \
+ uninstall-local
+
+#error dunno how to setup the JCOMPILER and compile
+
+# Make sure all sources and icons are also installed so users can use them.
+# (Be careful to strip off the srcdir part of the path when installing.)
+install-data-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(DESTDIR)$(pkgdatadir)/tools/$$fdir; then \
+ echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir"; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir; \
+ fi; \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+ echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/tools/"
+ $(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/tools/
+
+uninstall-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ echo "rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+dist-hook:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(distdir)/$$fdir; then \
+ echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
+ $(mkinstalldirs) $(distdir)/$$fdir; \
+ fi; \
+ echo "cp -p $$file $(distdir)/$$f"; \
+ cp -p $$file $(distdir)/$$f; \
+ done
+
+# To generate the example zip just depend on the sources and ignore the
+# class files. Always regenerate all .class files and remove them immediatly.
+# And copy the png icons we use to the classes dir so they get also included.
+$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
+ mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
+ cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
+ $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
+ (cd classes; \
+ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
+ cd ..)
+ rm -rf classes
+
+# Zip file be gone! (and make sure the classes are gone too)
+clean-local:
+ rm -rf $(TOOLS_ZIP) classes
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tools/Makefile.am b/tools/Makefile.am
new file mode 100755
index 000000000..d1e40b8e9
--- /dev/null
+++ b/tools/Makefile.am
@@ -0,0 +1,102 @@
+## Input file for automake to generate the Makefile.in used by configure
+
+# Setup the compiler to use the GNU Classpath library we just build
+if FOUND_GCJ
+JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
+else
+if FOUND_JIKES
+JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
+else
+if FOUND_GCJX
+JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath $(top_builddir)/lib:.
+else
+if FOUND_ECJ
+JCOMPILER = $(ECJ) -bootclasspath '$(top_builddir)/lib' -classpath .
+else
+error dunno how to setup the JCOMPILER and compile
+endif
+endif
+endif
+endif
+
+# All our example java source files
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+
+
+# The zip files with classes we want to produce.
+TOOLS_ZIP = tools.zip
+
+# Extra objects that will not exist until configure-time
+BUILT_SOURCES = $(TOOLS_ZIP)
+
+# the templates that must be included into the generated zip file
+TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
+TOOLS_HELPS = $(srcdir)/gnu/classpath/tools/giop/*.txt
+
+# The tool specific README files.
+READMES = $(srcdir)/gnu/classpath/tools/giop/README.txt
+
+# All the files we find "interesting"
+ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(READMES)
+
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP)
+
+# Where we want these data files installed.
+TOOLSdir = $(pkgdatadir)/tools
+
+# Make sure all sources and icons are also installed so users can use them.
+# (Be careful to strip off the srcdir part of the path when installing.)
+install-data-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(DESTDIR)$(pkgdatadir)/tools/$$fdir; then \
+ echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir"; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir; \
+ fi; \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+
+uninstall-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ echo "rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+
+# Make sure everything is included in the distribution.
+EXTRA_DIST = Makefile.am
+dist-hook:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(distdir)/$$fdir; then \
+ echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
+ $(mkinstalldirs) $(distdir)/$$fdir; \
+ fi; \
+ echo "cp -p $$file $(distdir)/$$f"; \
+ cp -p $$file $(distdir)/$$f; \
+ done
+
+# To generate the example zip just depend on the sources and ignore the
+# class files. Always regenerate all .class files and remove them immediatly.
+# And copy the template files we use to the classes dir so they get also included.
+$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
+ mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
+ cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
+ cp $(TOOLS_HELPS) classes/gnu/classpath/tools/giop/
+ $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
+ (cd classes; \
+ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
+ cd ..)
+ rm -rf classes
+
+# Zip file be gone! (and make sure the classes are gone too)
+clean-local:
+ rm -rf $(TOOLS_ZIP) classes
diff --git a/tools/Makefile.in b/tools/Makefile.in
new file mode 100644
index 000000000..3c20eb20c
--- /dev/null
+++ b/tools/Makefile.in
@@ -0,0 +1,544 @@
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = tools
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acattribute.m4 \
+ $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/pkg.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(TOOLSdir)"
+TOOLSDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(TOOLS_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
+BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
+CAIRO_CFLAGS = @CAIRO_CFLAGS@
+CAIRO_LIBS = @CAIRO_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@
+CLASSPATH_MODULE = @CLASSPATH_MODULE@
+CP = @CP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@
+CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@
+CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@
+CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@
+CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@
+CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@
+CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@
+CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@
+CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@
+CREATE_GTK_PEER_LIBRARIES_TRUE = @CREATE_GTK_PEER_LIBRARIES_TRUE@
+CREATE_JNI_HEADERS_FALSE = @CREATE_JNI_HEADERS_FALSE@
+CREATE_JNI_HEADERS_TRUE = @CREATE_JNI_HEADERS_TRUE@
+CREATE_JNI_LIBRARIES_FALSE = @CREATE_JNI_LIBRARIES_FALSE@
+CREATE_JNI_LIBRARIES_TRUE = @CREATE_JNI_LIBRARIES_TRUE@
+CREATE_QT_PEER_LIBRARIES_FALSE = @CREATE_QT_PEER_LIBRARIES_FALSE@
+CREATE_QT_PEER_LIBRARIES_TRUE = @CREATE_QT_PEER_LIBRARIES_TRUE@
+CREATE_XMLJ_LIBRARY_FALSE = @CREATE_XMLJ_LIBRARY_FALSE@
+CREATE_XMLJ_LIBRARY_TRUE = @CREATE_XMLJ_LIBRARY_TRUE@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+ECJ = @ECJ@
+EGREP = @EGREP@
+ERROR_CFLAGS = @ERROR_CFLAGS@
+EXAMPLESDIR = @EXAMPLESDIR@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FASTJAR = @FASTJAR@
+FFLAGS = @FFLAGS@
+FIND = @FIND@
+FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
+FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
+FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
+FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
+FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
+FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
+FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
+FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
+FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
+FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
+GCJ = @GCJ@
+GCJX = @GCJX@
+GJDOC = @GJDOC@
+GTK_CAIRO_ENABLED = @GTK_CAIRO_ENABLED@
+GTK_CAIRO_FALSE = @GTK_CAIRO_FALSE@
+GTK_CAIRO_TRUE = @GTK_CAIRO_TRUE@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
+INSTALL_CLASS_FILES_FALSE = @INSTALL_CLASS_FILES_FALSE@
+INSTALL_CLASS_FILES_TRUE = @INSTALL_CLASS_FILES_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_GLIBJ_ZIP_FALSE = @INSTALL_GLIBJ_ZIP_FALSE@
+INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
+JAY = @JAY@
+JAY_SKELETON = @JAY_SKELETON@
+JIKES = @JIKES@
+JIKESENCODING = @JIKESENCODING@
+JIKESWARNINGS = @JIKESWARNINGS@
+KJC = @KJC@
+LDFLAGS = @LDFLAGS@
+LIBDEBUG = @LIBDEBUG@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+MKDIR = @MKDIR@
+MOC = @MOC@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@
+PANGOFT2_LIBS = @PANGOFT2_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+QT_CFLAGS = @QT_CFLAGS@
+QT_LIBS = @QT_LIBS@
+RANLIB = @RANLIB@
+REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
+REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
+REMOVE = @REMOVE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
+STRIP = @STRIP@
+USER_CLASSLIB = @USER_CLASSLIB@
+USER_JAVAH = @USER_JAVAH@
+USER_SPECIFIED_CLASSLIB_FALSE = @USER_SPECIFIED_CLASSLIB_FALSE@
+USER_SPECIFIED_CLASSLIB_TRUE = @USER_SPECIFIED_CLASSLIB_TRUE@
+USER_SPECIFIED_JAVAH_FALSE = @USER_SPECIFIED_JAVAH_FALSE@
+USER_SPECIFIED_JAVAH_TRUE = @USER_SPECIFIED_JAVAH_TRUE@
+VERSION = @VERSION@
+WARNING_CFLAGS = @WARNING_CFLAGS@
+XML_CFLAGS = @XML_CFLAGS@
+XML_LIBS = @XML_LIBS@
+XSLT_CFLAGS = @XSLT_CFLAGS@
+XSLT_LIBS = @XSLT_LIBS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ZIP = @ZIP@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+default_toolkit = @default_toolkit@
+exec_prefix = @exec_prefix@
+glibjdir = @glibjdir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+nativelibdir = @nativelibdir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+vm_classes = @vm_classes@
+@FOUND_ECJ_TRUE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(ECJ) -bootclasspath '$(top_builddir)/lib' -classpath .
+@FOUND_GCJX_TRUE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath $(top_builddir)/lib:.
+@FOUND_GCJ_FALSE@@FOUND_JIKES_TRUE@JCOMPILER = $(JIKES) -bootclasspath '' -extdirs '' -sourcepath '' --classpath $(top_builddir)/lib:.
+
+# Setup the compiler to use the GNU Classpath library we just build
+@FOUND_GCJ_TRUE@JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C
+
+# All our example java source files
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
+
+# The zip files with classes we want to produce.
+TOOLS_ZIP = tools.zip
+
+# Extra objects that will not exist until configure-time
+BUILT_SOURCES = $(TOOLS_ZIP)
+
+# the templates that must be included into the generated zip file
+TOOLS_TEMPLATES = $(srcdir)/gnu/classpath/tools/giop/GRMIC.txt $(srcdir)/gnu/classpath/tools/giop/grmic/templates/*.jav
+
+# The tool specific README files.
+READMES = $(srcdir)/gnu/classpath/tools/giop/README.txt
+
+# All the files we find "interesting"
+ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(READMES)
+
+# Some architecture independent data to be installed.
+TOOLS_DATA = $(TOOLS_ZIP) README
+
+# Where we want these data files installed.
+TOOLSdir = $(pkgdatadir)/tools
+
+# Make sure everything is included in the distribution.
+EXTRA_DIST = README Makefile.am
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu tools/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-TOOLSDATA: $(TOOLS_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(TOOLSdir)" || $(mkdir_p) "$(DESTDIR)$(TOOLSdir)"
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(TOOLSDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ $(TOOLSDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+
+uninstall-TOOLSDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(TOOLS_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(TOOLSdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(TOOLSdir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(TOOLSdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-TOOLSDATA install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-TOOLSDATA uninstall-info-am uninstall-local
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local dist-hook distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-TOOLSDATA install-am install-data \
+ install-data-am install-data-local install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-TOOLSDATA uninstall-am uninstall-info-am \
+ uninstall-local
+
+@FOUND_ECJ_FALSE@@FOUND_GCJX_FALSE@@FOUND_GCJ_FALSE@@FOUND_JIKES_FALSE@error dunno how to setup the JCOMPILER and compile
+
+# Make sure all sources and icons are also installed so users can use them.
+# (Be careful to strip off the srcdir part of the path when installing.)
+install-data-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(DESTDIR)$(pkgdatadir)/tools/$$fdir; then \
+ echo "$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir"; \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/tools/$$fdir; \
+ fi; \
+ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+ echo "$(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/tools/"
+ $(INSTALL_DATA) Makefile.jawt $(DESTDIR)$(pkgdatadir)/tools/
+
+uninstall-local:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ echo "rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/tools/$$f; \
+ done
+dist-hook:
+ srcdir_cnt=`echo $(srcdir) | wc -c`; \
+ for file in $(ALL_TOOLS_FILES); do \
+ f=`echo $$file | cut -c$$srcdir_cnt-`; \
+ fdir=`dirname $$f`; \
+ if test ! -d $(distdir)/$$fdir; then \
+ echo "$(makeinstalldirs) $(distdir)/$$fdir"; \
+ $(mkinstalldirs) $(distdir)/$$fdir; \
+ fi; \
+ echo "cp -p $$file $(distdir)/$$f"; \
+ cp -p $$file $(distdir)/$$f; \
+ done
+
+# To generate the example zip just depend on the sources and ignore the
+# class files. Always regenerate all .class files and remove them immediatly.
+# And copy the png icons we use to the classes dir so they get also included.
+$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
+ mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
+ cp $(TOOLS_TEMPLATES) classes/gnu/classpath/tools/giop/grmic/templates
+ $(JCOMPILER) -d classes $(TOOLS_JAVA_FILES)
+ (cd classes; \
+ if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \
+ if test "$(FASTJAR)" != ""; then $(FASTJAR) cf ../$(TOOLS_ZIP) .; fi; \
+ cd ..)
+ rm -rf classes
+
+# Zip file be gone! (and make sure the classes are gone too)
+clean-local:
+ rm -rf $(TOOLS_ZIP) classes
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tools/gnu/classpath/tools/giop/GRMIC.java b/tools/gnu/classpath/tools/giop/GRMIC.java
new file mode 100644
index 000000000..89bc46a62
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/GRMIC.java
@@ -0,0 +1,225 @@
+/* GRMIC.java -- GIOP support for RMIC.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop;
+
+import gnu.classpath.tools.giop.grmic.GiopRmicCompiler;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+
+/**
+ * The main class of the GIOP compiler to generate stubs and ties for
+ * javax.rmi package.
+ *
+ * @author Audrius Meskauskas (AudriusA@Bioinformatics.org)
+ */
+public class GRMIC
+{
+ /**
+ * The version of the compiler.
+ */
+ public static String VERSION = "0.0 alpha pre";
+
+ /**
+ * The GRMIC compiler methods
+ *
+ * @param args
+ * the compiler parameters.
+ */
+ public static void main(String[] args)
+ {
+ boolean noWrite = false;
+ boolean verbose = false;
+
+ File output = new File(".");
+
+ if (args.length == 0)
+ {
+ printHelpAndExit();
+ }
+ else
+ {
+ GiopRmicCompiler compiler = new GiopRmicCompiler();
+
+ int cl = -1;
+
+ Options: for (int i = 0; i < args.length; i++)
+ {
+ String c = args[i];
+ if (c.equals("-poa"))
+ compiler.setPoaMode(true);
+ else if (c.equals("-impl"))
+ compiler.setPoaMode(false);
+ else if (c.equals("-v"))
+ {
+ printVersion();
+ System.exit(0);
+ }
+ else if (c.equals("-help"))
+ printHelpAndExit();
+ else if (c.equals("-nowrite"))
+ noWrite = true;
+ else if (c.equals("-nowarn"))
+ compiler.setWarnings(false);
+ else if (c.equals("-verbose"))
+ {
+ verbose = true;
+ compiler.setVerbose(true);
+ }
+ else if (c.equals("-d"))
+ {
+ int f = i + 1;
+ if (f < args.length)
+ {
+ output = new File(args[f]);
+ i++;
+ }
+ else
+ printHelpAndExit();
+ }
+ else if (c.charAt(0) != '-')
+ // No more options - start of class list.
+ {
+ cl = i;
+ break Options;
+ }
+ }
+
+ if (cl < 0)
+ printHelpAndExit();
+
+ if (verbose)
+ System.out.println("Compiling to " + output.getAbsolutePath());
+
+ // Compile classes
+ Compile: for (int i = cl; i < args.length; i++)
+ {
+ if (args[i].charAt(0) != '-')
+ {
+ compiler.reset();
+ Class c = null;
+ try
+ {
+ c = Thread.currentThread().getContextClassLoader().loadClass(
+ args[i]);
+ }
+ catch (ClassNotFoundException e)
+ {
+ System.err.println(args[i] + " class not found.");
+ System.exit(1);
+ }
+
+ compiler.compile(c);
+ String packag = compiler.getPackageName().replace('.', '/');
+ File fw = new File(output, packag);
+
+ // Generate stub.
+ String stub = compiler.generateStub();
+ String subName = "_" + compiler.getStubName() + "_Stub.java";
+
+ compiler.reset();
+ compiler.compile(c);
+
+ // Generate tie
+ String tie = compiler.generateTie();
+ String tieName = "_" + compiler.name(c) + "_Tie.java";
+
+ if (noWrite)
+ continue Compile;
+
+ try
+ {
+ fw.mkdirs();
+ OutputStream out = new FileOutputStream(new File(fw, subName));
+ out.write(stub.getBytes());
+ out.close();
+
+ out = new FileOutputStream(new File(fw, tieName));
+ out.write(tie.getBytes());
+ out.close();
+ }
+ catch (IOException ioex)
+ {
+ System.err.println("Output path not accessible");
+ ioex.printStackTrace();
+ System.exit(1);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Prints the help message and terminates.
+ */
+ public static void printHelpAndExit()
+ {
+ printVersion();
+ InputStream in = GRMIC.class.getResourceAsStream("GRMIC.txt");
+ BufferedReader r = new BufferedReader(new InputStreamReader(in));
+
+ try
+ {
+ String s;
+ while ((s = r.readLine()) != null)
+ {
+ System.out.println(s);
+ }
+ r.close();
+ }
+ catch (IOException e)
+ {
+ System.err.print("Resource loading is broken:");
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Print the version information.
+ */
+ public static void printVersion()
+ {
+ System.out.println
+ ("grmic v "+VERSION+" - GIOP stub and tie generator for javax.rmi.* ");
+ }
+}
diff --git a/tools/gnu/classpath/tools/giop/GRMIC.txt b/tools/gnu/classpath/tools/giop/GRMIC.txt
new file mode 100644
index 000000000..9471fafe9
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/GRMIC.txt
@@ -0,0 +1,26 @@
+
+Copyright 2006 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+Please report bugs at http://www.gnu.org/software/classpath/bugs.html
+
+Usage: grmic <options> <class names>
+
+ where <options> includes:
+ -poa Generate the Servant based ties (default)
+ -impl Generate the obsoleted ObjectImpl based ties
+ (for backward compatibility)
+ -nowarn Show no warnings
+ -nowrite Do not write any files (check for errors only)
+ -d <folder> Place generated files into the given folder
+
+ -help Print this help text
+ -v Print version
+ -verbose Verbose output
+
+ and <class names> can include one or more non abstract classes that implement
+ Remote and are accessible via current class path.
+
+This tool generates the source code that must be compiled with java compiler.
+
diff --git a/tools/gnu/classpath/tools/giop/README b/tools/gnu/classpath/tools/giop/README
new file mode 100644
index 000000000..d02d46c34
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/README
@@ -0,0 +1,7 @@
+This package defines GIOP tools for creating the applications that use this
+protocol. It provides necessary support for org.omg.* and javax.rmi.*
+packages.
+
+The list of tools:
+
+* GRMIC - RMI-IIOP stub and tie generator. \ No newline at end of file
diff --git a/tools/gnu/classpath/tools/giop/grmic/CompilationError.java b/tools/gnu/classpath/tools/giop/grmic/CompilationError.java
new file mode 100644
index 000000000..c6b3e56e8
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/CompilationError.java
@@ -0,0 +1,68 @@
+/* CompilationError.java -- Thrown on compilation error.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop.grmic;
+
+/**
+ * This error is thrown when the target being compiled has illegal
+ * strutures.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class CompilationError extends Error
+{
+ /**
+ * Use serialVersionUID for interoperability.
+ */
+ private static final long serialVersionUID = 1;
+
+ /**
+ * Create error with explaining message and cause.
+ */
+ public CompilationError(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Create error with explaining message
+ */
+ public CompilationError(String message)
+ {
+ super(message);
+ }
+}
diff --git a/tools/gnu/classpath/tools/giop/grmic/Generator.java b/tools/gnu/classpath/tools/giop/grmic/Generator.java
new file mode 100644
index 000000000..90bb21500
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/Generator.java
@@ -0,0 +1,139 @@
+/* Generator.java -- Generic code generator.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop.grmic;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ * Contains basic methods, used in code generation.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class Generator
+{
+ /**
+ * Get resource with the given name, as string.
+ *
+ * @param name
+ * the resource name
+ * @return the resourse string (in subfolder /templates).
+ */
+ public String getResource(String name)
+ {
+ InputStream in = getClass().getResourceAsStream("templates/" + name);
+ BufferedReader r = new BufferedReader(new InputStreamReader(in));
+ StringBuffer b = new StringBuffer();
+
+ String s;
+ try
+ {
+ while ((s = r.readLine()) != null)
+ {
+ b.append(s);
+ b.append('\n');
+ }
+ r.close();
+ }
+ catch (IOException e)
+ {
+ InternalError ierr = new InternalError("No expected resource " + name);
+ ierr.initCause(e);
+ throw ierr;
+ }
+
+ return b.toString();
+ }
+
+ /**
+ * Replace the variable references (starting from #) in the template string by
+ * the values, present in the given map. The strings, not present in the
+ * variable map, are ignored.
+ *
+ * @param template
+ * the template string
+ * @param variables
+ * the map of variables (name to value) to replace.
+ * @return the string with replaced values.
+ */
+ public String replaceAll(String template, Map variables)
+ {
+ BufferedReader r = new BufferedReader(new StringReader(template));
+ String s;
+ StringBuffer b = new StringBuffer(template.length());
+ try
+ {
+ Iterator iter;
+ Collection vars = variables.keySet();
+ while ((s = r.readLine()) != null)
+ {
+ // At least one variable must appear in the string to make
+ // the string scan sensible.
+ if (s.indexOf('#') >= 0)
+ {
+ iter = vars.iterator();
+ String variable;
+ while (iter.hasNext())
+ {
+ variable = (String) iter.next();
+ if (s.indexOf(variable) >= 0)
+ s = s.replaceAll(variable,
+ (String) variables.get(variable));
+ }
+ }
+ b.append(s);
+ b.append('\n');
+ }
+ r.close();
+ }
+ catch (IOException e)
+ {
+ // This should never happen.
+ InternalError ierr = new InternalError("");
+ ierr.initCause(e);
+ throw ierr;
+ }
+ return b.toString();
+ }
+}
diff --git a/tools/gnu/classpath/tools/giop/grmic/GiopIo.java b/tools/gnu/classpath/tools/giop/grmic/GiopIo.java
new file mode 100644
index 000000000..3714c4ce4
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/GiopIo.java
@@ -0,0 +1,128 @@
+/* GiopIo.java -- Generates GIOP input/output statements.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop.grmic;
+
+import java.rmi.Remote;
+
+import org.omg.CORBA.portable.ObjectImpl;
+
+/**
+ * Generates the code for reading and writing data over GIOP stream.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class GiopIo
+{
+ /**
+ * Get the statement for writing the variable of the given type to the GIOP ({@link org.omg.CORBA_2_3.portable.OutputStream) stream. The
+ * stream is always named "out".
+ *
+ * @param c
+ * the class of the object being written
+ * @param variable
+ * the variable, where the object value is stored
+ * @param r
+ * the parent generator, used to name the class
+ * @return the write statement.
+ */
+ public static String getWriteStatement(Class c, String variable, GiopRmicCompiler r)
+ {
+ if (c.equals(boolean.class))
+ return "out.write_boolean(" + variable + ");";
+ if (c.equals(byte.class))
+ return "out.write_octet(" + variable + ");";
+ else if (c.equals(short.class))
+ return "out.write_int(" + variable + ");";
+ else if (c.equals(int.class))
+ return "out.write_long(" + variable + ");";
+ else if (c.equals(long.class))
+ return "out.write_long_long(" + variable + ");";
+ else if (c.equals(double.class))
+ return "out.write_double(" + variable + ");";
+ else if (c.equals(float.class))
+ return "out.write_float(" + variable + ");";
+ else if (c.equals(char.class))
+ return "out.write_char(" + variable + ");";
+ else if (Remote.class.isAssignableFrom(c))
+ return "Util.writeRemoteObject(out, " + variable + ");";
+ else if (ObjectImpl.class.isAssignableFrom(c))
+ return "out.write_Object(" + variable + ");";
+ else
+ return "out.write_value(" + variable + ", " + r.name(c) + ".class);";
+ }
+
+ /**
+ * Get the statement for reading the value of the given type from to the GIOP ({@link org.omg.CORBA_2_3.portable.InputStream) stream. The
+ * stream is always named "in".
+ *
+ * @param c
+ * the class of the object being written
+ * @param r
+ * the parent generator, used to name the class
+ * @return the right side of the read statement.
+ */
+ public static String getReadStatement(Class c, GiopRmicCompiler r)
+ {
+ if (c.equals(boolean.class))
+ return "in.read_boolean();";
+ else if (c.equals(byte.class))
+ return "in.read_octet();";
+ else if (c.equals(short.class))
+ return "in.read_int();";
+ else if (c.equals(int.class))
+ return "in.read_long();";
+ else if (c.equals(long.class))
+ return "in.read_long_long();";
+ else if (c.equals(double.class))
+ return "in.read_double();";
+ else if (c.equals(float.class))
+ return "in.read_float();";
+ else if (c.equals(char.class))
+ return "in.read_char();";
+ else if (Remote.class.isAssignableFrom(c))
+ return "(" + r.name(c)
+ + ") PortableRemoteObject.narrow(in.read_Object()," + r.name(c)
+ + ".class);";
+ else if (ObjectImpl.class.isAssignableFrom(c))
+ return "in.read_Object();";
+ else
+ return "(" + r.name(c)
+ + ") in.read_value(" + r.name(c) + ".class);";
+ }
+
+}
diff --git a/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java b/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java
new file mode 100644
index 000000000..7d0c97d55
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/GiopRmicCompiler.java
@@ -0,0 +1,451 @@
+/* GiopRmicCompiler -- Central GIOP-based RMI stub and tie compiler class.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop.grmic;
+
+import java.lang.reflect.Method;
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.TreeSet;
+
+/**
+ * Provides the extended rmic functionality to generate the POA - based classes
+ * for GIOP (javax.rmi.CORBA package).
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class GiopRmicCompiler extends Generator
+{
+ /** The package name. */
+ String packag;
+
+ /**
+ * The "basic" name (normally, the interface name, unless several Remote -
+ * derived interfaces are implemented.
+ */
+ String name;
+
+ /**
+ * The name (without package) of the class, passed as the parameter.
+ */
+ String implName;
+
+ /**
+ * The proposed name for the stub.
+ */
+ String stubName;
+
+ /**
+ * The Remote's, implemented by this class.
+ */
+ Collection implementedRemotes = new HashSet();
+
+ /**
+ * The extra classes that must be imported.
+ */
+ Collection extraImports = new HashSet();
+
+ /**
+ * The methods we must implement.
+ */
+ Collection methods = new HashSet();
+
+ /**
+ * The map of all code generator variables.
+ */
+ Properties vars = new Properties();
+
+ /**
+ * If this flag is set (true by default), the compiler generates the Servant
+ * based classes. If set to false, the compiler generates the old style
+ * ObjectImpl based classes.
+ */
+ boolean poaMode = true;
+
+ /**
+ * If this flag is set (true by default), the compiler emits warnings.
+ */
+ boolean warnings = true;
+
+ /**
+ * Verbose output
+ */
+ boolean verbose = false;
+
+ /**
+ * Clear data, preparing for the next compilation.
+ */
+ public void reset()
+ {
+ packag = name = implName = stubName = null;
+ implementedRemotes.clear();
+ extraImports.clear();
+ methods.clear();
+ vars.clear();
+ }
+
+ /**
+ * Compile the given class (the instance of Remote), generating the stub and
+ * tie for it.
+ *
+ * @param remote
+ * the class to compile.
+ */
+ public synchronized void compile(Class remote)
+ {
+ reset();
+ String s;
+
+ // Get the package.
+ s = remote.getName();
+ int p = s.lastIndexOf('.');
+ if (p < 0)
+ {
+ // Root package.
+ packag = "";
+ implName = name = s;
+ }
+ else
+ {
+ packag = s.substring(0, p);
+ implName = name = s.substring(p + 1);
+ }
+
+ // Drop the Impl suffix, if one exists.
+ if (name.endsWith("Impl"))
+ name = name.substring(0, name.length() - "Impl".length());
+
+ stubName = name;
+
+ vars.put("#name", name);
+ vars.put("#package", packag);
+ vars.put("#implName", implName);
+
+ if (verbose)
+ System.out.println("Package " + packag + ", name " + name + " impl "
+ + implName);
+
+ // Get the implemented remotes.
+ Class[] interfaces = remote.getInterfaces();
+
+ for (int i = 0; i < interfaces.length; i++)
+ {
+ if (Remote.class.isAssignableFrom(interfaces[i]))
+ {
+ if (!interfaces[i].equals(Remote.class))
+ {
+ implementedRemotes.add(interfaces[i]);
+ }
+ }
+ }
+
+ vars.put("#idList", getIdList(implementedRemotes));
+
+ // Collect and process methods.
+ Iterator iter = implementedRemotes.iterator();
+
+ while (iter.hasNext())
+ {
+ Class c = (Class) iter.next();
+ Method[] m = c.getMethods();
+
+ // Check if throws RemoteException.
+ for (int i = 0; i < m.length; i++)
+ {
+ Class[] exc = m[i].getExceptionTypes();
+ boolean remEx = false;
+
+ for (int j = 0; j < exc.length; j++)
+ {
+ if (RemoteException.class.isAssignableFrom(exc[j]))
+ {
+ remEx = true;
+ break;
+ }
+ if (!remEx)
+ throw new CompilationError(m[i].getName() + ", defined in "
+ + c.getName()
+ + ", does not throw "
+ + RemoteException.class.getName());
+ }
+ MethodGenerator mm = new MethodGenerator(m[i], this);
+ methods.add(mm);
+ }
+ }
+ }
+
+ /**
+ * Get the name of the given class. The class is added to imports, if not
+ * already present and not from java.lang and not from the current package.
+ *
+ * @param nameIt
+ * the class to name
+ * @return the name of class as it should appear in java language
+ */
+ public String name(Class nameIt)
+ {
+ if (nameIt.isArray())
+ {
+ // Mesure dimensions:
+ int dimension = 0;
+ Class finalComponent = nameIt;
+ while (finalComponent.isArray())
+ {
+ finalComponent = finalComponent.getComponentType();
+ dimension++;
+ }
+
+ StringBuffer brackets = new StringBuffer();
+
+ for (int i = 0; i < dimension; i++)
+ {
+ brackets.append("[]");
+ }
+
+ return name(finalComponent) + " " + brackets;
+ }
+ else
+ {
+ String n = nameIt.getName();
+ if (!nameIt.isArray() && !nameIt.isPrimitive())
+ if (!n.startsWith("java.lang")
+ && !(packag != null && n.startsWith(packag)))
+ extraImports.add(n);
+
+ int p = n.lastIndexOf('.');
+ if (p < 0)
+ return n;
+ else
+ return n.substring(p + 1);
+ }
+ }
+
+ /**
+ * Get the RMI-style repository Id for the given class.
+ *
+ * @param c
+ * the interface, for that the repository Id must be created.
+ * @return the repository id
+ */
+ public String getId(Class c)
+ {
+ return "RMI:" + c.getName() + ":0000000000000000";
+ }
+
+ /**
+ * Get repository Id string array declaration.
+ *
+ * @param remotes
+ * the collection of interfaces
+ * @return the fully formatted string array.
+ */
+ public String getIdList(Collection remotes)
+ {
+ StringBuffer b = new StringBuffer();
+
+ // Keep the Ids sorted, ensuring, that the same order will be preserved
+ // between compilations.
+ TreeSet sortedIds = new TreeSet();
+
+ Iterator iter = remotes.iterator();
+ while (iter.hasNext())
+ {
+ sortedIds.add(getId((Class) iter.next()));
+ }
+
+ iter = sortedIds.iterator();
+ while (iter.hasNext())
+ {
+ b.append(" \"" + iter.next() + "\"");
+ if (iter.hasNext())
+ b.append(", \n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Generate stub. Can only be called from {@link #compile}.
+ *
+ * @return the string, containing the text of the generated stub.
+ */
+ public String generateStub()
+ {
+ String template = getResource("Stub.jav");
+
+ // Generate methods.
+ StringBuffer b = new StringBuffer();
+ Iterator iter = methods.iterator();
+ while (iter.hasNext())
+ {
+ MethodGenerator m = (MethodGenerator) iter.next();
+ b.append(m.generateStubMethod());
+ }
+
+ vars.put("#stub_methods", b.toString());
+ vars.put("#imports", getImportStatements());
+ vars.put("#interfaces", getAllInterfaces());
+
+ String output = replaceAll(template, vars);
+ return output;
+ }
+
+ /**
+ * Get the list of all interfaces, implemented by the class, that are
+ * derived from Remote.
+ *
+ * @return the string - all interfaces.
+ */
+ public String getAllInterfaces()
+ {
+ StringBuffer b = new StringBuffer();
+ Iterator iter = implementedRemotes.iterator();
+
+ while (iter.hasNext())
+ {
+ b.append(name( (Class) iter.next() ) );
+ if (iter.hasNext())
+ b.append(", ");
+ }
+
+ return b.toString();
+ }
+
+ /**
+ * Generate Tie. Can only be called from {@link #compile}.
+ *
+ * @return the string, containing the text of the generated Tie.
+ */
+ public String generateTie()
+ {
+ String template;
+ if (poaMode)
+ template = getResource("Tie.jav");
+ else
+ template = getResource("ImplTie.jav");
+
+ // Generate methods.
+ StringBuffer b = new StringBuffer();
+ Iterator iter = methods.iterator();
+ while (iter.hasNext())
+ {
+ MethodGenerator m = (MethodGenerator) iter.next();
+ b.append(m.generateTieMethod());
+ }
+
+ vars.put("#tie_methods", b.toString());
+
+ vars.put("#imports", getImportStatements());
+
+ String output = replaceAll(template, vars);
+ return output;
+ }
+
+
+ /**
+ * Import the extra classes, used as the method parameters and return values.
+ *
+ * @return the additional import block.
+ */
+ protected String getImportStatements()
+ {
+ TreeSet imp = new TreeSet();
+
+ Iterator it = extraImports.iterator();
+ while (it.hasNext())
+ {
+ String ic = it.next().toString();
+ imp.add("import " + ic + ";\n");
+ }
+
+ StringBuffer b = new StringBuffer();
+ it = imp.iterator();
+
+ while (it.hasNext())
+ {
+ b.append(it.next());
+ }
+ return b.toString();
+ }
+
+ /**
+ * If this flag is set (true by default), the compiler generates the Servant
+ * based classes. If set to false, the compiler generates the old style
+ * ObjectImpl based classes.
+ */
+ public void setPoaMode(boolean mode)
+ {
+ poaMode = mode;
+ }
+
+ /**
+ * Set the verbose output mode (false by default)
+ *
+ * @param isVerbose the verbose output mode
+ */
+ public void setVerbose(boolean isVerbose)
+ {
+ verbose = isVerbose;
+ }
+
+ /**
+ * If this flag is set (true by default), the compiler emits warnings.
+ */
+ public void setWarnings(boolean warn)
+ {
+ warnings = warn;
+ }
+
+ /**
+ * Get the package name.
+ */
+ public String getPackageName()
+ {
+ return packag;
+ }
+
+ /**
+ * Get the proposed stub name
+ */
+ public String getStubName()
+ {
+ return stubName;
+ }
+}
diff --git a/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java b/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java
new file mode 100644
index 000000000..0000dd5b3
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/MethodGenerator.java
@@ -0,0 +1,275 @@
+/* MethodGenerator.java -- Generates methods for GIOP rmic compiler.
+ Copyright (C) 2006 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.classpath.tools.giop.grmic;
+
+import java.lang.reflect.Method;
+import java.util.Properties;
+
+/**
+ * Keeps information about the single method and generates the code fragments,
+ * related to that method.
+ *
+ * @author Audrius Meskauskas, Lithuania (audriusa@Bioinformatics.org)
+ */
+public class MethodGenerator
+{
+ /**
+ * The method being defined.
+ */
+ Method method;
+
+ /**
+ * The parent code generator.
+ */
+ GiopRmicCompiler rmic;
+
+ /**
+ * Create the new method generator for the given method.
+ *
+ * @param aMethod
+ * the related method.
+ * @param aRmic
+ * the Rmic generator instance, where more class - related
+ * information is defined.
+ */
+ public MethodGenerator(Method aMethod, GiopRmicCompiler aRmic)
+ {
+ method = aMethod;
+ rmic = aRmic;
+ }
+
+ /**
+ * Get the method name.
+ *
+ * @return the name of the method.
+ */
+ public String getGiopMethodName()
+ {
+ String m = method.getName();
+ if (m.startsWith("get"))
+ return "_get_J" + m.substring("get".length());
+ else if (m.startsWith("set"))
+ return "_set_J" + m.substring("set".length());
+ else
+ return m;
+ }
+
+ /**
+ * Get the method parameter declaration.
+ *
+ * @return the string - method parameter declaration.
+ */
+ public String getArgumentList()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the method parameter list only (no type declarations). This is used to
+ * generate the method invocations statement.
+ *
+ * @return the string - method parameter list.
+ */
+ public String getArgumentNames()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" p" + i);
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the list of exceptions, thrown by this method.
+ *
+ * @return the list of exceptions.
+ */
+ public String getThrows()
+ {
+ StringBuffer b = new StringBuffer();
+
+ Class[] args = method.getExceptionTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(rmic.name(args[i]));
+ if (i < args.length - 1)
+ b.append(", ");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Generate this method for the Stub class.
+ *
+ * @return the method body for the stub class.
+ */
+ public String generateStubMethod()
+ {
+ String templateName;
+
+ Properties vars = new Properties(rmic.vars);
+ vars.put("#return_type", rmic.name(method.getReturnType()));
+ vars.put("#method_name", method.getName());
+ vars.put("#giop_method_name", getGiopMethodName());
+ vars.put("#argument_list", getArgumentList());
+ vars.put("#argument_names", getArgumentNames());
+
+ vars.put("#argument_write", getStubParaWriteStatement());
+
+ if (method.getReturnType().equals(void.class))
+ vars.put("#read_return", "return;");
+ else
+ vars.put("#read_return",
+ "return "
+ + GiopIo.getReadStatement(method.getReturnType(), rmic));
+ String thr = getThrows();
+ if (thr.length() > 0)
+ vars.put("#throws", "\n throws " + thr);
+ else
+ vars.put("#throws", "");
+
+ if (method.getReturnType().equals(void.class))
+ templateName = "StubMethodVoid.jav";
+ else
+ {
+ vars.put("#write_result",
+ GiopIo.getWriteStatement(method.getReturnType(), "result",
+ rmic));
+ templateName = "StubMethod.jav";
+ }
+
+ String template = rmic.getResource(templateName);
+ String generated = rmic.replaceAll(template, vars);
+ return generated;
+ }
+
+ /**
+ * Generate this method handling fragment for the Tie class.
+ *
+ * @return the fragment to handle this method for the Tie class.
+ */
+ public String generateTieMethod()
+ {
+ String templateName;
+
+ Properties vars = new Properties(rmic.vars);
+ vars.put("#return_type", rmic.name(method.getReturnType()));
+ vars.put("#method_name", method.getName());
+ vars.put("#giop_method_name", getGiopMethodName());
+ vars.put("#argument_list", getArgumentList());
+ vars.put("#argument_names", getArgumentNames());
+
+ vars.put("#argument_write", getStubParaWriteStatement());
+
+ if (method.getReturnType().equals(void.class))
+ templateName = "TieMethodVoid.jav";
+ else
+ {
+ vars.put("#write_result",
+ GiopIo.getWriteStatement(method.getReturnType(), "result",
+ rmic));
+ templateName = "TieMethod.jav";
+ }
+ vars.put("#read_and_define_args", getRda());
+
+ String template = rmic.getResource(templateName);
+ String generated = rmic.replaceAll(template, vars);
+ return generated;
+ }
+
+ /**
+ * Generate sentences for Reading and Defining Arguments.
+ *
+ * @return the sequence of sentences for reading and defining arguments.
+ */
+ public String getRda()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" ");
+ b.append(rmic.name(args[i]));
+ b.append(" ");
+ b.append("p"+i);
+ b.append(" = ");
+ b.append(GiopIo.getReadStatement(args[i], rmic));
+ if (i<args.length-1)
+ b.append("\n");
+ }
+ return b.toString();
+ }
+
+ /**
+ * Get the write statement for writing parameters inside the stub.
+ *
+ * @return the write statement.
+ */
+ public String getStubParaWriteStatement()
+ {
+ StringBuffer b = new StringBuffer();
+ Class[] args = method.getParameterTypes();
+
+ for (int i = 0; i < args.length; i++)
+ {
+ b.append(" ");
+ b.append(GiopIo.getWriteStatement(args[i], "p" + i, rmic));
+ b.append("\n");
+ }
+ return b.toString();
+ }
+}
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav b/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav
new file mode 100644
index 000000000..aff606b90
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/ImplTie.jav
@@ -0,0 +1,152 @@
+package #package;
+
+#imports
+import java.rmi.Remote;
+import javax.rmi.PortableRemoteObject;
+import javax.rmi.CORBA.Tie;
+
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ResponseHandler;
+import org.omg.CORBA.portable.UnknownException;
+import org.omg.PortableServer.Servant;
+
+import org.omg.CORBA_2_3.portable.ObjectImpl;
+import org.omg.CORBA_2_3.portable.InputStream;
+
+// This Tie type is obsolete. Use the POA - based tie (key -poa).
+
+/**
+ * This class accepts remote calls to the served GIOP object and delegates them
+ * to the enclosed implementing class. Being derived from the ObjectImpl,
+ * it directly implements the GIOP Object.
+ *
+ * It is normally generated with grmic -impl
+ */
+public class _#nameImpl_Tie extends ObjectImpl implements Tie
+{
+ /**
+ * All decoded remote calls are forwarded to this target.
+ */
+ #implName target;
+
+ /**
+ * The array of repository ids, supported by this GIOP Object
+ */
+ private static final String[] type_ids =
+ {
+#idList
+ };
+
+ /**
+ * Get an array of all interfaces (repository ids),
+ * supported by this Object.
+ *
+ * @return the array of Ids.
+ */
+ public String[] _ids()
+ {
+ return type_ids;
+ }
+
+ /**
+ * Set the invocation target, where all received calls are finally
+ * forwarded.
+ *
+ * @param a_target the forwarding target
+ *
+ * @throws ClassCastException if the target is not an instance of
+ * #implName
+ */
+ public void setTarget(Remote a_target)
+ {
+ this.target = (#implName) a_target;
+ }
+
+ /**
+ * Get the invocation target, where all received calls are finally
+ * forwarded.
+ *
+ * @return the target, an instance of
+ * #implName
+ */
+ public Remote getTarget()
+ {
+ return target;
+ }
+
+ /**
+ * Return the actual GIOP object that would handle this request.
+ *
+ * @return <code>this</code>, always.
+ */
+ public org.omg.CORBA.Object thisObject()
+ {
+ return this;
+ }
+
+ /**
+ * Deactivates this object, disconnecting it from the orb.
+ */
+ public void deactivate()
+ {
+ _orb().disconnect(this);
+ _set_delegate(null);
+ target = null;
+ }
+
+ /**
+ * Get the {@link ORB} where this {@link Servant} is connected.
+ *
+ * @return the ORB
+ */
+ public ORB orb()
+ {
+ return _orb();
+ }
+
+ /**
+ * Connect this servant to the given ORB.
+ */
+ public void orb(ORB orb)
+ {
+ orb.connect(this);
+ }
+
+/**
+ * This method is invoked by ORB in response to the remote call. It redirects
+ * the call to one of the methods in the target.
+ *
+ * @param method the name of the method to call.
+ * @param parameter_stream the input stream, from where the parameters must be
+ * read.
+ * @param reply the response hander, providing methods to return the result.
+ *
+ * @return the output stream, created by the response handler
+ *
+ * @throws SystemException if one occurs during method invocation.
+ */
+ public OutputStream _invoke(String method,
+ org.omg.CORBA.portable.InputStream parameter_stream,
+ ResponseHandler reply)
+ {
+ try
+ {
+ InputStream in =(InputStream) parameter_stream;
+
+#tie_methods
+
+ throw new BAD_OPERATION("No such method: '"+method+"'");
+ }
+ catch (SystemException ex)
+ {
+ throw ex;
+ }
+ catch (Throwable ex)
+ {
+ throw new UnknownException(ex);
+ }
+ }
+} \ No newline at end of file
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav b/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav
new file mode 100644
index 000000000..371e12d44
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/Stub.jav
@@ -0,0 +1,47 @@
+package #package;
+
+#imports
+import java.rmi.UnexpectedException;
+
+import javax.rmi.CORBA.Stub;
+import javax.rmi.CORBA.Util;
+
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.portable.ApplicationException;
+import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.RemarshalException;
+
+import org.omg.CORBA_2_3.portable.OutputStream;
+
+/**
+ * This class delegates its method calls to the remote GIOP object.
+ * It is normally generated with grmic.
+ */
+public class _#name_Stub extends Stub
+ implements #interfaces
+{
+ /**
+ * Use serialVersionUID for interoperability.
+ */
+ private static final long serialVersionUID = 1;
+
+ /**
+ * The array of repository ids, supported by this GIOP Object
+ */
+ private static final String[] type_ids =
+ {
+#idList
+ };
+
+ /**
+ * Return the array of repository ids, supported by this GIOP Object.
+ *
+ * @return the array of Ids.
+ */
+ public String[] _ids()
+ {
+ return type_ids;
+ }
+
+#stub_methods
+} \ No newline at end of file
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav b/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav
new file mode 100644
index 000000000..17636deb6
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/StubMethod.jav
@@ -0,0 +1,33 @@
+ /** @inheritDoc */
+ public #return_type #method_name(#argument_list) #throws
+ {
+ try
+ {
+ InputStream in = null;
+ try
+ {
+ OutputStream out =
+ (OutputStream) _request("#giop_method_name", true);
+#argument_write
+ in = _invoke(out);
+ #read_return
+ }
+ catch (ApplicationException ex)
+ {
+ in = ex.getInputStream();
+ throw new UnexpectedException(in.read_string());
+ }
+ catch (RemarshalException ex)
+ {
+ return #method_name(#argument_names);
+ }
+ finally
+ {
+ _releaseReply(in);
+ }
+ }
+ catch (SystemException ex)
+ {
+ throw Util.mapSystemException(ex);
+ }
+ }
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav b/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav
new file mode 100644
index 000000000..0125a02b0
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/StubMethodVoid.jav
@@ -0,0 +1,32 @@
+ /** @inheritDoc */
+ public #return_type #method_name(#argument_list) #throws
+ {
+ try
+ {
+ InputStream in = null;
+ try
+ {
+ OutputStream out =
+ (OutputStream) _request("#giop_method_name", true);
+#argument_write
+ in = _invoke(out);
+ }
+ catch (ApplicationException ex)
+ {
+ in = ex.getInputStream();
+ throw new UnexpectedException(in.read_string());
+ }
+ catch (RemarshalException ex)
+ {
+ #method_name(#argument_names);
+ }
+ finally
+ {
+ _releaseReply(in);
+ }
+ }
+ catch (SystemException ex)
+ {
+ throw Util.mapSystemException(ex);
+ }
+ }
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav b/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav
new file mode 100644
index 000000000..267614f08
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/Tie.jav
@@ -0,0 +1,181 @@
+package #package;
+
+#imports
+import java.rmi.Remote;
+import javax.rmi.PortableRemoteObject;
+import javax.rmi.CORBA.Tie;
+
+import org.omg.CORBA.BAD_OPERATION;
+import org.omg.CORBA.ORB;
+import org.omg.CORBA.SystemException;
+import org.omg.CORBA.portable.OutputStream;
+import org.omg.CORBA.portable.ResponseHandler;
+import org.omg.CORBA.portable.UnknownException;
+import org.omg.PortableServer.Servant;
+import org.omg.PortableServer.POA;
+import org.omg.PortableServer.POAPackage.WrongPolicy;
+import org.omg.PortableServer.POAPackage.ObjectNotActive;
+import org.omg.PortableServer.POAPackage.ServantNotActive;
+
+import org.omg.CORBA_2_3.portable.InputStream;
+
+/**
+ * This class accepts remote calls to the served GIOP object and delegates them
+ * to the enclosed implementing class. Being servant, it must be connected to
+ * the ORB Poa.
+ * It is normally generated with grmic -poa
+ */
+public class _#nameImpl_Tie extends Servant implements Tie
+{
+ /**
+ * All decoded remote calls are forwarded to this target.
+ */
+ #implName target;
+
+ /**
+ * The array of repository ids, supported by this GIOP Object
+ */
+ private static final String[] type_ids =
+ {
+#idList
+ };
+
+ /**
+ * Get an array of all interfaces, supported by this
+ * {@link Servant}.
+ *
+ * @param poa unused
+ * @param objectId unused
+ *
+ * @return the array of Ids.
+ */
+ public String[] _all_interfaces(POA poa,
+ byte[] objectId
+ )
+ {
+ return type_ids;
+ }
+
+
+ /**
+ * Set the invocation target, where all received calls are finally
+ * forwarded.
+ *
+ * @param a_target the forwarding target
+ *
+ * @throws ClassCastException if the target is not an instance of
+ * #implName
+ */
+ public void setTarget(Remote a_target)
+ {
+ this.target = (#implName) a_target;
+ }
+
+ /**
+ * Get the invocation target, where all received calls are finally
+ * forwarded.
+ *
+ * @return the target, an instance of
+ * #implName
+ */
+ public Remote getTarget()
+ {
+ return target;
+ }
+
+ /**
+ * Return the actual GIOP object that would handle this request.
+ *
+ * @return the GIOP object.
+ */
+ public org.omg.CORBA.Object thisObject()
+ {
+ return _this_object();
+ }
+
+ /**
+ * Deactivate this {@link Servant}. The WrongPolicy, ObjectNotActive
+ * and ServantNotActive exceptions, if thrown during deactivation, are
+ * catched and silently ignored.
+ */
+ public void deactivate()
+ {
+ try
+ {
+ _poa().deactivate_object(_poa().servant_to_id(this));
+ }
+ catch (WrongPolicy exception)
+ {
+ }
+ catch (ObjectNotActive exception)
+ {
+ }
+ catch (ServantNotActive exception)
+ {
+ }
+ }
+
+ /**
+ * Get the {@link ORB} where this {@link Servant} is connected.
+ *
+ * @return the ORB
+ */
+ public ORB orb()
+ {
+ return _orb();
+ }
+
+ /**
+ * Connect this servant to the given ORB. It is recommended to connect
+ * servant to the ORBs root or other POA rather than using this method.
+ */
+ public void orb(ORB orb)
+ {
+ try
+ {
+ ((org.omg.CORBA_2_3.ORB) orb).set_delegate(this);
+ }
+ catch (ClassCastException e)
+ {
+ throw new org.omg.CORBA.BAD_PARAM(
+ "POA Servant requires an instance of org.omg.CORBA_2_3.ORB"
+ );
+ }
+ }
+
+/**
+ * This method is invoked by ORB in response to the remote call. It redirects
+ * the call to one of the methods in the target.
+ *
+ * @param method the name of the method to call.
+ * @param parameter_stream the input stream, from where the parameters must be
+ * read.
+ * @param reply the response hander, providing methods to return the result.
+ *
+ * @return the output stream, created by the response handler
+ *
+ * @throws SystemException if one occurs during method invocation.
+ */
+ public OutputStream _invoke(String method,
+ org.omg.CORBA.portable.InputStream parameter_stream,
+ ResponseHandler reply
+ ) throws SystemException
+ {
+ try
+ {
+ InputStream in =(InputStream) parameter_stream;
+
+#tie_methods
+
+ throw new BAD_OPERATION("No such method: '"+method+"'");
+ }
+ catch (SystemException ex)
+ {
+ throw ex;
+ }
+ catch (Throwable ex)
+ {
+ throw new UnknownException(ex);
+ }
+ }
+} \ No newline at end of file
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav b/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav
new file mode 100644
index 000000000..3d174af2e
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/TieMethod.jav
@@ -0,0 +1,9 @@
+ // #method_name
+ if (method.equals("#giop_method_name"))
+ {
+#read_and_define_args
+ OutputStream out = reply.createReply();
+ #return_type result = target.#method_name(#argument_names);
+ #write_result
+ return out;
+ }
diff --git a/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav b/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav
new file mode 100644
index 000000000..d93b95713
--- /dev/null
+++ b/tools/gnu/classpath/tools/giop/grmic/templates/TieMethodVoid.jav
@@ -0,0 +1,8 @@
+ // #method_name
+ if (method.equals("#giop_method_name"))
+ {
+#read_and_define_args
+ OutputStream out = reply.createReply();
+ target.#method_name(#argument_names);
+ return out;
+ }