aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authortim.thelion <tim.thelion@gmail.com>2007-12-18 07:51:46 +0100
committertim.thelion <tim.thelion@gmail.com>2007-12-18 07:51:46 +0100
commit0bc907e32f85c91c4e2433056be6ee73a167ac7b (patch)
treef65c89772d16a2c7d0b32a433b329f8f58b54d70 /XMonad
parenta8df4338b64f23b211485868accc188db60af2b9 (diff)
downloadxmonad-0bc907e32f85c91c4e2433056be6ee73a167ac7b.tar.gz
xmonad-0bc907e32f85c91c4e2433056be6ee73a167ac7b.tar.xz
xmonad-0bc907e32f85c91c4e2433056be6ee73a167ac7b.zip
Allow for sharing of home directory across architectures.
darcs-hash:20071218065146-c18d4-533b073367884fbd9212fc547ce9e4e558a21bc9.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Core.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index 3933022..cc39b94 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -38,6 +38,7 @@ import Control.Applicative
import Control.Monad.State
import Control.Monad.Reader
import System.IO
+import System.Info
import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession)
import System.Process
import System.Directory
@@ -355,14 +356,16 @@ getXMonadDir = io $ getAppUserDataDirectory "xmonad"
recompile :: MonadIO m => Bool -> m ()
recompile force = io $ do
dir <- getXMonadDir
- let bin = dir ++ "/" ++ "xmonad"
- err = bin ++ ".errors"
- src = bin ++ ".hs"
+ let binn = "xmonad-"++arch++"-"++os
+ bin = dir ++ "/" ++ binn
+ base = dir ++ "/" ++ "xmonad"
+ err = base ++ ".errors"
+ src = base ++ ".hs"
srcT <- getModTime src
binT <- getModTime bin
when (force || srcT > binT) $ do
status <- bracket (openFile err WriteMode) hClose $ \h -> do
- waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0"] (Just dir)
+ waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
Nothing Nothing Nothing (Just h)
-- now, if it fails, run xmessage to let the user know: