summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-31 10:59:46 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-25 03:54:39 -0400
commit4acc2934952f4849c2082015d9bebef446d46545 (patch)
tree0473e7926f36a73666c3e5e6e3adfd9c2303667c
parent30e42652ed895c3ed086e7834be46f93ba1cc61b (diff)
downloadhaskell-4acc2934952f4849c2082015d9bebef446d46545.tar.gz
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.
-rw-r--r--configure.ac3
-rw-r--r--ghc.mk5
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/src/Builder.hs11
-rw-r--r--hadrian/src/Rules/Documentation.hs7
-rw-r--r--mk/config.mk.in1
-rw-r--r--rules/sphinx.mk2
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
diff --git a/ghc.mk b/ghc.mk
index 02e3b79a2d..91cc5588c4 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -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