Install dynlibs correctly
authorClemens Fruhwirth <clemens@endorphin.org>
Fri, 28 Dec 2007 18:40:24 +0000 (18:40 +0000)
committerClemens Fruhwirth <clemens@endorphin.org>
Fri, 28 Dec 2007 18:40:24 +0000 (18:40 +0000)
Add dynlibdir target to config.mk.in, setting it to @libdir@.
Invoke installPackage with dynlibdir at libraries/Makefile
Make installPackage.hs hand dynlibdir to Cabal.

libraries/Makefile
libraries/installPackage.hs
mk/config.mk.in

index 57c9adf..9bd393b 100644 (file)
@@ -94,6 +94,7 @@ iprefix             = $$topdir
 ibindir             = $$topdir
 ilibdir             = $$topdir
 ilibexecdir         = $$topdir
+idynlibdir          = $$topdir
 idatadir            = $$topdir
 idocdir             = $$topdir/doc/libraries/$$pkg
 ihaddockdir         = $$topdir/doc/libraries/$$pkg
@@ -106,6 +107,7 @@ iprefix             = $(prefix)
 ibindir             = $(bindir)
 ilibdir             = $(libdir)
 ilibexecdir         = $(libexecdir)
+idynlibdir          = $(dynlibdir)
 idatadir            = $(datadir)
 idocdir             = $(docdir)/libraries/$$pkg
 ihaddockdir         = $(htmldir)/libraries/$$pkg
@@ -372,7 +374,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
 install.library.%: installPackage/installPackage ifBuildable/ifBuildable
        if ifBuildable/ifBuildable $*; then \
          cd $* && \
-         ../installPackage/installPackage install '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
+         ../installPackage/installPackage install '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idynlibdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
        fi
 
 .PHONY: binary-dist binary-dist.library.%
index 371604b..df2a9e2 100644 (file)
@@ -17,12 +17,12 @@ main
                let verbosity = mkVerbosity args'
                in doRegisterInplace verbosity
            "install" : ghcpkg : ghcpkgconf : destdir : topdir :
-                    iprefix : ibindir : ilibdir : ilibexecdir :
+                    iprefix : ibindir : ilibdir : ilibexecdir : idynlibdir :
                     idatadir : idocdir : ihtmldir : ihaddockdir :
                     args' ->
                let verbosity = mkVerbosity args'
                in doInstall verbosity ghcpkg ghcpkgconf destdir topdir
-                            iprefix ibindir ilibdir ilibexecdir idatadir
+                            iprefix ibindir ilibdir ilibexecdir idynlibdir idatadir
                             idocdir ihtmldir ihaddockdir
            _ ->
                error ("Bad arguments: " ++ show args)
@@ -54,10 +54,10 @@ doRegisterInplace verbosity =
 
 doInstall :: Verbosity -> FilePath -> FilePath -> FilePath -> FilePath
           -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
-          -> FilePath -> FilePath -> FilePath
+          -> FilePath -> FilePath -> FilePath -> FilePath
           -> IO ()
 doInstall verbosity ghcpkg ghcpkgconf destdir topdir
-     iprefix ibindir ilibdir ilibexecdir idatadir
+     iprefix ibindir ilibdir ilibexecdir idynlibdir idatadir
      idocdir ihtmldir ihaddockdir =
        do let userHooks = simpleUserHooks
               copyto = if null destdir then NoCopyDest else CopyTo destdir
@@ -92,6 +92,7 @@ doInstall verbosity ghcpkg ghcpkgconf destdir topdir
               i_copy = i { prefix       = toPathTemplate' iprefix,
                            bindir       = toPathTemplate' ibindir,
                            libdir       = toPathTemplate' ilibdir,
+                           dynlibdir    = toPathTemplate' idynlibdir,
                            libexecdir   = toPathTemplate' ilibexecdir,
                            datadir      = toPathTemplate' idatadir,
                            docdir       = toPathTemplate' idocdir,
@@ -114,6 +115,7 @@ doInstall verbosity ghcpkg ghcpkgconf destdir topdir
               i_reg = i { prefix       = toPathTemplate iprefix,
                           bindir       = toPathTemplate ibindir,
                           libdir       = toPathTemplate ilibdir,
+                          dynlibdir    = toPathTemplate idynlibdir,
                           libexecdir   = toPathTemplate ilibexecdir,
                           datadir      = toPathTemplate idatadir,
                           docdir       = toPathTemplate idocdir,
index 5283f66..1ce9751 100644 (file)
@@ -557,6 +557,7 @@ datadir0        := @datadir@
 libdir0         := @libdir@
 includedir      := @includedir@
 mandir          := @mandir@
+dynlibdir       := @libdir@
 
 ifeq "$(RelocatableBuild)" "YES"