[project @ 2001-07-13 14:59:32 by simonmar]
authorsimonmar <unknown>
Fri, 13 Jul 2001 14:59:32 +0000 (14:59 +0000)
committersimonmar <unknown>
Fri, 13 Jul 2001 14:59:32 +0000 (14:59 +0000)
check TMPDIR (got lost somewhere in the conversion to SysTools)

ghc/compiler/main/SysTools.lhs

index 71e0e8e..1887038 100644 (file)
@@ -53,7 +53,7 @@ import IO
 import Directory       ( doesFileExist, removeFile )
 import IOExts          ( IORef, readIORef, writeIORef )
 import Monad           ( when, unless )
-import System          ( system, ExitCode(..), exitWith )
+import System          ( system, ExitCode(..), exitWith, getEnv )
     
 #include "../includes/config.h"
 
@@ -214,6 +214,14 @@ initSysTools minusB_args
                | am_installed = installed_bin cGHC_MANGLER
                | otherwise    = inplace cGHC_MANGLER_DIR cGHC_MANGLER
 
+#ifndef mingw32_TARGET_OS
+       -- check whether TMPDIR is set in the environment
+       ; IO.try (do dir <- getEnv "TMPDIR" -- fails if not set
+                    setTmpDir dir
+                    return ()
+                 )
+#endif
+
        -- Check that the package config exists
        ; config_exists <- doesFileExist pkgconfig_path
        ; when (not config_exists) $