From: simonmar Date: Mon, 22 Nov 2004 14:18:40 +0000 (+0000) Subject: [project @ 2004-11-22 14:18:40 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1404 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0dfb4fb45559831bca2061804ffec5d0f21544b2;p=ghc-hetmet.git [project @ 2004-11-22 14:18:40 by simonmar] Check the result of System.Cmd.system --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 572ecdb..b83dd8e 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -642,19 +642,18 @@ autoBuildGHCiLib dir batch_file ghci_file = do let ghci_lib_file = dir ++ '/':ghci_file batch_lib_file = dir ++ '/':batch_file hPutStr stderr ("building GHCi library `" ++ ghci_lib_file ++ "'...") -#ifdef darwin_TARGET_OS - system("ld -r -x -o " ++ ghci_lib_file ++ - " -all_load " ++ batch_lib_file) -#else -#ifdef mingw32_HOST_OS +#if defined(darwin_TARGET_OS) + r <- system("ld -r -x -o " ++ ghci_lib_file ++ + " -all_load " ++ batch_lib_file) +#elif defined(mingw32_HOST_OS) execDir <- getExecDir "/bin/ghc-pkg.exe" - system (maybe "" (++"/gcc-lib/") execDir++"ld -r -x -o " ++ ghci_lib_file ++ - " --whole-archive " ++ batch_lib_file) + r <- system (maybe "" (++"/gcc-lib/") execDir++"ld -r -x -o " ++ + ghci_lib_file ++ " --whole-archive " ++ batch_lib_file) #else - system("ld -r -x -o " ++ ghci_lib_file ++ - " --whole-archive " ++ batch_lib_file) -#endif + r <- system("ld -r -x -o " ++ ghci_lib_file ++ + " --whole-archive " ++ batch_lib_file) #endif + when (r /= ExitSuccess) $ exitWith r hPutStrLn stderr (" done.") -- -----------------------------------------------------------------------------