GNU bug report logs - #23599
Including search directories for pdf and dvi

Previous Next

Package: automake;

Reported by: Mohammad Akhlaghi <akhlaghi <at> gnu.org>

Date: Sun, 22 May 2016 18:04:02 UTC

Severity: normal

Tags: confirmed

Done: Mike Frysinger <vapier <at> gentoo.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23599 in the body.
You can then email your comments to 23599 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Sun, 22 May 2016 18:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mohammad Akhlaghi <akhlaghi <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Sun, 22 May 2016 18:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
To: bug-automake <at> gnu.org
Subject: Including search directories for pdf and dvi
Date: Sun, 22 May 2016 19:18:48 +0900
Hello,

In buiding Gnuastro, we are using Gnulib's `build-aux/bootstrap'.

To keep the source files clean, we have configured the bootstrap
process to build all its files and directories in a directory named
"bootstrapped". In the Git repository (link below), this directory is
basically empty (except for a README file) and in the relase tarball
it is populated with all the bootstrapped directories. The general
structure can be seen in the repo on Savannah:

http://git.savannah.gnu.org/cgit/gnuastro.git/tree/

One of the files in Gnulib that can be imported (instead of having to
keep it in the version controlled source) is `fdl.texi' (the Texinfo
source for the GNU Free Documentation license). Until now we have this
file under version control in our `doc/' directory. But since it is
present in the Gnulib archives, I am working on importing it during
the bootstrap process (my current work is not yet merged into the
repository yet).

The bootstrapping process puts the file in
`bootstrapped/doc/fdl.texi'. So I have included the following line in
my `doc/Makefile.am':

   AM_MAKEINFOFLAGS = -I $(top_srcdir)/bootstrapped/doc

This works for `make' (to build Info files) and also for `make
html'. However, when I run `make pdf', or `make dvi', it complains
about not finding `fdl.texi'.

Looking at Automake's generated `.texi.dvi', or `.texi.pdf' rules in
`Makefile.in', I see that the `AM_MAKEINFOFLAGS' is not given to
`texi2dvi'. It is set in the `MAKEINFO' variable before calling
`texi2dvi'. Therefore `texi2dvi' isn't instructed look into this
directory and thus it can't generate the pdf or dvi outputs. When I
add this line by hand in the final Makefile's rule, it works and finds
the directory.

I currently have a workaround for this problem (copying or making a
symbolic link from the `bootstrapped/doc/fdl.texi' to the
`doc/fdl.texi' during the bootstrap process), however, this is not
elegant! This file is a bootstrapped file and it would be much better
and clear if it remains with the other bootstrapped files.

If I am doing something wrong or missing something, I would really
appreciate it if you could let me know.  Since the `AM_MAKEINFOFLAGS'
solution works in making Info and HTML outputs for this situation, but
not in pdf or dvi outputs, I thought it might be a bug and I am
sharing it with you here to see if you agree and if it is possible to
fix this problem.

Thank you very much,
Mohammad




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 23 May 2016 01:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Mon, 23 May 2016 03:08:19 +0200
Hello,

Mohammad Akhlaghi <akhlaghi <at> gnu.org> writes:

> I currently have a workaround for this problem (copying or making a
> symbolic link from the `bootstrapped/doc/fdl.texi' to the
> `doc/fdl.texi' during the bootstrap process), however, this is not
> elegant! This file is a bootstrapped file and it would be much better
> and clear if it remains with the other bootstrapped files.
>
> If I am doing something wrong or missing something, I would really
> appreciate it if you could let me know.  Since the `AM_MAKEINFOFLAGS'
> solution works in making Info and HTML outputs for this situation, but
> not in pdf or dvi outputs, I thought it might be a bug and I am
> sharing it with you here to see if you agree and if it is possible to
> fix this problem.

I haved faced the same type of problem when trying to include a texi
fragment generated at configure time in "$(top_builddir)/doc" and
setting 'AM_MAKEINFOFLAGS = -I doc'.  My ugly workaround is to override
TEXI2DVI variable like this:

  TEXI2DVI = texi2dvi -I doc

After a quick look at $(datadir)/automake-1.15/am/texibuild.am' and
'$(bindir)/texi2dvi', my guess is that 'texi2dvi' no longer handles
passing arguments via the MAKEINFO shell variable, which is the way
Automake passes AM_MAKEINFOFLAGS content to it.

Thanks for reporting this issue.

-- 
Mathieu Lirzin




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 23 May 2016 04:35:02 GMT) Full text and rfc822 format available.

Message #11 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Mon, 23 May 2016 13:34:41 +0900
Hi Mathieu,

Thank you very much for the prompt answer.

On 05/23/2016 10:08 AM, Mathieu Lirzin wrote:
> Hello,
>
> Mohammad Akhlaghi <akhlaghi <at> gnu.org> writes:
>
>> I currently have a workaround for this problem (copying or making a
>> symbolic link from the `bootstrapped/doc/fdl.texi' to the
>> `doc/fdl.texi' during the bootstrap process), however, this is not
>> elegant! This file is a bootstrapped file and it would be much better
>> and clear if it remains with the other bootstrapped files.
>>
>> If I am doing something wrong or missing something, I would really
>> appreciate it if you could let me know.  Since the `AM_MAKEINFOFLAGS'
>> solution works in making Info and HTML outputs for this situation, but
>> not in pdf or dvi outputs, I thought it might be a bug and I am
>> sharing it with you here to see if you agree and if it is possible to
>> fix this problem.
>
> I haved faced the same type of problem when trying to include a texi
> fragment generated at configure time in "$(top_builddir)/doc" and
> setting 'AM_MAKEINFOFLAGS = -I doc'.  My ugly workaround is to override
> TEXI2DVI variable like this:
>
>   TEXI2DVI = texi2dvi -I doc
>
> After a quick look at $(datadir)/automake-1.15/am/texibuild.am' and
> '$(bindir)/texi2dvi', my guess is that 'texi2dvi' no longer handles
> passing arguments via the MAKEINFO shell variable, which is the way
> Automake passes AM_MAKEINFOFLAGS content to it.
>
> Thanks for reporting this issue.

Your solution is indeed much better than mine. It would be great if 
Automake could account for the change in texi2dvi's behavior (not 
handling arguments through the MAKEINFO shell variable).

I added a TEXI2DVI definition in my doc/Makefile.am, but I get the 
following error when running autoreconf (or automake independently):

  automake: warnings are treated as errors
  doc/Makefile.am:36: warning: user variable 'TEXI2DVI' defined here ...
  /usr/share/automake-1.15/am/texinfos.am: ... overrides Automake
  variable 'TEXI2DVI' defined here
  autoreconf: automake failed with exit status: 1

This is strange, because according to the Automake manual: "a variable 
defined in ‘Makefile.am’ or ‘AC_SUBST’ed from ‘configure.ac’ will 
override any definition of the variable that ‘automake’ would ordinarily 
create."

Thank you very much,
Mohammad




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 23 May 2016 11:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Lirzin <mthl <at> gnu.org>
To: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Mon, 23 May 2016 13:50:35 +0200
Mohammad Akhlaghi <akhlaghi <at> gnu.org> writes:

> Your solution is indeed much better than mine. It would be great if
> Automake could account for the change in texi2dvi's behavior (not
> handling arguments through the MAKEINFO shell variable).

I agree.  Fixing the issue seems not trivial because it will require not
breaking backward compatibility with older version of Texinfo.

> I added a TEXI2DVI definition in my doc/Makefile.am, but I get the
> following error when running autoreconf (or automake independently):
>
>   automake: warnings are treated as errors
>   doc/Makefile.am:36: warning: user variable 'TEXI2DVI' defined here ...
>   /usr/share/automake-1.15/am/texinfos.am: ... overrides Automake
>   variable 'TEXI2DVI' defined here
>   autoreconf: automake failed with exit status: 1
>
> This is strange, because according to the Automake manual: "a variable
> defined in ‘Makefile.am’ or ‘AC_SUBST’ed from ‘configure.ac’ will
> override any definition of the variable that ‘automake’ would
> ordinarily create."

This is normally just a warning.  It is treated as an error because you
are using "-Werror" in automake options.  To remove this error you can
add "-Wno-override".

Thanks.

-- 
Mathieu Lirzin




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 23 May 2016 12:28:01 GMT) Full text and rfc822 format available.

Message #17 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
To: Mathieu Lirzin <mthl <at> gnu.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Mon, 23 May 2016 21:27:28 +0900
On 05/23/2016 08:50 PM, Mathieu Lirzin wrote:

> This is normally just a warning.  It is treated as an error because you
> are using "-Werror" in automake options.  To remove this error you can
> add "-Wno-override".

That is correct, I had forgot the Automake options in `configure.ac'!

Thanks a lot for the great and prompt help,
Mohammad




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Fri, 21 Jan 2022 08:31:02 GMT) Full text and rfc822 format available.

Message #20 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Karl Berry <karl <at> freefriends.org>
Cc: Mohammad Akhlaghi <akhlaghi <at> gnu.org>, Mathieu Lirzin <mthl <at> gnu.org>,
 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Fri, 21 Jan 2022 08:30:31 +0000 (UTC)
tag 23599 = confirmed
thankyou

On Mon, 23 May 2016 03:08:19 +0200, Mathieu Lirzin wrote:
> Mohammad Akhlaghi <akhlaghi <at> gnu.org> writes:
> > I currently have a workaround for this problem (copying or making a
> > symbolic link from the `bootstrapped/doc/fdl.texi' to the
> > `doc/fdl.texi' during the bootstrap process), however, this is not
> > elegant! This file is a bootstrapped file and it would be much better
> > and clear if it remains with the other bootstrapped files.
> >
> > If I am doing something wrong or missing something, I would really
> > appreciate it if you could let me know.  Since the `AM_MAKEINFOFLAGS'
> > solution works in making Info and HTML outputs for this situation, but
> > not in pdf or dvi outputs, I thought it might be a bug and I am
> > sharing it with you here to see if you agree and if it is possible to
> > fix this problem.
>
> I haved faced the same type of problem when trying to include a texi
> fragment generated at configure time in "$(top_builddir)/doc" and
> setting 'AM_MAKEINFOFLAGS = -I doc'.  My ugly workaround is to override
> TEXI2DVI variable like this:
>
>   TEXI2DVI = texi2dvi -I doc
>
> After a quick look at $(datadir)/automake-1.15/am/texibuild.am' and
> '$(bindir)/texi2dvi', my guess is that 'texi2dvi' no longer handles
> passing arguments via the MAKEINFO shell variable, which is the way
> Automake passes AM_MAKEINFOFLAGS content to it.

looking at texi2dvi, it's had this behavior for a very long time.  the 4.3
release from Nov 2002 behaves this way.  not sure i can find history for
older releases.

util/texi2dvi:
  # Unless required by the user, makeinfo expansion is wanted only
  # if texinfo.tex is too old.
  if $expand; then
    makeinfo=${MAKEINFO:-makeinfo}
  else

that tip indicates perhaps an easy way out of this ... if we just add -E
to the texi2dvi call, it forces makeinfo (and its flags) to be used.

Karl: i see your name all over the texinfo history :).  any opinion ?
-mike




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Sat, 22 Jan 2022 02:34:01 GMT) Full text and rfc822 format available.

Message #23 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org, akhlaghi <at> gnu.org, 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Fri, 21 Jan 2022 19:33:43 -0700
    perhaps an easy way out of this ... if we just add -E
    to the texi2dvi call, it forces makeinfo (and its flags) to be used.

Using -E is not desirable nowadays, it has myriad possibilities for
affecting the output in bad/unpredictable ways.

_e used to be the way to support @macro. I surmise Automake used to
always use this, hence AM_MAKEINFOFLAGS would get propagated there. 

I don't think the MAKEINFO envvar was ever used in the part of texi2dvi
that calls TeX. I'm not sure it even applies to current makeinfo.

I'm not exactly sure what the right solution is. If we can supporting
pass arguments (as in -I doc) to texi2dvi somehow (aka some new variable
AM_TEXI2DVIFLAGS I guess -- should also apply to texi2pdf), that should
work out. I don't think we could/should make AM_MAKEINFOFLAGS apply to
texi2dvi/2pdf invocations, since many makeinfo options don't apply to
texi2dvi.

Overriding TEXI2DVI does not seem all that bad to me either ... -k




Added tag(s) confirmed. Request was from Mike Frysinger <vapier <at> gentoo.org> to control <at> debbugs.gnu.org. (Sat, 22 Jan 2022 05:00:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Sat, 22 Jan 2022 20:26:01 GMT) Full text and rfc822 format available.

Message #28 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Karl Berry <karl <at> freefriends.org>
Cc: akhlaghi <at> gnu.org, 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Sat, 22 Jan 2022 15:24:57 -0500
[Message part 1 (text/plain, inline)]
On 21 Jan 2022 19:33, Karl Berry wrote:
>     perhaps an easy way out of this ... if we just add -E
>     to the texi2dvi call, it forces makeinfo (and its flags) to be used.
> 
> Using -E is not desirable nowadays, it has myriad possibilities for
> affecting the output in bad/unpredictable ways.
> 
> _e used to be the way to support @macro. I surmise Automake used to
> always use this, hence AM_MAKEINFOFLAGS would get propagated there. 
> 
> I don't think the MAKEINFO envvar was ever used in the part of texi2dvi
> that calls TeX. I'm not sure it even applies to current makeinfo.
> 
> I'm not exactly sure what the right solution is. If we can supporting
> pass arguments (as in -I doc) to texi2dvi somehow (aka some new variable
> AM_TEXI2DVIFLAGS I guess -- should also apply to texi2pdf), that should
> work out. I don't think we could/should make AM_MAKEINFOFLAGS apply to
> texi2dvi/2pdf invocations, since many makeinfo options don't apply to
> texi2dvi.
> 
> Overriding TEXI2DVI does not seem all that bad to me either ...

what i dislike about forcing people to set TEXI2DVI is that it does not scale.
i came across this bug myself when converting newlib from recursive makes to a
single top-level makefile.  there are 2 subdirs, libm & libc, and each has a
manual, and each needs -I set to their own subdir.  so i'd have to:
TEXI2DVI = texi2dvi -I libc -I libm
and then hope each one doesn't otherwise use conflicting names.

in the original report here, and in my case, the issue could be distilled down
to the fact that makeinfo automatically includes -I flags to the subdir that
the files live in.  since it's libc/libc.texi, i get -I libc for free.  hence
my info targets generate fine without extra work.  so if i use the -e option:
TEXI2DVI = texi2dvi -e
the automatic -I flags from makeinfo get passed through and now pdfs work.

so if you say we should avoid -e because it has other side-effects, i think we
need to provide fallbacks, and smooth the default over in the process.
* provide AM_TEXI2FLAGS to apply to both texi2dvi & texi2pdf calls
  - i don't think we need sep AM_TEXI2DVIFLAGS & AM_TEXI2PDFFLAGS, at least
    for now.  if a request comes in, we can support both easily.
* update the lib/am/texibuild.am .dvi & .pdf rules to output automatic -I paths
  just like we do for makeinfo
* i guess delete the MAKEINFO= env var passing to texi2dvi & texi2pdf ?  if we
  don't want it to be used, prob best to throw it away to avoid confusion.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Sat, 22 Jan 2022 21:44:02 GMT) Full text and rfc822 format available.

Message #31 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org, 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Sat, 22 Jan 2022 14:43:57 -0700
    TEXI2DVI = texi2dvi -I libc -I libm

Couldn't it be set in each directory individually?
But anyway, agreed it is not the best approach, so never mind.

    TEXI2DVI = texi2dvi -e

Just for the record: -E, not -e.

    * provide AM_TEXI2FLAGS to apply to both texi2dvi & texi2pdf calls

Good idea.


      - i don't think we need sep AM_TEXI2DVIFLAGS & AM_TEXI2PDFFLAGS, at least
        for now.  if a request comes in, we can support both easily.

Agreed.

    * update the lib/am/texibuild.am .dvi & .pdf rules to output
    automatic -I paths just like we do for makeinfo

Sounds sensible.

    * i guess delete the MAKEINFO= env var passing to texi2dvi &
      texi2pdf ?  if we don't want it to be used, prob best to throw it
      away to avoid confusion.

Oh, looking again, I see the confusion: texi2dvi does use $MAKEINFO --
not jut for "options" to be passed to it, but as the invocation
of the makeinfo program. As in:

texi2dvi:1193:    makeinfo=${MAKEINFO:-makeinfo}
..
texi2dvi:1243:      | eval $makeinfo --footnote-style=end -I "$in_dir" $run_mi_includes \

So it is not ignored. --thanks,karl.




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Sun, 23 Jan 2022 02:07:02 GMT) Full text and rfc822 format available.

Message #34 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Karl Berry <karl <at> freefriends.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Sat, 22 Jan 2022 21:06:49 -0500
[Message part 1 (text/plain, inline)]
On 22 Jan 2022 14:43, Karl Berry wrote:
>     TEXI2DVI = texi2dvi -I libc -I libm
> 
> Couldn't it be set in each directory individually?

there is no subdir makefile.
newlib/Makefile:
TEXI2DVI = ...common setting...
include libc/local.mk
include libm/local.mk

libc/local.mk:
info_TEXINFOS += %D%/libc.texi
%C%_libc_TEXINFOS = ...

libm/local.mk:
info_TEXINFOS += %D%/libm.texi
%C%_libm_TEXINFOS = ...

the point is to avoid recursive makes to speed things up, so the variable
namespace is flat, and there currently afaict is no support for per-target
commands or flags.  i.e. this doesn't work:
info_TEXINFOS = libc.texi
libc_TEXINFOS = ...
libc_TEXI2DVI = ...       <- doesn't work
libc_MAKEINFOFLAGS = ...  <- doesn't work

>     * i guess delete the MAKEINFO= env var passing to texi2dvi &
>       texi2pdf ?  if we don't want it to be used, prob best to throw it
>       away to avoid confusion.
> 
> Oh, looking again, I see the confusion: texi2dvi does use $MAKEINFO --
> not jut for "options" to be passed to it, but as the invocation
> of the makeinfo program. As in:
> 
> texi2dvi:1193:    makeinfo=${MAKEINFO:-makeinfo}
> ..
> texi2dvi:1243:      | eval $makeinfo --footnote-style=end -I "$in_dir" $run_mi_includes \
> 
> So it is not ignored.

that's the -E (expand) code path :).  if expand isn't set, makeinfo isn't
set, so that eval wouldn't be run.  that said, the expand code path also
runs if it thinks tex is broken and doesn't expand correctly.  so i guess
if we want to keep that working, we'll want to pass the settings down.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 24 Jan 2022 08:11:02 GMT) Full text and rfc822 format available.

Message #37 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: 23599 <at> debbugs.gnu.org
Subject: [PATCH 1/2] texi: pass automatic -I to dvi & pdf generation
Date: Mon, 24 Jan 2022 03:10:06 -0500
Fixes automake bug https://bugs.gnu.org/23599.

When generating info/html pages, automake adds -I flags to source
dirs that contain the texi files, but it doesn't do this for dvi or
pdf formats.  Instead, automake has been relying on texi2dvi to use
makeinfo for expanding macros, and it hasn't done that by default in
a long time.

Since adding --expand to the texi2dvi call is undesirable (due to bad
and unpredictable BEHAVIOR), pass those automatic -I flags directly
to TEXI2DVI & TEXI2PDF so they work regardless of --expand behavior.

We have to keep the MAKEINFO= setting around as texi2dvi might itself
fall back to it if the version of tex is old or broken.

* bin/automake.in: Add comment about $makeinfoflags usage.
* lib/am/texibuild.am: Pass %MAKEINFOFLAGS% to TEXI2DVI & TEXI2PDF.
---
 bin/automake.in     |  4 ++++
 lib/am/texibuild.am | 12 ++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/bin/automake.in b/bin/automake.in
index 28e0fe67233b..e0fba69c47e3 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3131,6 +3131,10 @@ sub output_texinfo_build_rules
   # but just remember that some logic deeper in Automake will not
   # output the same rule twice); while the later need to be output for
   # each Texinfo source.
+  #
+  # NB: The makeinfoflags is currently passed to makeinfo and texi2dvi, so
+  # make sure that it only utilizes compatible flags.  Best to stick to -I.
+  # Changing this requires updating lib/am/texibuild.am.
   my $generic;
   my $makeinfoflags;
   my $sdir = dirname $source;
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index e3d63087a4f9..3f3f00d58df2 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -63,7 +63,9 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
 	%AM_V_TEXI2DVI%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
+## texi2dvi automatically fallsback to using makeinfo for expanding (-E).
+## If texi2dvi doesn't fallback, we also pass %MAKEINFOFLAGS% directly below.
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
@@ -74,7 +76,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfop bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+	$(TEXI2DVI) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
@@ -82,7 +84,9 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
 	%AM_V_TEXI2PDF%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
+## texi2dvi automatically fallsback to using makeinfo for expanding (-E).
+## If texi2dvi doesn't fallback, we also pass %MAKEINFOFLAGS% directly below.
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
@@ -93,7 +97,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfop bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+	$(TEXI2PDF) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
-- 
2.34.1





Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Mon, 24 Jan 2022 08:11:02 GMT) Full text and rfc822 format available.

Message #40 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: 23599 <at> debbugs.gnu.org
Subject: [PATCH 2/2] texi: define new AM_TEXI2FLAGS variable
Date: Mon, 24 Jan 2022 03:10:07 -0500
To provide a bit more flexibility when invoking TEXI2DVI & TEXI2PDF,
and provide a bit of symmetry with .info & .html generation, provide
a AM_TEXI2FLAGS setting that is passed to all TEXI2xxx invocations.

* doc/automake.texi: Mention new AM_TEXI2FLAGS setting.
* lib/am/texibuild.am: Pass $(AM_TEXI2FLAGS) to TEXI2DVI & TEXI2PDF.
---
 doc/automake.texi   | 6 ++++--
 lib/am/texibuild.am | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/doc/automake.texi b/doc/automake.texi
index 9916a41d4b79..d4b0d133a0dd 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8143,12 +8143,14 @@ users to pass extra flags to suit their needs.
 
 @item AM_MAKEINFOFLAGS
 @itemx AM_MAKEINFOHTMLFLAGS
+@itemx AM_TEXI2FLAGS
 Maintainer flags passed to each @command{makeinfo} invocation.  Unlike
 @code{MAKEINFOFLAGS}, these variables are meant to be defined by
 maintainers in @file{Makefile.am}.  @samp{$(AM_MAKEINFOFLAGS)} is
-passed to @code{makeinfo} when building @file{.info} files; and
+passed to @code{makeinfo} when building @file{.info} files;
 @samp{$(AM_MAKEINFOHTMLFLAGS)} is used when building @file{.html}
-files.
+files; and @samp{$(AM_TEXI2FLAGS)} is used when building @file{.dvi} and
+@file{.pdf} files.
 
 @c Keep in sync with txinfo-many-output-formats.sh
 For instance, the following setting can be used to obtain one single
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index 3f3f00d58df2..95d628df40d2 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -76,7 +76,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfop bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2DVI) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+	$(TEXI2DVI) $(AM_TEXI2FLAGS) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
@@ -97,7 +97,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfop bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2PDF) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+	$(TEXI2PDF) $(AM_TEXI2FLAGS) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
-- 
2.34.1





Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 02:51:01 GMT) Full text and rfc822 format available.

Message #43 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: [PATCH 1/2] texi: pass automatic -I to dvi & pdf
 generation
Date: Wed, 26 Jan 2022 19:50:56 -0700
    +## texi2dvi automatically fallsback to using makeinfo for expanding (-E).

s/fallsback/falls back/

    +## If texi2dvi doesn't fallback, we also pass %MAKEINFOFLAGS% directly below.

s/fallback/fall back/

    +## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
    +## texi2dvi automatically fallsback to using makeinfo for expanding (-E).
    +## If texi2dvi doesn't fallback, we also pass %MAKEINFOFLAGS% directly below.

Doesn't seem like the same comment should be written twice.

    ## avoid hitting a Texinfop bug that could cause low-probability racy

s/Texinfop/Texinfo/
(Not your text, but might as well fix as long as you're there)

Anyway, seems fine to me, but maybe needs test case? --thanks, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 02:52:01 GMT) Full text and rfc822 format available.

Message #46 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: [PATCH 2/2] texi: define new AM_TEXI2FLAGS variable
Date: Wed, 26 Jan 2022 19:50:57 -0700
I don't really understand why this patch is in two parts, with seemingly
the same change, but whatever, doesn't matter.
    
    * doc/automake.texi: Mention new AM_TEXI2FLAGS setting.
    * lib/am/texibuild.am: Pass $(AM_TEXI2FLAGS) to TEXI2DVI & TEXI2PDF.

1) Maybe something should be said about the -I propagation/restriction?
I have to admit I don't see where in your changes the -I comes into
play, other than being stated in the comments.

2) Needs NEWS entry. --thanks, karl.




Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 07:43:02 GMT) Full text and rfc822 format available.

Message #49 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Karl Berry <karl <at> freefriends.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: [PATCH 1/2] texi: pass automatic -I to dvi & pdf
 generation
Date: Thu, 27 Jan 2022 02:42:17 -0500
[Message part 1 (text/plain, inline)]
On 26 Jan 2022 19:50, Karl Berry wrote:
>     +## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
>     +## texi2dvi automatically fallsback to using makeinfo for expanding (-E).
>     +## If texi2dvi doesn't fallback, we also pass %MAKEINFOFLAGS% directly below.
> 
> Doesn't seem like the same comment should be written twice.

this is following the existing style where the .dvi & .pdf blocks are exactly
the same other change s/dvi/pdf/.  that includes the large comment blocks.
do you want all of the .pdf comments removed ?

> Anyway, seems fine to me, but maybe needs test case?

seems like flag checks in this space are missing for all types
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 07:57:02 GMT) Full text and rfc822 format available.

Message #52 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Karl Berry <karl <at> freefriends.org>
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: [PATCH 2/2] texi: define new AM_TEXI2FLAGS variable
Date: Thu, 27 Jan 2022 02:56:01 -0500
[Message part 1 (text/plain, inline)]
On 26 Jan 2022 19:50, Karl Berry wrote:
> I don't really understand why this patch is in two parts, with seemingly
> the same change, but whatever, doesn't matter.

they're logically independent things.  one fixes a bug by adding -I paths,
the other is a nice-to-have new feature.

>     * doc/automake.texi: Mention new AM_TEXI2FLAGS setting.
>     * lib/am/texibuild.am: Pass $(AM_TEXI2FLAGS) to TEXI2DVI & TEXI2PDF.
> 
> 1) Maybe something should be said about the -I propagation/restriction?

the manual doesn't have that info today about even the makeinfo step.
the existing Texinfo chapter doesn't appear to be well organized, just
a random collection of facts, so i can another paragraph in there.

> I have to admit I don't see where in your changes the -I comes into
> play, other than being stated in the comments.

the -I change isn't relevant to this patch.  this one is about letting
people pass extra flags to the tex2dvi/texi2pdf steps like we already
have with the makeinfo steps.
-mike
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 08:14:01 GMT) Full text and rfc822 format available.

Message #55 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: 23599 <at> debbugs.gnu.org
Subject: [PATCH 1/2 v2] texi: pass automatic -I to dvi & pdf generation
Date: Thu, 27 Jan 2022 03:12:50 -0500
Fixes automake bug https://bugs.gnu.org/23599.

When generating info/html pages, automake adds -I flags to source
dirs that contain the texi files, but it doesn't do this for dvi or
pdf formats.  Instead, automake has been relying on texi2dvi to use
makeinfo for expanding macros, and it hasn't done that by default in
a long time.

Since adding --expand to the texi2dvi call is undesirable (due to bad
and unpredictable BEHAVIOR), pass those automatic -I flags directly
to TEXI2DVI & TEXI2PDF so they work regardless of --expand behavior.

We have to keep the MAKEINFO= setting around as texi2dvi might itself
fall back to it if the version of tex is old or broken.

* bin/automake.in: Add comment about $makeinfoflags usage.
* doc/automake.texi: Mention automatic -I subdir flags.
* lib/am/texibuild.am: Pass %MAKEINFOFLAGS% to TEXI2DVI & TEXI2PDF.
* t/txinfo-subdir-pr343.sh: Check for -I subdir usage.
---
 bin/automake.in          |  4 ++++
 doc/automake.texi        |  5 +++++
 lib/am/texibuild.am      | 16 ++++++++++------
 t/txinfo-subdir-pr343.sh |  5 +++++
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/bin/automake.in b/bin/automake.in
index 58b589495e39..6d55884023cd 100644
--- a/bin/automake.in
+++ b/bin/automake.in
@@ -3135,6 +3135,10 @@ sub output_texinfo_build_rules
   # but just remember that some logic deeper in Automake will not
   # output the same rule twice); while the later need to be output for
   # each Texinfo source.
+  #
+  # NB: The makeinfoflags is currently passed to makeinfo and texi2dvi, so
+  # make sure that it only utilizes compatible flags.  Best to stick to -I.
+  # Changing this requires updating lib/am/texibuild.am.
   my $generic;
   my $makeinfoflags;
   my $sdir = dirname $source;
diff --git a/doc/automake.texi b/doc/automake.texi
index 67827cf8698a..c94b9f528c11 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8012,6 +8012,11 @@ the generated @file{.info} files are by default placed in @code{srcdir}
 rather than in the @code{builddir}.  This can be changed with the
 @option{info-in-builddir} option.
 
+If the Texinfo sources are in a subdirectory relative to the Makefile, then
+@code{-I} flags for the subdirectory, both in the source directory and in the
+build directory, will automatically be added.  There is no need to specify
+these in @samp{$(MAKEINFO)}, @samp{$(MAKEINFOFLAGS)}, etc...
+
 @trindex dvi
 @trindex html
 @trindex pdf
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index e3d63087a4f9..c9c4f92d82cb 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -63,7 +63,9 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
 	%AM_V_TEXI2DVI%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
+## texi2dvi automatically falls back to using makeinfo for expanding (-E).
+## If texi2dvi doesn't fall back, we also pass %MAKEINFOFLAGS% directly below.
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
@@ -71,10 +73,10 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## by-products are left in there, instead of cluttering the current
 ## directory (see automake bug#11146).  Use a different build-dir for
 ## each file (and distinct from that of the corresponding PDF file) to
-## avoid hitting a Texinfop bug that could cause low-probability racy
+## avoid hitting a Texinfo bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+	$(TEXI2DVI) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
@@ -82,7 +84,9 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
 	%AM_V_TEXI2PDF%TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
 ## Must set MAKEINFO like this so that version.texi will be found even
-## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
+## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%), and in case
+## texi2dvi automatically falls back to using makeinfo for expanding (-E).
+## If texi2dvi doesn't fall back, we also pass %MAKEINFOFLAGS% directly below.
 	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
 ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
@@ -90,10 +94,10 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## by-products are left in there, instead of cluttering the current
 ## directory (see automake bug#11146).  Use a different build-dir for
 ## each file (and distinct from that of the corresponding DVI file) to
-## avoid hitting a Texinfop bug that could cause low-probability racy
+## avoid hitting a Texinfo bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+	$(TEXI2PDF) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
diff --git a/t/txinfo-subdir-pr343.sh b/t/txinfo-subdir-pr343.sh
index 625a4faa7f89..085d53e2ba29 100644
--- a/t/txinfo-subdir-pr343.sh
+++ b/t/txinfo-subdir-pr343.sh
@@ -57,4 +57,9 @@ $MAKE distcheck
 test -f ../subdir/main.info
 test ! -e subdir/main.info
 
+# Make sure automatic -I flags were added for the subdir.
+grep '\$(MAKEINFO).* -I subdir ' ../Makefile.in
+grep '\$(TEXI2DVI).* -I subdir ' ../Makefile.in
+grep '\$(TEXI2PDF).* -I subdir ' ../Makefile.in
+
 :
-- 
2.34.1





Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 08:14:02 GMT) Full text and rfc822 format available.

Message #58 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: 23599 <at> debbugs.gnu.org
Subject: [PATCH 2/2 v2] texi: define new AM_TEXI2FLAGS variable
Date: Thu, 27 Jan 2022 03:12:51 -0500
To provide a bit more flexibility when invoking TEXI2DVI & TEXI2PDF,
and provide a bit of symmetry with .info & .html generation, provide
a AM_TEXI2FLAGS setting that is passed to all TEXI2xxx invocations.

* doc/automake.texi: Mention new AM_TEXI2FLAGS setting.
* lib/am/texibuild.am: Pass $(AM_TEXI2FLAGS) to TEXI2DVI & TEXI2PDF.
* NEWS: Mention AM_TEXI2FLAGS.
* t/txinfo-many-output-formats.sh: Check for AM_TEXI2FLAGS.
---
 NEWS                            | 2 ++
 doc/automake.texi               | 6 ++++--
 lib/am/texibuild.am             | 4 ++--
 t/txinfo-many-output-formats.sh | 4 ++++
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 57fd4275b8a7..f40860507707 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ New in 1.17:
   - AM_PATH_PYTHON will also search for Python versions 3.10 - 3.15.  It has
     previously searched for 3.0 - 3.9.
 
+  - AM_TEXI2FLAGS may be defined to pass extra flags to TEXI2DVI & TEXI2PDF.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 New in 1.16.5:
diff --git a/doc/automake.texi b/doc/automake.texi
index c94b9f528c11..df2b46dfaa12 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8153,12 +8153,14 @@ users to pass extra flags to suit their needs.
 
 @item AM_MAKEINFOFLAGS
 @itemx AM_MAKEINFOHTMLFLAGS
+@itemx AM_TEXI2FLAGS
 Maintainer flags passed to each @command{makeinfo} invocation.  Unlike
 @code{MAKEINFOFLAGS}, these variables are meant to be defined by
 maintainers in @file{Makefile.am}.  @samp{$(AM_MAKEINFOFLAGS)} is
-passed to @code{makeinfo} when building @file{.info} files; and
+passed to @code{makeinfo} when building @file{.info} files;
 @samp{$(AM_MAKEINFOHTMLFLAGS)} is used when building @file{.html}
-files.
+files; and @samp{$(AM_TEXI2FLAGS)} is used when building @file{.dvi} and
+@file{.pdf} files.
 
 @c Keep in sync with txinfo-many-output-formats.sh
 For instance, the following setting can be used to obtain one single
diff --git a/lib/am/texibuild.am b/lib/am/texibuild.am
index c9c4f92d82cb..43e69d7b94ea 100644
--- a/lib/am/texibuild.am
+++ b/lib/am/texibuild.am
@@ -76,7 +76,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfo bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2DVI) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+	$(TEXI2DVI) $(AM_TEXI2FLAGS) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
@@ -97,7 +97,7 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## avoid hitting a Texinfo bug that could cause low-probability racy
 ## failure when doing parallel builds; see:
 ## https://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
-	$(TEXI2PDF) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+	$(TEXI2PDF) $(AM_TEXI2FLAGS) %MAKEINFOFLAGS% %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
 ?GENERIC?	%SOURCE%
 ?!GENERIC?	`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
 
diff --git a/t/txinfo-many-output-formats.sh b/t/txinfo-many-output-formats.sh
index a5f795c2cc63..9903d4ef875e 100644
--- a/t/txinfo-many-output-formats.sh
+++ b/t/txinfo-many-output-formats.sh
@@ -86,6 +86,10 @@ $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
+# Make sure AM_TEXI2FLAGS is passed down.
+grep '\$(TEXI2DVI).*\$(AM_TEXI2FLAGS)' Makefile.in
+grep '\$(TEXI2PDF).*\$(AM_TEXI2FLAGS)' Makefile.in
+
 # To simplify syncing with sister test 'txinfo-many-output-formats.sh'
 srcdir=.
 
-- 
2.34.1





Information forwarded to bug-automake <at> gnu.org:
bug#23599; Package automake. (Thu, 27 Jan 2022 22:22:01 GMT) Full text and rfc822 format available.

Message #61 received at 23599 <at> debbugs.gnu.org (full text, mbox):

From: Karl Berry <karl <at> freefriends.org>
To: vapier <at> gentoo.org
Cc: 23599 <at> debbugs.gnu.org
Subject: Re: bug#23599: [PATCH 1/2] texi: pass automatic -I to dvi & pdf
 generation
Date: Thu, 27 Jan 2022 15:21:45 -0700
    this is following the existing style where the .dvi & .pdf blocks are exactly
    the same other change s/dvi/pdf/.  that includes the large comment blocks.
    do you want all of the .pdf comments removed ?

Not as part of this patch, anyway :). Never mind. Thanks.

    > Anyway, seems fine to me, but maybe needs test case?

    seems like flag checks in this space are missing for all types

Seems like a problem in itself. But certainly low priority compared to
all else. --thanks, karl.




Reply sent to Mike Frysinger <vapier <at> gentoo.org>:
You have taken responsibility. (Fri, 28 Jan 2022 09:08:01 GMT) Full text and rfc822 format available.

Notification sent to Mohammad Akhlaghi <akhlaghi <at> gnu.org>:
bug acknowledged by developer. (Fri, 28 Jan 2022 09:08:01 GMT) Full text and rfc822 format available.

Message #66 received at 23599-done <at> debbugs.gnu.org (full text, mbox):

From: Mike Frysinger <vapier <at> gentoo.org>
To: Mohammad Akhlaghi <akhlaghi <at> gnu.org>
Cc: 23599-done <at> debbugs.gnu.org
Subject: Re: bug#23599: Including search directories for pdf and dvi
Date: Fri, 28 Jan 2022 04:07:43 -0500
[Message part 1 (text/plain, inline)]
i believe this will be fixed in the next release with the patches i
just merged.  please feel free to reopen if that doesn't work out.
-mike
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Feb 2022 12:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 60 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.