Browse Source

build/HACKING: add check for pandoc and update make rule for HACKING.pdf

Paul Jakma 2 years ago
parent
commit
3c06ac025a
2 changed files with 13 additions and 4 deletions
  1. 3 3
      Makefile.am
  2. 10 1
      configure.ac

+ 3 - 3
Makefile.am

@@ -13,10 +13,10 @@ EXTRA_DIST = aclocal.m4 SERVICES TODO REPORTING-BUGS INSTALL.quagga.txt \
 	vtysh/Makefile.in vtysh/Makefile.am \
 	tools/zebra.el tools/multiple-bgpd.sh
 
-if HAVE_LATEX
+if HAVE_PANDOC
 
-HACKING.pdf: HACKING.tex
-	$(LATEXMK) -pdf $<
+HACKING.pdf: HACKING.md
+	pandoc -o $@ $<
 
 clean-local:
 	-$(LATEXMK) -C HACKING.tex

+ 10 - 1
configure.ac

@@ -83,7 +83,8 @@ dnl autoconf 2.59 appears not to support AC_PROG_SED
 dnl AC_PROG_SED
 AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
 
-dnl pdflatex and latexmk are needed to build HACKING.pdf
+dnl Check for pdflatex and latexmk, in case someone wants to build
+dnl PDFs from TeX (as used to be case for HACKING)
 AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[/bin/false])
 AC_CHECK_PROG([LATEXMK],[latexmk],[latexmk],[/bin/false])
 if test "x$PDFLATEX" = "x/bin/false" -o "x$LATEXMK" = "x/bin/false"; then
@@ -92,6 +93,14 @@ else
 	HAVE_LATEX=true
 fi
 AM_CONDITIONAL([HAVE_LATEX], [test "x$HAVE_LATEX" = "xtrue"])
+dnl for making HACKING.pdf from HACKING.md using pandoc
+AC_CHECK_PROG([PANDOC],[pandoc],[pandoc],[/bin/false])
+if test "x$PDFLATEX" = "x/bin/false" -o "x$PANDOC" = "x/bin/false"; then
+	AC_MSG_WARN([Will not be able to make PDF versions of MD documents])
+else
+	HAVE_PANDOC=true
+fi
+AM_CONDITIONAL([HAVE_PANDOC], [test "x$HAVE_PANDOC" = "xtrue"])
 
 if test "x${GCC}" != "xyes" ; then
   AC_MSG_CHECKING([whether we are using SunPro compiler])