resource-manipulation: libserver_builder.so add missing depending library
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 21 Jul 2015 18:55:50 +0000 (20:55 +0200)
committerUze Choi <uzchoi@samsung.com>
Fri, 24 Jul 2015 10:18:44 +0000 (10:18 +0000)
libserver_builder.so is also depending on liboc.so and
librcs_common.so, this patch adds these dependencies to the build.

liboctbstack.so is only needed when LOGGING=true is set. Without
liboctbstack.so libserver_builder.so misses the dependencies to the
OCLog and OCLogv symbols.
Add LIBPATH to make sure the libs will be found, this fixes a problem
in some jenkins tests.

pthread is added two times, once should be enough.

Without this the dynamic loader will not automatically load these
libraries and it could result in unresolved dependencies at runtime.

Change-Id: I6af126eb4af975b7231d01df922885c7dec5fc56
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1799
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/resource-manipulation/src/serverBuilder/SConscript

index d152287..4b93547 100644 (file)
@@ -47,6 +47,8 @@ server_builder_env.AppendUnique(CPPPATH = [
 
 server_builder_env.AppendUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs', 'include'])
 
+server_builder_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
+
 if target_os not in ['windows', 'winrt']:
     server_builder_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
     if target_os != 'android':
@@ -59,7 +61,10 @@ if target_os == 'android':
     server_builder_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
     server_builder_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
 
-server_builder_env.AppendUnique(LIBS = ['dl'])
+server_builder_env.AppendUnique(LIBS = ['dl', 'oc', 'rcs_common'])
+
+if env.get('LOGGING'):
+       server_builder_env.AppendUnique(LIBS = ['octbstack'])
 
 if not release:
     server_builder_env.AppendUnique(CXXFLAGS = ['--coverage'])
@@ -80,7 +85,6 @@ server_builder_env.InstallTarget([server_builder_static, server_builder_shared],
 ######################################################################
 server_builder_test_env = server_builder_env.Clone();
 
-server_builder_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 server_builder_test_env.AppendUnique(CPPPATH = [
     env.get('SRC_DIR')+'/extlibs/hippomocks-master',
     gtest_dir + '/include',
@@ -92,9 +96,6 @@ gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
 
 server_builder_test_env.PrependUnique(LIBS = [
     'rcs_server',
-    'rcs_common',
-    'pthread',
-    'oc',
     'octbstack',
     'oc_logger',
     'connectivity_abstraction',