projects
/
haskell-directory.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mark System.IO.openTempFile as non-portable in haddocks
[haskell-directory.git]
/
Setup.hs
diff --git
a/Setup.hs
b/Setup.hs
index
ae4f600
..
7fb1d87
100644
(file)
--- a/
Setup.hs
+++ b/
Setup.hs
@@
-10,9
+10,7
@@
import Control.Monad
import Data.List
import Distribution.Simple
import Distribution.PackageDescription
import Data.List
import Distribution.Simple
import Distribution.PackageDescription
-import Distribution.PreProcess
import Distribution.Setup
import Distribution.Setup
-import Distribution.Simple.Configure
import Distribution.Simple.LocalBuildInfo
import System.Environment
import System.Exit
import Distribution.Simple.LocalBuildInfo
import System.Environment
import System.Exit
@@
-20,11
+18,11
@@
import System.Exit
main :: IO ()
main = do args <- getArgs
let (ghcArgs, args') = extractGhcArgs args
main :: IO ()
main = do args <- getArgs
let (ghcArgs, args') = extractGhcArgs args
- (configureArgs, args'') = extractConfigureArgs args'
+ (confArgs, args'') = extractConfigureArgs args'
hooks = defaultUserHooks {
confHook = add_extra_deps
$ confHook defaultUserHooks,
hooks = defaultUserHooks {
confHook = add_extra_deps
$ confHook defaultUserHooks,
- postConf = add_configure_options configureArgs
+ postConf = add_configure_options confArgs
$ postConf defaultUserHooks,
buildHook = add_ghc_options ghcArgs
$ filter_modules_hook
$ postConf defaultUserHooks,
buildHook = add_ghc_options ghcArgs
$ filter_modules_hook
@@
-40,11
+38,11
@@
extractConfigureArgs :: [String] -> ([String], [String])
extractConfigureArgs = extractPrefixArgs "--configure-option="
extractPrefixArgs :: String -> [String] -> ([String], [String])
extractConfigureArgs = extractPrefixArgs "--configure-option="
extractPrefixArgs :: String -> [String] -> ([String], [String])
-extractPrefixArgs prefix args
+extractPrefixArgs the_prefix args
= let f [] = ([], [])
f (x:xs) = case f xs of
(wantedArgs, otherArgs) ->
= let f [] = ([], [])
f (x:xs) = case f xs of
(wantedArgs, otherArgs) ->
- case removePrefix prefix x of
+ case removePrefix the_prefix x of
Just wantedArg ->
(wantedArg:wantedArgs, otherArgs)
Nothing ->
Just wantedArg ->
(wantedArg:wantedArgs, otherArgs)
Nothing ->
@@
-53,6
+51,7
@@
extractPrefixArgs prefix args
removePrefix :: String -> String -> Maybe String
removePrefix "" ys = Just ys
removePrefix :: String -> String -> Maybe String
removePrefix "" ys = Just ys
+removePrefix _ "" = Nothing
removePrefix (x:xs) (y:ys)
| x == y = removePrefix xs ys
| otherwise = Nothing
removePrefix (x:xs) (y:ys)
| x == y = removePrefix xs ys
| otherwise = Nothing