]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Export libintl_{new,dup,free}locale from libintl.so on OpenBSD.
authorBruno Haible <bruno@clisp.org>
Thu, 24 Apr 2025 20:31:40 +0000 (22:31 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 24 Apr 2025 20:32:27 +0000 (22:32 +0200)
Reported by Christian Weisgerber <naddy@mips.inka.de>.

* gnulib-local/lib/getlocalename_l-unsafe.c.diff: New file.
* gnulib-local/Makefile.am (EXTRA_DIST): Add it.
* gettext-runtime/intl/configure.ac (rpl_newlocale, rpl_duplocale,
rpl_freelocale): Redirect to symbols prefixed with 'libintl_', not '_libintl_'.
* gettext-runtime/intl/Makefile.am (BUILT_SOURCES): Add libgnuintl.h.

gettext-runtime/intl/Makefile.am
gettext-runtime/intl/configure.ac
gnulib-local/Makefile.am
gnulib-local/lib/getlocalename_l-unsafe.c.diff [new file with mode: 0644]

index e81eb721f90081c76ebc21d15be4e2466bf8b1a6..f39c10cb8c6c1b42cb1318156856a5b0b2f640de 100644 (file)
@@ -240,6 +240,7 @@ libgnuintl.h: $(srcdir)/libgnuintl.in.h $(srcdir)/export.h
        | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
        | sed -e 's,@''WOE32DLL''@,@WOE32DLL@,g' \
          > libgnuintl.h
+BUILT_SOURCES += libgnuintl.h
 MOSTLYCLEANFILES += libgnuintl.h
 
 libintl.h: $(srcdir)/libgnuintl.in.h
index 0fccf107587382e0606de858e3a5d738868df2eb..40b55afe109d4142a631f0b1c97874edb8c3b4c5 100644 (file)
@@ -306,9 +306,6 @@ AH_VERBATIM([znoexport], [
 #define gl_locale_name_environ            _libintl_locale_name_environ
 #define gl_locale_name_default            _libintl_locale_name_default
 #define gl_locale_name_unsafe             _libintl_locale_name_unsafe
-#define rpl_newlocale                     _libintl_newlocale
-#define rpl_duplocale                     _libintl_duplocale
-#define rpl_freelocale                    _libintl_freelocale
 /* Symbols defined by gnulib module 'lock'.  */
 #if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
 #define glthread_lock_init                            _libintl_lock_init
@@ -455,6 +452,11 @@ if false; then
   AC_DEFINE([rpl_vfprintf],     [_libintl_vfprintf],  [Hidden symbol.])
 fi
 
+dnl These symbols must not be hidden; they are exported via libgnuintl.in.h.
+AC_DEFINE([rpl_newlocale],      [libintl_newlocale],  [Exported symbol.])
+AC_DEFINE([rpl_duplocale],      [libintl_duplocale],  [Exported symbol.])
+AC_DEFINE([rpl_freelocale],     [libintl_freelocale], [Exported symbol.])
+
 AC_CONFIG_FILES([Makefile])
 AC_CONFIG_FILES([gnulib-lib/Makefile])
 
index 89cfc7787e44a80f71a38f7f6e6b6ffb6163ea62..c88132220fa6a384597422cbeeb95938bde2928c 100644 (file)
@@ -1,5 +1,5 @@
 ## Makefile for the gnulib-local directory of GNU gettext
-## Copyright (C) 2006-2024 Free Software Foundation, Inc.
+## Copyright (C) 2006-2025 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -30,6 +30,7 @@ lib/error.in.h.diff \
 lib/error-progname.c \
 lib/error-progname.h \
 lib/exitfail.h.diff \
+lib/getlocalename_l-unsafe.c.diff \
 lib/getopt-core.h.diff \
 lib/gettext.h \
 lib/gl_array_list.h.diff \
diff --git a/gnulib-local/lib/getlocalename_l-unsafe.c.diff b/gnulib-local/lib/getlocalename_l-unsafe.c.diff
new file mode 100644 (file)
index 0000000..be3f953
--- /dev/null
@@ -0,0 +1,47 @@
+diff --git a/lib/getlocalename_l-unsafe.c b/lib/getlocalename_l-unsafe.c
+index cb7ae5e5ea..87031ea365 100644
+--- a/lib/getlocalename_l-unsafe.c
++++ b/lib/getlocalename_l-unsafe.c
+@@ -52,6 +52,12 @@
+ #if LOCALENAME_ENHANCE_LOCALE_FUNCS
++# if IN_LIBINTL
++#  define BUILDING_LIBINTL 1
++/* Get LIBINTL_SHLIB_EXPORTED.  */
++#  include "libgnuintl.h"
++# endif
++
+ # include "flexmember.h"
+ # include "glthread/lock.h"
+ # include "thread-optim.h"
+@@ -127,6 +133,9 @@ get_locale_t_name (int category, locale_t locale)
+ # endif
+ /* newlocale() override.  */
++# if IN_LIBINTL
++extern LIBINTL_SHLIB_EXPORTED locale_t newlocale (int, const char *, locale_t);
++# endif
+ locale_t
+ newlocale (int category_mask, const char *name, locale_t base)
+ #undef newlocale
+@@ -331,6 +340,9 @@ newlocale (int category_mask, const char *name, locale_t base)
+ }
+ /* duplocale() override.  */
++# if IN_LIBINTL
++extern LIBINTL_SHLIB_EXPORTED locale_t duplocale (locale_t);
++# endif
+ locale_t
+ duplocale (locale_t locale)
+ #undef duplocale
+@@ -426,6 +438,9 @@ duplocale (locale_t locale)
+ }
+ /* freelocale() override.  */
++# if IN_LIBINTL
++extern LIBINTL_SHLIB_EXPORTED void freelocale (locale_t);
++# endif
+ void
+ freelocale (locale_t locale)
+ #undef freelocale