[nhc-bugs] <Pine.LNX.4.10.10105222334140.24464-100000@90-mia-3.acn.waw.pl>

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Wed, 23 May 2001 14:30:57 +0100


[ Moved from nhc-users to nhc-bugs ]

Wojciech Moczydlowski, Jr writes:
> The configure script fails to detect ghc-5.00 - due to driver changes.

Oops, yes indeed.  Try the following patch.  I haven't been able to
test it fully, but i think it should work.

Regards,
    Malcolm


---- cut here ----
diff -u -r1.27 confhc
--- script/confhc	2001/03/23 20:36:38	1.27
+++ script/confhc	2001/05/23 13:25:21
@@ -149,12 +149,18 @@
   whichGHC=`which ghc`
   GHCVER=`${whichGHC} --version 2>&1 | sed 's/^.*version[ ]*\([0-9.]*\).*/\1/'`
   GHCSYM=`echo $GHCVER | tr "." " " | ( read x y z; echo $x$y; )`
-  GHCDIR=`grep '^\$libdir=' ${whichGHC} | head -1 | sed 's/^\$libdir=[^/]*\(.*\).;/\1/'`
-  if [ -d $GHCDIR/imports ]
-  then GHCINCDIR=$GHCDIR/imports
-  elif [ -d $GHCDIR/lib/imports ]
-  then GHCINCDIR=$GHCDIR/lib/imports
-  else GHCDIR=""
+  if [ $GHCSYM -lt 500 ]
+  then
+    GHCDIR=`grep '^\$libdir=' ${whichGHC} | head -1 | sed 's/^\$libdir=[^/]*\(.*\).;/\1/'`
+    if [ -d $GHCDIR/imports ]
+    then GHCINCDIR=$GHCDIR/imports
+    elif [ -d $GHCDIR/lib/imports ]
+    then GHCINCDIR=$GHCDIR/lib/imports
+    else GHCDIR=""
+    fi
+  else
+    GHCDIR=`${whichGHC} --show-package std --field import_dirs`
+    GHCINCDIR=`dirname $GHCDIR`
   fi
 fi
 if [ "$GHCDIR" = "" ]
@@ -247,7 +253,8 @@
            2.*)  sed -e "s|^GHC=0$|GHC=3|"  ;;
            3.*)  sed -e "s|^GHC=0$|GHC=4|"  ;;
            4.*)  sed -e "s|^GHC=0$|GHC=5|"  ;;
-           *)    sed -e "s|^GHC=0$|GHC=6|"  ;;
+           5.*)  sed -e "s|^GHC=0$|GHC=6|"  ;;
+           *)    sed -e "s|^GHC=0$|GHC=7|"  ;;
          esac
        )
   fi