48 opt.AddOptions( |
48 opt.AddOptions( |
49 BoolOption('simd', 'allow SSE intrinsics', True), |
49 BoolOption('simd', 'allow SSE intrinsics', True), |
50 ('precision', 'floating point number precision (single/double)', "single"), |
50 ('precision', 'floating point number precision (single/double)', "single"), |
51 ('flags', 'add additional compiler flags', ""), |
51 ('flags', 'add additional compiler flags', ""), |
52 BoolOption('force_flags', "use only flags specified by 'flags' option (do not autodetect arch/sse flags)", False), |
52 BoolOption('force_flags', "use only flags specified by 'flags' option (do not autodetect arch/sse flags)", False), |
|
53 ('ldflags', 'add additional linker flags', ""), |
53 BoolOption('profile', "enable gcc's profiling support (-pg)", False), |
54 BoolOption('profile', "enable gcc's profiling support (-pg)", False), |
54 ) |
55 ) |
55 if env['PLATFORM'] == 'win32': |
56 if env['PLATFORM'] == 'win32': |
56 opt.AddOptions( |
57 opt.AddOptions( |
57 BoolOption('mingw', 'use Mingw and GCC compiler, if available', False), |
58 BoolOption('mingw', 'use Mingw and GCC compiler, if available', False), |
206 print "Additional flags: " + add_flags |
207 print "Additional flags: " + add_flags |
207 |
208 |
208 if conf.env['profile'] and cc == 'gcc': |
209 if conf.env['profile'] and cc == 'gcc': |
209 conf.env.Append(CCFLAGS="-pg", LINKFLAGS="-pg") |
210 conf.env.Append(CCFLAGS="-pg", LINKFLAGS="-pg") |
210 |
211 |
|
212 if conf.env['ldflags']: |
|
213 conf.env.Append(LINKFLAGS=conf.env['ldflags']) |
|
214 |
211 |
215 |
212 # configure pthread |
216 # configure pthread |
213 pthread = True |
217 pthread = True |
214 if platform == 'win32': |
218 if platform == 'win32': |
215 if cc == 'msvc': |
219 if cc == 'msvc': |
289 sdlenv = conf.Finish() |
291 sdlenv = conf.Finish() |
290 |
292 |
291 |
293 |
292 ### build targets |
294 ### build targets |
293 |
295 |
294 Export('env pyenv sdlenv cc') |
296 Export('env pyenv sdlenv have_sdl cc') |
295 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0, |
297 lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0, |
296 exports={'buildmodule':False}) |
298 exports={'buildmodule':False}) |
297 pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0, |
299 pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0, |
298 exports={'buildmodule':True}) |
300 exports={'buildmodule':True}) |
299 |
301 |
300 if have_sdl: |
302 SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib') |
301 SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, |
|
302 exports='lib') |
|
303 |
|
304 SConscript('demos/SConscript', exports='pymodule') |
303 SConscript('demos/SConscript', exports='pymodule') |
305 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib') |
304 SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib') |
306 SConscript('models/SConscript') |
305 SConscript('models/SConscript') |
307 |
306 |
308 env.Alias('demos', ['cc-demos', 'python-demos']) |
307 env.Alias('demos', ['cc-demos', 'python-demos']) |