From f910a84ea5bea7168398dfe88de0810ae67f805b Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 4 Oct 2013 11:06:33 +0200 Subject: [PATCH 1/2] Android.mk: update build flags - split out release specific flags - set LOCAL_ARM_MODE to arm Change-Id: I272855216583d6c8d0a4106e8b3fde46aa59dfa9 --- Android.mk | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Android.mk b/Android.mk index b0bec4b4..0071b9da 100644 --- a/Android.mk +++ b/Android.mk @@ -54,11 +54,16 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD \ -DWEBP_USE_THREAD \ - -finline-functions -frename-registers -ffast-math \ - -s -fomit-frame-pointer -Isrc/webp + +ifeq ($(APP_OPTIM),release) + LOCAL_CFLAGS += -finline-functions -frename-registers -ffast-math -s +endif LOCAL_C_INCLUDES += $(LOCAL_PATH)/src +# prefer arm over thumb mode for performance gains +LOCAL_ARM_MODE := arm + ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) # Setting LOCAL_ARM_NEON will enable -mfpu=neon which may cause illegal # instructions to be generated for armv7a code. Instead target the neon code @@ -69,7 +74,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) endif LOCAL_STATIC_LIBRARIES := cpufeatures -LOCAL_MODULE:= webp +LOCAL_MODULE := webp include $(BUILD_STATIC_LIBRARY) From 5b2e6bd3e8c94ac36b2126778baf1040d220e294 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 4 Oct 2013 11:26:37 +0200 Subject: [PATCH 2/2] Android.mk: add a dwebp target Change-Id: Ic697660c1a5f7185d2ad00934b314b44870cec00 --- Android.mk | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Android.mk b/Android.mk index 0071b9da..15b00873 100644 --- a/Android.mk +++ b/Android.mk @@ -1,6 +1,13 @@ -LOCAL_PATH:= $(call my-dir) +LOCAL_PATH := $(call my-dir) + +WEBP_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD -DWEBP_USE_THREAD + +ifeq ($(APP_OPTIM),release) + WEBP_CFLAGS += -finline-functions -frename-registers -ffast-math -s +endif include $(CLEAR_VARS) + LOCAL_SRC_FILES := \ src/dec/alpha.c \ src/dec/buffer.c \ @@ -52,13 +59,7 @@ LOCAL_SRC_FILES := \ src/utils/thread.c \ src/utils/utils.c \ -LOCAL_CFLAGS := -Wall -DANDROID -DHAVE_MALLOC_H -DHAVE_PTHREAD \ - -DWEBP_USE_THREAD \ - -ifeq ($(APP_OPTIM),release) - LOCAL_CFLAGS += -finline-functions -frename-registers -ffast-math -s -endif - +LOCAL_CFLAGS := $(WEBP_CFLAGS) LOCAL_C_INCLUDES += $(LOCAL_PATH)/src # prefer arm over thumb mode for performance gains @@ -78,4 +79,18 @@ LOCAL_MODULE := webp include $(BUILD_STATIC_LIBRARY) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + examples/dwebp.c \ + examples/example_util.c \ + +LOCAL_CFLAGS := $(WEBP_CFLAGS) +LOCAL_C_INCLUDES := $(LOCAL_PATH)/src +LOCAL_STATIC_LIBRARIES := webp + +LOCAL_MODULE := dwebp + +include $(BUILD_EXECUTABLE) + $(call import-module,android/cpufeatures)