Commit d5796081 authored by sven.panne@aedion.de's avatar sven.panne@aedion.de
Browse files

Yet another attempt to get the paths for the installed documentation correct

MERGE TO STABLE
parent 08802abf
......@@ -30,7 +30,7 @@
<LI>
<P>
<B><A HREF="libraries/html/index.html">Libraries</A></B>
<B><A HREF="libraries/index.html">Libraries</A></B>
</P>
<P>
Documentation for the libraries that come with GHC.
......
......@@ -91,8 +91,6 @@ space=$(empty) $(empty)
# -----------------------------------------------------------------------------
libraryhtmldir = $(htmldir)/libraries
ifneq "$(DOING_BIN_DIST)" "YES"
CONFIGURE_OPTS =
......@@ -219,9 +217,7 @@ stamp/configure.library.build$(CONFIGURE_STAMP_EXTRAS).%: %/setup/Setup
$(CONFIGURE_OPTS) \
--prefix='$$topdir' \
--datadir='$(datadir)' \
--datasubdir='$$pkgid' \
--libsubdir='$(libsubdir)' \
--docdir='$(libraryhtmldir)' \
--with-compiler=../../compiler/stage1/ghc-inplace$ \
--with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace$ \
--with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace \
......@@ -300,17 +296,17 @@ endif
.PHONY: install install-docs install.library.%
DESTlibraryhtmldir = $(DESTDIR)$(libraryhtmldir)/html
libraryhtmldir = $(htmldir)/libraries
install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR))
ifeq "$(HADDOCK_DOCS)" "YES"
$(INSTALL_DIR) $(DESTlibraryhtmldir)
$(INSTALL_DATA) index.html doc-index.html $(DESTlibraryhtmldir)
$(INSTALL_SCRIPT) gen_contents_index $(DESTlibraryhtmldir)
$(INSTALL_DIR) $(DESTDIR)$(libraryhtmldir)
$(INSTALL_DATA) index.html doc-index.html $(DESTDIR)$(libraryhtmldir)
$(INSTALL_SCRIPT) gen_contents_index $(DESTDIR)$(libraryhtmldir)
# Hacks:
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.css $(DESTlibraryhtmldir)
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.js $(DESTlibraryhtmldir)
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.gif $(DESTlibraryhtmldir)
$(INSTALL_DATA) $(DESTDIR)$(libraryhtmldir)/base/*.css $(DESTDIR)$(libraryhtmldir)
$(INSTALL_DATA) $(DESTDIR)$(libraryhtmldir)/base/*.js $(DESTDIR)$(libraryhtmldir)
$(INSTALL_DATA) $(DESTDIR)$(libraryhtmldir)/base/*.gif $(DESTDIR)$(libraryhtmldir)
endif
# Cabal doesn't let us ask to install docs only, so do nothing here
......@@ -324,7 +320,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \
cd $* && \
../installPackage/installPackage "$(DESTDIR)" "$(prefix)" "$(datadir)" "$(libraryhtmldir)" "$(GHC_PKG_PROG)" "$(DESTDIR)$(libdir)/package.conf" ; \
../installPackage/installPackage "$(DESTDIR)" "$(prefix)" "$(datadir)" "$(libraryhtmldir)/$*" "$(libraryhtmldir)" "$(GHC_PKG_PROG)" "$(DESTDIR)$(libdir)/package.conf" ; \
fi
.PHONY: binary-dist binary-dist.library.%
......
......@@ -13,7 +13,7 @@ main :: IO ()
main
= do args <- getArgs
case args of
destdir : pref : idatadir : idocdir : ghcpkg : ghcpkgconf : args' ->
destdir : pref : idatadir : idocdir : ihtmldir : ghcpkg : ghcpkgconf : args' ->
let verbosity = case args' of
[] -> normal
['-':'v':v] ->
......@@ -22,15 +22,15 @@ main
_ -> Just v
in flagToVerbosity m
_ -> error ("Bad arguments: " ++ show args)
in doit destdir pref idatadir idocdir ghcpkg ghcpkgconf
in doit destdir pref idatadir idocdir ihtmldir ghcpkg ghcpkgconf
verbosity
_ ->
error "Missing arguments"
doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
doit :: FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
-> Verbosity
-> IO ()
doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity =
doit destdir pref idatadir idocdir ihtmldir ghcpkg ghcpkgconf verbosity =
do let userHooks = simpleUserHooks
copyto = if null destdir then NoCopyDest else CopyTo destdir
copyFlags = (emptyCopyFlags copyto) {
......@@ -63,7 +63,8 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity =
-- directory to copy to rather than "$topdir"
i_copy = i { prefixDirTemplate = toPathTemplate pref,
dataDirTemplate = toPathTemplate idatadir,
docDirTemplate = toPathTemplate idocdir
docDirTemplate = toPathTemplate idocdir,
htmlDirTemplate = toPathTemplate ihtmldir
}
lbi_copy = lbi { installDirTemplates = i_copy }
-- When we run GHC we give it a $topdir that includes the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment