Remove support for GHC versions < 6.12.

Debian stable ships 6.12 now, and this simplifies supporting GHC 7.
This commit is contained in:
Adam Sampson 2011-08-10 11:52:03 +00:00
parent 97e6031d0c
commit d9856814aa
4 changed files with 25 additions and 61 deletions

View File

@ -6,12 +6,29 @@ GHC_OPTS = \
-fwarn-missing-fields \
-fwarn-missing-methods \
-fwarn-missing-signatures \
-fwarn-monomorphism-restriction \
-fwarn-overlapping-patterns \
-fwarn-simple-patterns \
-fwarn-tabs \
-fwarn-type-defaults \
-fwarn-unused-binds \
-fwarn-unused-imports \
\
-XDeriveDataTypeable \
-XExistentialQuantification \
-XFlexibleContexts \
-XFlexibleInstances \
-XFunctionalDependencies \
-XGeneralizedNewtypeDeriving \
-XImpredicativeTypes \
-XKindSignatures \
-XMultiParamTypeClasses \
-XRank2Types \
-XScopedTypeVariables \
-XTypeOperators \
-XTypeSynonymInstances \
-XUndecidableInstances \
\
-hide-all-packages \
-package array \
-package @LIB_VER_base@ \
@ -40,40 +57,6 @@ GHC_OPTS = \
-ipregen \
-itransformations
if GHC68
# I'd like to spell out all the flags for GHC 6.8 as follows.
# But it seems that on GHC 6.8.2 (i386), this causes a GHC panic,
# which I believe is related to the use of unsafeCoerce#. So if anyone
# else tries to do this in future, make sure to test on GHC 6.8.2 (which
# is currently the latest version on Ubuntu and Gentoo)
#
# Addendum: I tried again once unsafeCoerce# was removed, but now it seems
# that -Werror is being secretly activated, which is possibly due to
# the GHC bug we had trouble with before (only fixed in 6.10 I think).
#GHC_OPTS += -XDeriveDataTypeable
#GHC_OPTS += -XExistentialQuantification
#GHC_OPTS += -XFlexibleContexts
#GHC_OPTS += -XFlexibleInstances
#GHC_OPTS += -XFunctionalDependencies
#GHC_OPTS += -XMultiParamTypeClasses
#GHC_OPTS += -XRank2Types
#GHC_OPTS += -XScopedTypeVariables
#GHC_OPTS += -XTypeSynonymInstances
GHC_OPTS += -XUndecidableInstances
GHC_OPTS += -fwarn-tabs -fwarn-monomorphism-restriction
else
# GHC 6.7 or earlier.
GHC_OPTS += -fallow-undecidable-instances
endif
if GHC610
GHC_OPTS += -XImpredicativeTypes
endif
GHC_OPTS += -fglasgow-exts
tock$(EXEEXT): $(BUILT_SOURCES) $(tock_SOURCES) $(config_sources)
@MKDIR_P@ obj
ghc $(GHC_OPTS) -o tock$(EXEEXT) --make Main -odir obj -hidir obj
@ -102,28 +85,19 @@ GenTagAST$(EXEEXT): $(GenTagAST_SOURCES)
# Both these results are near-identical. The -g flag to alex tells it to generate
# a lexer optimised for GHC. The other part of the rule inserts the
# -fno-warn-tabs flag under GHC >= 6.8, but doesn't add anything under previous
# versions of GHC
# -fno-warn-tabs flag.
frontends/LexOccam.hs: frontends/LexOccam.x
alex -g frontends/LexOccam.x -o frontends/LexOccam.temphs
if GHC68
echo "{-# OPTIONS_GHC -fno-warn-tabs -fno-warn-monomorphism-restriction #-}" > frontends/LexOccam.hs
cat frontends/LexOccam.temphs >> frontends/LexOccam.hs
rm frontends/LexOccam.temphs
else
mv frontends/LexOccam.temphs frontends/LexOccam.hs
endif
frontends/LexRain.hs: frontends/LexRain.x
alex -g frontends/LexRain.x -o frontends/LexRain.temphs
if GHC68
echo "{-# OPTIONS_GHC -fno-warn-tabs -fno-warn-monomorphism-restriction #-}" > frontends/LexRain.hs
cat frontends/LexRain.temphs >> frontends/LexRain.hs
rm frontends/LexRain.temphs
else
mv frontends/LexRain.temphs frontends/LexRain.hs
endif
TOCKDIR=$(DATADIR)/tock
TOCKMODDIR=$(TOCKDIR)/modules

View File

@ -1,4 +1,4 @@
{-# OPTIONS_GHC -fallow-incoherent-instances #-}
{-# LANGUAGE IncoherentInstances #-}
{-
Tock: a compiler for parallel languages
Copyright (C) 2007, 2008, 2009 University of Kent

View File

@ -82,14 +82,11 @@ AC_NEED_HASKELL_LIB([regex-posix],LIB_regexposix)
ghc_version=`ghc --numeric-version | awk -F . '{printf "%d%03d%03d\n", $1, $2, $3}'`
AC_MSG_CHECKING([whether GHC version is reasonable])
if test $ghc_version -lt 6006000; then
AC_MSG_ERROR([GHC 6.6 or later is required])
if test $ghc_version -lt 6012000; then
AC_MSG_ERROR([GHC 6.12 or later is required])
fi
AC_MSG_RESULT([OK])
AM_CONDITIONAL([GHC68],[test $ghc_version -ge 6008000])
AM_CONDITIONAL([GHC610],[test $ghc_version -ge 6010000])
AC_DEFUN([AC_PICK_HASKELL_LIB_VER],
[
AC_MSG_CHECKING([for $1 library, major version $2])
@ -101,16 +98,8 @@ AC_DEFUN([AC_PICK_HASKELL_LIB_VER],
fi
])
#GHC 6.10 and later have base-3 and base-4. For now, we're sticking with
#base-3, but we need to know the exact version to tell GHC. We filter
#for base-3, and take the last one (since ghc-pkg lists them in ascending order)
if test $ghc_version -lt 6010000; then
AC_PICK_HASKELL_LIB_VER([base],[3],[LIB_VER_base])
LIB_VER_syb="$LIB_VER_base"
else
AC_PICK_HASKELL_LIB_VER([base],[4],[LIB_VER_base])
AC_PICK_HASKELL_LIB_VER([syb],[0],LIB_VER_syb)
fi
AC_PICK_HASKELL_LIB_VER([base],[4],[LIB_VER_base])
AC_PICK_HASKELL_LIB_VER([syb],[0],LIB_VER_syb)
PKG_CHECK_MODULES(CCSP, ccsp-1.6 >= 1.6.3,,
AC_MSG_WARN([CCSP not located using pkg-config; you will not be able to compile output from the C backend on this machine: ] $CCSP_PKG_ERRORS)

View File

@ -59,7 +59,8 @@ main = do
= (reverse . takeWhile (/= '/') . drop 3 . reverse) $ moduleFileName
header isSpine moduleName =
["{-# OPTIONS_GHC -fallow-overlapping-instances -fwarn-overlapping-patterns -fwarn-unused-matches -fwarn-unused-binds #-}"
["{-# LANGUAGE OverlappingInstances #-}"
,"{-# OPTIONS_GHC -fwarn-overlapping-patterns -fwarn-unused-matches -fwarn-unused-binds #-}"
,"-- | This module is auto-generated by Polyplate. DO NOT EDIT."
,"module " ++ moduleName ++ " () where"
,""