glibc's glob.c currently does not handle patterns with a trailing slash
correctly.
https://sourceware.org/bugzilla/show_bug.cgi?id=22513.

This patch switches to gmake's own implementaion of glob until glibc is fixed.
Once glibc is fixed a version check can be added.
If the tests patch submitted in another email is applied then this patch should
be applied as well. Otherwise, gmake won't pass the tests on glibc systems.

regards, Dmitry

diff --git a/configure.ac b/configure.ac
index 4710832..1e0c6f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -410,7 +410,7 @@ AC_CACHE_CHECK([if system libc has GNU glob], 
[make_cv_sys_gnu_glob],
    gnu glob
 # endif
 #endif],
-        [make_cv_sys_gnu_glob=yes],
+        [make_cv_sys_gnu_glob=no],
         [make_cv_sys_gnu_glob=no])])
 AS_IF([test "$make_cv_sys_gnu_glob" = no],
 [ GLOBINC='-I$(srcdir)/glob'
 
diff --git a/glob/glob.c b/glob/glob.c
index f3911bc..6f8c8a4 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -57,6 +57,7 @@ USA.  */
 # endif
 #endif
 
+#undef ELIDE_CODE
 #ifndef ELIDE_CODE
 
 #if defined STDC_HEADERS || defined __GNU_LIBRARY__
@@ -208,7 +209,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ || __DJGPP__ */
 
 
-#if !defined __alloca && !defined __GNU_LIBRARY__
+#if !defined __alloca
 
 # ifdef        __GNUC__
 #  undef alloca
@@ -255,6 +256,10 @@ extern char *alloca ();
 # endif
 #endif
 
+#ifndef __stat
+# define __stat stat
+#endif
+
 #if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
 # undef        size_t
 # define size_t        unsigned int


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to