Commit 5d7cc9ba authored by ijones's avatar ijones
Browse files

added extensionToGHCFlag (from bringert)

parent 064996dd
......@@ -42,7 +42,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module Distribution.Misc(License(..), Dependency, Extension, Opt
module Distribution.Misc(License(..), Dependency, Extension(..), Opt
#ifdef DEBUG
,hunitTests
#endif
......@@ -70,7 +70,11 @@ data Dependency = Dependency String VersionRange
-- |This represents non-standard compiler extensions which each
-- package might employ. Not yet implemented.
data Extension = Foo | Bar deriving Show
data Extension =
OverlappingInstances
| TypeSynonymInstances
| TemplateHaskell
deriving Show
type Opt = String
......
......@@ -47,7 +47,7 @@ module Distribution.Simple.Build (
#endif
) where
import Distribution.Misc (Extension)
import Distribution.Misc (Extension(..))
import Distribution.Setup (CompilerFlavor(..), compilerFlavor, compilerPath)
import Distribution.Package (PackageDescription(..), showPackageId)
import Distribution.Simple.Configure (LocalBuildInfo, compiler)
......@@ -59,7 +59,7 @@ import Distribution.Simple.Utils (rawSystemExit, setupMessage,
import Control.Monad (when)
import Data.List(intersperse)
import Data.List(intersperse, nub)
#ifdef DEBUG
import HUnit (Test)
......@@ -117,7 +117,11 @@ constructGHCCmdLine pref pkg_descr _ =
++ allModules pkg_descr
extensionsToGHCFlag :: [ Extension ] -> [String]
extensionsToGHCFlag _ = [] -- ToDo
extensionsToGHCFlag = nub . map extensionToGHCFlag
where
extensionToGHCFlag OverlappingInstances = "-fallow-overlapping-instances"
extensionToGHCFlag TypeSynonymInstances = "-fglasgow-exts"
extensionToGHCFlag TemplateHaskell = "-fth"
extensionsToNHCFlag :: [ Extension ] -> [String]
extensionsToNHCFlag _ = [] -- ToDo
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment