Merge "ART: Compile libctstiagent with the NDK"
diff --git a/openjdkjvmti/Android.bp b/openjdkjvmti/Android.bp
index 1553b78..81b69e8 100644
--- a/openjdkjvmti/Android.bp
+++ b/openjdkjvmti/Android.bp
@@ -17,6 +17,7 @@
     name: "libopenjdkjvmti_headers",
     host_supported: true,
     export_include_dirs: ["include"],
+    sdk_version: "current",
 }
 
 cc_defaults {
diff --git a/test/Android.bp b/test/Android.bp
index e2516bd..72cdd41 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -200,7 +200,11 @@
 
 art_cc_defaults {
     name: "libtiagent-base-defaults",
-    defaults: ["libartagent-defaults"],
+    defaults: [
+        "art_test_defaults",
+        "art_defaults",
+        // Not derived from libartagent-defaults for NDK.
+    ],
     srcs: [
         // These are the ART-independent parts.
         "ti-agent/agent_common.cc",
@@ -274,8 +278,8 @@
         "1943-suspend-raw-monitor-wait/native_suspend_monitor.cc",
         "1946-list-descriptors/descriptors.cc",
     ],
+    // Use NDK-compatible headers for ctstiagent.
     header_libs: [
-        "jni_headers",
         "libopenjdkjvmti_headers",
     ],
     include_dirs: ["art/test/ti-agent"],
@@ -283,7 +287,10 @@
 
 art_cc_defaults {
     name: "libtiagent-defaults",
-    defaults: ["libtiagent-base-defaults"],
+    defaults: [
+        "libtiagent-base-defaults",
+        "libartagent-defaults",
+    ],
     srcs: [
         // This is to get the IsInterpreted native method.
         "common/stack_inspect.cc",
@@ -299,9 +306,6 @@
         "1940-ddms-ext/ddm_ext.cc",
         "1944-sudden-exit/sudden_exit.cc",
     ],
-    shared_libs: [
-        "libbase",
-    ],
 }
 
 art_cc_test_library {
@@ -333,18 +337,25 @@
         "983-source-transform-verify/source_transform_slicer.cc",
     ],
     whole_static_libs: [
-        "slicer",
-        "libz",  // for slicer (using adler32).
+        "slicer_ndk",
     ],
     static_libs: [
-        "libbase",
+        "libbase_ndk",
     ],
-    header_libs: [
+    shared_libs: [
+        "libz",  // for slicer (using adler32).
+    ],
+    sdk_version: "current",
+    stl: "c++_static",
+    cpp_std: "c++14",
+    include_dirs: [
         // This is needed to resolve the base/ header file in libdexfile. Unfortunately there are
         // many problems with how we export headers that are making doing this the 'right' way
         // difficult.
         // TODO: move those headers to art/ rather than under runtime.
-        "libart_runtime_headers",
+        "art/runtime",
+        // NDK headers aren't available in platform NDK builds.
+        "libnativehelper/include_jni",
     ],
     export_include_dirs: ["ti-agent"],
 }