diff options
-rw-r--r-- | Main.hs | 3 | ||||
-rw-r--r-- | XMonad/Core.hs | 11 |
2 files changed, 9 insertions, 5 deletions
@@ -18,6 +18,7 @@ import XMonad import Control.Exception (handle) import System.IO +import System.Info import System.Environment import System.Posix.Process (executeFile) @@ -43,5 +44,5 @@ buildLaunch = do recompile False dir <- getXMonadDir args <- getArgs - executeFile (dir ++ "/xmonad") False args Nothing + executeFile (dir ++ "/xmonad-"++arch++"-"++os) False args Nothing return () 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: |