Skip to content

Commit

Permalink
Update make to 4.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
starg2 committed Jul 20, 2023
1 parent 802e6b7 commit 32a65c8
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 24 deletions.
11 changes: 11 additions & 0 deletions patches/make/make-4.3_undef-HAVE_STRUCT_DIRENT_D_TYPE.patch
@@ -0,0 +1,11 @@
--- a/src/config.h.W32
+++ b/src/config.h.W32
@@ -348,7 +348,7 @@
/* Define to 1 if `d_type' is a member of `struct dirent'. */
/* SV 57152: MinGW64 version of dirent doesn't support d_type. */
-#ifndef __MINGW64__
+#ifndef __MINGW32__
# define HAVE_STRUCT_DIRENT_D_TYPE 1
#endif

/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
37 changes: 37 additions & 0 deletions patches/make/make-4.4-timestamps.patch
@@ -0,0 +1,37 @@
From 1f542f915d6a3f8a69a4acae94b01185df7ee2a6 Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgads@gmail.com>
Date: Wed, 2 Nov 2022 18:23:57 +0200
Subject: [PATCH] Fix reading file timestamp as 64-bit on MinGW32

Commit 01142a53c9d (Add support for intmax_t) added support for 64-bit
time_t by defining __MINGW_USE_VC2005_COMPAT. But this only works with
_stat64 as expected. When stat is used on 32-bit systems, it returns a
bad timestamp (for example, 72586185920376753).

This triggers the following errors every time make is executed:
mingw32-make: Warning: File 'Makefile' has modification time 7.3e+16 s in the future
mingw32-make: warning: Clock skew detected. Your build may be incomplete.

and of course, dependencies are completely broken.

Fix by enabling _stat64 also for MinGW.
---
src/remake.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/remake.c b/src/remake.c
index 4ce3d2a3..83b0b79d 100644
--- a/src/remake.c
+++ b/src/remake.c
@@ -37,7 +37,7 @@
#include <windows.h>
#include <io.h>
#include <sys/stat.h>
-#if defined(_MSC_VER) && _MSC_VER > 1200
+#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER > 1200)
/* VC7 or later supports _stat64 to access 64-bit file size. */
#define STAT _stat64
#else
--
2.38.1.windows.1.1.gfa087c7d8f

22 changes: 2 additions & 20 deletions patches/make/make-getopt.patch
Expand Up @@ -11,8 +11,8 @@ Index: getopt.c
RCS file: /sources/make/make/getopt.c,v
retrieving revision 1.22
diff -u -p -r1.22 getopt.c
--- make-3.82.orig/getopt.c 25 Oct 2009 18:56:45 -0000 1.22
+++ make-3.82/getopt.c 5 Jul 2010 20:05:22 -0000
--- make-3.82.orig/src/getopt.c 25 Oct 2009 18:56:45 -0000 1.22
+++ make-3.82/src/getopt.c 5 Jul 2010 20:05:22 -0000
@@ -436,6 +436,9 @@ _getopt_initialize (int argc, char *cons
}
else
Expand All @@ -23,21 +23,3 @@ diff -u -p -r1.22 getopt.c
#endif

return optstring;
@@ -678,7 +681,7 @@ _getopt_internal (int argc, char *const
optarg = nameend + 1;
else
{
- if (opterr)
+ if (opterr) {
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
@@ -689,7 +692,7 @@ _getopt_internal (int argc, char *const
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
-
+ }
nextchar += strlen (nextchar);

optopt = pfound->val;
4 changes: 2 additions & 2 deletions patches/make/make-linebuf-mingw.patch
@@ -1,5 +1,5 @@
--- make.orig/main.c
+++ make/main.c
--- make.orig/src/main.c
+++ make/src/main.c
@@ -971,8 +971,11 @@

#endif
Expand Down
6 changes: 4 additions & 2 deletions scripts/make.sh
Expand Up @@ -35,10 +35,10 @@

# **************************************************************************

PKG_VERSION=4.2.1
PKG_VERSION=4.4.1
PKG_NAME=make-${PKG_VERSION}
PKG_DIR_NAME=make-${PKG_VERSION}
PKG_TYPE=.tar.bz2
PKG_TYPE=.tar.gz
PKG_URLS=(
"https://ftpmirror.gnu.org/gnu/make/make-${PKG_VERSION}${PKG_TYPE}"
)
Expand All @@ -53,6 +53,8 @@ PKG_PRIORITY=main
PKG_PATCHES=(
make/make-linebuf-mingw.patch
make/make-getopt.patch
make/make-4.3_undef-HAVE_STRUCT_DIRENT_D_TYPE.patch
make/make-4.4-timestamps.patch
)

#
Expand Down

0 comments on commit 32a65c8

Please sign in to comment.