######################################################################
if int(containerJavaSupport):
- try:
- print 'Java Home: ', os.environ['JAVA_HOME']
- print 'Java Lib: ', os.environ['JAVA_LIB']
- resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':1})
- except KeyError:
- print '''
- *********************************** Error *************************************
- * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
- * Please configure JAVA_HOME to point to your Java 7 JDK and
- * JAVA_LIB to your folder containing libjvm
- * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
- * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server
- *******************************************************************************
- '''
- resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':0})
+ try:
+ print 'Java Home: ', os.environ['JAVA_HOME']
+ print 'Java Lib: ', os.environ['JAVA_LIB']
+ resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':1})
+ except KeyError:
+ print '''
+ *********************************** Error *************************************
+ * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
+ * Please configure JAVA_HOME to point to your Java 7 JDK and
+ * JAVA_LIB to your folder containing libjvm
+ * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
+ * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server
+ *******************************************************************************
+ '''
+ resource_container_env.Append(CPPDEFINES={'JAVA_SUPPORT':0})
resource_container_env.AppendUnique(
- CPPPATH = [
- env.get('SRC_DIR')+'/extlibs',
- '../../include',
- 'include',
- 'bundle-api/include',
- 'src'
- ])
+ CPPPATH = [
+ env.get('SRC_DIR')+'/extlibs',
+ '../resource-encapsulation/include',
+ 'include',
+ 'bundle-api/include',
+ 'src'
+ ])
if int(containerJavaSupport):
- try:
- resource_container_env.AppendUnique(
- CPPPATH = [
- os.environ['JAVA_HOME']+'/include',
- os.environ['JAVA_HOME']+'/include/linux'
- ])
- except KeyError:
- print ''
+ try:
+ resource_container_env.AppendUnique(
+ CPPPATH = [
+ os.environ['JAVA_HOME']+'/include',
+ os.environ['JAVA_HOME']+'/include/linux'
+ ])
+ except KeyError:
+ print ''
if target_os not in ['windows', 'winrt']:
- resource_container_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
- if target_os != 'android':
- resource_container_env.AppendUnique(CXXFLAGS = ['-pthread'])
+ resource_container_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ if target_os != 'android':
+ resource_container_env.AppendUnique(CXXFLAGS = ['-pthread'])
if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
- resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
+ resource_container_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
if target_os == 'android':
- resource_container_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- resource_container_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
+ resource_container_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
+ resource_container_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
try:
- resource_container_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
+ resource_container_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
except KeyError:
- print ''
+ print ''
resource_container_env.PrependUnique(LIBS = ['rcs_client', 'rcs_server', 'rcs_common', 'oc','octbstack', 'oc_logger', 'connectivity_abstraction'])
resource_container_env.AppendUnique(LIBS = ['dl', 'boost_system', 'boost_date_time', 'boost_thread'])
if int(containerJavaSupport):
- try:
- print 'Java Lib: ', os.environ['JAVA_LIB']
- resource_container_env.AppendUnique(LIBS = ['jvm'])
- except KeyError:
- print ''
+ try:
+ print 'Java Lib: ', os.environ['JAVA_LIB']
+ resource_container_env.AppendUnique(LIBS = ['jvm'])
+ except KeyError:
+ print ''
######################################################################
# Source files and Targets
######################################################################
res_container_src = ['src/BaseActivator.cpp','src/BundleActivator.cpp','src/RCSBundleInfo.cpp',
- 'src/BundleInfoInternal.cpp', 'src/BundleResource.cpp', 'src/Configuration.cpp', 'src/JavaBundleResource.cpp', 'src/ProtocolBridgeResource.cpp',
- 'src/ProtocolBridgeConnector.cpp', 'src/RCSResourceContainer.cpp', 'src/ResourceContainerBundleAPI.cpp', 'src/ResourceContainerImpl.cpp',
- 'src/SoftSensorResource.cpp', 'src/DiscoverResourceUnit.cpp', 'src/RemoteResourceUnit.cpp',
- ]
+ 'src/BundleInfoInternal.cpp', 'src/BundleResource.cpp', 'src/Configuration.cpp', 'src/JavaBundleResource.cpp', 'src/ProtocolBridgeResource.cpp',
+ 'src/ProtocolBridgeConnector.cpp', 'src/RCSResourceContainer.cpp', 'src/ResourceContainerBundleAPI.cpp', 'src/ResourceContainerImpl.cpp',
+ 'src/SoftSensorResource.cpp', 'src/DiscoverResourceUnit.cpp', 'src/RemoteResourceUnit.cpp',
+ ]
res_container_static = resource_container_env.StaticLibrary('rcs_container', res_container_src)
res_container_shared = resource_container_env.SharedLibrary('rcs_container', res_container_src)
resource_container_env.InstallTarget([res_container_static,res_container_shared], 'libResContainer')
+resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
+resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
+
######################################################################
# build discomfort index sensor sample bundle
######################################################################
if target_os in ['linux', 'tizen', 'android']:
- DI_sensor_bundle_env = resource_container_env.Clone()
- DI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ DI_sensor_bundle_env = resource_container_env.Clone()
+ DI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
- DI_SENSOR_BUNDLE_DIR = 'examples/DiscomfortIndexSensorBundle/'
- DI_sensor_bundle_env.AppendUnique(CPPPATH = [ DI_SENSOR_BUNDLE_DIR + 'include' ])
+ DI_SENSOR_BUNDLE_DIR = 'examples/DiscomfortIndexSensorBundle/'
+ DI_sensor_bundle_env.AppendUnique(CPPPATH = [ DI_SENSOR_BUNDLE_DIR + 'include' ])
- DI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
+ DI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
- DI_sensor_bundle_src = [ Glob(DI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
+ DI_sensor_bundle_src = [ Glob(DI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
- DISensorBundle = DI_sensor_bundle_env.SharedLibrary('DISensorBundle', DI_sensor_bundle_src)
- DI_sensor_bundle_env.InstallTarget(DISensorBundle, 'libDISensorBundle')
+ DISensorBundle = DI_sensor_bundle_env.SharedLibrary('DISensorBundle', DI_sensor_bundle_src)
+ DI_sensor_bundle_env.InstallTarget(DISensorBundle, 'libDISensorBundle')
- if target_os == 'linux' :
- SConscript(DI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
- 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 == 'linux' :
+ SConscript(DI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
+ 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"))
######################################################################
# build BMI sensor sample bundle
######################################################################
if target_os in ['linux', 'tizen', 'android']:
- BMI_sensor_bundle_env = resource_container_env.Clone()
- BMI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ BMI_sensor_bundle_env = resource_container_env.Clone()
+ BMI_sensor_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
- BMI_SENSOR_BUNDLE_DIR = 'examples/BMISensorBundle/'
- BMI_sensor_bundle_env.AppendUnique(CPPPATH = [ BMI_SENSOR_BUNDLE_DIR + 'include' ])
+ BMI_SENSOR_BUNDLE_DIR = 'examples/BMISensorBundle/'
+ BMI_sensor_bundle_env.AppendUnique(CPPPATH = [ BMI_SENSOR_BUNDLE_DIR + 'include' ])
- BMI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
+ BMI_sensor_bundle_env.PrependUnique(LIBS = ['rcs_container'])
- BMI_sensor_bundle_src = [ Glob(BMI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
+ BMI_sensor_bundle_src = [ Glob(BMI_SENSOR_BUNDLE_DIR + 'src/*.cpp')]
- BMISensorBundle = BMI_sensor_bundle_env.SharedLibrary('BMISensorBundle', BMI_sensor_bundle_src)
- BMI_sensor_bundle_env.InstallTarget(BMISensorBundle, 'libBMISensorBundle')
+ BMISensorBundle = BMI_sensor_bundle_env.SharedLibrary('BMISensorBundle', BMI_sensor_bundle_src)
+ BMI_sensor_bundle_env.InstallTarget(BMISensorBundle, 'libBMISensorBundle')
- if target_os == 'linux' :
- SConscript(BMI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
- 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 == 'linux' :
+ SConscript(BMI_SENSOR_BUNDLE_DIR + 'src/inputSensors/SConscript')
+ 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"))
######################################################################
# build hue sample bundle
conf2 = Configure(lib_env)
if not conf2.CheckLib('curl'):
- print '''X
+ print '''X
*********************************** Error *************************************
* Cannot build hue sample. Please install libcurl.
* Example (Ubuntu):
-* sudo apt-get install libcurl4-openssl-dev
-* sudo ldconfig
+* sudo apt-get install libcurl4-openssl-dev
+* sudo ldconfig
* Hint: check with pkg-config --libs libcurl and clear scons cache.
* Skipping hue sample build.
*******************************************************************************
- '''
+ '''
else:
- hue_resource_bundle_env = resource_container_env.Clone()
- hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
+ hue_resource_bundle_env = resource_container_env.Clone()
+ hue_resource_bundle_env.AppendUnique(CCFLAGS = ['-fPIC'])
- HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/'
- hue_resource_bundle_env.AppendUnique(CPPPATH = [
- HUE_RESOURCE_BUNDLE_DIR + 'include',
- 'include/'
- ])
+ HUE_RESOURCE_BUNDLE_DIR = 'examples/HueSampleBundle/'
+ hue_resource_bundle_env.AppendUnique(CPPPATH = [
+ HUE_RESOURCE_BUNDLE_DIR + 'include',
+ 'include/'
+ ])
- hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container'])
+ hue_resource_bundle_env.PrependUnique(LIBS = ['curl', 'rcs_container'])
- hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
+ hue_resource_bundle_src = [ Glob(HUE_RESOURCE_BUNDLE_DIR + 'src/*.cpp')]
- HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
- hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
+ HueBundle = hue_resource_bundle_env.SharedLibrary('HueBundle', hue_resource_bundle_src)
+ hue_resource_bundle_env.InstallTarget(HueBundle, 'libHueBundle')
lib_env = conf2.Finish()
######################################################################
# build resource container unit tests
######################################################################
if target_os == 'linux':
- SConscript('unittests/SConscript')
+ SConscript('unittests/SConscript')
######################################################################
# Build Container Sample
containersampleclient_src = ['examples/ContainerSampleClient.cpp']
containersampleclientapp = containersample_env.Program('ContainerSampleClient',containersampleclient_src)
Alias("containersampleclient", containersampleclientapp)
-env.AppendTarget('containersampleclient')
-
-
+env.AppendTarget('containersampleclient')
\ No newline at end of file
env.AddMethod(filtered_glob, "FilteredGlob");
if env.get('RELEASE'):
- env.AppendUnique(CCFLAGS = ['-Os'])
- env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ env.AppendUnique(CCFLAGS = ['-Os'])
+ env.AppendUnique(CPPDEFINES = ['NDEBUG'])
else:
- env.AppendUnique(CCFLAGS = ['-g'])
+ env.AppendUnique(CCFLAGS = ['-g'])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES = ['TB_LOG'])
container_gtest_env = lib_env.Clone()
if int(containerJavaSupport):
- try:
- print 'Java Home: ', os.environ['JAVA_HOME']
- print 'Java Lib: ', os.environ['JAVA_LIB']
- container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':1})
- except KeyError:
- print '''
- *********************************** Error *************************************
- * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
- * Please configure JAVA_HOME to point to your Java 7 JDK and
- * JAVA_LIB to your folder containing libjvm
- * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
- * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server/
- *******************************************************************************
- '''
- container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':0})
+ try:
+ print 'Java Home: ', os.environ['JAVA_HOME']
+ print 'Java Lib: ', os.environ['JAVA_LIB']
+ container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':1})
+ except KeyError:
+ print '''
+ *********************************** Error *************************************
+ * Building resource container without Java support. JAVA_HOME or JAVA_LIB are not set properly
+ * Please configure JAVA_HOME to point to your Java 7 JDK and
+ * JAVA_LIB to your folder containing libjvm
+ * Example: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
+ * export JAVA_LIB=/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/server/
+ *******************************************************************************
+ '''
+ container_gtest_env.Append(CPPDEFINES={'JAVA_SUPPORT_TEST':0})
target_os = env.get('TARGET_OS')
gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
container_gtest_env.AppendUnique(
- CPPPATH = [
- env.get('SRC_DIR')+'/extlibs',
- '../include',
- '../../../include',
- '../include/internal',
- '../../common/utils/include',
- '../bundle-api/include'
- ])
+ CPPPATH = [
+ env.get('SRC_DIR')+'/extlibs',
+ '../include',
+ '../../resource-encapsulation/include',
+ '../../resource-encapsulation/src/common/utils/include',
+ '../bundle-api/include',
+ '../src'
+ ])
if int(containerJavaSupport):
- try:
- container_gtest_env.AppendUnique(
- CPPPATH = [
- os.environ['JAVA_HOME']+'/include',
- os.environ['JAVA_HOME']+'/include/linux'
- ])
- except KeyError:
- print ''
+ try:
+ container_gtest_env.AppendUnique(
+ CPPPATH = [
+ os.environ['JAVA_HOME']+'/include',
+ os.environ['JAVA_HOME']+'/include/linux'
+ ])
+ except KeyError:
+ print ''
if target_os not in ['windows', 'winrt']:
- container_gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
- if target_os != 'android':
- container_gtest_env.AppendUnique(CXXFLAGS = ['-pthread'])
- container_gtest_env.AppendUnique(LIBS = ['pthread'])
+ container_gtest_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
+ if target_os != 'android':
+ container_gtest_env.AppendUnique(CXXFLAGS = ['-pthread'])
+ container_gtest_env.AppendUnique(LIBS = ['pthread'])
if target_os == 'android':
container_gtest_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
gtest_dir + '/include'])
if int(containerJavaSupport):
- try:
- container_gtest_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
- except KeyError:
- print ''
+ try:
+ container_gtest_env.AppendUnique(LIBPATH = [os.environ['JAVA_LIB']])
+ except KeyError:
+ print ''
container_gtest_env.AppendUnique(CCFLAGS = ['-Wnoexcept'])
container_gtest_env.AppendUnique(LIBS = ['dl'])
if int(containerJavaSupport):
- try:
- print 'Java Lib: ', os.environ['JAVA_LIB']
- container_gtest_env.AppendUnique(LIBS = ['jvm'])
- except KeyError:
- print ''
+ try:
+ print 'Java Lib: ', os.environ['JAVA_LIB']
+ container_gtest_env.AppendUnique(LIBS = ['jvm'])
+ except KeyError:
+ print ''
######################################################################
# build test bundle
TEST_BUNDLE_DIR = 'TestBundle/'
test_bundle_env.AppendUnique(CPPPATH = [
- TEST_BUNDLE_DIR + 'include',
- '../include/'
- ])
+ TEST_BUNDLE_DIR + 'include'
+ ])
test_bundle_src = [ Glob(TEST_BUNDLE_DIR + 'src/*.cpp'), Glob('src/*.cpp')]
Ignore("./TestBundleJava/hue-0.1-jar-with-dependencies.jar", "./TestBundleJava/hue-0.1-jar-with-dependencies.jar")
if env.get('TEST') == '1':
- target_os = env.get('TARGET_OS')
- if target_os == 'linux':
- from tools.scons.RunTest import *
- run_test(container_gtest_env,
- '',
- 'service/resource-encapsulation/src/resourceContainer/unittests/container_test')
\ No newline at end of file
+ target_os = env.get('TARGET_OS')
+ if target_os == 'linux':
+ from tools.scons.RunTest import *
+ run_test(container_gtest_env,
+ '',
+ 'service/resource-container/unittests/container_test')
\ No newline at end of file