diff options
author | Joey Hess <joey@kitenet.net> | 2013-02-27 02:39:22 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-02-27 02:39:22 -0400 |
commit | a06989c1aeaf6463e554131993c5cb395d3f08bd (patch) | |
tree | a180b379cce80e8d4fa94cd4a15b5052316fddec /Utility | |
parent | 8ba6b0d9bc54656eb0d8d45adf94561f6350e792 (diff) |
Makefile now builds using cabal, taking advantage of cabal's automatic detection of appropriate build flags.
The only thing lost is ./ghci
Speed: make fast used to take 20 seconds here, when rebuilding from
touching Command/Unused.hs. With cabal, it's 29 seconds.
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Lsof.hs | 2 | ||||
-rw-r--r-- | Utility/SRV.hs | 6 | ||||
-rw-r--r-- | Utility/Shell.hs | 2 | ||||
-rw-r--r-- | Utility/ThreadScheduler.hs | 4 | ||||
-rw-r--r-- | Utility/UserInfo.hs | 2 | ||||
-rw-r--r-- | Utility/Yesod.hs | 6 | ||||
-rw-r--r-- | Utility/libdiskfree.c | 2 | ||||
-rw-r--r-- | Utility/libmounts.h | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/Utility/Lsof.hs b/Utility/Lsof.hs index 2c312a461..8db514d79 100644 --- a/Utility/Lsof.hs +++ b/Utility/Lsof.hs @@ -56,7 +56,7 @@ query opts = type LsofParser = String -> [(FilePath, LsofOpenMode, ProcessInfo)] parse :: LsofParser -#ifdef WITH_ANDROID +#ifdef __ANDROID__ parse = parseDefault #else parse = parseFormatted diff --git a/Utility/SRV.hs b/Utility/SRV.hs index 9a099089e..b39bf71b2 100644 --- a/Utility/SRV.hs +++ b/Utility/SRV.hs @@ -31,14 +31,12 @@ import Data.Maybe import ADNS.Resolver import Data.Either #else -#ifndef WITH_HOST #ifdef WITH_DNS import qualified Network.DNS.Lookup as DNS import Network.DNS.Resolver import qualified Data.ByteString.UTF8 as B8 #endif #endif -#endif newtype SRV = SRV String deriving (Show, Eq) @@ -64,9 +62,6 @@ lookupSRV (SRV srv) = initResolver [] $ \resolver -> do resolveSRV resolver srv return $ either (\_ -> []) id r #else -#ifdef WITH_HOST -lookupSRV = lookupSRVHost -#else #ifdef WITH_DNS lookupSRV (SRV srv) = do seed <- makeResolvSeed defaultResolvConf @@ -83,7 +78,6 @@ lookupSRV (SRV srv) = do lookupSRV = lookupSRVHost #endif #endif -#endif lookupSRVHost :: SRV -> IO [HostPort] lookupSRVHost (SRV srv) = catchDefaultIO [] $ diff --git a/Utility/Shell.hs b/Utility/Shell.hs index fecafe1a8..f3858af7f 100644 --- a/Utility/Shell.hs +++ b/Utility/Shell.hs @@ -10,7 +10,7 @@ module Utility.Shell where shellPath :: FilePath -#ifndef WITH_ANDROID +#ifndef __ANDROID__ shellPath = "/bin/sh" #else shellPath = "/system/bin/sh" diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs index fdf40ab6d..a32606cfd 100644 --- a/Utility/ThreadScheduler.hs +++ b/Utility/ThreadScheduler.hs @@ -14,7 +14,7 @@ import Common import Control.Concurrent import System.Posix.Signals -#ifndef WITH_ANDROID +#ifndef __ANDROID__ import System.Posix.Terminal #endif @@ -53,7 +53,7 @@ waitForTermination :: IO () waitForTermination = do lock <- newEmptyMVar check softwareTermination lock -#ifndef WITH_ANDROID +#ifndef __ANDROID__ whenM (queryTerminal stdInput) $ check keyboardSignal lock #endif diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index 00790f615..916ebb191 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -28,7 +28,7 @@ myUserName :: IO String myUserName = myVal ["USER", "LOGNAME"] userName myUserGecos :: IO String -#ifdef WITH_ANDROID +#ifdef __ANDROID__ myUserGecos = return "" -- userGecos crashes on Android #else myUserGecos = myVal [] userGecos diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index b6748f240..93000587c 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -7,6 +7,12 @@ {-# LANGUAGE CPP #-} +#if defined VERSION_yesod_default +#if ! MIN_VERSION_yesod_default(1,1,0) +#define WITH_OLD_YESOD +#endif +#endif + module Utility.Yesod where import Yesod.Default.Util diff --git a/Utility/libdiskfree.c b/Utility/libdiskfree.c index a9ca90b41..d2843ed20 100644 --- a/Utility/libdiskfree.c +++ b/Utility/libdiskfree.c @@ -22,7 +22,7 @@ # define STATCALL statfs /* statfs64 not yet tested on a real FreeBSD machine */ # define STATSTRUCT statfs #else -#if defined WITH_ANDROID +#if defined __ANDROID__ # warning free space checking code not available for Android # define UNKNOWN #else diff --git a/Utility/libmounts.h b/Utility/libmounts.h index 76b2484d3..460fcc7ab 100644 --- a/Utility/libmounts.h +++ b/Utility/libmounts.h @@ -5,7 +5,7 @@ # include <sys/mount.h> # define GETMNTINFO #else -#if defined WITH_ANDROID +#if defined __ANDROID__ # warning mounts listing code not available for Android # define UNKNOWN #else |