This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
4.1 PATCH: Fix libjava bootstrap failure in split-for-gcj.sh
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: java-patches at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org, classpath-patches at gnu dot org
- Date: Wed, 10 Aug 2005 19:51:32 +0200 (MEST)
- Subject: 4.1 PATCH: Fix libjava bootstrap failure in split-for-gcj.sh
Mainline bootstrap as of 20050805 failed in libjava on Solaris 10/x86 and
Tru64 UNIX V5.1B due to the use of unportable shell constructs in
classpath/lib/split-for-gcj.sh:
/vol/gnu/src/gcc/gcc-dist/libjava/classpath/lib/split-for-gcj.sh: bad substitution
This file is unconditionally run by /bin/sh, but /bin/sh on those systems
doesn't support
real=${file%.1}
Even after this is fixed, the use of ! in
if ! cmp /dev/null /dev/null; then echo fail;
yields
/vol/gnu/src/gcc/gcc-dist/libjava/classpath/lib/split-for-gcj.sh: !: not found
The latter is documented in the Autoconf manual sub `Limitations of
Builtins'.
The following patch fixes both problems and allows the bootstrap to finish
without regressions.
Ok for mainline?
(I know that this file is from Classpath and should go upstream first, but
this is a bootstrap failure introduced by the big merge, so it is probably
appropriate for libjava, too?)
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Wed Aug 10 19:44:19 2005 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* lib/split-for-gcj.sh: Don't use unportable %{parameter%word}.
Don't use unportable !.
Index: lib/split-for-gcj.sh
===================================================================
RCS file: /cvs/gcc/gcc/libjava/classpath/lib/split-for-gcj.sh,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 split-for-gcj.sh
--- lib/split-for-gcj.sh 16 Jul 2005 00:33:25 -0000 1.1.1.1
+++ lib/split-for-gcj.sh 10 Aug 2005 17:46:01 -0000
@@ -11,7 +11,7 @@ for dir in java javax gnu org; do
list=lists/`echo $pkg | sed -e 's,/,-,g'`
echo "$file" >> ${list}.list.1
f2=`echo "$file" | sed -n -e "s,^.*/\($dir/.*\)$,\1,p"`
- f2=${f2%.java}.class
+ f2=`echo "$f2" | sed -e 's/.java$//'`.class
echo "$f2: ${list}.stamp" >> Makefile.deps
echo "${list}.list: $file" >> Makefile.deps
done
@@ -19,10 +19,10 @@ done
# Only update a .list file if it changed.
for file in lists/*.list.1; do
- real=${file%.1}
- if ! cmp -s $real $file; then
- mv $file $real
- else
+ real=`echo "$file" | sed -e 's/.1$//'`
+ if cmp -s $real $file; then
rm $file
+ else
+ mv $file $real
fi
done