summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Assistant.hs4
-rw-r--r--Makefile30
-rw-r--r--Utility/DiskFree.hs11
-rw-r--r--git-annex.cabal1
4 files changed, 34 insertions, 12 deletions
diff --git a/Assistant.hs b/Assistant.hs
index 63a5dafae..98e156175 100644
--- a/Assistant.hs
+++ b/Assistant.hs
@@ -133,7 +133,9 @@ import Assistant.Threads.Merger
import Assistant.Threads.TransferWatcher
import Assistant.Threads.Transferrer
import Assistant.Threads.SanityChecker
+#ifdef WITH_CLIBS
import Assistant.Threads.MountWatcher
+#endif
import Assistant.Threads.NetWatcher
import Assistant.Threads.TransferScanner
import Assistant.Threads.TransferPoller
@@ -219,7 +221,9 @@ startDaemon assistant foreground startbrowser = do
, assist $ daemonStatusThread
, assist $ sanityCheckerDailyThread
, assist $ sanityCheckerHourlyThread
+#ifdef WITH_CLIBS
, assist $ mountWatcherThread
+#endif
, assist $ netWatcherThread
, assist $ netWatcherFallbackThread
, assist $ transferScannerThread
diff --git a/Makefile b/Makefile
index ced1e2c9a..c26890af7 100644
--- a/Makefile
+++ b/Makefile
@@ -13,17 +13,6 @@ endif
build: $(all)
-# We bypass cabal, and only run the main ghc --make command for a
-# fast development built. Note: Does not rebuild C libraries.
-fast: dist/caballog
- @$$(grep 'ghc --make' dist/caballog | head -n 1)
- @ln -sf dist/build/git-annex/git-annex git-annex
- @$(MAKE) tags >/dev/null 2>&1
-
-dist/caballog: git-annex.cabal
- $(CABAL) configure -f"-Production" -O0
- $(CABAL) build -v2 | tee $@
-
Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs
$(CABAL) configure
@@ -167,4 +156,23 @@ androidapp:
$(MAKE) android
$(MAKE) -C standalone/android
+# We bypass cabal, and only run the main ghc --make command for a
+# fast development built. Note: Does not rebuild C libraries.
+fast: dist/caballog
+ @$$(grep 'ghc --make' dist/caballog | head -n 1)
+ @ln -sf dist/build/git-annex/git-annex git-annex
+ @$(MAKE) tags >/dev/null 2>&1
+
+dist/caballog: git-annex.cabal
+ $(CABAL) configure -f"-Production" -O0
+ $(CABAL) build -v2 | tee $@
+
+# Hardcoded command line to make hdevtools start up and work.
+# You will need some memory. It's worth it.
+# Note: Don't include WebDAV or Webapp. TH use bloats memory > 500 mb!
+# TODO should be possible to derive this from caballog.
+hdevtools:
+ hdevtools --stop-server || true
+ hdevtools check git-annex.hs -g -cpp -g -i -g -idist/build/git-annex/git-annex-tmp -g -i. -g -idist/build/autogen -g -Idist/build/autogen -g -Idist/build/git-annex/git-annex-tmp -g -IUtility -g -DWITH_TESTSUITE -g -DWITH_S3 -g -DWITH_ASSISTANT -g -DWITH_INOTIFY -g -DWITH_DBUS -g -DWITH_PAIRING -g -DWITH_XMPP -g -optP-include -g -optPdist/build/autogen/cabal_macros.h -g -odir -g dist/build/git-annex/git-annex-tmp -g -hidir -g dist/build/git-annex/git-annex-tmp -g -stubdir -g dist/build/git-annex/git-annex-tmp -g -threaded -g -Wall -g -XHaskell98
+
.PHONY: git-annex tags
diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs
index 453244175..20911dd06 100644
--- a/Utility/DiskFree.hs
+++ b/Utility/DiskFree.hs
@@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-{-# LANGUAGE ForeignFunctionInterface #-}
+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
module Utility.DiskFree ( getDiskFree ) where
@@ -15,6 +15,8 @@ import Foreign.C.Types
import Foreign.C.String
import Foreign.C.Error
+#ifdef WITH_CLIBS
+
foreign import ccall safe "libdiskfree.h diskfree" c_diskfree
:: CString -> IO CULLong
@@ -27,3 +29,10 @@ getDiskFree path = withFilePath path $ \c_path -> do
)
where
safeErrno (Errno v) = v == 0
+
+#else
+
+getDiskFree :: FilePath -> IO (Maybe Integer)
+getDiskFree _ = return Nothing
+
+#endif
diff --git a/git-annex.cabal b/git-annex.cabal
index e113164fb..18154c4d4 100644
--- a/git-annex.cabal
+++ b/git-annex.cabal
@@ -77,6 +77,7 @@ Executable git-annex
C-Sources: Utility/libdiskfree.c Utility/libmounts.c
CC-Options: -Wall
GHC-Options: -threaded -Wall
+ CPP-Options: -DWITH_CLIBS
if flag(Production)
GHC-Options: -O2