Skip to content

Commit 5296da9

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 <johannes.schindelin@gmx.de>
1 parent 23191a7 commit 5296da9

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

config.mak.uname

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -743,19 +743,13 @@ ifeq ($(uname_S),MINGW)
743743
ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
744744
BASIC_LDFLAGS += -Wl,--dynamicbase
745745
endif
746-
ifeq (MINGW32,$(MSYSTEM))
747-
prefix = /mingw32
748-
HOST_CPU = i686
749-
BASIC_LDFLAGS += -Wl,--pic-executable -Wl,--large-address-aware
750-
else ifeq (MINGW64,$(MSYSTEM))
751-
prefix = /mingw64
752-
HOST_CPU = x86_64
753-
BASIC_LDFLAGS += -Wl,--pic-executable
754-
else ifeq (CLANGARM64,$(MSYSTEM))
755-
prefix = /clangarm64
756-
HOST_CPU = aarch64
746+
ifneq (,$(MSYSTEM))
747+
prefix = $(MINGW_PREFIX)
748+
HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
757749
BASIC_LDFLAGS += -Wl,--pic-executable
758-
else
750+
ifeq (MINGW32,$(MSYSTEM))
751+
BASIC_LDFLAGS += -Wl,--large-address-aware
752+
endif
759753
endif
760754
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
761755
-fstack-protector-strong

0 commit comments

Comments
 (0)