[RFC] gdb: add disable-docs option

Message ID 1441532245-23124-1-git-send-email-romain.naour@openwide.fr
State New, archived
Headers

Commit Message

Romain Naour Sept. 6, 2015, 9:37 a.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.

As suggested [1], add a new option to disable the documentation.

[1] http://lists.busybox.net/pipermail/buildroot/2015-September/138824.html

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

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Cc: Yao Qi  <yao.qi@linaro.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
This patch is untested since I can't regenerate the configure script
due to autoconf version mismatch.

configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.
---
 gdb/ChangeLog    | 4 ++++
 gdb/Makefile.in  | 7 ++++++-
 gdb/configure.ac | 7 +++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
  

Comments

Romain Naour Sept. 24, 2015, 8:10 p.m. UTC | #1
Ping.

Best regards,
Romain Naour

Le 06/09/2015 11:37, Romain Naour a écrit :
> 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.
> 
> As suggested [1], add a new option to disable the documentation.
> 
> [1] http://lists.busybox.net/pipermail/buildroot/2015-September/138824.html
> 
> Fixes:
> http://autobuild.buildroot.net/results/dee/dee1326baf26ad1eb6e12a7d033428eca50d00bc/build-end.log
> 
> Signed-off-by: Romain Naour <romain.naour@openwide.fr>
> Cc: Yao Qi  <yao.qi@linaro.org>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> This patch is untested since I can't regenerate the configure script
> due to autoconf version mismatch.
> 
> configure.ac:34: error: Please use exactly Autoconf 2.64 instead of 2.69.
> ---
>  gdb/ChangeLog    | 4 ++++
>  gdb/Makefile.in  | 7 ++++++-
>  gdb/configure.ac | 7 +++++++
>  3 files changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 370980d..900e53f 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,7 @@
> +2015-09-06  Romain Naour <romain.naour@openwide.fr>  (tiny change)
> +
> +	* configure.ac: add disable-docs option
> +
>  2015-09-04  Andrew Burgess  <andrew.burgess@embecosm.com>
>  
>  	* tui/tui-data.c (win_with_focus): Remove cast of NULL pointer.
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 0d7cf97..bfbb6be 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -1089,7 +1089,12 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
>  
>  TSOBS = inflow.o
>  
> -SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
> +SUBDIRS = @subdirs@ data-directory $(GNULIB_BUILDDIR)
> +
> +if INSTALL_DOC
> +SUBDIRS += doc
> +endif
> +
>  CLEANDIRS = $(SUBDIRS)
>  
>  # List of subdirectories in the build tree that must exist.
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 29d0b63..79c370b 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -107,6 +107,13 @@ PACKAGE=gdb
>  AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
>  AC_SUBST(PACKAGE)
>  
> +# Enable/Disable documentation
> +AC_ARG_ENABLE([docs],
> +  [AS_HELP_STRING([--disable-docs],
> +    [disable building of documentation])],
> +  wantdocs=$enableval, wantdocs=yes)
> +AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
> +
>  # We never need to detect it in this sub-configure.
>  # But preserve it for config.status --recheck.
>  AC_ARG_VAR(MAKEINFO,
>
  
Mike Frysinger Sept. 24, 2015, 9:12 p.m. UTC | #2
On 06 Sep 2015 11:37, Romain Naour wrote:
> 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.
> 
> As suggested [1], add a new option to disable the documentation.

aren't info pages shipped as part of the release ?  so even if makeinfo isn't
available, it doesn't matter as the pages aren't regenerated on the user's
system.  maybe you're applying patches to the source that cause the docs to be
regenerated ?  if that's the case, i think disabling the docs entirely is the
wrong way to go.  instead it should be skipping the regeneration step and
installing the pages that already exist.  alternatively, you can adjust your
build to update the timestamps of the generated files so the build won't try
to regenerate them.
-mike
  
Doug Evans Sept. 24, 2015, 9:46 p.m. UTC | #3
On Thu, Sep 24, 2015 at 2:12 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 06 Sep 2015 11:37, Romain Naour wrote:
>> 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.
>>
>> As suggested [1], add a new option to disable the documentation.
>
> aren't info pages shipped as part of the release ?  so even if makeinfo isn't
> available, it doesn't matter as the pages aren't regenerated on the user's
> system.  maybe you're applying patches to the source that cause the docs to be
> regenerated ?  if that's the case, i think disabling the docs entirely is the
> wrong way to go.  instead it should be skipping the regeneration step and
> installing the pages that already exist.  alternatively, you can adjust your
> build to update the timestamps of the generated files so the build won't try
> to regenerate them.
> -mike

Agreed.

Sometimes releases have gone out with bad timestamps which need to be
fixed, but yeah there should be no need to disable doc generation.
  
Romain Naour Sept. 25, 2015, 8:58 a.m. UTC | #4
Hello,

Thanks for your reply!

Le 24/09/2015 23:46, Doug Evans a écrit :
> On Thu, Sep 24, 2015 at 2:12 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> On 06 Sep 2015 11:37, Romain Naour wrote:
>>> 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.
>>>
>>> As suggested [1], add a new option to disable the documentation.
>>
>> aren't info pages shipped as part of the release ?  so even if makeinfo isn't
>> available, it doesn't matter as the pages aren't regenerated on the user's
>> system.  maybe you're applying patches to the source that cause the docs to be
>> regenerated ?  if that's the case, i think disabling the docs entirely is the
>> wrong way to go.  instead it should be skipping the regeneration step and
>> installing the pages that already exist.  alternatively, you can adjust your
>> build to update the timestamps of the generated files so the build won't try
>> to regenerate them.
>> -mike
> 
> Agreed.
> 
> Sometimes releases have gone out with bad timestamps which need to be
> fixed, but yeah there should be no need to disable doc generation.
> 

Actually, I really want to disable the documentation entirely since all
documentation installed by packages (like gdb) are automatically removed from
the generated filesystem at the end of the build (see [1] and [2]).

Until gdb 7.8, ac_cv_prog_MAKEINFO=missing was used to workaround the build
issue when makeinfo was missing. But it's not enough since gdb 7.9.

Best regards,
Romain Naour

[1] http://buildroot.uclibc.org/downloads/manual/manual.html#faq-no-doc-on-target

[2] http://git.buildroot.net/buildroot/tree/Makefile#n559
  
Simon Marchi Sept. 25, 2015, 11:50 a.m. UTC | #5
On 15-09-25 04:58 AM, Romain Naour wrote:
> Hello,
> 
> Thanks for your reply!
> 
> Le 24/09/2015 23:46, Doug Evans a écrit :
>> On Thu, Sep 24, 2015 at 2:12 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>>> On 06 Sep 2015 11:37, Romain Naour wrote:
>>>> 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.
>>>>
>>>> As suggested [1], add a new option to disable the documentation.
>>>
>>> aren't info pages shipped as part of the release ?  so even if makeinfo isn't
>>> available, it doesn't matter as the pages aren't regenerated on the user's
>>> system.  maybe you're applying patches to the source that cause the docs to be
>>> regenerated ?  if that's the case, i think disabling the docs entirely is the
>>> wrong way to go.  instead it should be skipping the regeneration step and
>>> installing the pages that already exist.  alternatively, you can adjust your
>>> build to update the timestamps of the generated files so the build won't try
>>> to regenerate them.
>>> -mike
>>
>> Agreed.
>>
>> Sometimes releases have gone out with bad timestamps which need to be
>> fixed, but yeah there should be no need to disable doc generation.
>>
> 
> Actually, I really want to disable the documentation entirely since all
> documentation installed by packages (like gdb) are automatically removed from
> the generated filesystem at the end of the build (see [1] and [2]).
> 
> Until gdb 7.8, ac_cv_prog_MAKEINFO=missing was used to workaround the build
> issue when makeinfo was missing. But it's not enough since gdb 7.9.
> 
> Best regards,
> Romain Naour
> 
> [1] http://buildroot.uclibc.org/downloads/manual/manual.html#faq-no-doc-on-target
> 
> [2] http://git.buildroot.net/buildroot/tree/Makefile#n559

I don't know if this is acceptable, but I managed to effectively disable building
of the doc by setting MAKEINFO=true (as in /bin/true) during the build.

See http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh
  
Mike Frysinger Sept. 25, 2015, 1:53 p.m. UTC | #6
On 25 Sep 2015 10:58, Romain Naour wrote:
> Le 24/09/2015 23:46, Doug Evans a écrit :
> > On Thu, Sep 24, 2015 at 2:12 PM, Mike Frysinger wrote:
> >> On 06 Sep 2015 11:37, Romain Naour wrote:
> >>> 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.
> >>>
> >>> As suggested [1], add a new option to disable the documentation.
> >>
> >> aren't info pages shipped as part of the release ?  so even if makeinfo isn't
> >> available, it doesn't matter as the pages aren't regenerated on the user's
> >> system.  maybe you're applying patches to the source that cause the docs to be
> >> regenerated ?  if that's the case, i think disabling the docs entirely is the
> >> wrong way to go.  instead it should be skipping the regeneration step and
> >> installing the pages that already exist.  alternatively, you can adjust your
> >> build to update the timestamps of the generated files so the build won't try
> >> to regenerate them.
> > 
> > Agreed.
> > 
> > Sometimes releases have gone out with bad timestamps which need to be
> > fixed, but yeah there should be no need to disable doc generation.
> 
> Actually, I really want to disable the documentation entirely since all
> documentation installed by packages (like gdb) are automatically removed from
> the generated filesystem at the end of the build (see [1] and [2]).

your configure flag only impacts gdb though --  there are other
subdirs (like the binutils related ones) that also install docs.

in Gentoo, when we want to do this, we simply delete the /usr/share/...
dirs, or we set it to a place like --docdir=/nukeme and then rm that.

either way, i'm not sure the additional flags in this case are really
worth the maintenance overhead when installing+deleting after the fact
is trivial.  do you have data to show that the overhead you're saving
is significant ?
-mike
  

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 370980d..900e53f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@ 
+2015-09-06  Romain Naour <romain.naour@openwide.fr>  (tiny change)
+
+	* configure.ac: add disable-docs option
+
 2015-09-04  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* tui/tui-data.c (win_with_focus): Remove cast of NULL pointer.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 0d7cf97..bfbb6be 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1089,7 +1089,12 @@  COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
 
 TSOBS = inflow.o
 
-SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
+SUBDIRS = @subdirs@ data-directory $(GNULIB_BUILDDIR)
+
+if INSTALL_DOC
+SUBDIRS += doc
+endif
+
 CLEANDIRS = $(SUBDIRS)
 
 # List of subdirectories in the build tree that must exist.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 29d0b63..79c370b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -107,6 +107,13 @@  PACKAGE=gdb
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
 AC_SUBST(PACKAGE)
 
+# Enable/Disable documentation
+AC_ARG_ENABLE([docs],
+  [AS_HELP_STRING([--disable-docs],
+    [disable building of documentation])],
+  wantdocs=$enableval, wantdocs=yes)
+AM_CONDITIONAL([INSTALL_DOC], [test "$wantdocs" = "yes"])
+
 # We never need to detect it in this sub-configure.
 # But preserve it for config.status --recheck.
 AC_ARG_VAR(MAKEINFO,