texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 27 Oct 2024 17:53:37 -0400 (EDT)

branch: master
commit 0841129b651927ad36f046a13ad0c62d7f928a46
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Oct 27 22:51:10 2024 +0100

    * tp/Texinfo/XS/teximakehtml.c (main): call txi_general_setup with
    paths setup for an uninstalled program, similarly with how
    Texinfo::ModulePath.pm can be used to set paths.
---
 ChangeLog                    |  6 ++++++
 tp/Texinfo/XS/teximakehtml.c | 23 ++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f2d404152b..0507f01b37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-27  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/teximakehtml.c (main): call txi_general_setup with
+       paths setup for an uninstalled program, similarly with how
+       Texinfo::ModulePath.pm can be used to set paths.
+
 2024-10-27  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/convert/converter.c
diff --git a/tp/Texinfo/XS/teximakehtml.c b/tp/Texinfo/XS/teximakehtml.c
index 9f55133958..085b544569 100644
--- a/tp/Texinfo/XS/teximakehtml.c
+++ b/tp/Texinfo/XS/teximakehtml.c
@@ -115,6 +115,9 @@ main (int argc, char *argv[])
   CONVERTER_INITIALIZATION_INFO *format_defaults;
   char *home_dir;
   const char *curdir = ".";
+  char *top_srcdir;
+  char *top_builddir;
+  char *tp_builddir = 0;
 
   /* there are two modes, depending on test value.
       - if test is set, the output is setup to test specific output
@@ -198,7 +201,25 @@ main (int argc, char *argv[])
    }
   */
 
-  txi_general_setup (LOCALEDIR, 0, 0, 0, 0);
+  top_srcdir = getenv ("top_srcdir");
+  if (top_srcdir)
+    top_srcdir = strdup (top_srcdir);
+  else
+    /* equivalent to setting top_srcdir based on updirs in ModulePath.pm
+       adapted to a program without any in-source version */
+    top_srcdir = strdup ("../../..");
+
+  top_builddir = getenv ("top_builddir");
+  if (top_builddir)
+    xasprintf (&tp_builddir, "%s/tp", top_builddir);
+  else
+    /* this is correct for in-source builds only. */
+    top_builddir = strdup (top_srcdir);
+
+  txi_general_setup (LOCALEDIR, 1, 0, tp_builddir, top_srcdir);
+
+  free (tp_builddir);
+  free (top_srcdir);
 
   txi_converter_output_format_setup ("html");
 



reply via email to

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