source: rtems-libbsd/wscript @ 32ceb14

5-freebsd-12freebsd-9.3
Last change on this file since 32ceb14 was 32ceb14, checked in by Chris Johns <chrisj@…>, on Jun 16, 2016 at 3:32:28 AM

Add support for long command lines and fix some shell rules on Windows.

  • Property mode set to 100644
File size: 3.8 KB
Line 
1#
2# RTEMS Project (https://www.rtems.org/)
3#
4# Copyright (c) 2015-2016 Chris Johns <chrisj@rtems.org>. All rights reserved.
5#
6#  Redistribution and use in source and binary forms, with or without
7#  modification, are permitted provided that the following conditions
8#  are met:
9#  1. Redistributions of source code must retain the above copyright
10#     notice, this list of conditions and the following disclaimer.
11#  2. Redistributions in binary form must reproduce the above copyright
12#     notice, this list of conditions and the following disclaimer in the
13#     documentation and/or other materials provided with the distribution.
14#
15#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19#  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22#  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23#  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27#
28# RTEMS LibBSD is a transparent source build of the FreeBSD kernel source for RTEMS.
29#
30# To use see README.waf shipped with this file.
31#
32
33from __future__ import print_function
34
35rtems_version = "4.12"
36
37try:
38    import rtems_waf.rtems as rtems
39except:
40    print("error: no rtems_waf git submodule; see README.waf")
41    import sys
42    sys.exit(1)
43
44import libbsd_waf
45
46def init(ctx):
47    rtems.init(ctx, version = rtems_version, long_commands = True)
48    libbsd_waf.init(ctx)
49
50def options(opt):
51    rtems.options(opt)
52    opt.add_option("--enable-auto-regen",
53                   action = "store_true",
54                   default = False,
55                   dest = "auto_regen",
56                   help = "Enable auto-regeneration of LEX, RPC and YACC files.")
57    opt.add_option("--enable-warnings",
58                   action = "store_true",
59                   default = False,
60                   dest = "warnings",
61                   help = "Enable all warnings. The default is quiet builds.")
62    opt.add_option("--net-test-config",
63                   default = "config.inc",
64                   dest = "net_config",
65                   help = "Network test configuration.")
66    opt.add_option("--freebsd-options",
67                   action = "store",
68                   default = "",
69                   dest = "freebsd_options",
70                   help = "Set FreeBSD options (developer option).")
71    libbsd_waf.options(opt)
72
73def bsp_configure(conf, arch_bsp):
74    conf.check(header_name = "dlfcn.h", features = "c")
75    conf.check(header_name = "rtems/pci.h", features = "c", mandatory = False)
76    if not rtems.check_posix(conf):
77        conf.fatal("RTEMS kernel POSIX support is disabled; configure RTEMS with --enable-posix")
78    if rtems.check_networking(conf):
79        conf.fatal("RTEMS kernel contains the old network support; configure RTEMS with --disable-networking")
80    libbsd_waf.bsp_configure(conf, arch_bsp)
81
82def configure(conf):
83    if conf.options.auto_regen:
84        conf.find_program("lex", mandatory = True)
85        conf.find_program("rpcgen", mandatory = True)
86        conf.find_program("yacc", mandatory = True)
87    conf.env.AUTO_REGEN = conf.options.auto_regen
88    conf.env.WARNINGS = conf.options.warnings
89    conf.env.NET_CONFIG = conf.options.net_config
90    conf.env.FREEBSD_OPTIONS =conf.options.freebsd_options
91    rtems.configure(conf, bsp_configure)
92    libbsd_waf.configure(conf)
93
94def build(bld):
95    rtems.build(bld)
96    libbsd_waf.build(bld)
Note: See TracBrowser for help on using the repository browser.