summaryrefslogtreecommitdiffstats
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
commitaa3bcc30d837719840064a1ed0972929c2bcde50 (patch)
treef65c89772d16a2c7d0b32a433b329f8f58b54d70 /XMonad
parent77c511849ea79cf39d202388482ec130acee64f7 (diff)
downloadmetatile-aa3bcc30d837719840064a1ed0972929c2bcde50.tar
metatile-aa3bcc30d837719840064a1ed0972929c2bcde50.zip
Allow for sharing of home directory across architectures.
darcs-hash:20071218065146-c18d4-533b073367884fbd9212fc547ce9e4e558a21bc9
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: