Skip to content

Commit

Permalink
8297352: configure should check pandoc version
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Nov 21, 2022
1 parent 15e2e28 commit 817e039
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions make/autoconf/basic_tools.m4
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
])

1 comment on commit 817e039

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.