Bug 31224 - some installation scripts and Makefiles do not run on stock Solaris
Summary: some installation scripts and Makefiles do not run on stock Solaris
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.1.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-16 13:52 UTC by Luc Maisonobe
Modified: 2007-03-19 08:08 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments
patch changing commands flags to ones hopefully more widely supported (1.14 KB, patch)
2007-03-16 13:56 UTC, Luc Maisonobe
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luc Maisonobe 2007-03-16 13:52:30 UTC
Some scripts and Makefiles used during the bootstrap process use options provided by GNU tools (bash, test, diff) which are not supported by stock Solaris 2.8 tools.

The errors I have encountered so far (I'm still fighting with installation) are:

 missing -a flag between two tests

 use of test -e, which should be replaced by test -f
  (or test -d for directories)

 use of set -C in shell (which has no equivalent)

 use of diff -U 0, which should be replaced by diff -C 0 with the additional
  trick to add a space between the initial '-' or '+' character and the line

The concerned files are libjava/classpath/lib/gen-classlist.sh.in, libjava/classpath/lib/Makefile.am and libjava/classpath/scripts/check_jni_methods.sh.

I will post a patch for this in a few minutes.
Comment 1 Luc Maisonobe 2007-03-16 13:56:48 UTC
Created attachment 13213 [details]
patch changing commands flags to ones hopefully more widely supported

This patch is neither fully tested nor complete. It is merely provided as a reference and to clarify the problem. I am not sure the chosen flags are the good ones (for example I didn't understand what the inial test with the missing -a and the compound -ef flags intended to do).
Comment 2 Luc Maisonobe 2007-03-16 13:59:50 UTC
In the provided patch, I replaced a sequence of mkdir commands with a single mkdir -p. I know the -p flag is not supported everywhere (or at least was not supported years ago), but since this option is used elsewhere in the Makefile.am, I considered it was not a problem.
Comment 3 Andrew Pinski 2007-03-16 15:20:35 UTC
/bin/sh is not a POSIX shell in Solaris and GCC depends a POSIX shell.

test -ef is actually POSIX, read the man page on solaris, it will say it is not avaible with /bin/sh.


Anyways you did not read:
http://gcc.gnu.org/install/specific.html#x-x-solaris2

Which says:

The Solaris 2 /bin/sh will often fail to configure libstdc++-v3, boehm-gc or libjava. We therefore recommend using the following initial sequence of commands

        % CONFIG_SHELL=/bin/ksh
        % export CONFIG_SHELL
Comment 4 Luc Maisonobe 2007-03-19 08:08:21 UTC
Sorry, I missed this.

One question remains, though: does this also stand for the -U flag in the diff command from script libjava/classpath/scripts/check_jni_methods.sh ? I did not find anything about it (but once again may have missed something).