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.
This commit is contained in:
Joey Hess 2013-02-27 02:39:22 -04:00
parent 32aee1bb3e
commit cbd53b4a8c
18 changed files with 56 additions and 141 deletions

View file

@ -56,7 +56,7 @@ query opts =
type LsofParser = String -> [(FilePath, LsofOpenMode, ProcessInfo)]
parse :: LsofParser
#ifdef WITH_ANDROID
#ifdef __ANDROID__
parse = parseDefault
#else
parse = parseFormatted

View file

@ -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 [] $

View file

@ -10,7 +10,7 @@
module Utility.Shell where
shellPath :: FilePath
#ifndef WITH_ANDROID
#ifndef __ANDROID__
shellPath = "/bin/sh"
#else
shellPath = "/system/bin/sh"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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