[Git][ghc/ghc][master] Hadrian: fix library install paths in bindist Makefile (#16498)

Marge Bot gitlab at gitlab.haskell.org
Tue Apr 9 16:56:22 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
fe40ddd9 by Sylvain Henry at 2019-04-09T16:50:15Z
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.

- - - - -


1 changed file:

- hadrian/src/Rules/BinaryDist.hs


Changes:

=====================================
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 at echo \"Copying libraries to $(libdir)\""
-    , "\t$(INSTALL_DIR) \"$(libdir)\""
+    , "\t at 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 at echo \"Updating the package DB\""
     , "\t$(foreach p, $(PKG_CONFS),\\"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/fe40ddd9f960d89fbb430962f642ee9b053a0492

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/fe40ddd9f960d89fbb430962f642ee9b053a0492
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/20190409/980107fa/attachment-0001.html>


More information about the ghc-commits mailing list