[project @ 2001-03-14 12:13:02 by rrt]
authorrrt <unknown>
Wed, 14 Mar 2001 12:13:02 +0000 (12:13 +0000)
committerrrt <unknown>
Wed, 14 Mar 2001 12:13:02 +0000 (12:13 +0000)
Add Config.hs generation to Makefile to make TMPDIR work in KludgedSystem.

ghc/utils/hsc2hs/KludgedSystem.hs
ghc/utils/hsc2hs/Makefile

index 4794ee8..0b5bcd4 100644 (file)
@@ -1,6 +1,6 @@
 {-# OPTIONS -cpp -fglasgow-exts #-}
 -----------------------------------------------------------------------------
--- $Id: KludgedSystem.hs,v 1.3 2001/03/13 17:46:56 rrt Exp $
+-- $Id: KludgedSystem.hs,v 1.4 2001/03/14 12:13:02 rrt Exp $
 
 -- system that works feasibly under Windows (i.e. passes the command line to sh,
 -- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
@@ -27,8 +27,7 @@ import Config
 system :: String -> IO ExitCode
 system cmd = do
     pid <- getProcessID
-    tmp_dir <- readIORef v_TmpDir
-    let tmp = tmp_dir++"/sh"++show pid
+    let tmp = cDEFAULT_TMPDIR++"/sh"++show pid
     writeFile tmp (cmd++"\n")
     bracket_ (return tmp) removeFile $ System.system ("sh - "++tmp)
 
index 0ef0962..0f70d89 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.10 2001/03/05 00:07:23 qrczak Exp $
+# $Id: Makefile,v 1.11 2001/03/14 12:13:02 rrt Exp $
 
 TOP=../..
 include $(TOP)/mk/boilerplate.mk
@@ -54,6 +54,22 @@ INSTALL_LIBEXECS += $(HS_PROG)
 override datadir=$(libdir)
 INSTALL_DATAS += template-hsc.h
 
+# -----------------------------------------------------------------------------
+# Create driver configuration
+
+CURRENT_DIR=ghc/utils/hsc2hs
+CONFIG_HS = Config.hs
+boot :: $(CONFIG_HS)
+
+$(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile
+       @$(RM) -f $(CONFIG_HS)
+       @echo -n "Creating $(CONFIG_HS) ... "
+       @echo "module Config where" >>$(CONFIG_HS)
+       @echo "cDEFAULT_TMPDIR       = \"$(DEFAULT_TMPDIR)\"" >> $(CONFIG_HS)
+       @echo done.
+
+CLEAN_FILES += $(CONFIG_HS)
+
 # don't recurse on 'make install'
 #
 ifeq "$(INSTALLING)" "1"