aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvaylo Asenov <ivaylo.asenov@linaro.org>2017-06-21 09:03:58 +0100
committerIvaylo Asenov <ivaylo.asenov@linaro.org>2017-06-21 09:05:11 +0100
commit0f3d38096cabcfb33f903d95503185b8310cf749 (patch)
tree92ea004a0d273586ae5c7c3f2f2b462c4b3d3655
parent36bccbf7e7e0d12594a48179a458d9a70c4f2480 (diff)
downloadlibpng-linaro-upstream-1.6.29.tar.gz
Replace Android.mk with Android.bplinaro-upstream-1.6.29
Change-Id: Ia3acb7380a56030b583d9873954d59cd63b5f9e6 Signed-off-by: Ivaylo Asenov <ivaylo.asenov@linaro.org>
-rw-r--r--Android.bp124
-rw-r--r--Android.mk102
2 files changed, 124 insertions, 102 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 000000000..e6dc440e0
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,124 @@
+// We need to build this for both the device (as a shared library)
+// and the host (as a static library for tools to use).
+
+cc_defaults {
+ name: "libpng-defaults",
+ srcs: [
+ "png.c",
+ "pngerror.c",
+ "pngget.c",
+ "pngmem.c",
+ "pngpread.c",
+ "pngread.c",
+ "pngrio.c",
+ "pngrtran.c",
+ "pngrutil.c",
+ "pngset.c",
+ "pngtrans.c",
+ "pngwio.c",
+ "pngwrite.c",
+ "pngwtran.c",
+ "pngwutil.c",
+ ],
+ cflags: [
+ "-std=gnu89",
+ "-Wno-unused-parameter",
+ ],
+ arch: {
+ arm: {
+ srcs: [
+ "arm/arm_init.c",
+ "arm/filter_neon.S",
+ "arm/filter_neon_intrinsics.c",
+ ],
+ },
+ arm64: {
+ srcs: [
+ "arm/arm_init.c",
+ "arm/filter_neon.S",
+ "arm/filter_neon_intrinsics.c",
+ ],
+ },
+ x86: {
+ srcs: [
+ "intel/intel_init.c",
+ "intel/filter_sse2_intrinsics.c",
+ ],
+ // Disable optimizations because they crash on windows
+ // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
+ },
+ x86_64: {
+ srcs: [
+ "intel/intel_init.c",
+ "intel/filter_sse2_intrinsics.c",
+ ],
+ // Disable optimizations because they crash on windows
+ // cflags: ["-DPNG_INTEL_SSE_OPT=1"],
+ },
+ },
+ target: {
+ android: {
+ shared_libs: ["libz"],
+ },
+ android_x86: {
+ cflags: ["-DPNG_INTEL_SSE_OPT=1"],
+ },
+ android_x86_64: {
+ cflags: ["-DPNG_INTEL_SSE_OPT=1"],
+ },
+ host: {
+ shared_libs: ["libz-host"],
+ },
+ },
+ export_include_dirs: ["."],
+ clang: true,
+}
+
+// For the host and device platform
+// =====================================================
+
+cc_library {
+ name: "libpng",
+ vendor_available: true,
+ host_supported: true,
+ defaults: ["libpng-defaults"],
+ target: {
+ windows: {
+ enabled: true,
+ },
+ },
+}
+
+// For the device (static) for NDK
+// =====================================================
+
+cc_library_static {
+ name: "libpng_ndk",
+ defaults: ["libpng-defaults"],
+ cflags: ["-ftrapv"],
+
+ shared_libs: ["libz"],
+ sdk_version: "14",
+}
+
+// For testing
+// =====================================================
+
+cc_test {
+ clang: true,
+ host_supported: true,
+ gtest: false,
+ srcs: ["pngtest.c"],
+ name: "pngtest",
+ shared_libs: [
+ "libpng",
+ ],
+ target: {
+ android: {
+ shared_libs: ["libz"],
+ },
+ host: {
+ shared_libs: ["libz-host"],
+ },
+ },
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index c0a4b461e..000000000
--- a/Android.mk
+++ /dev/null
@@ -1,102 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-# We need to build this for both the device (as a shared library)
-# and the host (as a static library for tools to use).
-
-common_SRC_FILES := \
- png.c \
- pngerror.c \
- pngget.c \
- pngmem.c \
- pngpread.c \
- pngread.c \
- pngrio.c \
- pngrtran.c \
- pngrutil.c \
- pngset.c \
- pngtrans.c \
- pngwio.c \
- pngwrite.c \
- pngwtran.c \
- pngwutil.c \
-
-ifeq ($(ARCH_ARM_HAVE_NEON),true)
-my_cflags_arm := -DPNG_ARM_NEON_OPT=2
-endif
-
-my_cflags_arm64 := -DPNG_ARM_NEON_OPT=2
-
-# BUG: http://llvm.org/PR19472 - SLP vectorization (on ARM at least) crashes
-# when we can't lower a vectorized bswap.
-my_cflags_arm += -fno-slp-vectorize
-
-my_src_files_arm := \
- arm/arm_init.c \
- arm/filter_neon.S \
- arm/filter_neon_intrinsics.c
-
-
-common_CFLAGS := -std=gnu89 #-fvisibility=hidden ## -fomit-frame-pointer
-
-# For the host
-# =====================================================
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS)
-LOCAL_ASFLAGS += $(common_ASFLAGS)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_STATIC_LIBRARIES := libz
-LOCAL_C_INCLUDES += external/zlib
-LOCAL_MODULE:= libpng
-include $(BUILD_HOST_STATIC_LIBRARY)
-
-
-# For the device (static)
-# =====================================================
-
-include $(CLEAR_VARS)
-LOCAL_CLANG := true
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
-LOCAL_CFLAGS_arm := $(my_cflags_arm)
-LOCAL_ASFLAGS += $(common_ASFLAGS)
-LOCAL_SRC_FILES_arm := $(my_src_files_arm)
-LOCAL_CFLAGS_arm64 := $(my_cflags_arm64)
-LOCAL_SRC_FILES_arm64 := $(my_src_files_arm)
-LOCAL_ADDRESS_SANITIZER := false
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_SHARED_LIBRARIES := libz
-LOCAL_C_INCLUDES += external/zlib
-LOCAL_MODULE:= libpng
-include $(BUILD_STATIC_LIBRARY)
-
-# For the device (shared)
-# =====================================================
-
-include $(CLEAR_VARS)
-LOCAL_CLANG := true
-LOCAL_SRC_FILES := $(common_SRC_FILES)
-LOCAL_CFLAGS += $(common_CFLAGS) -ftrapv
-LOCAL_CFLAGS_arm := $(my_cflags_arm)
-LOCAL_ASFLAGS += $(common_ASFLAGS)
-LOCAL_SRC_FILES_arm := $(my_src_files_arm)
-LOCAL_CFLAGS_arm64 := $(my_cflags_arm64)
-LOCAL_SRC_FILES_arm64 := $(my_src_files_arm)
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_C_INCLUDES += external/zlib
-LOCAL_SHARED_LIBRARIES := libz
-LOCAL_MODULE:= libpng
-include $(BUILD_SHARED_LIBRARY)
-
-# For testing
-# =====================================================
-
-include $(CLEAR_VARS)
-LOCAL_CLANG := true
-LOCAL_SRC_FILES:= pngtest.c
-LOCAL_MODULE := pngtest
-LOCAL_SHARED_LIBRARIES:= libpng libz
-LOCAL_C_INCLUDES += external/zlib
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_EXECUTABLE)