This patch caused link errors on mingw, with libunistring installed: /home/bruno/testdir-all/build-mingw64/gllib/../../gllib/unistr/u-pcpy.h:21: undefined reference to `u32_cpy' collect2: error: ld returned 1 exit status make[4]: *** [Makefile:18137: test-fnmatch-w32.exe] Error 1
../gllib/libgnu.a(u32-pcpy.o): In function `u32_pcpy': /home/bruno/testdir-all/build-mingw64/gllib/../../gllib/unistr/u-pcpy.h:21: undefined reference to `u32_cpy' collect2: error: ld returned 1 exit status make[4]: *** [Makefile:18517: test-glob.exe] Error 1 Fixed by this patch. 2023-07-27 Bruno Haible <br...@clisp.org> fnmatch, glob tests: Fix link errors (regression 2023-07-24). * modules/fnmatch-tests (Makefile.am): Link test-fnmatch-w32 with the same libraries as test-fnmatch. * modules/glob (Link): Add $(LIBUNISTRING). * modules/glob-tests (Makefile.am): Link test-glob with $(LIBUNISTRING). diff --git a/modules/fnmatch-tests b/modules/fnmatch-tests index 2d66f6f361..30ec4fded6 100644 --- a/modules/fnmatch-tests +++ b/modules/fnmatch-tests @@ -46,3 +46,4 @@ TESTS_ENVIRONMENT += \ LOCALE_ZH_CN='@LOCALE_ZH_CN@' check_PROGRAMS += test-fnmatch test-fnmatch-w32 test_fnmatch_LDADD = $(LDADD) $(SETLOCALE_LIB) $(LIBUNISTRING) $(MBRTOWC_LIB) +test_fnmatch_w32_LDADD = $(LDADD) $(SETLOCALE_LIB) $(LIBUNISTRING) $(MBRTOWC_LIB) diff --git a/modules/glob b/modules/glob index a03834a619..7d1fea1d5d 100644 --- a/modules/glob +++ b/modules/glob @@ -59,6 +59,7 @@ Include: <glob.h> Link: +$(LTLIBUNISTRING) when linking with libtool, $(LIBUNISTRING) otherwise $(MBRTOWC_LIB) License: diff --git a/modules/glob-tests b/modules/glob-tests index 2abbba3da6..6054e7838b 100644 --- a/modules/glob-tests +++ b/modules/glob-tests @@ -12,7 +12,7 @@ configure.ac: Makefile.am: TESTS += test-glob check_PROGRAMS += test-glob -test_glob_LDADD = $(LDADD) $(LIBINTL) $(MBRTOWC_LIB) +test_glob_LDADD = $(LDADD) $(LIBUNISTRING) $(LIBINTL) $(MBRTOWC_LIB) MOSTLYCLEANFILES += \ test-glob.tglobfile \ test-glob.tgloblink1 \