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.")
-- -----------------------------------------------------------------------------