[ecj] Patch: FYI: hack around dependency generation

Tom Tromey tromey@redhat.com
Tue Dec 12 23:37:00 GMT 2006


I'm checking this in on the gcj-eclipse-merge-branch.

We need -M options to do something for the Makefiles to work properly.
(This stuff is in Automake so it isn't just a question of fixing
libjava.)

However the -M options "work funny" now that we have ecj, and in
particular will emit dependencies for temporary files.  This is
anti-helpful.

For the time being this disables dependencies in a way that doesn't
break Makefiles.

Longer term, I'm not sure what to do.  Perhaps arrange to only emit
dependencies on non-temporary files.  Even this is not a very good
solution... perhaps we could teach ecj to emit some info.

I'm not sure why we didn't see this problem before.  It cropped up
when working on the tools.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* lang-specs.h: Pass -M options to jc1.
	* jcf-depend.c (jcf_dependency_add_file): Don't emit
	dependencies.

Index: lang-specs.h
===================================================================
--- lang-specs.h	(revision 119583)
+++ lang-specs.h	(working copy)
@@ -50,6 +50,7 @@
       %{.java|fsaw-java-file:%U.jar -fsource-filename=%i %<ffilelist-file} \
       %{.class|.zip|.jar|ffilelist-file|fcompile-resource*:%i}		\
       %(jc1) %(cc1_options) %{I*} %{!findirect-dispatch:-faux-classpath %U.zip} \
+      %{MD:-MD_} %{MMD:-MMD_} %{M} %{MM} %{MA} %{MT*} %{MF*}\
       %(invoke_as)}",
       0, 0, 0},
 
Index: jcf-depend.c
===================================================================
--- jcf-depend.c	(revision 119583)
+++ jcf-depend.c	(working copy)
@@ -1,6 +1,6 @@
 /* Functions for handling dependency tracking when reading .class files.
 
-   Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -109,7 +109,10 @@
   if (system_p && ! system_files)
     return;
 
-  deps_add_dep (dependencies, filename);
+
+  /* FIXME: Don't emit any dependencies.  In many cases we'll just see
+     temporary files emitted by ecj... */
+  /* deps_add_dep (dependencies, filename); */
 }
 
 void



More information about the Java-patches mailing list