aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deymo <deymo@google.com>2016-01-21 20:47:11 -0800
committerAlex Deymo <deymo@google.com>2016-01-21 20:47:11 -0800
commitb137dc9b98e6200ed955ab1290df711a4b2c144a (patch)
tree1e7301898363f1b469ef81f667689b66db6e9271
parent2a25190ea741023a3753e7f381a8a2b1465c43c1 (diff)
downloadplatform_external_libbrillo-b137dc9b98e6200ed955ab1290df711a4b2c144a.tar.gz
platform_external_libbrillo-b137dc9b98e6200ed955ab1290df711a4b2c144a.tar.bz2
platform_external_libbrillo-b137dc9b98e6200ed955ab1290df711a4b2c144a.zip
Set default USE flags values as local variables.
Setting variables such as BRILLO_USE_FOO can leak to other makefiles, so the local default value set by another project can affect the default behavior. This patch defines local variables with the local default value for the USE flags. Bug: None TEST=mmma external/libbrillo Change-Id: Iefca0c4de48d7bd09d41b06ca18f1c95716f6fce
-rw-r--r--Android.mk17
1 files changed, 9 insertions, 8 deletions
diff --git a/Android.mk b/Android.mk
index f10575c..0b32d96 100644
--- a/Android.mk
+++ b/Android.mk
@@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Default values for the USE flags. Set these variables in your product .mk
-# file.
-BRILLO_USE_DBUS ?= 1
+# Default values for the USE flags. Override these USE flags from your product
+# by setting BRILLO_USE_* values. Note that we define local variables like
+# local_use_* to prevent leaking our default setting for other packages.
+local_use_dbus := $(if $(BRILLO_USE_DBUS),$(BRILLO_USE_DBUS),1)
LOCAL_PATH := $(call my-dir)
@@ -146,7 +147,7 @@ libbrillo_dbus_test_sources := \
libbrillo_CFLAGS := \
-Wall \
-Werror \
- -DUSE_DBUS=$(BRILLO_USE_DBUS)
+ -DUSE_DBUS=$(local_use_dbus)
libbrillo_CPPFLAGS :=
libbrillo_includes := external/gtest/include
libbrillo_shared_libraries := libchrome
@@ -181,7 +182,7 @@ LOCAL_CLANG := true
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
include $(BUILD_SHARED_LIBRARY)
-ifeq ($(BRILLO_USE_DBUS),1)
+ifeq ($(local_use_dbus),1)
# Shared dbus library for target
# ========================================================
@@ -198,7 +199,7 @@ LOCAL_CLANG := true
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) external/dbus
include $(BUILD_SHARED_LIBRARY)
-endif # BRILLO_USE_DBUS == 1
+endif # local_use_dbus == 1
# Shared minijail library for target
# ========================================================
@@ -360,11 +361,11 @@ LOCAL_STATIC_LIBRARIES := libgtest libchrome_test_helpers \
libbrillo-test-helpers libgmock libBionicGtestMain
LOCAL_SHARED_LIBRARIES := $(libbrillo_shared_libraries) libbrillo libcurl \
libbrillo-http libbrillo-stream libcrypto libprotobuf-cpp-lite
-ifeq ($(BRILLO_USE_DBUS),1)
+ifeq ($(local_use_dbus),1)
LOCAL_SRC_FILES += $(libbrillo_dbus_test_sources)
LOCAL_STATIC_LIBRARIES += libchrome_dbus_test_helpers
LOCAL_SHARED_LIBRARIES += libbrillo-dbus libchrome-dbus libdbus
-endif # BRILLO_USE_DBUS == 1
+endif # local_use_dbus == 1
LOCAL_CFLAGS := $(libbrillo_CFLAGS)
LOCAL_CPPFLAGS := $(libbrillo_CPPFLAGS) -Wno-sign-compare
LOCAL_CLANG := true