public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
@ 2022-09-01  9:51 Tom de Vries
  2022-09-01 14:43 ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2022-09-01  9:51 UTC (permalink / raw)
  To: gdb-patches

Hi,

Currently, we cannot build gdb without makeinfo installed.

It would be convenient to work around this by using the configure flag
MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
configure requires a makeinfo of at least version 4.7, and that version check
fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.

Work around this by adding a script gdb/contrib/makeinfo-dummy.sh that can be
used instead, like so:
...
$ ./src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh
...

The script merely prints the version string that satisfies the version check
in $src/configure.

Tested on x86_64-linux, with makeinfo removed.

Any comments?

Thanks,
- Tom

[gdb/build] Add gdb/contrib/makeinfo-dummy.sh

---
 gdb/contrib/makeinfo-dummy.sh | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gdb/contrib/makeinfo-dummy.sh b/gdb/contrib/makeinfo-dummy.sh
new file mode 100755
index 00000000000..9fed87ed6c6
--- /dev/null
+++ b/gdb/contrib/makeinfo-dummy.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# Copyright (C) 2022 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# This script can be used to build gdb in case makeinfo is not available, like
+# this:
+#
+#   $src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh.
+#
+# It currently does not do anything, so no *.info files are generated, but
+# that doesn't seem to break the build.
+
+if [ "$1" = "--version" ]; then
+    # The version corresponds to the required minimum version as specified in
+    # $src/configure.
+    echo "makeinfo (dummy texinfo) 4.7"
+fi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-01  9:51 [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh Tom de Vries
@ 2022-09-01 14:43 ` Simon Marchi
  2022-09-01 14:58   ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2022-09-01 14:43 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 9/1/22 05:51, Tom de Vries via Gdb-patches wrote:
> Hi,
>
> Currently, we cannot build gdb without makeinfo installed.
>
> It would be convenient to work around this by using the configure flag
> MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
> configure requires a makeinfo of at least version 4.7, and that version check
> fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.
>
> Work around this by adding a script gdb/contrib/makeinfo-dummy.sh that can be
> used instead, like so:
> ...
> $ ./src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh
> ...
>
> The script merely prints the version string that satisfies the version check
> in $src/configure.
>
> Tested on x86_64-linux, with makeinfo removed.
>
> Any comments?

I wouldn't mind having this if it helps you.  This file would probably
belong in $top_level/contrib more than $top_level/gdb/contrib.

Just in case that would work for you, in this case I have been using:

  $ ./configure
  $ make MAKEINFO=/bin/true

and that worked fine so far.

Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-01 14:43 ` Simon Marchi
@ 2022-09-01 14:58   ` Tom de Vries
  2022-09-01 17:21     ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2022-09-01 14:58 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/1/22 16:43, Simon Marchi wrote:
> On 9/1/22 05:51, Tom de Vries via Gdb-patches wrote:
>> Hi,
>>
>> Currently, we cannot build gdb without makeinfo installed.
>>
>> It would be convenient to work around this by using the configure flag
>> MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
>> configure requires a makeinfo of at least version 4.7, and that version check
>> fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.
>>
>> Work around this by adding a script gdb/contrib/makeinfo-dummy.sh that can be
>> used instead, like so:
>> ...
>> $ ./src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh
>> ...
>>
>> The script merely prints the version string that satisfies the version check
>> in $src/configure.
>>
>> Tested on x86_64-linux, with makeinfo removed.
>>
>> Any comments?
> 
> I wouldn't mind having this if it helps you.  This file would probably
> belong in $top_level/contrib more than $top_level/gdb/contrib.
> 

Hi Simon,

thanks for the review.

Agreed, but does that also mean submitting to gcc-patches instead?  All 
the other scripts in <binutils-gdb>/contrib seems to be copies from 
<gcc>/contrib.

> Just in case that would work for you, in this case I have been using:
> 
>    $ ./configure
>    $ make MAKEINFO=/bin/true
> 
> and that worked fine so far.

I see, I suppose that'll work as well, I didn't think of that.

I guess it matters more for me to have a documented way of dealing with 
this, than some specific solution.  I ran into this today, knew I worked 
around this before, but didn't remember how.  I'm hoping that having 
this file in the repo will be something that is easy to find back and  use.

It would be possible to handle 'true' in the toplevel configure, which 
would make configure MAKEINFO=true work, but that would have to go past 
gcc-patches review, and I'm not sure if it's worth the effort to try 
this, given my suspicion that it will not be accepted.

Thanks,
- Tom


Thanks,
- Tom


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-01 14:58   ` Tom de Vries
@ 2022-09-01 17:21     ` Simon Marchi
  2022-09-05 14:10       ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2022-09-01 17:21 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 9/1/22 10:58, Tom de Vries via Gdb-patches wrote:
> On 9/1/22 16:43, Simon Marchi wrote:
>> On 9/1/22 05:51, Tom de Vries via Gdb-patches wrote:
>>> Hi,
>>>
>>> Currently, we cannot build gdb without makeinfo installed.
>>>
>>> It would be convenient to work around this by using the configure flag
>>> MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
>>> configure requires a makeinfo of at least version 4.7, and that version check
>>> fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.
>>>
>>> Work around this by adding a script gdb/contrib/makeinfo-dummy.sh that can be
>>> used instead, like so:
>>> ...
>>> $ ./src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh
>>> ...
>>>
>>> The script merely prints the version string that satisfies the version check
>>> in $src/configure.
>>>
>>> Tested on x86_64-linux, with makeinfo removed.
>>>
>>> Any comments?
>>
>> I wouldn't mind having this if it helps you.  This file would probably
>> belong in $top_level/contrib more than $top_level/gdb/contrib.
>>
>
> Hi Simon,
>
> thanks for the review.
>
> Agreed, but does that also mean submitting to gcc-patches instead?  All the other scripts in <binutils-gdb>/contrib seems to be copies from <gcc>/contrib.

IMO, it would be fine to add a file like this just in binutils-gdb, and
if someone wants it in gcc they can copy it there.  When making changes
to files existing in both repos, then yeah it's better to involve gcc to
so that they stay in sync.

>
>> Just in case that would work for you, in this case I have been using:
>>
>>    $ ./configure
>>    $ make MAKEINFO=/bin/true
>>
>> and that worked fine so far.
>
> I see, I suppose that'll work as well, I didn't think of that.
>
> I guess it matters more for me to have a documented way of dealing with this, than some specific solution.  I ran into this today, knew I worked around this before, but didn't remember how.  I'm hoping that having this file in the repo will be something that is easy to find back and  use.
>
> It would be possible to handle 'true' in the toplevel configure, which would make configure MAKEINFO=true work, but that would have to go past gcc-patches review, and I'm not sure if it's worth the effort to try this, given my suspicion that it will not be accepted.

Also more efforts, but what we would want is a --disable-doc or
--without-makeinfo configure switch, I think.

Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-01 17:21     ` Simon Marchi
@ 2022-09-05 14:10       ` Tom de Vries
  2022-09-20 19:11         ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2022-09-05 14:10 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

On 9/1/22 19:21, Simon Marchi wrote:
> On 9/1/22 10:58, Tom de Vries via Gdb-patches wrote:
>> On 9/1/22 16:43, Simon Marchi wrote:
>>> On 9/1/22 05:51, Tom de Vries via Gdb-patches wrote:
>>>> Hi,
>>>>
>>>> Currently, we cannot build gdb without makeinfo installed.
>>>>
>>>> It would be convenient to work around this by using the configure flag
>>>> MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
>>>> configure requires a makeinfo of at least version 4.7, and that version check
>>>> fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.
>>>>
>>>> Work around this by adding a script gdb/contrib/makeinfo-dummy.sh that can be
>>>> used instead, like so:
>>>> ...
>>>> $ ./src/configure MAKEINFO=$src/gdb/contrib/makeinfo-dummy.sh
>>>> ...
>>>>
>>>> The script merely prints the version string that satisfies the version check
>>>> in $src/configure.
>>>>
>>>> Tested on x86_64-linux, with makeinfo removed.
>>>>
>>>> Any comments?
>>>
>>> I wouldn't mind having this if it helps you.  This file would probably
>>> belong in $top_level/contrib more than $top_level/gdb/contrib.
>>>
>>
>> Hi Simon,
>>
>> thanks for the review.
>>
>> Agreed, but does that also mean submitting to gcc-patches instead?  All the other scripts in <binutils-gdb>/contrib seems to be copies from <gcc>/contrib.
> 
> IMO, it would be fine to add a file like this just in binutils-gdb, and
> if someone wants it in gcc they can copy it there.  When making changes
> to files existing in both repos, then yeah it's better to involve gcc to
> so that they stay in sync.
> 
>>
>>> Just in case that would work for you, in this case I have been using:
>>>
>>>     $ ./configure
>>>     $ make MAKEINFO=/bin/true
>>>
>>> and that worked fine so far.
>>
>> I see, I suppose that'll work as well, I didn't think of that.
>>
>> I guess it matters more for me to have a documented way of dealing with this, than some specific solution.  I ran into this today, knew I worked around this before, but didn't remember how.  I'm hoping that having this file in the repo will be something that is easy to find back and  use.
>>
>> It would be possible to handle 'true' in the toplevel configure, which would make configure MAKEINFO=true work, but that would have to go past gcc-patches review, and I'm not sure if it's worth the effort to try this, given my suspicion that it will not be accepted.
> 
> Also more efforts, but what we would want is a --disable-doc or
> --without-makeinfo configure switch, I think.

I gave the --without-makeinfo a try.

WDYT?

Thanks,
- Tom

[-- Attachment #2: 0001-Add-without-makeinfo.patch --]
[-- Type: text/x-patch, Size: 1944 bytes --]

Add --without-makeinfo

Currently, we cannot build gdb without makeinfo installed.

It would be convenient to work around this by using the configure flag
MAKEINFO=/usr/bin/true or some such, but that doesn't work because top-level
configure requires a makeinfo of at least version 4.7, and that version check
fails for /usr/bin/true, so we end up with MAKEINFO=missing instead.

What does work is this:
...
$ ./configure
$ make MAKEINFO=/usr/bin/true
...
but the drawback is that it'll have to be specified for each make invocation.

Fix this by adding support for --without-makeinfo in top-level configure.

Tested by building gdb on x86_64-linux, and verifying that no .info files
were generated.

ChangeLog:

2022-09-05  Tom de Vries  <tdevries@suse.de>

	* configure.ac: Add --without-makeinfo.
	* configure: Regenerate.

---
 configure    | 4 ++++
 configure.ac | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/configure b/configure
index 16139e3bfa3..66ccef4d8c0 100755
--- a/configure
+++ b/configure
@@ -8386,6 +8386,9 @@ fi
 done
 test -n "$MAKEINFO" || MAKEINFO="$MISSING makeinfo"
 
+if test $with_makeinfo = "no"; then
+MAKEINFO=true
+else
 case " $build_configdirs " in
   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
   *)
@@ -8401,6 +8404,7 @@ case " $build_configdirs " in
     ;;
 
 esac
+fi
 
 # FIXME: expect and dejagnu may become build tools?
 
diff --git a/configure.ac b/configure.ac
index a5555a9c91b..3680fa97087 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3436,6 +3436,9 @@ case " $build_configdirs " in
 esac
 
 AC_CHECK_PROGS([MAKEINFO], makeinfo, [$MISSING makeinfo])
+if test $with_makeinfo = "no"; then
+MAKEINFO=true
+else
 case " $build_configdirs " in
   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
   *)
@@ -3451,6 +3454,7 @@ changequote(,)
     ;;
 changequote([,])
 esac
+fi
 
 # FIXME: expect and dejagnu may become build tools?
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-05 14:10       ` Tom de Vries
@ 2022-09-20 19:11         ` Tom Tromey
  2022-10-04 15:37           ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2022-09-20 19:11 UTC (permalink / raw)
  To: Tom de Vries via Gdb-patches; +Cc: Simon Marchi, Tom de Vries

>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> I gave the --without-makeinfo a try.

Tom> WDYT?

It seems reasonable to me.
FWIW I think there is at least one bug in bugzilla on this topic.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh
  2022-09-20 19:11         ` Tom Tromey
@ 2022-10-04 15:37           ` Tom de Vries
  0 siblings, 0 replies; 7+ messages in thread
From: Tom de Vries @ 2022-10-04 15:37 UTC (permalink / raw)
  To: Tom Tromey, Tom de Vries via Gdb-patches; +Cc: Simon Marchi

On 9/20/22 21:11, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Tom> I gave the --without-makeinfo a try.
> 
> Tom> WDYT?
> 
> It seems reasonable to me.

Thanks for the review.

I've posted it to the gcc ml: 
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602797.html .

> FWIW I think there is at least one bug in bugzilla on this topic.

There's https://sourceware.org/bugzilla/show_bug.cgi?id=14678 which is 
mostly about the GDBvn.texi issue, which should already be fixed by 
commit ab954e4a53c ("Fix building gdb release from tar file without 
makeinfo").

But there's indeed duplicate 
https://sourceware.org/bugzilla/show_bug.cgi?id=20417 which does mention 
--without-makeinfo.

Thanks,
- Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-04 15:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  9:51 [PATCH][gdb/build] Add gdb/contrib/makeinfo-dummy.sh Tom de Vries
2022-09-01 14:43 ` Simon Marchi
2022-09-01 14:58   ` Tom de Vries
2022-09-01 17:21     ` Simon Marchi
2022-09-05 14:10       ` Tom de Vries
2022-09-20 19:11         ` Tom Tromey
2022-10-04 15:37           ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).