diff -ruN recode-3.7.6/build-aux/ltmain.sh patched/build-aux/ltmain.sh --- recode-3.7.6/build-aux/ltmain.sh 2016-02-08 00:39:37.000000000 +0100 +++ patched/build-aux/ltmain.sh 2019-10-03 12:41:04.095081265 +0200 @@ -7766,6 +7766,12 @@ deplibs="$deplib $deplibs" continue fi + case $deplib in + *.dll.a) + deplibs="$deplib $deplibs" + continue + ;; + esac case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, diff -ruN recode-3.7.6/configure patched/configure --- recode-3.7.6/configure 2019-09-13 14:25:04.000000000 +0200 +++ patched/configure 2019-10-03 12:41:04.101747962 +0200 @@ -7736,7 +7736,8 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else diff -ruN recode-3.7.6/configure.ac patched/configure.ac --- recode-3.7.6/configure.ac 2019-09-13 14:23:45.000000000 +0200 +++ patched/configure.ac 2019-10-03 12:41:04.101747962 +0200 @@ -111,6 +111,14 @@ AM_GNU_GETTEXT(external) AM_XGETTEXT_OPTION([--from-code=UTF-8]) +LIBRECODE_LDFLAGS="" +case "$host_os" in mingw*) + # we may assume that the backend is gnu-ld but DLLs need full resolution + LIBRECODE_LDFLAGS="-no-undefined ${wl}-no-undefined ${wl}-export-all-symbols" +;; esac +AC_MSG_RESULT([$LIBRECODE_LDFLAGS]) +AC_SUBST([LIBRECODE_LDFLAGS]) + AC_CONFIG_FILES([Makefile contrib/Makefile doc/Makefile lib/Makefile po/Makefile.in src/Makefile tests/Makefile tests/setup.py]) AC_OUTPUT diff -ruN recode-3.7.6/m4/libtool.m4 patched/m4/libtool.m4 --- recode-3.7.6/m4/libtool.m4 2016-02-08 00:39:37.000000000 +0100 +++ patched/m4/libtool.m4 2019-10-03 12:41:04.105081310 +0200 @@ -3480,7 +3480,8 @@ # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else diff -ruN recode-3.7.10/src/Makefile.am patched/src/Makefile.am --- recode-3.7.10/src/Makefile.am 2022-01-20 00:25:59.000000000 +0100 +++ patched/src/Makefile.am 2022-01-22 00:51:19.676666666 +0100 @@ -54,7 +54,7 @@ librecode_la_SOURCES = charname.c combine.c fr-charname.c iconv.c \ names.c outer.c recode.c request.c strip-pool.c task.c $(ALL_STEPS) \ $(include_HEADERS) $(noinst_HEADERS) $(H_STEPS) -librecode_la_LDFLAGS = -version-info $(VERSION_INFO) $(LTLIBINTL) \ +librecode_la_LDFLAGS = @LIBRECODE_LDFLAGS@ -version-info $(VERSION_INFO) $(LTLIBINTL) \ $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) $(LIB_SETLOCALE_NULL) librecode_la_LIBADD = ../lib/libgnu.la libmerged.la