This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Makefile patch: CNI header dependencies


Jeff Sturm wrote:

>Originally nat_headers relied only on this rule, I think:
>
>## This is an evil hack to work around an automake limitation.  We
>## need to ensure that the built headers are built before we try to
>## compile the C++ sources, but we can't make the .o files depend on
>## the headers, because in that case we'll force a complete rebuild of
>## the C++ code whenever any .java file is touched.
>all-recursive: $(nat_headers) $(x_nat_headers)
>
>IIRC this worked OK as long as make was called recursively, but I had
>trouble getting nat_headers to rebuild reliably, so I added the
>dependency on libgcj.jar.
>
>Note that the comment above seems at odds with the behavior you reported.
>

Yes. This rule is, I think, still required in order to make sure all the 
headers get built since our own native files (are supposed to) depend on 
individual .h files and not nat_headers as a whole.

All the dependencies seem to work fine with my patch, except for the 
native files which are in subdirectories ??

ie: if I touch java/lang/UnsatisfiedLinkError.java, which prims.cc 
depends on, the the .class file gets built, gcjh gets run on it, and 
prims.cc gets rebuilt - perfect. But if I touch 
java/net/InetAddress.java, the .class and .h get built fine but it does 
not trigger a rebuild of java/net/natInetAddress.cc.


>>And BTW does anyone know why libtool is now doing the following during
>>make install? its very annoying!
>>
>
>Good question.  Libtool is supposed to relink only on a few platforms
>where it is required.  Is this happening on the trunk only?
>

I think so.

regards

Bryce.


Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.183
diff -u -r1.183 Makefile.am
--- Makefile.am	2001/11/13 17:43:38	1.183
+++ Makefile.am	2001/11/29 01:42:12
@@ -259,29 +259,25 @@
 	$(GCJH) -classpath $(top_builddir) $(basename $<)
 
 ## Header files used when compiling some of the nat* files.
-nat_headers = $(ordinary_java_source_files:.java=.h) \
-	$(built_java_source_files:.java=.h) \
-	java/io/ObjectOutputStream$$PutField.h \
+ordinary_nat_headers = $(ordinary_java_source_files:.java=.h) \
+	$(built_java_source_files:.java=.h)
+
+inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
 	java/io/ObjectInputStream$$GetField.h
 
+nat_headers = $(ordinary_nat_headers) $(inner_nat_headers)
+
 x_nat_headers = $(x_java_source_files:.java=.h)
 
-$(nat_headers) $(x_nat_headers): libgcj.jar
+$(ordinary_nat_headers) $(x_nat_headers): %.h: %.class
 
-java/lang/ClassLoader.h: java/lang/ClassLoader.class libgcj.jar
+java/lang/ClassLoader.h: java/lang/ClassLoader.class
 	$(GCJH) -classpath $(top_builddir) \
 		-friend 'jclass _Jv_FindClass (_Jv_Utf8Const *name, java::lang::ClassLoader *loader);' \
 		-friend 'void _Jv_RunMain (jclass klass, const char *name, int argc, const char **argv, bool is_jar);' \
 		$(basename $<)
-
-## Our internal main program needs to be able to create a FirstThread.
-gnu/gcj/runtime/FirstThread.h: gnu/gcj/runtime/FirstThread.class libgcj.jar
-	$(GCJH) -classpath $(top_builddir) \
-		-friend 'void JvRunMain (jclass, int, const char **);' \
-		-friend 'void _Jv_RunMain (const char*, int, const char **);' \
-		$(basename $<)
 
-java/lang/Thread.h: java/lang/Thread.class libgcj.jar
+java/lang/Thread.h: java/lang/Thread.class
 	$(GCJH) -classpath $(top_builddir) \
 		-prepend 'class _Jv_JNIEnv;' \
 		-prepend '#define _JV_NOT_OWNER 1' \
@@ -294,7 +290,7 @@
 		-friend 'jint _Jv_DetachCurrentThread ();' \
 		$(basename $<)
 
-java/lang/String.h: java/lang/String.class libgcj.jar
+java/lang/String.h: java/lang/String.class
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'jchar* _Jv_GetStringChars (jstring str);' \
 	    -friend 'jstring* _Jv_StringFindSlot (jchar*, jint, jint);' \
@@ -304,37 +300,37 @@
 	    -friend 'jstring _Jv_AllocString (jsize);' \
 	    $(basename $<)
 
-java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class libgcj.jar
+java/lang/reflect/Constructor.h: java/lang/reflect/Constructor.class
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'jmethodID _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *);' \
 	    -friend 'class java::lang::Class;' \
 	    -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
 	    $(basename $<)
 
-java/lang/reflect/Field.h: java/lang/reflect/Field.class libgcj.jar
+java/lang/reflect/Field.h: java/lang/reflect/Field.class
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'jfieldID _Jv_FromReflectedField (java::lang::reflect::Field *);' \
 	    -friend 'jobject _Jv_JNI_ToReflectedField (_Jv_JNIEnv*, jclass, jfieldID, jboolean);' \
 	    -friend 'class java::lang::Class;' \
 	    $(basename $<)
 
-java/lang/reflect/Method.h: java/lang/reflect/Method.class libgcj.jar
+java/lang/reflect/Method.h: java/lang/reflect/Method.class
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
 	    -friend 'class java::lang::Class;' \
 	    -friend 'jobject _Jv_JNI_ToReflectedMethod (_Jv_JNIEnv *, jclass, jmethodID, jboolean);' \
 	    $(basename $<)
 
-gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class libgcj.jar
+gnu/gcj/runtime/VMClassLoader.h: gnu/gcj/runtime/VMClassLoader.class
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'class java::lang::ClassLoader;' \
 	    $(basename $<)
 
-java/io/ObjectInputStream$$GetField.h: libgcj.jar
+java/io/ObjectInputStream$$GetField.h: java/io/ObjectInputStream.class
 	$(GCJH) -classpath $(top_builddir) \
 	'java/io/ObjectInputStream$$GetField'
 
-java/io/ObjectOutputStream$$PutField.h: libgcj.jar
+java/io/ObjectOutputStream$$PutField.h: java/io/ObjectOutputStream.class
 	$(GCJH) -classpath $(top_builddir) \
 	'java/io/ObjectOutputStream$$PutField'
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]