build: Add support for MSYS2

MSYS2 is a modern fork of Cygwin that is widely supported
and provides frequent releases and good support. It is
also the framework used by the official Windows Git port.
This patch adds MSYS2 support so that builds on Windows using
MSYS2 work properly.

Change-Id: Ia5743a410d1cff983a7aab37f8e3d8228cb8ae8e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2017-03-17 14:28:50 +01:00
parent efc68b4faf
commit 1436e44aa6
2 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,11 @@ endif
MAKEFLAGS += -rR --include-dir=$(CURDIR)
UNAME := $(shell uname)
ifeq (MINGW, $(findstring MINGW, $(UNAME)))
ifeq (MSYS, $(findstring MSYS, $(UNAME)))
DISABLE_TRYRUN=y
HOST_OS=MSYS
PWD_OPT=-W
else ifeq (MINGW, $(findstring MINGW, $(UNAME)))
HOST_OS=MINGW
PWD_OPT=-W
DISABLE_TRYRUN=y

View File

@ -35,10 +35,10 @@ fi
# zephyr-env_install.bash in your home directory. It will be automatically
# run (if it exists) by this script.
uname | grep -q MINGW && MINGW_OPT="-W"
uname | grep -q -P "MINGW|MSYS" && PWD_OPT="-W"
# identify OS source tree root directory
export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" && pwd ${MINGW_OPT})
export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" && pwd ${PWD_OPT})
scripts_path=${ZEPHYR_BASE}/scripts
scripts_path=$(echo "/$scripts_path" | sed 's/\\/\//g' | sed 's/://')