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':
40 env.SConscript(os.path.join(root_dir, 'extlibs/tinydtls/SConscript'))
42 env.SConscript('#extlibs/tinydtls/SConscript')
44 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
45 'adapter_util/caadapterutils.c')])
46 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
47 'adapter_util/cafragmentation.c')])
49 if env.get('SECURED') == '1':
50 env.AppendUnique(CA_SRC = [os.path.join(ca_path,
51 'adapter_util/caadapternetdtls.c')])
52 env.AppendUnique(CPPPATH = [os.path.join(root_dir,
56 if ca_os == 'arduino':
57 env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
58 env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
59 print "setting WITH_ARDUINO"
61 'caconnectivitymanager.c',
62 'cainterfacecontroller.c',
63 'camessagehandler_singlethread.c',
64 'canetworkconfigurator.c',
65 'caprotocolmessage.c',
70 'caconnectivitymanager.c',
71 'cainterfacecontroller.c',
73 'canetworkconfigurator.c',
74 'caprotocolmessage.c',
79 env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
81 env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'extlibs/tinydtls')])
83 env.AppendUnique(CPPPATH = ['#extlibs/tinydtls'])
86 os.path.join(ca_path, d) for d in ca_common_src ]
88 env.AppendUnique(CA_SRC = ca_common_src)
90 if 'ALL' in ca_transport:
91 transports = [ 'ip_adapter', 'bt_edr_adapter', 'bt_le_adapter' ]
92 env.SConscript(dirs = [
93 os.path.join(ca_path, d) for d in transports ])
95 if 'IP' in ca_transport:
96 env.SConscript(os.path.join(ca_path, 'ip_adapter/SConscript'))
98 if 'BT' in ca_transport:
99 env.SConscript(os.path.join(ca_path, 'bt_edr_adapter/SConscript'))
101 if 'BLE' in ca_transport:
102 env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
104 print "Include path is %s" % env.get('CPPPATH')
105 print "Files path is %s" % env.get('CA_SRC')
106 if ca_os in ['android', 'tizen']:
107 calib = env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
109 calib = env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
110 env.InstallTarget(calib, 'libconnectivity_abstraction')
111 env.UserInstallTargetLib(calib, 'libconnectivity_abstraction')