Skip to content
Snippets Groups Projects
Commit f065b6b0 authored by Tamar Christina's avatar Tamar Christina Committed by Marge Bot
Browse files

Fix use distro toolchian

parent c6f50cea
No related branches found
No related tags found
No related merge requests found
......@@ -583,6 +583,7 @@ AC_DEFUN([FP_SETTINGS],
SettingsCCompilerLinkFlags="$CONF_GCC_LINKER_OPTS_STAGE2"
SettingsCCompilerSupportsNoPie="$CONF_GCC_SUPPORTS_NO_PIE"
SettingsLdFlags="$CONF_LD_LINKER_OPTS_STAGE2"
SettingsUseDistroMINGW="$EnableDistroToolchain"
AC_SUBST(SettingsCCompilerCommand)
AC_SUBST(SettingsHaskellCPPCommand)
AC_SUBST(SettingsHaskellCPPFlags)
......@@ -601,6 +602,7 @@ AC_DEFUN([FP_SETTINGS],
AC_SUBST(SettingsClangCommand)
AC_SUBST(SettingsLlcCommand)
AC_SUBST(SettingsOptCommand)
AC_SUBST(SettingsUseDistroMINGW)
])
# Helper for cloning a shell variable's state
......
......@@ -79,7 +79,7 @@ $topdir/../../{mingw, perl}/.
-- | Expand occurrences of the @$tooldir@ interpolation in a string
-- on Windows, leave the string untouched otherwise.
expandToolDir :: Maybe FilePath -> String -> String
#if defined(mingw32_HOST_OS)
#if defined(mingw32_HOST_OS) && !defined(USE_INPLACE_MINGW_TOOLCHAIN)
expandToolDir (Just tool_dir) s = expandPathVar "tooldir" tool_dir s
expandToolDir Nothing _ = panic "Could not determine $tooldir"
#else
......@@ -117,10 +117,11 @@ tryFindTopDir Nothing
-- Returns @Nothing@ when not on Windows.
-- When called on Windows, it either throws an error when the
-- tooldir can't be located, or returns @Just tooldirpath@.
-- If the distro toolchain is being used we treat Windows the same as Linux
findToolDir
:: FilePath -- ^ topdir
-> IO (Maybe FilePath)
#if defined(mingw32_HOST_OS)
#if defined(mingw32_HOST_OS) && !defined(USE_INPLACE_MINGW_TOOLCHAIN)
findToolDir top_dir = go 0 (top_dir </> "..")
where maxDepth = 3
go :: Int -> FilePath -> IO (Maybe FilePath)
......
......@@ -462,6 +462,7 @@ then
# so never tried without the prefix.
AC_PATH_PROG([CC],[gcc], [clang])
AC_PATH_PROG([NM],[nm])
AC_PATH_PROG([LD],[ld])
AC_PATH_PROG([AR],[ar])
AC_PATH_PROG([RANLIB],[ranlib])
AC_PATH_PROG([OBJDUMP],[objdump])
......
......@@ -92,6 +92,8 @@ project-patch-level1 = @ProjectPatchLevel1@
project-patch-level2 = @ProjectPatchLevel2@
project-git-commit-id = @ProjectGitCommitId@
system-use-distro-mingw = @SettingsUseDistroMINGW@
# Compilation and linking flags:
#===============================
......
......@@ -25,6 +25,7 @@ data Flag = ArSupportsAtFile
| HaveLibMingwEx
| UseSystemFfi
| BootstrapThreadedRts
| SystemDistroMINGW
-- Note, if a flag is set to empty string we treat it as set to NO. This seems
-- fragile, but some flags do behave like this.
......@@ -45,6 +46,7 @@ flag f = do
HaveLibMingwEx -> "have-lib-mingw-ex"
UseSystemFfi -> "use-system-ffi"
BootstrapThreadedRts -> "bootstrap-threaded-rts"
SystemDistroMINGW -> "system-use-distro-mingw"
value <- lookupValueOrError configFile key
when (value `notElem` ["YES", "NO", ""]) . error $ "Configuration flag "
++ quote (key ++ " = " ++ value) ++ " cannot be parsed."
......
......@@ -245,6 +245,7 @@ generateGhcPlatformH = do
hostOs <- chooseSetting HostOs TargetOs
hostVendor <- chooseSetting HostVendor TargetVendor
ghcUnreg <- getFlag GhcUnregisterised
inplaceTools <- getFlag SystemDistroMINGW
return . unlines $
[ "#if !defined(__GHCPLATFORM_H__)"
, "#define __GHCPLATFORM_H__"
......@@ -274,6 +275,8 @@ generateGhcPlatformH = do
, ""
]
++
[ "#define USE_INPLACE_MINGW_TOOLCHAIN 1" | inplaceTools ]
++
[ "#define UnregisterisedCompiler 1" | ghcUnreg ]
++
[ ""
......
......@@ -186,6 +186,9 @@ $$(includes_$1_H_PLATFORM) : includes/ghc.mk includes/Makefile | $$$$(dir $$$$@)
@echo "#define BUILD_VENDOR \"$(BuildVendor_$1_CPP)\"" >> $$@
@echo "#define HOST_VENDOR \"$(HostVendor_$1_CPP)\"" >> $$@
@echo >> $$@
ifeq "$$(SettingsUseDistroMINGW)" "YES"
@echo "#define USE_INPLACE_MINGW_TOOLCHAIN 1" >> $$@
endif
ifeq "$$(GhcUnregisterised)" "YES"
@echo "#define UnregisterisedCompiler 1" >> $$@
endif
......
......@@ -20,8 +20,8 @@
#
# The ProjectVersionInt is included in interface files, and GHC
# checks that it's reading interface generated by the same ProjectVersion
# as itself. It does this even though interface file syntax may not
# change between versions. Rationale: calling conventions or other
# as itself. It does this even though interface file syntax may not
# change between versions. Rationale: calling conventions or other
# random .o-file stuff might change even if the .hi syntax doesn't
ProjectName = @ProjectName@
......@@ -127,6 +127,7 @@ BuildVendor_CPP = @BuildVendor_CPP@
# Valid options: YES/NO
#
LeadingUnderscore=@LeadingUnderscore@
SettingsUseDistroMINGW=@SettingsUseDistroMINGW@
# Pin a suffix on executables? If so, what (Windows only).
exeext0=@exeext_host@
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment