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 not in ['darwin', 'ios', 'windows', 'winrt']:
31 env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
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 # The tinydtls library is found in '#extlibs/tinydtls', where the '#'
40 # is interpreted by SCons as the top-level iotivity directory where
41 # the SConscruct file is found.
42 if env.get('SECURED') == '1':
44 env.SConscript(os.path.join(root_dir, 'extlibs/tinydtls/SConscript'))
46 env.SConscript('#extlibs/tinydtls/SConscript')
48 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
49 'adapter_util/caadapterutils.c')])
50 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
51 'adapter_util/cafragmentation.c')])
52 if ca_os in ['android', 'tizen']:
53 env.AppendUnique(CA_SRC=[os.path.join(ca_path, 'adapter_util/ifaddrs.c')])
54 if env.get('SECURED') == '1':
55 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
56 'adapter_util/caadapternetdtls.c')])
57 env.AppendUnique(CPPPATH = [os.path.join(root_dir,
61 if ca_os == 'arduino':
62 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
63 env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
64 print "setting WITH_ARDUINO"
66 'caconnectivitymanager.c',
67 'cainterfacecontroller.c',
69 'canetworkconfigurator.c',
70 'caprotocolmessage.c',
75 'caconnectivitymanager.c',
76 'cainterfacecontroller.c',
78 'canetworkconfigurator.c',
79 'caprotocolmessage.c',
83 if not 'BLE' in ca_transport:
84 env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'cablockwisetransfer.c') ])
85 env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
87 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
89 env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'extlibs/tinydtls')])
91 env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
94 os.path.join(ca_path, d) for d in ca_common_src ]
96 env.AppendUnique(CA_SRC = ca_common_src)
98 if 'ALL' in ca_transport:
99 transports = [ 'ip_adapter', 'bt_edr_adapter', 'bt_le_adapter' ]
101 transports.append ('ra_adapter')
102 env.SConscript(dirs = [
103 os.path.join(ca_path, d) for d in transports ])
105 if 'IP' in ca_transport:
106 env.SConscript(os.path.join(ca_path, 'ip_adapter/SConscript'))
108 if 'BT' in ca_transport:
109 env.SConscript(os.path.join(ca_path, 'bt_edr_adapter/SConscript'))
111 if 'BLE' in ca_transport:
112 env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
114 print "Include path is %s" % env.get('CPPPATH')
115 print "Files path is %s" % env.get('CA_SRC')
116 if ca_os in ['android', 'tizen']:
117 calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
119 calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
120 env.InstallTarget(calib, 'libconnectivity_abstraction')
121 env.UserInstallTargetLib(calib, 'libconnectivity_abstraction')