From 0c7829a97b309d2290ce83d0d1c2a9e23b9dec2e Mon Sep 17 00:00:00 2001 From: Mohan Embar Date: Wed, 27 Aug 2003 06:02:28 +0000 Subject: [PATCH] Makefile.am: (write_entries_to_file) New parameterized function for writing entries to a... * Makefile.am: (write_entries_to_file) New parameterized function for writing entries to a file one line at a time. (all_java_class_files): Removed definition. (.java.class) Removed.target. (libgcj-@gcc_version@.jar): Changed dependency to $(all_java_source_files); added compilation step which compiles all changed source files in one pass. (libgcj.la) Refactored to use write_entries_to_file. (lib-gnu-awt-xlib.la) Likewise. (install-data-local) Likewise. (write-entries-to-file-check) New target which tests write_entries_to_file. (all-recursive): Changed dependency from $(all_java_class_files) to libgcj-@gcc_version@.jar * Makefile.in: Rebuilt. From-SVN: r70842 --- libjava/ChangeLog | 17 +++++++++++++++++ libjava/Makefile.am | 36 +++++++++++++++++++++++++----------- libjava/Makefile.in | 35 ++++++++++++++++++++++++----------- 3 files changed, 66 insertions(+), 22 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index c5f5066d868..ba60c8267a4 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,20 @@ +2003-08-26 Mohan Embar + + * Makefile.am: (write_entries_to_file) New parameterized + function for writing entries to a file one line at a time. + (all_java_class_files): Removed definition. + (.java.class) Removed.target. + (libgcj-@gcc_version@.jar): Changed dependency to + $(all_java_source_files); added compilation step which compiles + all changed source files in one pass. + (libgcj.la) Refactored to use write_entries_to_file. + (lib-gnu-awt-xlib.la) Likewise. + (install-data-local) Likewise. + (write-entries-to-file-check) New target which tests write_entries_to_file. + (all-recursive): Changed dependency from $(all_java_class_files) + to libgcj-@gcc_version@.jar + * Makefile.in: Rebuilt. + 2003-08-26 Tom Tromey * java/lang/StrictMath.java: Typo fix. diff --git a/libjava/Makefile.am b/libjava/Makefile.am index e6a06d1ecee..c43d6b0e571 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -10,6 +10,15 @@ else SUBDIRS = $(DIRLTDL) gcj include endif +# write_entries_to_file - writes each entry in a list +# to the specified file. Each entry is written individually +# to accomodate systems with severe command-line-length +# limitations. +# Parameters: +# $(1): variable containing entries to iterate over +# $(2): output file +write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2))) + ## ################################################################ ## @@ -328,14 +337,11 @@ all_java_source_files = \ $(gtk_awt_peer_sources) \ $(x_java_source_files) -all_java_class_files = $(all_java_source_files:.java=.class) - -.java.class: - $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \ - -d $(here) $< - -libgcj-@gcc_version@.jar: $(all_java_class_files) +libgcj-@gcc_version@.jar: $(all_java_source_files) -@rm -f libgcj-@gcc_version@.jar + @echo Compiling Java sourcefiles... + @: $(call write_entries_to_file,$?,libgcj.sourcelist) + $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) @libgcj.sourcelist ## Note that we explicitly want to include directory information. find java gnu javax org -type d -o -type f -name '*.class' | \ sed -e '/\/\./d' -e '/\/xlib/d' | \ @@ -390,13 +396,15 @@ $(gtk_awt_peer_sources:.java=.lo): %.lo: %.java ## Pass the list of object files to libtool in a temporary file to ## avoid tripping platform command line length limits. libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES) - @: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist)) + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist) $(libgcj_la_LINK) -objectlist libgcj.objectlist \ @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES) - @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist)) + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist) $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \ -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS) @@ -513,7 +521,8 @@ install-data-local: $(PRE_INSTALL) ## We use a GNU make trick here so that we don't go over the command ## length limit of some shells. - @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist)) + @echo Creating list of headers to install... + @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist) @cat tmp-ilist | while read f; do \ d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \ $(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \ @@ -569,6 +578,11 @@ class-check: libgcj-@gcc_version@.jar :; else ok=1; fi; \ done; exit $$ok +## This rule checks whether write_entries_to_file works properly. +write-entries-to-file-check: + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist) + ## ################################################################ ## @@ -2726,7 +2740,7 @@ texinfo: TexinfoDoclet.class ## the C++ code whenever any .java file is touched. ## Also force all the class files to build first. This makes them build in ## the right order to improve performance. -all-recursive: $(all_java_class_files) $(nat_headers) $(x_nat_headers) +all-recursive: libgcj-@gcc_version@.jar $(nat_headers) $(x_nat_headers) ## ################################################################ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 344bd757c38..2c5a93252f2 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -151,6 +151,15 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I . @TESTSUBDIR_TRUE@SUBDIRS = @TESTSUBDIR_TRUE@$(DIRLTDL) testsuite gcj include @TESTSUBDIR_FALSE@SUBDIRS = @TESTSUBDIR_FALSE@$(DIRLTDL) gcj include + +# write_entries_to_file - writes each entry in a list +# to the specified file. Each entry is written individually +# to accomodate systems with severe command-line-length +# limitations. +# Parameters: +# $(1): variable containing entries to iterate over +# $(2): output file +write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2))) @XLIB_AWT_TRUE@cond_x_ltlibrary = @XLIB_AWT_TRUE@lib-gnu-awt-xlib.la @XLIB_AWT_FALSE@cond_x_ltlibrary = @XLIB_AWT_TRUE@xlib_includes = @XLIB_AWT_TRUE@-I../libstdc++-v3/include -I../libstdc++-v3/include/$(target_alias) -I$(srcdir)/../libstdc++-v3/libsupc++ @@ -418,8 +427,6 @@ all_java_source_files = \ $(x_java_source_files) -all_java_class_files = $(all_java_source_files:.java=.class) - MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers) CLEANFILES = libgcj-@gcc_version@.jar @@ -4851,12 +4858,11 @@ $(gtk_c_headers): $(gtk_awt_peer_sources) echo "$(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input"; \ $(GCJH) -jni -d jniinclude -classpath '' -bootclasspath $(top_builddir) $$input -.java.class: - $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \ - -d $(here) $< - -libgcj-@gcc_version@.jar: $(all_java_class_files) +libgcj-@gcc_version@.jar: $(all_java_source_files) -@rm -f libgcj-@gcc_version@.jar + @echo Compiling Java sourcefiles... + @: $(call write_entries_to_file,$?,libgcj.sourcelist) + $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) @libgcj.sourcelist find java gnu javax org -type d -o -type f -name '*.class' | \ sed -e '/\/\./d' -e '/\/xlib/d' | \ $(ZIP) cfM0E@ $@ @@ -4896,13 +4902,15 @@ $(gtk_awt_peer_sources:.java=.lo): %.lo: %.java $(GCJCOMPILE) -fjni -o $@ $< libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES) - @: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist)) + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist) $(libgcj_la_LINK) -objectlist libgcj.objectlist \ @GCLIBS@ @LIBFFI@ @ZLIBS@ \ -rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS) lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES) - @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist)) + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist) $(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \ -rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS) @@ -4993,7 +5001,8 @@ $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h: install-data-local: $(PRE_INSTALL) - @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist)) + @echo Creating list of headers to install... + @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist) @cat tmp-ilist | while read f; do \ d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \ $(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \ @@ -5029,6 +5038,10 @@ class-check: libgcj-@gcc_version@.jar :; else ok=1; fi; \ done; exit $$ok +write-entries-to-file-check: + @echo Creating list of files to link... + @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist) + # The Unicode consortium does not permit re-distributing the file JIS0201.TXT. # You can get it from ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/. @@ -5113,7 +5126,7 @@ texinfo: TexinfoDoclet.class -include deps.mk -all-recursive: $(all_java_class_files) $(nat_headers) $(x_nat_headers) +all-recursive: libgcj-@gcc_version@.jar $(nat_headers) $(x_nat_headers) # Multilib support. .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \ -- 2.30.2