This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[ecj] Patch: FYI: libgcj build tweaks
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 04 Jun 2006 19:44:57 -0600
- Subject: [ecj] Patch: FYI: libgcj build tweaks
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcj-eclipse branch.
This changes the libgcj build for ecj-ification. In particular we now
only compile from .class to object.
This is the last of my current ecj patches. Once I post the patch to
ecj itself you ought to be able to build libgcj with ecj.
I have a second set of patches for compiling using the classpath
generics branch. I'm considering checking all this in and switching
everything all at once. Let me know what you think of this.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* sources.am, Makefile.in: Rebuilt.
* Makefile.am (gcj_dbtool_LDADD): Add
gnu-gcj-tools-gcj_dbtool.lo.
(gcj_dbtool_SOURCES): Updated.
(EXTRA_libgcj_la_SOURCES): New macro.
* scripts/makemake.tcl (emit_package_rule): Compile class files
from the package.
(gcj_dbtool/Main.java, Class.java, Object.java): Removed
package_map settings.
(emit_package_rule): Special case gnu.gcj.tools.gcj_dbtool.
Index: scripts/makemake.tcl
===================================================================
--- scripts/makemake.tcl (revision 114362)
+++ scripts/makemake.tcl (working copy)
@@ -60,15 +60,6 @@
set package_map(gnu/CORBA) bc
set package_map(gnu/javax/rmi) bc
-# This is handled specially by the Makefile.
-# We still want it byte-compiled so it isn't in the .omit file.
-set package_map(gnu/gcj/tools/gcj_dbtool/Main.java) ignore
-
-# These are handled specially. If we list Class.java with other files
-# in java.lang, we hit a compiler bug.
-set package_map(java/lang/Class.java) ignore
-set package_map(java/lang/Object.java) ignore
-
# More special cases. These end up in their own library.
# Note that if we BC-compile AWT we must update these as well.
set package_map(gnu/gcj/xlib) package
@@ -280,17 +271,14 @@
# A rule to make the phony file we are going to compile.
puts "$lname: \$($varname)"
puts "\t@\$(mkinstalldirs) \$(dir \$@)"
- puts "\t@for file in \$($varname); do \\"
- puts "\t if test -f \$(srcdir)/\$\$file; then \\"
- puts "\t echo \$(srcdir)/\$\$file; \\"
- puts "\t else echo \$\$file; fi; \\"
- puts "\tdone > $lname"
+ puts "\techo classpath/lib/$package/*.class > $lname"
puts ""
puts "-include $dname"
puts ""
puts ""
- if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"} {
+ if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"
+ && $pkgname != "gnu/gcj/tools/gcj_dbtool"} {
lappend package_files $lname
}
}
Index: Makefile.am
===================================================================
--- Makefile.am (revision 114362)
+++ Makefile.am (working copy)
@@ -180,7 +180,6 @@
libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
link.cc defineclass.cc interpret.cc verify.cc \
- java/lang/Class.java java/lang/Object.java \
$(nat_source_files)
if USING_BOEHMGC
@@ -236,7 +235,12 @@
$(LIBLTDL) $(libgcj_la_LIBADD)
libgcj_la_LINK = $(LIBLINK)
+## A hack to make sure the various gcj-related macros, like
+## LTGCJCOMPILE, are defined by automake. This is never actually
+## compiled.
+EXTRA_libgcj_la_SOURCES = java/lang/Object.java
+
## The .db file. This rule is only used for native builds, so it is
## safe to invoke gcj-dbtool.
$(db_name): gcj-dbtool$(EXEEXT)
@@ -671,7 +675,6 @@
jv_convert_DEPENDENCIES = libgcj.la libgcj.spec
gcj_dbtool_SOURCES = \
-gnu/gcj/tools/gcj_dbtool/Main.java \
gnu/gcj/tools/gcj_dbtool/natMain.cc
## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'. We
@@ -687,7 +690,7 @@
## searched before the build-tree ones, and we'd get errors because of
## different libraries with the same SONAME from picky linkers such as
## Solaris'. FIXME: should be _libs on some systems.
-gcj_dbtool_LDADD = -L$(here)/.libs libgcj.la
+gcj_dbtool_LDADD = gnu/gcj/tools/gcj_dbtool.lo -L$(here)/.libs libgcj.la
## Depend on the spec file to make sure it is up to date before
## linking this program.
gcj_dbtool_DEPENDENCIES = libgcj.la libgcj.spec