Skip to content
Snippets Groups Projects
Commit 93cc8fd0 authored by Matthew Pickering's avatar Matthew Pickering
Browse files

Fix relocatable build

parent 187aa816
No related branches found
No related tags found
No related merge requests found
Pipeline #82925 canceled
......@@ -63,19 +63,28 @@ show:
.PHONY: install
ifeq "$(TargetOS_CPP)" "mingw32"
install_bin: install_mingw install_bin_direct
install_extra: install_mingw
else
install_extra:
endif
ifeq "$(RelocatableBuild)" "YES"
install_bin: install_bin_direct
else
install_bin: install_bin_libdir install_wrappers
endif
install: install_bin install_lib
install: install_bin install_lib install_extra
install: install_man install_docs update_package_db
ActualBinsDir=${ghclibdir}/bin
ifeq "$(RelocatableBuild)" "YES"
ActualLibsDir=${ghclibdir}
ActualBinsDir=${bindir}
else
ActualLibsDir=${ghclibdir}/lib
ActualBinsDir=${ghclibdir}/bin
endif
WrapperBinsDir=${bindir}
......
......@@ -63,6 +63,12 @@ $(eval $(call set_default,dvidir,$${docdir}))
$(eval $(call set_default,pdfdir,$${docdir}))
$(eval $(call set_default,psdir,$${docdir}))
# On Windows we normally want to make a relocatable bindist, to we
# ignore flags like libdir
ifeq "$(Windows_Host)" "YES"
RelocatableBuild = YES
endif
ifeq "$(RelocatableBuild)" "YES"
# Hack: our directory layouts tend to be different on Windows, so
......@@ -149,13 +155,6 @@ else
GhcWithInterpreter=$(if $(findstring YES,$(DYNAMIC_GHC_PROGRAMS)),YES,NO)
endif
# On Windows we normally want to make a relocatable bindist, to we
# ignore flags like libdir
ifeq "$(Windows_Host)" "YES"
RelocatableBuild = YES
else
RelocatableBuild = NO
endif
# runhaskell and hsc2hs are special, in that other compilers besides
......
......@@ -362,7 +362,7 @@ instance H.Builder Builder where
HsCpp -> captureStdout
Make dir -> cmd' path ["-C", dir] buildArgs
Make dir -> cmd' buildOptions path ["-C", dir] buildArgs
Makeinfo -> do
cmd' [path] "--no-split" [ "-o", output] [input]
......
......@@ -116,7 +116,7 @@ installTo prefix = do
let ghcVersionPretty = "ghc-" ++ version ++ "-" ++ targetPlatform
bindistFilesDir = root -/- "bindist" -/- ghcVersionPretty
runBuilder (Configure bindistFilesDir) ["--prefix="++prefix] [] []
runBuilder (Make bindistFilesDir) ["install"] [] []
runBuilderWithCmdOptions [AddEnv "RelocatableBuild" "YES"] (Make bindistFilesDir) ["install"] [] []
bindistRules :: Rules ()
bindistRules = do
......
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