-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathmake.patch
114 lines (107 loc) · 2.81 KB
/
make.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Written and placed in public domain by Jeffrey Walton.
# This patch fixes some issues with GNU Make.
--- configure.ac
+++ configure.ac
@@ -399,10 +399,9 @@
#include <glob.h>
#include <fnmatch.h>
-#define GLOB_INTERFACE_VERSION 1
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
+# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
gnu glob
# endif
#endif],
--- dir.c
+++ dir.c
@@ -407,6 +407,7 @@
const char *name; /* Name of the file. */
size_t length;
short impossible; /* This file is impossible. */
+ unsigned char type;
};
static unsigned long
@@ -731,6 +732,9 @@
#else
df->name = strcache_add_len (d->d_name, len);
#endif
+#ifdef _DIRENT_HAVE_D_TYPE
+ df->type = d->d_type;
+#endif
df->length = len;
df->impossible = 0;
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
@@ -1242,7 +1246,7 @@
d->d_namlen = len - 1;
#endif
#ifdef _DIRENT_HAVE_D_TYPE
- d->d_type = DT_UNKNOWN;
+ d->d_type = df->type;
#endif
memcpy (d->d_name, df->name, len);
return d;
@@ -1299,15 +1303,40 @@
}
#endif
+/* Similarly for lstat. */
+#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
+# ifndef VMS
+# ifndef HAVE_SYS_STAT_H
+int lstat (const char *path, struct stat *sbuf);
+# endif
+# else
+ /* We are done with the fake lstat. Go back to the real lstat */
+# ifdef lstat
+# undef lstat
+# endif
+# endif
+# define local_lstat lstat
+#elif defined(WINDOWS32)
+/* Windows doesn't support lstat(). */
+# define local_lstat local_stat
+#else
+static int
+local_lstat (const char *path, struct stat *buf)
+{
+ int e;
+ EINTRLOOP (e, lstat (path, buf));
+ return e;
+}
+#endif
+
void
dir_setup_glob (glob_t *gl)
{
gl->gl_opendir = open_dirstream;
gl->gl_readdir = read_dirstream;
gl->gl_closedir = free;
+ gl->gl_lstat = local_lstat;
gl->gl_stat = local_stat;
- /* We don't bother setting gl_lstat, since glob never calls it.
- The slot is only there for compatibility with 4.4 BSD. */
}
void
--- tests/run_make_tests.pl
+++ tests/run_make_tests.pl
@@ -58,6 +58,9 @@ if ($^O eq 'VMS')
*CORE::GLOBAL::rmdir = \&vms_rmdir;
}
+use FindBin;
+use lib "$FindBin::Bin";
+
require "test_driver.pl";
require "config-flags.pm";
--- configure 2016-06-10
+++ configure 2019-05-04
@@ -11481,10 +11481,9 @@
#include <glob.h>
#include <fnmatch.h>
-#define GLOB_INTERFACE_VERSION 1
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
+# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
gnu glob
# endif
#endif