[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binar
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary |
Date: |
Fri, 14 Feb 2020 18:18:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Peter Maydell <address@hidden> writes:
> On Fri, 14 Feb 2020 at 12:20, Markus Armbruster <address@hidden> wrote:
>>
>> Peter Maydell <address@hidden> writes:
>> >> # Default objcc to clang if available, otherwise use CC
>> >> @@ -4803,7 +4816,7 @@ has_sphinx_build() {
>> >> # sphinx-build doesn't exist at all or if it is too old.
>> >> mkdir -p "$TMPDIR1/sphinx"
>> >> touch "$TMPDIR1/sphinx/index.rst"
>> >> - $sphinx_build -c "$source_path/docs" -b html "$TMPDIR1/sphinx"
>> >> "$TMPDIR1/sphinx/out" >/dev/null 2>&1
>> >> + "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx"
>> >> "$TMPDIR1/sphinx/out" >/dev/null 2>&1
>> >> }
>> >
>> > This change isn't related to trying sphinx-build-3 --
>> > did you actually need it ?
>>
>> If the for loop finds nothing, $sphinx_build remains empty. Quoting the
>> variable seems cleaner.
>
> Oh, I see. Anyway, yes, happy to have quotes here.
I decided I prefer this as a separate patch, between PATCH 01 and 02.
Hmm, maybe I should squash the last hunk into PATCH 01.
>From 10d174a9f811708807fb60a610e88084f282c222 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <address@hidden>
Date: Fri, 14 Feb 2020 07:33:43 +0100
Subject: [PATCH] configure: Pick sphinx-build-3 when available
The next commit will require a sphinx-build that uses Python 3. On
some systems, sphinx-build is fine, on others you need to use
sphinx-build-3. To keep things working out of the box on both kinds
of systems, try sphinx-build-3, then sphinx-build.
Signed-off-by: Markus Armbruster <address@hidden>
---
configure | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 14172909f0..4cbeb06b86 100755
--- a/configure
+++ b/configure
@@ -584,7 +584,6 @@ query_pkg_config() {
}
pkg_config=query_pkg_config
sdl2_config="${SDL2_CONFIG-${cross_prefix}sdl2-config}"
-sphinx_build=sphinx-build
# If the user hasn't specified ARFLAGS, default to 'rv', just as make does.
ARFLAGS="${ARFLAGS-rv}"
@@ -903,6 +902,7 @@ fi
: ${make=${MAKE-make}}
: ${install=${INSTALL-install}}
+
# We prefer python 3.x. A bare 'python' is traditionally
# python 2.x, but some distros have it as python 3.x, so
# we check that too
@@ -915,6 +915,17 @@ do
break
fi
done
+
+sphinx_build=
+for binary in sphinx-build-3 sphinx-build
+do
+ if has "$binary"
+ then
+ sphinx_build=$(command -v "$binary")
+ break
+ fi
+done
+
: ${smbd=${SMBD-/usr/sbin/smbd}}
# Default objcc to clang if available, otherwise use CC
@@ -4803,7 +4814,7 @@ has_sphinx_build() {
# sphinx-build doesn't exist at all or if it is too old.
mkdir -p "$TMPDIR1/sphinx"
touch "$TMPDIR1/sphinx/index.rst"
- $sphinx_build -c "$source_path/docs" -b html "$TMPDIR1/sphinx"
"$TMPDIR1/sphinx/out" >/dev/null 2>&1
+ "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx"
"$TMPDIR1/sphinx/out" >/dev/null 2>&1
}
# Check if tools are available to build documentation.
--
2.21.1
- [PATCH v2 00/30] Convert QAPI doc comments to generate rST instead of texinfo, Peter Maydell, 2020/02/13
- [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Peter Maydell, 2020/02/13
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Markus Armbruster, 2020/02/14
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Peter Maydell, 2020/02/14
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Markus Armbruster, 2020/02/14
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Peter Maydell, 2020/02/14
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary,
Markus Armbruster <=
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Peter Maydell, 2020/02/14
- Re: [PATCH v2 01/30] configure: Allow user to specify sphinx-build binary, Markus Armbruster, 2020/02/15
[PATCH v2 02/30] configure: Check that sphinx-build is using Python 3, Peter Maydell, 2020/02/13
[PATCH v2 03/30] Makefile: Fix typo in dependency list for interop manpages, Peter Maydell, 2020/02/13
[PATCH v2 04/30] qga/qapi-schema.json: Fix missing '-' in GuestDiskBusType doc comment, Peter Maydell, 2020/02/13
[PATCH v2 07/30] qapi/block-core.json: Use literal block for ascii art, Peter Maydell, 2020/02/13