Commit

59ab0a53f610e4179f38ef45d3a8fb8ef2ae1906

mingw: set the prefix and HOST_CPU as per MSYS2's settings

MSYS2 already defines a couple of helpful environment variables, and we
can use those to infer the installation location as well as the CPU. No
need for hard-coding ;-)

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin <johannes.schindelin@gmx.de> · 2026-09-10 06:05 UTC · committed by Junio C Hamano

Browse files
1 file changed, +6 −12
modified config.mak.uname
@@ -754,19 +754,13 @@ ifeq ($(uname_S),MINGW)
754 754 ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
755 755 BASIC_LDFLAGS += -Wl,--dynamicbase
756 756 endif
757 - ifeq (MINGW32,$(MSYSTEM))
758 - prefix = /mingw32
759 - HOST_CPU = i686
760 - BASIC_LDFLAGS += -Wl,--pic-executable -Wl,--large-address-aware
761 - else ifeq (MINGW64,$(MSYSTEM))
762 - prefix = /mingw64
763 - HOST_CPU = x86_64
764 - BASIC_LDFLAGS += -Wl,--pic-executable
765 - else ifeq (CLANGARM64,$(MSYSTEM))
766 - prefix = /clangarm64
767 - HOST_CPU = aarch64
757 + ifneq (,$(MSYSTEM))
758 + prefix = $(MINGW_PREFIX)
759 + HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
768 760 BASIC_LDFLAGS += -Wl,--pic-executable
769 - else
761 + ifeq (MINGW32,$(MSYSTEM))
762 + BASIC_LDFLAGS += -Wl,--large-address-aware
763 + endif
770 764 endif
771 765 COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
772 766 -fstack-protector-strong