]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Test for pandoc --latex-engine or --pdf-engine
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sat, 2 Feb 2019 11:52:18 +0000 (11:52 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sat, 2 Feb 2019 11:52:59 +0000 (11:52 +0000)
Thankfully they both work in exactly the same way. Fixes #2460

Makefile

index 551cf5e382fc14511d5a8477143ad9e8849e1445..d03d2e8b1d036f9d28d5a5f265e1ebf691a56664 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -345,6 +345,16 @@ ADOC_FILES += $(patsubst raddb/%.md,asciidoc/%.adoc,$(shell find raddb -name "*\
 PDF_FILES := $(patsubst asciidoc/%.adoc,asciidoc/%.pdf,$(ADOC_FILES))
 HTML_FILES := $(patsubst asciidoc/%.adoc,asciidoc/%.html,$(ADOC_FILES))
 
+#
+#  Pandoc v2 onwards renamed --latex-engine to --pdf-engine
+#
+PANDOC_ENGINE=pdf
+ifneq ($(shell which pandoc),)
+ifneq ($(shell pandoc --help | grep latex-engine),)
+PANDOC_ENGINE=latex
+endif
+endif
+
 #
 #  Markdown files get converted to asciidoc via pandoc.
 #
@@ -372,14 +382,14 @@ asciidoc/%.html: asciidoc/%.adoc
 asciidoc/%.pdf: asciidoc/%.adoc
        @echo PDF $^
        @asciidoctor $< -b docbook5 -o - | \
-               pandoc -f docbook -t latex --pdf-engine=xelatex \
+               pandoc -f docbook -t latex --${PANDOC_ENGINE}-engine=xelatex \
                        -V papersize=letter \
                        -V images=yes \
                        --template=./scripts/asciidoc/freeradius.template -o $@
 
 asciidoc/%.pdf: raddb/%.md
        @echo PDF $^
-       pandoc -f markdown -t latex --pdf-engine=xelatex \
+       pandoc -f markdown -t latex --${PANDOC_ENGINE}-engine=xelatex \
                -V papersize=letter \
                --template=./scripts/asciidoc/freeradius.template -o $@ $<