Fix rtemsconfig building.

I'll probably move to a more pythonic way of doing conf.py since this is getting
too complicated.
This commit is contained in:
Amar Takhar 2016-01-17 22:28:28 -05:00 committed by Amar Takhar
parent 6c6246cace
commit 46498bd4e3
4 changed files with 31 additions and 8 deletions

View File

@ -22,8 +22,6 @@ Table of Contents
develenv/index.rst develenv/index.rst
filesystem/index.rst filesystem/index.rst
networking/index.rst networking/index.rst
new_chapters/index.rst
porting/index.rst porting/index.rst
posix1003_1/index.rst posix1003_1/index.rst
posix_users/index.rst posix_users/index.rst
relnotes/index.rst

View File

@ -4,7 +4,15 @@ path.append(abspath('../common/'))
from waf import cmd_configure, cmd_build from waf import cmd_configure, cmd_build
def options(ctx):
ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
def configure(ctx): def configure(ctx):
if not ctx.options.rtems_path_py:
ctx.fatal("--rtems-path-py is required")
ctx.env.RTEMS_PATH = ctx.options.rtems_path_py
cmd_configure(ctx) cmd_configure(ctx)
def build(ctx): def build(ctx):
@ -20,11 +28,9 @@ def build(ctx):
"develenv", "develenv",
"filesystem", "filesystem",
"networking", "networking",
"new_chapters",
"porting", "porting",
"posix1003_1", "posix1003_1",
"posix_users", "posix_users",
"relnotes"
] ]
p = ctx.path.parent.abspath() p = ctx.path.parent.abspath()
@ -34,6 +40,8 @@ def build(ctx):
for dir in dirs: for dir in dirs:
files = ctx.path.parent.find_node(dir).ant_glob("**/*.rst") files = ctx.path.parent.find_node(dir).ant_glob("**/*.rst")
files += ctx.path.parent.find_node(dir).ant_glob("**/*.jpg")
files += ctx.path.parent.find_node(dir).ant_glob("**/*.png")
files = [x for x in files if x.name.find("/build/") == -1] files = [x for x in files if x.name.find("/build/") == -1]
ctx.path.get_bld().make_node(dir).mkdir() # dirs ctx.path.get_bld().make_node(dir).mkdir() # dirs
@ -54,10 +62,11 @@ def build(ctx):
sub = { sub = {
"VERSION": "1.0", "VERSION": "1.0",
"RELEASE": "5.0.0", "RELEASE": "5.0.0",
"DOC": "Manual", "DOC": "Manual",
"FILE_DOC": "rtemsmanual", "FILE_DOC": "rtemsmanual",
"CONF_EXTRA": "sys.path.append('%s')" % ctx.env.RTEMS_PATH
} }
cmd_build(ctx, sub, source_dir="build") cmd_build(ctx, sub, source_dir="build")

View File

@ -2,6 +2,8 @@ import sys, os
sys.path.append(os.path.abspath('.')) sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('../../common/')) sys.path.append(os.path.abspath('../../common/'))
@CONF_EXTRA@
extensions = [ extensions = [
"sphinx.ext.autodoc", "sphinx.ext.autodoc",
"sphinx.ext.coverage", "sphinx.ext.coverage",

View File

@ -2,18 +2,32 @@ from sys import path
from os.path import abspath from os.path import abspath
path.append(abspath('../common/')) path.append(abspath('../common/'))
from waf import cmd_configure, cmd_build from waf import cmd_configure, cmd_build
def options(ctx):
ctx.add_option('--rtems-path-py', type='string', help="Path to py/ in RTEMS.")
def configure(ctx): def configure(ctx):
if not ctx.options.rtems_path_py:
ctx.fatal("--rtems-path-py is required")
ctx.env.RTEMS_PATH = ctx.options.rtems_path_py
cmd_configure(ctx) cmd_configure(ctx)
def build(ctx): def build(ctx):
# path.append(ctx.env.RTEMS_PATH)
sub = { sub = {
"VERSION": "1.0", "VERSION": "1.0",
"RELEASE": "5.0.0", "RELEASE": "5.0.0",
"DOC": "RTEMS Config", "DOC": "RTEMS Config",
"FILE_DOC": "rtemsconfig", "FILE_DOC": "rtemsconfig",
"CONF_EXTRA": "sys.path.append('%s')" % ctx.env.RTEMS_PATH
} }
cmd_build(ctx, sub) cmd_build(ctx, sub)