From 1ec3923a6b9075526a24947ae10dab25b9a0d5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 26 Nov 2019 12:39:48 +0100 Subject: [PATCH] Build system: by default, error out if LaTeX distribution is not there A new --disable-doc configure flag has been introduced to skip the compilation of the documentation. --- configure.ac | 34 +++++++++++++++++----------------- doc/Makefile.am | 4 ---- doc/macroprocessor/Makefile.am | 4 +--- doc/preprocessor/Makefile.am | 4 +--- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/configure.ac b/configure.ac index 415beb53..b268b254 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -dnl Copyright © 2009-2018 Dynare Team +dnl Copyright © 2009-2019 Dynare Team dnl dnl This file is part of Dynare. dnl @@ -77,19 +77,20 @@ CPPFLAGS="$CPPFLAGS_SAVED" # Don't use deprecated hash structures AC_DEFINE([BOOST_NO_HASH], [], [Don't use deprecated STL hash structures]) +# Check if internal documentation can be built AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) -AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex]) -AM_CONDITIONAL([HAVE_PDFLATEX], [test -n "$PDFLATEX"]) +# Check if user documentation can be built +AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc], [disable compilation of documentation]), [], [enable_doc=yes]) +AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = yes]) -AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex]) -AM_CONDITIONAL([HAVE_BIBTEX], [test -n "$BIBTEX"]) - -if test -n "$PDFLATEX" -a -n "$BIBTEX"; then - AX_LATEX_CLASS([beamer], [ax_latex_have_beamer]) +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.])]) + 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 -AM_CONDITIONAL([HAVE_BEAMER], [test "$ax_latex_have_beamer" = yes]) + AC_CONFIG_FILES([Makefile src/Makefile @@ -100,16 +101,15 @@ AC_CONFIG_FILES([Makefile ]) if test -n "$DOXYGEN"; then - BUILD_DYNARE_PREPROC_DOC="yes" + BUILD_INTERNAL_DOC="yes" else - BUILD_DYNARE_PREPROC_DOC="no (missing doxygen)" + BUILD_INTERNAL_DOC="no (missing doxygen)" fi - -if test -n "$PDFLATEX" -a "$ax_latex_have_beamer" = yes; then - BUILD_BEAMER_DOC="yes" +if test "$enable_doc" = yes; then + BUILD_DOC="yes" else - BUILD_BEAMER_DOC="no (missing one of: pdflatex, beamer)" + BUILD_DOC="no" fi AC_MSG_NOTICE([ @@ -120,10 +120,10 @@ Binaries (with "make") Dynare preprocessor: yes PDF documentation (with "make pdf"): - Preprocessor & Macroprocessor presentations: $BUILD_BEAMER_DOC + Preprocessor & Macroprocessor presentations: $BUILD_DOC HTML documentation (with "make html"): - Dynare preprocessor developer doc: $BUILD_DYNARE_PREPROC_DOC + Dynare preprocessor internal doc: $BUILD_INTERNAL_DOC ]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 8e622799..975faa56 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,3 @@ SUBDIRS = preprocessor macroprocessor -PDF_TARGETS = - EXTRA_DIST = logos - -pdf-local: $(PDF_TARGETS) diff --git a/doc/macroprocessor/Makefile.am b/doc/macroprocessor/Makefile.am index 5d06b17d..b6304dc0 100644 --- a/doc/macroprocessor/Makefile.am +++ b/doc/macroprocessor/Makefile.am @@ -1,8 +1,6 @@ -if HAVE_PDFLATEX -if HAVE_BEAMER +if ENABLE_DOC pdf-local: macroprocessor.pdf endif -endif SRC = macroprocessor.tex new-design.pdf diff --git a/doc/preprocessor/Makefile.am b/doc/preprocessor/Makefile.am index 65ee1437..63b9a182 100644 --- a/doc/preprocessor/Makefile.am +++ b/doc/preprocessor/Makefile.am @@ -1,8 +1,6 @@ -if HAVE_PDFLATEX -if HAVE_BEAMER +if ENABLE_DOC pdf-local: preprocessor.pdf endif -endif SRC = preprocessor.tex expr.png expr-sharing.png matrices.png overview.png json-preprocessor.png -- GitLab