scons: force configure stage if the user supplies commandline arguments, and make sure not to save out custom variables for gdal and postgres if the config failed

This commit is contained in:
Dane Springmeyer 2009-03-09 04:45:09 +00:00
parent 9cf64111c2
commit fd50ef8400

View file

@ -214,23 +214,20 @@ if not force_configure:
for key, value in pickled_values.items(): for key, value in pickled_values.items():
env[key] = value env[key] = value
preconfigured = True preconfigured = True
if ('-h' not in command_line_args) and ('--help' not in command_line_args):
color_print(4,'Using previous successful configuration...')
color_print(4,'Re-configure by running "python scons/scons.py configure".')
except: except:
# unpickling failed, so reconfigure as fallback # unpickling failed, so reconfigure as fallback
preconfigured = False preconfigured = False
else: else:
preconfigured = False preconfigured = False
if opts.args:
if preconfigured: preconfigured = False
if opts.args: elif preconfigured:
color_print(1,'Arguments ignored, please run "configure" with arguments to customize build') if ('-h' not in command_line_args) and ('--help' not in command_line_args):
Exit(0) color_print(4,'Using previous successful configuration...')
else: color_print(4,'Re-configure by running "python scons/scons.py configure".')
# if we are not preconfigured update the environment based on commandline options
opts.Update(env) opts.Update(env)
Help(opts.GenerateHelpText(env)) Help(opts.GenerateHelpText(env))
@ -262,6 +259,7 @@ def parse_config(context, config, checks='--libs --cflags'):
else: else:
if config == 'GDAL_CONFIG': if config == 'GDAL_CONFIG':
env['SKIPPED_DEPS'].append(tool) env['SKIPPED_DEPS'].append(tool)
conf.rollback_option('GDAL_CONFIG')
else: else:
env['MISSING_DEPS'].append(tool) env['MISSING_DEPS'].append(tool)
context.Result( ret ) context.Result( ret )
@ -295,6 +293,7 @@ def parse_pg_config(context, config):
env.Append(LIBS = lpq) env.Append(LIBS = lpq)
else: else:
env['SKIPPED_DEPS'].append(tool) env['SKIPPED_DEPS'].append(tool)
conf.rollback_option(config)
context.Result( ret ) context.Result( ret )
return ret return ret
@ -307,6 +306,13 @@ def ogr_enabled(context):
context.Result( ret ) context.Result( ret )
return ret return ret
def rollback_option(context,variable):
global opts
env = context.env
for item in opts.options:
if item.key == variable:
env[variable] = item.default
def CheckBoost(context, version, silent=False): def CheckBoost(context, version, silent=False):
# Boost versions are in format major.minor.subminor # Boost versions are in format major.minor.subminor
v_arr = version.split(".") v_arr = version.split(".")
@ -385,8 +391,9 @@ conf_tests = { 'CheckPKGConfig' : CheckPKGConfig,
'GetMapnikLibVersion' : GetMapnikLibVersion, 'GetMapnikLibVersion' : GetMapnikLibVersion,
'parse_config' : parse_config, 'parse_config' : parse_config,
'parse_pg_config' : parse_pg_config, 'parse_pg_config' : parse_pg_config,
'ogr_enabled':ogr_enabled, 'ogr_enabled': ogr_enabled,
'get_pkg_lib':get_pkg_lib, 'get_pkg_lib': get_pkg_lib,
'rollback_option': rollback_option
} }