summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Nagy <tnagy2pow10@gmail.com>2015-03-03 13:17:22 +0100
committerThomas Nagy <tnagy2pow10@gmail.com>2015-03-03 13:17:22 +0100
commit5bbcd05dedaea9fdc8ad12183193927883276111 (patch)
treee8a7f59b6dee8ec0ed14162c67bd3a682c362adc
parentad6a3738cf7d360cf3d4ed8acc418319ddae6a5f (diff)
Run configure automatically when config.cfg is modified
-rw-r--r--wscript24
1 files changed, 18 insertions, 6 deletions
diff --git a/wscript b/wscript
index 4eaac72901..6a5670f88c 100644
--- a/wscript
+++ b/wscript
@@ -1,3 +1,6 @@
+#! /usr/bin/env python
+# encoding: ascii
+
# RTEMS version, this is the only editable portion of this file.
config = {}
config["rtems_version_major"] = 4
@@ -7,8 +10,7 @@ config["rtems_version_patch"] = 0
# --------- DO NOT EDIT BELOW THIS LINE -----------
from sys import argv
-#from waflib.Task import Task
-from waflib import Task
+from waflib import Task, Scripting, Configure, Utils
from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext, StepContext, ListContext
from waflib.Context import Context
from waflib.Tools import c_preproc
@@ -20,6 +22,7 @@ from os.path import exists
pprint.__doc__ = None # Make sure waf doesn't see this as a command.
+Configure.autoconfig = 'clobber' # Apply the original configure command-line arguments
Context.repeat_hack = False
top = '.'
@@ -128,6 +131,8 @@ for command, func, descr in commands:
__doc__ = descr
cmd = command
fun = func
+ if command in 'install uninstall build clean list step docs bsp info':
+ execute = Scripting.autoconfigure(Context.execute)
def buildlog(ctx):
@@ -144,16 +149,23 @@ checkconfig.__doc__ = None # Make sure waf doesn't see this as a command.
def configure(ctx):
from rtems_waf.configure import cmd_configure
+ node = ctx.path.find_node('config.cfg')
+ if not node:
+ ctx.fatal('Run "waf config" first, for example: waf config --bsp sparc/sis --path-tools ~/development/rtems/4.11/bin')
+ # hash the config.cfg file too so that changes in the configure() function will trigger
+ # a re-configuration with the original command-line
+ ctx.files.append(node.abspath())
+ ctx.hash = Utils.h_list((ctx.hash, node.read('rb')))
+ # using the standard ctx.recurse() would add the dependency automatically
+ node = ctx.path.find_node('rtems_waf/configure.py')
+ ctx.files.append(node.abspath())
+ ctx.hash = Utils.h_list((ctx.hash, node.read('rb')))
cmd_configure(ctx, config)
-
def build(ctx):
if ctx.env.ENABLE_SYSTEM_DEP:
c_preproc.go_absolute=True
- if ctx.env.CONFIG_TIMESTAMP != get_file_mtime("config.cfg"):
- ctx.fatal("config.cfg has changed please re-run 'waf configure'")
-
ctx.load('waf', tooldir='rtems_waf')
from rtems_waf.waf import rtems_stlib_command