Apply this patch to the results of unpacking a make 4.2.1 tarball, then run the following commands: touch aclocal.m4 touch Makefile.in touch configure Now you should be able to reconfigure and rebuild. --- a/configure.ac 2016-06-06 08:27:31.000000000 -0400 +++ b/configure.ac 2019-05-04 14:24:17.102496612 -0400 @@ -399,10 +399,9 @@ #include #include -#define GLOB_INTERFACE_VERSION 1 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 # include -# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION +# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 gnu glob # endif #endif], --- a/dir.c 2016-05-31 03:17:26.000000000 -0400 +++ b/dir.c 2019-05-04 14:24:11.134431911 -0400 @@ -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 --- a/tests/run_make_tests.pl +++ b/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"; --- a/configure 2016-06-10 19:03:21.000000000 -0400 +++ b/configure 2019-05-04 14:33:03.212667798 -0400 @@ -11481,10 +11481,9 @@ #include #include -#define GLOB_INTERFACE_VERSION 1 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 # include -# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION +# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 gnu glob # endif #endif