Main.java (main): Handle '-p'.

libjava:
	* gnu/gcj/tools/gcj_dbtool/Main.java (main): Handle '-p'.
	(usage): Document '-p'.
	* Makefile.in: Rebuilt.
	* Makefile.am (dbexecdir): New variable.
	(db_name): Likewise.
	(dbexec_DATA): Likewise.
	($(db_name)): New target.
	(AM_CXXFLAGS): Define LIBGCJ_DEFAULT_DATABASE.
	* java/lang/natRuntime.cc (insertSystemProperties): Set default
	system database.
gcc/java:
	* gcj.texi (Invoking gcj-dbtool): Document 'gcj-dbtool -p'.
	(libgcj Runtime Properties): Document the default .db.

From-SVN: r96303
This commit is contained in:
Tom Tromey 2005-03-11 17:35:37 +00:00 committed by Tom Tromey
parent 0ac40e7a86
commit 558b8548b4
7 changed files with 106 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2005-03-11 Tom Tromey <tromey@redhat.com>
* gcj.texi (Invoking gcj-dbtool): Document 'gcj-dbtool -p'.
(libgcj Runtime Properties): Document the default .db.
2005-03-10 Ranjit Mathew <rmathew@hotmail.com>
PR java/20312

View File

@ -991,7 +991,7 @@ Each time a class is initialized, print a short message on standard error.
gcj-dbtool @option{OPTION} @var{DBFILE} [@option{MORE}] @dots{}
gcj-dbtool [@option{-n}] [@option{-a}] [@option{-f}]
[@option{-t}] [@option{-l}]
[@option{-t}] [@option{-l}] [@option{-p}]
[@option{-v}] [@option{--version}] [@option{--help}]
@c man end
@ -1043,6 +1043,10 @@ Test a database.
@item -l @var{DBFILE}
List the contents of a database.
@item -p
Print the name of the default database. If there is no default
database, this prints a blank line.
@item --help
Print a help message, then exit.
@ -2531,7 +2535,8 @@ be set to a directory that is writable by any other user.
This is a sequence of file names, each referring to a file created by
@command{gcj-dbtool}. These files will be used by @code{libgcj} to
find shared libraries corresponding to classes that are loaded from
bytecode.
bytecode. @code{libgcj} often has a built-in default database; it
can be queried using @code{gcj-dbtool -p}.
@end table

View File

@ -1,3 +1,16 @@
2005-03-11 Tom Tromey <tromey@redhat.com>
* gnu/gcj/tools/gcj_dbtool/Main.java (main): Handle '-p'.
(usage): Document '-p'.
* Makefile.in: Rebuilt.
* Makefile.am (dbexecdir): New variable.
(db_name): Likewise.
(dbexec_DATA): Likewise.
($(db_name)): New target.
(AM_CXXFLAGS): Define LIBGCJ_DEFAULT_DATABASE.
* java/lang/natRuntime.cc (insertSystemProperties): Set default
system database.
2005-03-10 Bryce McKinlay <mckinlay@redhat.com>
* exception.cc: Remove stray MethodRef.h include.

View File

@ -123,9 +123,18 @@ secdir = $(libdir)/security
## Where to install default logging property file.
propdir = $(libdir)
## Where the standard .db file is found.
dbexecdir = $(libdir)/gcj-@gcc_version@
## Name of the default .db.
db_name = classmap.db
## For now, only on native systems. FIXME.
if NATIVE
bin_PROGRAMS = jv-convert gij grmic grmiregistry gcj-dbtool
## It is convenient to actually build and install the default database
## when gcj-dbtool is available.
dbexec_DATA = $(db_name)
endif
bin_SCRIPTS = addr2name.awk
@ -171,7 +180,8 @@ AM_CXXFLAGS = \
-DPREFIX="\"$(prefix)\"" \
-DLIBDIR="\"$(libdir)\"" \
-DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\"" \
-DJAVA_EXT_DIRS="\"$(jardir)/ext\""
-DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
-DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\""
AM_GCJFLAGS = \
@LIBGCJ_JAVAFLAGS@ \
@ -250,6 +260,17 @@ libgcj_la_DEPENDENCIES = libgcj-@gcc_version@.jar \
$(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
## The .db file. This rule is only used for native builds, so it is
## safe to invoke gcj-dbtool.
$(db_name): gcj-dbtool
## In case it exists already.
@rm -f $(db_name)
## We don't actually care if it fails -- if it does, just make an
## empty file. This is simpler than trying to discover when mmap is
## not available.
./gcj-dbtool -n $(db_name) || touch $(db_name)
# Gtk/Cairo JNI sources.
if GTK_CAIRO
gtk_cairo_c_source_files = \

View File

@ -93,8 +93,9 @@ am__vpath_adj = case $$p in \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(bindir)" "$(DESTDIR)$(jardir)" \
"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(toolexecmainlibdir)"
"$(DESTDIR)$(bindir)" "$(DESTDIR)$(dbexecdir)" \
"$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" \
"$(DESTDIR)$(toolexecmainlibdir)"
toolexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES)
am__dirstamp = $(am__leading_dot)dirstamp
@ -4817,10 +4818,12 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
dbexecDATA_INSTALL = $(INSTALL_DATA)
jarDATA_INSTALL = $(INSTALL_DATA)
pkgconfigDATA_INSTALL = $(INSTALL_DATA)
toolexecmainlibDATA_INSTALL = $(INSTALL_DATA)
DATA = $(jar_DATA) $(pkgconfig_DATA) $(toolexecmainlib_DATA)
DATA = $(dbexec_DATA) $(jar_DATA) $(pkgconfig_DATA) \
$(toolexecmainlib_DATA)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = @DIRLTDL@ gcj include external testsuite
@ -5109,6 +5112,9 @@ jardir = $(datadir)/java
jar_DATA = libgcj-@gcc_version@.jar
secdir = $(libdir)/security
propdir = $(libdir)
dbexecdir = $(libdir)/gcj-@gcc_version@
db_name = classmap.db
@NATIVE_TRUE@dbexec_DATA = $(db_name)
bin_SCRIPTS = addr2name.awk
GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8 -Wno-deprecated
GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
@ -5129,7 +5135,8 @@ AM_CXXFLAGS = \
-DPREFIX="\"$(prefix)\"" \
-DLIBDIR="\"$(libdir)\"" \
-DBOOT_CLASS_PATH="\"$(jardir)/$(jar_DATA)\"" \
-DJAVA_EXT_DIRS="\"$(jardir)/ext\""
-DJAVA_EXT_DIRS="\"$(jardir)/ext\"" \
-DLIBGCJ_DEFAULT_DATABASE="\"$(dbexecdir)/$(db_name)\""
AM_GCJFLAGS = \
@LIBGCJ_JAVAFLAGS@ \
@ -25751,6 +25758,23 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-dbexecDATA: $(dbexec_DATA)
@$(NORMAL_INSTALL)
test -z "$(dbexecdir)" || $(mkdir_p) "$(DESTDIR)$(dbexecdir)"
@list='$(dbexec_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(dbexecDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(dbexecdir)/$$f'"; \
$(dbexecDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(dbexecdir)/$$f"; \
done
uninstall-dbexecDATA:
@$(NORMAL_UNINSTALL)
@list='$(dbexec_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(dbexecdir)/$$f'"; \
rm -f "$(DESTDIR)$(dbexecdir)/$$f"; \
done
install-jarDATA: $(jar_DATA)
@$(NORMAL_INSTALL)
test -z "$(jardir)" || $(mkdir_p) "$(DESTDIR)$(jardir)"
@ -26070,7 +26094,7 @@ check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(toolexecmainlibdir)"; do \
for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(dbexecdir)" "$(DESTDIR)$(jardir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(toolexecmainlibdir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-recursive
@ -26453,7 +26477,8 @@ install-data-am: install-data-local install-jarDATA \
install-pkgconfigDATA
install-exec-am: install-binPROGRAMS install-binSCRIPTS \
install-toolexeclibLTLIBRARIES install-toolexecmainlibDATA
install-dbexecDATA install-toolexeclibLTLIBRARIES \
install-toolexecmainlibDATA
install-info: install-info-recursive
@ -26482,8 +26507,9 @@ ps: ps-recursive
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-info-am uninstall-jarDATA uninstall-pkgconfigDATA \
uninstall-toolexeclibLTLIBRARIES uninstall-toolexecmainlibDATA
uninstall-dbexecDATA uninstall-info-am uninstall-jarDATA \
uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES \
uninstall-toolexecmainlibDATA
uninstall-info: uninstall-info-recursive
@ -26497,9 +26523,10 @@ uninstall-info: uninstall-info-recursive
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-binSCRIPTS \
install-data install-data-am install-data-local install-exec \
install-exec-am install-info install-info-am install-jarDATA \
install-man install-pkgconfigDATA install-strip \
install-data install-data-am install-data-local \
install-dbexecDATA install-exec install-exec-am install-info \
install-info-am install-jarDATA install-man \
install-pkgconfigDATA install-strip \
install-toolexeclibLTLIBRARIES install-toolexecmainlibDATA \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic \
@ -26507,11 +26534,15 @@ uninstall-info: uninstall-info-recursive
mostlyclean-generic mostlyclean-libtool mostlyclean-local \
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-binSCRIPTS uninstall-info-am uninstall-jarDATA \
uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES \
uninstall-toolexecmainlibDATA
uninstall-binSCRIPTS uninstall-dbexecDATA uninstall-info-am \
uninstall-jarDATA uninstall-pkgconfigDATA \
uninstall-toolexeclibLTLIBRARIES uninstall-toolexecmainlibDATA
$(db_name): gcj-dbtool
@rm -f $(db_name)
./gcj-dbtool -n $(db_name) || touch $(db_name)
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics.h: gnu/java/awt/peer/gtk/GdkGraphics.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphics2D.h: gnu/java/awt/peer/gtk/GdkGraphics2D.java
jniinclude/gnu_java_awt_peer_gtk_GdkGraphicsEnvironment.h: gnu/java/awt/peer/gtk/GdkGraphicsEnvironment.java

View File

@ -256,7 +256,16 @@ public class Main
}
return;
}
if (s[0].equals("-p"))
{
insist (s.length == 1);
String result = System.getProperty("gnu.gcj.precompiled.db.path",
"");
System.out.println (result);
return;
}
usage(System.err);
System.exit(1);
}
@ -284,6 +293,7 @@ public class Main
+ " gcj-dbtool -t file.gcjdb - Test a gcj map database\n"
+ " gcj-dbtool -l file.gcjdb - List a gcj map database\n"
+ " gcj-dbtool -m dest.gcjdb [source.gcjdb]...\n"
+ " gcj-dbtool -p - Print default database name\n"
+ " - Merge gcj map databases into dest\n"
+ " Replaces dest\n"
+ " To add to dest, include dest in the list of sources");

View File

@ -531,6 +531,9 @@ java::lang::Runtime::insertSystemProperties (java::util::Properties *newprops)
// The path to libgcj's boot classes
SET ("sun.boot.class.path", BOOT_CLASS_PATH);
// If there is a default system database, set it.
SET ("gnu.gcj.precompiled.db.path", LIBGCJ_DEFAULT_DATABASE);
// 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