summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2019-03-29 20:33:16 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-09 12:50:15 -0400
commitfe40ddd9f960d89fbb430962f642ee9b053a0492 (patch)
treecfbce73555feb460ee325dd8244bb8e13833e5e1 /hadrian
parent14a7870770fb2dd2e096bc13e8c927d49c868911 (diff)
downloadhaskell-fe40ddd9f960d89fbb430962f642ee9b053a0492.tar.gz
Hadrian: fix library install paths in bindist Makefile (#16498)
GHC now works out-of-the-box (i.e. without any wrapper script) by assuming that @bin@ and @lib@ directories sit next to each other. In particular, its RUNPATH uses $ORIGIN-based relative path to find the libraries. However, to be good citizens we want to support the case where @bin@ and @lib@ directories (respectively BINDIR and LIBDIR) don't sit next to each other or are renamed. To do that the install script simply creates GHC specific @bin@ and @lib@ siblings directories into: LIBDIR/ghc-VERSION/{bin,lib} Then it installs wrapper scripts into BINDIR that call the appropriate programs into LIBDIR/ghc-VERSION/bin/. The issue fixed by this patch is that libraries were not installed into LIBDIR/ghc-VERSION/lib but directly into LIBDIR.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Rules/BinaryDist.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
index 610e668ce1..b1b91bd5e0 100644
--- a/hadrian/src/Rules/BinaryDist.hs
+++ b/hadrian/src/Rules/BinaryDist.hs
@@ -86,6 +86,12 @@ you can simply do:
./configure --prefix=<path> [... other configure options ...]
make install
+In order to support @bin@ and @lib@ directories that don't sit next to each
+other, the install script:
+ * installs programs into @LIBDIR/ghc-VERSION/bin@
+ * installs libraries into @LIBDIR/ghc-VERSION/lib@
+ * installs the wrappers scripts into @BINDIR@ directory
+
-}
bindistRules :: Rules ()
@@ -268,6 +274,7 @@ bindistMakefile = unlines
, "install: install_mingw update_package_db"
, ""
, "ActualBinsDir=${ghclibdir}/bin"
+ , "ActualLibsDir=${ghclibdir}/lib"
, "WrapperBinsDir=${bindir}"
, ""
, "# We need to install binaries relative to libraries."
@@ -288,10 +295,10 @@ bindistMakefile = unlines
, ""
, "LIBRARIES = $(wildcard ./lib/*)"
, "install_lib:"
- , "\t@echo \"Copying libraries to $(libdir)\""
- , "\t$(INSTALL_DIR) \"$(libdir)\""
+ , "\t@echo \"Copying libraries to $(ActualLibsDir)\""
+ , "\t$(INSTALL_DIR) \"$(ActualLibsDir)\""
, "\tfor i in $(LIBRARIES); do \\"
- , "\t\tcp -R $$i \"$(libdir)/\"; \\"
+ , "\t\tcp -R $$i \"$(ActualLibsDir)/\"; \\"
, "\tdone"
, ""
, "INCLUDES = $(wildcard ./include/*)"
@@ -317,9 +324,9 @@ bindistMakefile = unlines
, "\t$(foreach p, $(BINARY_NAMES),\\"
, "\t\t$(call installscript,$p,$(WrapperBinsDir)/$p," ++
"$(WrapperBinsDir),$(ActualBinsDir),$(ActualBinsDir)/$p," ++
- "$(libdir),$(docdir),$(includedir)))"
+ "$(ActualLibsDir),$(docdir),$(includedir)))"
, ""
- , "PKG_CONFS = $(wildcard $(libdir)/package.conf.d/*)"
+ , "PKG_CONFS = $(wildcard $(ActualLibsDir)/package.conf.d/*)"
, "update_package_db:"
, "\t@echo \"Updating the package DB\""
, "\t$(foreach p, $(PKG_CONFS),\\"