GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
mingw

MinGW: Honor --with-local-dir and --with-native-system-header-dir

MinGW build system now respects configure options for system header and local installation directories.

The MinGW build system has been updated to correctly honor the --with-native-system-header-dir and --with-local-prefix configure options. Previously, the native system header directory was hardcoded to /mingw/include and the local include directory was overridden, regardless of configure-time settings. This change ensures greater flexibility in cross-compilation setups by respecting user-specified directory configurations.

In Details

This commit modifies the MinGW cross-compilation configuration to respect configure-time options. Specifically, config/mingw/mingw32.h no longer forces NATIVE_SYSTEM_HEADER_DIR to /mingw/include, allowing --with-native-system-header-dir to take effect. Additionally, the MinGW host make fragment (config/i386/x-mingw32) no longer overrides local_includedir, ensuring that --with-local-prefix is honored. This resolves PR126608 by making the build system more compliant with standard GCC configuration practices.

For Context
MinGW
Minimalist GNU for Windows, a software development environment that provides a GNU toolchain (like GCC) for creating Windows applications.
cross-compilation
The process of developing software on one platform (the host) for another platform (the target), requiring a cross-compiler that runs on the host but generates code for the target.
configure script
A script run before building software that checks the system environment and system headers, and generates configuration files and Makefiles tailored for the host and target systems.
local_includedir
A configuration variable in GCC that specifies the directory where local include files (often for user-specific libraries or headers) should be searched or installed.
native system header directory
The directory where the compiler expects to find the standard system header files for the target architecture and operating system.
Filed Under: mingwbuild systemcompiler