9 ca_os = env.get('TARGET_OS')
10 ca_transport = env.get('TARGET_TRANSPORT')
11 secured = env.get('SECURED')
12 with_ra = env.get ('WITH_RA')
16 #####################################################################
17 # Source files and Target(s)
18 ######################################################################
20 print"Reading ca script %s"%ca_transport
22 env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ])
23 env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'),
24 os.path.join(root_dir, 'lib/libcoap-4.1.1'),
25 os.path.join(root_dir, 'common/inc') ])
27 if ca_os not in ['arduino', 'windows', 'winrt']:
28 env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
30 if ca_os in ['darwin','ios']:
31 env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
33 # Getting common source files
34 env.SConscript('./../common/SConscript')
36 # The tinydtls library is found in '#extlibs/tinydtls', where the '#'
37 # is interpreted by SCons as the top-level iotivity directory where
38 # the SConscruct file is found.
39 if env.get('SECURED') == '1':
41 env.SConscript(os.path.join(root_dir, 'extlibs/tinydtls/SConscript'))
43 env.SConscript('#extlibs/tinydtls/SConscript')
45 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
46 'adapter_util/caadapterutils.c')])
47 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
48 'adapter_util/cafragmentation.c')])
49 if ca_os in ['android', 'tizen']:
50 env.AppendUnique(CA_SRC=[os.path.join(ca_path, 'adapter_util/ifaddrs.c')])
51 if env.get('SECURED') == '1':
52 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
53 'adapter_util/caadapternetdtls.c')])
54 env.AppendUnique(CPPPATH = [os.path.join(root_dir,
58 if ca_os == 'arduino':
59 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
60 env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
61 print "setting WITH_ARDUINO"
63 'caconnectivitymanager.c',
64 'cainterfacecontroller.c',
66 'canetworkconfigurator.c',
67 'caprotocolmessage.c',
72 'caconnectivitymanager.c',
73 'cainterfacecontroller.c',
75 'canetworkconfigurator.c',
76 'caprotocolmessage.c',
80 if not 'BLE' in ca_transport:
81 env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'cablockwisetransfer.c') ])
82 env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
84 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
86 env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'extlibs/tinydtls')])
88 env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
91 os.path.join(ca_path, d) for d in ca_common_src ]
93 env.AppendUnique(CA_SRC = ca_common_src)
95 if 'ALL' in ca_transport:
96 transports = [ 'ip_adapter', 'bt_edr_adapter', 'bt_le_adapter' ]
98 transports.append ('ra_adapter')
99 env.SConscript(dirs = [
100 os.path.join(ca_path, d) for d in transports ])
102 if 'IP' in ca_transport:
103 env.SConscript(os.path.join(ca_path, 'ip_adapter/SConscript'))
105 if 'BT' in ca_transport:
106 env.SConscript(os.path.join(ca_path, 'bt_edr_adapter/SConscript'))
108 if 'BLE' in ca_transport:
109 env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
111 print "Include path is %s" % env.get('CPPPATH')
112 print "Files path is %s" % env.get('CA_SRC')
113 if ca_os in ['android', 'tizen']:
114 calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
116 calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
117 env.InstallTarget(calib, 'libconnectivity_abstraction')
118 env.UserInstallTargetLib(calib, 'libconnectivity_abstraction')