On Tue, Jul 13, 1999 at 17:47:27 +0900, Manuel M. T. Chakravarty wrote:
> Simon Marlow <[EMAIL PROTECTED]> wrote,
>
>>>> It isn't strictly speaking hardcoded, it's set up when you configure a
>>>> binary distribution. So if you move gcc or install a new version, you need
>>>> to re-install ghc.
Yes, and that's a thing which should not happen: one installs a new package
and mysteriously other packages begin to break... :-( Even worse: consider
this being done by the admin or automatically, i.e. where problem resolution
isn't simple...
>>> I am sure that it is clear that a binary distribution with strict
>>> dependencies on locations of other tools is far from ideal.
That's exactly why I wrote the original message :-)
> > This probably isn't the case for RPM's, but as you noted in your message
> > it's up to the package builder to arrange for the location of cpp and other
> > tools to be configured at install time.
>>> [...] it would be nice if the path (and any other similar dependencies)
>>> where located in a dedicated file where they are easy to find and patch.
>
> One possibility would be to have a `ghc-cpp' script, which is a one liner
> and just `exec's cpp. We could either patch this script or have different
> versions `ghc-cpp-<arch>', which are linked to `ghc-cpp'. What do you
> think?
*hmm* IMHO we already have one: 'hscpp'. As I said, ghc doesn't make use of
$RAWCPP, and mkdependHS could use hscpp instead of calling cpp directly.
Besides, SimonM mentioned that 'gcc -E' is a Bad Thing. I tried CPPs from
gcc-2.7.2.3, gcc-2.8.1 and egcs-2.91.66, and they do accept input from stdin
(note the dash):
======
$ echo TEST|gcc -E -DTEST=works -
# 1 ""
works
======
However, cpp does the same without the dash, but adding a dash _doesn't_
break things.
======
$ echo TEST|cpp -DTEST=works -
# 1 ""
works
======
Regarding unusual places where CPP lives on some systems, this should be (is
already?) solved by autoconf. IIRC, ghc relies heavily on gcc's/egcs's
features on all platforms, so we loose, if there is none, anyway.
autoconf will always prefer an installed gcc over any other compiler, and
thus also "gcc -E" over anything else.
So the only things we have do, are:
* in aclocal.m4, set $fptools_cv_gnu_cpp="$CPP -" and put this into hscpp's
$RAWCPP
* make mkdependHS use hscpp
* remove $RAWCPP from perl scripts, that don't make use of it
BTW: I tried Solaris and Linux platforms only, maybe the *BSD, OSF, and Windows
folks should do the above tests, too...
Cheers,
Michael
--
standard construction, def:
"sort of a mathematical equivalent of 'hey you'"
-- Phil Wadler, "Monads"