1src = Split('''
2        port/sys_arch.c
3''')
4
5core_src = Split('''
6        core/init.c
7        core/def.c
8        core/dns.c
9        core/inet_chksum.c
10        core/ip.c
11        core/mem.c
12        core/memp.c
13        core/netif.c
14        core/pbuf.c
15        core/raw.c
16        core/stats.c
17        core/sys.c
18        core/tcp.c
19        core/tcp_in.c
20        core/tcp_out.c
21        core/timeouts.c
22        core/udp.c
23        core/af_packet.c
24''')
25
26core_tcp4_src = Split('''
27        core/ipv4/autoip.c
28        core/ipv4/dhcp.c
29        core/ipv4/etharp.c
30        core/ipv4/icmp.c
31        core/ipv4/igmp.c
32        core/ipv4/ip4_frag.c
33        core/ipv4/ip4.c
34        core/ipv4/ip4_addr.c
35''')
36
37core_tcp6_src = Split('''
38        core/ipv6/dhcp6.c
39        core/ipv6/ethip6.c
40        core/ipv6/icmp6.c
41        core/ipv6/inet6.c
42        core/ipv6/ip6.c
43        core/ipv6/ip6_addr.c
44        core/ipv6/ip6_frag.c
45        core/ipv6/mld6.c
46        core/ipv6/nd6.c
47''')
48
49api_src = Split('''
50        api/api_lib.c
51        api/api_msg.c
52        api/err.c
53        api/netbuf.c
54        api/netdb.c
55        api/netifapi.c
56        api/sockets.c
57        api/tcpip.c
58''')
59
60net_if_src = Split('''
61        netif/ethernet.c
62        netif/slipif.c
63''')
64
65tftp_src = Split('''
66        apps/tftp/tftp_server.c
67        apps/tftp/tftp_common.c
68        apps/tftp/tftp_client.c
69        apps/tftp/tftp_ota.c
70''')
71
72telnetd_src = Split('''
73        apps/telnetd/telnetserver.c
74        apps/telnetd/telnetserver_cli.c
75''')
76
77dhcpd_src = Split('''
78        apps/dhcpd/dhcps.c
79''')
80
81src.extend(core_src)
82src.extend(core_tcp4_src)
83src.extend(core_tcp6_src)
84src.extend(api_src)
85src.extend(net_if_src)
86src.extend(tftp_src)
87
88if aos_global_config.get('use_private_lwip') != 1:
89    if aos_global_config.get('use_private_telnetd') != 1:
90        component.add_global_macros('WITH_LWIP_TELNETD')
91        src.extend(telnetd_src)
92
93    if aos_global_config.get('use_private_dhcpd') != 1:
94        src.extend(dhcpd_src)
95
96    component = aos_component('lwip', src)
97    component.add_global_includes('include', 'port/include')
98    component.add_global_macros('CONFIG_NET_LWIP')
99
100else:
101    component = aos_component('lwip', [])
102
103if aos_global_config.get('no_with_lwip') != 1:
104    component.add_global_macros('WITH_LWIP')
105    aos_global_config.set('with_lwip','1')
106