summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-11 16:56:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-11 16:56:30 -0400
commitc4e7c6af35c3abf66b4c0c68d4224ae010e1f2a8 (patch)
tree9712147f4c671a6ce92aca7c6f735311103e58fc /Build
parentae9a235b8c49543df1de1a294a438f0894cd579c (diff)
configure: hardcode some things that cannot be probed for when cross-compiling for Android
Diffstat (limited to 'Build')
-rw-r--r--Build/Configure.hs21
1 files changed, 20 insertions, 1 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index 6e12d19af..b6e852d48 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -7,6 +7,7 @@ import Data.List
import System.Process
import Control.Applicative
import System.FilePath
+import System.Environment
import Build.TestConfig
import Utility.SafeCommand
@@ -121,8 +122,26 @@ cleanup = removeDirectoryRecursive tmpDir
run :: [TestCase] -> IO ()
run ts = do
+ args <- getArgs
setup
config <- runTests ts
- writeSysConfig config
+ if args == ["Android"]
+ then writeSysConfig $ androidConfig config
+ else writeSysConfig config
cleanup
cabalSetup
+
+{- Hard codes some settings to cross-compile for Android. -}
+androidConfig :: [Config] -> [Config]
+androidConfig c = overrides ++ filter (not . overridden) c
+ where
+ overrides =
+ [ Config "cp_reflink_auto" $ BoolConfig False
+ , Config "curl" $ BoolConfig False
+ , Config "sshconnectioncaching" $ BoolConfig False
+ , Config "sha224" $ MaybeStringConfig Nothing
+ , Config "sha384" $ MaybeStringConfig Nothing
+ ]
+ overridden (Config k _) = k `elem` overridekeys
+ overridekeys = map (\(Config k _) -> k) overrides
+