public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
From: cagney@sourceware.org
To: frysk-cvs@sourceware.org
Subject: [SCM]  master: Pre-check each antlr file separately; handle GCJ's stray semicolon error.
Date: Thu, 22 Nov 2007 20:57:00 -0000	[thread overview]
Message-ID: <20071122205723.12158.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  23d35ae52512823d608fb46136564301948b5fe1 (commit)
      from  d7c815e89593b5133268c9574950ca09b01eb6c7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 23d35ae52512823d608fb46136564301948b5fe1
Author: Andrew Cagney <cagney@redhat.com>
Date:   Thu Nov 22 15:56:40 2007 -0500

    Pre-check each antlr file separately; handle GCJ's stray semicolon error.
    
    frysk-common/ChangeLog
    2007-11-22  Andrew Cagney  <cagney@redhat.com>
    
    	* Makefile.rules (.g.antlred): Compile each file separatly.
    	* antlr-warnings.awk: Recognize the error "An empty declaration".

-----------------------------------------------------------------------

Summary of changes:
 frysk-common/ChangeLog          |    5 ++
 frysk-common/Makefile.rules     |  139 ++++++++++++++++++++++----------------
 frysk-common/antlr-warnings.awk |    2 +-
 3 files changed, 86 insertions(+), 60 deletions(-)

First 500 lines of diff:
diff --git a/frysk-common/ChangeLog b/frysk-common/ChangeLog
index fe624dc..7c46f6f 100644
--- a/frysk-common/ChangeLog
+++ b/frysk-common/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-22  Andrew Cagney  <cagney@redhat.com>
+
+	* Makefile.rules (.g.antlred): Compile each file separatly.
+	* antlr-warnings.awk: Recognize the error "An empty declaration".
+
 2007-11-15  Andrew Cagney  <cagney@redhat.com>
 
 	* antlr-warnings.awk: Delete references to ExprAST.
diff --git a/frysk-common/Makefile.rules b/frysk-common/Makefile.rules
index bae9e3d..7c78f16 100644
--- a/frysk-common/Makefile.rules
+++ b/frysk-common/Makefile.rules
@@ -489,72 +489,93 @@ ANTLR = $(JAVA) \
 
 SUFFIXES += .antlred .g
 .g.antlred:
-	mkdir -p $*.tmp
-	b=`basename $*` ; \
-	d=`dirname $*` ; \
-	cd $$d ; \
-	$(ANTLR) -o $$b.tmp @abs_srcdir@/$*.g
-	@echo "Setting up generated files ..." ; \
-	d=$*.tmp ; for gen in $$d/*.java ; do \
+	@echo ""
+	@echo Creating working directory ...
+	@echo ""
+	@d=`dirname $*` ; t=$*.tmp ; set -xe ; \
+	mkdir -p $$t/$$d
+	@echo ""
+	@echo Running antlr in output directory to pick up previously generated files ...
+	@echo ""
+	@d=`dirname $*` ; t=$*.tmp ; set -xe ; \
+	cd $$d ; $(ANTLR) -o `basename $$t`/$$d @abs_srcdir@/$*.g
+	@echo ""
+	@echo Setting up generated files ...
+	@echo ""
+	@b=`basename $*` ; d=`dirname $*` ; t=$*.tmp ; set -xe ; \
+	for gen in $$t/$$d/*.java ; do \
 	    b=`basename $$gen .java` ; \
-	    ( set -x ; mv $$gen $$d/$$b.gen ) ; \
-	    ( set -x ; rm -f $$d/../$$b.java ) ; \
-	    for f in @abs_srcdir@/`dirname $$d`/$$b.sed /dev/null ; do \
-		if test -r $$f ; then \
-		    ( set -x ; cp $$f $$d/$$b.sed ) ; \
-		    break ; \
-	        fi ; \
-	    done ; \
+	    mv $$gen $$t/$$b.gen ; \
+	    i=@abs_srcdir@/$$d/$$b.sed ; \
+	    o=$$t/$$b.sed ; \
+   	    if test -r $$i ; then \
+		cp $$i $$o.sed ; \
+	    else \
+		cp /dev/null $$o ; \
+	    fi ; \
 	done
-	@edits=true ; d=$*.tmp ; \
+	@echo ""
+	@echo Running repeated builds ...
+	@echo ""
+	@d=`dirname $*` ; t=$*.tmp ; set -xe ; \
+	edits=true ; \
 	while $$edits ; do \
 	    edits=false ; \
-	    echo "Applying fixes ..." ; \
-	    for gen in $$d/*.gen ; do \
+	    for gen in $$t/*.gen ; do \
 		b=`basename $$gen .gen` ; \
-		( set -x ; sed -f $$d/$$b.sed $$gen > $$d/$$b.java ) \
-		     || exit 1 ; \
-	    done ; \
-	    echo "Parsing compiler warnings ..." ; \
-	    rm -f $$d/*.antlr-fixes ; \
-	    ( set -x ; rm -rf $$d/classes ; mkdir -p $$d/classes ) ; \
-	    if test "x@HAVE_ECJ_TRUE@" = x ; then \
-		( set -x ; $(GIJ) 2>&1 \
-		    --classpath $(ECJ_JAR):$(CLASSPATH) \
-		    org.eclipse.jdt.internal.compiler.batch.Main \
-		    \
-		    -d $$d/classes \
-		    -warn:+semicolon \
-		    -sourcepath $(SOURCEPATH) \
-		    -classpath $(CLASSPATH) \
-		    $$d/*.java ) ; \
-	    else \
-		( set -x ; $(GCJCOMPILE) 2>&1 \
-		    -C \
-		    -d $$d/classes \
-		    $$d/*.java ) ; \
-	    fi | ( set -x ; cd $$d ; $(AWK) \
-		-f @abs_srcdir@/common/antlr-warnings.awk ) ; \
-	    echo "Merging `sort -n $$d/*.antlr-fixes 2>/dev/null | uniq | wc -l` fixes" ; \
-	    for fix in $$d/*.antlr-fixes ; do \
-		b=`basename $$fix .antlr-fixes` ; \
-		test -r "$$d/$$b.sed" || continue ; \
-		( set -x ; sort -n $$d/$$b.sed $$fix | uniq > $$d/$$b.tmp ) ; \
-		if ( set -x ; cmp -s $$d/$$b.tmp $$d/$$b.sed ) ; then \
-		    echo "***" ; \
-		    echo "*** $$d/$$b.sed already contains all fixes!" ; \
-		    echo "*** Assuming errors are real." ; \
-		    echo "***" ; \
-		    continue ; \
-		fi ; \
-		mv -f $$d/$$b.tmp $$d/$$b.sed ; \
-		edits=true ; \
+	        echo "Applying fixes for $$b ..." ; \
+		for fix in $$t/*.sed ; do \
+		    f=`basename $$fix .sed` ; \
+		    sed -f $$fix $$t/$$f.gen > $$t/$$d/$$f.java ; \
+		done ; \
+		echo "Parsing compiler warnings from $$b..." ; \
+		rm -f $$t/*.antlr-fixes ; \
+	        rm -rf $$t/classes ; mkdir -p $$t/classes ; \
+		if test "x@HAVE_ECJ_TRUE@" = y ; then \
+		    $(GIJ) 2>&1 \
+			--classpath $(ECJ_JAR):$(CLASSPATH) \
+			org.eclipse.jdt.internal.compiler.batch.Main \
+			\
+			-d $$t/classes \
+			-warn:+semicolon \
+			-sourcepath  $$t:$(SOURCEPATH) \
+			-classpath $(CLASSPATH) \
+			$$t/$$d/$$b.java || true ; \
+		else \
+		    $(GCJCOMPILE) 2>&1 \
+			-C \
+			-I $$t \
+			-d $$t/classes \
+			$$t/$$d/$$b.java || true ; \
+		fi | ( \
+		    cd $$t ; \
+		    $(AWK) -f @abs_srcdir@/common/antlr-warnings.awk \
+		) ; \
+		echo "Merging `sort -n $$t/*.antlr-fixes 2>/dev/null | uniq | wc -l` fixes" ; \
+		for fix in $$t/*.antlr-fixes ; do \
+		    b=`basename $$fix .antlr-fixes` ; \
+		    test -r "$$t/$$b.sed" || continue ; \
+ 		    sort -n $$t/$$b.sed $$fix | uniq > $$t/$$b.tmp ; \
+		    if ( set -x ; cmp -s $$t/$$b.tmp $$t/$$b.sed ) ; then \
+			echo "***" ; \
+			echo "*** $$t/$$b.sed already contains all fixes!" ; \
+			echo "*** Assuming errors are real." ; \
+			echo "***" ; \
+			continue ; \
+		    fi ; \
+		    mv -f $$t/$$b.tmp $$t/$$b.sed ; \
+ 		    edits=true ; \
+	        done ; \
 	    done ; \
 	done || true
-	@echo Installing generated files files ... ; \
-	( cd $*.tmp ; for f in *.java *.txt ; do \
-	    ( set -x ; cp $$f ../$$f ) ; \
-	done )
+	@echo ""
+	@echo Installing generated files files ...
+	@echo ""
+	@d=`dirname $*` ; t=$*.tmp ; set -xe ; \
+	for f in $$t/$$d/*.java $$t/$$d/*.txt ; do \
+	    b=`basename $$f` ; \
+	    cp $$f $$d/$$b ; \
+	done
 	rm -rf $*.antlred
 	touch $*.antlred
 \f
diff --git a/frysk-common/antlr-warnings.awk b/frysk-common/antlr-warnings.awk
index f77e3c0..8b40149 100644
--- a/frysk-common/antlr-warnings.awk
+++ b/frysk-common/antlr-warnings.awk
@@ -107,7 +107,7 @@ function sed_comment(code) {
     return "s," code ",// " code ","
 }
 
-prob ~ /Unnecessary semicolon/ {
+prob ~ /Unnecessary semicolon/ || prob ~ /An empty declaration is a deprecated feature/ {
     if (code ~ /};/) {
 	sed = "s,};,} // ;,"
     } else if (code ~ /;;$/) {


hooks/post-receive
--
frysk system monitor/debugger


                 reply	other threads:[~2007-11-22 20:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071122205723.12158.qmail@sourceware.org \
    --to=cagney@sourceware.org \
    --cc=frysk-cvs@sourceware.org \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).