9 ca_os = env.get('TARGET_OS')
10 ca_transport = env.get('TARGET_TRANSPORT')
11 secured = env.get('SECURED')
15 #####################################################################
16 # Source files and Target(s)
17 ######################################################################
19 print"Reading ca script %s"%ca_transport
21 env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ])
22 env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'),
23 os.path.join(root_dir, 'lib/libcoap-4.1.1'),
24 os.path.join(root_dir, 'common/inc') ])
26 if ca_os not in ['arduino', 'windows', 'winrt']:
27 env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
29 if ca_os in ['darwin','ios']:
30 env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
32 # Getting common source files
33 env.SConscript('./../common/SConscript')
35 # The tinydtls library is found in '#extlibs/tinydtls', where the '#'
36 # is interpreted by SCons as the top-level iotivity directory where
37 # the SConscruct file is found.
38 if env.get('SECURED') == '1':
39 env.SConscript('#extlibs/tinydtls/SConscript')
41 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
42 'adapter_util/caadapterutils.c')])
43 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
44 'adapter_util/cafragmentation.c')])
46 if env.get('SECURED') == '1':
47 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
48 'adapter_util/caadapternetdtls.c')])
49 env.AppendUnique(CPPPATH = [os.path.join(root_dir,
53 if ca_os == 'arduino':
54 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
55 env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
56 print "setting WITH_ARDUINO"
58 'caconnectivitymanager_singlethread.c',
59 'cainterfacecontroller_singlethread.c',
60 'camessagehandler_singlethread.c',
61 'canetworkconfigurator.c',
62 'caprotocolmessage.c',
64 'caretransmission_singlethread.c',
67 env.AppendUnique(CPPDEFINES = ['MULTI_THREAD'])
69 'caconnectivitymanager.c',
70 'cainterfacecontroller.c',
72 'canetworkconfigurator.c',
73 'caprotocolmessage.c',
79 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
80 env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
83 os.path.join(ca_path, d) for d in ca_common_src ]
85 env.AppendUnique(CA_SRC = ca_common_src)
87 if 'ALL' in ca_transport:
88 transports = [ 'ip_adapter', 'bt_edr_adapter', 'bt_le_adapter' ]
89 env.SConscript(dirs = [
90 os.path.join(ca_path, d) for d in transports ])
92 if 'IP' in ca_transport:
93 env.SConscript(os.path.join(ca_path, 'ip_adapter/SConscript'))
95 if 'BT' in ca_transport:
96 env.SConscript(os.path.join(ca_path, 'bt_edr_adapter/SConscript'))
98 if 'BLE' in ca_transport:
99 env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
101 print "Include path is %s" % env.get('CPPPATH')
102 print "Files path is %s" % env.get('CA_SRC')
103 if ca_os in ['android', 'tizen']:
104 calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
106 calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
107 env.InstallTarget(calib, 'libconnectivity_abstraction')