diff --git a/tools/Makefile.host b/tools/Makefile.host index 77573a0d70..87560adacb 100644 --- a/tools/Makefile.host +++ b/tools/Makefile.host @@ -43,18 +43,18 @@ include ${TOPDIR}/tools/Config.mk # Define HOSTCC on the make command line if it differs from these defaults # Define HOSTCFLAGS with -g on the make command line to build debug versions -HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} +HOSTOS = ${shell uname -o || echo "Other"} -ifeq ($(CONFIG_WINDOWS_NATIVE),y) +ifeq ($(HOSTOS),MinGW) -# In the Windows native environment, the MinGW GCC compiler is assumed +# In the Windows native environment, the MinGW GCC compiler is used -HOSTCC ?= mingw-gcc.exe +HOSTCC ?= mingw32-gcc.exe HOSTCFLAGS ?= -O2 -Wall -Wstrict-prototypes -Wshadow -I. -DCONFIG_WINDOWS_NATIVE=y else -# GCC is assumed in the POSIX environment (Linux or Cygwin). +# GCC is assumed in all other POSIX environments (Linux, Cygwin, MSYS2). # strtok_r is used in some tools, but does not seem to be available in # the MinGW environment.