From 2e09c8290ae3c9c613efd5a22de08cacece271e5 Mon Sep 17 00:00:00 2001
From: Ian Lynagh <igloo@earth.li>
Date: Sat, 14 Jan 2012 22:04:34 +0000
Subject: [PATCH] When configuring, handle $topdir/ in the ghc --info output

It might make more sense for there to be a way to get the
"ghc --info" output with $topdir already expanded, but in
the mean time this gets things working again.
---
 aclocal.m4 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/aclocal.m4 b/aclocal.m4
index dcb8832a7549..1e1f30cb64f5 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1891,6 +1891,12 @@ AC_DEFUN([BOOTSTRAPPING_GHC_INFO_FIELD],[
 if test $GhcCanonVersion -ge 701
 then
     $1=`"$WithGhc" --info | grep "^ ,(\"$2\"," | sed -e 's/.*","//' -e 's/")$//'`
+    tmp=${$1#\$topdir/}
+    if test "${$1}" != "$tmp"
+    then
+        topdir=`"$WithGhc" --print-libdir | sed 's#\\\\#/#g'`
+        $1="$topdir/$tmp"
+    fi
 else
     $1=$3
 fi
-- 
GitLab