Added BUILD_HOST_static to build statically linked executable/shared-lib
Statically linked executable/shared-lib (eg. SDK tools) are useful
in sandboxed environment.
In BUILD_HOST_static zipalign needs -lpthread indirectly:
zipalign->libutils.a->liblog.a->logd_write.c->pthread
Change-Id: I615f574e918c83ed1ab82db2453b69d0420cb59c
diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk
index 85bb2cd..23f3994 100644
--- a/core/combo/HOST_darwin-x86.mk
+++ b/core/combo/HOST_darwin-x86.mk
@@ -29,6 +29,11 @@
HOST_GLOBAL_LDFLAGS += -m32
endif # BUILD_HOST_64bit
+ifneq ($(strip $(BUILD_HOST_static)),)
+# Statically-linked binaries are desirable for sandboxed environment
+HOST_GLOBAL_LDFLAGS += -static
+endif # BUILD_HOST_static
+
build_mac_version := $(shell sw_vers -productVersion)
mac_sdk_version := 10.6
mac_sdk_root := /Developer/SDKs/MacOSX$(mac_sdk_version).sdk