This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: a few minor java fixes
- To: egcs-patches at cygnus dot com
- Subject: PATCH: a few minor java fixes
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 22 Oct 1998 14:03:42 -0600
- Reply-To: tromey at cygnus dot com
I'm committing the appended patch. It fixes a few bugs in the
gcc/java Makefile. It also fixes a minor snafu with my last patch; I
defined a variable in the wrong file.
1998-10-22 Tom Tromey <tromey@cygnus.com>
* config-lang.in (stagestuff): Added jcf-dump and jv-scan.
Sun Oct 11 10:31:52 1998 Anthony Green <green@cygnus.com>
* Make-lang.in (java): Depend on jcf-dump and jv-scan.
(JV_SCAN_SOURCES): New macro.
(JCF_DUMP_SOURCES): Likewise.
(jcf-dump$(exeext)): New target.
(jv-scan$(exeext)): New target.
1998-10-22 Tom Tromey <tromey@cygnus.com>
* Makefile.in (LEX): Removed.
(LEXFLAGS): Likewise.
(SET_BISON): New macro.
(BISON): Removed.
($(PARSE_C)): Use SET_BISON. Run bison from srcdir to avoid
spurious diffs in parse.c.
($(PARSE_SCAN_C)): Likewise.
(PARSE_DIR): New macro.
(PARSE_C): Use it.
(PARSE_SCAN_C): Likewise.
(PARSE_RELDIR): New macro.
Tom
Index: Make-lang.in
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/Make-lang.in,v
retrieving revision 1.6
diff -u -r1.6 Make-lang.in
--- Make-lang.in 1998/10/22 12:05:47 1.6
+++ Make-lang.in 1998/10/22 19:58:56
@@ -57,7 +57,7 @@
GCJ = gcj
# Define the names for selecting java in LANGUAGES.
-java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext)
+java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext)
# Define the name of target independant tools to be installed in $(bindir)
# Names are subject to changes
@@ -125,6 +125,19 @@
gcjh$(exeext): $(GCJH_SOURCES)
cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../gcjh$(exeext)
+# This must be kept in sync with dependencies in Makefile.in.
+JV_SCAN_SOURCES = $(srcdir)/java/parse-scan.y $(srcdir)/java/lex.c \
+ $(srcdir)/java/parse.h $(srcdir)/java/lex.h $(srcdir)/java/jv-scan.c
+
+jv-scan$(exeext): $(JV_SCAN_SOURCES)
+ cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jv-scan$(exeext)
+
+# This must be kept in sync with dependencies in Makefile.in.
+JCF_DUMP_SOURCES = $(srcdir)/java/jcf-dump.c $(srcdir)/java/jcf-io.c \
+ $(srcdir)/java/zextract.c $(srcdir)/../libiberty/memmove.c
+
+jcf-dump$(exeext): $(JCF_DUMP_SOURCES)
+ cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jcf-dump$(exeext)
# Build hooks:
Index: Makefile.in
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/Makefile.in,v
retrieving revision 1.13
diff -u -r1.13 Makefile.in
--- Makefile.in 1998/10/22 12:05:48 1.13
+++ Makefile.in 1998/10/22 19:59:01
@@ -59,11 +59,9 @@
T_CPPFLAGS =
CC = @CC@
-BISON = `if [ -f ../../bison/bison ] ; then echo ../../bison/bison -L $(srcdir)/../../bison/ ; else echo bison ; fi`
+SET_BISON = here=`pwd`; sdir=`cd $(srcdir) && pwd`; if test -f ../../bison; then bison="$$here/../../bison/bison -L $$sdir"; else bison=bison; fi
BISONFLAGS =
JAVABISONFLAGS = --name-prefix=java_
-LEX = `if [ -f ../../flex/flex ] ; then echo ../../flex/flex ; else echo flex ; fi`
-LEXFLAGS =
AR = ar
AR_FLAGS = rc
SHELL = /bin/sh
@@ -229,16 +227,24 @@
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
-PARSE_C = $(srcdir)/parse.c
-PARSE_SCAN_C = $(srcdir)/parse-scan.c
+# Separating PARSE_DIR from PARSE_RELDIR lets us easily change the
+# code to support building parse.c in the build directory, at some
+# expense in readability.
+PARSE_DIR = $(srcdir)
+PARSE_RELDIR = .
+PARSE_C = $(PARSE_DIR)/parse.c
+PARSE_SCAN_C = $(PARSE_DIR)/parse-scan.c
PARSE_H = $(srcdir)/parse.h
$(PARSE_C): $(srcdir)/parse.y $(srcdir)/lex.c $(PARSE_H) $(srcdir)/lex.h
- $(BISON) -t -v $(BISONFLAGS) $(JAVABISONFLAGS) -o $(PARSE_C) \
- $(srcdir)/parse.y
+ $(SET_BISON); \
+ cd $(PARSE_DIR) && $$bison -t -v $(BISONFLAGS) $(JAVABISONFLAGS) \
+ -o parse.c $(PARSE_RELDIR)/parse.y
$(PARSE_SCAN_C): $(srcdir)/parse-scan.y $(srcdir)/lex.c $(PARSE_H) \
$(srcdir)/lex.h
- $(BISON) -t -v $(BISONFLAGS) -o $(PARSE_SCAN_C) $(srcdir)/parse-scan.y
+ $(SET_BISON); \
+ cd $(PARSE_DIR) && $$bison -t -v $(BISONFLAGS) -o parse-scan.c \
+ $(PARSE_RELDIR)/parse-scan.y
lex.c: keyword.h lex.h
Index: config-lang.in
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/config-lang.in,v
retrieving revision 1.1
diff -u -r1.1 config-lang.in
--- config-lang.in 1998/09/06 15:36:07 1.1
+++ config-lang.in 1998/10/22 19:59:01
@@ -35,6 +35,6 @@
compilers="jc1\$(exeext) jvgenmain\$(exeext)"
-stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext)"
+stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext) jv-scan\$(exeext) jcf-dump\$(exeext)"
outputs=java/Makefile
Index: jcf-io.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/jcf-io.c,v
retrieving revision 1.7
diff -u -r1.7 jcf-io.c
--- jcf-io.c 1998/10/22 12:05:53 1.7
+++ jcf-io.c 1998/10/22 19:59:05
@@ -29,6 +29,11 @@
#include <sys/stat.h>
#include <sys/wait.h>
+/* This is true if the user specified a `.java' file on the command
+ line. Otherwise it is 0. FIXME: this is temporary, until our
+ .java parser is fully working. */
+int saw_java_source = 0;
+
/* DOS brain-damage */
#ifndef O_BINARY
#define O_BINARY 0 /* MS-DOS brain-damage */
@@ -350,7 +355,6 @@
java_entry = jcf_path_next (java_entry))
{
int m, l;
- extern int saw_java_source; /* FIXME: temporary. */
if (jcf_path_is_zipfile (java_entry))
continue;
Index: jcf-parse.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/jcf-parse.c,v
retrieving revision 1.6
diff -u -r1.6 jcf-parse.c
--- jcf-parse.c 1998/10/22 12:05:54 1.6
+++ jcf-parse.c 1998/10/22 19:59:12
@@ -61,11 +61,6 @@
/* The class we started with. */
tree main_class = NULL_TREE;
-/* This is true if the user specified a `.java' file on the command
- line. Otherwise it is 0. FIXME: this is temporary, until our
- .java parser is fully working. */
-int saw_java_source = 0;
-
/* The FIELD_DECL for the current field. */
static tree current_field = NULL_TREE;
@@ -721,8 +716,11 @@
if (list[0])
{
char *value, len;
+ extern int saw_java_source; /* FIXME: temporary. */
len = strlen (list);
+ /* FIXME: this test is only needed until our .java parser is
+ fully capable. */
if (len > 5 && ! strcmp (&list[len - 5], ".java"))
saw_java_source = 1;