From 2213aab8b9043d939752baa61910f970338a1e6b Mon Sep 17 00:00:00 2001
From: Thorsten Glaser
Date: Thu, 3 Jun 2010 19:57:02 +0200
Subject: [PATCH] Add new variable TARGET_SHELL := ash (default; or mksh)
Besides that, add enough magic to build everything tagged
as "shell_$(TARGET_SHELL)" and permit ash/mksh as not unusual
Change-Id: I36c0590ba49f45251d24dc179cb27c8368c3662a
---
core/base_rules.mk | 2 +-
core/build-system.html | 6 ++++--
core/config.mk | 3 +++
core/main.mk | 2 +-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 0d17c8382..2b95a5c89 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -65,7 +65,7 @@ endif
# Only the tags mentioned in this test are expected to be set by module
# makefiles. Anything else is either a typo or a source of unexpected
# behaviors.
-ifneq ($(filter-out user debug eng tests optional samples,$(LOCAL_MODULE_TAGS)),)
+ifneq ($(filter-out user debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),)
$(warning unusual tags $(LOCAL_MODULE_TAGS) on $(LOCAL_MODULE) at $(LOCAL_PATH))
endif
diff --git a/core/build-system.html b/core/build-system.html
index ce5e869cd..e547185c9 100644
--- a/core/build-system.html
+++ b/core/build-system.html
@@ -247,6 +247,7 @@ for these).
for eng
.
LOCAL_MODULE_TAGS
Set LOCAL_MODULE_TAGS
to any number of whitespace-separated
tags. If the tag list is empty or contains droid
, the module
-will get installed as part of a make droid
. Otherwise, it will
+will get installed as part of a make droid
. Modules with the tag
+shell_
$(TARGET_SHELL) will also be installed. Otherwise, it will
only get installed by running make <your-module>
or with the make all
pseudotarget.
diff --git a/core/config.mk b/core/config.mk
index 337152c91..0a306e13a 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -105,6 +105,9 @@ TARGET_COMPRESS_MODULE_SYMBOLS := false
# Default is to prelink modules.
TARGET_PRELINK_MODULE := true
+# Default shell is ash. Other possible value is mksh.
+TARGET_SHELL := ash
+
# ###############################################################
# Include sub-configuration files
# ###############################################################
diff --git a/core/main.mk b/core/main.mk
index 98ac4bbb7..46bf11a3f 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -561,7 +561,7 @@ else
endif
# Use tags to get the non-APPS user modules. Use the product
# definition files to get the APPS user modules.
-user_MODULES := $(sort $(call get-tagged-modules,user))
+user_MODULES := $(sort $(call get-tagged-modules,user shell_$(TARGET_SHELL)))
user_MODULES := $(user_MODULES) $(user_PACKAGES)
eng_MODULES := $(sort $(call get-tagged-modules,eng))