texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/ModulePath.pm.in ($texinfo_uninstall


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/ModulePath.pm.in ($texinfo_uninstalled, init), tp/Texinfo/XS/TestXS.xs (xstest_init), tp/Texinfo/XS/convert/ConvertXS.xs (init), tp/Texinfo/XS/parsetexi/Parsetexi.xs (init): initialize Texinfo::ModulePath $texinfo_uninstalled to undef, such that it is possible to determine that Texinfo::ModulePath init has not been called.
Date: Sat, 23 Nov 2024 17:48:14 -0500

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a7d3682dfe * tp/Texinfo/ModulePath.pm.in ($texinfo_uninstalled, init), 
tp/Texinfo/XS/TestXS.xs (xstest_init), tp/Texinfo/XS/convert/ConvertXS.xs 
(init), tp/Texinfo/XS/parsetexi/Parsetexi.xs (init): initialize 
Texinfo::ModulePath $texinfo_uninstalled to undef, such that it is possible to 
determine that Texinfo::ModulePath init has not been called.
a7d3682dfe is described below

commit a7d3682dfef65563953cd0f974bc59dc8f470b67
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Nov 23 23:48:09 2024 +0100

    * tp/Texinfo/ModulePath.pm.in ($texinfo_uninstalled, init),
    tp/Texinfo/XS/TestXS.xs (xstest_init),
    tp/Texinfo/XS/convert/ConvertXS.xs (init),
    tp/Texinfo/XS/parsetexi/Parsetexi.xs (init): initialize
    Texinfo::ModulePath $texinfo_uninstalled to undef, such that it is
    possible to determine that Texinfo::ModulePath init has not been
    called.
    
    * tp/Texinfo/XSLoader.pm (load_libtool_library): add .libs directory
    if Texinfo::ModulePath $texinfo_uninstalled is set or if it is undef
    when Texinfo::ModulePath has not been called, as is the ase when
    TestXS is called, as it is not called from a Perl script.
---
 ChangeLog                            | 15 +++++++++++++++
 tp/Texinfo/ModulePath.pm.in          |  4 +++-
 tp/Texinfo/XS/TestXS.xs              |  2 +-
 tp/Texinfo/XS/convert/ConvertXS.xs   |  5 ++++-
 tp/Texinfo/XS/parsetexi/Parsetexi.xs |  2 +-
 tp/Texinfo/XSLoader.pm               |  8 ++++++--
 6 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ed938e66aa..71e5ab848f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2024-11-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/ModulePath.pm.in ($texinfo_uninstalled, init),
+       tp/Texinfo/XS/TestXS.xs (xstest_init),
+       tp/Texinfo/XS/convert/ConvertXS.xs (init),
+       tp/Texinfo/XS/parsetexi/Parsetexi.xs (init): initialize
+       Texinfo::ModulePath $texinfo_uninstalled to undef, such that it is
+       possible to determine that Texinfo::ModulePath init has not been
+       called.
+
+       * tp/Texinfo/XSLoader.pm (load_libtool_library): add .libs directory
+       if Texinfo::ModulePath $texinfo_uninstalled is set or if it is undef
+       when Texinfo::ModulePath has not been called, as is the ase when
+       TestXS is called, as it is not called from a Perl script.
+
 2024-11-23  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/Text.pm (_convert),
diff --git a/tp/Texinfo/ModulePath.pm.in b/tp/Texinfo/ModulePath.pm.in
index 44409a961c..00562c0c4a 100644
--- a/tp/Texinfo/ModulePath.pm.in
+++ b/tp/Texinfo/ModulePath.pm.in
@@ -20,7 +20,7 @@ use File::Spec;
 
 # Used as a flag to say whether to look for data files in uninstalled
 # locations.
-our $texinfo_uninstalled = 0;
+our $texinfo_uninstalled = undef;
 
 # uninstalled locations paths, if $Texinfo::ModulePath::texinfo_uninstalled
 # Pathname of the tp/ build directory.  Used to find the locale
@@ -93,6 +93,8 @@ sub init {
     }
 
   } else {
+    $texinfo_uninstalled = 0;
+
     # for the Texinfo modules
     if (defined($lib_dir)) {
       unshift @INC, $lib_dir;
diff --git a/tp/Texinfo/XS/TestXS.xs b/tp/Texinfo/XS/TestXS.xs
index 5804dfc26a..f8e98b5a0a 100644
--- a/tp/Texinfo/XS/TestXS.xs
+++ b/tp/Texinfo/XS/TestXS.xs
@@ -12,7 +12,7 @@ MODULE = TestXS PACKAGE = TestXS PREFIX = xstest_
 PROTOTYPES: ENABLE
 
 int
-xstest_init (int, SV *, SV *, SV *)
+xstest_init (SV *, SV *, SV *, SV *)
     CODE:
         puts ("message from XS module\n");
         RETVAL = 1;
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index 5a68337930..1f70d52837 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -73,12 +73,15 @@ PROTOTYPES: ENABLE
 # Called from Texinfo::XSLoader.pm.
 # File paths are byte strings and can be in any encoding.
 int
-init (int texinfo_uninstalled, SV *converterdatadir_sv, SV *tp_builddir_sv, SV 
*top_srcdir_sv)
+init (SV *texinfo_uninstalled_sv, SV *converterdatadir_sv, SV *tp_builddir_sv, 
SV *top_srcdir_sv)
       PREINIT:
         const char *tp_builddir = 0;
         const char *top_srcdir = 0;
         const char *converterdatadir = 0;
+        int texinfo_uninstalled = 0;
       CODE:
+        if (SvOK (texinfo_uninstalled_sv))
+          texinfo_uninstalled = SvIV (texinfo_uninstalled_sv);
         if (texinfo_uninstalled)
           {
             if (SvOK (tp_builddir_sv))
diff --git a/tp/Texinfo/XS/parsetexi/Parsetexi.xs 
b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
index 2bc55dde8b..795bcc55c6 100644
--- a/tp/Texinfo/XS/parsetexi/Parsetexi.xs
+++ b/tp/Texinfo/XS/parsetexi/Parsetexi.xs
@@ -66,7 +66,7 @@ PROTOTYPES: ENABLE
 # Called once from Texinfo::XSLoader.pm at loading time.
 # File paths (not used) are byte strings and can be in any encoding.
 int
-init (int texinfo_uninstalled, SV *converterdatadir, SV *tp_builddir, SV 
*top_srcdir)
+init (SV *texinfo_uninstalled, SV *converterdatadir, SV *tp_builddir, SV 
*top_srcdir)
     CODE:
         messages_and_encodings_setup ();
         RETVAL = 1;
diff --git a/tp/Texinfo/XSLoader.pm b/tp/Texinfo/XSLoader.pm
index 9726daf953..784e9ac9ce 100644
--- a/tp/Texinfo/XSLoader.pm
+++ b/tp/Texinfo/XSLoader.pm
@@ -131,8 +131,12 @@ sub load_libtool_library {
   # Use unshift to place directories at start of search path.  This
   # way we avoid accidentally loading the wrong library, e.g. if someone
   # has some random /usr/lib/libtexinfo.so file.
-  # The *.so file is under .libs in the source directory.
-  if ($Texinfo::ModulePath::texinfo_uninstalled) {
+  # The *.so file is under .libs in the build directory.
+  # Consider that we are in the build directory if texinfo_uninstalled
+  # is set, or if Texinfo::ModulePath has not been called, as is the
+  # case when TestXS is called, as it is not called from a Perl script.
+  if (not defined($Texinfo::ModulePath::texinfo_uninstalled)
+      or $Texinfo::ModulePath::texinfo_uninstalled) {
     unshift @DynaLoader::dl_library_path, "$libtool_dir/.libs";
   }
   unshift @DynaLoader::dl_library_path, $libtool_dir;



reply via email to

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