Simplify BOOTSTRAPPING_GHC_INFO_FIELD
authorIan Lynagh <ian@well-typed.com>
Tue, 13 Nov 2012 22:30:42 +0000 (22:30 +0000)
committerIan Lynagh <ian@well-typed.com>
Tue, 13 Nov 2012 22:30:42 +0000 (22:30 +0000)
All supported bootstrapping compilers now have --info output,
so we can use that unconditionally.

aclocal.m4
configure.ac

index 9adad1e..9087994 100644 (file)
@@ -1857,21 +1857,14 @@ case "$1" in
 
 # BOOTSTRAPPING_GHC_INFO_FIELD
 # --------------------------------
-# If the bootstrapping compiler is >= 7.1, then set the variable
-# $1 to the value of the ghc --info field $2. Otherwise, set it to
-# $3.
+# Set the variable $1 to the value of the ghc --info field $2.
 AC_DEFUN([BOOTSTRAPPING_GHC_INFO_FIELD],[
-if test $GhcCanonVersion -ge 701
+$1=`"$WithGhc" --info | grep "^ ,(\"$2\"," | sed -e 's/.*","//' -e 's/")$//'`
+tmp=${$1#\$topdir/}
+if test "${$1}" != "$tmp"
 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
+    topdir=`"$WithGhc" --print-libdir | sed 's#\\\\#/#g'`
+    $1="$topdir/$tmp"
 fi
 AC_SUBST($1)
 ])
index 5c887f6..f0bc4c3 100644 (file)
@@ -131,12 +131,12 @@ if test "$WithGhc" != ""; then
   GhcMinVersion2=`echo "$GhcMinVersion" | sed 's/^\\(.\\)$/0\\1/'`
   GhcCanonVersion="$GhcMajVersion$GhcMinVersion2"
 
-  BOOTSTRAPPING_GHC_INFO_FIELD([OS_STAGE0],[target os],['unkown'])
-  BOOTSTRAPPING_GHC_INFO_FIELD([CC_STAGE0],[C compiler command],['$(CC)'])
+  BOOTSTRAPPING_GHC_INFO_FIELD([OS_STAGE0],[target os])
+  BOOTSTRAPPING_GHC_INFO_FIELD([CC_STAGE0],[C compiler command])
   if test "x$OS_STAGE0" != "xOSDarwin"; then
-    BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command],['$(AR)'])
-    BOOTSTRAPPING_GHC_INFO_FIELD([AR_OPTS_STAGE0],[ar flags],['$(AR_OPTS)'])
-    BOOTSTRAPPING_GHC_INFO_FIELD([ArSupportsAtFile_STAGE0],[ar supports at file],['$(ArSupportsAtFile)'])
+    BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command])
+    BOOTSTRAPPING_GHC_INFO_FIELD([AR_OPTS_STAGE0],[ar flags])
+    BOOTSTRAPPING_GHC_INFO_FIELD([ArSupportsAtFile_STAGE0],[ar supports at file])
   else
     AR_STAGE0='$(AR)'
     AR_OPTS_STAGE0='$(AR_OPTS)'