This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[patch] libjava: avoid using escape sequence with undefined behaviour in echo


When using ash as system and config shell, the bootstrap fails in libjava,
because a wrong Makefile.deps is generated. echo '\1\2' in ash just
echoes ^A^B. ash claims that these escape sequences elicit undefined
behaviour.

This rule was introduced in the 4.0 branch after 4.0.1, before that
change libjava used to build using ash, proposing this change for the
4.0 branch as well.

Ok to checkin?

  Matthias


2005-09-18  Matthias Klose  <doko@debian.org>

	* Makefile.am (Makefile.deps): Don't use non-standardized escape
	sequences in echo command. 
	* Makefile.in: Regenerate.

--- libjava/Makefile.am~	2005-09-17 19:47:24.122598072 +0200
+++ libjava/Makefile.am	2005-09-18 08:47:23.513009312 +0200
@@ -267,8 +267,8 @@
 # recompiles to native code.
 Makefile.deps: $(srcdir)/Makefile.in
 	@: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
-	echo 's,^\(.*\)/\([^/]*\)\.java$$,\1.list: &\' > tmpsed
-	echo '\1/\2.class: \1.stamp,' >> tmpsed
+	echo 's,^\(.*\)/\([^/]*\)\.java$$,@1.list: &\' | sed 's/@/\\/g' > tmpsed
+	echo '@1/@2.class: @1.stamp,' | sed 's/@/\\/g' >> tmpsed
 	sed -ftmpsed files.tmplist > Makefile.deps
 	rm files.tmplist tmpsed
 
--- libjava/Makefile.in~	2005-09-17 19:47:24.127597312 +0200
+++ libjava/Makefile.in	2005-09-18 08:48:31.863618440 +0200
@@ -6323,8 +6323,8 @@
 # recompiles to native code.
 Makefile.deps: $(srcdir)/Makefile.in
 	@: $(call write_entries_to_file,$(all_java_source_files),files.tmplist)
-	echo 's,^\(.*\)/\([^/]*\)\.java$$,\1.list: &\' > tmpsed
-	echo '\1/\2.class: \1.stamp,' >> tmpsed
+	echo 's,^\(.*\)/\([^/]*\)\.java$$,@1.list: &\' | sed 's/@/\\/g' > tmpsed
+	echo '@1/@2.class: @1.stamp,' | sed 's/@/\\/g' >> tmpsed
 	sed -ftmpsed files.tmplist > Makefile.deps
 	rm files.tmplist tmpsed
 


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