In MSVC builds, use 'rc' instead of 'windres'. * INSTALL.windows (MSVC): Remove requirement to install mingw tools. Instead, show how to set the PATH. * lib/Makefile.in (libiconv.res.lo): On MSVC, use 'rc' and 'cvtres'. * src/Makefile.in (iconv.res): Likewise.
diff --git a/ChangeLog b/ChangeLog index 22d5a69..4112188 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -1,5 +1,13 @@ 2026-10-16 Bruno Haible <bruno@clisp.org> + In MSVC builds, use 'rc' instead of 'windres'. + * INSTALL.windows (MSVC): Remove requirement to install mingw tools. + Instead, show how to set the PATH. + * lib/Makefile.in (libiconv.res.lo): On MSVC, use 'rc' and 'cvtres'. + * src/Makefile.in (iconv.res): Likewise. + +2026-10-16 Bruno Haible <bruno@clisp.org> + Improve copyright statement in the Windows .rc files. * windows/libiconv.rc (LegalCopyright): Add the copyright holder. * windows/iconv.rc (LegalCopyright): Likewise.
diff --git a/INSTALL.windows b/INSTALL.windows index 5912bb8..50c10b5 100644 --- a/INSTALL.windows +++ b/INSTALL.windows
@@ -87,14 +87,6 @@ * Cygwin (from https://cygwin.com/), * some packages available from the Cygwin package installer: make - * the mingw cross-compilation tool named 'windres', available from the - Cygwin package installer (setup-x86_64.exe): - - for creating 32-bit binaries: packages - mingw64-i686-binutils, - mingw64-i686-gcc-core - - for creating 64-bit binaries: packages - mingw64-x86_64-binutils, - mingw64-x86_64-gcc-core You also need the scripts 'ar-lib' and 'compile' from https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/ar-lib;hb=HEAD @@ -129,6 +121,10 @@ INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" LIB="${WindowsSdkLibDir}x86;$LIB" + # Windows tools. + WindowsSdkBinDir='C:\Program Files (x86)\Windows Kits\8.1\bin\' + PATH=`cygpath -u "${WindowsSdkBinDir}x86"`:"$PATH" + # Visual C++ tools, headers and libraries. VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0' VCINSTALLDIR="${VSINSTALLDIR}"'\VC' @@ -140,29 +136,33 @@ - for creating 64-bit binaries: through the following bash commands: - # Set environment variables for using MSVC 14, - # for creating native 64-bit Windows executables. + # Set environment variables for using MSVC 14, + # for creating native 64-bit Windows executables. - # Windows C library headers and libraries. - WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt' - WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\' - INCLUDE="${WindowsCrtIncludeDir};$INCLUDE" - LIB="${WindowsCrtLibDir}x64;$LIB" + # Windows C library headers and libraries. + WindowsCrtIncludeDir='C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt' + WindowsCrtLibDir='C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\' + INCLUDE="${WindowsCrtIncludeDir};$INCLUDE" + LIB="${WindowsCrtLibDir}x64;$LIB" - # Windows API headers and libraries. - WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\' - WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\' - INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" - LIB="${WindowsSdkLibDir}x64;$LIB" + # Windows API headers and libraries. + WindowsSdkIncludeDir='C:\Program Files (x86)\Windows Kits\8.1\Include\' + WindowsSdkLibDir='C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\' + INCLUDE="${WindowsSdkIncludeDir}um;${WindowsSdkIncludeDir}shared;$INCLUDE" + LIB="${WindowsSdkLibDir}x64;$LIB" - # Visual C++ tools, headers and libraries. - VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0' - VCINSTALLDIR="${VSINSTALLDIR}"'\VC' - PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH" - INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}" - LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}" + # Windows tools. + WindowsSdkBinDir='C:\Program Files (x86)\Windows Kits\8.1\bin\' + PATH=`cygpath -u "${WindowsSdkBinDir}x64"`:"$PATH" - export INCLUDE LIB + # Visual C++ tools, headers and libraries. + VSINSTALLDIR='C:\Program Files (x86)\Microsoft Visual Studio 14.0' + VCINSTALLDIR="${VSINSTALLDIR}"'\VC' + PATH=`cygpath -u "${VCINSTALLDIR}"`/bin/amd64:"$PATH" + INCLUDE="${VCINSTALLDIR}"'\include;'"${INCLUDE}" + LIB="${VCINSTALLDIR}"'\lib\amd64;'"${LIB}" + + export INCLUDE LIB Building 32-bit binaries with MSVC is achieved through the following preparation, configure, and build commands:
diff --git a/lib/Makefile.in b/lib/Makefile.in index 8d3899d..824dbb8 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in
@@ -89,8 +89,18 @@ iconv-exports.lo : $(srcdir)/../woe32dll/iconv-exports.c $(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/../woe32dll/iconv-exports.c -libiconv.res.lo : $(srcdir)/../windows/libiconv.rc - $(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff +libiconv.res.lo : $(srcdir)/../windows/libiconv.rc iconv-exports.lo + if test '@OBJEXT@' = obj; then \ + rcfile=`cygpath -w '$(srcdir)/../windows/libiconv.rc'`; \ + rc -folibiconv.tmp.res `$(SHELL) $(srcdir)/../windows/windres-options $(PACKAGE_VERSION)` "$$rcfile" \ + && cvtres -out:libiconv.res.@OBJEXT@ libiconv.tmp.res \ + && $(RM) libiconv.tmp.res \ + && mkdir -p .libs \ + && cp libiconv.res.@OBJEXT@ .libs/libiconv.res.@OBJEXT@ \ + && sed -e 's/iconv-exports/libiconv.res/g' < iconv-exports.lo > libiconv.res.lo; \ + else \ + $(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff; \ + fi # Installs the library and include files only. Typically called with only # $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
diff --git a/src/Makefile.in b/src/Makefile.in index 92307d5..4076d4b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in
@@ -86,7 +86,14 @@ $(CC) -c $(INCLUDES) -I../lib $(CFLAGS) $(CPPFLAGS) -DINSTALLDIR=$(bindir_c_make) -DLOCALEDIR=$(localedir_c_make) $(srcdir)/iconv.c iconv.res : $(srcdir)/../windows/iconv.rc - $(WINDRES) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/iconv.rc -o iconv.res --output-format=coff + if test '@OBJEXT@' = obj; then \ + rcfile=`cygpath -w '$(srcdir)/../windows/iconv.rc'`; \ + rc -foiconv.tmp.res `$(SHELL) $(srcdir)/../windows/windres-options $(PACKAGE_VERSION)` "$$rcfile" \ + && cvtres -out:iconv.res iconv.tmp.res \ + && $(RM) iconv.tmp.res; \ + else \ + $(WINDRES) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/iconv.rc -o iconv.res --output-format=coff; \ + fi # The following rule is necessary to avoid a toplevel "make -n check" failure. ../lib/libiconv.la :