Commit

843047f8613da2f38f024c5b69e7e89a4ff175fb

mingw: only enable the MSYS2-specific stuff when compiling in MSYS2

The tell-tale is the presence of the `MSYSTEM` value while compiling, of
course. In that case, we want to ensure that `MSYSTEM` is set when
running `git.exe`, and also enable the magic MSYS2 tty detection.

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, +2 −2
modified config.mak.uname
@@ -758,12 +758,12 @@ ifeq ($(uname_S),MINGW)
758 758 prefix = $(MINGW_PREFIX)
759 759 HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
760 760 BASIC_LDFLAGS += -Wl,--pic-executable
761 + COMPAT_CFLAGS += -DDETECT_MSYS_TTY
761 762 ifeq (MINGW32,$(MSYSTEM))
762 763 BASIC_LDFLAGS += -Wl,--large-address-aware
763 764 endif
764 765 endif
765 - COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
766 - -fstack-protector-strong
766 + COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -fstack-protector-strong
767 767 EXTLIBS += -lntdll
768 768 EXTRA_PROGRAMS += headless-git$X
769 769 INSTALL = /bin/install