Changeset 7:2ba083653995
- Timestamp:
- 08/09/06 15:24:15 (2 years ago)
- Files:
-
- Env/BuildJob.py (modified) (5 diffs)
- SConscript (modified) (1 diff)
- SConstruct (modified) (2 diffs)
- eXosip/SConscript (modified) (1 diff)
- httptunnel/SConscript (modified) (1 diff)
- libosip2/SConscript (modified) (1 diff)
- libs/portaudio/SConscript (modified) (9 diffs)
- ortp/SConscript (modified) (3 diffs)
- phapi/SConscript (modified) (8 diffs)
- phapi/speex/SConscript (modified) (1 diff)
- phapi/speex/libspeex/SConscript (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Env/BuildJob.py
r6 r7 14 14 15 15 def prepare(self, env): 16 """ add to the given environement information needed to use this moduel""" 16 17 18 dict = env.Dictionary() 19 20 def evar(k): 21 if dict.has_key(k): 22 return dict[k] 23 24 return [] 25 26 print "Preparing for:", self.name 17 27 for m in self.depends: 18 28 m.prepare(env) 29 19 30 20 elp = sets.ImmutableSet(env['LIBPATH']) 21 einc = sets.ImmutableSet(env['INCLUDE']) 22 elibs = sets.ImmutableSet(env['LIBS']) 31 32 elp = sets.ImmutableSet(evar('LIBPATH')) 33 einc = sets.ImmutableSet(evar('CPPPATH')) 34 elibs = sets.ImmutableSet(evar('LIBS')) 23 35 24 36 newlp = self.libpathes - elp … … 27 39 28 40 if len(newlp): 29 env.Append(LIBPATH = newlp)41 env.Append(LIBPATH = list(newlp)) 30 42 if len(newinc): 31 env.Append( INCLUDE = newinc)43 env.Append(CPPPATH = list(newinc)) 32 44 if len(newlibs): 33 env.Append(LIBS = newlp)45 env.Append(LIBS = list(newlp)) 34 46 35 47 … … 70 82 71 83 72 self.buildpath += "/" + self.buildpath73 84 74 85 if self.debug: 75 86 self.buildpath += "/debug" 76 87 else: 77 self.buildpath += "/rel sease"88 self.buildpath += "/release" 78 89 79 90 … … 102 113 def Prepare(self, env, uses): 103 114 104 return 115 dict = env.Dictionary() 116 def showprep(msg): 117 l = [] 118 for k in ["CPPPATH", "LIBPATH", "LIBS"]: 119 v = "" 120 if dict.has_key(k): 121 v = dict[k] 122 l += [(k,v)] 123 print msg, l 124 125 showprep("Before preparing") 105 126 usedModules = [ self.modules[x] for x in uses ] 106 127 for m in usedModules: 107 128 m.prepare(env) 108 129 130 showprep("After preparing") 131 132 109 133 110 134 … … 156 180 try: 157 181 #SCons 0.96.91 support (pre-release for 0.97) 158 tmp = self['LDMODULEPREFIX']182 tmp = env['LDMODULEPREFIX'] 159 183 #Removes the library name prefix 160 self['LDMODULEPREFIX'] = ''161 lib = env.LoadableModule( pluginName, source, **kw)162 self['LDMODULEPREFIX'] = tmp184 env['LDMODULEPREFIX'] = '' 185 lib = env.LoadableModule(target, source, **kw) 186 env['LDMODULEPREFIX'] = tmp 163 187 except KeyError: 164 188 #SCons 0.96.1 support (stable version) 165 tmp = self['SHLIBPREFIX']189 tmp = env['SHLIBPREFIX'] 166 190 #Removes the library name prefix 167 self['SHLIBPREFIX'] = ''168 lib = env.SharedLibrary( pluginName, source, **kw)169 self['SHLIBPREFIX'] = tmp191 env['SHLIBPREFIX'] = '' 192 lib = env.SharedLibrary(target, source, **kw) 193 env['SHLIBPREFIX'] = tmp 170 194 171 195 return lib SConscript
r6 r7 55 55 56 56 57 projects = [ 57 projects = [ 58 'libs/portaudio', 58 59 'libs/curl', 59 60 'libs/util', 60 61 'httptunnel', 61 62 'libosip2', 63 'ortp', 62 64 'eXosip', 63 65 'phapi/stun', 64 66 'phapi/gsm', 65 67 'phapi/ilbc', 68 'phapi/speex', 69 'phapi' 66 70 ] 67 71 SConstruct
r6 r7 15 15 BoolOption('libsamplerate', "Enable usage of libsamplerate", False), 16 16 BoolOption('phapi_audio_arts', "Build PortAudio/arts support", False), 17 BoolOption('phapi_audio_esd', "Build PortAudio/esd support", False), 17 18 BoolOption('portaudio_oss', "Build PortAudio/OSS", False), 18 19 BoolOption('portaudio_dsound', "Build PortAudio/DirectSound support", False), … … 21 22 BoolOption('speexwb_replaces_g726wb', "if set replace negotiated G726wb payload by SPEEX WB", False), 22 23 BoolOption('ipp', "Enable usage of INTEL IPP Library", False), 24 BoolOption('amr', "Enable usage of AMR codec", False), 23 25 BoolOption('debug', "Enable debug build", True), 26 BoolOption('enable_phapi_embed', "Enable EMBEDDED version of PHAPI", False), 27 BoolOption('qos_debug', "Enable QoS debugging functionality", False), 28 BoolOption('enable_video', "Enable Video functionality", False), 29 BoolOption('enable_alsa', "Disable ALSA driver", False), 24 30 ('target_os', "Target platform", sys.platform), 25 ('VERONA_VERSION', "Software version", "0.0. 1")31 ('VERONA_VERSION', "Software version", "0.0.2") 26 32 ) 27 33 eXosip/SConscript
r6 r7 53 53 exosipobj = env.SharedObject( source=sources, CPPDEFINES = defines, CPPPATH = include_path) 54 54 exosiplib = env.StaticLibrary('eXosip', source = exosipobj) 55 BJ.DefModule('eXosip', includes = ["#eXosip/include"], libpath = ["#eXosip"], libs = ["eXosip"]) 56 55 57 Alias('eXosip', exosiplib) httptunnel/SConscript
r6 r7 20 20 21 21 22 BJ.Prepare(env, 'veronacurl')22 BJ.Prepare(env, ['veronacurl']) 23 23 httptunnel = env.StaticLibrary('httptunnel', sources, CPPDEFINES = defines, CPPPATH=["#libs/curl/include", "."]) 24 24 BJ.DefModule('httptunnel', includes = ['.'], libpath = ['.'], libs = ['httptunnel'], uses = ['veronacurl'], node = httptunnel) libosip2/SConscript
r6 r7 106 106 107 107 osip = env.StaticLibrary('osip', source = osipobj) 108 109 BJ.DefModule('osip', includes = ['#libosip2/include'], libpath = ["libosip2"], libs = ["osip"]) 108 110 Alias("osip", osip) libs/portaudio/SConscript
r0 r7 1 Import("BJ") 1 2 import sys 2 3 3 env = GlobalGetEnvironment()4 env = BJ.NewEnv() 4 5 5 6 lib_path = [ … … 110 111 } 111 112 112 if GlobalDebugMode():113 if env['debug']: 113 114 defines['DEBUG'] = 1 114 115 … … 116 117 headers = headers_common 117 118 118 if GlobalOSLinux() or GlobalOSBSD():119 if BJ.linuxTarget: 119 120 defines['PA_LITTLE_ENDIAN'] = 1 120 121 defines['HAVE_LIBPTHREAD'] = 1 … … 122 123 sources += sources_linux 123 124 headers += headers_linux 124 if GlobalGetConsoleArgument('portaudio-oss') == 0:125 if not env['portaudio_oss']: 125 126 defines['PA_USE_ALSA'] = 1 126 127 libs += ['libasound'] … … 131 132 sources += sources_oss 132 133 133 elif GlobalOSMacOSX():134 elif BJ.osxTarget: 134 135 defines['PA_BIG_ENDIAN'] = 1 135 136 defines['WORDS_BIGENDIAN'] = 1 … … 139 140 headers += headers_mac 140 141 141 elif GlobalOSWindows():142 elif BJ.win32Target: 142 143 defines['PA_LITTLE_ENDIAN'] = 1 143 144 defines['PA_NO_ASIO'] = 1 … … 146 147 headers += headers_win 147 148 148 if GlobalGetConsoleArgument('portaudio-dsound') == 1:149 if env['portaudio_dsound']: 149 150 sources += source_dsound 150 151 headers += headers_dsound … … 154 155 headers += headers_wmme 155 156 defines['PA_NO_DS'] = 1 156 if not GlobalCCGCC():157 if not BJ.gcc: 157 158 sources += source_msvc 158 159 … … 161 162 sys.exit() 162 163 163 env.GlobalAddLinkFlags(lib_flags) 164 env. GlobalAddLibPath(lib_path)165 env.GlobalUseLibraries(libs)166 env.GlobalAddDefines(defines) 167 env.GlobalAddIncludePath(include_path)168 env.GlobalStaticLibrary('portaudio', sources, headers) 164 165 env.Append(CPPPATH = include_path, LIBPATH = "lib", CPPDEFINES = defines) 166 pa = env.SharedLibrary('portaudio', sources) 167 BJ.DefModule('portaudio', includes = ["#libs/portaudio/pa_common"], libpath = ["#libs/portaudio"], libs = ["portaudio"]) 168 Alias('portaudio', pa) 169 169 170 170 171 #env.SConscript('tests/SConscript') ortp/SConscript
r0 r7 1 env = GlobalGetEnvironment() 1 Import('BJ') 2 3 env = BJ.NewEnv() 2 4 3 5 env['WIN32_INSERT_DEF'] = 1 … … 9 11 'RTP_MAX_SIZE' : 8192 10 12 } 13 11 14 headers = [] 12 15 sources = [ … … 31 34 32 35 33 if GlobalGetConsoleArgument('enable-http-tunnel'):36 if env['httptunnel']: 34 37 defines['USE_HTTP_TUNNEL'] = 1 35 38 36 if GlobalOSWindows():39 if BJ.win32Target: 37 40 defines['WIN32'] = 1 38 41 libs += ['ws2_32', 'winmm'] 39 42 40 if GlobalOSLinux() or GlobalOSMacOSX():41 env.ParseConfig('pkg-config --cflags --libsgthread-2.0')43 if BJ.linuxTarget or BJ.osxTarget: 44 env.ParseConfig('pkg-config --cflags gthread-2.0') 42 45 43 env.GlobalAddIncludePath(include_path) 44 env.GlobalAddDefines(defines) 45 env.GlobalUseLibraries(libs) 46 env.GlobalAddDoxyfile() 47 48 env.GlobalStaticLibrary('ortp', sources) 46 env.Append(CPPPATH = include_path, CPPDEFINES = defines) 47 ortpobj = env.SharedObject( source=sources ) 48 ortplib = env.StaticLibrary('ortp', source = ortpobj) 49 Alias('ortp', ortplib) 50 BJ.DefModule('ortp', includes = [ "#ortp/src" ], libpath = ["#ortp/src"], libs = ["ortp"]) phapi/SConscript
r6 r7 6 6 defines = { } 7 7 8 if env['speexwb_replaces_amrwb'] and env['speexwb_replaces_amrnb'] and env['speexwb_replaces_g726wb'] 8 env = BJ.NewEnv() 9 10 if env['speexwb_replaces_amrwb'] and env['speexwb_replaces_amrnb'] and env['speexwb_replaces_g726wb']: 9 11 print "******* Please Select ONLY ONE of: [ speexwb_replaces_amrwb speexwb_replaces_amrnb or speexwb_replaces_g726wb]" 10 12 Exit(1) 11 13 12 14 13 if env['speexwb_replaces_amrwb'] 15 if env['speexwb_replaces_amrwb']: 14 16 amr_defines['PH_SPEEXWB_REPLACES_AMRWB'] = 1 15 17 speex_defines['PH_SPEEXWB_REPLACES_AMRWB'] = 1 … … 46 48 47 49 48 sp pex_env.Append(CPPDEFINES = speex_defines, LIBS = speex_libs, CCFLAGS = BJ.phapi_optimization_flags)50 speex_env.Append(CPPDEFINES = speex_defines, LIBS = speex_libs, CCFLAGS = BJ.phapi_optimization_flags) 49 51 speex = BJ.Plugin(speex_env, 'phspeexplugin', ['phcodec-speex.c']) 50 52 … … 123 125 'BLOCKING_MODE' : 0, 124 126 'DO_ECHO_CAN' : 1, 125 'ENABLE_AMR_WB' : 1,126 'ENABLE_AMR' : 1,127 'ENABLE_AMR_WB' : 0, 128 'ENABLE_AMR' : 0, 127 129 'MY_DLLEXPORTS' : 1, 128 130 'USE_WAVEIN_CBK' : 1, … … 168 170 sources += ['phmedia-oss.c'] 169 171 170 if env['phapi_audio_arts' ):172 if env['phapi_audio_arts']: 171 173 defines['ENABLE_ARTS'] = 1 172 174 sources += ['phmedia-audio-arts.c'] … … 242 244 243 245 if BJ.linuxTarget: 244 if env[' disable-alsa']:246 if env['enable_alsa']: 245 247 defines['ENABLE_ALSA'] = 1 246 248 libs += ['asound'] … … 288 290 289 291 292 293 if BJ.linuxTarget or BJ.osxTarget: 294 env.ParseConfig('pkg-config --cflags --libs gthread-2.0') 295 290 296 env.Append(CPPPATH = include_path, CPPDEFINES = defines, LINKFLAGS = link_flags, LIBS = libs) 297 BJ.Prepare(env, ["ortp", "eXosip", "portaudio"]) 291 298 292 299 if shphapi: … … 299 306 #Depends(phapi, [amr, speex]) 300 307 Depends(phapi, [speex]) 308 Alias('phapi', phapi) 301 309 302 310 #pyphapi … … 323 331 324 332 325 if not BJ.win32Target and not BJ.osxTarget :333 if not BJ.win32Target and not BJ.osxTarget and "testec" in BUILD_TARGETS: 326 334 tenv = BJ.NewEnv() 327 tec = tenv.Program(target = 'testec', source = ['testec.c', 'spxec.c', 'spxecfft.c'], LIBS='m') 335 tecobjs = tenv.Object(['testec.c', 'spxec.c', 'spxecfft.c']) 336 tec = tenv.Program(target = 'testec', source = tecobjs, LIBS = ['m']) 328 337 Alias('testec', tec) 329 338 phapi/speex/SConscript
r6 r7 5 5 if BJ.osxTarget: 6 6 env.Autoconf('speex', ['libspeex/.libs/libspeex.la']) 7 BJ. Module('speex', includes = ['include'], libpath,'speex')7 BJ.DefModule('speex', ['include'], None, 'speex') 8 8 9 9 else: phapi/speex/libspeex/SConscript
r6 r7 43 43 includes = [] 44 44 libpath = [] 45 node = N ull45 node = None 46 46 # this is private WIN32 specific include 47 47 if BJ.win32Target: … … 57 57 58 58 59 BJ. Module("speex", includes, libpath, "speex")59 BJ.DefModule("speex", includes, libpath, "speex") 60 60
