From d6f79741c5cfebd274aab54d8868ec44d0cab74f Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Wed, 5 Nov 2014 17:15:24 +0900 Subject: [PATCH] Initial setup to compile on SDK 10-21. --- .gitignore | 2 + .rsync-filter | 2 + Makefile | 192 ++++++++++++++++++++++++++++++++++++++++ build-remote.sh | 29 ++++++ jni/Android.mk | 1 + jni/minicap/Android.mk | 27 ++++++ jni/minicap/minicap.cpp | 4 + 7 files changed, 257 insertions(+) create mode 100644 .gitignore create mode 100644 .rsync-filter create mode 100644 Makefile create mode 100755 build-remote.sh create mode 100644 jni/Android.mk create mode 100644 jni/minicap/Android.mk create mode 100644 jni/minicap/minicap.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0c9bb44f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +/libs/ diff --git a/.rsync-filter b/.rsync-filter new file mode 100644 index 00000000..d07b72d4 --- /dev/null +++ b/.rsync-filter @@ -0,0 +1,2 @@ +- .git +- libs diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..084003ba --- /dev/null +++ b/Makefile @@ -0,0 +1,192 @@ +this_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +SOURCES := $(shell find jni -name '*.cpp' -or -name '*.mk') + +all: \ + libs/android-10/armeabi-v7a/minicap \ + libs/android-14/armeabi-v7a/minicap \ + libs/android-14/x86/minicap \ + libs/android-15/armeabi-v7a/minicap \ + libs/android-15/x86/minicap \ + libs/android-16/armeabi-v7a/minicap \ + libs/android-16/x86/minicap \ + libs/android-17/armeabi-v7a/minicap \ + libs/android-17/x86/minicap \ + libs/android-18/armeabi-v7a/minicap \ + libs/android-18/x86/minicap \ + libs/android-19/armeabi-v7a/minicap \ + libs/android-19/x86/minicap \ + libs/android-21/armeabi-v7a/minicap \ + libs/android-21/arm64-v8a/minicap \ + libs/android-21/x86/minicap \ + libs/android-21/x86_64/minicap \ + +libs/android-10/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-2.3.3_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build generic-eng minicap + +libs/android-14/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.0.1_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full-eng minicap + +libs/android-14/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.0.1_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap + +libs/android-15/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.0.3_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full-eng minicap + +libs/android-15/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.0.3_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap + +libs/android-16/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.1.1_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full-eng minicap + +libs/android-16/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.1.1_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap + +libs/android-17/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.2_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full-eng minicap + +libs/android-17/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.2_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build full_x86-eng minicap + +libs/android-18/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.3_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap + +libs/android-18/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.3_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap + +libs/android-19/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.4_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap + +libs/android-19/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-4.4_r1:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap + +libs/android-21/armeabi-v7a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_arm-eng minicap + +libs/android-21/arm64-v8a/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_arm64-eng minicap + +libs/android-21/x86/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_x86-eng minicap + +libs/android-21/x86_64/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_x86_64-eng minicap + +libs/android-21/mips/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_mips-eng minicap + +libs/android-21/mips64/minicap: $(SOURCES) + mkdir -p $(@D) + docker run --rm \ + -a stdout -a stderr \ + -v /srv/aosp/android-5.0.0_r2:/aosp \ + -v $(this_dir)jni:/app \ + -v $(this_dir)$(@D):/artifacts \ + sorccu/aosp:jdk6 /aosp.sh build aosp_mips64-eng minicap diff --git a/build-remote.sh b/build-remote.sh new file mode 100755 index 00000000..b82c45f1 --- /dev/null +++ b/build-remote.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -xueo pipefail + +TARGET=/tmp/minicap + +rsync \ + --rsync-path='nice rsync' \ + --recursive \ + --copy-links \ + --perms \ + --times \ + -FF ./ "$BUILD_HOST":$TARGET + +ssh -T "$BUILD_HOST" "docker run --rm \ + -a stdout -a stderr \ + -v $TARGET:$TARGET \ + -v \$(which docker):\$(which docker) \ + -v /usr/lib:/usr/lib \ + -v /var/run/docker.sock:/var/run/docker.sock \ + sorccu/aosp:latest bash -c 'cd $TARGET && make -j 4'" + +rsync \ + --rsync-path='nice rsync' \ + --recursive \ + --copy-links \ + --perms \ + --times \ + "$BUILD_HOST":$TARGET/libs/ libs/ diff --git a/jni/Android.mk b/jni/Android.mk new file mode 100644 index 00000000..5053e7d6 --- /dev/null +++ b/jni/Android.mk @@ -0,0 +1 @@ +include $(call all-subdir-makefiles) diff --git a/jni/minicap/Android.mk b/jni/minicap/Android.mk new file mode 100644 index 00000000..2656dcb9 --- /dev/null +++ b/jni/minicap/Android.mk @@ -0,0 +1,27 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := minicap + +LOCAL_MODULE_TAGS := optional + +LOCAL_SRC_FILES := \ + minicap.cpp \ + +LOCAL_PRELINK_MODULE := false + +LOCAL_SHARED_LIBRARIES := \ + libcutils \ + libutils \ + libbinder \ + libui \ + +ifeq ($(PLATFORM_SDK_VERSION),10) +LOCAL_SHARED_LIBRARIES += libsurfaceflinger_client +else +LOCAL_SHARED_LIBRARIES += libgui +endif + +LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) + +include $(BUILD_EXECUTABLE) diff --git a/jni/minicap/minicap.cpp b/jni/minicap/minicap.cpp new file mode 100644 index 00000000..9f0510be --- /dev/null +++ b/jni/minicap/minicap.cpp @@ -0,0 +1,4 @@ +int main(int argc, char* argv[]) +{ + return 0; +}