texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Tue, 26 Nov 2024 17:56:39 -0500 (EST)

branch: master
commit 545fe7ff7a01aa09554475d94b5db23cfb1bad32
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Nov 26 23:56:24 2024 +0100

    * configure.ac (--enable-xs-perl-libintl), tp/Texinfo/XS/configure.ac
    (--enable-xs-perl-libintl, USE_LIBINTL_PERL_IN_XS),
    tp/Texinfo/XS/main/translations.c
    (configure_output_strings_translations): add an explicit configure
    command-line switch to prefer calling libintl-perl from XS code.  Set
    it if $usable_getenv_in_XS is no.  Use USE_LIBINTL_PERL_IN_XS instead
    of HAVE_USABLE_GETENV_IN_XS in configure_output_strings_translations
    to determine th edefault for use_external_translate_string.
---
 ChangeLog                         | 11 +++++++++++
 configure.ac                      | 10 ++++++++++
 tp/Texinfo/XS/configure.ac        | 24 ++++++++++++++++++++++++
 tp/Texinfo/XS/main/translations.c |  6 +++---
 4 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4a0ef7b076..c13222653e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-11-26  Patrice Dumas  <pertusus@free.fr>
+
+       * configure.ac (--enable-xs-perl-libintl), tp/Texinfo/XS/configure.ac
+       (--enable-xs-perl-libintl, USE_LIBINTL_PERL_IN_XS),
+       tp/Texinfo/XS/main/translations.c
+       (configure_output_strings_translations): add an explicit configure
+       command-line switch to prefer calling libintl-perl from XS code.  Set
+       it if $usable_getenv_in_XS is no.  Use USE_LIBINTL_PERL_IN_XS instead
+       of HAVE_USABLE_GETENV_IN_XS in configure_output_strings_translations
+       to determine th edefault for use_external_translate_string.
+
 2024-11-26  Patrice Dumas  <pertusus@free.fr>
 
        * doc/texinfo.texi (Internationalization of Document Strings): move
diff --git a/configure.ac b/configure.ac
index a3c2519701..6594bea5b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -503,6 +503,16 @@ AC_SUBST([enable_xs])
 
 AM_CONDITIONAL([DISABLE_XS], [test "z$enable_xs" = zno])
 
+AC_ARG_ENABLE([xs-perl-libintl],
+    AS_HELP_STRING([--enable-xs-perl-libintl],
+            [prefer Perl libintl-perl gettext in XS modules]),
+    [if test $enableval = 'yes'; then
+       prefer_libinlt_perl=yes
+     else
+       prefer_libinlt_perl=no
+     fi],
+     [])
+
 # Texinfo JS Interface
 npm_path="${srcdir}/js/node_modules/.bin"
 if test -d "$npm_path" ; then
diff --git a/tp/Texinfo/XS/configure.ac b/tp/Texinfo/XS/configure.ac
index e26fbc2783..40c00153e5 100644
--- a/tp/Texinfo/XS/configure.ac
+++ b/tp/Texinfo/XS/configure.ac
@@ -30,6 +30,7 @@ fi
 AC_MSG_RESULT($usable_getenv_in_XS)
 
 if test $usable_getenv_in_XS = yes ; then
+  # currently unused
   AC_DEFINE([HAVE_USABLE_GETENV_IN_XS], [1],
             [Define to 1 if getenv can be used in XS])
 fi
@@ -200,6 +201,29 @@ GL_GNULIB_MDA_PUTENV=0
 AM_CONDITIONAL([HAVE_ICONV],
                [test "x$am_func_iconv" = "xyes"])
 
+AC_ARG_ENABLE([xs-perl-libintl],
+    AS_HELP_STRING([--enable-xs-perl-libintl],
+              [prefer Perl libintl-perl gettext in XS modules]),
+    [if test $enableval = 'yes'; then
+       use_libinlt_perl_in_xs=yes
+     else
+       use_libinlt_perl_in_xs=no
+     fi],
+     [
+      if test $usable_getenv_in_XS = yes ; then
+        use_libinlt_perl_in_xs=no
+        # TODO add a check of working C libintl gettext for the locale
+        # switching and translated output string retrieveal
+      else
+        use_libinlt_perl_in_xs=yes
+      fi
+     ])
+
+if test $use_libinlt_perl_in_xs = yes ; then
+  AC_DEFINE([USE_LIBINTL_PERL_IN_XS], [1],
+            [Define to 1 if Perl libintl-perl should be called from XS])
+fi
+
 # Do not include Perl configuration values when outputting these variables,
 # as advised in the automake manual for CFLAGS and LDFLAGS, which could be
 # reset by the user.  Here PERL_EXT_CFLAGS and PERL_EXT_LDFLAGS play the
diff --git a/tp/Texinfo/XS/main/translations.c 
b/tp/Texinfo/XS/main/translations.c
index 7964358212..79aa7bb38f 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -78,10 +78,10 @@ configure_output_strings_translations (const char 
*localesdir,
     use_external_translate_string = use_external_translate_string_in;
   else
     {
-  #ifndef HAVE_USABLE_GETENV_IN_XS
-      use_external_translate_string = 1;
-  #else
+  #ifndef USE_LIBINTL_PERL_IN_XS
       use_external_translate_string = 0;
+  #else
+      use_external_translate_string = 1;
   #endif
     }
 



reply via email to

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