source: rtems-tools/linkers/wscript @ 5025439

4.104.115
Last change on this file since 5025439 was 5025439, checked in by Chris Johns <chrisj@…>, on 09/21/14 at 04:24:37

rtems-tld: Add config options, fix void args, and SCore traces.

  • Property mode set to 100644
File size: 4.0 KB
RevLine 
[ec24a37]1#
2# RTEMS Linker build script.
3#
4import sys
5
6version_major = 1
7version_minor = 0
8version_revision = 0
9
10def options(opt):
11    opt.load("g++")
12    opt.load("gcc")
13
14def configure(conf):
[993aa67]15    conf.load("g++")
16    conf.load("gcc")
[ec24a37]17
[ead8da1]18    conf.env.C_OPTS = conf.options.c_opts.split(',')
[ec24a37]19    conf.env.RTEMS_VERSION = conf.options.rtems_version
[87e0e76]20    conf.write_config_header('config.h')
[ec24a37]21
22def build(bld):
[be8e188]23    #
24    # Build the doxygen documentation.
25    #
26    if bld.cmd == 'doxy':
27        bld(features = 'doxygen',
[e78e2b0]28            doxyfile = 'rtl-host.conf')
[be8e188]29        return
30
[ec24a37]31    #
[87e0e76]32    # The local configuration.
[ec24a37]33    #
[87e0e76]34    conf = {}
[ec24a37]35
36    #
37    # Build flags.
38    #
[87e0e76]39    rtemstoolkit = '../rtemstoolkit'
40    conf['includes'] = [rtemstoolkit,
41                        rtemstoolkit + '/elftoolchain/libelf',
42                        rtemstoolkit + '/elftoolchain/common',
43                        rtemstoolkit + '/libiberty']
44    conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic']
45    conf['optflags'] = bld.env.C_OPTS
46    conf['cflags'] = ['-pipe', '-g'] + conf['optflags']
47    conf['cxxflags'] = ['-pipe', '-g'] + conf['optflags']
48    conf['linkflags'] = ['-g']
[ea29902]49
50    #
51    # The list of modules.
52    #
[435d879]53    modules = ['rld', 'elf', 'iberty']
[ea29902]54
[ec24a37]55    #
56    # Build the linker.
57    #
58    bld.program(target = 'rtems-ld',
[31bf375]59                source = ['rtems-ld.cpp'],
[53ed116]60                defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
[87e0e76]61                includes = ['.'] + conf['includes'],
62                cflags = conf['cflags'] + conf['warningflags'],
63                cxxflags = conf['cxxflags'] + conf['warningflags'],
64                linkflags = conf['linkflags'],
[53ed116]65                use = modules)
66
67    #
68    # Build the ra linker.
69    #
70    bld.program(target = 'rtems-ra',
[31bf375]71                source = ['rtems-ra.cpp'],
[ea29902]72                defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
[87e0e76]73                includes = ['.'] + conf['includes'],
74                cflags = conf['cflags'] + conf['warningflags'],
75                cxxflags = conf['cxxflags'] + conf['warningflags'],
76                linkflags = conf['linkflags'],
[ea29902]77                use = modules)
78
79    #
80    # Build the trace linker.
81    #
82    bld.program(target = 'rtems-tld',
83                source = ['rtems-tld.cpp'],
[977c3de]84                defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
[87e0e76]85                includes = ['.'] + conf['includes'],
86                cflags = conf['cflags'] + conf['warningflags'],
87                cxxflags = conf['cxxflags'] + conf['warningflags'],
88                linkflags = conf['linkflags'],
[977c3de]89                use = modules)
[6506aa1]90    bld.install_files('${PREFIX}/share/rtems/trace-linker',
[5025439]91                      ['rtems.ini',
92                       'rtems-api.ini',
93                       'rtems-score.ini',
94                       'rtems-score-object.ini',
95                       'rtems-score-thread.ini',
96                       'rtems-score-heap.ini',
97                       'rtems-score-coremutex.ini',
98                       'rtld-base.ini',
99                       'rtld-print.ini'])
[977c3de]100
101    #
102    # Build the symbols.
103    #
104    bld.program(target = 'rtems-syms',
[ea29902]105                source = ['rtems-syms.cpp'],
[ec24a37]106                defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
[87e0e76]107                includes = ['.'] + conf['includes'],
108                cflags = conf['cflags'] + conf['warningflags'],
109                cxxflags = conf['cxxflags'] + conf['warningflags'],
110                linkflags = conf['linkflags'],
[8bb0d53]111                use = modules)
112
113    #
114    # Build the RAP utility.
115    #
116    bld.program(target = 'rtems-rap',
[ea29902]117                source = ['rtems-rapper.cpp'],
[8bb0d53]118                defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
[87e0e76]119                includes = ['.'] + conf['includes'],
120                cflags = conf['cflags'] + conf['warningflags'],
121                cxxflags = conf['cxxflags'] + conf['warningflags'],
122                linkflags = conf['linkflags'],
[ec24a37]123                use = modules)
124
[1ec9633]125def tags(ctx):
126    ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True)
Note: See TracBrowser for help on using the repository browser.