在 2026-2-8 06:22, Martin Storsjö 写道:
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?

When using the top-level configure, it is the case. This structure is required 
by recursive make.


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.

GCC does not search `-L` directories for CRT object files ({,g,dll}crt2.o), so this setup only allows building the CRT itself. In order to build tests, the CRT has to be installed first; and in that case, test programs are linked against pre-installed CRT object files. But such an issue has always been there.


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?

None, afaict.


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

Yeah exactly. I didn't skip it.


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.

Wile doing these changes, I noticed that `MINGW_HAS_DDK_H` is defined indirectly by _mingw.h. Technically, macros in there must be reserved names. Do you think DDK can be removed from repo? I will send a new series of patches for that, since the first one would no longer make any sense.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

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

Reply via email to