From 1436e44aa684450d90bf391b404da96725ec9f16 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Fri, 17 Mar 2017 14:28:50 +0100 Subject: [PATCH] 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 --- Makefile | 6 +++++- zephyr-env.sh | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d09d2c22040..70c3d79e48e 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/zephyr-env.sh b/zephyr-env.sh index 2027ae5cc62..d758a8d8481 100644 --- a/zephyr-env.sh +++ b/zephyr-env.sh @@ -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/://')