diff mbox

[1/2] package/gdb (7.9): fix doc build when makeinfo is missing

Message ID 1441463443-9335-1-git-send-email-romain.naour@openwide.fr
State Superseded
Headers show

Commit Message

Romain Naour Sept. 5, 2015, 2:30 p.m. UTC
If makeinfo is not found in the system then the missing
script is used to warn the user.

Before commit e30465112ed4c6320dd19107302057a5f7712cf2 the missing
script returned 0 after printing the message.

Now, missing return 127 (command not found) to the Makefile and
the build fail.

Ignore the code returned by missing in order to build successfully
gdb even if makeinfo is not installed on the system.

upstream status: to be submitted

Fixes:
http://autobuild.buildroot.net/results/dee/dee1326baf26ad1eb6e12a7d033428eca50d00bc/build-end.log

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 ...db-fix-doc-build-when-makeinfo-is-missing.patch | 73 ++++++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 package/gdb/7.9.1/0004-gdb-fix-doc-build-when-makeinfo-is-missing.patch

Comments

Thomas Petazzoni Sept. 5, 2015, 6:09 p.m. UTC | #1
Romain,

On Sat,  5 Sep 2015 16:30:42 +0200, Romain Naour wrote:

> + gdb/index.html: ${GDB_DOC_FILES}
> +-	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
> ++	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo | true

Can you try instead to just prepend a - at the beginning of the line?

	-$(MAKEHTML) ....

Or better yet, for a properly upstreamable solution, a --enable-doc
option to explicitly enable or disable the doc. Or something that
detects if makeinfo is available, and if it isn't, that doesn't try to
generate the documentation.

Thanks,

Thomas
Romain Naour Sept. 5, 2015, 9:50 p.m. UTC | #2
Hi Thomas,

Le 05/09/2015 20:09, Thomas Petazzoni a écrit :
> Romain,
> 
> On Sat,  5 Sep 2015 16:30:42 +0200, Romain Naour wrote:
> 
>> + gdb/index.html: ${GDB_DOC_FILES}
>> +-	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
>> ++	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo | true
> 
> Can you try instead to just prepend a - at the beginning of the line?
> 
> 	-$(MAKEHTML) ....
> 

It doesn't work. What's the meaning of a - in this case ?

> Or better yet, for a properly upstreamable solution, a --enable-doc
> option to explicitly enable or disable the doc. Or something that
> detects if makeinfo is available, and if it isn't, that doesn't try to
> generate the documentation.

It's not easy to add a new options in configure.ac since a specific version of
autoconf is needed. Also it prevent to use GDB_AUTORECONF...

configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.

Another solution is to remove "doc" directory from SUBDIRS in gdb/Makefile.in:
-SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
+SUBDIRS = @subdirs@ data-directory $(GNULIB_BUILDDIR)

Thoughts ?

Best regards,
Romain

> 
> Thanks,
> 
> Thomas
>
Thomas Petazzoni Sept. 6, 2015, 8:31 a.m. UTC | #3
Romain,

On Sat, 5 Sep 2015 23:50:33 +0200, Romain Naour wrote:

> >> + gdb/index.html: ${GDB_DOC_FILES}
> >> +-	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
> >> ++	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo | true
> > 
> > Can you try instead to just prepend a - at the beginning of the line?
> > 
> > 	-$(MAKEHTML) ....
> > 
> 
> It doesn't work. What's the meaning of a - in this case ?

It tells make to ignore the return value of the command, and continue
executing the Makefile even if the command failed.

See https://www.gnu.org/software/make/manual/html_node/Errors.html:

"""
To ignore errors in a recipe line, write a ‘-’ at the beginning of the
line’s text (after the initial tab). The ‘-’ is discarded before the
line is passed to the shell for execution.
"""

> It's not easy to add a new options in configure.ac since a specific version of
> autoconf is needed. Also it prevent to use GDB_AUTORECONF...
> 
> configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.
> 
> Another solution is to remove "doc" directory from SUBDIRS in gdb/Makefile.in:
> -SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
> +SUBDIRS = @subdirs@ data-directory $(GNULIB_BUILDDIR)
> 
> Thoughts ?

Argh. So maybe, removing the "doc" directory from SUBDIRS from
Makefile.in is the easiest solution. In parallel to that, if you are
brave enough to write a patch for upstream gdb to make building the
documentation optional, and submit it, it would allow to solve the
problem for future versions of gdb. Or at least report the bug to the
gdb folks.

Thanks!

Thomas
Romain Naour Sept. 6, 2015, 9:18 a.m. UTC | #4
Hi Thomas,

Le 06/09/2015 10:31, Thomas Petazzoni a écrit :
> Romain,
> 
> On Sat, 5 Sep 2015 23:50:33 +0200, Romain Naour wrote:
> 
>>>> + gdb/index.html: ${GDB_DOC_FILES}
>>>> +-	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
>>>> ++	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo | true
>>>
>>> Can you try instead to just prepend a - at the beginning of the line?
>>>
>>> 	-$(MAKEHTML) ....
>>>
>>
>> It doesn't work. What's the meaning of a - in this case ?
> 
> It tells make to ignore the return value of the command, and continue
> executing the Makefile even if the command failed.
> 
> See https://www.gnu.org/software/make/manual/html_node/Errors.html:
> 
> """
> To ignore errors in a recipe line, write a ‘-’ at the beginning of the
> line’s text (after the initial tab). The ‘-’ is discarded before the
> line is passed to the shell for execution.
> """

Ok thanks.

> 
>> It's not easy to add a new options in configure.ac since a specific version of
>> autoconf is needed. Also it prevent to use GDB_AUTORECONF...
>>
>> configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.
>>
>> Another solution is to remove "doc" directory from SUBDIRS in gdb/Makefile.in:
>> -SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
>> +SUBDIRS = @subdirs@ data-directory $(GNULIB_BUILDDIR)
>>
>> Thoughts ?
> 
> Argh. So maybe, removing the "doc" directory from SUBDIRS from
> Makefile.in is the easiest solution. In parallel to that, if you are
> brave enough to write a patch for upstream gdb to make building the
> documentation optional, and submit it, it would allow to solve the
> problem for future versions of gdb. Or at least report the bug to the
> gdb folks.

Ok, I'll update my patches to remove the "doc" directory and I'll see what I can
do with upstream.

Best regards,
Romain

> 
> Thanks!
> 
> Thomas
>
diff mbox

Patch

diff --git a/package/gdb/7.9.1/0004-gdb-fix-doc-build-when-makeinfo-is-missing.patch b/package/gdb/7.9.1/0004-gdb-fix-doc-build-when-makeinfo-is-missing.patch
new file mode 100644
index 0000000..ca73750
--- /dev/null
+++ b/package/gdb/7.9.1/0004-gdb-fix-doc-build-when-makeinfo-is-missing.patch
@@ -0,0 +1,73 @@ 
+From e282f9d2a24f72ff7bb9bfb20dbdea299982bda0 Mon Sep 17 00:00:00 2001
+From: Romain Naour <romain.naour@openwide.fr>
+Date: Sat, 5 Sep 2015 16:02:28 +0200
+Subject: [PATCH] gdb: fix doc build when makeinfo is missing
+
+If makeinfo is not found in the system then the missing
+script is used to warn the user.
+
+Before commit e30465112ed4c6320dd19107302057a5f7712cf2 the missing
+script returned 0 after printing the message.
+
+Now, missing return 127 (command not found) to the Makefile and
+the build fail.
+
+Ignore the code returned by missing in order to build successfully
+gdb even if makeinfo is not installed on the system.
+
+Fixes:
+http://autobuild.buildroot.net/results/dee/dee1326baf26ad1eb6e12a7d033428eca50d00bc/build-end.log
+
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ gdb/doc/Makefile.in | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in
+index bd30a81..fe276d6 100644
+--- a/gdb/doc/Makefile.in
++++ b/gdb/doc/Makefile.in
+@@ -485,7 +485,7 @@ gdb.pdf: ${GDB_DOC_FILES}
+ # GDB MANUAL: info file
+ gdb.info: ${GDB_DOC_FILES}
+ 	$(MAKEINFO_CMD) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) \
+-		-o gdb.info $(srcdir)/gdb.texinfo
++		-o gdb.info $(srcdir)/gdb.texinfo | true
+ 
+ # GDB MANUAL: roff translations
+ # Try to use a recent texi2roff.  v2 was put on prep in jan91.
+@@ -560,15 +560,15 @@ gdb.mm: $(GDB_DOC_FILES) links2roff
+ # GDB MANUAL: HTML file
+ 
+ gdb/index.html: ${GDB_DOC_FILES}
+-	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo
++	$(MAKEHTML) $(MAKEHTMLFLAGS) $(READLINE_TEXI_INCFLAG) -I ${GDBMI_DIR} -I $(srcdir) $(srcdir)/gdb.texinfo | true
+ 
+ stabs.info: $(STABS_DOC_FILES)
+-	$(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo
++	$(MAKEINFO_CMD) -I $(srcdir) -o stabs.info $(srcdir)/stabs.texinfo | true
+ 
+ # STABS DOCUMENTATION: HTML file
+ 
+ stabs/index.html: $(STABS_DOC_FILES)
+-	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/stabs.texinfo
++	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/stabs.texinfo | true
+ 
+ # Clean these up before each run.  Avoids a catch 22 with not being
+ # able to re-generate these files (to fix a corruption) because these
+@@ -607,10 +607,10 @@ annotate.pdf: $(ANNOTATE_DOC_FILES)
+ 	$(TEXI2DVI) --pdf -I $(srcdir) $(srcdir)/annotate.texinfo
+ 
+ annotate.info: $(ANNOTATE_DOC_FILES)
+-	$(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo
++	$(MAKEINFO_CMD) -I $(srcdir) -o annotate.info $(srcdir)/annotate.texinfo | true
+ 
+ annotate/index.html: $(ANNOTATE_DOC_FILES)
+-	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/annotate.texinfo
++	$(MAKEHTML) $(MAKEHTMLFLAGS) -I $(srcdir) $(srcdir)/annotate.texinfo | true
+ 
+ # Man pages
+ gdb.1: $(GDB_DOC_FILES)
+-- 
+2.4.3
+