Skip to content

Commit 6e21074

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 26ffba9 commit 6e21074

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
@@ -756,19 +756,13 @@ ifeq ($(uname_S),MINGW)
756756
ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS))))
757757
BASIC_LDFLAGS += -Wl,--dynamicbase
758758
endif
759-
ifeq (MINGW32,$(MSYSTEM))
760-
prefix = /mingw32
761-
HOST_CPU = i686
762-
BASIC_LDFLAGS += -Wl,--pic-executable -Wl,--large-address-aware
763-
else ifeq (MINGW64,$(MSYSTEM))
764-
prefix = /mingw64
765-
HOST_CPU = x86_64
766-
BASIC_LDFLAGS += -Wl,--pic-executable
767-
else ifeq (CLANGARM64,$(MSYSTEM))
768-
prefix = /clangarm64
769-
HOST_CPU = aarch64
759+
ifneq (,$(MSYSTEM))
760+
prefix = $(MINGW_PREFIX)
761+
HOST_CPU = $(patsubst %-w64-mingw32,%,$(MINGW_CHOST))
770762
BASIC_LDFLAGS += -Wl,--pic-executable
771-
else
763+
ifeq (MINGW32,$(MSYSTEM))
764+
BASIC_LDFLAGS += -Wl,--large-address-aware
765+
endif
772766
endif
773767
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
774768
-fstack-protector-strong

0 commit comments

Comments
 (0)