live555 Android.mk (kk-4.4.2) android

LOCAL_PATH := $(call my-dir)

basic_sources := $(wildcard $(LOCAL_PATH)/BasicUsageEnvironment/*.cpp)
basic_sources := $(basic_sources:$(LOCAL_PATH)/BasicUsageEnvironment/%=%)

groupsock_cpp_sources := $(wildcard $(LOCAL_PATH)/groupsock/*.cpp)
groupsock_cpp_sources := $(groupsock_cpp_sources:$(LOCAL_PATH)/groupsock/%=%)

groupsock_c_sources := $(wildcard $(LOCAL_PATH)/groupsock/*.c)
groupsock_c_sources := $(groupsock_c_sources:$(LOCAL_PATH)/groupsock/%=%)

livemedia_cpp_sources := $(wildcard $(LOCAL_PATH)/liveMedia/*.cpp)
livemedia_cpp_sources := $(livemedia_cpp_sources:$(LOCAL_PATH)/liveMedia/%=%)

livemedia_c_sources := $(wildcard $(LOCAL_PATH)/liveMedia/*.c)
livemedia_c_sources := $(livemedia_c_sources:$(LOCAL_PATH)/liveMedia/%=%)

env_sources := $(wildcard $(LOCAL_PATH)/UsageEnvironment/*.cpp)
env_sources := $(env_sources:$(LOCAL_PATH)/UsageEnvironment/%=%)

includes := \
$(LOCAL_PATH)/BasicUsageEnvironment/include \
$(LOCAL_PATH)/UsageEnvironment/include \
$(LOCAL_PATH)/groupsock/include \
$(LOCAL_PATH)/liveMedia/include \

include $(CLEAR_VARS)  

#LOCAL_SRC_FILES := $(basic_src)
LOCAL_SRC_FILES := \
$(basic_sources:%=BasicUsageEnvironment/%) \
$(groupsock_cpp_sources:%=groupsock/%) \
$(groupsock_c_sources:%=groupsock/%) \
$(livemedia_cpp_sources:%=liveMedia/%) \
$(livemedia_c_sources:%=liveMedia/%) \
$(env_sources:%=UsageEnvironment/%) \

#LOCAL_MODULE := live555
LOCAL_MODULE := liblive555

LOCAL_SHARED_LIBRARIES += libcutils libstlport libdl

#cflags += -Werror
cppflags += -fexceptions -frtti -DXLOCALE_NOT_USED=1 -DNULL=0 -DNO_SSTREAM=1 -UIP_ADD_SOURCE_MEMBERSHIP

#LOCAL_MODULE_TAGS := eng optional
LOCAL_CFLAGS := $(cflags)
LOCAL_CPPFLAGS := $(cppflags)
LOCAL_C_INCLUDES := external/stlport/stlport bionic/ bionic/libstdc++/include libcore/include
LOCAL_C_INCLUDES += $(includes)
#LOCAL_LDLIBS := 
LOCAL_LDFLAGS := -Wl,-v
LOCAL_LDFLAGS += -Lprebuilts/ndk/7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a -lstdc++ \
 -Lprebuilts/ndk/7/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a -lsupc++
#LOCAL_SDK_VERSION := 19
#LOCAL_NDK_STL_VARIANT := gnustl_static
#LOCAL_NDK_STL_VARIANT := c++_static
#LOCAL_NDK_STL_VARIANT := stlport_static
#LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
include $(BUILD_SHARED_LIBRARY)


include $(CLEAR_VARS)
#LOCAL_CLANG := true
LOCAL_C_INCLUDES:= \
mediaServer \
$(includes)
LOCAL_SRC_FILES:= \
mediaServer/DynamicRTSPServer.cpp \
mediaServer/live555MediaServer.cpp
LOCAL_MODULE := live555MediaServer
LOCAL_SHARED_LIBRARIES:= liblive555
LOCAL_MODULE_TAGS := eng optional
include $(BUILD_EXECUTABLE)