7 ca_os = env.get('TARGET_OS')
8 ca_transport = env.get('TARGET_TRANSPORT')
9 secured = env.get('SECURED')
12 current_dir=env.get('SRC_DIR')
14 # The tinydtls library location is ~/iotivity/extlibs. When scons run from connectivity folder,
15 # the build folder is ~/iotivity/resource/csdk/connectivity/out/linux/x86_64/release/.
16 # To include ~/iotivity/extlibs/tinyDTLS, it should go seven level up from the build folder.
17 extlib_dir ='../../../../../../../../'
19 #####################################################################
20 # Source files and Target(s)
21 ######################################################################
23 print"Reading ca script %s"%ca_transport
25 env.PrependUnique(CPPPATH = [root_dir + '/api/'])
26 env.AppendUnique(CPPPATH = [root_dir + '/inc/'])
27 env.AppendUnique(CPPPATH = [root_dir + '/lib/libcoap-4.1.1/'])
28 env.AppendUnique(CPPPATH = [root_dir + '/common/inc/'])
30 if ca_os not in ['arduino', 'windows', 'winrt']:
31 env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
33 if ca_os in ['darwin','ios']:
34 env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
36 #Getting common source files
37 env.SConscript('./../common/SConscript')
39 if env.get('SECURED') == '1':
40 if current_dir.find('connectivity') == -1:
41 env.SConscript(current_dir +'/extlibs/tinydtls/SConscript')
43 env.SConscript(extlib_dir + '/extlibs/tinydtls/SConscript')
46 env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapterutils.c'])
47 env.AppendUnique(CA_SRC=[ca_path+'adapter_util/camsgparser.c'])
48 if env.get('SECURED') == '1':
49 env.AppendUnique(CA_SRC=[ca_path+'adapter_util/caadapternetdtls.c'])
50 env.AppendUnique(CPPPATH = [root_dir + '/external/inc/'])
52 if ca_os == 'arduino':
53 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
55 ca_path + 'caconnectivitymanager_singlethread.c',
56 ca_path + 'cainterfacecontroller_singlethread.c',
57 ca_path + 'camessagehandler_singlethread.c',
58 ca_path + 'canetworkconfigurator.c',
59 ca_path + 'caprotocolmessage.c',
60 ca_path + 'caremotehandler.c',
61 ca_path + 'caretransmission_singlethread.c',
64 env.AppendUnique(CPPDEFINES = ['MULTI_THREAD'])
66 ca_path + 'caconnectivitymanager.c',
67 ca_path + 'cainterfacecontroller.c',
68 ca_path + 'camessagehandler.c',
69 ca_path + 'canetworkconfigurator.c',
70 ca_path + 'caprotocolmessage.c',
71 ca_path + 'caqueueingthread.c',
72 ca_path + 'caremotehandler.c',
73 ca_path + 'caretransmission.c',
76 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
77 if current_dir.find('connectivity') == -1:
78 env.AppendUnique(CPPPATH = [current_dir + '/extlibs/tinydtls'])
80 env.AppendUnique(CPPPATH = [extlib_dir + '/extlibs/tinydtls'])
81 env.AppendUnique(CA_SRC = ca_common_src)
85 if 'ALL' in ca_transport:
86 env.SConscript(ca_path + 'ip_adapter/SConscript')
87 env.SConscript(ca_path + 'bt_edr_adapter/SConscript')
88 env.SConscript(ca_path + 'bt_le_adapter/SConscript')
90 if 'IP' in ca_transport:
91 env.SConscript(ca_path + 'ip_adapter/SConscript')
93 if 'BT' in ca_transport:
94 env.SConscript(ca_path + 'bt_edr_adapter/SConscript')
96 if 'BLE' in ca_transport:
97 env.SConscript(ca_path + 'bt_le_adapter/SConscript')
99 print "Include path is %s" %env.get('CPPPATH')
100 print "Files path is %s" %env.get('CA_SRC')
101 if ca_os in ['android', 'tizen']:
102 calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
104 calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
105 env.InstallTarget(calib, 'libconnectivity_abstraction')