Add Android.mk support for building LLDB on Linux host.
This change adds support for building LLDB with the following
build command from the top level:
make FORCE_BUILD_LLVM_COMPONENTS=true ANDROID_BUILD_LLDB=true lldb
There are known issues with the google linux host gcc 4.6.2+ variant
currently used to build host executables. A follow up change will
apply a temporary work-around that will be used until either the
compiler is fixed or a new compiler is used.
Change-Id: I18451f73cbe2264074cd8fba6397680855352a93
diff --git a/host_shared_lldb.mk b/host_shared_lldb.mk
new file mode 100644
index 0000000..9fec7bb
--- /dev/null
+++ b/host_shared_lldb.mk
@@ -0,0 +1,80 @@
+# Don't build the library unless forced to.
+ifeq (true,$(ANDROID_BUILD_LLDB))
+# Don't build the library in unbundled branches.
+ifeq (,$(TARGET_BUILD_APPS))
+
+LOCAL_PATH:= $(call my-dir)
+
+LOCAL_IS_HOST_MODULE := true
+
+LOCAL_MODULE:= liblldb
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ liblldbInitAndLog \
+ liblldbAPI \
+ liblldbBreakpoint \
+ liblldbCommands \
+ liblldbCore \
+ liblldbDataFormatters \
+ liblldbExpression \
+ liblldbHostCommon \
+ liblldbHostLinux \
+ liblldbInterpreter \
+ liblldbPluginABIMacOSX_arm \
+ liblldbPluginABIMacOSX_i386 \
+ liblldbPluginABISysV_x86_64 \
+ liblldbPluginDisassemblerLLVM \
+ liblldbPluginDynamicLoaderMacOSX \
+ liblldbPluginDynamicLoaderPOSIX \
+ liblldbPluginDynamicLoaderStatic \
+ liblldbPluginEmulateInstructionARM \
+ liblldbPluginLanguageRuntimeCPlusPlusItaniumABI \
+ liblldbPluginLanguageRuntimeObjCAppleObjCRuntime \
+ liblldbPluginObjectContainerBSDArchive \
+ liblldbPluginObjectFileELF \
+ liblldbPluginObjectFilePECOFF \
+ liblldbPluginOperatingSystemPython \
+ liblldbPluginPlatformFreeBSD \
+ liblldbPluginPlatformGDBServer \
+ liblldbPluginPlatformLinux \
+ liblldbPluginPlatformMacOSX \
+ liblldbPluginProcessElfCore \
+ liblldbPluginProcessGDBRemote \
+ liblldbPluginProcessLinux \
+ liblldbPluginProcessPOSIX \
+ liblldbPluginSymbolFileDWARF \
+ liblldbPluginSymbolFileSymtab \
+ liblldbPluginSymbolVendorELF \
+ liblldbPluginUnwindAssemblyInstEmulation \
+ liblldbPluginUnwindAssemblyx86 \
+ liblldbPluginUtility \
+ liblldbSymbol \
+ liblldbTarget \
+ liblldbUtility
+
+LOCAL_SHARED_LIBRARIES := \
+ libLLVM \
+ libclang
+
+ifeq ($(HOST_OS),windows)
+ LOCAL_LDLIBS := -limagehlp -lpsapi
+else
+ LOCAL_LDLIBS := \
+ -ldl \
+ -lm \
+ -lpthread \
+ -lrt \
+ -lutil \
+ -lz
+endif
+
+PYTHON_BASE_PATH := prebuilts/python/linux-x86/2.7.5
+LOCAL_LDLIBS += $(PYTHON_BASE_PATH)/lib/libpython2.7.a
+
+include $(LLDB_BUILD_MK)
+include $(BUILD_HOST_SHARED_LIBRARY)
+
+endif # don't build in unbundled branches
+endif # don't build unless forced to