From 421e0b3e18f28b636a66b6429cdd3c10282c3447 Mon Sep 17 00:00:00 2001 From: Steven Conaway Date: Thu, 31 Jan 2019 20:47:38 -0800 Subject: [PATCH] Make the script aware of sed's path --- Makefile | 4 ++-- esp-open-sdk-mac-bsd.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 313c05830..4133897f1 100644 --- a/Makefile +++ b/Makefile @@ -25,9 +25,9 @@ endif PATCH = patch -b -N UNZIP = unzip -q -o ifeq ($(MACOS),1) -SED = /usr/local/bin/sed +SED ?= /usr/local/bin/sed else -SED = sed +SED ?= sed endif VENDOR_SDK_ZIP = $(VENDOR_SDK_ZIP_$(VENDOR_SDK)) diff --git a/esp-open-sdk-mac-bsd.sh b/esp-open-sdk-mac-bsd.sh index 1888c3604..8ef8f8a43 100755 --- a/esp-open-sdk-mac-bsd.sh +++ b/esp-open-sdk-mac-bsd.sh @@ -31,13 +31,20 @@ elif [ ${MACOS} = 1 ]; then fi +if [ "$(echo "123 abc" | sed -r 's/[0-9]+/& &/')" = "123 123 abc" ]; +then + SED=$(which sed) + echo "Using sed from $SED" +else + echo no +fi # call make -if [ ${FREEBSD} = 1 ]; then - gmake STANDALONE=y FREEBSD=1 -elif [ ${MACOS} = 1 ]; then - make STANDALONE=y MACOS=1 +if [ ${FREEBSD} = 1 ]; then + gmake STANDALONE=y FREEBSD=1 SED=$SED +elif [ ${MACOS} = 1 ]; then + make STANDALONE=y MACOS=1 SED=$SED fi