Initial build configuration for the new Android runtime.

Change-Id: I9956c8623f7bd333ceba5a41fc8cd3d16c309fd7
diff --git a/Android.aexec.host.mk b/Android.aexec.host.mk
new file mode 100644
index 0000000..667c2f6
--- /dev/null
+++ b/Android.aexec.host.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := aexec
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES := src/main.cc
+
+LOCAL_SHARED_LIBRARIES := \
+	libart
+
+LOCAL_C_INCLUDES += \
+	$(LOCAL_PATH)/arc
+
+include $(BUILD_HOST_EXECUTABLE)
diff --git a/Android.aexec.mk b/Android.aexec.mk
new file mode 100644
index 0000000..81b02fa
--- /dev/null
+++ b/Android.aexec.mk
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := aexec
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES := src/main.cc
+
+LOCAL_SHARED_LIBRARIES := \
+	libart \
+	libstlport
+
+LOCAL_C_INCLUDES += \
+	external/stlport/stlport \
+	bionic \
+	bionic/libstdc++/include \
+	$(LOCAL_PATH)/arc
+
+include $(BUILD_EXECUTABLE)
diff --git a/Android.common.mk b/Android.common.mk
new file mode 100644
index 0000000..daa4ab4
--- /dev/null
+++ b/Android.common.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LIBART_LOCAL_SRC_FILES := \
+	src/art.cc
+
diff --git a/Android.libart.host.mk b/Android.libart.host.mk
new file mode 100644
index 0000000..ce1adf6
--- /dev/null
+++ b/Android.libart.host.mk
@@ -0,0 +1,53 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libart
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES += $(LIBART_LOCAL_SRC_FILES)
+
+LOCAL_CFLAGS += \
+	-g3
+	-Wall \
+	-Wextra \
+	-Wno-unused-parameter \
+	-Wstrict-aliasing=2 \
+	-fno-align-jumps \
+	-fstrict-aliasing \
+	-fvisibility=hidden
+
+LOCAL_C_INCLUDES += \
+	dalvik/libdex \
+	libcore/include \
+	$(LOCAL_PATH)/src
+
+LOCAL_WHOLE_STATIC_LIBRARIES += \
+	libcutils \
+	libdex \
+	liblog \
+	libz
+
+LOCAL_LDLIBS := \
+	-ldl \
+	-lpthread \
+	-lrt
+
+include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/Android.libart.mk b/Android.libart.mk
new file mode 100644
index 0000000..072cf13
--- /dev/null
+++ b/Android.libart.mk
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libart
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_CPP_EXTENSION := .cc
+
+LOCAL_SRC_FILES := $(LIBART_LOCAL_SRC_FILES)
+
+LOCAL_CFLAGS += \
+	-Wall \
+	-Wextra \
+	-Wno-unused-parameter \
+	-Wstrict-aliasing=2 \
+	-fno-align-jumps \
+	-fstrict-aliasing \
+	-fvisibility=hidden
+
+ifeq ($(TARGET_ARCH),arm)
+	LOCAL_CFLAGS +=
+endif
+
+ifeq ($(TARGET_ARCH),x86)
+	LOCAL_CFLAGS +=
+endif
+
+LOCAL_C_INCLUDES += \
+	external/stlport/stlport \
+	bionic/ \
+	bionic/libstdc++/include \
+	dalvik/libdex \
+	libcore/include \
+	$(LOCAL_PATH)/src
+
+LOCAL_SHARED_LIBRARIES += libstlport
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..a64104d
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,26 @@
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+include $(LOCAL_PATH)/Android.libart.mk
+include $(LOCAL_PATH)/Android.aexec.mk
+
+ifeq ($(WITH_HOST_DALVIK),true)
+    include $(LOCAL_PATH)/Android.libart.host.mk
+    include $(LOCAL_PATH)/Android.aexec.host.mk
+endif
diff --git a/src/art.cc b/src/art.cc
new file mode 100644
index 0000000..17c5aae
--- /dev/null
+++ b/src/art.cc
@@ -0,0 +1,13 @@
+#include "art.h"
+
+namespace android {
+namespace runtime {
+
+bool Art::Startup() {
+  return true;
+}
+
+void Art::Shutdown() {
+}
+
+} }  // namespace
diff --git a/src/art.h b/src/art.h
new file mode 100644
index 0000000..417e296
--- /dev/null
+++ b/src/art.h
@@ -0,0 +1,17 @@
+#ifndef ART_ART_H_
+#define ART_ART_H_
+
+namespace android {
+namespace runtime {
+
+class Art {
+ public:
+  static bool Startup();
+  static void Shutdown();
+};
+
+} }  // namespace android::runtime
+
+namespace r = android::runtime;
+
+#endif  // ART_ART_H_
diff --git a/src/main.cc b/src/main.cc
new file mode 100644
index 0000000..b87a8fe
--- /dev/null
+++ b/src/main.cc
@@ -0,0 +1,6 @@
+#include <iostream>
+
+int main(int argc, char** argv) {
+  std::cout << "hello, world" << std::endl;
+  return 0;
+}