added support for inheriting CCFLAGS and LINKFLAGS from system
environment
This commit is contained in:
parent
9c6cbb0563
commit
0474a05ac3
10
SConstruct
10
SConstruct
|
@ -3,11 +3,17 @@ opts = Options()
|
|||
opts.Add('PSS_STYLE', 'Path separator style', 1)
|
||||
opts.Add('LSB_FIRST', 'Least significant byte first?', 1)
|
||||
|
||||
#Import('env')
|
||||
env = Environment(options = opts,
|
||||
CPPDEFINES={'PSS_STYLE' : '${PSS_STYLE}',
|
||||
'LSB_FIRST' : '${LSB_FIRST}'})
|
||||
|
||||
#bring in environment CCFLAGS and LINKFLAGS
|
||||
import os
|
||||
if os.environ.has_key('CCFLAGS'):
|
||||
env['CCFLAGS'] = os.environ['CCFLAGS'];
|
||||
if os.environ.has_key('LINKFLAGS'):
|
||||
env['LINKFLAGS'] = os.environ['LINKFLAGS'];
|
||||
|
||||
print "platform: ", env['PLATFORM']
|
||||
|
||||
#special flags for cygwin
|
||||
|
@ -25,7 +31,7 @@ if not conf.CheckLib('z'):
|
|||
print 'Did not find libz.a or z.lib, exiting!'
|
||||
Exit(1)
|
||||
if conf.CheckFunc('asprintf'):
|
||||
conf.env['CCFLAGS'].append("-DHAVE_ASPRINTF");
|
||||
conf.env['CCFLAGS'] += " -DHAVE_ASPRINTF";
|
||||
|
||||
|
||||
env = conf.Finish()
|
||||
|
|
|
@ -62,7 +62,7 @@ for flag in sdl_libflags.split(' '):
|
|||
sdl_libs.append(flag.strip("-l"));
|
||||
else:
|
||||
print "extra link flag: ", flag;
|
||||
env['LINKFLAGS'] += flag;
|
||||
env['LINKFLAGS'] += " " + flag;
|
||||
|
||||
sdl_libflags_pipe.close();
|
||||
|
||||
|
@ -71,7 +71,7 @@ env['LIBS'].append('z');
|
|||
env['LIBS'].extend(sdl_libs);
|
||||
|
||||
# include sdl cflags
|
||||
env['CCFLAGS'] += sdl_cflags;
|
||||
env['CCFLAGS'] += " " + sdl_cflags;
|
||||
|
||||
print env['LINKFLAGS']
|
||||
|
||||
|
|
Loading…
Reference in New Issue