Am 19.01.2026 um 15:17 schrieb Markus Muetzel:
I inserted an additional patch after the first one that should make sure that the configure script is re-run if necessary on incremental `make`.


There is no need to run `autoconf` when any of the input files for the files that are generated by the `configure` scripts changed. Running `configure` on an incremental `make` is sufficient in that case.

Addressing that is the only change with respect to the patch series I sent earlier.


Markus

From 22e6bd86d4129f95d40ff534552954b3c93abe32 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 14:48:47 +0100
Subject: [PATCH 1/4] Generate crt/sdks/_mingw_ddk.h with configure script.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The header `_mingw_ddk.h` is included as `sdks/_mingw_ddk.h` from `_mingw.h`
and it must be available before any other target is built.

Generate it using the configure script in the correct relative location to
that header.

Signed-off-by: Markus Mützel <[email protected]>
---
 mingw-w64-headers/Makefile.am              | 4 ----
 mingw-w64-headers/configure.ac             | 1 +
 mingw-w64-headers/crt/sdks/_mingw_ddk.h.in | 2 +-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index 6ebeda477..af260e795 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -21,7 +21,6 @@ gdiplushead_HEADERS = @GDIPLUSHEAD_LIST@
 wrlhead_HEADERS = @WRLHEAD_LIST@
 wrlwrappershead_HEADERS = @WRLWRAPPERSHEAD_LIST@
 mingwhelperhead_HEADERS = @MINGWHELPERHEAD_LIST@
-nodist_sdkshead_HEADERS = _mingw_ddk.h
 noinst_HEADERS = crt/sdks/_mingw_ddk.h.in
 
 ddkheaddir = $(baseheaddir)/ddk
@@ -413,6 +412,3 @@ include/prsht.h: ;
 include/wincrypt.h: ;
 
 endif
-
-_mingw_ddk.h: $(srcdir)/crt/sdks/_mingw_ddk.h.in
-       $(SED) s/MINGW_HAS_DDK$$/@MINGW_HAS_DDK@/ $< > $@
diff --git a/mingw-w64-headers/configure.ac b/mingw-w64-headers/configure.ac
index 3211fbd18..bb2d1455d 100644
--- a/mingw-w64-headers/configure.ac
+++ b/mingw-w64-headers/configure.ac
@@ -199,6 +199,7 @@ AC_SUBST([DEFAULT_MSVCRT_VERSION])
 AC_CONFIG_FILES([
   Makefile
   crt/_mingw.h
+  crt/sdks/_mingw_ddk.h
 ])
 AC_OUTPUT
 
diff --git a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in 
b/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
index 0978eddeb..564e2e8ac 100644
--- a/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
+++ b/mingw-w64-headers/crt/sdks/_mingw_ddk.h.in
@@ -1,6 +1,6 @@
 #ifndef MINGW_DDK_H
 #define MINGW_DDK_H
-#if MINGW_HAS_DDK
+#if @MINGW_HAS_DDK@
 #define MINGW_HAS_DDK_H 1
 #endif
 #endif
-- 
2.51.0.windows.2

From 68045e908d6dea01528f529b7a0f82c2f51618b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 15:05:25 +0100
Subject: [PATCH 2/4] Trigger a re-run of the configure scripts on incremental
 make if needed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Some files are generated from sources when the configure script is run.

Let `make` re-run the corresponding configure script if some of these source
files changed.

Signed-off-by: Markus Mützel <[email protected]>
---
 Makefile.am                                    | 8 ++++++++
 mingw-w64-crt/Makefile.am                      | 2 ++
 mingw-w64-headers/Makefile.am                  | 2 ++
 mingw-w64-libraries/libmangle/Makefile.am      | 2 ++
 mingw-w64-libraries/pseh/Makefile.am           | 2 ++
 mingw-w64-libraries/winpthreads/Makefile.am    | 2 ++
 mingw-w64-libraries/winstorecompat/Makefile.am | 2 ++
 mingw-w64-tools/gendef/Makefile.am             | 2 ++
 mingw-w64-tools/genidl/Makefile.am             | 2 ++
 mingw-w64-tools/genpeimg/Makefile.am           | 2 ++
 mingw-w64-tools/widl/Makefile.am               | 2 ++
 11 files changed, 28 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 308b6fd9d..8aa82ef6c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,29 +1,37 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
 if HEADER
   MAYBE_HEADER = mingw-w64-headers
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_HEADER)/Makefile.in 
$(MAYBE_HEADER)/crt/_mingw.h.in $(MAYBE_HEADER)/crt/sdks/_mingw_ddk.h.in
 endif
 
 if CRT
   MAYBE_CRT = mingw-w64-crt
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_CRT)/Makefile.in
 endif
 
 if LIBRARIES_MANGLE
   MAYBE_LIBRARIES_MANGLE = mingw-w64-libraries/libmangle
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_LIBRARIES_MANGLE)/Makefile.in
 endif
 
 if LIBRARIES_PSEH
   MAYBE_LIBRARIES_PSEH = mingw-w64-libraries/pseh
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_LIBRARIES_PSEH)/Makefile.in
 endif
 
 if LIBRARIES_WINPTHREADS
   MAYBE_LIBRARIES_WINPTHREADS = mingw-w64-libraries/winpthreads
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_LIBRARIES_WINPTHREADS)/Makefile.in
 endif
 
 if TOOLS_GENDEF
   MAYBE_TOOLS_GENDEF = mingw-w64-tools/gendef
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_TOOLS_GENDEF)/Makefile.in
 endif
 
 if TOOLS_GENIDL
   MAYBE_TOOLS_GENIDL = mingw-w64-tools/genidl
+  CONFIG_STATUS_DEPENDENCIES += $(MAYBE_TOOLS_GENIDL)/Makefile.in
 endif
 
 SUBDIRS = $(MAYBE_HEADER) $(MAYBE_CRT) $(MAYBE_LIBRARIES_MANGLE) 
$(MAYBE_LIBRARIES_PSEH) $(MAYBE_LIBRARIES_WINPTHREADS) $(MAYBE_TOOLS_GENDEF) 
$(MAYBE_TOOLS_GENIDL)
diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 74f35ea12..dc3d3cabd 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -11,6 +11,8 @@
 
 #AUTOMAKE_OPTIONS = color-tests
 
+CONFIG_STATUS_DEPENDENCIES = Makefile.in testcases/Makefile.in
+
 if WITHSYSROOT
   sysincludes="-I@TARGET_SYSTEM_ROOT@/include"
   withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"
diff --git a/mingw-w64-headers/Makefile.am b/mingw-w64-headers/Makefile.am
index af260e795..8fa594070 100644
--- a/mingw-w64-headers/Makefile.am
+++ b/mingw-w64-headers/Makefile.am
@@ -31,6 +31,8 @@ idlhead_HEADERS = @IDLHEAD_LIST@
 
 CLEANFILES = $(nodist_sdkshead_HEADERS)
 
+CONFIG_STATUS_DEPENDENCIES = Makefile.in crt/_mingw.h.in 
crt/sdks/_mingw_ddk.h.in
+
 DISTCHECK_CONFIGURE_FLAGS = --enable-crt --enable-sdk=all --enable-idl
 
 EXTRA_DIST = $(srcdir)/ChangeLog.* include crt ddk tlb
diff --git a/mingw-w64-libraries/libmangle/Makefile.am 
b/mingw-w64-libraries/libmangle/Makefile.am
index 42c332cf5..88bf4145e 100644
--- a/mingw-w64-libraries/libmangle/Makefile.am
+++ b/mingw-w64-libraries/libmangle/Makefile.am
@@ -1,3 +1,5 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 lib_LIBRARIES = libmangle.a
 
 libmangle_a_SOURCES = \
diff --git a/mingw-w64-libraries/pseh/Makefile.am 
b/mingw-w64-libraries/pseh/Makefile.am
index ff34dad60..96f349233 100644
--- a/mingw-w64-libraries/pseh/Makefile.am
+++ b/mingw-w64-libraries/pseh/Makefile.am
@@ -1,5 +1,7 @@
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 AM_CPPFLAGS = -I$(srcdir)/include
 AM_CFLAGS = -Wall -Wstrict-aliasing=2 -pedantic
 
diff --git a/mingw-w64-libraries/winpthreads/Makefile.am 
b/mingw-w64-libraries/winpthreads/Makefile.am
index d602e6c64..dbd5a3a06 100644
--- a/mingw-w64-libraries/winpthreads/Makefile.am
+++ b/mingw-w64-libraries/winpthreads/Makefile.am
@@ -1,4 +1,6 @@
 
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 SUBDIRS = . tests
 
 AM_CFLAGS =
diff --git a/mingw-w64-libraries/winstorecompat/Makefile.am 
b/mingw-w64-libraries/winstorecompat/Makefile.am
index 22a9eea8c..0a60cc604 100644
--- a/mingw-w64-libraries/winstorecompat/Makefile.am
+++ b/mingw-w64-libraries/winstorecompat/Makefile.am
@@ -1,5 +1,7 @@
 AUTOMAKE_OPTIONS = foreign subdir-objects
 
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 AM_CFLAGS = -Wall -Wstrict-aliasing=2 -pedantic
 
 lib_LIBRARIES = libwinstorecompat.a \
diff --git a/mingw-w64-tools/gendef/Makefile.am 
b/mingw-w64-tools/gendef/Makefile.am
index bcd85664c..3d0b6f9ac 100644
--- a/mingw-w64-tools/gendef/Makefile.am
+++ b/mingw-w64-tools/gendef/Makefile.am
@@ -1,3 +1,5 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 bin_PROGRAMS = gendef
 AM_LDFLAGS = @GENDEF_LDFLAGS@
 AM_CPPFLAGS = @GENDEF_CPPFLAGS@
diff --git a/mingw-w64-tools/genidl/Makefile.am 
b/mingw-w64-tools/genidl/Makefile.am
index b7c77dc38..d6bb9711c 100644
--- a/mingw-w64-tools/genidl/Makefile.am
+++ b/mingw-w64-tools/genidl/Makefile.am
@@ -1,3 +1,5 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 bin_PROGRAMS = genidl
 
 genidl_SOURCES = \
diff --git a/mingw-w64-tools/genpeimg/Makefile.am 
b/mingw-w64-tools/genpeimg/Makefile.am
index 3f5219b00..94f99df30 100644
--- a/mingw-w64-tools/genpeimg/Makefile.am
+++ b/mingw-w64-tools/genpeimg/Makefile.am
@@ -1,3 +1,5 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 bin_PROGRAMS = genpeimg
 genpeimg_SOURCES = src/img.h src/img.c src/img_pe.c src/genpeimg.c
 genpeimg_CPPFLAGS = -Isrc
diff --git a/mingw-w64-tools/widl/Makefile.am b/mingw-w64-tools/widl/Makefile.am
index 75558b068..4fbe86577 100644
--- a/mingw-w64-tools/widl/Makefile.am
+++ b/mingw-w64-tools/widl/Makefile.am
@@ -1,3 +1,5 @@
+CONFIG_STATUS_DEPENDENCIES = Makefile.in
+
 bin_PROGRAMS = widl
 
 widl_SOURCES = src/widl.h \
-- 
2.51.0.windows.2

From 13861513fbf18e6ea891f32cb72a34edd4126d33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 15:08:29 +0100
Subject: [PATCH 3/4] Prefer headers in the source tree and generated headers
 over installed ones
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Add `-I` flags to the preprocessor flags that prefer headers in the source
tree or headers the have been generated over ones that are installed.

Signed-off-by: Markus Mützel <[email protected]>
---
 mingw-w64-crt/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index dc3d3cabd..e0dad22f9 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -13,11 +13,11 @@
 
 CONFIG_STATUS_DEPENDENCIES = Makefile.in testcases/Makefile.in
 
+sysincludes=-I$(top_srcdir)/../mingw-w64-headers/include 
-I$(top_srcdir)/../mingw-w64-headers/crt 
-I$(top_builddir)/../mingw-w64-headers/crt
 if WITHSYSROOT
-  sysincludes="-I@TARGET_SYSTEM_ROOT@/include"
+  sysincludes += "-I@TARGET_SYSTEM_ROOT@/include"
   withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"
 else
-  sysincludes=
   withsys=
 endif
 
-- 
2.51.0.windows.2

From c3f0b548b0c7422d314856af4dc4e8d1794e321f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
Date: Mon, 19 Jan 2026 15:11:46 +0100
Subject: [PATCH 4/4] Use in-tree and generated headers and built libraries in
 tests.

---
 mingw-w64-crt/testcases/Makefile.am         | 28 +++++++++++++++++++--
 mingw-w64-crt/testcases/complex/Makefile.am |  6 +++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/testcases/Makefile.am 
b/mingw-w64-crt/testcases/Makefile.am
index 45a61d6dc..6f3006e3e 100644
--- a/mingw-w64-crt/testcases/Makefile.am
+++ b/mingw-w64-crt/testcases/Makefile.am
@@ -1,6 +1,30 @@
+sysincludes=-I$(top_srcdir)/../mingw-w64-headers/include 
-I$(top_srcdir)/../mingw-w64-headers/crt 
-I$(top_builddir)/../mingw-w64-headers/crt
+if WITHSYSROOT
+  sysincludes += "-I@TARGET_SYSTEM_ROOT@/include"
+  withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"
+else
+  withsys=
+endif
+
 TEST_CFLAGS=-Wno-format -Wno-unused-parameter -Wno-error=unused-function
-AM_CFLAGS=@ADD_C_CXX_WARNING_FLAGS@ @ADD_C_ONLY_WARNING_FLAGS@ $(TEST_CFLAGS) 
-Wno-missing-prototypes
-AM_CXXFLAGS=@ADD_C_CXX_WARNING_FLAGS@ @ADD_CXX_ONLY_WARNING_FLAGS@ 
$(TEST_CFLAGS)
+AM_CFLAGS=$(sysincludes) @ADD_C_CXX_WARNING_FLAGS@ @ADD_C_ONLY_WARNING_FLAGS@ 
$(TEST_CFLAGS) -Wno-missing-prototypes
+AM_CXXFLAGS=$(sysincludes) @ADD_C_CXX_WARNING_FLAGS@ 
@ADD_CXX_ONLY_WARNING_FLAGS@ $(TEST_CFLAGS)
+if LIB64
+AM_LDFLAGS=-L$(top_builddir)/lib64
+else
+if LIB32
+AM_LDFLAGS=-L$(top_builddir)/lib32
+else
+if LIBARM64
+AM_LDFLAGS=-L$(top_builddir)/libarm64
+else
+if LIBARM32
+AM_LDFLAGS=-L$(top_builddir)/libarm32
+endif
+endif
+endif
+endif
+
 
 # Testsuite options
 #
diff --git a/mingw-w64-crt/testcases/complex/Makefile.am 
b/mingw-w64-crt/testcases/complex/Makefile.am
index 013758e22..173259dbe 100644
--- a/mingw-w64-crt/testcases/complex/Makefile.am
+++ b/mingw-w64-crt/testcases/complex/Makefile.am
@@ -46,6 +46,11 @@
 # Due to automake limitations, references are relative to the top level,
 # and not the subdirectory in which this resides.
 
+CPPFLAGS32 ?= $(AM_CPPFLAGS)
+CPPFLAGS64 ?= $(AM_CPPFLAGS)
+LDFLAGS32 ?= $(AM_LDFLAGS)
+LDFLAGS64 ?= $(AM_LDFLAGS)
+
 # Complex library check sources.
 check_complex_lib_sources = \
   complex/complex_test.h \
@@ -244,6 +249,7 @@ endif LIB32
 # 64 bit tests.
 if LIB64
 
+
 # Complex library support libs.
 newcomplex_test_lib64 = \
   tests64/libnewcomplextestsf.a \
-- 
2.51.0.windows.2

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to