8194 fix

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
commit 2947869c3d3e40d81596189972446def35c8f352
Author: Bryan O'Sullivan <bryano@fb.com>
Date:   Fri Sep 13 13:13:04 2013 -0700

    Cause "make install" to install dynamic libraries (#8194)

    Our special ghc-cabal command needs to be told that we are building with
    dynamic library support when it does its copying. We do so by passing an
    extra parameter from ghc.mk.

diff --git a/ghc.mk b/ghc.mk
index 82e9e5c..2597ee9 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -918,7 +918,8 @@ install_packages: rts/dist/package.conf.install
 	                                  '$(DESTDIR)'                \
 	                                  '$(prefix)'                 \
 	                                  '$(ghclibdir)'              \
-	                                  '$(docdir)/html/libraries'))
+	                                  '$(docdir)/html/libraries'  \
+	                                  '$(GhcLibWays)'))
 	"$(INSTALLED_GHC_PKG_REAL)" --force --global-package-db "$(INSTALLED_PACKAGE_CONF)" update rts/dist/package.conf.install
 	$(foreach p, $(INSTALL_PACKAGES),                             \
 	    $(call make-command,                                      \
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 7d1d9bc..4c29e77 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -40,9 +40,10 @@ main = do hSetBuffering stdout LineBuffering
                   doCheck dir
               "copy" : dir : distDir
                      : strip : myDestDir : myPrefix : myLibdir : myDocdir
-                     : args' ->
+                     : ghcLibWays : args' ->
                   doCopy dir distDir
                          strip myDestDir myPrefix myLibdir myDocdir
+                         ("dyn" `elem` (words ghcLibWays))
                          args'
               "register" : dir : distDir : ghc : ghcpkg : topdir
                          : myDestDir : myPrefix : myLibdir : myDocdir
@@ -127,11 +128,11 @@ runHsColour directory distdir args
  $ defaultMainArgs ("hscolour" : "--builddir" : distdir : args)

 doCopy :: FilePath -> FilePath
-       -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
+       -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> Bool
        -> [String]
        -> IO ()
 doCopy directory distDir
-       strip myDestDir myPrefix myLibdir myDocdir
+       strip myDestDir myPrefix myLibdir myDocdir withSharedLibs
        args
  = withCurrentDirectory directory $ do
      let copyArgs = ["copy", "--builddir", distDir]
@@ -172,7 +173,8 @@ doCopy directory distDir
             progs' <- configureProgram verbosity stripProgram' progs
             let lbi' = lbi {
                                withPrograms = progs',
-                               installDirTemplates = idts
+                               installDirTemplates = idts,
+                               withSharedLib = withSharedLibs
                            }
             f pd lbi' us flags