Import(["env", "conf_env"]) if env.get("JRTPLIB_BUNDLED", False) : ################################################################################ # Common ################################################################################ cppdefines = ["RTP_SUPPORT_RTCPUNKNOWN", ("JRTPLIB_EXPORT", ""), ("JRTPLIB_IMPORTEXPORT", "JRTPLIB_EXPORT"), "RTP_SOCKLENTYPE_UINT", "RTP_SUPPORT_IPV4MULTICAST", "RTP_SUPPORT_SDESPRIV", "RTP_SUPPORT_PROBATION", "RTP_SUPPORT_GETLOGINR", "RTP_SUPPORT_IPV6", "RTP_SUPPORT_IPV6MULTICAST", "RTP_SUPPORT_IFADDRS", "RTP_SUPPORT_SENDAPP", ] if env["PLATFORM"] != "win32" : cppdefines += ["RTPCONFIG_UNIX_H", ] if env["PLATFORM"] != "win32" : cppflags = [("-include", "sys/types.h"), ("-include", "stdint.h")] ################################################################################ # Module flags ################################################################################ if env["SCONS_STAGE"] == "flags" : env["JRTPLIB_FLAGS"] = { "CPPPATH": [Dir("src/")], "LIBPATH": [Dir(".")], "LIBS": ["Swiften_JRTPLIB"], "INTERNAL_CPPDEFINES": ["STATICLIB"], "CPPDEFINES": cppdefines, "CPPFLAGS": cppflags, } #if env["PLATFORM"] == "win32" : # env["LIBIDN_FLAGS"]["CPPPATH"] += [Dir("stubs/win32")] # if env["MSVC_VERSION"][:3] == "9.0" : # env["LIBIDN_FLAGS"]["CPPPATH"] += [Dir("stubs/win32/VC2008")] ################################################################################ # 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.Append(CCFLAGS = ["-DNDEBUG", "-DSTATICLIB"]) #if myenv["PLATFORM"] != "win32": # myenv.Append(CCFLAGS = ["-DMINIUPNPC_SET_SOCKET_TIMEOUT"]) #if myenv["PLATFORM"] == "darwin": # myenv.Append(CCFLAGS = ["-DMACOSX", "-D_DARWIN_C_SOURCE"]) #if myenv["PLATFORM"] == "win32": # myenv.Append(CCFLAGS = ["-DWIN32"]) 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", ] #if myenv["PLATFORM"] == "win32": # src_files += ["src/libnatpmp/wingettimeofday.c"] myenv.StaticLibrary("Swiften_JRTPLIB", src_files)