xref: /haiku/src/kits/network/libnetapi/Jamfile (revision 6d2f2ec177bf615a117a7428d71be4330545b320)
1SubDir HAIKU_TOP src kits network libnetapi ;
2
3UsePrivateHeaders app net shared storage support ;
4UsePrivateHeaders locale shared ;
5
6UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_network compat ]
7	: true ;
8UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd_wlan ] : true ;
9UseHeaders [ FDirName $(HAIKU_TOP) headers os add-ons network_settings ]
10	: true ;
11
12SubDirC++Flags [ FDefines _BSD_SOURCE=1 ] ;
13
14local architectureObject ;
15for architectureObject in [ MultiArchSubDirSetup ] {
16	on $(architectureObject) {
17		local sslSources ;
18		local md5Sources ;
19
20		UsePrivateSystemHeaders ;
21
22		if [ FIsBuildFeatureEnabled openssl ] {
23			SubDirC++Flags -DOPENSSL_ENABLED ;
24			UseBuildFeatureHeaders openssl ;
25			sslSources = SSL.cpp ;
26			md5Sources = ;
27			Includes [ FGristFiles $(sslSources) SecureSocket.cpp
28					HttpAuthentication.cpp Certificate.cpp ]
29				: [ BuildFeatureAttribute openssl : headers ] ;
30				# Dependency needed to trigger downloading/unzipping the package
31				# before compiling the files.
32			SetupFeatureObjectsDir ssl ;
33		} else {
34			# As we don't have md5 from ssl, use our own
35			md5Sources = md5.c ;
36			SetupFeatureObjectsDir no-ssl ;
37		}
38
39		# BUrl uses ICU to perform IDNA conversions (unicode domain names)
40		UseBuildFeatureHeaders icu ;
41		Includes [ FGristFiles Url.cpp ]
42			: [ BuildFeatureAttribute icu : headers ] ;
43
44		SharedLibrary [ MultiArchDefaultGristFiles libbnetapi.so ] :
45			init.cpp
46			DynamicBuffer.cpp
47			NetEndpoint.cpp
48			NetAddress.cpp
49			NetBuffer.cpp
50			NetDebug.cpp
51
52			$(sslSources)
53			Certificate.cpp
54
55			NetworkAddress.cpp
56			NetworkAddressResolver.cpp
57			NetworkCookie.cpp
58			NetworkCookieJar.cpp
59			NetworkDevice.cpp
60			NetworkInterface.cpp
61			NetworkRoster.cpp
62			NetworkRoute.cpp
63			NetworkSettings.cpp
64
65			AbstractSocket.cpp
66			DatagramSocket.cpp
67			Socket.cpp
68			SecureSocket.cpp
69
70			# TODO: another add-on for file:// (a much simpler one)
71			FileRequest.cpp
72
73			# TODO: another add-on for gopher://
74			GopherRequest.cpp
75
76			# TODO: The HTTP stuff should all go into an add-on. It needs
77			# linking against libcrypto.so and only the add-on should link
78			# against it.
79			DataRequest.cpp
80			HttpAuthentication.cpp
81			HttpHeaders.cpp
82			HttpForm.cpp
83			HttpRequest.cpp
84			HttpResult.cpp
85			HttpTime.cpp
86
87			notifications.cpp
88
89			$(md5Sources)
90
91			NetworkRequest.cpp
92			Url.cpp
93			UrlContext.cpp
94			UrlProtocolAsynchronousListener.cpp
95			UrlProtocolDispatchingListener.cpp
96			UrlProtocolListener.cpp
97			UrlProtocolRoster.cpp
98			UrlRequest.cpp
99			UrlResult.cpp
100			UrlSynchronousRequest.cpp
101
102			:
103			be $(TARGET_NETWORK_LIBS) [ TargetLibstdc++ ] [ TargetLibsupc++ ]
104			[ BuildFeatureAttribute openssl : libraries ]
105			[ BuildFeatureAttribute icu : libraries ]
106			[ MultiArchDefaultGristFiles libshared.a ]
107			;
108	}
109}
110