Fixes for compiling the HEAD with iteslf
authorIan Lynagh <igloo@earth.li>
Sun, 13 Sep 2009 14:21:22 +0000 (14:21 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 13 Sep 2009 14:21:22 +0000 (14:21 +0000)
compiler/ghc.mk
configure.ac
mk/config.mk.in
utils/ghc-cabal/ghc-cabal.hs

index e8c487f..498e8dc 100644 (file)
@@ -364,19 +364,23 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 # The #include is vital for the via-C route with older compilers, else the C
 # compiler doesn't realise that the stcall foreign imports are indeed
 # stdcall, and doesn't generate the Foo@8 name for them
-# As it's only important for older compilers we don't need to do anything
-# for stage2+.
+# It's only important for older compilers, and in fact newer compilers
+# will give a warning if the -#include flag is used. We therefore only
+# do it for stage1, and only for < 6.11.
+ifeq "$(ghc_ge_611)" "NO"
 compiler_stage1_CONFIGURE_OPTS += --ghc-option='-\#include'    \
                           --ghc-option='"<windows.h>"' \
                           --ghc-option='-\#include'    \
                           --ghc-option='"<process.h>"'
 endif
+endif
 
 # ghc_strlen percolates through so many modules that it is easier to get its
 # prototype via a global option instead of a myriad of per-file OPTIONS.
-# Again, this is only important for older compilers, so we don't do it in
-# stage 2+.
+# Again, this is only done for older compilers.
+ifeq "$(ghc_ge_611)" "NO"
 compiler_stage1_CONFIGURE_OPTS += --ghc-options='-\#include "cutils.h"'
+endif
 
 compiler_stage3_CONFIGURE_OPTS := $(compiler_stage2_CONFIGURE_OPTS)
 
index c615967..5387c83 100644 (file)
@@ -128,8 +128,10 @@ if test "$WithGhc" != ""; then
   if test $GhcCanonVersion -ge 609; then ghc_ge_609=YES; else ghc_ge_609=NO; fi
   FP_COMPARE_VERSIONS($GhcVersion,[-ge],[6.10.2],
                       [ghc_ge_6102=YES], [ghc_ge_6102=NO])
+  if test $GhcCanonVersion -ge 611; then ghc_ge_611=YES; else ghc_ge_611=NO; fi
   AC_SUBST(ghc_ge_609)dnl
   AC_SUBST(ghc_ge_6102)dnl
+  AC_SUBST(ghc_ge_611)dnl
 fi
 
 dnl ** Must have GHC to build GHC, unless --enable-hc-boot is on
index 6516238..0b2300c 100644 (file)
@@ -509,6 +509,7 @@ GhcMinVersion       = @GhcMinVersion@
 
 ghc_ge_609 = @ghc_ge_609@
 ghc_ge_6102 = @ghc_ge_6102@
+ghc_ge_611 = @ghc_ge_611@
 
 # Canonicalised ghc version number, used for easy (integer) version
 # comparisons.  We must expand $(GhcMinVersion) to two digits by
index 3d9cf13..f5fd6d8 100644 (file)
@@ -26,7 +26,6 @@ import System.Directory
 import System.Environment
 import System.Exit
 import System.FilePath
-import Data.Char
 
 main :: IO ()
 main = do args <- getArgs