]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure: check for new enough sphinx-build
authorJason Ish <jason.ish@oisf.net>
Tue, 5 Sep 2023 21:06:24 +0000 (15:06 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 6 Sep 2023 18:22:48 +0000 (20:22 +0200)
We need a recent version of Sphinx to build the documentation in
7.0. Check for a minimum version of 3.4.3. If older, do not build the
docs which is the same behavior when sphinx-build is not found.

Bug: #6297

configure.ac

index 1fba3ebeefb94ec4209d89165c00795f503ef5e4..743770464993a191063ba4719379a6f96fd44b5a 100644 (file)
@@ -2229,8 +2229,23 @@ fi
         AC_DEFINE([CLS],[64],[L1 cache line size])
     fi
 
-# sphinx for documentation
+# sphinx-build for documentation, and also check for a new enough version
     AC_PATH_PROG(HAVE_SPHINXBUILD, sphinx-build, "no")
+    if test "$HAVE_SPHINXBUILD" != "no"; then
+        MIN_SPHINX_BUILD_VERSION="3.4.3"
+        sphinx_build_version=$($HAVE_SPHINXBUILD --version 2>&1 | cut -d' ' -f2-)
+        AC_MSG_CHECKING([for sphinx-build >= $MIN_SPHINX_BUILD_VERSION])
+        AS_VERSION_COMPARE([$sphinx_build_version], [$MIN_SPHINX_BUILD_VERSION],
+            [
+                AC_MSG_RESULT([no, documentation will not be built])
+                HAVE_SPHINXBUILD="no"
+            ],
+            [], [])
+        if test "$HAVE_SPHINXBUILD" != "no"; then
+            AC_MSG_RESULT(yes)
+        fi
+    fi
+
     if test "$HAVE_SPHINXBUILD" = "no"; then
        enable_sphinxbuild=no
        if test -e "$srcdir/doc/userguide/suricata.1"; then