summaryrefslogtreecommitdiff
path: root/Utility
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-10 15:48:38 -0400
commit4e14ef3660924e7c005c42d4d58716ee0beb2d31 (patch)
tree4691e44203ded56f77bf2c4abf5de9a6acdac462 /Utility
parent516d4899d3ea7e12ee9b408160b36190b8c2d3f2 (diff)
can now build Android targeted binary
Various things that don't work on Android are just ifdefed out. * the webapp (needs template haskell for arm) * --include and --exclude globbing (needs libpcre, which is not ported; probably I'll make it use the pure haskell glob library instead) * annex.diskreserve checking (missing sys/statvfs.h) * timestamp preservation support (yawn) * S3 * WebDAV * XMPP The resulting 17mb binary has been tested on Android, and it is able to, at least, print its usage message.
Diffstat (limited to 'Utility')
-rw-r--r--Utility/ThreadScheduler.hs8
-rw-r--r--Utility/libdiskfree.c5
-rw-r--r--Utility/libmounts.h5
3 files changed, 17 insertions, 1 deletions
diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs
index 96bccbe70..fdf40ab6d 100644
--- a/Utility/ThreadScheduler.hs
+++ b/Utility/ThreadScheduler.hs
@@ -6,13 +6,17 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
+
module Utility.ThreadScheduler where
import Common
import Control.Concurrent
-import System.Posix.Terminal
import System.Posix.Signals
+#ifndef WITH_ANDROID
+import System.Posix.Terminal
+#endif
newtype Seconds = Seconds { fromSeconds :: Int }
deriving (Eq, Ord, Show)
@@ -49,8 +53,10 @@ waitForTermination :: IO ()
waitForTermination = do
lock <- newEmptyMVar
check softwareTermination lock
+#ifndef WITH_ANDROID
whenM (queryTerminal stdInput) $
check keyboardSignal lock
+#endif
takeMVar lock
where
check sig lock = void $
diff --git a/Utility/libdiskfree.c b/Utility/libdiskfree.c
index 5e84d4bde..a9ca90b41 100644
--- a/Utility/libdiskfree.c
+++ b/Utility/libdiskfree.c
@@ -22,6 +22,10 @@
# define STATCALL statfs /* statfs64 not yet tested on a real FreeBSD machine */
# define STATSTRUCT statfs
#else
+#if defined WITH_ANDROID
+# warning free space checking code not available for Android
+# define UNKNOWN
+#else
#if defined (__linux__) || defined (__FreeBSD_kernel__)
/* Linux or Debian kFreeBSD */
/* This is a POSIX standard, so might also work elsewhere too. */
@@ -34,6 +38,7 @@
#endif
#endif
#endif
+#endif
#include <errno.h>
#include <stdio.h>
diff --git a/Utility/libmounts.h b/Utility/libmounts.h
index b65978629..76b2484d3 100644
--- a/Utility/libmounts.h
+++ b/Utility/libmounts.h
@@ -5,6 +5,10 @@
# include <sys/mount.h>
# define GETMNTINFO
#else
+#if defined WITH_ANDROID
+# warning mounts listing code not available for Android
+# define UNKNOWN
+#else
#if defined (__linux__) || defined (__FreeBSD_kernel__)
/* Linux or Debian kFreeBSD */
#include <mntent.h>
@@ -14,6 +18,7 @@
# define UNKNOWN
#endif
#endif
+#endif
#include <stdio.h>