[Git][ghc/ghc][wip/hadrian-windows-bindist] Fix relocatable build

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Tue Aug 15 10:51:51 UTC 2023



Matthew Pickering pushed to branch wip/hadrian-windows-bindist at Glasgow Haskell Compiler / GHC


Commits:
93cc8fd0 by Matthew Pickering at 2023-08-15T11:34:50+01:00
Fix relocatable build

- - - - -


4 changed files:

- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/src/Builder.hs
- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
hadrian/bindist/Makefile
=====================================
@@ -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}
 


=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -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


=====================================
hadrian/src/Builder.hs
=====================================
@@ -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]


=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93cc8fd07f517fad59756f1d670716350ed299e2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/93cc8fd07f517fad59756f1d670716350ed299e2
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230815/4a017893/attachment-0001.html>


More information about the ghc-commits mailing list