Commit 35073a0a authored by pcapriotti's avatar pcapriotti
Browse files

Avoid using deprecated package-conf GHC flags.

parent f3cb7ecb
...@@ -24,6 +24,13 @@ main = do ...@@ -24,6 +24,13 @@ main = do
getGhcField fields "GhcRTSWays" "RTS ways" getGhcField fields "GhcRTSWays" "RTS ways"
getGhcFieldProgWithDefault fields "AR" "ar command" "ar" getGhcFieldProgWithDefault fields "AR" "ar command" "ar"
let pkgdb_flag = case lookup "Project version" fields of
Just v
| parseVersion v >= [7,5] -> "package-db"
_ -> "package-conf"
putStrLn $ "GhcPackageDbFlag" ++ '=':pkgdb_flag
getGhcField :: [(String,String)] -> String -> String -> IO () getGhcField :: [(String,String)] -> String -> String -> IO ()
getGhcField fields mkvar key = getGhcField fields mkvar key =
case lookup key fields of case lookup key fields of
...@@ -49,3 +56,9 @@ fixSlashes = map f ...@@ -49,3 +56,9 @@ fixSlashes = map f
where f '\\' = '/' where f '\\' = '/'
f c = c f c = c
parseVersion :: String -> [Int]
parseVersion v = case break (== '.') v of
(n, rest) -> read n : case rest of
[] -> []
('.':v') -> parseVersion v'
_ -> error "bug in parseVersion"
...@@ -27,7 +27,7 @@ CONFIG = $(CONFIGDIR)/$(COMPILER) ...@@ -27,7 +27,7 @@ CONFIG = $(CONFIGDIR)/$(COMPILER)
# TEST_HC_OPTS is passed to every invocation of TEST_HC # TEST_HC_OPTS is passed to every invocation of TEST_HC
# in nested Makefiles # in nested Makefiles
TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-conf -rtsopts $(EXTRA_HC_OPTS) TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS)
RUNTEST_OPTS = RUNTEST_OPTS =
......
Markdown is supported
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