diff options
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | ghc.mk | 5 | ||||
-rw-r--r-- | hadrian/cfg/system.config.in | 1 | ||||
-rw-r--r-- | hadrian/src/Builder.hs | 11 | ||||
-rw-r--r-- | hadrian/src/Rules/Documentation.hs | 7 | ||||
-rw-r--r-- | mk/config.mk.in | 1 | ||||
-rw-r--r-- | rules/sphinx.mk | 2 |
7 files changed, 21 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 070f7ce56c..a2faecff06 100644 --- a/configure.ac +++ b/configure.ac @@ -880,6 +880,7 @@ fi dnl ** check for xelatex AC_PATH_PROG(XELATEX,xelatex) +AC_PATH_PROG(MAKEINDEX,makeindex) dnl ** check for makeinfo AC_PATH_PROG(MAKEINFO,makeinfo) @@ -1383,7 +1384,7 @@ dnl -------------------------------------------------------------- if test -n "$SPHINXBUILD"; then BUILD_MAN=YES BUILD_SPHINX_HTML=YES - if test -n "$XELATEX"; then + if test -n "$XELATEX" -a -n "$MAKEINDEX"; then BUILD_SPHINX_PDF=YES else BUILD_SPHINX_PDF=NO @@ -185,6 +185,11 @@ $(error BUILD_SPHINX_PDF=YES, but `xelatex` was not found. \ Install `xelatex`, then rerun `./configure`. \ See https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation) endif +ifeq "$(MAKEINDEX)" "" +$(error BUILD_SPHINX_PDF=YES, but `makeindex` was not found. \ + Install `xelatex`, then rerun `./configure`. \ + See https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation) +endif endif ifeq "$(HSCOLOUR_SRCS)" "YES" diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 810b290d1b..e1b7684b84 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -24,6 +24,7 @@ system-ghc-pkg = @GhcPkgCmd@ tar = @TarCmd@ patch = @PatchCmd@ xelatex = @XELATEX@ +makeindex = @MAKEINDEX@ makeinfo = @MAKEINFO@ # Python 3 is required to run test driver. diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs index b6fd3e7f2a..e51936ec77 100644 --- a/hadrian/src/Builder.hs +++ b/hadrian/src/Builder.hs @@ -140,6 +140,7 @@ data Builder = Alex | Tar TarMode | Unlit | Xelatex + | Makeindex -- ^ from xelatex deriving (Eq, Generic, Show) instance Binary Builder @@ -279,13 +280,8 @@ instance H.Builder Builder where Makeinfo -> do cmd' echo [path] "--no-split" [ "-o", output] [input] - Xelatex -> do - unit $ cmd' [Cwd output] [path] buildArgs - unit $ cmd' [Cwd output] [path] buildArgs - unit $ cmd' [Cwd output] [path] buildArgs - unit $ cmd' [Cwd output] ["makeindex"] (input -<.> "idx") - unit $ cmd' [Cwd output] [path] buildArgs - unit $ cmd' [Cwd output] [path] buildArgs + Xelatex -> unit $ cmd' [Cwd output] [path] buildArgs + Makeindex -> unit $ cmd' [Cwd output] [path] buildArgs Tar _ -> cmd' buildOptions echo [path] buildArgs _ -> cmd' echo [path] buildArgs @@ -326,6 +322,7 @@ systemBuilderPath builder = case builder of Sphinx _ -> fromKey "sphinx-build" Tar _ -> fromKey "tar" Xelatex -> fromKey "xelatex" + Makeindex -> fromKey "makeindex" _ -> error $ "No entry for " ++ show builder ++ inCfg where inCfg = " in " ++ quote configFile ++ " file." diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs index a673e2e074..f39d52c512 100644 --- a/hadrian/src/Rules/Documentation.hs +++ b/hadrian/src/Rules/Documentation.hs @@ -290,6 +290,13 @@ buildSphinxPdf path = do need (map (rstFilesDir -/-) rstFiles) build $ target docContext (Sphinx LatexMode) [pathPath path] [dir] checkSphinxWarnings dir + + -- LaTeX "fixed point" + build $ target docContext Xelatex [path <.> "tex"] [dir] + build $ target docContext Xelatex [path <.> "tex"] [dir] + build $ target docContext Xelatex [path <.> "tex"] [dir] + build $ target docContext Makeindex [path <.> "idx"] [dir] + build $ target docContext Xelatex [path <.> "tex"] [dir] build $ target docContext Xelatex [path <.> "tex"] [dir] copyFileUntracked (dir -/- path <.> "pdf") file diff --git a/mk/config.mk.in b/mk/config.mk.in index 406e72ba1b..9c4cdc9573 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -839,6 +839,7 @@ BUILD_SPHINX_HTML = @BUILD_SPHINX_HTML@ BUILD_SPHINX_PDF = @BUILD_SPHINX_PDF@ SPHINXOPTS = -D latex_paper_size=letter XELATEX = @XELATEX@ +MAKEINDEX = @MAKEINDEX@ #----------------------------------------------------------------------------- # FPtools support software diff --git a/rules/sphinx.mk b/rules/sphinx.mk index 5291816d31..2e24e50385 100644 --- a/rules/sphinx.mk +++ b/rules/sphinx.mk @@ -66,7 +66,7 @@ $1/$2.pdf: $1/conf.py $$($1_RST_SOURCES) cd $1/build-pdf/$2 ; $(XELATEX) -halt-on-error $2.tex 2>/dev/null >/dev/null || true cd $1/build-pdf/$2 ; $(XELATEX) -halt-on-error $2.tex 2>/dev/null >/dev/null || true cd $1/build-pdf/$2 ; $(XELATEX) -halt-on-error $2.tex 2>/dev/null >/dev/null || true - cd $1/build-pdf/$2 ; makeindex $2.idx + cd $1/build-pdf/$2 ; $(MAKEINDEX) $2.idx cd $1/build-pdf/$2 ; $(XELATEX) -halt-on-error $2.tex 2>/dev/null >/dev/null || true cd $1/build-pdf/$2 ; $(XELATEX) -halt-on-error $2.tex cp $1/build-pdf/$2/$2.pdf $1/$2.pdf |