## # CA build script ## Import('env') ca_os = env.get('TARGET_OS') ca_transport = env.get('TARGET_TRANSPORT') secured = env.get('SECURED') root_dir = './../' ca_path = './' current_dir=env.get('SRC_DIR') # The tinydtls library location is ~/iotivity/extlibs. When scons run from connectivity folder, # the build folder is ~/iotivity/resource/csdk/connectivity/out/linux/x86_64/release/. # To include ~/iotivity/extlibs/tinyDTLS, it should go seven level up from the build folder. extlib_dir ='../../../../../../../../' ##################################################################### # Source files and Target(s) ###################################################################### print"Reading ca script %s"%ca_transport env.PrependUnique(CPPPATH = [root_dir + '/api/']) env.AppendUnique(CPPPATH = [root_dir + '/inc/']) env.AppendUnique(CPPPATH = [root_dir + '/lib/libcoap-4.1.1/']) env.AppendUnique(CPPPATH = [root_dir + '/common/inc/']) if ca_os not in ['arduino', 'windows', 'winrt']: env.AppendUnique(CPPDEFINES = ['WITH_POSIX']) if ca_os in ['darwin']: env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE']) #Getting common source files env.SConscript('./../common/SConscript') if env.get('SECURED') == '1': if current_dir.find('connectivity') == -1: env.SConscript(current_dir +'/extlibs/tinydtls/SConscript') else: env.SConscript(extlib_dir + '/extlibs/tinydtls/SConscript') env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapterutils.c']) env.AppendUnique(CA_SRC=[ca_path+'adapter_util/camsgparser.c']) if env.get('SECURED') == '1': env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapternetdtls.c']) env.AppendUnique(CPPPATH = [root_dir + '/external/inc/']) if ca_os == 'arduino': env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD']) ca_common_src = [ ca_path + 'caconnectivitymanager_singlethread.c', ca_path + 'cainterfacecontroller_singlethread.c', ca_path + 'camessagehandler_singlethread.c', ca_path + 'canetworkconfigurator.c', ca_path + 'caprotocolmessage.c', ca_path + 'caremotehandler.c', ca_path + 'caretransmission_singlethread.c', ] else: env.AppendUnique(CPPDEFINES = ['MULTI_THREAD']) ca_common_src = [ ca_path + 'caconnectivitymanager.c', ca_path + 'cainterfacecontroller.c', ca_path + 'camessagehandler.c', ca_path + 'canetworkconfigurator.c', ca_path + 'caprotocolmessage.c', ca_path + 'caqueueingthread.c', ca_path + 'caremotehandler.c', ca_path + 'caretransmission.c', ] if secured == '1': env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__']) if current_dir.find('connectivity') == -1: env.AppendUnique(CPPPATH = [current_dir + '/extlibs/tinydtls']) else: env.AppendUnique(CPPPATH = [extlib_dir + '/extlibs/tinydtls']) env.AppendUnique(CA_SRC = ca_common_src) if 'ALL' in ca_transport: env.SConscript(ca_path + 'ip_adapter/SConscript') env.SConscript(ca_path + 'bt_edr_adapter/SConscript') env.SConscript(ca_path + 'bt_le_adapter/SConscript') if 'IP' in ca_transport: env.SConscript(ca_path + 'ip_adapter/SConscript') if 'BT' in ca_transport: env.SConscript(ca_path + 'bt_edr_adapter/SConscript') if 'BLE' in ca_transport: env.SConscript(ca_path + 'bt_le_adapter/SConscript') print "Include path is %s" %env.get('CPPPATH') print "Files path is %s" %env.get('CA_SRC') if ca_os in ['android', 'tizen']: calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC')) else: calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC')) env.InstallTarget(calib, 'libconnectivity_abstraction')