lib/fnmatch.c tests a HAVE___STRCHRNUL macro to implement an alternative __strchrnul().
Without this, compilation fails on OS/2 kLIBC due to duplicated declarations of __strchrnul() like this: ----- gcc -DHAVE_CONFIG_H -I. -I../src -D__ST_MT_ERRNO__ -Wno-cast-qual -Wno-conversion -Wno-float-equal -Wno-sign-compare -Wno-undef -Wno-unused-function -Wno-unused-parameter -Wno-float-conversion -Wimplicit-fallthrough -Wno-pedantic -Wno-sign-conversion -Wno-type-limits -Wno-unsuffixed-float-constants -O2 -Zomf -Zmt -MT libgnu_a-fnmatch.o -MD -MP -MF .deps/libgnu_a-fnmatch.Tpo -c -o libgnu_a-fnmatch.o `test -f 'fnmatch.c' || echo './'`fnmatch.c fnmatch.c:135:1: error: static declaration of '__strchrnul' follows non-static declaration 135 | __strchrnul (s, c) | ^~~~~~~~~~~ In file included from fnmatch.c:34: f:/lang/gcc/usr/include/string.h:198:10: note: previous declaration of '__strchrnul' was here 198 | char *__strchrnul(const char *, int); | ^~~~~~~~~~~ ----- * configure.ac: Check __strchrnul(). --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.ac b/configure.ac index 9f688971..17291d4a 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,9 @@ AC_FUNC_CLOSEDIR_VOID # dir.c and our glob.c use dirent.d_type if available AC_STRUCT_DIRENT_D_TYPE +# fnmatch.c uses __strchrnul() +AC_CHECK_FUNCS([__strchrnul]) + # See if the user wants to add (or not) GNU Guile support AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile], [Support GNU Guile for embedded scripting])]) -- 2.30.0