classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] Patch: FYI: run split-for-gcj at correct times


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: run split-for-gcj at correct times
Date: 22 Aug 2005 14:59:16 -0600

I'm checking this in.

Currently we run split-for-gcj.sh when gcj is detected, even if it is
not going to be used.  Also, if it is interrupted, we won't run it
again -- even though this can leave inconsistent results.

This patch fixes both of these problems.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * lib/split-for-gcj.sh: Create Makefile.deps atomically.
        * lib/gen-classlist.sh.in: Don't run split-for-gcj.sh.
        * lib/Makefile.gcj (Makefile.deps): New target.
        * lib/Makefile.am (compile-classes): Pass top_srcdir to
        Makefile.gcj.

Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.99
diff -u -r1.99 Makefile.am
--- lib/Makefile.am 14 Aug 2005 22:32:08 -0000 1.99
+++ lib/Makefile.am 22 Aug 2005 21:03:19 -0000
@@ -125,7 +125,9 @@
 ## builds.
 compile-classes: classes $(JAVA_SRCS) Makefile
        $(MAKE) -f $(srcdir)/Makefile.gcj \
-         GCJ='$(GCJ)' compile_classpath='$(top_builddir):$(compile_classpath)'
+         GCJ='$(GCJ)' \
+         compile_classpath='$(top_builddir):$(compile_classpath)' \
+         top_srcdir=$(top_srcdir)
 else
 compile-classes: classes $(JAVA_SRCS) Makefile
        $(JAVAC)
Index: lib/Makefile.gcj
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.gcj,v
retrieving revision 1.3
diff -u -r1.3 Makefile.gcj
--- lib/Makefile.gcj 18 Jul 2005 18:51:27 -0000 1.3
+++ lib/Makefile.gcj 22 Aug 2005 21:03:19 -0000
@@ -17,6 +17,11 @@
 
 all: $(all_stamp_files)
 
+# Ensure this is rebuilt whenever the list of classes changes.
+# The list will always exist when this Makefile is used.
+Makefile.deps: classes
+       $(SHELL) $(top_srcdir)/lib/split-for-gcj.sh
+
 -include Makefile.deps $(all_deps_files)
 
 ## Like GCJ but include some common flags.
Index: lib/gen-classlist.sh.in
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/gen-classlist.sh.in,v
retrieving revision 1.29
diff -u -r1.29 gen-classlist.sh.in
--- lib/gen-classlist.sh.in 11 Aug 2005 16:40:53 -0000 1.29
+++ lib/gen-classlist.sh.in 22 Aug 2005 21:03:19 -0000
@@ -85,10 +85,6 @@
   for i in `cat ${top_builddir}/lib/classes` ; do
     echo $i "\\" >> ${top_builddir}/lib/java.dep
   done
-
-  if test -n "$GCJ"; then
-     @SHELL@ ${top_srcdir}/lib/split-for-gcj.sh
-  fi
 fi
 
 exit 0
Index: lib/split-for-gcj.sh
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/split-for-gcj.sh,v
retrieving revision 1.5
diff -u -r1.5 split-for-gcj.sh
--- lib/split-for-gcj.sh 11 Aug 2005 14:18:21 -0000 1.5
+++ lib/split-for-gcj.sh 22 Aug 2005 21:03:19 -0000
@@ -26,7 +26,7 @@
 # given file.
 
 echo "Splitting for gcj"
-rm -f Makefile.deps > /dev/null 2>&1
+rm -f Makefile.dtmp > /dev/null 2>&1
 test -d lists || mkdir lists
 for dir in java javax gnu org; do
    fgrep /$dir/ classes | while read file; do
@@ -35,8 +35,8 @@
       echo "$file" >> ${list}.list.1
       f2=`echo "$file" | sed -n -e "s,^.*/\($dir/.*\)$,\1,p"`
       f2=`echo "$f2" | sed -e 's/.java$//'`.class
-      echo "$f2: ${list}.stamp" >> Makefile.deps
-      echo "${list}.list: $file" >> Makefile.deps
+      echo "$f2: ${list}.stamp" >> Makefile.dtmp
+      echo "${list}.list: $file" >> Makefile.dtmp
    done
 done
 
@@ -49,3 +49,6 @@
       mv $file $real
    fi
 done
+
+# If we were run we must update Makefile.deps.
+mv Makefile.dtmp Makefile.deps




reply via email to

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