[commit: ghc] master: Simplify BOOTSTRAPPING_GHC_INFO_FIELD (e605c3e)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/e605c3e8c1b1a643a7c11e7aa2a7f639dd890cfe

>---------------------------------------------------------------

commit e605c3e8c1b1a643a7c11e7aa2a7f639dd890cfe
Author: Ian Lynagh <[email protected]>
Date:   Tue Nov 13 22:30:42 2012 +0000

    Simplify BOOTSTRAPPING_GHC_INFO_FIELD
    
    All supported bootstrapping compilers now have --info output,
    so we can use that unconditionally.

>---------------------------------------------------------------

 aclocal.m4   |   19 ++++++-------------
 configure.ac |   10 +++++-----
 2 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 9adad1e..9087994 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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)
 ])
diff --git a/configure.ac b/configure.ac
index 5c887f6..f0bc4c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.