On Thu, 22 Jan 2026, LIU Hao wrote:

From c73a4f099f3fc7fa65b9b7aed735371a19a87b65 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Thu, 22 Jan 2026 10:32:37 +0800
Subject: [PATCH 1/5] headers: Move `MINGW_HAS_DDK_H` from sdks/_mingw_ddk.h to
_mingw.h

This eliminates the need for sdks/_mingw_ddk.h, so all build rules about it
can be removed.

This patch looks ok

From 2597f36659a3e8059d82543807eff32a8c300555 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 15:58:08 +0800
Subject: [PATCH 2/5] headers: Remove unused `AC_PROG_SED`

It'd be good to clarify, the _now_ unused AC_PROG_SED; it didn't use to be unused before.

Other than that, the change looks ok.

From 47544dbc555a0344068fe30149db763443b46eb9 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/5] 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 `-isystem` to the preprocessor flags that prefer headers in the source
tree or headers the have been generated over ones that have been installed.

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

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 74f35ea12..f3d45d05b 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -11,11 +11,13 @@

#AUTOMAKE_OPTIONS = color-tests

+sysincludes = -isystem $(top_srcdir)/../mingw-w64-headers/include \
+              -isystem $(top_srcdir)/../mingw-w64-headers/crt \

These two could indeed be found without problem this way

+              -isystem $(top_builddir)/../mingw-w64-headers/crt

But this one doesn't seem to be generic enough - it seems to assume a specific layout between the build directories for crt and headers.

I presume this is for the case of building both through the toplevel autoconf files in the project root? So you'd have a build directory, with mingw-w64-headers and mingw-w64-crt build directories next to each other in it?

It's probably harmless in one sense to add this, as it won't find anything if using a different build layout, but it would be nice if we could set this up so that one could pass e.g. a --with-headers-builddir= or something like that, to make the same work for any build configuration.

But on the other hand as well, it's a lot of work, where the only thing we really need it for, is _mingw.h.

In theory we could generate a separate _mingw.h for use in the build of the crt as well. Most things (like default CRT, default _WIN32_WINNT) doesn't really matter, as it is overridden anyway, during the build of the crt files. But if we want to build tests too (not sure yet if this patchset gets there or not), we'd want to have the real values of those. The default CRT is known here anyway.

if WITHSYSROOT
-  sysincludes="-I@TARGET_SYSTEM_ROOT@/include"
+  sysincludes+="-isystem @TARGET_SYSTEM_ROOT@/include"
  withsys="--with-sysroot=@TARGET_SYSTEM_ROOT@"

This change looks correct, and could maybe even be split out into a separate preceding commit (except for the = vs += change).

From 556a15a7510536bf5926c0190d2ce517965d8ef5 Mon Sep 17 00:00:00 2001
From: LIU Hao <[email protected]>
Date: Tue, 20 Jan 2026 13:38:55 +0800
Subject: [PATCH 4/5] headers: Remove obsolete 'defaults' directory

Signed-off-by: LIU Hao <[email protected]>
---
mingw-w64-headers/defaults/generate.sh               | 3 ---
mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h | 6 ------
2 files changed, 9 deletions(-)
delete mode 100755 mingw-w64-headers/defaults/generate.sh
delete mode 100644 mingw-w64-headers/defaults/include/sdks/_mingw_ddk.h

This looks ok... Was this file ever used for anything anywhere, or would one have to manually copy it to use it?

The patch subjects talk about [../5], I presume the fifth patch that wasn't sent is for regenerating autoconf/automake files?

Overall, I like the direction, I've been thinking about something like this too, for being able to build and run crt tests without installing the built libraries as well.

// Martin

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

Reply via email to