modified build scons related cloud provisioning 61/15861/5
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 21 Dec 2016 04:46:06 +0000 (13:46 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 9 Jan 2017 10:12:20 +0000 (10:12 +0000)
Change-Id: I14879be778f977cc817b9530c57914e755b2a370
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15861
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
java/jni/JniOcStack.cpp
java/jni/SConscript

index 03cb4ad..95cd5a8 100644 (file)
@@ -82,11 +82,12 @@ jclass g_cls_OcOicSecAcl_resr = nullptr;
 jclass g_cls_OcOicSecAcl_validity = nullptr;
 jclass g_cls_OcOicSecPdAcl = nullptr;
 jclass g_cls_OcDirectPairDevice = nullptr;
+
+#ifdef WITH_CLOUD
+jclass g_cls_OcAccountManager = nullptr;
 #ifdef __WITH_TLS__
 jclass g_cls_OcCloudProvisioning = nullptr;
 #endif
-#ifdef WITH_CLOUD
-jclass g_cls_OcAccountManager = nullptr;
 #endif
 
 jmethodID g_mid_Integer_ctor = nullptr;
@@ -150,10 +151,12 @@ jmethodID g_mid_OcOicSecAcl_validity_get_recurrenceLen = nullptr;
 jmethodID g_mid_OcOicSecAcl_resr_get_interfaceLen = nullptr;
 jmethodID g_mid_OcOicSecAcl_get_rownerID = nullptr;
 
+#ifdef WITH_CLOUD
 #ifdef __WITH_TLS__
 jmethodID g_mid_OcCloudProvisioning_getIP = nullptr;
 jmethodID g_mid_OcCloudProvisioning_getPort = nullptr;
 #endif
+#endif
 
 jobject getOcException(JNIEnv* env, const char* file, const char* functionName,
     const int line, const int code, const char* message)
@@ -613,6 +616,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
 
     g_mid_OcOicSecPdAcl_get_recurrences = env->GetMethodID(g_cls_OcOicSecPdAcl, "getRecurrences", "(I)Ljava/lang/String;");
     VERIFY_VARIABLE_NULL(g_mid_OcOicSecPdAcl_get_recurrences);
+#ifdef WITH_CLOUD
 #ifdef __WITH_TLS__
     //OcCloudProvisioning
     clazz = env->FindClass("org/iotivity/base/OcCloudProvisioning");
@@ -625,6 +629,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
 
     g_mid_OcCloudProvisioning_getPort = env->GetMethodID(g_cls_OcCloudProvisioning, "getPort", "()I");
     VERIFY_VARIABLE_NULL(g_mid_OcCloudProvisioning_getPort);
+#endif
 #endif
     return JNI_CURRENT_VERSION;
 }
@@ -682,9 +687,9 @@ JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
         env->DeleteGlobalRef(g_cls_byte3DArray);
 #ifdef WITH_CLOUD
         env->DeleteGlobalRef(g_cls_OcAccountManager);
-#endif
 #ifdef __WITH_TLS__
         env->DeleteGlobalRef(g_cls_OcCloudProvisioning);
+#endif
 #endif
         env->DeleteGlobalRef(g_cls_OcOicSecAcl);
         env->DeleteGlobalRef(g_cls_OcOicSecAcl_ace);
index 152ee81..83202cd 100644 (file)
@@ -69,8 +69,9 @@ if env.get('SECURED') == '1':
 #    jni_env.AppendUnique(CPPDEFINES= ['__WITH_TLS__'])
     jni_env.PrependUnique(LIBS = ['tinydtls', 'ocprovision', 'ocpmapi'])
     jni_env.AppendUnique(CPPPATH = ['#resource/csdk/security/include/internal',
-                                    '#extlibs/cjson',
-                                    '#resource/csdk/security/provisioning/include/cloud'])
+                                    '#extlibs/cjson'])
+    if env.get('WITH_CLOUD') == '1':
+        jni_env.AppendUnique(CPPPATH = ['#resource/csdk/security/provisioning/include/cloud'])
 
 if target_os == 'android':
        jni_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
@@ -149,15 +150,15 @@ if env.get('SECURED') == '1':
                        ]
 if env.get('WITH_CLOUD'):
        ocstack_files += [
-                               'JniOcAccountManager.cpp'
-                       ]
-if env.get('WITH_TCP') or env.get('SECURED') == '1':
-       ocstack_files += [
+                               'JniOcAccountManager.cpp',
                                'JniOcCloudResultListener.cpp',
                                'JniGetAclIdByDeviceListener.cpp'
                        ]
-if env.get('WITH_TCP'):
-    ocstack_files += ['JniOcCloudProvisioning.cpp']
+       if env.get('SECURED') == '1':
+               ocstack_files += [
+                                       'JniOcCloudProvisioning.cpp'
+                               ]
+
 ocstack_jni = jni_env.SharedLibrary('ocstack-jni', ocstack_files)
 
 jni_env.InstallTarget(ocstack_jni, 'ocstack-jni')