]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
configure: more idiomatic autoconf for sphinx-build checks
authorJason Ish <jason.ish@oisf.net>
Tue, 5 Sep 2023 21:16:43 +0000 (15:16 -0600)
committerVictor Julien <victor@inliniac.net>
Wed, 6 Sep 2023 18:22:49 +0000 (20:22 +0200)
- Use SPHINX_BUILD instead of HAVE_SPHINX_BUILD, as here we're
  actually using the path of the program.

- Wrap some elements in [] as is done in modern idiomatic autoconf

configure.ac
doc/userguide/Makefile.am

index 743770464993a191063ba4719379a6f96fd44b5a..72adef1b91872304e428186f300f2863775317a2 100644 (file)
@@ -2230,29 +2230,29 @@ fi
     fi
 
 # 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
+    AC_PATH_PROG([SPHINX_BUILD], [sphinx-build], [no])
+    if test "$SPHINX_BUILD" != "no"; then
         MIN_SPHINX_BUILD_VERSION="3.4.3"
-        sphinx_build_version=$($HAVE_SPHINXBUILD --version 2>&1 | cut -d' ' -f2-)
+        sphinx_build_version=$($SPHINX_BUILD --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"
+                SPHINX_BUILD="no"
             ],
             [], [])
-        if test "$HAVE_SPHINXBUILD" != "no"; then
-            AC_MSG_RESULT(yes)
+        if test "$SPHINX_BUILD" != "no"; then
+            AC_MSG_RESULT([yes])
         fi
     fi
 
-    if test "$HAVE_SPHINXBUILD" = "no"; then
+    if test "$SPHINX_BUILD" = "no"; then
        enable_sphinxbuild=no
        if test -e "$srcdir/doc/userguide/suricata.1"; then
            have_suricata_man=yes
        fi
     fi
-    AM_CONDITIONAL([HAVE_SPHINXBUILD], [test "x$enable_sphinxbuild" != "xno"])
+    AM_CONDITIONAL([SPHINX_BUILD], [test "x$enable_sphinxbuild" != "xno"])
     AM_CONDITIONAL([HAVE_SURICATA_MAN], [test "x$have_suricata_man" = "xyes"])
 
 # pdflatex for the pdf version of the user manual
index 8fcfa861771c0765a129a141bf0e9a0925ce857c..bd157920cfac7ff30e0c599cbd5dba75c5d8f63e 100644 (file)
@@ -37,7 +37,7 @@ if HAVE_SURICATA_MAN
 dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1
 endif
 
-if HAVE_SPHINXBUILD
+if SPHINX_BUILD
 dist_man1_MANS = suricata.1 suricatasc.1 suricatactl.1 suricatactl-filestore.1
 
 if HAVE_PDFLATEX
@@ -92,4 +92,4 @@ clean-local:
        rm -f $(top_builddir)/doc/userguide/suricata*.1
        rm -f $(top_builddir)/doc/userguide/userguide.pdf
 
-endif # HAVE_SPHINXBUILD
+endif # SPHINX_BUILD