Add the Renderscript library. (Not in the build by default yet.)
This library can be used to create animated 3D User Interfaces.
This library is currently under heavy development, so it's not part of
the build by default.
In order to build this library, you must define
BUILD_RENDERSCRIPT=true
in your build environment.
You will also have to manually edit
build/core/prelink-linux-arm.map
And add libRS and libRS_jni at the end like this (exact address may change.)
libRS.so 0x9A100000
libRS_jni.so 0x9A000000
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..73c1eea
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,132 @@
+# Only build if BUILD_RENDERSCRIPT is defined to true in the environment.
+ifeq ($(BUILD_RENDERSCRIPT),true)
+
+TOP_LOCAL_PATH:=$(call my-dir)
+LOCAL_PATH:= $(TOP_LOCAL_PATH)
+
+
+# Build rsg-generator
+
+LOCAL_MODULE := rsg-generator
+
+# These symbols are normally defined by BUILD_XXX, but we need to define them
+# here so that local-intermediates-dir works.
+
+LOCAL_IS_HOST_MODULE := true
+LOCAL_MODULE_CLASS := EXECUTABLES
+intermediates:= $(local-intermediates-dir)
+
+GEN := $(addprefix $(intermediates)/, \
+ lex.yy.c \
+ )
+$(GEN): PRIVATE_CUSTOM_TOOL = flex -o $@ $<
+
+$(intermediates)/lex.yy.c : $(LOCAL_PATH)/spec.lex
+ $(transform-generated-source)
+
+$(LOCAL_PATH)/rsg_generator.c : $(intermediates)/lex.yy.c
+
+LOCAL_SRC_FILES:= \
+ rsg_generator.c
+
+include $(BUILD_HOST_EXECUTABLE)
+
+RSG_GENERATOR:=$(LOCAL_BUILT_MODULE)
+
+# Build render script lib
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libRS
+
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+intermediates:= $(local-intermediates-dir)
+
+RS_GENERATED_INCLUDE_DIR:=$(intermediates)
+
+# Generate custom headers
+
+GEN := $(addprefix $(intermediates)/, \
+ rsgApiStructs.h \
+ rsgApiFuncDecl.h \
+ )
+
+$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec
+$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
+$(GEN): $(intermediates)/%.h : $(LOCAL_PATH)/%.h.rsg
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+# Generate custom source files
+
+GEN := $(addprefix $(intermediates)/, \
+ rsgApi.cpp \
+ rsgApiReplay.cpp \
+ )
+
+$(GEN) : PRIVATE_CUSTOM_TOOL = $(RSG_GENERATOR) $< $@ <$(LOCAL_PATH)/rs.spec
+$(GEN) : $(RSG_GENERATOR) $(LOCAL_PATH)/rs.spec
+$(GEN): $(intermediates)/%.cpp : $(LOCAL_PATH)/%.cpp.rsg
+ $(transform-generated-source)
+LOCAL_GENERATED_SOURCES += $(GEN)
+
+LOCAL_SRC_FILES:= \
+ rsAdapter.cpp \
+ rsAllocation.cpp \
+ rsComponent.cpp \
+ rsContext.cpp \
+ rsDevice.cpp \
+ rsElement.cpp \
+ rsLocklessFifo.cpp \
+ rsObjectBase.cpp \
+ rsMatrix.cpp \
+ rsProgram.cpp \
+ rsProgramFragment.cpp \
+ rsProgramFragmentStore.cpp \
+ rsProgramVertex.cpp \
+ rsSampler.cpp \
+ rsScript.cpp \
+ rsScriptC.cpp \
+ rsThreadIO.cpp \
+ rsType.cpp \
+ rsTriangleMesh.cpp
+
+LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL libGLESv1_CM libui
+LOCAL_LDLIBS := -lpthread -ldl
+LOCAL_MODULE:= libRS
+
+#LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_SHARED_LIBRARY)
+
+# Build JNI library
+
+LOCAL_PATH:= $(TOP_LOCAL_PATH)/jni
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ RenderScript_jni.cpp
+
+LOCAL_SHARED_LIBRARIES := \
+ libandroid_runtime \
+ libnativehelper \
+ libRS \
+ libcutils \
+ libutils \
+ libui
+
+LOCAL_STATIC_LIBRARIES :=
+
+LOCAL_C_INCLUDES += \
+ $(JNI_H_INCLUDE) \
+ $(RS_GENERATED_INCLUDE_DIR) \
+ $(call include-path-for, corecg graphics)
+
+LOCAL_CFLAGS +=
+
+LOCAL_LDLIBS := -lpthread
+
+LOCAL_MODULE:= libRS_jni
+
+include $(BUILD_SHARED_LIBRARY)
+
+endif # BUILD_RENDERSCRIPT
\ No newline at end of file