SubDir TOP haiku-on-genode kits network libnetapi ;

UsePrivateHeaders app net shared storage support ;
UsePrivateHeaders locale shared ;

#UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_network ] : true ;
#UseHeaders [ FDirName $(HAIKU_TOP) src libs compat freebsd11_wlan ] : true ;
#UseHeaders [ FDirName $(HAIKU_TOP) headers os add-ons network_settings ]
#	: true ;

#SubDirC++Flags [ FDefines _BSD_SOURCE=1 ] ;
#
#local architectureObject ;
#for architectureObject in [ MultiArchSubDirSetup ] {
#	on $(architectureObject) {
#		local sslSources ;
#		local md5Sources ;
#
#		UsePrivateSystemHeaders ;
#
#		if [ FIsBuildFeatureEnabled openssl ] {
#			SubDirC++Flags -DOPENSSL_ENABLED ;
#			UseBuildFeatureHeaders openssl ;
#			sslSources = SSL.cpp ;
#			md5Sources = ;
#			Includes [ FGristFiles $(sslSources) SecureSocket.cpp
#					HttpAuthentication.cpp Certificate.cpp ]
#				: [ BuildFeatureAttribute openssl : headers ] ;
#				# Dependency needed to trigger downloading/unzipping the package
#				# before compiling the files.
#			SetupFeatureObjectsDir ssl ;
#		} else {
#			# As we don't have md5 from ssl, use our own
#			md5Sources = md5.c ;
#			SetupFeatureObjectsDir no-ssl ;
#		}
#
#		SharedLibrary [ MultiArchDefaultGristFiles libbnetapi.so ] :
#			init.cpp
#			DynamicBuffer.cpp
#			NetEndpoint.cpp
#			NetAddress.cpp
#			NetBuffer.cpp
#			NetDebug.cpp
#
#			$(sslSources)
#			Certificate.cpp
#
#			NetworkAddress.cpp
#			NetworkAddressResolver.cpp
#			NetworkCookie.cpp
#			NetworkCookieJar.cpp
#			NetworkDevice.cpp
#			NetworkInterface.cpp
#			NetworkRoster.cpp
#			NetworkRoute.cpp
#			NetworkSettings.cpp
#
#			AbstractSocket.cpp
#			DatagramSocket.cpp
#			ProxySecureSocket.cpp
#			SecureSocket.cpp
#			Socket.cpp
#			SocketMessenger.cpp
#
#			# TODO: another add-on for file:// (a much simpler one)
#			FileRequest.cpp
#
#			# TODO: another add-on for gopher://
#			GopherRequest.cpp
#
#			# TODO: The HTTP stuff should all go into an add-on. It needs
#			# linking against libcrypto.so and only the add-on should link
#			# against it.
#			DataRequest.cpp
#			HttpAuthentication.cpp
#			HttpHeaders.cpp
#			HttpForm.cpp
#			HttpRequest.cpp
#			HttpResult.cpp
#			HttpTime.cpp
#
#			notifications.cpp
#
#			$(md5Sources)
#
#			NetworkRequest.cpp
#			UrlContext.cpp
#			UrlProtocolAsynchronousListener.cpp
#			UrlProtocolDispatchingListener.cpp
#			UrlProtocolListener.cpp
#			UrlProtocolRoster.cpp
#			UrlRequest.cpp
#			UrlResult.cpp
#			UrlSynchronousRequest.cpp
#
#			:
#			be shared $(TARGET_NETWORK_LIBS) [ TargetLibstdc++ ]
#			[ TargetLibsupc++ ] [ BuildFeatureAttribute openssl : libraries ]
#			[ BuildFeatureAttribute icu : libraries ]
#			;
#	}
#}


if $(LayerLevel) >= 9  #8?
{
	HaikuKit network_kit.a :
		#xx move these down to "t8" level ?  Or move the rest to "t10" (except there is no such 'tenth' level...)
		# would require conditional compiling of HttpRequest.h though...
		DynamicBuffer.cpp
		NetEndpoint.cpp
		NetAddress.cpp
		NetBuffer.cpp
		
		NetworkAddress.cpp
		NetworkAddressResolver.cpp
		
		AbstractSocket.cpp
		SecureSocket.cpp
		Socket.cpp
		;
}


if $(LayerLevel) >= 9
{
	HaikuKit network_kit.a :
		# these are really "level 9+":
		
		Certificate.cpp
		
		NetworkCookie.cpp
		NetworkCookieJar.cpp
		
		ProxySecureSocket.cpp
		
		FileRequest.cpp
		GopherRequest.cpp
		
		DataRequest.cpp
		HttpAuthentication.cpp
		HttpHeaders.cpp
		HttpForm.cpp
		HttpRequest.cpp
		HttpResult.cpp
		HttpTime.cpp
		
		md5.c
		
		NetworkRequest.cpp
		UrlContext.cpp
		UrlProtocolListener.cpp
		UrlProtocolRoster.cpp
		UrlRequest.cpp
		UrlResult.cpp
		;
}

