LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE := coap
-LOCAL_SRC_FILES := ../libs/libcoap.so
+LOCAL_MODULE := ca
+LOCAL_SRC_FILES := ../libs/libconnectivity_abstraction.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
if target_os == 'android':
things_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- things_manager_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared', 'android_cpp11_compat', 'log'])
+ things_manager_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared'])
######################################################################
# Source files and Targets
things_manager_env.InstallTarget([tgmsdk_static,tgmsdk_shared], 'libTGMSDK')
+# Build JNI layer
+#if target_os == 'android':
+# SConscript(os.path.join('sdk', 'java', 'jni', 'SConscript'))
+
#Go to build sample apps
SConscript('sampleapp/SConscript')
#include <ActionSet.h>
#include "OCPlatform.h"
#include "OCApi.h"
-#include "GroupManager.h"
using namespace OC;
LOCAL_PATH := $(call my-dir)
-ifeq ($(strip $(ANDROID_NDK)),)
-$(error ANDROID_NDK is not set!)
-endif
+include $(CLEAR_VARS)
+OIC_LIB_PATH := ../../../../../out/android/$(TARGET_ARCH_ABI)/release
+LOCAL_MODULE := android-oc_logger
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/liboc_logger.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+OIC_LIB_PATH := ../../../../../out/android/$(TARGET_ARCH_ABI)/release
+LOCAL_MODULE := android-octbstack
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/liboctbstack.so
+include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
-OIC_LIB_PATH := ../../../../../dep/android/$(TARGET_ARCH_ABI)/usr/lib
-LOCAL_MODULE := libandroid-boost_system
-LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libboost_system.a
-include $(PREBUILT_STATIC_LIBRARY)
+OIC_LIB_PATH := ../../../../../out/android/$(TARGET_ARCH_ABI)/release
+LOCAL_MODULE := android-oc
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/liboc.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+OIC_LIB_PATH := ../../../../../out/android/$(TARGET_ARCH_ABI)/release
+LOCAL_MODULE := android-connectivity_abstraction
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libconnectivity_abstraction.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+OIC_LIB_PATH := ../../../../../android/android_api/base/libs/$(TARGET_ARCH_ABI)
+LOCAL_MODULE := android-ocstack-jni
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libocstack-jni.so
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+OIC_LIB_PATH := ../../../../../android/android_api/base/libs/$(TARGET_ARCH_ABI)
+LOCAL_MODULE := android-ca-interface
+LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libca-interface.so
+include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
OIC_LIB_PATH := ../../../../../out/android/$(TARGET_ARCH_ABI)/release
-LOCAL_MODULE := libandroid-thingsmanager
+LOCAL_MODULE := android-thingsmanager
LOCAL_SRC_FILES := $(OIC_LIB_PATH)/libTGMSDKLibrary.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
-OIC_LIB_PATH := ../../../../out/android/$(TARGET_ARCH_ABI)/release
-BASE_LIB_PATH := ../../../../android/android_api/base/libs/$(TARGET_ARCH_ABI)
-OIC_RESOURCE_PATH := ../../../../resource
-OIC_SERVICE_PATH := ../../../../service
-OIC_OUT_PATH := ../../../../out
+OIC_SRC_DIR := ../../../..
LOCAL_MODULE := things-manager-jni
-LOCAL_C_INCLUDES := $(OIC_RESOURCE_PATH)/include \
- $(OIC_RESOURCE_PATH)/csdk/stack/include \
- $(OIC_RESOURCE_PATH)/csdk/ocsocket/include \
- $(OIC_RESOURCE_PATH)/oc_logger/include \
- $(OIC_RESOURCE_PATH)/android/include \
- $(OIC_RESOURCE_PATH)/dependencies/cereal/include \
- $(OIC_RESOURCE_PATH)/../extlibs/boost/boost_1_58_0 \
- $(OIC_RESOURCE_PATH)/../extlibs/timer \
- $(OIC_SERVICE_PATH)/things-manager/sdk/inc \
- $(OIC_SERVICE_PATH)/things-manager/sdk/src \
- $(OIC_SERVICE_PATH)/../android/android_api/base/jni \
- $(OIC_SERVICE_PATH)/../build_common/android/compatibility \
- $(LOCAL_PATH)/jniutil/inc \
- $(LOCAL_PATH)/tm/inc \
- $(LOCAL_PATH)/tm/src \
- $(LOCAL_PATH)/tm/src/base \
- $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/include \
- $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI)/include \
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/jniutil/inc \
+ $(OIC_SRC_DIR)/android/android_api/base/jni \
+ $(OIC_SRC_DIR)/resource/include \
+ $(OIC_SRC_DIR)/resource/csdk/stack/include \
+ $(OIC_SRC_DIR)/resource/oc_logger/include \
+ $(OIC_SRC_DIR)/extlibs/boost/boost_1_58_0 \
+ $(OIC_SRC_DIR)/extlibs/timer \
+ $(OIC_SRC_DIR)/service/things-manager/sdk/inc \
+ $(LOCAL_PATH)/tm/inc
LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/jniutil/src/*.cpp))
LOCAL_SRC_FILES += $(patsubst $(LOCAL_PATH)/%, %, $(wildcard $(LOCAL_PATH)/tm/src/*.cpp))
LOCAL_CPPFLAGS := -std=c++0x -frtti -fexceptions
-LOCAL_LDLIBS := -llog -L$(BASE_LIB_PATH) -locstack-jni -L$(OIC_LIB_PATH) -loc -loctbstack -lcoap -loc_logger
-LOCAL_LDLIBS += -L$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/$(TOOLCHAIN_VERSION)/libs/$(TARGET_ARCH_ABI) -lgnustl_shared
-LOCAL_SHARED_LIBRARIES := android-thingsmanager
-LOCAL_STATIC_LIBRARIES := android-boost_system
+LOCAL_LDLIBS := -llog
+LOCAL_SHARED_LIBRARIES := android-ocstack-jni
+LOCAL_SHARED_LIBRARIES += android-thingsmanager
+LOCAL_SHARED_LIBRARIES += android-oc
include $(BUILD_SHARED_LIBRARY)
NDK_TOOLCHAIN_VERSION := 4.9
-#APP_STL := gnustl_shared
+APP_STL := gnustl_shared
# Things manager service JNI build script
##
+import os
Import('env')
# Add third party libraries
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
tm_jni_env = lib_env.Clone()
-target_os = env.get('TARGET_OS')
-tm_sdk = env.get('SRC_DIR') + '/service/things-manager/sdk'
-base_jni = env.get('SRC_DIR') + '/android/android_api/base/jni'
+target_os = tm_jni_env.get('TARGET_OS')
+tm_sdk = tm_jni_env.get('SRC_DIR') + '/service/things-manager/sdk'
+base_jni = tm_jni_env.get('SRC_DIR') + '/android/android_api/base/jni'
+extlibs = tm_jni_env.get('SRC_DIR') + '/extlibs'
######################################################################
# Build flags
######################################################################
tm_jni_env.AppendUnique(CXXFLAGS = ['-Wall', '-DLINUX', '-DNDEBUG'])
-tm_jni_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-tm_jni_env.AppendUnique(LIBPATH = [base_jni+'/../libs/'+env.get('TARGET_ARCH')])
-tm_jni_env.PrependUnique(LIBS = ['ocstack-jni', 'TGMSDKLibrary', 'oc', 'octbstack', 'boost_system', 'gnustl_shared', 'compatibility', 'log'])
+tm_jni_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions', '-std=c++0x'])
+tm_jni_env.AppendUnique(LIBPATH = [base_jni+'/../libs/'+tm_jni_env.get('TARGET_ARCH')])
+tm_jni_env.PrependUnique(LIBS = ['ocstack-jni', 'TGMSDKLibrary', 'oc', 'gnustl_shared', 'log'])
-tm_jni_env.AppendUnique(CPPPATH = [tm_sdk+'/inc', tm_sdk+'/src'])
+tm_jni_env.AppendUnique(CPPPATH = [tm_sdk+'/inc'])
tm_jni_env.AppendUnique(CPPPATH = [base_jni])
-tm_jni_env.AppendUnique(CPPPATH = ['tm/inc', 'tm/src', 'jniutil/inc', 'jniutil/src', '../../../../../extlibs/timer/'])
+tm_jni_env.AppendUnique(CPPPATH = ['tm/inc', 'jniutil/inc', extlibs+'/timer/'])
######################################################################
# Source files and Targets
######################################################################
-tm_jni_src = [env.Glob('tm/src/*.cpp'), env.Glob('jniutil/src/*.cpp')]
+tm_jni_src = [tm_jni_env.Glob('tm/src/*.cpp'), tm_jni_env.Glob('jniutil/src/*.cpp')]
tm_jni = tm_jni_env.SharedLibrary('things-manager-jni', tm_jni_src)
tm_jni_env.InstallTarget(tm_jni, 'libthings-manager-jni')
# Install the libraries to /libs/<TARGET_ARCH> directory
-tm_jni_env.Install(tm_sdk+'/java/libs/'+env.get('TARGET_ARCH'),env.get('BUILD_DIR')+'/libTGMSDKLibrary.so')
-tm_jni_env.Install(tm_sdk+'/java/libs/'+env.get('TARGET_ARCH'),tm_jni)
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni_env.get('BUILD_DIR')+'/liboc_logger.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni_env.get('BUILD_DIR')+'/liboctbstack.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni_env.get('BUILD_DIR')+'/liboc.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni_env.get('BUILD_DIR')+'/libconnectivity_abstraction.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),base_jni+'/../libs/'+tm_jni_env.get('TARGET_ARCH')+'/libocstack-jni.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),base_jni+'/../libs/'+tm_jni_env.get('TARGET_ARCH')+'/libca-interface.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni_env.get('BUILD_DIR')+'/libTGMSDKLibrary.so')
+tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'),tm_jni)
+
+gnu_lib_paths = env.get('LIBPATH')
+for gnu_lib_path in gnu_lib_paths:
+ gnu_lib_path = gnu_lib_path + '/libgnustl_shared.so'
+ if os.path.exists(gnu_lib_path):
+ tm_jni_env.Install(tm_sdk+'/java/libs/'+tm_jni_env.get('TARGET_ARCH'), gnu_lib_path)
+ break