Commit 68ad4c6a authored by simonpj's avatar simonpj
Browse files

[project @ 2001-06-25 14:50:22 by simonpj]

Keep pgm paths in native format
parent a5ded1f8
...@@ -123,7 +123,7 @@ Config.hs contains two sorts of things ...@@ -123,7 +123,7 @@ Config.hs contains two sorts of things
%* * %* *
%************************************************************************ %************************************************************************
All these pathnames are maintained in Unix format. All these pathnames are maintained IN THE NATIVE FORMAT OF THE HOST MACHINE.
(See remarks under pathnames below) (See remarks under pathnames below)
\begin{code} \begin{code}
...@@ -168,10 +168,11 @@ initSysTools minusB_args ...@@ -168,10 +168,11 @@ initSysTools minusB_args
-- top_dir -- top_dir
-- for "installed" this is the root of GHC's support files -- for "installed" this is the root of GHC's support files
-- for "in-place" it is the root of the build tree -- for "in-place" it is the root of the build tree
-- NB: top_dir is assumed to be in standard Unix format '/' separated
; let installed_bin pgm = top_dir `slash` "bin" `slash` pgm ; let installed_bin pgm = pgmPath (top_dir `slash` "bin") pgm
installed file = top_dir `slash` file installed file = pgmPath top_dir file
inplace dir pgm = top_dir `slash` dir `slash` pgm inplace dir pgm = pgmPath (top_dir `slash` dir) pgm
; let pkgconfig_path ; let pkgconfig_path
| am_installed = installed "package.conf" | am_installed = installed "package.conf"
...@@ -317,7 +318,7 @@ setPgm pgm = unknownFlagErr ("-pgm" ++ pgm) ...@@ -317,7 +318,7 @@ setPgm pgm = unknownFlagErr ("-pgm" ++ pgm)
getTopDir :: [String] getTopDir :: [String]
-> IO (Bool, -- True <=> am installed, False <=> in-place -> IO (Bool, -- True <=> am installed, False <=> in-place
String) -- TopDir String) -- TopDir (in Unix format '/' separated)
getTopDir minusbs getTopDir minusbs
= do { top_dir1 <- get_proto = do { top_dir1 <- get_proto
...@@ -510,7 +511,7 @@ runSomething :: String -- For -v message ...@@ -510,7 +511,7 @@ runSomething :: String -- For -v message
-> String -- Command name (possibly a full path) -> String -- Command name (possibly a full path)
-- assumed already dos-ified -- assumed already dos-ified
-> [String] -- Arguments -> [String] -- Arguments
-- runSomthing will dos-ify them -- runSomething will dos-ify them
-> IO () -> IO ()
runSomething phase_name pgm args runSomething phase_name pgm args
...@@ -521,7 +522,8 @@ runSomething phase_name pgm args ...@@ -521,7 +522,8 @@ runSomething phase_name pgm args
else return () else return ()
} }
where where
cmd_line = unwords (dosifyPaths (pgm : args)) cmd_line = unwords (pgm : dosifyPaths args)
-- The pgm is already in native format
traceCmd :: String -> String -> IO () -> IO () traceCmd :: String -> String -> IO () -> IO ()
-- a) trace the command (at two levels of verbosity) -- a) trace the command (at two levels of verbosity)
...@@ -573,6 +575,13 @@ dosifyPaths :: [String] -> [String] ...@@ -573,6 +575,13 @@ dosifyPaths :: [String] -> [String]
unDosifyPath :: String -> String unDosifyPath :: String -> String
-- Just change '\' to '/' -- Just change '\' to '/'
pgmPath :: String -- Directory string in Unix format
-> String -- Program name with no directory separators
-- (e.g. copy /y)
-> String -- Program invocation string in native format
#if defined(mingw32_TARGET_OS) #if defined(mingw32_TARGET_OS)
--------------------- Windows version ------------------ --------------------- Windows version ------------------
...@@ -580,6 +589,8 @@ unDosifyPath xs = xs ...@@ -580,6 +589,8 @@ unDosifyPath xs = xs
dosifyPaths xs = map dosifyPath xs dosifyPaths xs = map dosifyPath xs
pgmPath dir pgm = dosifyPath dir ++ '\\' : pgm
dosifyPath stuff dosifyPath stuff
= subst '/' '\\' real_stuff = subst '/' '\\' real_stuff
where where
...@@ -596,6 +607,7 @@ dosifyPath stuff ...@@ -596,6 +607,7 @@ dosifyPath stuff
--------------------- Unix version --------------------- --------------------- Unix version ---------------------
dosifyPaths ps = ps dosifyPaths ps = ps
unDosifyPath xs = subst '\\' '/' xs unDosifyPath xs = subst '\\' '/' xs
pgmPath dir pgm = dir ++ '/' : pgm
-------------------------------------------------------- --------------------------------------------------------
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment