texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 28 Aug 2024 14:30:58 -0400 (EDT)

branch: release/7.1
commit 4bed2c40a643b3f8b511b5bc2257d340943461fe
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Tue Aug 27 21:07:58 2024 +0100

    texi2any_internals.texi build fixes
    
    * doc/tp_api/Makefile.am (texi2any_internals.texi):
    Generate .info file in builddir.  Change working directory to
    $(srcdir) before running pod2texi.  This allows pod2texi to
    generate @include directives correctly with the --subdir option.
    (texi2any_internals_dependencies): List dependencies with
    ../../ prefix instead of $(top_srcdir)/.
    (MAKEINFO_ENVIRONMENT): Use abs_top_srcdir and abs_top_buildir
    instead of top_srcdir and top_buildir.
    
    Report from Bruno Haible and analysis by Patrice.
    
    * tp/Makefile.am (Texinfo/Commands.pm): Generate in srcdir.
    Remove from modules_DATA and DISTCLEANFILES, and add to
    dist_modules_DATA and MAINTAINERCLEANFILES.
    * tp/maintain/regenerate_commands_perl_info.pl:
    Receive generated file name as argument.
    (Based on Patrice's change to git 'master' branch on 2023-10-22,
    commit 3cc99724; and 2023-10-19, commit bec1b4b3).
---
 ChangeLog                                    | 23 +++++++++++
 doc/tp_api/Makefile.am                       | 57 +++++++++++++++-------------
 tp/Makefile.am                               | 12 +++---
 tp/maintain/regenerate_commands_perl_info.pl |  7 +++-
 4 files changed, 65 insertions(+), 34 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ab75ee8ab1..f833dfc3ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2024-08-27  Gavin Smith <gavinsmith0123@gmail.com>
+
+       texi2any_internals.texi build fixes
+
+       * doc/tp_api/Makefile.am (texi2any_internals.texi):
+       Generate .info file in builddir.  Change working directory to
+       $(srcdir) before running pod2texi.  This allows pod2texi to
+       generate @include directives correctly with the --subdir option.
+       (texi2any_internals_dependencies): List dependencies with
+       ../../ prefix instead of $(top_srcdir)/.
+       (MAKEINFO_ENVIRONMENT): Use abs_top_srcdir and abs_top_buildir
+       instead of top_srcdir and top_buildir.
+
+       Report from Bruno Haible and analysis by Patrice.
+
+       * tp/Makefile.am (Texinfo/Commands.pm): Generate in srcdir.
+       Remove from modules_DATA and DISTCLEANFILES, and add to
+       dist_modules_DATA and MAINTAINERCLEANFILES.
+       * tp/maintain/regenerate_commands_perl_info.pl:
+       Receive generated file name as argument.
+       (Based on Patrice's change to git 'master' branch on 2023-10-22,
+       commit 3cc99724; and 2023-10-19, commit bec1b4b3).
+
 2024-08-08  Gavin Smith <gavinsmith0123@gmail.com>
 
        * Makefile.am (BUILT_SOURCES): Add tp/Texinfo/ModulePath.pm along
diff --git a/doc/tp_api/Makefile.am b/doc/tp_api/Makefile.am
index f76b7e98f8..5a9f2a8a7e 100644
--- a/doc/tp_api/Makefile.am
+++ b/doc/tp_api/Makefile.am
@@ -14,10 +14,11 @@
 # texi2any_internals_indices.texi soes not appear in any menu.
 AM_MAKEINFOFLAGS = -c INFO_SPECIAL_CHARS_WARNING=0 -c 
TREE_TRANSFORMATIONS=complete_tree_nodes_menus
 
-# Use the programs built in our distribution.
+# Use the programs built in our distribution.  Use absolute directory
+# names so we can run from a different working directory.
 MAKEINFO_ENVIRONMENT = TEXINFO_DEV_SOURCE=1 \
-                       top_srcdir="$(top_srcdir)" \
-                       top_builddir="$(top_builddir)"
+                       top_srcdir="$(abs_top_srcdir)" \
+                       top_builddir="$(abs_top_builddir)"
 MAKEINFO = $(MAKEINFO_ENVIRONMENT) $(PERL) $(top_srcdir)/tp/texi2any.pl
 
 TEXI2DVI_ENVIRONMENT = TEXINDEX=${abs_top_builddir}/texindex/texindex \
@@ -49,30 +50,34 @@ BUILT_SOURCES = texi2any_internals.texi
 
 # all the modules with some interesting public interfaces.
 # The order matters for the result.
+# Note that these relative file names are correct from srcdir, and will be
+# found from builddir in VPATH builds.
 texi2any_internals_dependencies = \
-  $(top_srcdir)/tp/Texinfo/Commands.pod \
-  $(top_srcdir)/tp/Texinfo/Common.pm \
-  $(top_srcdir)/tp/Texinfo/ParserNonXS.pm \
-  $(top_srcdir)/tp/Texinfo/Structuring.pm \
-  $(top_srcdir)/tp/Texinfo/Report.pm \
-  $(top_srcdir)/tp/Texinfo/Translations.pm \
-  $(top_srcdir)/tp/Texinfo/Transformations.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Texinfo.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Utils.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Unicode.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/NodeNameNormalization.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Text.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Converter.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Info.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/HTML.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/DocBook.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/TexinfoMarkup.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/TexinfoXML.pm \
-  $(top_srcdir)/tp/Texinfo/Convert/Plaintext.pm
+  ../../tp/Texinfo/Commands.pod \
+  ../../tp/Texinfo/Common.pm \
+  ../../tp/Texinfo/ParserNonXS.pm \
+  ../../tp/Texinfo/Structuring.pm \
+  ../../tp/Texinfo/Report.pm \
+  ../../tp/Texinfo/Translations.pm \
+  ../../tp/Texinfo/Transformations.pm \
+  ../../tp/Texinfo/Convert/Texinfo.pm \
+  ../../tp/Texinfo/Convert/Utils.pm \
+  ../../tp/Texinfo/Convert/Unicode.pm \
+  ../../tp/Texinfo/Convert/NodeNameNormalization.pm \
+  ../../tp/Texinfo/Convert/Text.pm \
+  ../../tp/Texinfo/Convert/Converter.pm \
+  ../../tp/Texinfo/Convert/Info.pm \
+  ../../tp/Texinfo/Convert/HTML.pm \
+  ../../tp/Texinfo/Convert/DocBook.pm \
+  ../../tp/Texinfo/Convert/TexinfoMarkup.pm \
+  ../../tp/Texinfo/Convert/TexinfoXML.pm \
+  ../../tp/Texinfo/Convert/Plaintext.pm
 
-texi2any_internals.texi: $(texi2any_internals_dependencies) 
texi2any_internals_indices.texi texi2any_internals_preamble.texi
-       if $(MAKEINFO_ENVIRONMENT) $(PERL) -I 
$(top_srcdir)/Pod-Simple-Texinfo/lib/ 
$(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl --base-level=section --preamble - 
--subdir=api_includes $(texi2any_internals_dependencies) < 
$(srcdir)/texi2any_internals_preamble.texi >$@.tmp ; then \
-         cat $@.tmp  | sed -e 's/^@bye/@__bye/' | sed -e '/^@__bye/r 
$(srcdir)/texi2any_internals_indices.texi' | sed -e 's/^@__bye//' > $@ ; \
-       fi ; rm -f $@.tmp
+$(srcdir)/texi2any_internals.texi: $(texi2any_internals_dependencies) 
$(srcdir)/texi2any_internals_indices.texi 
$(srcdir)/texi2any_internals_preamble.texi
+       cd $(srcdir) ; \
+       target=texi2any_internals.texi ; \
+       if $(MAKEINFO_ENVIRONMENT) $(PERL) -I ../../Pod-Simple-Texinfo/lib/ 
../../Pod-Simple-Texinfo/pod2texi.pl --base-level=section --preamble - 
--subdir=api_includes $(texi2any_internals_dependencies) < 
texi2any_internals_preamble.texi >$${target}.tmp ; then \
+         cat $${target}.tmp  | sed -e 's/^@bye/@__bye/' | sed -e '/^@__bye/r 
texi2any_internals_indices.texi' | sed -e 's/^@__bye//' > $${target} ; \
+       fi ; rm -f $${target}.tmp
 
 endif
diff --git a/tp/Makefile.am b/tp/Makefile.am
index f98cf7e6a0..40a67d9273 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -70,6 +70,7 @@ dist_modules_DATA = \
  Texinfo/Report.pm \
  Texinfo/Common.pm \
  Texinfo/Commands.pod \
+ Texinfo/Commands.pm \
  Texinfo/Structuring.pm \
  Texinfo/Transformations.pm \
  Texinfo/Translations.pm \
@@ -81,8 +82,7 @@ dist_noinst_DATA = \
  Texinfo/ModulePath.pm.in
 
 modules_DATA = \
- Texinfo/ModulePath.pm \
- Texinfo/Commands.pm
+ Texinfo/ModulePath.pm
 
 convertersdir = $(pkgdatadir)/Texinfo/Convert
 dist_converters_DATA = \
@@ -338,9 +338,8 @@ Texinfo/ModulePath.pm: Texinfo/ModulePath.pm.in Makefile
            -e 's|[@]ICONV_CONVERTS_EUC_CN[@]|$(ICONV_CONVERTS_EUC_CN)|' \
          $(srcdir)/Texinfo/ModulePath.pm.in >$@
 
-Texinfo/Commands.pm: Texinfo/command_data.txt
-       $(MKDIR_P) Texinfo
-       $(srcdir)/maintain/regenerate_commands_perl_info.pl < 
$(srcdir)/Texinfo/command_data.txt
+$(srcdir)/Texinfo/Commands.pm: Texinfo/command_data.txt
+       $(srcdir)/maintain/regenerate_commands_perl_info.pl 
$(srcdir)/Texinfo/Commands.pm < $(srcdir)/Texinfo/command_data.txt
 
 libsrcdir = $(srcdir)/maintain/lib
 
@@ -386,4 +385,5 @@ distclean-local:
        rm -rf po po_document
 
 CLEANFILES = texi2any makeinfo Texinfo/ModulePath.pm
-DISTCLEANFILES = maintain/catalog.xml Texinfo/Commands.pm
+DISTCLEANFILES = maintain/catalog.xml
+MAINTAINERCLEANFILES = Texinfo/Commands.pm
diff --git a/tp/maintain/regenerate_commands_perl_info.pl 
b/tp/maintain/regenerate_commands_perl_info.pl
index 3b9f12cc91..a937812d69 100755
--- a/tp/maintain/regenerate_commands_perl_info.pl
+++ b/tp/maintain/regenerate_commands_perl_info.pl
@@ -42,7 +42,7 @@ my %command_args_nr;
 
 my %multi_category_commands;
 
-while (<>) {
+while (<STDIN>) {
   if (not (/^#/ or /^ *$/)) {
     my ($command, $flags, $data, $args_nr) = split;
     my @flags = split /,/, $flags;
@@ -101,7 +101,10 @@ while (<>) {
   }
 }
 
-open (OUT, ">Texinfo/Commands.pm") or die "Open Texinfo/Commands.pm: $!\n";
+my $out_file = $ARGV[0];
+die "Need an output file\n" if (!defined($out_file));
+
+open (OUT, ">$out_file") or die "Open $out_file: $!\n";
 
 print OUT "# Automatically generated from $0\n\n";
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]