Restore splitting at ':' for the -i option, which I broke recently.
@echo "cProjectPatchLevel = \"$(ProjectPatchLevel)\"" >> $(CONFIG_HS)
@echo "cBooterVersion = \"$(GhcVersion)\"" >> $(CONFIG_HS)
@echo "cHscIfaceFileVersion = \"$(HscIfaceFileVersion)\"" >> $(CONFIG_HS)
@echo "cProjectPatchLevel = \"$(ProjectPatchLevel)\"" >> $(CONFIG_HS)
@echo "cBooterVersion = \"$(GhcVersion)\"" >> $(CONFIG_HS)
@echo "cHscIfaceFileVersion = \"$(HscIfaceFileVersion)\"" >> $(CONFIG_HS)
- @echo "cHOSTPLATFORM = \"$(HOSTPLATFORM)\"" >> $(CONFIG_HS)
@echo "cTARGETPLATFORM = \"$(TARGETPLATFORM)\"" >> $(CONFIG_HS)
@echo "cTARGETOS = \"$(TargetOS_CPP)\"" >> $(CONFIG_HS)
@echo "cTARGETARCH = \"$(TargetArch_CPP)\"" >> $(CONFIG_HS)
@echo "cTARGETPLATFORM = \"$(TARGETPLATFORM)\"" >> $(CONFIG_HS)
@echo "cTARGETOS = \"$(TargetOS_CPP)\"" >> $(CONFIG_HS)
@echo "cTARGETARCH = \"$(TargetArch_CPP)\"" >> $(CONFIG_HS)
-- -i on its own deletes the import paths
addImportPath "" = updDynFlags (\s -> s{importPaths = []})
-- -i on its own deletes the import paths
addImportPath "" = updDynFlags (\s -> s{importPaths = []})
-addImportPath p = updDynFlags (\s -> s{importPaths = p : importPaths s})
+addImportPath p = do
+ paths <- splitPathList p
+ updDynFlags (\s -> s{importPaths = importPaths s ++ paths})
-- we can only switch between HscC, HscAsmm, and HscILX with dynamic flags
-- (-fvia-C, -fasm, -filx respectively).
-- we can only switch between HscC, HscAsmm, and HscILX with dynamic flags
-- (-fvia-C, -fasm, -filx respectively).
GLOBAL_VAR(v_Cmdline_frameworks, [], [String])
#endif
GLOBAL_VAR(v_Cmdline_frameworks, [], [String])
#endif
-addToOrDeleteDirList :: IORef [String] -> String -> IO ()
-addToOrDeleteDirList ref "" = writeIORef ref []
-addToOrDeleteDirList ref path = addToDirList ref path
-
addToDirList :: IORef [String] -> String -> IO ()
addToDirList ref path
= do paths <- readIORef ref
addToDirList :: IORef [String] -> String -> IO ()
addToDirList ref path
= do paths <- readIORef ref
- shiny_new_ones <- splitUp path
- writeIORef ref (paths ++ filter notNull shiny_new_ones)
+ shiny_new_ones <- splitPathList path
+ writeIORef ref (paths ++ shiny_new_ones)
+
+
+splitPathList :: String -> IO [String]
+splitPathList s = do ps <- splitUp s; return (filter notNull ps)
-- empty paths are ignored: there might be a trailing
-- ':' in the initial list, for example. Empty paths can
-- cause confusion when they are translated into -I options
-- for passing to gcc.
where
-- empty paths are ignored: there might be a trailing
-- ':' in the initial list, for example. Empty paths can
-- cause confusion when they are translated into -I options
-- for passing to gcc.
where
- splitUp ::String -> IO [String]
#ifdef mingw32_TARGET_OS
-- 'hybrid' support for DOS-style paths in directory lists.
--
#ifdef mingw32_TARGET_OS
-- 'hybrid' support for DOS-style paths in directory lists.
--