From 45383a9cc2b80e1a98e9c080f034c94dd41ae920 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 28 Nov 2019 14:42:43 +0100
Subject: [PATCH] Build system: really error out if LaTeX distribution is not
 there

The changes in 1ec3923a6b9075526a24947ae10dab25b9a0d5d4 were not working as
intended, because AC_CHECK_PROG expect values and not actions. Hence
AC_MSG_ERROR was not properly executed.
---
 configure.ac | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index b268b254..5e26e834 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,8 +86,10 @@ AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc], [disable compilation of doc
 AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = yes])
 
 if test "$enable_doc" = yes; then
-  AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [AC_MSG_ERROR([pdflatex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
-  AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex], [AC_MSG_ERROR([bibtex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
+  AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [no])
+  test "$PDFLATEX" = no && AC_MSG_ERROR([pdflatex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
+  AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex], [no])
+  test "$BIBTEX" = no && AC_MSG_ERROR([bibtex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
   AX_LATEX_CLASS([beamer], [ax_latex_have_beamer], [], [AC_MSG_ERROR([beamer cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
 fi
 
-- 
GitLab