Skip to content

Commit 9dfebe1

Browse files
authored
Merge pull request #11016 from jsquyres/pr/make-sphinx-version-check-better
opal_setup_sphinx.m4: make version check better
2 parents a4c2d16 + 41618f7 commit 9dfebe1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

config/opal_setup_sphinx.m4

+15-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,21 @@ AC_DEFUN([OPAL_SETUP_SPHINX],[
4343
# version.
4444
AS_IF([test -n "$SPHINX_BUILD"],
4545
[[sphinx_target_version=`sed -n -e 's/sphinx[><=]*\([0-9\.]\)/\1/p' $srcdir/docs/requirements.txt`]
46-
sphinx_found_version=`$SPHINX_BUILD --version 2>&1 | cut -d\ -f2`
46+
# Some older versions of Sphinx (e.g., Sphinx v1.1.3 in
47+
# RHEL 7):
48+
#
49+
# - Don't support "--version".
50+
# - But do emit the version number as part of the general
51+
# CLI help when they don't recognize the --version CLI
52+
# option.
53+
#
54+
# In that case, we only want the first line, and we want to
55+
# strip off the leading "v" from the version number.
56+
#
57+
# In the case where --version *is* recognized, all the
58+
# additional processing is harmless and we still end up
59+
# with the Sphinx version number.
60+
sphinx_found_version=`$SPHINX_BUILD --version 2>&1 | head -n 1 | cut -d\ -f2 | sed -e 's/^v//'`
4761
AC_MSG_CHECKING([if Sphinx version is high enough ($sphinx_found_version >= $sphinx_target_version)])
4862
AS_VERSION_COMPARE([$sphinx_found_version],
4963
[$sphinx_target_version],

0 commit comments

Comments
 (0)