1# RT-Thread building script for component
2
3from building import *
4
5cwd = GetCurrentDir()
6
7src = Glob('src/*.c')
8src += ['socket/net_netdb.c']
9
10CPPPATH = [cwd + '/include']
11CPPPATH += [cwd + '/include/socket']
12
13if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'):
14    CPPPATH += [cwd + '/impl']
15
16if GetDepend('SAL_USING_LWIP'):
17    src += ['impl/af_inet_lwip.c']
18
19if GetDepend('SAL_USING_AT'):
20    src += ['impl/af_inet_at.c']
21
22if GetDepend('SAL_USING_TLS'):
23    src += ['impl/proto_mbedtls.c']
24
25if GetDepend('SAL_USING_POSIX'):
26    CPPPATH += [cwd + '/include/dfs_net']
27    src += ['socket/net_sockets.c']
28    src += Glob('dfs_net/*.c')
29
30if not GetDepend('HAVE_SYS_SOCKET_H'):
31    CPPPATH += [cwd + '/include/socket/sys_socket']
32
33group = DefineGroup('SAL', src, depend = ['RT_USING_SAL'], CPPPATH = CPPPATH)
34
35Return('group')
36