This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFA, RFT: enable tools using CNI
Hi,
Tom Tromey wrote:
"Tom" == Thomas Fitzsimmons <fitzsim@redhat.com> writes:
Tom> +libgcj_tools_la_GCJFLAGS = -findirect-dispatch -classpath libgcj-$(gcc_version).jar
The -classpath here seems odd. Ordinarily -bootclasspath would be
preferred.
I suppose this is because using libgcj_tools_la_GCJFLAGS means that
AM_GCJFLAGS won't be used. How about removing the -classpath argument
(and the _DEPENDENCIES variable) and adding $(AM_GCJFLAGS) instead?
Good point. Attached patch committed.
Tom
2006-06-30 Thomas Fitzsimmons <fitzsim@redhat.com>
* classpath/tools/Makefile.am: Comment out tools wrapper creation.
(TOOLS_ZIP): Rename tools.zip tools.jar.
(noinst_DATA): Do not install tools.jar.
* classpath/tools/Makefile.in: Regenerate.
* classpath/Makefile.am (SUBDIRS): Add tools.
(DIST_SUBDIRS): Likewise.
* classpath/Makefile.in: Regenerate.
* Makefile.am (toolexeclib_LTLIBRARIES): Add libgcj-tools.la.
(jar_DATA): Add libgcj-tools-$(gcc_version).jar.
(bin_PROGRAMS): Add gappletviewer, gjarsigner and gkeytool.
Add build logic for libgcj-tools.la,
libgcj-tools-$(gcc_version).jar and gappletviewer, gjarsigner and
gkeytool.
* Makefile.in: Regenerate.
Index: classpath/tools/Makefile.am
===================================================================
--- classpath/tools/Makefile.am (revision 115087)
+++ classpath/tools/Makefile.am (working copy)
@@ -21,67 +21,60 @@
endif
endif
-if CREATE_WRAPPERS
-bin_SCRIPTS =
-bin_PROGRAMS = gappletviewer gjarsigner gkeytool
+## GCJ LOCAL: do not build and install wrapper binaries here, since
+## the build ordering will not work. Instead build them in
+## gcc/libjava/Makefile.am.
+# if CREATE_WRAPPERS
+# bin_SCRIPTS =
+# bin_PROGRAMS = gappletviewer gjarsigner gkeytool
-if FOUND_GCJ
-LIBJVM = -lgcj
-else
-if FOUND_CACAO
-LIBJVM = -ljvm
-else
-LIBJVM =
-endif
-endif
+# if FOUND_GCJ
+# LIBJVM = -lgcj
+# else
+# if FOUND_CACAO
+# LIBJVM = -ljvm
+# else
+# LIBJVM =
+# endif
+# endif
-# Some architecture independent data to be installed.
-TOOLS_DATA = $(TOOLS_ZIP)
+# AM_CPPFLAGS = -Wall \
+# -I$(top_srcdir)/include \
+# -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\""
-# Where we want these data files installed.
-## GCJ LOCAL: install libgcj-tools.jar alongside libgcj.jar.
-TOOLSdir = $(datadir)/java
+# gappletviewer_SOURCES = toolwrapper.c
+# gappletviewer_CFLAGS = \
+# -DTOOLPACKAGE="\"appletviewer\"" \
+# -DTOOLNAME="\"gappletviewer\""
+# gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
-# The zip files with classes we want to produce.
-## GCJ LOCAL: rename tools.zip libgcj-tools-$(gcc_version).jar
-TOOLS_ZIP = libgcj-tools-$(gcc_version).jar
+# gjarsigner_SOURCES = toolwrapper.c
+# gjarsigner_CFLAGS = \
+# -DTOOLPACKAGE="\"jarsigner\"" \
+# -DTOOLNAME="\"gjarsigner\""
+# gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
-## GCJ LOCAL: calculate GCC version
-gcc_version := $(shell cat $(top_srcdir)/../../gcc/BASE-VER)
+# gkeytool_SOURCES = toolwrapper.c
+# gkeytool_CFLAGS = \
+# -DTOOLPACKAGE="\"keytool\"" \
+# -DTOOLNAME="\"gkeytool\""
+# gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
-gappletviewer_SOURCES = toolwrapper.c
-gappletviewer_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"appletviewer\"" \
- -DTOOLNAME="\"gappletviewer\""
-gappletviewer_LDFLAGS = -L$(libdir) $(LIBJVM)
+# else
+# bin_SCRIPTS = gappletviewer gjarsigner gkeytool
+# bin_PROGRAMS =
+# endif
+EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in
-gjarsigner_SOURCES = toolwrapper.c
-gjarsigner_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"jarsigner\"" \
- -DTOOLNAME="\"gjarsigner\""
-gjarsigner_LDFLAGS = -L$(libdir) $(LIBJVM)
+# All our example java source files
+TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
-gkeytool_SOURCES = toolwrapper.c
-gkeytool_CFLAGS = -Wall \
- -I$(top_srcdir)/include \
- -DTOOLS_ZIP="\"$(TOOLSdir)/$(TOOLS_ZIP)\"" \
- -DTOOLPACKAGE="\"keytool\"" \
- -DTOOLNAME="\"gkeytool\""
-gkeytool_LDFLAGS = -L$(libdir) $(LIBJVM)
+# The zip files with classes we want to produce.
-else
-bin_SCRIPTS = appletviewer jarsigner keytool
-bin_PROGRAMS =
-endif
-EXTRA_DIST = toolwrapper.c appletviewer.in jarsigner.in keytool.in
+## GCJ LOCAL: rename this tools.jar for libgcj_tools_la_SOURCES in
+## gcc/libjava/Makefile.am.
+TOOLS_ZIP = tools.jar
-# All our example java source files
-TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*.java $(srcdir)/gnu/classpath/tools/*/*.java $(srcdir)/gnu/classpath/tools/*/*/*.java
-
# Extra objects that will not exist until configure-time
BUILT_SOURCES = $(TOOLS_ZIP)
@@ -103,6 +96,16 @@
# All the files we find "interesting"
ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(TOOLS_TEMPLATES) $(TOOLS_HELPS)
+## GCJ LOCAL: build tools.zip but do not install it. It is installed
+## in gcc/libjava/Makefile.am.
+# # Some architecture independent data to be installed.
+# TOOLS_DATA = $(TOOLS_ZIP)
+noinst_DATA = $(TOOLS_ZIP)
+
+# Where we want these data files installed.
+## GCJ LOCAL: install libgcj-tools.jar alongside libgcj.jar.
+# TOOLSdir = $(datadir)/java
+
# Make sure everything is included in the distribution.
dist-hook:
srcdir_cnt=`echo $(srcdir) | wc -c`; \
@@ -121,6 +124,7 @@
# the class files. Always regenerate all .class files and remove them
# immediately. And copy the template files we use to the classes dir
# so they get also included.
+## GCJ LOCAL: assume FASTJAR since we pass --with-fastjar to configure
$(TOOLS_ZIP): $(TOOLS_JAVA_FILES)
mkdir -p classes/gnu/classpath/tools/giop/grmic/templates
mkdir -p classes/gnu/classpath/tools/rmi/rmic/templates
Index: classpath/Makefile.am
===================================================================
--- classpath/Makefile.am (revision 115087)
+++ classpath/Makefile.am (working copy)
@@ -1,9 +1,8 @@
## Input file for automake to generate the Makefile.in used by configure
# lib first, to compile .class files before native code, last examples
-## GCJ LOCAL: exclude tools directory
-SUBDIRS = lib doc external include native resource scripts $(EXAMPLESDIR)
-DIST_SUBDIRS = lib doc external include native resource scripts examples
+SUBDIRS = lib doc external include native resource scripts tools $(EXAMPLESDIR)
+DIST_SUBDIRS = lib doc external include native resource scripts tools examples
## GCJ LOCAL: we need an extra -I here.
ACLOCAL_AMFLAGS = -I m4 -I ../.. -I ../../config
Index: Makefile.am
===================================================================
--- Makefile.am (revision 115087)
+++ Makefile.am (working copy)
@@ -33,7 +33,7 @@
## What gets installed, and where.
##
-toolexeclib_LTLIBRARIES = libgcj.la libgij.la
+toolexeclib_LTLIBRARIES = libgcj.la libgij.la libgcj-tools.la
toolexecmainlib_DATA = libgcj.spec
if XLIB_AWT
@@ -46,7 +46,7 @@
pkgconfig_DATA = libgcj.pc
jardir = $(datadir)/java
-jar_DATA = libgcj-$(gcc_version).jar
+jar_DATA = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
if JAVA_HOME_SET
JAVA_HOME_DIR = $(JAVA_HOME)
@@ -68,7 +68,8 @@
## For now, only on native systems. FIXME.
if NATIVE
-bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
+bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool \
+ gappletviewer gjarsigner gkeytool
## It is convenient to actually build and install the default database
## when gcj-dbtool is available.
@@ -234,6 +235,12 @@
$(LIBLTDL) $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
+libgcj_tools_la_SOURCES = classpath/tools/tools.jar
+libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findirect-dispatch
+libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
+ -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+libgcj_tools_la_LINK = $(LIBLINK)
+
## libjvm.so
libjvm_la_SOURCES = jni-libjvm.cc
libjvm_la_DEPENDENCIES = libgcj.la libgcj.spec
@@ -282,7 +289,10 @@
cd classpath/lib; $(JAR) -cfM \
../../libgcj-$(gcc_version).jar gnu java javax org
-CLEANFILES = libgcj-$(gcc_version).jar
+libgcj-tools-$(gcc_version).jar: classpath/tools/tools.jar
+ cp $< $@
+
+CLEANFILES = libgcj-$(gcc_version).jar libgcj-tools-$(gcc_version).jar
DISTCLEANFILES = native.dirs
mostlyclean-local:
@@ -721,6 +731,39 @@
## linking this program.
grmiregistry_DEPENDENCIES = libgcj.la libgcj.spec
+## This is a dummy definition.
+gappletviewer_SOURCES =
+gappletviewer_LDFLAGS = --main=gnu.classpath.tools.appletviewer.Main \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+gappletviewer_LINK = $(GCJLINK)
+## See jv_convert_LDADD.
+gappletviewer_LDADD = -L$(here)/.libs libgcj-tools.la
+## Depend on the spec file to make sure it is up to date before
+## linking this program.
+gappletviewer_DEPENDENCIES = libgcj-tools.la
+
+## This is a dummy definition.
+gjarsigner_SOURCES =
+gjarsigner_LDFLAGS = --main=gnu.classpath.tools.jarsigner.Main \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+gjarsigner_LINK = $(GCJLINK)
+## See jv_convert_LDADD.
+gjarsigner_LDADD = -L$(here)/.libs libgcj-tools.la
+## Depend on the spec file to make sure it is up to date before
+## linking this program.
+gjarsigner_DEPENDENCIES = libgcj-tools.la
+
+## This is a dummy definition.
+gkeytool_SOURCES =
+gkeytool_LDFLAGS = --main=gnu.classpath.tools.keytool.Main \
+ -rpath $(toolexeclibdir) -shared-libgcc $(THREADLDFLAGS)
+gkeytool_LINK = $(GCJLINK)
+## See jv_convert_LDADD.
+gkeytool_LDADD = -L$(here)/.libs libgcj-tools.la
+## Depend on the spec file to make sure it is up to date before
+## linking this program.
+gkeytool_DEPENDENCIES = libgcj-tools.la
+
## ################################################################
## This lists all the C++ source files in subdirectories.