SConscript 890 字节
Newer Older
1 2 3 4 5 6 7
# RT-Thread building script for component

from building import *

cwd = GetCurrentDir()

src = Glob('src/*.c')
8
src += Glob('socket/net_netdb.c')
9 10 11 12 13 14 15 16 17

CPPPATH = [cwd + '/include']
CPPPATH += [cwd + '/include/socket']

if GetDepend('SAL_USING_LWIP'):
    src += Glob('impl/af_inet_lwip.c')

if GetDepend('SAL_USING_AT'):
    src += Glob('impl/af_inet_at.c')
18 19 20
    
if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'):
    CPPPATH += [cwd + '/impl']
21 22

if GetDepend('SAL_USING_POSIX'):
23 24
    CPPPATH += [cwd + '/include/dfs_net']
    src += Glob('socket/net_sockets.c')
25 26 27 28 29
    src += Glob('dfs_net/*.c')
    
    if not GetDepend('HAVE_SYS_SELECT_H'):
        CPPPATH += [cwd + '/include/dfs_net/sys_select']

30 31
if not GetDepend('HAVE_SYS_SOCKET_H'):
    CPPPATH += [cwd + '/include/socket/sys_socket']
32 33 34 35

group = DefineGroup('SAL', src, depend = ['RT_USING_SAL'], CPPPATH = CPPPATH)

Return('group')