
On Wed, Jul 26, 2006 at 09:25:49AM -0700, Isaac Jones wrote:
CCing Ian, since I seem to remember that he hacked on the makefile.
Frederik Eaton
writes: Hi,
What's the reason for not resolving executables through PATH in the cabal Makefile?
No particularly good reason, afaik.
$ pwd /home/frederik/cabal-1.1.4 $ which ghc /home/frederik/arch/i386/bin/ghc $ make install mkdir -p dist/tmp /usr/bin/ghc --make -Wall -fno-warn-unused-matches -cpp -i. -odir dist/tmp -hidir dist/tmp Setup.lhs -o setup make: /usr/bin/ghc: Command not found make: *** [setup] Error 127
If I want to specify a different version of GHC than the one I normally use, then I could do:
$ PATH=special-version-dir:$PATH make install
similar to:
$ HCBASE=special-version-dir make install
which works now, right?
Yes, that was my point. My suggestion is quite similar in the unusual case where one needs to specify a different compiler from what one normally uses, and in the default case it's much shorter.
One disadvantage to using PATH is in the case where you want to use the GHC in /usr/local, but some other tool in /usr.
$ mkdir ghcbin $ ln -s /usr/local/bin/ghc ghcbin/ $ PATH=$PWD/ghcbin:$PATH make install
Why the cabal makefile has to introduce a new variable HCBASE to achieve this functionality, I don't understand. It makes the normal user's life much harder by breaking a standard Unix abstraction layer; and at the same time it barely makes anyone else's life any easier.
It's only been a few years without anyone complaining ;)
Also, I think it is more standard to use PREFIX to refer to what appears as PREF in the makefile.
If no one has any objections, I'd be happy to apply a tested patch for this.
I've attached a tested patch. Thanks, Frederik -- http://ofb.net/~frederik/