source: rtems-tools/tester/covoar/wscript @ d7979de

Last change on this file since d7979de was d7979de, checked in by Chris Johns <chrisj@…>, on May 27, 2019 at 12:08:27 AM

waf: Update the check_cc tests to a newer method supported by waf.

  • Fix a minor issue in covoar's use of 64bit calls.
  • Property mode set to 100644
File size: 5.3 KB
Line 
1#
2# RTEMS Tools Project (http://www.rtems.org/)
3# Copyright 2014 Chris Johns (chrisj@rtems.org)
4# All rights reserved.
5#
6# This file is part of the RTEMS Tools package in 'rtems-tools'.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions are met:
10#
11# 1. Redistributions of source code must retain the above copyright notice,
12# this list of conditions and the following disclaimer.
13#
14# 2. Redistributions in binary form must reproduce the above copyright notice,
15# this list of conditions and the following disclaimer in the documentation
16# and/or other materials provided with the distribution.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28# POSSIBILITY OF SUCH DAMAGE.
29#
30
31#
32# Build the covoar application.
33#
34# Taken from the waf C++ demo.
35#
36
37#
38# The following two variables are used by the target "waf dist".
39#
40VERSION='0.0.1'
41APPNAME='covoar'
42
43#
44# These variables are mandatory ('/' are converted automatically)
45#
46top = '.'
47out = 'build'
48
49def init(ctx):
50    pass
51
52def options(opt):
53    opt.load('compiler_cxx')
54
55def configure(conf):
56    conf.load('compiler_cxx')
57    conf.check_cc(fragment = '''
58                    #include <stdlib.h>
59                    int main() { FILE* f = fopen64("name", "r"); } ''',
60                  cflags = '-Wall', define_name = 'HAVE_OPEN64',
61                  msg = 'Checking for fopen64', mandatory = False)
62    conf.check_cc(fragment = '''
63                    #include <sys/stat.h>
64                    int main() { struct stat64 sb; int f = 3; int r = stat64(f, &sb); } ''',
65                  cflags = '-Wall', define_name = 'HAVE_STAT64',
66                  msg = 'Checking for stat64', mandatory = False)
67    conf.write_config_header('covoar-config.h')
68
69def build(bld):
70    rtemstoolkit = '../../rtemstoolkit'
71    rtl_includes = [rtemstoolkit,
72                    rtemstoolkit + '/elftoolchain/libelf',
73                    rtemstoolkit + '/elftoolchain/libdwarf',
74                    rtemstoolkit + '/elftoolchain/common',
75                    rtemstoolkit + '/libiberty']
76    if bld.env.DEST_OS == 'win32':
77        rtl_includes += [rtemstoolkit + '/win32']
78
79    #
80    # The list of modules.
81    #
82    modules = ['rld', 'dwarf', 'elf', 'iberty']
83
84    bld.stlib(target = 'ccovoar',
85              source = ['app_common.cc',
86                        'CoverageFactory.cc',
87                        'CoverageMap.cc',
88                        'CoverageMapBase.cc',
89                        'CoverageRanges.cc',
90                        'CoverageReaderBase.cc',
91                        'CoverageReaderQEMU.cc',
92                        'CoverageReaderRTEMS.cc',
93                        'CoverageReaderSkyeye.cc',
94                        'CoverageReaderTSIM.cc',
95                        'CoverageWriterBase.cc',
96                        'CoverageWriterRTEMS.cc',
97                        'CoverageWriterSkyeye.cc',
98                        'CoverageWriterTSIM.cc',
99                        'DesiredSymbols.cc',
100                        'ExecutableInfo.cc',
101                        'Explanations.cc',
102                        'GcovData.cc',
103                        'GcovFunctionData.cc',
104                        'ObjdumpProcessor.cc',
105                        'ReportsBase.cc',
106                        'ReportsText.cc',
107                        'ReportsHtml.cc',
108                        'SymbolTable.cc',
109                        'Target_arm.cc',
110                        'TargetBase.cc',
111                        'TargetFactory.cc',
112                        'Target_i386.cc',
113                        'Target_lm32.cc',
114                        'Target_m68k.cc',
115                        'Target_powerpc.cc',
116                        'Target_sparc.cc',
117                        'Target_riscv.cc'],
118              cflags = ['-O2', '-g', '-Wall'],
119              cxxflags = ['-std=c++11', '-O2', '-g', '-Wall'],
120              includes = ['.'] + rtl_includes)
121
122    bld.program(target = 'trace-converter',
123                source = ['TraceConverter.cc',
124                          'TraceList.cc',
125                          'TraceReaderBase.cc',
126                          'TraceReaderLogQEMU.cc',
127                          'TraceWriterBase.cc',
128                          'TraceWriterQEMU.cc'],
129                use = ['ccovoar'] + modules,
130                cflags = ['-O2', '-g'],
131                cxxflags = ['-std=c++11', '-O2', '-g'],
132                includes = ['.'] + rtl_includes)
133
134    bld.program(target = 'covoar',
135                source = ['covoar.cc'],
136                use = ['ccovoar'] + modules,
137                install_path = '${PREFIX}/share/rtems/tester/bin',
138                cflags = ['-O2', '-g'],
139                cxxflags = ['-std=c++11', '-O2', '-g'],
140                includes = ['.'] + rtl_includes)
Note: See TracBrowser for help on using the repository browser.