author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Mon, 23 Jul 2007 15:53:54 +0200 | |
changeset 968 | 70d02500c9d5 |
parent 955 | c9be0df711d2 |
child 969 | 3c3ce40492a6 |
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 |
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
|
4 |
import shutil |
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 |
|
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
|
6 |
import Action |
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
|
7 |
import Common |
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 |
import Object |
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
|
9 |
import Params |
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
|
10 |
|
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
|
11 |
|
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
|
12 |
all_modules = [ |
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
|
13 |
'core', |
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
|
14 |
'common', |
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
|
15 |
'simulator', |
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
|
16 |
'node', |
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
|
17 |
'internet-node', |
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
|
18 |
'devices/p2p', |
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
|
19 |
'applications', |
968
70d02500c9d5
mobility models
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
955
diff
changeset
|
20 |
'mobility', |
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
|
21 |
] |
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
|
22 |
|
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
|
23 |
|
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
24 |
def set_options(opt): |
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
25 |
opt.sub_options('simulator') |
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
|
26 |
|
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
|
27 |
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
|
28 |
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
|
29 |
" (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
|
30 |
" --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
|
31 |
" 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
|
32 |
action="store_true", dest='enable_rpath', default=False) |
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
|
33 |
|
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
|
34 |
|
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
35 |
def configure(conf): |
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
36 |
conf.sub_config('core') |
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
37 |
conf.sub_config('simulator') |
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
38 |
|
761
0ffbc9fa8ef0
Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
693
diff
changeset
|
39 |
blddir = os.path.abspath(os.path.join(conf.m_blddir, conf.env.variant())) |
0ffbc9fa8ef0
Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
693
diff
changeset
|
40 |
for module in all_modules: |
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
|
41 |
module_path = os.path.join(blddir, 'src', module) |
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 |
conf.env.append_value('NS3_MODULE_PATH', module_path) |
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 |
if Params.g_options.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
|
44 |
conf.env.append_value('RPATH', '-Wl,-rpath=%s' % (module_path,)) |
761
0ffbc9fa8ef0
Define env['NS3_MODULE_PATH'] in configure rather than build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
693
diff
changeset
|
45 |
|
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
|
46 |
## Used to link the 'run-tests' program with all of ns-3 code |
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
|
47 |
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
|
48 |
|
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
|
49 |
|
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
|
50 |
|
537
e8a4183dfe00
Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff
changeset
|
51 |
def build(bld): |
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
|
52 |
Object.register('ns3header', Ns3Header) |
954
a54d59850d03
WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
928
diff
changeset
|
53 |
Action.Action('ns3header', func=_ns3_headers_inst, color='BLUE') |
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
|
54 |
|
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
|
55 |
bld.add_subdirs(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
|
56 |
|
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
|
57 |
class Ns3Header(Object.genobj): |
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
|
58 |
"""A set of NS-3 header files""" |
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
|
59 |
def __init__(self, env=None): |
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
|
60 |
Object.genobj.__init__(self, 'other') |
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
|
61 |
self.inst_var = 'INCLUDEDIR' |
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
|
62 |
self.inst_dir = 'ns3' |
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
|
63 |
self.env = env |
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
|
64 |
if not self.env: |
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
|
65 |
self.env = Params.g_build.m_allenvs['default'] |
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
|
66 |
|
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
|
67 |
def apply(self): |
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
|
68 |
ns3_dir_node = Params.g_build.m_srcnode.find_dir("ns3") |
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
|
69 |
for filename in self.to_list(self.source): |
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
|
70 |
src_node = self.path.find_source(filename) |
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
|
71 |
if src_node is None: |
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
|
72 |
Params.fatal("source ns3 header file %s not found" % (filename,)) |
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
|
73 |
dst_node = ns3_dir_node.find_build(os.path.basename(filename)) |
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
|
74 |
assert dst_node is not None |
954
a54d59850d03
WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
928
diff
changeset
|
75 |
task = self.create_task('ns3header', self.env, 1) |
a54d59850d03
WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
928
diff
changeset
|
76 |
task.set_inputs([src_node]) |
a54d59850d03
WAF: use a separate 'waf task' for installing each public ns3 header to work around a dependency tracking bug in waf causing too many rebuilds when a single header file changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
928
diff
changeset
|
77 |
task.set_outputs([dst_node]) |
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
|
78 |
|
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
|
79 |
def install(self): |
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
|
80 |
for i in self.m_tasks: |
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
|
81 |
current = Params.g_build.m_curdirnode |
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
|
82 |
lst = map(lambda a: a.relpath_gen(current), i.m_outputs) |
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
|
83 |
Common.install_files(self.inst_var, self.inst_dir, lst) |
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
|
84 |
|
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
|
85 |
def _ns3_headers_inst(task): |
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
|
86 |
assert len(task.m_inputs) == len(task.m_outputs) |
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
|
87 |
inputs = [node.srcpath(task.m_env) for node in task.m_inputs] |
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
|
88 |
outputs = [node.bldpath(task.m_env) for node in task.m_outputs] |
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
|
89 |
for src, dst in zip(inputs, outputs): |
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
|
90 |
try: |
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
|
91 |
os.chmod(dst, 0600) |
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
|
92 |
except OSError: |
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
|
93 |
pass |
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
|
94 |
shutil.copy2(src, dst) |
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
|
95 |
## make the headers in builddir read-only, to prevent |
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
|
96 |
## accidental modification |
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
|
97 |
os.chmod(dst, 0400) |
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
|
98 |
return 0 |