import CmmLint ( cmmLint )
import Packages
import DriverState ( getExplicitPackagesAnd, getPackageCIncludes )
+import DriverUtil ( filenameOf )
import FastString ( unpackFS )
import Cmm ( Cmm )
import HscTypes
hPutStr h ("/* GHC_PACKAGES " ++ unwords pkg_names ++ "\n*/\n")
hPutStr h cc_injects
when stub_h_exists $
- hPutStrLn h ("#include \"" ++ (hscStubHOutName dflags) ++ "\"")
+ hPutStrLn h ("#include \"" ++ (filenameOf (hscStubHOutName dflags)) ++ "\"")
writeCs h flat_absC
\end{code}
pkg_include_dirs <- getPackageIncludePath pkgs
let include_paths = foldr (\ x xs -> "-I" : x : xs) []
(cmdline_include_paths ++ pkg_include_dirs)
- ++ ["-I-"]
- -- We add the flag -I- after all the include paths.
- -- According to the gcc docs, this causes all -I paths
- -- up to this point apply only to #include "..."
- -- style includes. This prevents accidentally
- -- shadowing a system include (eg. #include <stdio.h>)
- -- by putting a file of the same name in the current
- -- directory, for example.
mangle <- readIORef v_Do_asm_mangling
(md_c_flags, md_regd_c_flags) <- machdepCCOpts
v_Import_paths, v_Include_paths, v_Library_paths :: IORef [String]
GLOBAL_VAR(v_Import_paths, ["."], [String])
-GLOBAL_VAR(v_Include_paths, ["."], [String])
+GLOBAL_VAR(v_Include_paths, [], [String])
GLOBAL_VAR(v_Library_paths, [], [String])
#ifdef darwin_TARGET_OS
-----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.44 2004/09/30 10:37:11 simonpj Exp $
+-- $Id: DriverUtil.hs,v 1.45 2004/10/03 16:28:06 panne Exp $
--
-- Utils for the driver
--
split, add, addNoDups,
Suffix, splitFilename, getFileSuffix,
splitFilename3, remove_suffix, split_longest_prefix,
- replaceFilenameSuffix, directoryOf, replaceFilenameDirectory,
- remove_spaces, escapeSpaces,
+ replaceFilenameSuffix, directoryOf, filenameOf,
+ replaceFilenameDirectory, remove_spaces, escapeSpaces,
) where
#include "../includes/ghcconfig.h"
directoryOf :: FilePath -> String
directoryOf = fst . splitFilenameDir
+-- filenameOf strips the directory off the input string, returning
+-- the filename.
+filenameOf :: FilePath -> String
+filenameOf = snd . splitFilenameDir
+
replaceFilenameDirectory :: FilePath -> String -> FilePath
replaceFilenameDirectory s dir
= dir ++ '/':drop_longest_prefix s isPathSeparator