print "Given Transport is %s" % transport
if env.get('RELEASE'):
- env.AppendUnique(CFLAGS = ['-std=c99', '-fPIC', '-D__TIZEN__','-DWITH_POSIX', '-Wall','-D_GNU_SOURCE','-DTIZEN_DEBUG_ENABLE'])
+ env.AppendUnique(CFLAGS=[
+ '-std=c99', '-fPIC', '-D__TIZEN__', '-DWITH_POSIX', '-Wall',
+ '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'
+ ])
else:
- env.AppendUnique(CFLAGS = ['-std=c99', '-fPIC', '-D__TIZEN__','-DWITH_POSIX', '-Wall', '-DSLP_SDK_LOG', '-g','-D_GNU_SOURCE','-DTIZEN_DEBUG_ENABLE'])
+ env.AppendUnique(CFLAGS=[
+ '-std=c99', '-fPIC', '-D__TIZEN__', '-DWITH_POSIX', '-Wall',
+ '-DSLP_SDK_LOG', '-g', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'
+ ])
if env.get('LOGGING'):
- env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ env.AppendUnique(CPPDEFINES=['TB_LOG'])
-env.ParseConfig("pkg-config --cflags --libs capi-network-connection dlog glib-2.0")
+env.ParseConfig(
+ "pkg-config --cflags --libs capi-network-connection dlog glib-2.0")
if env.get('OIC_SUPPORT_TIZEN_TRACE') == 'True':
- env.ParseConfig("pkg-config --cflags --libs ttrace")
+ env.ParseConfig("pkg-config --cflags --libs ttrace")
if 'ALL' in transport:
- env.AppendUnique(CPPDEFINES = ['WIFI_ADAPTER', 'NO_ETHERNET_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
- print "CA Transport is ALL"
+ env.AppendUnique(CPPDEFINES=[
+ 'WIFI_ADAPTER', 'NO_ETHERNET_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER'
+ ])
+ print "CA Transport is ALL"
else:
- if 'BT' in transport:
- env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
- print "CA Transport is BT"
- else:
- env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
-
- if 'BLE' in transport:
- env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
- print "CA Transport is BLE"
- else:
- env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
-
- if 'WIFI' in transport:
- env.AppendUnique(CPPDEFINES = ['WIFI_ADAPTER'])
- print "CA Transport is WIFI"
- else:
- env.AppendUnique(CPPDEFINES = ['NO_WIFI_ADAPTER'])
-
- if with_tcp == True:
- env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
- print "CA Transport is TCP"
- else:
- env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
+ if 'BT' in transport:
+ env.AppendUnique(CPPDEFINES=['EDR_ADAPTER'])
+ print "CA Transport is BT"
+ else:
+ env.AppendUnique(CPPDEFINES=['NO_EDR_ADAPTER'])
+ if 'BLE' in transport:
+ env.AppendUnique(CPPDEFINES=['LE_ADAPTER'])
+ print "CA Transport is BLE"
+ else:
+ env.AppendUnique(CPPDEFINES=['NO_LE_ADAPTER'])
+
+ if 'WIFI' in transport:
+ env.AppendUnique(CPPDEFINES=['WIFI_ADAPTER'])
+ print "CA Transport is WIFI"
+ else:
+ env.AppendUnique(CPPDEFINES=['NO_WIFI_ADAPTER'])
+
+ if with_tcp == True:
+ env.AppendUnique(CPPDEFINES=['TCP_ADAPTER'])
+ print "CA Transport is TCP"
+ else:
+ env.AppendUnique(CPPDEFINES=['NO_TCP_ADAPTER'])
env.SConscript(['../con/lib/libcoap-4.1.1/SConscript'])
env.SConscript(['../con/SConscript'])
build_dir = env.get('BUILD_DIR')
-env.AppendUnique(CPPPATH = [os.path.join(Dir('.').abspath, 'include'),
- os.path.join('#', 'resource', 'c_common')
- ])
+env.AppendUnique(CPPPATH=[
+ os.path.join(Dir('.').abspath, 'include'),
+ os.path.join('#', 'resource', 'c_common')
+])
if env.get('TARGET_OS') in ['arduino']:
- env.AppendUnique(CPPPATH = [os.path.join(build_dir, 'resource', 'c_common', 'oic_string', 'include')])
+ env.AppendUnique(CPPPATH=[
+ os.path.join(build_dir, 'resource', 'c_common', 'oic_string',
+ 'include')
+ ])
if env.get('TARGET_OS') == 'tizen':
- env.AppendUnique(LIBPATH = [build_dir])
+ env.AppendUnique(LIBPATH=[build_dir])
else:
- env.AppendUnique(LIBPATH = [os.path.join(build_dir, 'resource', 'csdk', 'logger')])
+ env.AppendUnique(
+ LIBPATH=[os.path.join(build_dir, 'resource', 'csdk', 'logger')])
if env.get('OIC_SUPPORT_TIZEN_TRACE') == 'True':
- env.AppendUnique(CPPDEFINES = ['OIC_SUPPORT_TIZEN_TRACE'])
+ env.AppendUnique(CPPDEFINES=['OIC_SUPPORT_TIZEN_TRACE'])
local_env = env.Clone()
# Therefore we copy it to a .cpp name so it is compiled correctly.
if env.get('TARGET_OS') in ['arduino']:
- Command("./src/logger.cpp", "./src/logger.c", Copy("$TARGET", "$SOURCE"))
- logger_src = ['./src/logger.cpp']
+ Command("./src/logger.cpp", "./src/logger.c", Copy("$TARGET", "$SOURCE"))
+ logger_src = ['./src/logger.cpp']
else:
- logger_src = ['./src/logger.c', './src/trace.c']
+ logger_src = ['./src/logger.c', './src/trace.c']
if log_level == 'INFO':
env.AppendUnique(CPPDEFINES = ['SET_LOG_INFO'])
rd_env = env.Clone()
if rd_env.get('LOGGING'):
- rd_env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
+ rd_env.AppendUnique(CPPDEFINES=['-DTB_LOG'])
target_os = env.get('TARGET_OS')
src_dir = env.get('SRC_DIR')
######################################################################
# Build flags
######################################################################
-rd_env.AppendUnique(CPPPATH = [ '#/resource/csdk/security/include',
- 'include',
- 'src/internal',
- '#/resource/csdk/include',
- '#/resource/csdk/stack/include',
- '#/resource/csdk/stack/include/internal',
- '#/resource/include',
- '#/resource/csdk/logger/include',
- '#/resource/oc_logger/include',
- '#/resource/csdk/connectivity/api'
+rd_env.AppendUnique(CPPPATH=[
+ '#/resource/csdk/security/include',
+ 'include',
+ 'src/internal',
+ '#/resource/csdk/include',
+ '#/resource/csdk/stack/include',
+ '#/resource/csdk/stack/include/internal',
+ '#/resource/include',
+ '#/resource/csdk/logger/include',
+ '#/resource/oc_logger/include',
+ '#/resource/csdk/connectivity/api'
])
if 'CLIENT' in rd_mode:
- rd_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
+ rd_env.AppendUnique(CPPDEFINES=['RD_CLIENT'])
if 'SERVER' in rd_mode:
- rd_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+ rd_env.AppendUnique(CPPDEFINES=['RD_SERVER'])
if target_os != 'android':
- rd_env.PrependUnique(RPATH = [rd_env.get('BUILD_DIR')])
-rd_env.PrependUnique(LIBS = ['octbstack', 'oc', 'oc_logger', 'connectivity_abstraction'])
+ rd_env.PrependUnique(RPATH=[rd_env.get('BUILD_DIR')])
+rd_env.PrependUnique(
+ LIBS=['octbstack', 'oc', 'oc_logger', 'connectivity_abstraction'])
if target_os not in ['windows']:
- rd_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
+ rd_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
else:
- # Non-Windows platforms find the boost headers under /usr/include or similar path.\r
- rd_env.AppendUnique(CPPPATH = ['#/extlibs/boost/boost'])
+ # Non-Windows platforms find the boost headers under /usr/include or similar path.
+ rd_env.AppendUnique(CPPPATH=['#/extlibs/boost/boost'])
if target_os == 'android':
- rd_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
- rd_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libresource_directory.so'])
- rd_env.AppendUnique(LIBS = ['gnustl_static'])
+ rd_env.AppendUnique(CXXFLAGS=['-frtti', '-fexceptions'])
+ rd_env.AppendUnique(LINKFLAGS=['-Wl,-soname,libresource_directory.so'])
+ rd_env.AppendUnique(LIBS=['gnustl_static'])
if not env.get('RELEASE'):
- rd_env.AppendUnique(LIBS = ['log'])
+ rd_env.AppendUnique(LIBS=['log'])
if target_os in ['linux', 'tizen']:
rd_env.ParseConfig('pkg-config --cflags --libs sqlite3')
else:
- rd_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
+ rd_env.AppendUnique(CPPPATH=['../../../extlibs/sqlite3'])
######################################################################
# Source files and Targets
rd_src_c += [
RD_SRC_DIR + 'internal/rd_database.c',
RD_SRC_DIR + 'rd_server.c',
- ]
- if target_os not in ['linux', 'tizen', 'windows'] :
- rd_src_c += [ '../../../extlibs/sqlite3/sqlite3.c' ]
+ ]
+ if target_os not in ['linux', 'tizen', 'windows']:
+ rd_src_c += ['../../../extlibs/sqlite3/sqlite3.c']
if 'CLIENT' in rd_mode:
rd_src_c += [RD_SRC_DIR + 'rd_client.c',]
rd_src_all = rd_src_c
-if target_os not in ['arduino','darwin','ios']:
- rd_src_cpp += [ RD_SRC_DIR + 'RDClient.cpp']
+if target_os not in ['arduino', 'darwin', 'ios']:
+ rd_src_cpp += [RD_SRC_DIR + 'RDClient.cpp']
if 'CLIENT' in rd_mode:
rd_src_all += rd_src_cpp
rd_env.UserInstallTargetLib(rdsdk, 'resource_directory')
if 'CLIENT' in rd_mode:
- rd_env.UserInstallTargetHeader('include/rd_client.h', 'resource', 'rd_client.h')
- rd_env.UserInstallTargetHeader('include/RDClient.h', 'resource', 'RDClient.h')
+ rd_env.UserInstallTargetHeader(
+ 'include/rd_client.h', 'resource', 'rd_client.h')
+ rd_env.UserInstallTargetHeader(
+ 'include/RDClient.h', 'resource', 'RDClient.h')
if 'SERVER' in rd_mode:
- rd_env.UserInstallTargetHeader('include/rd_server.h', 'resource', 'rd_server.h')
- rd_env.UserInstallTargetHeader('include/rd_database.h', 'resource', 'rd_database.h')
+ rd_env.UserInstallTargetHeader(
+ 'include/rd_server.h', 'resource', 'rd_server.h')
+ rd_env.UserInstallTargetHeader(
+ 'include/rd_database.h', 'resource', 'rd_database.h')
######################################################################
# Samples for the resource directory
Import('env')
lib_env = env.Clone()
-SConscript('#resource/third_party_libs.scons', 'lib_env')
+SConscript('#/resource/third_party_libs.scons', 'lib_env')
rd_sample_app_env = lib_env.Clone()
######################################################################
# Build flags
######################################################################
-rd_sample_app_env.AppendUnique(CPPPATH = ['../include',
- '../src/internal',
- src_dir + '/resource/csdk/include',
- src_dir + '/resource/csdk/stack/include',
- src_dir + '/resource/csdk/security/include',
- src_dir + '/resource/include',
- src_dir + '/resource/oc_logger/include',])
+rd_sample_app_env.AppendUnique(CPPPATH=[
+ '../include',
+ '../src/internal',
+ src_dir + '/resource/csdk/include',
+ src_dir + '/resource/csdk/stack/include',
+ src_dir + '/resource/csdk/security/include',
+ src_dir + '/resource/include',
+ src_dir + '/resource/oc_logger/include',
+])
if target_os not in ['windows']:
- rd_sample_app_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
-rd_sample_app_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
-rd_sample_app_env.PrependUnique(LIBS = ['resource_directory', 'octbstack'])
+ rd_sample_app_env.AppendUnique(
+ CXXFLAGS=['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x'])
+rd_sample_app_env.AppendUnique(RPATH=[env.get('BUILD_DIR')])
+rd_sample_app_env.PrependUnique(LIBS=['resource_directory', 'octbstack'])
if env.get('SECURED') == '1':
- rd_sample_app_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
+ rd_sample_app_env.AppendUnique(LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
if env.get('LOGGING'):
- rd_sample_app_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ rd_sample_app_env.AppendUnique(CPPDEFINES=['TB_LOG'])
if rd_sample_app_env.get('RD_MODE'):
rd_mode = rd_sample_app_env.get('RD_MODE')
if 'CLIENT' in rd_mode:
- rd_sample_app_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
+ rd_sample_app_env.AppendUnique(CPPDEFINES=['RD_CLIENT'])
if 'SERVER' in rd_mode:
- rd_sample_app_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+ rd_sample_app_env.AppendUnique(CPPDEFINES=['RD_SERVER'])
####################################################################
# Source files and Targets
######################################################################
-rd_queryClient = rd_sample_app_env.Program('rd_queryClient', 'rd_queryClient.cpp')
+rd_queryClient = rd_sample_app_env.Program('rd_queryClient',
+ 'rd_queryClient.cpp')
if 'SERVER' in rd_sample_app_env.get('RD_MODE'):
rd_server = rd_sample_app_env.Program('rd_server', 'rd_main.c')
Alias("resource_directory", [rd_server, rd_queryClient])
if 'CLIENT' in rd_sample_app_env.get('RD_MODE'):
- rd_publishingClient = rd_sample_app_env.Program('rd_publishingClient', 'rd_publishingClient.cpp')
+ rd_publishingClient = rd_sample_app_env.Program('rd_publishingClient',
+ 'rd_publishingClient.cpp')
Alias("resource_directory", [rd_publishingClient, rd_queryClient])
env.AppendTarget('resource_directory')
# SConscript file for Local PKI google tests
from tools.scons.RunTest import run_test
-gtest_env = SConscript('#extlibs/gtest/SConscript')
+gtest_env = SConscript('#/extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
target_os = lib_env.get('TARGET_OS')
if lib_env.get('RELEASE'):
- lib_env.AppendUnique(CCFLAGS = ['-Os'])
- lib_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
+ lib_env.AppendUnique(CCFLAGS=['-Os'])
+ lib_env.AppendUnique(CPPDEFINES=['NDEBUG'])
else:
- lib_env.AppendUnique(CCFLAGS = ['-g'])
+ lib_env.AppendUnique(CCFLAGS=['-g'])
if lib_env.get('LOGGING'):
- lib_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
+ lib_env.AppendUnique(CPPDEFINES=['TB_LOG'])
# Add third party libraries
-SConscript('#resource/third_party_libs.scons', 'lib_env')
+SConscript('#/resource/third_party_libs.scons', 'lib_env')
if target_os in ['linux']:
- SConscript('#extlibs/hippomocks/SConscript')
+ SConscript('#/extlibs/hippomocks/SConscript')
rd_test_env = lib_env.Clone()
######################################################################
with_upstream_libcoap = rd_test_env.get('WITH_UPSTREAM_LIBCOAP')
if with_upstream_libcoap == '1':
- rd_test_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
+ rd_test_env.AppendUnique(CPPPATH=['#extlibs/libcoap/libcoap/include'])
else:
- rd_test_env.AppendUnique(CPPPATH = [
- src_dir + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include'
- ])
+ rd_test_env.AppendUnique(CPPPATH=[
+ src_dir + '/resource/csdk/connectivity/lib/libcoap-4.1.1/include'
+ ])
-rd_test_env.AppendUnique(
- CPPPATH = [
- src_dir + '/extlibs/hippomocks/hippomocks',
- '../include',
- src_dir + '/resource/include',
- src_dir + '/resource/csdk/connectivity/api',
- src_dir + '/resource/csdk/include',
- src_dir + '/resource/csdk/stack/include',
- src_dir + '/resource/csdk/security/include',
- src_dir + '/resource/csdk/stack/test/',
- src_dir + '/resource/oc_logger/include',])
+rd_test_env.AppendUnique(CPPPATH=[
+ src_dir + '/extlibs/hippomocks/hippomocks',
+ '../include',
+ src_dir + '/resource/include',
+ src_dir + '/resource/csdk/connectivity/api',
+ src_dir + '/resource/csdk/include',
+ src_dir + '/resource/csdk/stack/include',
+ src_dir + '/resource/csdk/security/include',
+ src_dir + '/resource/csdk/stack/test/',
+ src_dir + '/resource/oc_logger/include',
+])
-rd_test_env.AppendUnique(RPATH = [lib_env.get('BUILD_DIR')])
-rd_test_env.PrependUnique(LIBS = ['octbstack'])
+rd_test_env.AppendUnique(RPATH=[lib_env.get('BUILD_DIR')])
+rd_test_env.PrependUnique(LIBS=['octbstack'])
if rd_test_env.get('RD_MODE'):
rd_mode = rd_test_env.get('RD_MODE')
- rd_test_env.PrependUnique(LIBS = ['resource_directory'])
+ rd_test_env.PrependUnique(LIBS=['resource_directory'])
if 'CLIENT' in rd_mode:
- rd_test_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
- rd_test_env.AppendUnique(LIBS = ['oc', 'oc_logger'])
+ rd_test_env.AppendUnique(CPPDEFINES=['RD_CLIENT'])
+ rd_test_env.AppendUnique(LIBS=['oc', 'oc_logger'])
if 'SERVER' in rd_mode:
- rd_test_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+ rd_test_env.AppendUnique(CPPDEFINES=['RD_SERVER'])
######################################################################
# Build Test
local_env = env.Clone()
-local_env.AppendUnique(CPPPATH = [os.path.join(Dir('.').abspath, './include')])
+local_env.AppendUnique(CPPPATH=[os.path.join(Dir('.').abspath, './include')])
if env.get('ROUTING') == 'GW':
- local_env.AppendUnique(CPPPATH = [
- os.path.join(Dir('.').abspath, './../include'),
- os.path.join(Dir('.').abspath, './../stack/include'),
- os.path.join(Dir('.').abspath, './../stack/include/internal'),
- os.path.join(Dir('.').abspath, './../logger'),
- os.path.join(Dir('.').abspath, './../../oc_logger/include'),
- os.path.join(Dir('.').abspath, './../../c_common/ocrandom/include'),
- os.path.join(Dir('.').abspath, './../connectivity/api'),
- os.path.join(Dir('.').abspath, './../connectivity/common/inc'),
- os.path.join(Dir('.').abspath, './../security/include'),
- os.path.join(Dir('.').abspath, './../connectivity/external/inc')
- ])
+ local_env.AppendUnique(CPPPATH=[
+ os.path.join(Dir('.').abspath, './../include'),
+ os.path.join(Dir('.').abspath, './../stack/include'),
+ os.path.join(Dir('.').abspath, './../stack/include/internal'),
+ os.path.join(Dir('.').abspath, './../logger'),
+ os.path.join(Dir('.').abspath, './../../oc_logger/include'),
+ os.path.join(Dir('.').abspath, './../../c_common/ocrandom/include'),
+ os.path.join(Dir('.').abspath, './../connectivity/api'),
+ os.path.join(Dir('.').abspath, './../connectivity/common/inc'),
+ os.path.join(Dir('.').abspath, './../security/include'),
+ os.path.join(Dir('.').abspath, './../connectivity/external/inc')
+ ])
elif env.get('ROUTING') == 'EP':
- local_env.AppendUnique(CPPPATH = [
- os.path.join(Dir('.').abspath, './../include'),
- os.path.join(Dir('.').abspath, './../stack/include'),
- os.path.join(Dir('.').abspath, './../stack/include/internal'),
- os.path.join(Dir('.').abspath, './../logger'),
- os.path.join(Dir('.').abspath, './../../oc_logger/include'),
- os.path.join(Dir('.').abspath, './../connectivity/api'),
- os.path.join(Dir('.').abspath, './../connectivity/common/inc'),
- os.path.join(Dir('.').abspath, './../connectivity/external/inc')
- ])
+ local_env.AppendUnique(CPPPATH=[
+ os.path.join(Dir('.').abspath, './../include'),
+ os.path.join(Dir('.').abspath, './../stack/include'),
+ os.path.join(Dir('.').abspath, './../stack/include/internal'),
+ os.path.join(Dir('.').abspath, './../logger'),
+ os.path.join(Dir('.').abspath, './../../oc_logger/include'),
+ os.path.join(Dir('.').abspath, './../connectivity/api'),
+ os.path.join(Dir('.').abspath, './../connectivity/common/inc'),
+ os.path.join(Dir('.').abspath, './../connectivity/external/inc')
+ ])
######################################################################
# Build flags
######################################################################
if env.get('LOGGING') == '1':
- local_env.AppendUnique(CPPDEFINES=['TB_LOG'])
+ local_env.AppendUnique(CPPDEFINES=['TB_LOG'])
######################################################################
# Source files and Targets
######################################################################
if env.get('ROUTING') == 'GW':
- routing_src = [
- './src/routingutility.c',
- './src/routingmanager.c',
- './src/routingtablemanager.c',
- './src/routingmanagerinterface.c',
- './src/routingmessageparser.c',
+ routing_src = [
+ './src/routingutility.c',
+ './src/routingmanager.c',
+ './src/routingtablemanager.c',
+ './src/routingmanagerinterface.c',
+ './src/routingmessageparser.c',
]
elif env.get('ROUTING') == 'EP':
- routing_src = [
- './src/routingutility.c',
+ routing_src = [
+ './src/routingutility.c',
]
routinglib = local_env.StaticLibrary('routingmanager', routing_src)