Commit 4acc2934 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

hadrian/make: Detect makeindex

Previously we would simply assume that makeindex was available.
Now we correctly detect it in `configure` and respect this conclusion in
hadrian and make.
parent 30e42652
......@@ -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"
......
......@@ -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.
......
......@@ -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."
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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