SConstruct: Added conditions to add compiler/linker flags from user's environemn

t if they have any set.
This commit is contained in:
xatmes 2007-05-22 01:20:06 +00:00
parent fd8471138f
commit 0cfd37f0c9
2 changed files with 27 additions and 1 deletions

View file

@ -1,5 +1,9 @@
D2X-Rebirth Changelog
20070522
--------
SConstruct: Added conditions to add compiler/linker flags from user's environemnt if they have any set.
20070521
--------
ui/window.c: use new 3 argument mouse_get_delta to avoid compiler errors

View file

@ -3,6 +3,7 @@
# needed imports
import sys
import os
import SCons.Util
PROGRAM_NAME = 'D2X-Rebirth'
@ -325,6 +326,18 @@ env.Append(CPPPATH = ['include', 'main', 'arch/include'])
generic_libs = ['SDL', 'physfs']
sdlmixerlib = ['SDL_mixer']
# Get traditional compiler environment variables
if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
# windows or *nix?
if sys.platform == 'win32':
print "compiling on Windows"
@ -493,6 +506,15 @@ Help(PROGRAM_NAME + ', SConstruct file help:' +
'gp2x=1' compile for GP2X handheld
Default values:
""" + ' sharepath = ' + DATA_DIR + '\n')
""" + ' sharepath = ' + DATA_DIR + """
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
<include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
""")
#EOF