Blame SOURCES/gcc32-libjava-jar-timestamps.patch

6f1b0c
2004-08-12  Jakub Jelinek  <jakub@redhat.com>
6f1b0c
6f1b0c
	* Makefile.am (libgcj-@gcc_version@.jar): Set timestamp of all files
6f1b0c
	and directories in the jar file to the youngest of gcc/ChangeLog,
6f1b0c
	gcc/java/ChangeLog and libjava/ChangeLog.  Sort the file/directory
6f1b0c
	list before passing it to fastjar.
6f1b0c
	* Makefile.in: Rebuilt.
6f1b0c
6f1b0c
--- libjava/Makefile.am	2003-02-03 23:58:32.000000000 +0100
6f1b0c
+++ libjava/Makefile.am	2004-08-12 13:21:35.928177346 +0200
6f1b0c
@@ -170,9 +170,29 @@ all_java_class_files = $(all_java_source
6f1b0c
 libgcj-@gcc_version@.jar: $(all_java_class_files)
6f1b0c
 	-@rm -f libgcj-@gcc_version@.jar
6f1b0c
 ## Note that we explicitly want to include directory information.
6f1b0c
-	find java gnu javax org -type d -o -type f -name '*.class' | \
6f1b0c
-	  sed -e '/\/\./d' -e '/\/xlib/d' | \
6f1b0c
-	  $(ZIP) cfM0E@ $@
6f1b0c
+	# The following is an attempt to have libgcj-*.jar files
6f1b0c
+	# from the same GCC version identical accross the architectures.
6f1b0c
+	JARDIR=`mktemp -d ../$@.XXXXXX` || exit 1; \
6f1b0c
+	for d in `find java gnu javax org -type d \
6f1b0c
+		  | sed -e '/\/\./d' -e '/\/xlib/d'`; do \
6f1b0c
+	  mkdir -p $$JARDIR/$$d; \
6f1b0c
+	done; \
6f1b0c
+	touch -r $(srcdir)/../gcc/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	[ $(srcdir)/../gcc/java/ChangeLog -nt $$JARDIR.stamp ] \
6f1b0c
+	  && touch -r $(srcdir)/../gcc/java/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	[ $(srcdir)/ChangeLog -nt $$JARDIR.stamp ] \
6f1b0c
+	  && touch -r $(srcdir)/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	for f in `find java gnu javax org -type f -name '*.class' \
6f1b0c
+		  | sed -e '/\/\./d' -e '/\/xlib/d'`; do \
6f1b0c
+	  cp $$f $$JARDIR/$$f; \
6f1b0c
+	  touch -r $$JARDIR.stamp $$JARDIR/$$f; \
6f1b0c
+	done; \
6f1b0c
+	touch -r $$JARDIR.stamp `find $$JARDIR -type d`; \
6f1b0c
+	cd $$JARDIR; \
6f1b0c
+	find java gnu javax org -type d -o -type f | \
6f1b0c
+	  LC_ALL=C sort | $(ZIP) cfM0E@ ../libjava/$@ || exit 1; \
6f1b0c
+	cd -; \
6f1b0c
+	rm -rf $$JARDIR $$JARDIR.stamp
6f1b0c
 
6f1b0c
 MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
6f1b0c
 CLEANFILES = libgcj-@gcc_version@.jar
6f1b0c
--- libjava/Makefile.in	2003-02-03 23:58:32.000000000 +0100
6f1b0c
+++ libjava/Makefile.in	2004-08-12 13:21:22.928440630 +0200
6f1b0c
@@ -3280,9 +3280,29 @@ install-exec-hook:
6f1b0c
 
6f1b0c
 libgcj-@gcc_version@.jar: $(all_java_class_files)
6f1b0c
 	-@rm -f libgcj-@gcc_version@.jar
6f1b0c
-	find java gnu javax org -type d -o -type f -name '*.class' | \
6f1b0c
-	  sed -e '/\/\./d' -e '/\/xlib/d' | \
6f1b0c
-	  $(ZIP) cfM0E@ $@
6f1b0c
+	# The following is an attempt to have libgcj-*.jar files
6f1b0c
+	# from the same GCC version identical accross the architectures.
6f1b0c
+	JARDIR=`mktemp -d ../$@.XXXXXX` || exit 1; \
6f1b0c
+	for d in `find java gnu javax org -type d \
6f1b0c
+		  | sed -e '/\/\./d' -e '/\/xlib/d'`; do \
6f1b0c
+	  mkdir -p $$JARDIR/$$d; \
6f1b0c
+	done; \
6f1b0c
+	touch -r $(srcdir)/../gcc/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	[ $(srcdir)/../gcc/java/ChangeLog -nt $$JARDIR.stamp ] \
6f1b0c
+	  && touch -r $(srcdir)/../gcc/java/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	[ $(srcdir)/ChangeLog -nt $$JARDIR.stamp ] \
6f1b0c
+	  && touch -r $(srcdir)/ChangeLog $$JARDIR.stamp; \
6f1b0c
+	for f in `find java gnu javax org -type f -name '*.class' \
6f1b0c
+		  | sed -e '/\/\./d' -e '/\/xlib/d'`; do \
6f1b0c
+	  cp $$f $$JARDIR/$$f; \
6f1b0c
+	  touch -r $$JARDIR.stamp $$JARDIR/$$f; \
6f1b0c
+	done; \
6f1b0c
+	touch -r $$JARDIR.stamp `find $$JARDIR -type d`; \
6f1b0c
+	cd $$JARDIR; \
6f1b0c
+	find java gnu javax org -type d -o -type f | \
6f1b0c
+	  LC_ALL=C sort | $(ZIP) cfM0E@ ../libjava/$@ || exit 1; \
6f1b0c
+	cd -; \
6f1b0c
+	rm -rf $$JARDIR $$JARDIR.stamp
6f1b0c
 
6f1b0c
 clean-local:
6f1b0c
 	find . -name '*.class' -print | xargs rm -f