Skip to content

Commit cfa4e50

Browse files
dschoGit for Windows Build Agent
authored andcommitted
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 ;-) Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 97db40d commit cfa4e50

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

config.mak.uname

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -747,19 +747,13 @@ ifeq ($(uname_S),MINGW)
747747
ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
748748
BASIC_LDFLAGS += -Wl,--dynamicbase
749749
endif
750-
ifeq (MINGW32,$(MSYSTEM))
751-
prefix = /mingw32
752-
HOST_CPU = i686
753-
BASIC_LDFLAGS += -Wl,--pic-executable -Wl,--large-address-aware
754-
else ifeq (MINGW64,$(MSYSTEM))
755-
prefix = /mingw64
756-
HOST_CPU = x86_64
757-
BASIC_LDFLAGS += -Wl,--pic-executable
758-
else ifeq (CLANGARM64,$(MSYSTEM))
759-
prefix = /clangarm64
760-
HOST_CPU = aarch64
750+
ifneq (,$(MSYSTEM))
751+
prefix = $(MINGW_PREFIX)
752+
HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
761753
BASIC_LDFLAGS += -Wl,--pic-executable
762-
else
754+
ifeq (MINGW32,$(MSYSTEM))
755+
BASIC_LDFLAGS += -Wl,--large-address-aware
756+
endif
763757
endif
764758
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
765759
-DENSURE_MSYSTEM_IS_SET -fstack-protector-strong

0 commit comments

Comments
 (0)