This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: allow default .db for libgcj
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 07 Mar 2005 15:52:08 -0700
- Subject: Patch: RFA: allow default .db for libgcj
- Reply-to: tromey at redhat dot com
We would like to be able to set a default .db for use by libgcj, so
that we can more easily set up 'gij' as an alternative to the 'java'
command in OS builds. Without this, we have to modify startup scripts
and the like to pass a special -D option to 'gij'.
This patch implements the required configure switch. At the moment I
think it is premature to have a gcc-supplied default .db, so the
current default is not to have one.
Ok to commit? I'm asking in particular because of the change to
install.texi.
I would like to commit this to the 4.0 branch as well, so that gcj 4.0
is more useful to FC. Failing that I suppose we can put it on the RH
branch.
Tom
Index: gcc/ChangeLog
from Tom Tromey <tromey@redhat.com>
* doc/install.texi (Configuration): Document
--enable-libgcj-database.
Index: libjava/ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/natRuntime.cc (insertSystemProperties): Set default
system database.
* include/config.h.in: Rebuilt.
* configure: Rebuilt.
* configure.ac (--enable-libgcj-database): Recognize.
(LIBGCJ_DEFAULT_DATABASE): Define.
Index: gcc/doc/install.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/install.texi,v
retrieving revision 1.336
diff -u -r1.336 install.texi
--- gcc/doc/install.texi 21 Feb 2005 10:03:07 -0000 1.336
+++ gcc/doc/install.texi 7 Mar 2005 22:37:43 -0000
@@ -42,7 +42,7 @@
@settitle Installing GCC: GNU Free Documentation License
@end ifset
-@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2005,
@c 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
@@ -1279,6 +1279,12 @@
@item --disable-getenv-properties
Don't set system properties from @env{GCJ_PROPERTIES}.
+@item --enable-libgcj-database=@var{file}
+This option, if provided, sets @samp{libgcj}'s default class lookup
+database to be the indicated file. This must be a @file{.db} file as
+created by @samp{gcj-dbtool}. If this option is not provided, then
+@samp{libgcj} will not have a default class lookup database.
+
@item --enable-hash-synchronization
Use a global hash table for monitor locks. Ordinarily,
@samp{libgcj}'s @samp{configure} script automatically makes
Index: libjava/configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.ac,v
retrieving revision 1.19
diff -u -r1.19 configure.ac
--- libjava/configure.ac 23 Feb 2005 01:05:45 -0000 1.19
+++ libjava/configure.ac 7 Mar 2005 22:38:04 -0000
@@ -195,6 +195,16 @@
AC_DEFINE(DISABLE_MAIN_ARGS, 1, [Define if we should ignore arguments to main().])
fi
+# The default database, if any.
+AC_ARG_ENABLE(libgcj-database,
+ AS_HELP_STRING([--enable-libgcj-database],
+ [set default class lookup database]))
+
+if test -n "$enable_libgcj_database"; then
+ AC_DEFINE_UNQUOTED(LIBGCJ_DEFAULT_DATABASE, "$enable_libgcj_database",
+ [Define as path to the default system database.])
+fi
+
# Should we use hashtable-based synchronization?
# Currently works only for Linux X86/ia64
Index: libjava/include/config.h.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/config.h.in,v
retrieving revision 1.59
diff -u -r1.59 config.h.in
--- libjava/include/config.h.in 19 Dec 2004 16:26:06 -0000 1.59
+++ libjava/include/config.h.in 7 Mar 2005 22:38:05 -0000
@@ -373,6 +373,9 @@
/* Indicate that linker is not able to 8-byte align static data */
#undef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS
+/* Define as path to the default system database. */
+#undef LIBGCJ_DEFAULT_DATABASE
+
/* Define if we want to use debug calls into the garbage collector. */
#undef LIBGCJ_GC_DEBUG
Index: libjava/java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.47
diff -u -r1.47 natRuntime.cc
--- libjava/java/lang/natRuntime.cc 23 Feb 2005 17:36:25 -0000 1.47
+++ libjava/java/lang/natRuntime.cc 7 Mar 2005 22:38:05 -0000
@@ -553,6 +553,11 @@
// The path to libgcj's boot classes
SET ("sun.boot.class.path", BOOT_CLASS_PATH);
+ // If there is a default system database, set it.
+#ifdef LIBGCJ_DEFAULT_DATABASE
+ SET ("gnu.gcj.precompiled.db.path", LIBGCJ_DEFAULT_DATABASE);
+#endif
+
// Set some properties according to whatever was compiled in with
// `-D'. Important: after this point, the only properties that
// should be set are those which either the user cannot meaningfully