[nhc-bugs] confhc does not recognize ghc 5.*

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Tue, 23 Oct 2001 10:53:29 +0100


Mieszko Lis <elf@sandburst.com> writes:
> i ran into a compiler-detection bug in building nhc98 (the 1.10 tarball, 
> but the same bug seems to be in cvs and earlier versions): the build 
> process fails to detect the default ghc 5.02 installation on my debian 
> linux machine as well as the ghc 5.00.2 installation on a redhat 7.1 box 
> nearby.
> 
> the problem turns out to be that script/confhc looks through the ghc 
> executable for the wrong stuff (at least in the installations i 
> mentioned above).  i attached a patch  (against the cvs tree) to fix 
> this at least on these debian and redhat installations.

Here is the essential part of the patch:

-     GHCDIR=`grep '^libdir' ${whichGHC} | head -1 | sed 's/^libdir=.\(.*\)./\1/'`
+     GHCDIR=`grep '^TOPDIROPT' ${whichGHC} | head -1 | sed 's/^TOPDIROPT="*-B\([^";]*\).*/\1/'`

However, this does not work on my (Slackware Linux) machine.  In the
driver script for ghc-5.02, I see the following two lines:

    libdir='/usr/malcolm/local/lib/ghc-5.02'
    TOPDIROPT="-B$libdir";

which means that the original confhc gives the correct path
(/usr/malcolm/local/lib/ghc-5.02), but the patched confhc gives an
incorrect path symbol ($libdir).

Can someone at ghc central confirm whether this part of the ghc-5.02
driver script differs, depending on package and platform?  And if so,
what is the best way to detect which variation applies?

Regards,
    Malcolm