* gettext-runtime/libasprintf/configure.ac: Set RC and WOE32 variables.
* gettext-runtime/libasprintf/libasprintf.rc: New file.
* gettext-runtime/libasprintf/Makefile.am (EXTRA_DIST): Add it.
(WOE32_LIBADD): New variable.
(libasprintf.res.lo): New rule.
(libasprintf_la_LIBADD, libasprintf_la_DEPENDENCIES): New variables.
## Makefile for the gettext-runtime/libasprintf subdirectory of GNU gettext
-## Copyright (C) 2002-2007, 2009-2011, 2013, 2016, 2018 Free Software Foundation, Inc.
+## Copyright (C) 2002-2007, 2009-2011, 2013, 2016, 2018-2019 Free Software Foundation, Inc.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
EXTRA_DIST += $(lib_asprintf_EXTRASOURCES)
+# Version information according to Woe32 conventions.
+EXTRA_DIST += libasprintf.rc
+if WOE32
+WOE32_LIBADD = libasprintf.res.lo
+# This rule is executed only on Woe32 systems.
+# Use $(RC) with libtool, $(WINDRES) when not using libtool.
+# The following sed expressions come from the windres-options script. They are
+# inlined here, so that they can be written in a Makefile without requiring a
+# temporary file. They must contain literal newlines rather than semicolons,
+# so that they work with the sed-3.02 that is shipped with MSYS.
+libasprintf.res.lo: $(srcdir)/libasprintf.rc
+ nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
+ sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'c\'$${nl}0$${nl}q; \
+ $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) \
+ "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \
+ "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \
+ "-DPACKAGE_VERSION_MINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_minor"` \
+ "-DPACKAGE_VERSION_SUBMINOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_subminor"` \
+ -i $(srcdir)/libasprintf.rc -o libasprintf.res.lo --output-format=coff
+MOSTLYCLEANFILES += libasprintf.res.lo
+else
+WOE32_LIBADD =
+endif
+libasprintf_la_LIBADD = $(WOE32_LIBADD)
+libasprintf_la_DEPENDENCIES = $(WOE32_LIBADD)
+
# How to build libasprintf.
# With libtool 1.5.14, on some platforms, like BeOS, "libtool --tag=CXX" fails
# to create a shared library, however "libtool --tag=CC" succeeds.
dnl Configuration for the GNU libasprintf library
-dnl Copyright (C) 2002-2012, 2016, 2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2012, 2016, 2018-2019 Free Software Foundation, Inc.
dnl
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
gl_EARLY
dnl Check for build configuration.
+
gl_WOE32_DLL
+
LT_INIT([win32-dll])
+
+dnl Prepares the libtool configuration for handling of Windows resources, and
+dnl sets the RC variable to a program that compiles Windows resource files.
+LT_LANG([Windows Resource])
+
+dnl On mingw and Cygwin, we can activate special Makefile rules which add
+dnl version information to the shared libraries and executables.
+case "$host_os" in
+ mingw* | cygwin*) is_woe32=yes ;;
+ *) is_woe32=no ;;
+esac
+AM_CONDITIONAL([WOE32], [test $is_woe32 = yes])
+
case "$host_os" in
# On Cygwin, without -no-undefined, a warning is emitted and only a static
# library is built.
--- /dev/null
+/* Resources for asprintf.dll */
+
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
+ PRODUCTVERSION PACKAGE_VERSION_MAJOR,PACKAGE_VERSION_MINOR,PACKAGE_VERSION_SUBMINOR,0
+ FILEFLAGSMASK 0x3fL /* VS_FFI_FILEFLAGSMASK */
+#ifdef _DEBUG
+ FILEFLAGS 0x1L /* VS_FF_DEBUG */
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x10004L /* VOS_DOS_WINDOWS32 */
+ FILETYPE 0x2L /* VFT_DLL */
+ FILESUBTYPE 0x0L /* VFT2_UNKNOWN */
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "04090000" /* Lang = US English, Charset = ASCII */
+ BEGIN
+ VALUE "Comments", "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License. You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <https://www.gnu.org/licenses/>.\0"
+ VALUE "CompanyName", "Free Software Foundation\0"
+ VALUE "FileDescription", "LGPLed libasprintf for Windows\0"
+ VALUE "FileVersion", PACKAGE_VERSION_STRING "\0"
+ VALUE "InternalName", "asprintf.dll\0"
+ VALUE "LegalCopyright", "Copyright (C) 2002-2019\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "asprintf.dll\0"
+ VALUE "ProductName", "GNU libasprintf: automatic formatted output\0"
+ VALUE "ProductVersion", PACKAGE_VERSION_STRING "\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 0 /* US English, ASCII */
+ END
+END