diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/HsVersions.h | 2 | ||||
-rw-r--r-- | compiler/main/DriverPipeline.hs | 6 | ||||
-rw-r--r-- | compiler/main/DynFlags.hs | 12 |
3 files changed, 12 insertions, 8 deletions
diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h index a4ec3e4c40..992c4377cd 100644 --- a/compiler/HsVersions.h +++ b/compiler/HsVersions.h @@ -12,7 +12,7 @@ you will screw up the layout where they are used in case expressions! /* Useful in the headers that we share with the RTS */ #define COMPILING_GHC 1 -/* Pull in all the platform defines for this build (foo_TARGET_ARCH etc.) */ +/* Pull in all the platform defines for this build (foo_HOST_ARCH etc.) */ #include "ghc_boot_platform.h" /* Pull in the autoconf defines (HAVE_FOO), but don't include diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 74bc64ede3..17c8f480d9 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1962,11 +1962,13 @@ doCpp dflags raw input_fn output_fn = do let cpp_prog args | raw = SysTools.runCpp dflags args | otherwise = SysTools.runCc Nothing dflags (SysTools.Option "-E" : args) + let targetArch = stringEncodeArch $ platformArch $ targetPlatform dflags + targetOS = stringEncodeOS $ platformOS $ targetPlatform dflags let target_defs = [ "-D" ++ HOST_OS ++ "_BUILD_OS", "-D" ++ HOST_ARCH ++ "_BUILD_ARCH", - "-D" ++ TARGET_OS ++ "_HOST_OS", - "-D" ++ TARGET_ARCH ++ "_HOST_ARCH" ] + "-D" ++ targetOS ++ "_HOST_OS", + "-D" ++ targetArch ++ "_HOST_ARCH" ] -- remember, in code we *compile*, the HOST is the same our TARGET, -- and BUILD is the same as our HOST. diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index fcc5cfb1a0..2379f484e9 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -1503,9 +1503,11 @@ versionedAppDir dflags = do -- constructing platform-version-dependent files that need to co-exist. -- versionedFilePath :: DynFlags -> FilePath -versionedFilePath dflags = TARGET_ARCH - ++ '-':TARGET_OS - ++ '-':projectVersion dflags +versionedFilePath dflags = intercalate "-" + [ stringEncodeArch $ platformArch $ targetPlatform dflags + , stringEncodeOS $ platformOS $ targetPlatform dflags + , projectVersion dflags + ] -- NB: This functionality is reimplemented in Cabal, so if you -- change it, be sure to update Cabal. @@ -5503,7 +5505,7 @@ addIncludePath p = addFrameworkPath p = upd (\s -> s{frameworkPaths = frameworkPaths s ++ splitPathList p}) -#if !defined(mingw32_TARGET_OS) +#if !defined(mingw32_HOST_OS) split_marker :: Char split_marker = ':' -- not configurable (ToDo) #endif @@ -5515,7 +5517,7 @@ splitPathList s = filter notNull (splitUp s) -- cause confusion when they are translated into -I options -- for passing to gcc. where -#if !defined(mingw32_TARGET_OS) +#if !defined(mingw32_HOST_OS) splitUp xs = split split_marker xs #else -- Windows: 'hybrid' support for DOS-style paths in directory lists. |