classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: RFC: add --with-vm-classes


From: Tom Tromey
Subject: [cp-patches] Patch: RFC: add --with-vm-classes
Date: 05 May 2005 11:14:33 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm not checking this in yet; I wanted commentary before doing so.

I've been working on the "Big Classpath Merge" for libgcj.  The idea
here is to eliminate libgcj/classpath cross-merging by simply dropping
a copy of the classpath tree into the libgcj tree.

libgcj developers would check check out classpath head into their
libgcj source tree and would work directly on classpath.

It seemed best to reuse Classpath's build infrastructure as much as
possible for this.  So, my change (which isn't yet complete fwiw) runs
the classpath configure script, the classpath build, etc.

libgcj still has some core classes which diverge from Classpath (and
which most likely will continue to do so); one example is String.  So,
I had to add support to the Classpath build infrastructure to let us
override some core Classpath classes with our own copies.

The appended patch adds a new configure option, --with-vm-classes,
which takes as an argument a list (in ":"-separate CLASSPATH format)
of vm override directories.  gen-classlist.sh uses this to add files
to the build and also to remove duplicates; you can also have '.omit'
files in these VM directories to let the VM specify other things that
should not be built.

I also made compile-classes and friends no longer conditional on
INSTALL_CLASS_FILES; the idea being that libgcj wants to configure
Classpath with '--with-glibj=none' -- but still wants the class files
to be built.  It wasn't clear to me if not building the classes here
was intentional; if so I can easily add a new mode for --with-glibj.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * m4/acinclude.m4 (--with-vm-classes): New option.
        * lib/gen-classlist.sh.in: Handle 'vm_classes' feature.
        * lib/Makefile.am (compile_classpath): Updated for new
        classpath-setting approach.
        (noinst_DATA): Now unconditional.

Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.79
diff -u -r1.79 Makefile.am
--- lib/Makefile.am 7 Feb 2005 02:32:37 -0000 1.79
+++ lib/Makefile.am 5 May 2005 17:06:30 -0000
@@ -8,7 +8,7 @@
 propertydirs :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org 
-type d ! -name CVS -print)
 propertyfiles :=  $(shell cd $(top_srcdir)/resource && $(FIND) gnu java org 
-name \*\.properties -print)
 
-compile_classpath = 
$(top_srcdir):$(top_srcdir)/vm/reference:$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB)
+compile_classpath = 
$(vm_classes):$(top_srcdir):$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB)
 
 # handling source to bytecode compiler programs like gcj, jikes  and kjc
 if FOUND_GCJ
@@ -43,10 +43,10 @@
 
 endif # INSTALL_GLIBJ_ZIP
 
-if INSTALL_CLASS_FILES
-
 noinst_DATA = genclasses compile-classes resources
 
+if INSTALL_CLASS_FILES
+
 install-data-local: genclasses compile-classes
        -$(top_srcdir)/mkinstalldirs $(DESTDIR)$(pkgdatadir)
        cp -R gnu $(DESTDIR)$(pkgdatadir)
Index: lib/gen-classlist.sh.in
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/gen-classlist.sh.in,v
retrieving revision 1.21
diff -u -r1.21 gen-classlist.sh.in
--- lib/gen-classlist.sh.in 5 Jan 2005 23:01:03 -0000 1.21
+++ lib/gen-classlist.sh.in 5 May 2005 17:06:30 -0000
@@ -3,10 +3,23 @@
 
 echo "Adding java source files from srcdir '@top_srcdir@'."
 @FIND@ @top_srcdir@/java @top_srcdir@/javax @top_srcdir@/gnu \
-       @top_srcdir@/org @top_srcdir@/vm/reference \
+       @top_srcdir@/org \
        @top_srcdir@/external/w3c_dom @top_srcdir@/external/sax \
        -follow -type f -print | grep '\.java$' > ${top_builddir}/lib/classes.1
 
+# Generate files for the VM classes.
+: > vm.omit
+: > vm.add
+vm_dirlist=`echo "@vm_classes@" | sed -e 's/:/ /g'`
+echo "Adding java source files from VM directory $vm_dirlist"
+for dir in $vm_dirlist; do
+   (cd $dir && find . -name '*.java' -print | sed -e 's,^[.]/,,') |
+   while read f; do
+      echo $dir/$f >> vm.add
+      echo $f >> vm.omit
+   done
+done
+
 # Only include generated files once.
 if test ! "${top_builddir}" -ef "@top_srcdir@"; then
   echo "Adding generated files in builddir '${top_builddir}'."
@@ -14,7 +27,29 @@
   | grep '\.java$' >> ${top_builddir}/lib/classes.1
 fi
 
-for filexp in `cat @top_srcdir@/lib/$1.omit` ; do { grep -v ${filexp} < 
${top_builddir}/lib/classes.1 > ${top_builddir}/lib/classes.2 ; mv 
${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1 ; } ; done
+
+cat @top_srcdir@/lib/$1.omit vm.omit > tmp.omit
+for dir in $vm_dirlist; do
+   if test -f $dir/$1.omit; then
+      cat $dir/$1.omit >> tmp.omit
+   fi
+done
+
+for filexp in `cat tmp.omit`; do
+   grep -v ${filexp} < ${top_builddir}/lib/classes.1 > 
${top_builddir}/lib/classes.2
+   mv ${top_builddir}/lib/classes.2 ${top_builddir}/lib/classes.1
+done
+
+
+for dir in $vm_dirlist; do
+   if test -f $dir/$1.omit; then
+      for filexp in `cat $dir/$1.omit`; do
+        grep -v $filexp < vm.add > vm.add.1
+        mv vm.add.1 vm.add
+      done
+   fi
+done
+cat vm.add >> classes.1
 
 new=
 if test -e ${top_builddir}/lib/classes; then
@@ -45,3 +80,5 @@
 grep /locale/ classes > classes.locale
 grep /xml/ classes > classes.xml
 grep /javax/ classes | grep -v /xml/ > classes.standardx
+
+exit 0
Index: m4/acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/m4/acinclude.m4,v
retrieving revision 1.1
diff -u -r1.1 acinclude.m4
--- m4/acinclude.m4 26 Apr 2005 22:44:03 -0000 1.1
+++ m4/acinclude.m4 5 May 2005 17:06:30 -0000
@@ -301,6 +301,11 @@
   ],
   [ conditional_with_classlib=false ])
   AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test "x${conditional_with_classlib}" 
= xtrue)
+
+  AC_ARG_WITH([vm-classes],
+             [AS_HELP_STRING(--with-vm-classes,specify path to VM override 
source files)], [vm_classes="$with_vm_classes"],
+             [vm_classes="${top_srcdir}/vm/reference"])
+  AC_SUBST(vm_classes)
 ])
 
 dnl -----------------------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]