LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := nicoro-jni
LOCAL_CFLAGS    := -Werror
LOCAL_CPPFLAGS  := -Werror
## disable "note: the mangling of 'va_list' has changed in GCC 4.4"
#LOCAL_CFLAGS    := $(LOCAL_CFLAGS) -Wno-psabi
#LOCAL_CPPFLAGS  := $(LOCAL_CPPFLAGS) -Wno-psabi
LOCAL_SRC_FILES := nicoro-jni.cpp NicoroFFmpegPlayer.cpp
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) $(LOCAL_PATH)/../../FFmpeg/jni

ifdef FOR_XPERIA
	LOCAL_LDLIBS    := -L$(LOCAL_PATH)/../../FFmpeg/obj/local/armeabi-v7a
	LOCAL_ARM_NEON  := true
else
	LOCAL_LDLIBS    := -L$(LOCAL_PATH)/../../FFmpeg/obj/local/$(TARGET_ARCH_ABI)
	ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
		LOCAL_ARM_NEON  := true
	endif
endif

LOCAL_LDLIBS    := $(LOCAL_LDLIBS) -lavformat -lavcodec -lavutil -lswscale -lz -lc -lm -ldl -lgcc -llog

include $(BUILD_SHARED_LIBRARY)
