From 817e039bb5300e95ba60749f237f1243f72f4eeb Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Mon, 21 Nov 2022 18:33:32 +0000 Subject: [PATCH] 8297352: configure should check pandoc version Reviewed-by: erikj --- make/autoconf/basic_tools.m4 | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/make/autoconf/basic_tools.m4 b/make/autoconf/basic_tools.m4 index fc349a811e3..db13241568f 100644 --- a/make/autoconf/basic_tools.m4 +++ b/make/autoconf/basic_tools.m4 @@ -23,6 +23,11 @@ # questions. # +############################################################################### +# It is recommended to use exactly this version of pandoc, especially for +# re-generating checked in html files +RECOMMENDED_PANDOC_VERSION=2.19.2 + ############################################################################### # Setup the most fundamental tools that relies on not much else to set up, # but is used by much of the early bootstrap code. @@ -426,22 +431,29 @@ AC_DEFUN_ONCE([BASIC_SETUP_PANDOC], [ UTIL_LOOKUP_PROGS(PANDOC, pandoc) - PANDOC_MARKDOWN_FLAG="markdown" - if test -n "$PANDOC"; then - AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown) + if test "x$PANDOC" != x; then + AC_MSG_CHECKING([for pandoc version]) + PANDOC_VERSION=`$PANDOC --version 2>&1 | $HEAD -1 | $CUT -d " " -f 2` + AC_MSG_RESULT([$PANDOC_VERSION]) + + if test "x$PANDOC_VERSION" != x$RECOMMENDED_PANDOC_VERSION; then + AC_MSG_WARN([pandoc is version $PANDOC_VERSION, not the recommended version $RECOMMENDED_PANDOC_VERSION]) + fi + + PANDOC_MARKDOWN_FLAG="markdown" + AC_MSG_CHECKING([if the pandoc smart extension needs to be disabled for markdown]) if $PANDOC --list-extensions | $GREP -q '\+smart'; then AC_MSG_RESULT([yes]) PANDOC_MARKDOWN_FLAG="markdown-smart" else AC_MSG_RESULT([no]) fi - fi - if test -n "$PANDOC"; then ENABLE_PANDOC="true" else ENABLE_PANDOC="false" fi + AC_SUBST(ENABLE_PANDOC) AC_SUBST(PANDOC_MARKDOWN_FLAG) ])