add ability to set the cc compiler and default it to gcc (solaris configure check fix), and touchups around CXXFLAGS
This commit is contained in:
parent
e22c187e95
commit
65ef9a3548
1 changed files with 9 additions and 7 deletions
16
SConstruct
16
SConstruct
|
@ -241,7 +241,8 @@ opts = Variables()
|
||||||
|
|
||||||
opts.AddVariables(
|
opts.AddVariables(
|
||||||
# Compiler options
|
# Compiler options
|
||||||
('CXX', 'The C++ compiler to use (defaults to g++).', 'g++'),
|
('CXX', 'The C++ compiler to use to compile mapnik (defaults to g++).', 'g++'),
|
||||||
|
('CC', 'The C compiler used for configure checks of C libs (defaults to gcc).', 'gcc'),
|
||||||
EnumVariable('OPTIMIZATION','Set g++ optimization level','2', ['0','1','2','3','4']),
|
EnumVariable('OPTIMIZATION','Set g++ optimization level','2', ['0','1','2','3','4']),
|
||||||
# Note: setting DEBUG=True will override any custom OPTIMIZATION level
|
# Note: setting DEBUG=True will override any custom OPTIMIZATION level
|
||||||
BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'),
|
BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'),
|
||||||
|
@ -251,6 +252,7 @@ opts.AddVariables(
|
||||||
# SCons build behavior options
|
# SCons build behavior options
|
||||||
('CONFIG', "The path to the python file in which to save user configuration options. Currently : '%s'" % SCONS_LOCAL_CONFIG,SCONS_LOCAL_CONFIG),
|
('CONFIG', "The path to the python file in which to save user configuration options. Currently : '%s'" % SCONS_LOCAL_CONFIG,SCONS_LOCAL_CONFIG),
|
||||||
BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
|
BoolVariable('USE_CONFIG', "Use SCons user '%s' file (will also write variables after successful configuration)", 'True'),
|
||||||
|
# http://www.scons.org/wiki/GoFastButton
|
||||||
BoolVariable('FAST', "Make scons faster at the cost of less precise dependency tracking", 'False'),
|
BoolVariable('FAST', "Make scons faster at the cost of less precise dependency tracking", 'False'),
|
||||||
BoolVariable('PRIORITIZE_LINKING', 'Sort list of lib and inc directories to ensure preferencial compiling and linking (useful when duplicate libs)', 'True'),
|
BoolVariable('PRIORITIZE_LINKING', 'Sort list of lib and inc directories to ensure preferencial compiling and linking (useful when duplicate libs)', 'True'),
|
||||||
('LINK_PRIORITY','Priority list in which to sort library and include paths (default order is internal, other, frameworks, user, then system - see source of `sort_paths` function for more detail)',','.join(DEFAULT_LINK_PRIORITY)),
|
('LINK_PRIORITY','Priority list in which to sort library and include paths (default order is internal, other, frameworks, user, then system - see source of `sort_paths` function for more detail)',','.join(DEFAULT_LINK_PRIORITY)),
|
||||||
|
@ -327,13 +329,13 @@ opts.AddVariables(
|
||||||
# these include all scons core variables as well as custom
|
# these include all scons core variables as well as custom
|
||||||
# env variables needed in Sconscript files
|
# env variables needed in Sconscript files
|
||||||
pickle_store = [# Scons internal variables
|
pickle_store = [# Scons internal variables
|
||||||
'CC',
|
'CC', # compiler user to check if c deps compile during configure
|
||||||
'CXX',
|
'CXX', # C++ compiler to compile mapnik
|
||||||
'CCFLAGS',
|
'CCFLAGS',
|
||||||
'CPPDEFINES',
|
'CPPDEFINES',
|
||||||
'CPPFLAGS',
|
'CPPFLAGS', # c preprocessor flags
|
||||||
'CPPPATH',
|
'CPPPATH',
|
||||||
'CXXFLAGS',
|
'CXXFLAGS', # C++ flags built up during configure
|
||||||
'LIBPATH',
|
'LIBPATH',
|
||||||
'LIBS',
|
'LIBS',
|
||||||
'LINKFLAGS',
|
'LINKFLAGS',
|
||||||
|
@ -796,7 +798,7 @@ if not preconfigured:
|
||||||
# before the `-o` flag).
|
# before the `-o` flag).
|
||||||
env['CXX'] = 'CC -library=stlport4'
|
env['CXX'] = 'CC -library=stlport4'
|
||||||
if env['THREADING'] == 'multi':
|
if env['THREADING'] == 'multi':
|
||||||
env['CXXFLAGS'] = ['-mt']
|
env.Append(CXXFLAGS = '-mt')
|
||||||
|
|
||||||
# Adding the required prerequisite library directories to the include path for
|
# Adding the required prerequisite library directories to the include path for
|
||||||
# compiling and the library path for linking, respectively.
|
# compiling and the library path for linking, respectively.
|
||||||
|
@ -1023,7 +1025,7 @@ if not preconfigured:
|
||||||
|
|
||||||
|
|
||||||
# Common C++ flags.
|
# Common C++ flags.
|
||||||
if env['THREADING'] == 'multi' :
|
if env['THREADING'] == 'multi':
|
||||||
common_cxx_flags = '-D%s -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE ' % env['PLATFORM'].upper()
|
common_cxx_flags = '-D%s -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE ' % env['PLATFORM'].upper()
|
||||||
else :
|
else :
|
||||||
common_cxx_flags = '-D%s ' % env['PLATFORM'].upper()
|
common_cxx_flags = '-D%s ' % env['PLATFORM'].upper()
|
||||||
|
|
Loading…
Reference in a new issue