mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-06-05 07:22:02 +08:00
waf: Move the generated content to libbsd_waf.py.
This commit is contained in:
parent
5529f7daf9
commit
051ef305f7
1395
libbsd_waf.py
Normal file
1395
libbsd_waf.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -154,8 +154,8 @@ class ModuleManager(builder.ModuleManager):
|
||||
except:
|
||||
out.write(self.script)
|
||||
out.close()
|
||||
wscript = builder.RTEMS_DIR + '/wscript'
|
||||
builder.processIfDifferent(out.name, wscript, "wscript")
|
||||
wscript = builder.RTEMS_DIR + '/libbsd_waf.py'
|
||||
builder.processIfDifferent(out.name, wscript, "libbsd_waf.py")
|
||||
finally:
|
||||
try:
|
||||
os.remove(out.name)
|
||||
@ -266,57 +266,21 @@ class ModuleManager(builder.ModuleManager):
|
||||
self.add('from __future__ import print_function')
|
||||
self.add('')
|
||||
self.add('import os.path')
|
||||
self.add('')
|
||||
self.add('rtems_version = "%s"' % (rtems_version))
|
||||
self.add('')
|
||||
self.add('try:')
|
||||
self.add(' import rtems_waf.rtems as rtems')
|
||||
self.add('except:')
|
||||
self.add(' print("error: no rtems_waf git submodule; see README.waf")')
|
||||
self.add(' import sys')
|
||||
self.add(' sys.exit(1)')
|
||||
self.add('import rtems_waf.rtems as rtems')
|
||||
self.add('')
|
||||
self.add('def init(ctx):')
|
||||
self.add(' rtems.init(ctx, version = rtems_version)')
|
||||
self.add(' pass')
|
||||
self.add('')
|
||||
self.add('def options(opt):')
|
||||
self.add(' rtems.options(opt)')
|
||||
self.add(' opt.add_option("--enable-auto-regen",')
|
||||
self.add(' action = "store_true",')
|
||||
self.add(' default = False,')
|
||||
self.add(' dest = "auto_regen",')
|
||||
self.add(' help = "Enable auto-regeneration of LEX, RPC and YACC files.")')
|
||||
self.add(' opt.add_option("--enable-warnings",')
|
||||
self.add(' action = "store_true",')
|
||||
self.add(' default = False,')
|
||||
self.add(' dest = "warnings",')
|
||||
self.add(' help = "Enable all warnings. The default is quiet builds.")')
|
||||
self.add(' opt.add_option("--net-test-config",')
|
||||
self.add(' default = "config.inc",')
|
||||
self.add(' dest = "net_config",')
|
||||
self.add(' help = "Network test configuration.")')
|
||||
self.add(' pass')
|
||||
self.add('')
|
||||
self.add('def bsp_configure(conf, arch_bsp):')
|
||||
self.add(' conf.check(header_name = "dlfcn.h", features = "c")')
|
||||
self.add(' conf.check(header_name = "rtems/pci.h", features = "c", mandatory = False)')
|
||||
self.add(' if not rtems.check_posix(conf):')
|
||||
self.add(' conf.fatal("RTEMS kernel POSIX support is disabled; configure RTEMS with --enable-posix")')
|
||||
self.add(' if rtems.check_networking(conf):')
|
||||
self.add(' conf.fatal("RTEMS kernel contains the old network support; configure RTEMS with --disable-networking")')
|
||||
self.add(' pass')
|
||||
self.add('')
|
||||
self.add('def configure(conf):')
|
||||
self.add(' if conf.options.auto_regen:')
|
||||
self.add(' conf.find_program("lex", mandatory = True)')
|
||||
self.add(' conf.find_program("rpcgen", mandatory = True)')
|
||||
self.add(' conf.find_program("yacc", mandatory = True)')
|
||||
self.add(' conf.env.AUTO_REGEN = conf.options.auto_regen')
|
||||
self.add(' conf.env.WARNINGS = conf.options.warnings')
|
||||
self.add(' conf.env.NET_CONFIG = conf.options.net_config')
|
||||
self.add(' rtems.configure(conf, bsp_configure)')
|
||||
self.add(' pass')
|
||||
self.add('')
|
||||
self.add('def build(bld):')
|
||||
self.add(' rtems.build(bld)')
|
||||
self.add('')
|
||||
self.add(' # C/C++ flags')
|
||||
self.add(' common_flags = []')
|
||||
for f in builder.common_flags():
|
||||
|
Loading…
x
Reference in New Issue
Block a user