[(pushed)] sphinx: fix building if sphinx-build is missing

Message ID 75c37723-6963-db1a-0eb3-d71e16aecd7b@suse.cz
State New
Headers
Series [(pushed)] sphinx: fix building if sphinx-build is missing |

Commit Message

Martin Liška Nov. 9, 2022, 9:09 a.m. UTC
  I noticed I modified Makefile.in files in the Sphinx series. While I was
supposed to modifiky Makefile.am and use automake. I'm going to fix that soon.

Martin

libgomp/ChangeLog:

	* Makefile.in: Build info pages conditionally.

libitm/ChangeLog:

	* Makefile.in: Build info pages conditionally.

libquadmath/ChangeLog:

	* Makefile.in: Build info pages conditionally.
---
 libgomp/Makefile.in     | 5 ++++-
 libitm/Makefile.in      | 5 ++++-
 libquadmath/Makefile.in | 4 +++-
 3 files changed, 11 insertions(+), 3 deletions(-)
  

Comments

Stephan Bergmann Nov. 13, 2022, 7:18 p.m. UTC | #1
On 11/9/22 10:09, Martin Liška wrote:
> I noticed I modified Makefile.in files in the Sphinx series. While I was
> supposed to modifiky Makefile.am and use automake. I'm going to fix that soon.

A recent master build against (apparently too old) 
python3-sphinx-5.0.2-2.fc37.noarch failed for me with

[...]
> make -C ../../src/gcc/../doc man SOURCEDIR=.../build/gcc/../../src/gcc/fortran/doc/gfortran BUILDDIR=.../build/gcc/doc/gfortran/man SPHINXBUILD=sphinx-build
> make[3]: Entering directory '.../src/doc'
> sphinx-build -b "man" -d .../build/gcc/doc/gfortran/man/doctrees  -q  .../build/gcc/../../src/gcc/fortran/doc/gfortran ".../build/gcc/doc/gfortran/man/man"
> 
> Sphinx version error:
> This project needs at least Sphinx v5.3 and therefore cannot be built with this version.
> make[3]: *** [Makefile:100: man] Error 2
> make[3]: Leaving directory '.../src/doc'
> make[2]: *** [../../src/gcc/fortran/Make-lang.in:164: doc/gfortran/man/man/gfortran.1] Error 2
> make[2]: Leaving directory '.../build/gcc'
> make[1]: *** [Makefile:5300: install-gcc] Error 2
> make[1]: Leaving directory '.../build'
> make: *** [Makefile:2576: install] Error 2

which would be fixed by

> diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
> index 48acbed1754..852b6f3327f 100644
> --- a/gcc/fortran/Make-lang.in
> +++ b/gcc/fortran/Make-lang.in
> @@ -161,7 +161,9 @@ fortran.install-pdf: $(F95_PDFFILES)
>  F95_MANFILES = doc/gfortran/man/man/gfortran.1
>  
>  doc/gfortran/man/man/gfortran.1: $(SPHINX_FILES)
> -       + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/man SPHINXBUILD=$(SPHINX_BUILD)
> +       + if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \
> +         make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/man SPHINXBUILD=$(SPHINX_BUILD) \
> +       else true; fi
>  
>  fortran.man: $(F95_MANFILES)
>
  
Martin Liška Nov. 13, 2022, 7:26 p.m. UTC | #2
On 11/13/22 20:18, Stephan Bergmann wrote:
> On 11/9/22 10:09, Martin Liška wrote:
>> I noticed I modified Makefile.in files in the Sphinx series. While I was
>> supposed to modifiky Makefile.am and use automake. I'm going to fix that soon.
> 
> A recent master build against (apparently too old) python3-sphinx-5.0.2-2.fc37.noarch failed for me with

I see!

> 
> [...]
>> make -C ../../src/gcc/../doc man SOURCEDIR=.../build/gcc/../../src/gcc/fortran/doc/gfortran BUILDDIR=.../build/gcc/doc/gfortran/man SPHINXBUILD=sphinx-build
>> make[3]: Entering directory '.../src/doc'
>> sphinx-build -b "man" -d .../build/gcc/doc/gfortran/man/doctrees  -q  .../build/gcc/../../src/gcc/fortran/doc/gfortran ".../build/gcc/doc/gfortran/man/man"
>>
>> Sphinx version error:
>> This project needs at least Sphinx v5.3 and therefore cannot be built with this version.
>> make[3]: *** [Makefile:100: man] Error 2
>> make[3]: Leaving directory '.../src/doc'
>> make[2]: *** [../../src/gcc/fortran/Make-lang.in:164: doc/gfortran/man/man/gfortran.1] Error 2
>> make[2]: Leaving directory '.../build/gcc'
>> make[1]: *** [Makefile:5300: install-gcc] Error 2
>> make[1]: Leaving directory '.../build'
>> make: *** [Makefile:2576: install] Error 2
> 
> which would be fixed by

The patch is fine, please send it to gcc-patches ML and install it.

Thanks,
Martin

> 
>> diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
>> index 48acbed1754..852b6f3327f 100644
>> --- a/gcc/fortran/Make-lang.in
>> +++ b/gcc/fortran/Make-lang.in
>> @@ -161,7 +161,9 @@ fortran.install-pdf: $(F95_PDFFILES)
>>  F95_MANFILES = doc/gfortran/man/man/gfortran.1
>>  
>>  doc/gfortran/man/man/gfortran.1: $(SPHINX_FILES)
>> -       + make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/man SPHINXBUILD=$(SPHINX_BUILD)
>> +       + if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \
>> +         make -C $(srcdir)/../doc man SOURCEDIR=$(abs_srcdir)/fortran/doc/gfortran BUILDDIR=$(objdir)/doc/gfortran/man SPHINXBUILD=$(SPHINX_BUILD) \
>> +       else true; fi
>>  
>>  fortran.man: $(F95_MANFILES)
>>  
> 
>
  
Stephan Bergmann Nov. 13, 2022, 9:19 p.m. UTC | #3
On 11/13/22 20:26, Martin Liška wrote:
> The patch is fine, please send it to gcc-patches ML and install it.

I sent a patch now, but don't have commit rights.
  

Patch

diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index 9d1787d8458..0c016980c3d 100644
--- a/libgomp/Makefile.in
+++ b/libgomp/Makefile.in
@@ -1304,7 +1304,10 @@  stamp-geninsrc: doc/info/texinfo/libgomp.info
 	@touch $@
 
 doc/info/texinfo/libgomp.info: $(SPHINX_FILES)
-	+ make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD)
+	+ if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \
+	  make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD); \
+	else true; fi
+
 
 # target overrides
 -include $(tmake_file)
diff --git a/libitm/Makefile.in b/libitm/Makefile.in
index 38a7e5bf731..f51858db8c7 100644
--- a/libitm/Makefile.in
+++ b/libitm/Makefile.in
@@ -1121,7 +1121,10 @@  stamp-geninsrc: doc/info/texinfo/libitm.info
 	@touch $@
 
 doc/info/texinfo/libitm.info: $(SPHINX_FILES)
-	+ make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD)
+	+ if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \
+	  make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD); \
+	else true; fi
+
 
 # GNU Make needs to see an explicit $(MAKE) variable in the command it
 # runs to enable its job server during parallel builds.  Hence the
diff --git a/libquadmath/Makefile.in b/libquadmath/Makefile.in
index d551f56ce62..864ebc6048a 100644
--- a/libquadmath/Makefile.in
+++ b/libquadmath/Makefile.in
@@ -1374,7 +1374,9 @@  SPHINX_FILES:=$(RST_FILES) $(SPHINX_CONFIG_FILES)
 export BUGURL=$(REPORT_BUGS_TO)
 
 doc/info/texinfo/libquadmath.info: $(SPHINX_FILES)
-	+ make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD)
+	+ if [ x$(HAS_SPHINX_BUILD) = xhas-sphinx-build ]; then \
+	  make -C $(srcdir)/../doc info SOURCEDIR=$(abs_srcdir)/doc BUILDDIR=$(abs_doc_builddir)/info SPHINXBUILD=$(SPHINX_BUILD); \
+	else true; fi
 
 # GNU Make needs to see an explicit $(MAKE) variable in the command it
 # runs to enable its job server during parallel builds.  Hence the