Using gnustl_shared library instead of gnustl_static
authorCaiwen Zhang <caiwen.zhang@intel.com>
Mon, 2 Mar 2015 09:09:04 +0000 (17:09 +0800)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Mon, 9 Mar 2015 20:16:55 +0000 (20:16 +0000)
As iotiviy includes more than one library should use gnustl_shared
library instead of gnustl_static library

Change-Id: I3d35e1b482ee8c5b7cca77ac735005bd62e630d6
Signed-off-by: Caiwen Zhang<caiwen.zhang@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/425
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
build_common/android/SConscript
resource/android/SConscript
resource/examples/SConscript
resource/oc_logger/SConscript
resource/oc_logger/examples/SConscript
resource/src/SConscript
service/notification-manager/SConscript
service/protocol-plugin/plugins/SConscript
service/protocol-plugin/sample-app/linux/SConscript
service/soft-sensor-manager/SConscript

index e79f266..21c5fbe 100644 (file)
@@ -87,7 +87,7 @@ for tc_ver in ['4.7', '4.8', '4.9', '']:
 
 cmd = [ndk_build_cmd]
 cmd.append('APP_ABI=' + target_arch)
-cmd.append('APP_STL=gnustl_static')
+cmd.append('APP_STL=gnustl_shared')
 if env.get('RELEASE'):
        cmd.append('APP_OPTIM=release')
 else:
@@ -133,8 +133,12 @@ for flags in p.stdout.readlines():
 
        elif cmp(flags[0:7], 'TC_VER=') == 0:  # set gnustl library path
                ver = flags[7:].strip()
-               env.AppendUnique(LIBPATH = [android_ndk + '/sources/cxx-stl/gnu-libstdc++/'
-                               + ver + '/libs/' + target_arch])
+               stl_path = android_ndk + '/sources/cxx-stl/gnu-libstdc++/' + ver + '/libs/' + target_arch
+               if target_arch in ['armeabi', 'armeabi-v7a', 'armeabi-v7a-hard']:
+                       stl_path = stl_path + '/thumb/'
+
+               env.AppendUnique(LIBPATH = [stl_path])
+               env.Install(env.get('BUILD_DIR'), stl_path + '/libgnustl_shared.so')
 
        elif cmp(flags[0:9], 'PLATFORM=') == 0:  # get target platform: android-x
                platform_ver = flags[9+8:].strip()
index 6c1f901..d7bce9f 100644 (file)
@@ -13,7 +13,7 @@ target_os = env.get('TARGET_OS')
 
 if target_os == 'android':
        compatibilitylib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       compatibilitylib_env.AppendUnique(LIBS = ['gnustl_static'])
+       compatibilitylib_env.AppendUnique(LIBS = ['gnustl_shared'])
 
 ######################################################################
 # Source files and Targets
index 4a5098f..f7828b1 100644 (file)
@@ -31,7 +31,7 @@ examples_env.PrependUnique(LIBS = ['oc', 'octbstack', 'coap', 'oc_logger'])
 
 if target_os == 'android':
        examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       examples_env.AppendUnique(LIBS = ['gnustl_static'])
+       examples_env.AppendUnique(LIBS = ['gnustl_shared'])
 
        if not env.get('RELEASE'):
                examples_env.AppendUnique(LIBS = ['log'])
index 078f725..c5e3a15 100644 (file)
@@ -13,7 +13,7 @@ liboc_logger_env.PrependUnique(CPPPATH = ['include'])
 target_os = env.get('TARGET_OS')
 if target_os == 'android':
        liboc_logger_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       liboc_logger_env.AppendUnique(LIBS = ['gnustl_static', 'log'])
+       liboc_logger_env.AppendUnique(LIBS = ['gnustl_shared', 'log'])
 
 if target_os not in ['arduino', 'windows', 'winrt']:
        liboc_logger_env.AppendUnique(CFLAGS = ['-std=c99'])
index ebc71cc..73cce37 100644 (file)
@@ -15,7 +15,7 @@ examples_env.AppendUnique(LIBS = ['oc_logger', 'stdc++'])
 target_os = env.get('TARGET_OS')
 if target_os == 'android':
        examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       examples_env.AppendUnique(LIBS = ['gnustl_static'])
+       examples_env.AppendUnique(LIBS = ['gnustl_shared'])
 
 if target_os not in ['arduino', 'windows', 'winrt']:
        examples_env.AppendUnique(CFLAGS = Split('-Wall -std=c99 -Werror'))
index 8a1803b..288aa2b 100644 (file)
@@ -24,7 +24,7 @@ if target_os not in ['windows', 'winrt']:
 if target_os == 'android':
        oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
        oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-       oclib_env.AppendUnique(LIBS = ['octbstack', 'coap', 'oc_logger', 'boost_thread', 'gnustl_static', 'log', 'compatibility'])
+       oclib_env.AppendUnique(LIBS = ['octbstack', 'coap', 'oc_logger', 'boost_thread', 'gnustl_shared', 'log', 'compatibility'])
 
 if target_os in ['darwin', 'ios']:
        oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
index 14e205a..e5b7f17 100644 (file)
@@ -23,7 +23,7 @@ if target_os == 'linux':
 
 if target_os == 'android':
        notimgr_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       notimgr_env.AppendUnique(LIBS = ['gnustl_static'])
+       notimgr_env.AppendUnique(LIBS = ['gnustl_shared'])
 
        if not env.get('RELEASE'):
                notimgr_env.AppendUnique(LIBS = ['log'])
index 0797a42..3dd48f1 100644 (file)
@@ -26,7 +26,7 @@ if target_os not in ['windows', 'winrt']:
 
 if target_os == 'android':
        plugins_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       plugins_env.AppendUnique(LIBS = ['gnustl_static'])
+       plugins_env.AppendUnique(LIBS = ['gnustl_shared'])
 
 plugins_env.AppendUnique(LIBS = [File(env.get('BUILD_DIR') + '/libmosquitto.a'),
                'mosquitto', 'ssl', 'rt'])
index c25d2f2..1b483a4 100644 (file)
@@ -22,7 +22,7 @@ if target_os not in ['windows', 'winrt']:
        sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread'])
 
 sample_env.AppendUnique(LIBS = ['oc', 'oc_logger', 'octbstack', 'coap', 'ppm', 'pmimpl', 'boost_system', 'boost_thread', 'dl'])
-sample_env.AppendUnique(LIBS = ['pthread'])
+sample_env.AppendUnique(LIBS = ['pthread', 'rt'])
 
 ######################################################################
 # Source files and Targets
index 518a550..7a73866 100644 (file)
@@ -26,7 +26,7 @@ if target_os not in ['windows', 'winrt']:
 
 if target_os == 'android':
        soft_sensor_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
-       soft_sensor_manager_env.AppendUnique(LIBS = ['gnustl_static', 'compatibility', 'log'])
+       soft_sensor_manager_env.AppendUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
 
 #######################################################################
 ## build SSM SDK