]> git.ipfire.org Git - thirdparty/gettext.git/commit
build: Fix MSVC builds with --enable-shared.
authorBruno Haible <bruno@clisp.org>
Thu, 5 Jun 2025 19:37:01 +0000 (21:37 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 5 Jun 2025 19:37:01 +0000 (21:37 +0200)
commit0bf30b9f8773c90d2016dabbd3b4a48bfeccced0
treeeea4c121e8cab9d961b3749853ddf46de5f49659
parentbeb65f2ccd4e79c750e3181faa9bb72fa81723a1
build: Fix MSVC builds with --enable-shared.

This was a regression in commit 8e914861708ed459a2ae8157eb60d89375ab46cd
from 2023-09-06.

Thanks to Kirill Makurin <maiddaisuki@outlook.com> for fruitful discussions.

* autogen.sh: Among the gnulib-tests, avoid the modules array-map-tests,
array-oset-tests, carray-list-tests, and uninorm/decomposing-form-tests, since
they use variables from libgettextlib.
* gettext-tools/configure.ac (GL_GNULIB_LIBUNISTRING_DLL_VARIABLE_NAME): New
variable.
(WOE32DLL): New C macro.
(DLL_VARIABLE): On MSVC with --enable-shared, define to '__declspec(dllexport)'
when compiling libgettextlib, and define to '__declspec(dllimport)' when
compiling the programs in src/.
(LIBGETTEXTSRC_DLL_VARIABLE): New C macro.
* gettext-tools/gnulib-lib/Makefile.am (AM_CPPFLAGS): Define the C macro
IN_LIBGETTEXTLIB.
* gettext-tools/src/Makefile.am (libgettextsrc_la_CPPFLAGS): Define the C macro
IN_LIBGETTEXTSRC.
* gettext-tools/src/format.h: Use LIBGETTEXTSRC_DLL_VARIABLE instead of
DLL_VARIABLE.
* gettext-tools/src/message.h: Likewise.
* gettext-tools/src/msgl-cat.h: Likewise.
* gettext-tools/src/plural-table.h: Likewise.
* gettext-tools/src/po-charset.h: Likewise.
* gettext-tools/src/po-error.h: Likewise.
* gettext-tools/src/read-catalog.h: Likewise.
* gettext-tools/src/read-po.h: Likewise.
* gettext-tools/src/read-properties.h: Likewise.
* gettext-tools/src/read-stringtable.h: Likewise.
* gettext-tools/src/sentence.h: Likewise.
* gettext-tools/src/write-po.h: Likewise.
* gettext-tools/src/write-properties.h: Likewise.
* gettext-tools/src/write-stringtable.h: Likewise.
* gettext-tools/src/xerror-handler.h: Likewise.
* gettext-tools/libgettextpo/Makefile.am (config.h): Override the value of
LIBGETTEXTSRC_DLL_VARIABLE.
* gettext-runtime/configure.ac (WOE32DLL): New C macro.
(DLL_VARIABLE): Define to empty always.
21 files changed:
autogen.sh
gettext-runtime/configure.ac
gettext-tools/configure.ac
gettext-tools/gnulib-lib/Makefile.am
gettext-tools/libgettextpo/Makefile.am
gettext-tools/src/Makefile.am
gettext-tools/src/format.h
gettext-tools/src/message.h
gettext-tools/src/msgl-cat.h
gettext-tools/src/plural-table.h
gettext-tools/src/po-charset.h
gettext-tools/src/po-error.h
gettext-tools/src/read-catalog.h
gettext-tools/src/read-po.h
gettext-tools/src/read-properties.h
gettext-tools/src/read-stringtable.h
gettext-tools/src/sentence.h
gettext-tools/src/write-po.h
gettext-tools/src/write-properties.h
gettext-tools/src/write-stringtable.h
gettext-tools/src/xerror-handler.h