From efc4f099b459833cc424f133716824bc0efc060e Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Wed, 9 Dec 2015 20:08:19 +1100 Subject: Add release versioning support. Support a top level VERSION file that defines an RTEMS release. Fix the install of the python modules including thertems-test. Update the git python module to the RSB version. Fix the options to not call clean and to call dirty. Update the version python module. Fix the rtld C++ support to the VERSION file and the top level waf script. --- wscript | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 674b640..654845d 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,6 @@ # # RTEMS Tools Project (http://www.rtems.org/) -# Copyright 2014, 2015 Chris Johns (chrisj@rtems.org) +# Copyright 2014-2015 Chris Johns (chrisj@rtems.org) # All rights reserved. # # This file is part of the RTEMS Tools package in 'rtems-tools'. @@ -28,20 +28,33 @@ # POSSIBILITY OF SUCH DAMAGE. # +import os.path + subdirs = ['rtemstoolkit', 'linkers', 'tester', 'tools/gdb/python'] +def get_version(ctx): + release = '4.12.not_released' + if os.path.exists('VERSION'): + try: + with open('VERSION') as v: + release = v.readline().strip() + v.close() + except: + ctx.fatal('cannot access the VERSION file') + last_dot = release.rfind('.') + if last_dot == -1: + ctx.fatal('invalid VERSION file') + revision = release[0:last_dot] + return revision, release + def recurse(ctx): for sd in subdirs: ctx.recurse(sd) def options(ctx): - ctx.add_option('--rtems-version', - default = '4.11', - dest='rtems_version', - help = 'Set the RTEMS version') ctx.add_option('--c-opts', default = '-O2', dest='c_opts', @@ -69,12 +82,14 @@ def configure(ctx): ctx.load("doxygen", tooldir = 'waf-tools') except: pass + ctx.env.RTEMS_VERSION, ctx.env.RTEMS_RELEASE = get_version(ctx) ctx.env.C_OPTS = ctx.options.c_opts.split(',') - ctx.env.RTEMS_VERSION = ctx.options.rtems_version check_options(ctx, ctx.options.host) recurse(ctx) def build(ctx): + if os.path.exists('VERSION'): + ctx.install_files('${PREFIX}/share/rtems/rtemstoolkit', ['VERSION']) recurse(ctx) def install(ctx): -- cgit v1.2.3