]> hydra-www.ietfng.org Git - dyna2/commitdiff
Attempt to improve GHC version support
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 4 May 2015 15:17:01 +0000 (11:17 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 4 May 2015 18:18:43 +0000 (14:18 -0400)
Hopefully this helps people who aren't running the latest GHC until
the whole Mode system is gutted and replaced.

See github:nwf/dyna#81

dyna.cabal
src/Dyna/Analysis/Mode/Execution/Functions.hs

index aec6a05c08194d3b569f236ab67bf8ab4ccd6f3b..3b73ba0f4cd6cb53094e95bf74a462ea4dc3c266 100644 (file)
@@ -100,6 +100,9 @@ Executable dyna
     ghc-options:        -Wall
                         -main-is Dyna.Main.Driver
 
+    if (impl(ghc < 7.7))
+        cpp-options:   -DDYNA_GHC_PRE_77
+
     Build-Depends:      ansi-wl-pprint >= 0.6,
                         base >=4 && <6,
                         bytestring >=0.9,
@@ -135,6 +138,9 @@ Test-suite dyna-selftests
     ghc-options:        -Wall
                         -main-is Dyna.Main.TestsDriver
 
+    if (impl(ghc < 7.7))
+        cpp-options:   -DDYNA_GHC_PRE_77
+
     Build-Depends:      ansi-wl-pprint >= 0.6,
                         base >=4 && <6,
                         bytestring >=0.9,
index 43e105002befd6391f6ddfe2ad515f90657b747e..8f6164d9520ed1d1d760371415d62d5c22959128 100644 (file)
@@ -3,6 +3,7 @@
 -- call during mode analysis.
 
 -- Header material                                                      {{{
+{-# LANGUAGE CPP #-} -- XXX doCall
 {-# LANGUAGE ConstraintKinds #-}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE ViewPatterns #-}
+       -- XXX can't use MIN_TOOL_VERSION because there are still
+       -- very old cabals out in the wild. :(
+#ifndef DYNA_GHC_PRE_77
 {-# LANGUAGE AllowAmbiguousTypes #-} -- XXX doCall
+#endif
 {-# OPTIONS_GHC -Wall #-}
 
 module Dyna.Analysis.Mode.Execution.Functions (