[Solaris bindist] ANNOUNCE: GHC 7.8.1 Release Candidate 1

Christian Maeder Christian.Maeder at dfki.de
Thu Feb 13 13:01:03 UTC 2014

Am 06.02.2014 15:27, schrieb Páli Gábor János:
> On Thu, Feb 6, 2014 at 1:39 PM, Merijn Verstraaten
> <merijn at inconsistent.nl> wrote:
>> On Feb 6, 2014, at 10:33 , Christian Maeder wrote:
>>> or (as I've seen elsewhere) better (?)
>>> #!/usr/bin/env bash
>> Definitely use this, FreeBSD (for example) does not ship with bash so /bin/bash will *not* exist.
> Please, do not introduce dependency on bash unless it is really necessary.

In fact ./configure detects "/bin/bash" as SHELL under Solaris, so this 
setting could be used (instead of hard coding "bin/sh")!

(Under FreeBSD a proper other SHELL might be found by ./configure.)

Many configure files of libraries also set SHELL this way.

Yet, for this ghc-pwd-bindist script it is easier to make the script 
(Bourne) /bin/sh compatible. Yet, I have not found out, how this script 
is created!

utils/ghc-pwd/ghc.mk contains
"utils/ghc-pwd_dist-install_WANT_BINDIST_WRAPPER = YES"
but then I'm lost what build-prog does from rules/build-prog.mk.

Maybe somehow the code in
libraries/Cabal/Cabal/Distribution/Simple/Program/Script.hs is called, 
then the second line should be changed from:

     setEnv (var, Nothing)  = ["unset " ++ var, "export " ++ var]
     setEnv (var, Just val) = ["export " ++ var ++ "=" ++ quote val]
     setEnv (var, Nothing)  = ["unset " ++ var, "export " ++ var]
     setEnv (var, Just val) = [var ++ "=" ++ quote val, "export " ++ var]

I guess that is still POSIX compliant.

Cheers Christian

More information about the cabal-devel mailing list