waf: add option --no-autoconfig

That is useful for developers working on the build system, so that they can
test the build without having to wait for a reconfiguration.
This commit is contained in:
Gustavo Jose de Sousa 2016-07-28 18:46:42 -03:00 committed by Lucas De Marchi
parent b65f63ffc1
commit 5edb03d184

16
wscript
View File

@ -12,8 +12,6 @@ import boards
from waflib import Build, ConfigSet, Configure, Context, Utils from waflib import Build, ConfigSet, Configure, Context, Utils
Configure.autoconfig = 'clobber'
# TODO: implement a command 'waf help' that shows the basic tasks a # TODO: implement a command 'waf help' that shows the basic tasks a
# developer might want to do: e.g. how to configure a board, compile a # developer might want to do: e.g. how to configure a board, compile a
# vehicle, compile all the examples, add a new example. Should fit in # vehicle, compile all the examples, add a new example. Should fit in
@ -39,6 +37,8 @@ def init(ctx):
except: except:
return return
Configure.autoconfig = 'clobber' if env.AUTOCONFIG else False
if 'VARIANT' not in env: if 'VARIANT' not in env:
return return
@ -71,6 +71,15 @@ def options(opt):
default=False, default=False,
help='Configure as debug variant.') help='Configure as debug variant.')
g.add_option('--no-autoconfig',
dest='autoconfig',
action='store_false',
default=True,
help='''
Disable autoconfiguration feature. By default, the build system triggers a
reconfiguration whenever it thinks it's necessary - this option disables that.
''')
g.add_option('--no-submodule-update', g.add_option('--no-submodule-update',
dest='submodule_update', dest='submodule_update',
action='store_false', action='store_false',
@ -122,6 +131,7 @@ def _collect_autoconfig_files(cfg):
def configure(cfg): def configure(cfg):
cfg.env.BOARD = cfg.options.board cfg.env.BOARD = cfg.options.board
cfg.env.DEBUG = cfg.options.debug cfg.env.DEBUG = cfg.options.debug
cfg.env.AUTOCONFIG = cfg.options.autoconfig
cfg.env.VARIANT = cfg.env.BOARD cfg.env.VARIANT = cfg.env.BOARD
if cfg.env.DEBUG: if cfg.env.DEBUG:
@ -136,6 +146,8 @@ def configure(cfg):
# Allow to differentiate our build from the make build # Allow to differentiate our build from the make build
cfg.define('WAF_BUILD', 1) cfg.define('WAF_BUILD', 1)
cfg.msg('Autoconfiguration', 'enabled' if cfg.options.autoconfig else 'disabled')
if cfg.options.static: if cfg.options.static:
cfg.msg('Using static linking', 'yes', color='YELLOW') cfg.msg('Using static linking', 'yes', color='YELLOW')
cfg.env.STATIC_LINKING = True cfg.env.STATIC_LINKING = True