[IOT-2295] Some libraries in "services" don't have the soname set.
authorHerve Jourdain <herve.jourdain@beechwoods.com>
Thu, 18 May 2017 08:06:57 +0000 (16:06 +0800)
committerUze Choi <uzchoi@samsung.com>
Mon, 22 May 2017 07:17:13 +0000 (07:17 +0000)
In the android case, this results in some jni libraries not being able
to load the shared libraries they depend upon, which results in errors.
The solution is to add the soname for the libraries that don't have it.

Change-Id: I52e3e3e182b1aeb9257862c7253d11023a634ac3
Signed-off-by: Herve Jourdain <herve.jourdain@beechwoods.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20105
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/cpp-wrapper/consumer/SConscript
service/notification/cpp-wrapper/provider/SConscript
service/resource-container/SConscript
service/resource-encapsulation/SConscript
service/resource-encapsulation/src/common/SConscript
service/resource-encapsulation/src/serverBuilder/SConscript

index 87dd0c7..67186ea 100644 (file)
@@ -76,6 +76,7 @@ if target_os == 'linux':
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer_wrapper.so'])
 
 if not env.get('RELEASE') and target_os not in ['ios']:
     notification_env.PrependUnique(LIBS = ['gcov'])
index ba03bfb..35b2fbf 100644 (file)
@@ -77,6 +77,7 @@ if target_os == 'linux':
 if target_os == 'android':
     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider_wrapper.so'])
 
 if not env.get('RELEASE') and target_os not in ['ios']:
     notification_env.PrependUnique(LIBS = ['gcov'])
index 8b05653..67678d7 100644 (file)
@@ -144,6 +144,9 @@ else:
 resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
 resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
 
+if target_os in ['android']:
+    resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_container.so'])
+
 ######################################################################
 # build discomfort index sensor sample bundle
 ######################################################################
@@ -167,6 +170,9 @@ if target_os in ['linux', 'tizen', 'android']:
         Command("THSensorApp", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp/THSensorApp", Copy("$TARGET", "$SOURCE"))
         Command("THSensorApp1", DI_SENSOR_BUNDLE_DIR + "src/inputSensors/THSensorApp1/THSensorApp1", Copy("$TARGET", "$SOURCE"))
 
+    if target_os in ['android']:
+        resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libDISensorBundle.so'])
+
 ######################################################################
 # build BMI sensor sample bundle
 ######################################################################
@@ -190,6 +196,9 @@ if target_os in ['linux', 'tizen', 'android']:
         Command("HeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/HeightSensorApp/HeightSensorApp", Copy("$TARGET", "$SOURCE"))
         Command("WeightSensorApp", BMI_SENSOR_BUNDLE_DIR + "src/inputSensors/WeightSensorApp/WeightSensorApp", Copy("$TARGET", "$SOURCE"))
 
+    if target_os in ['android']:
+        resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libBMISensorBundle.so'])
+
 ######################################################################
 # build hue sample bundle
 ######################################################################
index 4eba1b5..70b4328 100644 (file)
@@ -78,6 +78,7 @@ if target_os not in ['windows']:
 if target_os in ['android']:
     resourceClient_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     resourceClient_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    resourceClient_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_client.so'])
 
 if target_os in ['linux']:
     if not env.get('RELEASE'):
index 1c2b9e2..fedc923 100644 (file)
@@ -62,6 +62,7 @@ if target_os not in ['darwin', 'ios', 'windows']:
 if target_os == 'android':
     rcs_common_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     rcs_common_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    rcs_common_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_common.so'])
 
 rcs_common_env.AppendUnique(LIBS = ['oc'])
 
index e85a439..4138d82 100644 (file)
@@ -68,6 +68,7 @@ if target_os not in ['darwin', 'ios', 'windows']:
 if target_os in ['android']:
     server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+    server_builder_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,librcs_server.so'])
 
 if server_builder_env.get('SECURED') == '1':
        if server_builder_env.get('WITH_TCP') == True: