From ed4812950dce7621d4e32fd465383bed08ce0775 Mon Sep 17 00:00:00 2001
From: panne <unknown>
Date: Fri, 30 Jun 2000 19:12:21 +0000
Subject: [PATCH] [project @ 2000-06-30 19:12:21 by panne] Hackily quote
 -#include options before passing them to mkdependHS

---
 ghc/driver/Main.hs | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs
index 16544a657e94..e3a3bc5cd33a 100644
--- a/ghc/driver/Main.hs
+++ b/ghc/driver/Main.hs
@@ -1202,11 +1202,9 @@ newTempName extn = do
 
 do_mkdependHS :: [String] -> [String] -> IO ()
 do_mkdependHS cmd_opts srcs = do
-
-    -- 	# They're not (currently) needed, but we need to quote any -#include options
-    -- foreach (@Cmd_opts) {
-    -- 	   s/-#include.*$/'$&'/g;
-    -- };  
+   -- HACK
+   let quote_include_opt o | prefixMatch "-#include" o = "'" ++ o ++ "'"
+                           | otherwise                 = o
 
    mkdependHS      <- readIORef pgm_dep
    mkdependHS_opts <- getOpts opt_dep
@@ -1216,7 +1214,7 @@ do_mkdependHS cmd_opts srcs = do
 	(unwords (mkdependHS : 
 		      mkdependHS_opts
 		   ++ hs_src_cpp_opts
-		   ++ ("--" : cmd_opts )
+		   ++ ("--" : map quote_include_opt cmd_opts )
 		   ++ ("--" : srcs)
 	))
 
-- 
GitLab