Create a bare bones host libbacktrace on mac.
This allows the libbacktrace library to compile for host on mac.
Bug: 12474939
Change-Id: I32cbcf996e6fe9057e5065ba21f89086343704a0
diff --git a/libbacktrace/Android.mk b/libbacktrace/Android.mk
index a6b9c2b..8995fc1 100644
--- a/libbacktrace/Android.mk
+++ b/libbacktrace/Android.mk
@@ -168,18 +168,15 @@
include $(BUILD_NATIVE_TEST)
#----------------------------------------------------------------------------
-# Only linux-x86 host versions of libbacktrace supported.
+# Only x86 host versions of libbacktrace supported.
#----------------------------------------------------------------------------
-ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
+ifeq ($(HOST_ARCH),x86)
#----------------------------------------------------------------------------
# The host libbacktrace library using libcorkscrew
#----------------------------------------------------------------------------
include $(CLEAR_VARS)
-LOCAL_SRC_FILES += \
- $(common_src) \
- Corkscrew.cpp \
LOCAL_CFLAGS += \
$(common_cflags) \
@@ -187,21 +184,12 @@
LOCAL_CONLYFLAGS += \
$(common_conlyflags) \
-LOCAL_CPPFLAGS += \
- $(common_cppflags) \
-
LOCAL_C_INCLUDES := \
$(common_c_includes) \
- system/core/libcorkscrew \
LOCAL_SHARED_LIBRARIES := \
libgccdemangle \
liblog \
- libcorkscrew \
-
-LOCAL_LDLIBS += \
- -ldl \
- -lrt \
LOCAL_MODULE := libbacktrace
LOCAL_MODULE_TAGS := optional
@@ -209,9 +197,38 @@
LOCAL_ADDITIONAL_DEPENDENCIES := \
$(LOCAL_PATH)/Android.mk
+ifeq ($(HOST_OS),linux)
+LOCAL_SRC_FILES += \
+ $(common_src) \
+ Corkscrew.cpp \
+
+LOCAL_C_INCLUDES += \
+ system/core/libcorkscrew \
+
+LOCAL_SHARED_LIBRARIES := \
+ libcorkscrew \
+
+LOCAL_CPPFLAGS += \
+ $(common_cppflags) \
+
+LOCAL_LDLIBS += \
+ -ldl \
+ -lrt \
+
+else
+LOCAL_SRC_FILES += \
+ map_info.c \
+
+endif
+
include $(BUILD_HOST_SHARED_LIBRARY)
#----------------------------------------------------------------------------
+# The host test is only supported on linux.
+#----------------------------------------------------------------------------
+ifeq ($(HOST_OS),linux)
+
+#----------------------------------------------------------------------------
# libbacktrace host test library, all optimizations turned off
#----------------------------------------------------------------------------
include $(CLEAR_VARS)
@@ -263,4 +280,6 @@
include $(BUILD_HOST_NATIVE_TEST)
-endif # HOST_OS-HOST_ARCH == linux-x86
+endif # HOST_OS == linux
+
+endif # HOST_ARCH == x86