summaryrefslogtreecommitdiffstats
blob: 8504e11a8aaef2d12c6693c438bae46b9480baa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Import(["env", "conf_env"])

if env.get("JRTPLIB_BUNDLED", False) :

################################################################################
# Module flags
################################################################################

	if env["SCONS_STAGE"] == "flags" :
		env["JRTPLIB_FLAGS"] = {
				"CPPPATH": [Dir("src/")],
				"LIBPATH": [Dir(".")],
				"LIBS": ["Swiften_JRTPLIB"],
				"INTERNAL_CPPDEFINES": ["STATICLIB"],
			}

################################################################################
# Build
################################################################################

	if env["SCONS_STAGE"] == "build" :
		myenv = env.Clone()
		myenv.Append(CPPPATH = ["src"])
		# Remove warn flags
		myenv.Replace(CXXFLAGS = [flag for flag in env["CCFLAGS"] if flag not in ["-W", "-Wall"]])

		myenv.WriteVal("src/rtpconfig.h", myenv.Value(
"""
#pragma once
#define JRTPLIB_IMPORT
#define JRTPLIB_EXPORT
#define JRTPLIB_IMPORTEXPORT JRTPLIB_EXPORT
#define RTP_SOCKLENTYPE_UINT
#define RTP_SUPPORT_IPV4MULTICAST
#define RTP_SUPPORT_SDESPRIV
#define RTP_SUPPORT_PROBATION
#define RTP_SUPPORT_GETLOGINR
#define RTP_SUPPORT_IPV6
#define RTP_SUPPORT_IPV6MULTICAST
#define RTP_SUPPORT_IFADDRS
#define RTP_SUPPORT_SENDAPP
#define RTP_SUPPORT_RTCPUNKNOWN
"""))

		myenv.WriteVal("src/rtptypes.h", myenv.Value(
"""
#pragma once
#include <stdint.h>
#include <sys/types.h>
"""))

		src_files = [
				"src/rtpsession.cpp",
				"src/rtpexternaltransmitter.cpp",
				"src/rtppacket.cpp",
				"src/rtpsourcedata.cpp",
				"src/rtpsessionparams.cpp",
				"src/rtpexternaltransmitter.cpp",
				"src/rtpipv4address.cpp",
				"src/rtcpapppacket.cpp",
				"src/rtcpbyepacket.cpp",
				"src/rtcpcompoundpacketbuilder.cpp",
				"src/rtcpcompoundpacket.cpp",
				"src/rtcppacketbuilder.cpp",
				"src/rtcppacket.cpp",
				"src/rtcprrpacket.cpp",
				"src/rtcpscheduler.cpp",
				"src/rtcpsdesinfo.cpp",
				"src/rtcpsdespacket.cpp",
				"src/rtcpsrpacket.cpp",
				"src/rtpbyteaddress.cpp",
				"src/rtpcollisionlist.cpp",
				"src/rtpdebug.cpp",
				"src/rtperrors.cpp",
				"src/rtpexternaltransmitter.cpp",
				"src/rtpinternalsourcedata.cpp",
				"src/rtpipv4address.cpp",
				"src/rtpipv6address.cpp",
				"src/rtplibraryversion.cpp",
				"src/rtppacketbuilder.cpp",
				"src/rtppacket.cpp",
				"src/rtppollthread.cpp",
				"src/rtprandom.cpp",
				"src/rtprandomrand48.cpp",
				"src/rtprandomrands.cpp",
				"src/rtprandomurandom.cpp",
				"src/rtpsession.cpp",
				"src/rtpsessionparams.cpp",
				"src/rtpsessionsources.cpp",
				"src/rtpsourcedata.cpp",
				"src/rtpsources.cpp",
				"src/rtptimeutilities.cpp",
				"src/rtpudpv4transmitter.cpp",
				"src/rtpudpv6transmitter.cpp",
			]	
		
		myenv.StaticLibrary("Swiften_JRTPLIB", src_files)