aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Bort <>2009-04-09 17:20:55 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-09 17:20:55 -0700
commitef09681e42fc693d5e3e800467d73e6021172bd9 (patch)
tree61ca3894ed1b8b3dccfe6ea14b1992d68841592a
parent15ca0bd5d0a028fd8e42f72a45f17d8e1ee67485 (diff)
downloadbuild-ef09681e42fc693d5e3e800467d73e6021172bd9.tar.gz
AI 145576: Probe for the proper sed(1) extended regex switchandroid-sdk-1.5-pre
Automated import of CL 145576
-rw-r--r--core/product_config.mk16
1 files changed, 15 insertions, 1 deletions
diff --git a/core/product_config.mk b/core/product_config.mk
index b793e43506..64488d8054 100644
--- a/core/product_config.mk
+++ b/core/product_config.mk
@@ -49,6 +49,20 @@ $(strip \
)
endef
+# TODO: push this into the combo files; unfortunately, we don't even
+# know HOST_OS at this point.
+trysed := $(shell echo a | sed -E -e 's/a/b/' 2>/dev/null)
+ifeq ($(trysed),b)
+ SED_EXTENDED := sed -E
+else
+ trysed := $(shell echo c | sed -r -e 's/c/d/' 2>/dev/null)
+ ifeq ($(trysed),d)
+ SED_EXTENDED := sed -r
+ else
+ $(error Unknown sed version)
+ endif
+endif
+
###########################################################
## List all of the files in a subdirectory in a format
## suitable for PRODUCT_COPY_FILES and
@@ -60,7 +74,7 @@ endef
###########################################################
define find-copy-subdir-files
-$(shell find $(2) -name "$(1)" | sed -E "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g")
+$(shell find $(2) -name "$(1)" | $(SED_EXTENDED) "s:($(2)/?(.*)):\\1\\:$(3)/\\2:" | sed "s://:/:g")
endef
# ---------------------------------------------------------------