This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[JAVA] /bin/sh portability issues in scripts/check_jni_methods.sh
- From: Roger Sayle <roger at eyesopen dot com>
- To: java-patches at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 6 Jul 2006 22:44:19 -0600 (MDT)
- Subject: [JAVA] /bin/sh portability issues in scripts/check_jni_methods.sh
This patch, or more likely request for help, is the fourth and final
in the series to enable mainline GCC to be bootstrapped with the native
/bin/sh on Solaris/x86. The current build failures are a regression
from gcc 3.4. These four patches appear to address all of the build
system related issues with the default build.
Now for the admission. This final patch, to scripts/check_jni_methods.sh
is more of a workaround (hack?) than a solution to the portability issues.
The problem is that this shell script contains the command "set -C" which
isn't supported by Solaris' sh. Commenting it out, stops the script from
terminating with a hard error, and enables libjava to reach the
application linking steps at the end of the build (which suffer from
boehmgc issues that I may not have resolved correctly).
However, I've no idea what the correct way to fix this problem is. I
did discover that this issue is related to PR other/2141, which was a
similar use of "set -C" in gccbug. The solution there was to reorganize
the script to avoid the need for this functionality.
If any shell scripting gurus could take a look and see what the
correct fix for this problem is, it'd be much appreciated.
Many thanks in advance,
2006-07-06 Roger Sayle <roger@eyesopen.com>
* scripts/check_jni_methods.sh: Don't use the "set -C" command
which isn't available in all shells.
Index: scripts/check_jni_methods.sh
===================================================================
*** scripts/check_jni_methods.sh (revision 115223)
--- scripts/check_jni_methods.sh (working copy)
***************
*** 3,9 ****
# Fail if any command fails
set -e
# Don't override existing files
! set -C
TMPFILE=/tmp/check-jni-methods.$$.1
TMPFILE2=/tmp/check-jni-methods.$$.2
--- 3,10 ----
# Fail if any command fails
set -e
# Don't override existing files
! # Alas, this doesn't appear to be portable
! # set -C
TMPFILE=/tmp/check-jni-methods.$$.1
TMPFILE2=/tmp/check-jni-methods.$$.2
Roger
--