author | Nicola Baldo <nbaldo@cttc.es> |
Wed, 18 Jan 2012 18:13:25 +0100 | |
changeset 8569 | 2cc1c7afb3c0 |
parent 8505 | 479f4d2d133d |
parent 7688 | 6f5c9b870e45 |
child 8702 | d3e7f0d5e378 |
permissions | -rw-r--r-- |
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
1 |
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
2 |
|
761
0ffbc9fa8ef0
Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
693
diff
changeset
|
3 |
import os, os.path |
7291
d39c09dbc3d9
Make emu and template modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7237
diff
changeset
|
4 |
import sys |
693
c8fc89076aa2
WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
672
diff
changeset
|
5 |
import shutil |
1217
2f7791ae388d
WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1214
diff
changeset
|
6 |
import types |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
7 |
import warnings |
693
c8fc89076aa2
WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
672
diff
changeset
|
8 |
|
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
9 |
from waflib.Errors import WafError |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
10 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
11 |
import TaskGen |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
12 |
import Task |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
13 |
import Options |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
14 |
import Build |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4164
diff
changeset
|
15 |
import Utils |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
16 |
|
7319
175c382cfab0
Bug 1175 - the shared libraries is not versioned, based on patch by YunQiang Su
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7303
diff
changeset
|
17 |
import wutils |
175c382cfab0
Bug 1175 - the shared libraries is not versioned, based on patch by YunQiang Su
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7303
diff
changeset
|
18 |
|
6168
c737d0a0e9a0
Bug 860: waf dies while executing ns3header task in case of parallel jobs.
Andrey Mazo <mazo@iitp.ru>
parents:
6127
diff
changeset
|
19 |
try: |
c737d0a0e9a0
Bug 860: waf dies while executing ns3header task in case of parallel jobs.
Andrey Mazo <mazo@iitp.ru>
parents:
6127
diff
changeset
|
20 |
set |
c737d0a0e9a0
Bug 860: waf dies while executing ns3header task in case of parallel jobs.
Andrey Mazo <mazo@iitp.ru>
parents:
6127
diff
changeset
|
21 |
except NameError: |
c737d0a0e9a0
Bug 860: waf dies while executing ns3header task in case of parallel jobs.
Andrey Mazo <mazo@iitp.ru>
parents:
6127
diff
changeset
|
22 |
from sets import Set as set # Python 2.3 fallback |
c737d0a0e9a0
Bug 860: waf dies while executing ns3header task in case of parallel jobs.
Andrey Mazo <mazo@iitp.ru>
parents:
6127
diff
changeset
|
23 |
|
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
24 |
|
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
25 |
all_modules = [] |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
26 |
for dirname in os.listdir('src'): |
7675 | 27 |
if dirname.startswith('.') or dirname == 'CVS': |
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
28 |
continue |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
29 |
path = os.path.join('src', dirname) |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
30 |
if not os.path.isdir(path): |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
31 |
continue |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
32 |
if os.path.exists(os.path.join(path, 'wscript')): |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
33 |
all_modules.append(dirname) |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
34 |
all_modules.sort() |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
35 |
|
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
36 |
|
600
fd944dbf33c6
WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
537
diff
changeset
|
37 |
|
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
38 |
def options(opt): |
955
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
39 |
opt.add_option('--enable-rpath', |
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
40 |
help=("Link programs with rpath" |
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
41 |
" (normally not needed, see " |
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
42 |
" --run and --shell; moreover, only works in some" |
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
43 |
" specific platforms, such as Linux and Solaris)"), |
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
44 |
action="store_true", dest='enable_rpath', default=False) |
4164
1f6ae48061a9
checkpoint tap bridge
Craig Dowell <craigdo@ee.washington.edu>
parents:
4163
diff
changeset
|
45 |
|
1858
68e1964c19e8
WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1747
diff
changeset
|
46 |
opt.add_option('--enable-modules', |
68e1964c19e8
WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1747
diff
changeset
|
47 |
help=("Build only these modules (and dependencies)"), |
68e1964c19e8
WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1747
diff
changeset
|
48 |
dest='enable_modules') |
68e1964c19e8
WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1747
diff
changeset
|
49 |
|
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
50 |
for module in all_modules: |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
51 |
opt.sub_options(module, mandatory=False) |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
52 |
|
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
53 |
|
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
54 |
def configure(conf): |
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
55 |
for module in all_modules: |
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
56 |
conf.sub_config(module, mandatory=False) |
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
57 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
58 |
blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant)) |
3498
ce35418645e9
bug 266: src/wscript unconditionally sets conf.env['NS3_MODULE_PATH']
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3439
diff
changeset
|
59 |
conf.env.append_value('NS3_MODULE_PATH', blddir) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
60 |
if Options.options.enable_rpath: |
1306
8834e434187f
Build the ns3 library in the build/<variant> root, not in build/<variant>/src.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1272
diff
changeset
|
61 |
conf.env.append_value('RPATH', '-Wl,-rpath=%s' % (os.path.join(blddir),)) |
761
0ffbc9fa8ef0
Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
693
diff
changeset
|
62 |
|
5361
e8989b44bffb
Doxygen and wscript messages point to test.py
Craig Dowell <craigdo@ee.washington.edu>
parents:
5270
diff
changeset
|
63 |
## Used to link the 'test-runner' program with all of ns-3 code |
928
218063b19458
WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
770
diff
changeset
|
64 |
conf.env['NS3_MODULES'] = ['ns3-' + module.split('/')[-1] for module in all_modules] |
218063b19458
WAF: derive the variable NS3_MODULES from the 'all_modules' list in src/wscript, instead of requiring every module to define a configure function to register themselves. This way module registration is done in one place only: src/wscript. Requires module naming conventions, though.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
770
diff
changeset
|
65 |
|
1858
68e1964c19e8
WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1747
diff
changeset
|
66 |
|
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
67 |
|
7492
5299fc683dfa
Clean some dead waf code
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7490
diff
changeset
|
68 |
# we need the 'ns3module' waf "feature" to be created because code |
5299fc683dfa
Clean some dead waf code
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7490
diff
changeset
|
69 |
# elsewhere looks for it to find the ns3 module objects. |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
70 |
@TaskGen.feature('ns3module') |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
71 |
def _add_test_code(module): |
7492
5299fc683dfa
Clean some dead waf code
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7490
diff
changeset
|
72 |
pass |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
73 |
|
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
74 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
75 |
def create_ns3_module(bld, name, dependencies=(), test=False): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
76 |
static = bool(bld.env.ENABLE_STATIC_NS3) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
77 |
# Create a separate library for this module. |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
78 |
if static: |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
79 |
module = bld.new_task_gen(features=['cxx', 'cxxstlib', 'ns3module']) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
80 |
else: |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
81 |
module = bld.new_task_gen(features=['cxx', 'cxxshlib', 'ns3module']) |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
82 |
module.target = '%s/ns%s-%s-%s' % (bld.srcnode.relpath_gen(module.path), wutils.VERSION, |
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
83 |
name, bld.env['BUILD_PROFILE']) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
84 |
linkflags = [] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
85 |
cxxflags = [] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
86 |
ccflags = [] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
87 |
if not static: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
88 |
cxxflags = module.env['shlib_CXXFLAGS'] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
89 |
ccflags = module.env['shlib_CXXFLAGS'] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
90 |
# Turn on the link flags for shared libraries if we have the |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
91 |
# proper compiler and platform. |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
92 |
if module.env['CXX_NAME'] in ['gcc', 'icc'] and module.env['WL_SONAME_SUPPORTED']: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
93 |
# Get the module library name without any relative paths |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
94 |
# at its beginning because all of the libraries will end |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
95 |
# up in the same directory. |
7489
994360413f55
waf 1.6: bring back -Wl,--soname, fix waf warnings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7488
diff
changeset
|
96 |
module_library_name = module.env.cshlib_PATTERN % (os.path.basename(module.target),) |
994360413f55
waf 1.6: bring back -Wl,--soname, fix waf warnings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7488
diff
changeset
|
97 |
linkflags = '-Wl,--soname=' + module_library_name |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
98 |
cxxdefines = ["NS3_MODULE_COMPILATION"] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
99 |
ccdefines = ["NS3_MODULE_COMPILATION"] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
100 |
|
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
101 |
module.env.append_value('CXXFLAGS', cxxflags) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
102 |
module.env.append_value('CCFLAGS', ccflags) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
103 |
module.env.append_value('LINKFLAGS', linkflags) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
104 |
module.env.append_value('CXXDEFINES', cxxdefines) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
105 |
module.env.append_value('CCDEFINES', ccdefines) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
106 |
|
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
107 |
module.is_static = static |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
108 |
module.vnum = wutils.VNUM |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
109 |
# Add the proper path to the module's name. |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
110 |
# Set the libraries this module depends on. |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
111 |
module.module_deps = list(dependencies) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
112 |
|
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
113 |
module.install_path = "${LIBDIR}" |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
114 |
|
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
115 |
module.name = "ns3-" + name |
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
116 |
module.dependencies = dependencies |
7023
af9c5ac72f2c
Make examples and tests be enabled from the .ns3rc file
Mitch Watrous <watrous@u.washington.edu>
parents:
7021
diff
changeset
|
117 |
# Initially create an empty value for this because the pcfile |
af9c5ac72f2c
Make examples and tests be enabled from the .ns3rc file
Mitch Watrous <watrous@u.washington.edu>
parents:
7021
diff
changeset
|
118 |
# writing task assumes every module has a uselib attribute. |
af9c5ac72f2c
Make examples and tests be enabled from the .ns3rc file
Mitch Watrous <watrous@u.washington.edu>
parents:
7021
diff
changeset
|
119 |
module.uselib = '' |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
120 |
module.use = ['ns3-' + dep for dep in dependencies] |
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
121 |
module.test = test |
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
122 |
module.is_ns3_module = True |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7354
diff
changeset
|
123 |
module.ns3_dir_location = bld.path.relpath_gen(bld.srcnode) |
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
124 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
125 |
module.env.append_value("INCLUDES", '#') |
7511
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
126 |
|
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
127 |
module.pcfilegen = bld(features='ns3pcfile') |
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
128 |
module.pcfilegen.module = module |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
129 |
|
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
130 |
return module |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
131 |
|
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
132 |
@TaskGen.feature("ns3testlib") |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
133 |
@TaskGen.before_method("apply_incpaths") |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
134 |
def apply_incpaths_ns3testlib(self): |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
135 |
if not self.source: |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
136 |
return |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
137 |
testdir = self.source[-1].parent.relpath_gen(self.bld.srcnode) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
138 |
self.env.append_value("DEFINES", 'NS_TEST_SOURCEDIR="%s"' % (testdir,)) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
139 |
|
7331
827246e3bc4c
Bug 1174 - Ns-3 does not generate static libraries
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7320
diff
changeset
|
140 |
|
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
141 |
def create_ns3_module_test_library(bld, name): |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
142 |
# Create an ns3 module for the test library that depends only on |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
143 |
# the module being tested. |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
144 |
library_name = name + "-test" |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
145 |
library = bld.create_ns3_module(library_name, [name], test=True) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
146 |
library.features.append("ns3testlib") |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
147 |
|
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
148 |
# Modify attributes for the test library that are different from a |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
149 |
# normal module. |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
150 |
del library.is_ns3_module |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
151 |
library.is_ns3_module_test_library = True |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
152 |
library.module_name = 'ns3-' + name |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
153 |
|
6925
43d9c7eedf7b
Test implicitly dependent modules
Mitch Watrous <watrous@u.washington.edu>
parents:
6921
diff
changeset
|
154 |
# Add this module and test library to the list. |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
155 |
bld.env.append_value('NS3_MODULES_WITH_TEST_LIBRARIES', [(library.module_name, library.name)]) |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
156 |
|
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
157 |
# Set the include path from the build directory to modules. |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
158 |
relative_path_from_build_to_here = bld.path.relpath_gen(bld.bldnode) |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
159 |
include_flag = '-I' + relative_path_from_build_to_here |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
160 |
library.env.append_value('CXXFLAGS', include_flag) |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
161 |
library.env.append_value('CCFLAGS', include_flag) |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
162 |
|
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
163 |
return library |
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
164 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
165 |
def create_obj(bld, *args): |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
166 |
warnings.warn("(in %s) Use bld.new_task_gen(...) now, instead of bld.create_obj(...)" % str(bld.path), |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
167 |
DeprecationWarning, stacklevel=2) |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
168 |
return bld.new_task_gen(*args) |
955
c9be0df711d2
WAF: add back the --enable-rpath option, per Mathieu's request, though disabled by default.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
954
diff
changeset
|
169 |
|
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
170 |
|
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
171 |
def ns3_python_bindings(bld): |
7490
886cf992ade6
waf 1.6: fix python bindings apiscan
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7489
diff
changeset
|
172 |
|
6933
4bbaa92c3220
./waf --apiscan=all: now only scans modules that have bld.ns3_python_bindings() in their wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6925
diff
changeset
|
173 |
# this method is called from a module wscript, so remember bld.path is not bindings/python! |
4bbaa92c3220
./waf --apiscan=all: now only scans modules that have bld.ns3_python_bindings() in their wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6925
diff
changeset
|
174 |
module_abs_src_path = bld.path.abspath() |
4bbaa92c3220
./waf --apiscan=all: now only scans modules that have bld.ns3_python_bindings() in their wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6925
diff
changeset
|
175 |
module = os.path.basename(module_abs_src_path) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
176 |
env = bld.env |
6933
4bbaa92c3220
./waf --apiscan=all: now only scans modules that have bld.ns3_python_bindings() in their wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6925
diff
changeset
|
177 |
env.append_value("MODULAR_BINDINGS_MODULES", "ns3-"+module) |
4bbaa92c3220
./waf --apiscan=all: now only scans modules that have bld.ns3_python_bindings() in their wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6925
diff
changeset
|
178 |
|
7583
e42004e38839
Fix issue with waf --apiscan=all
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7545
diff
changeset
|
179 |
if Options.options.apiscan: |
e42004e38839
Fix issue with waf --apiscan=all
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7545
diff
changeset
|
180 |
return |
e42004e38839
Fix issue with waf --apiscan=all
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7545
diff
changeset
|
181 |
|
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
182 |
if not env['ENABLE_PYTHON_BINDINGS']: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
183 |
return |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
184 |
|
6942
3b9ce3a727a5
./waf --apiscan: fix bug in detection of whether the per-module bindings dir exists
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6941
diff
changeset
|
185 |
bindings_dir = bld.path.find_dir("bindings") |
3b9ce3a727a5
./waf --apiscan: fix bug in detection of whether the per-module bindings dir exists
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6941
diff
changeset
|
186 |
if bindings_dir is None or not os.path.exists(bindings_dir.abspath()): |
6876
9ac9bd55541d
Make ns3_python_bindings skip bindings with warning if apidefs dir not found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6875
diff
changeset
|
187 |
warnings.warn("(in %s) Requested to build modular python bindings, but apidefs dir not found " |
9ac9bd55541d
Make ns3_python_bindings skip bindings with warning if apidefs dir not found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6875
diff
changeset
|
188 |
"=> skipped the bindings." % str(bld.path), |
9ac9bd55541d
Make ns3_python_bindings skip bindings with warning if apidefs dir not found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6875
diff
changeset
|
189 |
Warning, stacklevel=2) |
9ac9bd55541d
Make ns3_python_bindings skip bindings with warning if apidefs dir not found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6875
diff
changeset
|
190 |
return |
9ac9bd55541d
Make ns3_python_bindings skip bindings with warning if apidefs dir not found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6875
diff
changeset
|
191 |
|
6920
b1b821ae64c1
Modular bindings: skip a binding module if the corresponding ns-3 module is not enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6913
diff
changeset
|
192 |
if ("ns3-%s" % (module,)) not in env.NS3_ENABLED_MODULES: |
b1b821ae64c1
Modular bindings: skip a binding module if the corresponding ns-3 module is not enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6913
diff
changeset
|
193 |
#print "bindings for module %s which is not enabled, skip" % module |
b1b821ae64c1
Modular bindings: skip a binding module if the corresponding ns-3 module is not enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6913
diff
changeset
|
194 |
return |
b1b821ae64c1
Modular bindings: skip a binding module if the corresponding ns-3 module is not enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6913
diff
changeset
|
195 |
|
6897
f338f17b0238
Modular bindings: generate a compatibility 'ns3' module that imports the modular bindings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6894
diff
changeset
|
196 |
env.append_value('PYTHON_MODULES_BUILT', module) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
197 |
apidefs = env['PYTHON_BINDINGS_APIDEFS'].replace("-", "_") |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
198 |
|
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
199 |
#debug = ('PYBINDGEN_DEBUG' in os.environ) |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
200 |
debug = True # XXX |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
201 |
source = [bld.srcnode.find_resource('bindings/python/ns3modulegen-modular.py').relpath_gen(bld.path), |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
202 |
"bindings/modulegen__%s.py" % apidefs] |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
203 |
|
6956
4a3bb1ba53fb
Modular bindings: add missing dep on the modulegen_customizations.py file, when found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6946
diff
changeset
|
204 |
if bindings_dir.find_resource("modulegen_customizations.py") is not None: |
4a3bb1ba53fb
Modular bindings: add missing dep on the modulegen_customizations.py file, when found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6946
diff
changeset
|
205 |
source.append("bindings/modulegen_customizations.py") |
4a3bb1ba53fb
Modular bindings: add missing dep on the modulegen_customizations.py file, when found
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6946
diff
changeset
|
206 |
|
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
207 |
# the local customization file may or not exist |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
208 |
if bld.path.find_resource("bindings/modulegen_local.py"): |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
209 |
source.append("bindings/modulegen_local.py") |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
210 |
|
6957
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
211 |
module_py_name = module.replace('-', '_') |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
212 |
module_target_dir = bld.srcnode.find_dir("bindings/python/ns").relpath_gen(bld.path) |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
213 |
|
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
214 |
# if bindings/<module>.py exists, it becomes the module frontend, and the C extension befomes _<module> |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
215 |
if bld.path.find_resource("bindings/%s.py" % (module_py_name,)) is not None: |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
216 |
bld.new_task_gen( |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
217 |
features='copy', |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
218 |
source=("bindings/%s.py" % (module_py_name,)), |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
219 |
target=('%s/%s.py' % (module_target_dir, module_py_name))) |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
220 |
extension_name = '_%s' % (module_py_name,) |
7673
1997b1a91020
Install python modules to PYTHONARCHDIR instead of PYTHONDIR; should fix #1329.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7667
diff
changeset
|
221 |
bld.install_files('${PYTHONARCHDIR}/ns', ["bindings/%s.py" % (module_py_name,)]) |
6957
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
222 |
else: |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
223 |
extension_name = module_py_name |
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
224 |
|
6893
5dccd86f90cf
Modular Python bindings work (many bug fixes, more modules tested)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6882
diff
changeset
|
225 |
target = ['bindings/ns3module.cc', 'bindings/ns3module.h', 'bindings/ns3modulegen.log'] |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
226 |
#if not debug: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
227 |
# target.append('ns3modulegen.log') |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
228 |
|
7408
4f1f961b6cdc
Bug 1224 - Ns-3-allinone fails to compile on Lion
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7384
diff
changeset
|
229 |
argv = ['NS3_ENABLED_FEATURES=${FEATURES}', |
4f1f961b6cdc
Bug 1224 - Ns-3-allinone fails to compile on Lion
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7384
diff
changeset
|
230 |
'GCC_RTTI_ABI_COMPLETE=${GCC_RTTI_ABI_COMPLETE}', |
4f1f961b6cdc
Bug 1224 - Ns-3-allinone fails to compile on Lion
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7384
diff
changeset
|
231 |
'${PYTHON}'] |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
232 |
#if debug: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
233 |
# argv.extend(["-m", "pdb"]) |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
234 |
|
6957
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
235 |
argv.extend(['${SRC[0]}', module_abs_src_path, apidefs, extension_name, '${TGT[0]}']) |
6893
5dccd86f90cf
Modular Python bindings work (many bug fixes, more modules tested)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6882
diff
changeset
|
236 |
|
5dccd86f90cf
Modular Python bindings work (many bug fixes, more modules tested)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6882
diff
changeset
|
237 |
argv.extend(['2>', '${TGT[2]}']) # 2> ns3modulegen.log |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
238 |
|
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
239 |
features = [] |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
240 |
for (name, caption, was_enabled, reason_not_enabled) in env['NS3_OPTIONAL_FEATURES']: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
241 |
if was_enabled: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
242 |
features.append(name) |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
243 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
244 |
bindgen = bld.new_task_gen(features=['command'], source=source, target=target, command=argv) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
245 |
bindgen.env['FEATURES'] = ','.join(features) |
7408
4f1f961b6cdc
Bug 1224 - Ns-3-allinone fails to compile on Lion
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7384
diff
changeset
|
246 |
bindgen.dep_vars = ['FEATURES', "GCC_RTTI_ABI_COMPLETE"] |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
247 |
bindgen.before = 'cxx' |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
248 |
bindgen.after = 'gen_ns3_module_header' |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
249 |
bindgen.name = "pybindgen(ns3 module %s)" % module |
7545
ac0569e8cb7d
Avoid installation of ns3modulegen-modular.py as a python module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7541
diff
changeset
|
250 |
bindgen.install_path = None |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
251 |
|
6957
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
252 |
# generate the extension module |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
253 |
pymod = bld.new_task_gen(features='cxx cxxshlib pyext') |
6893
5dccd86f90cf
Modular Python bindings work (many bug fixes, more modules tested)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6882
diff
changeset
|
254 |
pymod.source = ['bindings/ns3module.cc'] |
6957
5f49d23b4a74
Modular bindings: add support for <module>.py and _<module>.so layout, for extending modules in Python
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6956
diff
changeset
|
255 |
pymod.target = '%s/%s' % (module_target_dir, extension_name) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
256 |
pymod.name = 'ns3module_%s' % module |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
257 |
pymod.use = ["%s" % mod for mod in pymod.env['NS3_ENABLED_MODULES']] # Should be '"ns3-"+module', but see bug 1117 |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
258 |
if pymod.env['ENABLE_STATIC_NS3']: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
259 |
if sys.platform == 'darwin': |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
260 |
pymod.env.append_value('LINKFLAGS', '-Wl,-all_load') |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
261 |
for mod in pymod.usel: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
262 |
#mod = mod.split("--lib")[0] |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
263 |
pymod.env.append_value('LINKFLAGS', '-l' + mod) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
264 |
else: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
265 |
pymod.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic') |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
266 |
for mod in pymod.use: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
267 |
#mod = mod.split("--lib")[0] |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
268 |
pymod.env.append_value('LINKFLAGS', '-l' + mod) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
269 |
pymod.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive') |
7494
d93f5e8e0a59
waf-1.6: Mac OSX and other fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7492
diff
changeset
|
270 |
defines = list(pymod.env['DEFINES']) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
271 |
defines.extend(['NS_DEPRECATED=', 'NS3_DEPRECATED_H']) |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
272 |
if Options.platform == 'win32': |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
273 |
try: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
274 |
defines.remove('_DEBUG') # causes undefined symbols on win32 |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
275 |
except ValueError: |
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
276 |
pass |
7494
d93f5e8e0a59
waf-1.6: Mac OSX and other fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7492
diff
changeset
|
277 |
pymod.env['DEFINES'] = defines |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
278 |
pymod.includes = '# bindings' |
7673
1997b1a91020
Install python modules to PYTHONARCHDIR instead of PYTHONDIR; should fix #1329.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7667
diff
changeset
|
279 |
pymod.install_path = '${PYTHONARCHDIR}/ns' |
7678
a4c56ef461ba
Bug 1335 - waf 1.6.10 upgrade breaks OS X build when Python enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7675
diff
changeset
|
280 |
|
a4c56ef461ba
Bug 1335 - waf 1.6.10 upgrade breaks OS X build when Python enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7675
diff
changeset
|
281 |
# Workaround to a WAF bug, remove this when ns-3 upgrades to WAF > 1.6.10 |
a4c56ef461ba
Bug 1335 - waf 1.6.10 upgrade breaks OS X build when Python enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7675
diff
changeset
|
282 |
# https://www.nsnam.org/bugzilla/show_bug.cgi?id=1335 |
a4c56ef461ba
Bug 1335 - waf 1.6.10 upgrade breaks OS X build when Python enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7675
diff
changeset
|
283 |
# http://code.google.com/p/waf/issues/detail?id=1098 |
7679
5a9a0a21b553
Bug #1335 postfix
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7678
diff
changeset
|
284 |
if Utils.unversioned_sys_platform() == 'darwin': |
5a9a0a21b553
Bug #1335 postfix
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7678
diff
changeset
|
285 |
pymod.mac_bundle = True |
7678
a4c56ef461ba
Bug 1335 - waf 1.6.10 upgrade breaks OS X build when Python enabled
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7675
diff
changeset
|
286 |
|
6893
5dccd86f90cf
Modular Python bindings work (many bug fixes, more modules tested)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6882
diff
changeset
|
287 |
return pymod |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
288 |
|
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
289 |
|
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
290 |
def build(bld): |
1217
2f7791ae388d
WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1214
diff
changeset
|
291 |
bld.create_ns3_module = types.MethodType(create_ns3_module, bld) |
6913
54679ab32585
Create separate module and test-module libraries
Mitch Watrous <watrous@u.washington.edu>
parents:
6902
diff
changeset
|
292 |
bld.create_ns3_module_test_library = types.MethodType(create_ns3_module_test_library, bld) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
293 |
bld.create_obj = types.MethodType(create_obj, bld) |
6874
c7537e62f2fa
Start of work on modular Python bindings, unstable
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
294 |
bld.ns3_python_bindings = types.MethodType(ns3_python_bindings, bld) |
600
fd944dbf33c6
WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
537
diff
changeset
|
295 |
|
7293
0f574c532cee
Make test module not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7291
diff
changeset
|
296 |
# Remove these modules from the list of all modules. |
0f574c532cee
Make test module not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7291
diff
changeset
|
297 |
for not_built in bld.env['MODULES_NOT_BUILT']: |
7303
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
298 |
|
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
299 |
# XXX Becaue these modules are located in subdirectories of |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
300 |
# test, their names in the all_modules list include the extra |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
301 |
# relative path "test/". If these modules are moved into the |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
302 |
# src directory, then this if block should be removed. |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
303 |
if not_built == 'ns3tcp' or not_built == 'ns3wifi': |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
304 |
not_built = 'test/' + not_built |
8359b3ac1ab0
Handle extra relative paths for ns3tcp and ns3wifi modules
Mitch Watrous <watrous@u.washington.edu>
parents:
7297
diff
changeset
|
305 |
|
7293
0f574c532cee
Make test module not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7291
diff
changeset
|
306 |
if not_built in all_modules: |
0f574c532cee
Make test module not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7291
diff
changeset
|
307 |
all_modules.remove(not_built) |
7291
d39c09dbc3d9
Make emu and template modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents:
7237
diff
changeset
|
308 |
|
969
3c3ce40492a6
WAF: make list of modules (all_modules) a tuple instead of list, because it is hashable, and this way newer WAF is able to notice changes in it and automatically trigger a reconfiguration.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
968
diff
changeset
|
309 |
bld.add_subdirs(list(all_modules)) |
693
c8fc89076aa2
WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
672
diff
changeset
|
310 |
|
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
311 |
for module in all_modules: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
312 |
modheader = bld.new_task_gen(features=['ns3moduleheader']) |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
313 |
modheader.module = module.split('/')[-1] |
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
314 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
315 |
class ns3pcfile_task(Task.Task): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
316 |
after = 'cc cxx' |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
317 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
318 |
def __str__(self): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
319 |
"string to display to the user" |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
320 |
tgt_str = ' '.join([a.nice_path(self.env) for a in self.outputs]) |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
321 |
return 'pcfile: %s\n' % (tgt_str) |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
322 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
323 |
def runnable_status(self): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
324 |
return super(ns3pcfile_task, self).runnable_status() |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
325 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
326 |
def _self_libs(self, env, name, libdir): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
327 |
if env['ENABLE_STATIC_NS3']: |
7520
a61ef851d443
Fix issue with generating .pc file in static build
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7514
diff
changeset
|
328 |
path_st = 'STLIBPATH_ST' |
a61ef851d443
Fix issue with generating .pc file in static build
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7514
diff
changeset
|
329 |
lib_st = 'STLIB_ST' |
a61ef851d443
Fix issue with generating .pc file in static build
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7514
diff
changeset
|
330 |
lib_marker = 'STLIB_MARKER' |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
331 |
else: |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
332 |
path_st = 'LIBPATH_ST' |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
333 |
lib_st = 'LIB_ST' |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
334 |
lib_marker = 'SHLIB_MARKER' |
7523
7c6a89520349
Fix .pc file generation on OSX
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7522
diff
changeset
|
335 |
retval = [env[path_st] % libdir] |
7c6a89520349
Fix .pc file generation on OSX
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7522
diff
changeset
|
336 |
if env[lib_marker]: |
7c6a89520349
Fix .pc file generation on OSX
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7522
diff
changeset
|
337 |
retval.append(env[lib_marker]) |
7c6a89520349
Fix .pc file generation on OSX
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7522
diff
changeset
|
338 |
retval.append(env[lib_st] % name) |
7070
5635f2667e08
fix typo: % should be $
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
7053
diff
changeset
|
339 |
return retval |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
340 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
341 |
def _lib(self, env, dep): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
342 |
libpath = env['LIBPATH_%s' % dep] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
343 |
linkflags = env['LINKFLAGS_%s' % dep] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
344 |
libs = env['LIB_%s' % dep] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
345 |
retval = [] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
346 |
for path in libpath: |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
347 |
retval.append(env['LIBPATH_ST'] % path) |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
348 |
retval = retval + linkflags |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
349 |
for lib in libs: |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
350 |
retval.append(env['LIB_ST'] % lib) |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
351 |
return retval |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
352 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
353 |
def _listify(self, v): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
354 |
if isinstance(v, list): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
355 |
return v |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
356 |
else: |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
357 |
return [v] |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
358 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
359 |
def _cflags(self, dep): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
360 |
flags = self.env['CFLAGS_%s' % dep] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
361 |
return self._listify(flags) |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
362 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
363 |
def _cxxflags(self, dep): |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
364 |
return self._listify(self.env['CXXFLAGS_%s' % dep]) |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
365 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
366 |
def _defines(self, dep): |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
367 |
return [self.env['DEFINES_ST'] % define for define in self.env['DEFINES_%s' % dep]] |
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
368 |
|
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
369 |
def _includes(self, dep): |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
370 |
includes = self.env['INCLUDES_%s' % dep] |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
371 |
return [self.env['CPPPATH_ST'] % include for include in includes] |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
372 |
|
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
373 |
def _generate_pcfile(self, name, use, env, outfilename): |
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
374 |
outfile = open(outfilename, 'wt') |
7345
850237ab2111
Bug 1199 - waf install doesn't work on x86_64
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7331
diff
changeset
|
375 |
prefix = env.PREFIX |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
376 |
includedir = Utils.subst_vars('${INCLUDEDIR}/%s%s' % (wutils.APPNAME, wutils.VERSION), env) |
7345
850237ab2111
Bug 1199 - waf install doesn't work on x86_64
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7331
diff
changeset
|
377 |
libdir = env.LIBDIR |
7688
6f5c9b870e45
Still Bug 1327: disable VNUM in libraries, fix the .pc file deps
Vedran Miletić
parents:
7681
diff
changeset
|
378 |
libs = self._self_libs(env, "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name[4:], env['BUILD_PROFILE']), '${libdir}') |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
379 |
for dep in use: |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
380 |
libs += self._lib(env, dep) |
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
381 |
for dep in env.LIBS: |
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
382 |
libs += self.env['LIB_ST'] % dep |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
383 |
cflags = [self.env['CPPPATH_ST'] % '${includedir}'] |
7514
cac200ed9c0a
Add Requires: to the .pc file indicating inter-module dependencies
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7512
diff
changeset
|
384 |
requires = [] |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
385 |
for dep in use: |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
386 |
cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \ |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
387 |
self._defines(dep) + self._includes(dep) |
7514
cac200ed9c0a
Add Requires: to the .pc file indicating inter-module dependencies
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7512
diff
changeset
|
388 |
if dep.startswith('ns3-'): |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
389 |
dep_name = dep[4:] |
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
390 |
requires.append("libns%s-%s-%s" % (wutils.VERSION, dep_name, env['BUILD_PROFILE'])) |
7667
42dda4375d79
Bug 1332 - Generated .pc files have blank line above and below the text
Vedran Miletić <rivanvx@gmail.com>
parents:
7583
diff
changeset
|
391 |
print >> outfile, """\ |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
392 |
prefix=%s |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
393 |
libdir=%s |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
394 |
includedir=%s |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
395 |
|
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
396 |
Name: lib%s |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
397 |
Description: ns-3 module %s |
7688
6f5c9b870e45
Still Bug 1327: disable VNUM in libraries, fix the .pc file deps
Vedran Miletić
parents:
7681
diff
changeset
|
398 |
Version: %s |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
399 |
Libs: %s |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
400 |
Cflags: %s |
7667
42dda4375d79
Bug 1332 - Generated .pc files have blank line above and below the text
Vedran Miletić <rivanvx@gmail.com>
parents:
7583
diff
changeset
|
401 |
Requires: %s\ |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
402 |
""" % (prefix, libdir, includedir, |
7688
6f5c9b870e45
Still Bug 1327: disable VNUM in libraries, fix the .pc file deps
Vedran Miletić
parents:
7681
diff
changeset
|
403 |
name, name, wutils.VERSION, ' '.join(libs), ' '.join(cflags), ' '.join(requires)) |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
404 |
outfile.close() |
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
405 |
|
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
406 |
def run(self): |
7511
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
407 |
output_filename = self.outputs[0].abspath() |
7522
8a7aec72d793
Don't pass first name in list when generating the pc file
Mitch Watrous <watrous@u.washington.edu>
parents:
7521
diff
changeset
|
408 |
self._generate_pcfile(self.module.name, |
7512
bbdfcec0d97d
More pc file fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7511
diff
changeset
|
409 |
self.module.to_list(self.module.use), |
7345
850237ab2111
Bug 1199 - waf install doesn't work on x86_64
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7331
diff
changeset
|
410 |
self.env, output_filename) |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
411 |
|
7511
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
412 |
|
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
413 |
@TaskGen.feature('ns3pcfile') |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
414 |
@TaskGen.after_method('process_rule') |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
415 |
def apply(self): |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
416 |
output_filename = 'lib%s.pc' % os.path.basename(self.module.target) |
7511
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
417 |
output_node = self.path.find_or_declare(output_filename) |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
418 |
assert output_node is not None, str(self) |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
419 |
task = self.create_task('ns3pcfile') |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
420 |
self.bld.install_files('${LIBDIR}/pkgconfig', output_node) |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
421 |
task.set_outputs([output_node]) |
6d03bec01c5c
Fix .pc file generation
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7496
diff
changeset
|
422 |
task.module = self.module |
7016
eab6710a6346
generate pkg-config files for installation.
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
7006
diff
changeset
|
423 |
|
1220
4933e0890acd
Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
1217
diff
changeset
|
424 |
|
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
425 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
426 |
@TaskGen.feature('ns3header') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
427 |
@TaskGen.after_method('process_rule') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
428 |
def apply_ns3header(self): |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
429 |
if self.module is None: |
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
430 |
raise WafError("'module' missing on ns3headers object %s" % self) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
431 |
ns3_dir_node = self.bld.path.find_dir("ns3") |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
432 |
for filename in set(self.to_list(self.source)): |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
433 |
src_node = self.path.find_resource(filename) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
434 |
if src_node is None: |
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
435 |
raise WafError("source ns3 header file %s not found" % (filename,)) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
436 |
dst_node = ns3_dir_node.find_or_declare(src_node.name) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
437 |
assert dst_node is not None |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
438 |
task = self.create_task('ns3header') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
439 |
task.mode = getattr(self, 'mode', 'install') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
440 |
if task.mode == 'install': |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
441 |
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), [src_node]) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
442 |
task.set_inputs([src_node]) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
443 |
task.set_outputs([dst_node]) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
444 |
else: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
445 |
task.header_to_remove = dst_node |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
446 |
self.headers = set(self.to_list(self.source)) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
447 |
self.source = '' # tell WAF not to process these files further |
693
c8fc89076aa2
WAF: cleanup the main wscript file by moving the definition of the ns3header object type into src/wscript
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
672
diff
changeset
|
448 |
|
7492
5299fc683dfa
Clean some dead waf code
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7490
diff
changeset
|
449 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
450 |
class ns3header_task(Task.Task): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
451 |
before = 'cc cxx gen_ns3_module_header' |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
452 |
color = 'BLUE' |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
453 |
|
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
454 |
def __str__(self): |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
455 |
"string to display to the user" |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
456 |
env = self.env |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
457 |
src_str = ' '.join([a.nice_path(env) for a in self.inputs]) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
458 |
tgt_str = ' '.join([a.nice_path(env) for a in self.outputs]) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
459 |
if self.outputs: sep = ' -> ' |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
460 |
else: sep = '' |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
461 |
if self.mode == 'remove': |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
462 |
return 'rm-ns3-header %s\n' % (self.header_to_remove.abspath(),) |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
463 |
return 'install-ns3-header: %s%s%s\n' % (src_str, sep, tgt_str) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
464 |
|
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
465 |
def __repr__(self): |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
466 |
return str(self) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
467 |
|
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
468 |
def uid(self): |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
469 |
try: |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
470 |
return self.uid_ |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
471 |
except AttributeError: |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
472 |
m = Utils.md5() |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
473 |
up = m.update |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
474 |
up(self.__class__.__name__.encode()) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
475 |
for x in self.inputs + self.outputs: |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
476 |
up(x.abspath().encode()) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
477 |
up(self.mode) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
478 |
if self.mode == 'remove': |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
479 |
up(self.header_to_remove.abspath().encode()) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
480 |
self.uid_ = m.digest() |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
481 |
return self.uid_ |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
482 |
|
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
483 |
def runnable_status(self): |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
484 |
if self.mode == 'remove': |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
485 |
if os.path.exists(self.header_to_remove.abspath()): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
486 |
return Task.RUN_ME |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
487 |
else: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
488 |
return Task.SKIP_ME |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
489 |
else: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
490 |
return super(ns3header_task, self).runnable_status() |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
491 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
492 |
def run(self): |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
493 |
if self.mode == 'install': |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
494 |
assert len(self.inputs) == len(self.outputs) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
495 |
inputs = [node.abspath() for node in self.inputs] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
496 |
outputs = [node.abspath() for node in self.outputs] |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
497 |
for src, dst in zip(inputs, outputs): |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
498 |
try: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
499 |
os.chmod(dst, 0600) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
500 |
except OSError: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
501 |
pass |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
502 |
shutil.copy2(src, dst) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
503 |
## make the headers in builddir read-only, to prevent |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
504 |
## accidental modification |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
505 |
os.chmod(dst, 0400) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
506 |
return 0 |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
507 |
else: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
508 |
assert len(self.inputs) == 0 |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
509 |
assert len(self.outputs) == 0 |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
510 |
out_file_name = self.header_to_remove.abspath() |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
511 |
try: |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
512 |
os.unlink(out_file_name) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
513 |
except OSError, ex: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
514 |
if ex.errno != 2: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
515 |
raise |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
516 |
return 0 |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
517 |
|
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
518 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
519 |
class gen_ns3_module_header_task(Task.Task): |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
520 |
before = 'cc cxx' |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
521 |
after = 'ns3header' |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
522 |
color = 'BLUE' |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
523 |
|
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
524 |
def runnable_status(self): |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
525 |
if self.mode == 'remove': |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
526 |
if os.path.exists(self.header_to_remove.abspath()): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
527 |
return Task.RUN_ME |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
528 |
else: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
529 |
return Task.SKIP_ME |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
530 |
else: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
531 |
return super(gen_ns3_module_header_task, self).runnable_status() |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
532 |
|
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
533 |
def __str__(self): |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
534 |
"string to display to the user" |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
535 |
env = self.env |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
536 |
src_str = ' '.join([a.nice_path(env) for a in self.inputs]) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
537 |
tgt_str = ' '.join([a.nice_path(env) for a in self.outputs]) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
538 |
if self.outputs: sep = ' -> ' |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
539 |
else: sep = '' |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
540 |
if self.mode == 'remove': |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
541 |
return 'rm-module-header %s\n' % (self.header_to_remove.abspath(),) |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
542 |
return 'gen-module-header: %s%s%s\n' % (src_str, sep, tgt_str) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
543 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
544 |
def run(self): |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
545 |
if self.mode == 'remove': |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
546 |
assert len(self.inputs) == 0 |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
547 |
assert len(self.outputs) == 0 |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
548 |
out_file_name = self.header_to_remove.abspath() |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
549 |
try: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
550 |
os.unlink(out_file_name) |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
551 |
except OSError, ex: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
552 |
if ex.errno != 2: |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
553 |
raise |
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
554 |
return 0 |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
555 |
assert len(self.outputs) == 1 |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
556 |
out_file_name = self.outputs[0].get_bld().abspath()#self.env) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
557 |
header_files = [os.path.basename(node.abspath()) for node in self.inputs] |
6647
bdbbfbc6bda7
When a module is disabled, remove xxx-module.h and module header files from build/variant/ns3
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6639
diff
changeset
|
558 |
outfile = file(out_file_name, "w") |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
559 |
header_files.sort() |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
560 |
|
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
561 |
print >> outfile, """ |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
562 |
#ifdef NS3_MODULE_COMPILATION |
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
563 |
# error "Do not include ns3 module aggregator headers from other modules; these are meant only for end user scripts." |
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
564 |
#endif |
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
565 |
|
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
566 |
#ifndef NS3_MODULE_%s |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
567 |
""" % (self.module.upper().replace('-', '_'),) |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
568 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
569 |
# if self.module_deps: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
570 |
# print >> outfile, "// Module dependencies:" |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
571 |
# for dep in self.module_deps: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
572 |
# print >> outfile, "#include \"%s-module.h\"" % dep |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
573 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
574 |
print >> outfile |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
575 |
print >> outfile, "// Module headers:" |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
576 |
for header in header_files: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
577 |
print >> outfile, "#include \"%s\"" % (header,) |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
578 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
579 |
print >> outfile, "#endif" |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
580 |
|
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
581 |
outfile.close() |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3854
diff
changeset
|
582 |
return 0 |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
583 |
|
4126
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
584 |
def sig_explicit_deps(self): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
585 |
self.m.update('\n'.join([node.abspath() for node in self.inputs])) |
6671
b3d5193a2f94
Bug 1004 - module header not rebuilt
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6647
diff
changeset
|
586 |
return self.m.digest() |
4126
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
587 |
|
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
588 |
def unique_id(self): |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
589 |
try: |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
590 |
return self.uid |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
591 |
except AttributeError: |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
592 |
"this is not a real hot zone, but we want to avoid surprizes here" |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4164
diff
changeset
|
593 |
m = Utils.md5() |
4126
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
594 |
m.update("ns-3-module-header-%s" % self.module) |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
595 |
self.uid = m.digest() |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
596 |
return self.uid |
0ba0346d655b
Workaround WAF issue 325 for generating module header files
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4066
diff
changeset
|
597 |
|
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
598 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
599 |
# Generates a 'ns3/foo-module.h' header file that includes all public |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
600 |
# ns3 headers of a certain module. |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
601 |
@TaskGen.feature('ns3moduleheader') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
602 |
@TaskGen.after_method('process_rule') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
603 |
def apply_ns3moduleheader(self): |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
604 |
## get all of the ns3 headers |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
605 |
ns3_dir_node = self.bld.path.find_dir("ns3") |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
606 |
all_headers_inputs = [] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
607 |
found_the_module = False |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
608 |
for ns3headers in self.bld.all_task_gen: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
609 |
if 'ns3header' in getattr(ns3headers, "features", []): |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
610 |
if ns3headers.module != self.module: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
611 |
continue |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
612 |
found_the_module = True |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
613 |
for source in ns3headers.headers: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
614 |
source = os.path.basename(source) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
615 |
node = ns3_dir_node.find_or_declare(os.path.basename(source)) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
616 |
if node is None: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
617 |
fatal("missing header file %s" % (source,)) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
618 |
all_headers_inputs.append(node) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
619 |
if not found_the_module: |
7496
ce1ec79d488c
waf1.6: make the all_modules in src/wscript be automatically discovered
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7494
diff
changeset
|
620 |
raise WafError("error finding headers for module %s" % self.module) |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
621 |
if not all_headers_inputs: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
622 |
return |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
623 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
624 |
try: |
7488
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
625 |
module_obj = self.bld.get_tgen_by_name("ns3-" + self.module) |
72d0c878f3c7
More waf 1.6.7 build fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
626 |
except WafError: # maybe the module was disabled, and therefore removed |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
627 |
return |
2611
79b1c42fef3e
Generate foo-module.h module aggreator header files, for use in user scripts.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
2609
diff
changeset
|
628 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
629 |
all_headers_outputs = [ns3_dir_node.find_or_declare("%s-module.h" % self.module)] |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
630 |
task = self.create_task('gen_ns3_module_header') |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
631 |
task.module = self.module |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
632 |
task.mode = getattr(self, "mode", "install") |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
633 |
if task.mode == 'install': |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
634 |
assert module_obj is not None, self.module |
7681
0873edb445e8
Bug 1327 - Version installed ns-3 files
Gustavo Carneiro / Vedran Miletić
parents:
7679
diff
changeset
|
635 |
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
636 |
ns3_dir_node.find_or_declare("%s-module.h" % self.module)) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
637 |
task.set_inputs(all_headers_inputs) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
638 |
task.set_outputs(all_headers_outputs) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
639 |
task.module_deps = module_obj.module_deps |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
640 |
else: |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7467
diff
changeset
|
641 |
task.header_to_remove = all_headers_outputs[0] |