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

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