File: Setup.hs

package info (click to toggle)
uuagc 0.9.57-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,760 kB
  • sloc: haskell: 84,339; makefile: 10
file content (21 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
module Main where

import System.Environment (getArgs)
import Distribution.Simple (defaultMainWithHooksArgs, UserHooks (..), simpleUserHooks)
import Distribution.Simple.LocalBuildInfo (flagAssignment)
import Distribution.Simple.UUAGC (uuagcUserHook)
import Distribution.Types.Flag (lookupFlagAssignment, mkFlagName)
import Debug.Trace

main :: IO ()
main = do
  args <- getArgs
  defaultMainWithHooksArgs hooks args
  where
    hooks = uuagcUserHook { buildHook = myBuildHook }
    myBuildHook pd lbi uh bf
      | lookupFlagAssignment (mkFlagName "bootstrap_external") (flagAssignment lbi) == Just True
      = buildHook uuagcUserHook pd lbi uh bf
      | otherwise
      = buildHook simpleUserHooks pd lbi uh bf