|
79 |
module = bld.new_task_gen(features=['cxx', 'cxxstlib', 'ns3module']) |
79 |
module = bld.new_task_gen(features=['cxx', 'cxxstlib', 'ns3module']) |
80 |
else: |
80 |
else: |
81 |
module = bld.new_task_gen(features=['cxx', 'cxxshlib', 'ns3module']) |
81 |
module = bld.new_task_gen(features=['cxx', 'cxxshlib', 'ns3module']) |
82 |
module.target = '%s/ns3-%s' % (bld.srcnode.relpath_gen(module.path), name) |
82 |
module.target = '%s/ns%s-%s-%s' % (bld.srcnode.relpath_gen(module.path), wutils.VERSION, |
|
|
83 |
name, bld.env['BUILD_PROFILE']) |
83 |
linkflags = [] |
84 |
linkflags = [] |
84 |
cxxflags = [] |
85 |
cxxflags = [] |
85 |
ccflags = [] |
86 |
ccflags = [] |
|
123 |
|
124 |
|
124 |
module.env.append_value("INCLUDES", '#') |
125 |
module.env.append_value("INCLUDES", '#') |
125 |
|
126 |
|
126 |
pcfilegen = bld(features='ns3pcfile') |
127 |
module.pcfilegen = bld(features='ns3pcfile') |
127 |
pcfilegen.module = module |
128 |
module.pcfilegen.module = module |
128 |
|
129 |
|
129 |
return module |
130 |
return module |
130 |
|
131 |
|
|
372 |
def _generate_pcfile(self, name, use, env, outfilename): |
373 |
def _generate_pcfile(self, name, use, env, outfilename): |
373 |
outfile = open(outfilename, 'wt') |
374 |
outfile = open(outfilename, 'wt') |
374 |
prefix = env.PREFIX |
375 |
prefix = env.PREFIX |
375 |
includedir = env.INCLUDEDIR |
376 |
includedir = Utils.subst_vars('${INCLUDEDIR}/%s%s' % (wutils.APPNAME, wutils.VERSION), env) |
376 |
libdir = env.LIBDIR |
377 |
libdir = env.LIBDIR |
377 |
libs = self._self_libs(env, name, '${libdir}') |
378 |
libs = self._self_libs(env, name, '${libdir}') |
378 |
for dep in use: |
379 |
for dep in use: |
|
385 |
cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \ |
386 |
cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \ |
386 |
self._defines(dep) + self._includes(dep) |
387 |
self._defines(dep) + self._includes(dep) |
387 |
if dep.startswith('ns3-'): |
388 |
if dep.startswith('ns3-'): |
388 |
requires.append("lib"+dep) |
389 |
dep_name = dep[4:] |
|
|
390 |
requires.append("libns%s-%s-%s" % (wutils.VERSION, dep_name, env['BUILD_PROFILE'])) |
389 |
print >> outfile, """\ |
391 |
print >> outfile, """\ |
390 |
prefix=%s |
392 |
prefix=%s |
391 |
libdir=%s |
393 |
libdir=%s |
|
411 |
@TaskGen.feature('ns3pcfile') |
413 |
@TaskGen.feature('ns3pcfile') |
412 |
@TaskGen.after_method('process_rule') |
414 |
@TaskGen.after_method('process_rule') |
413 |
def apply(self): |
415 |
def apply(self): |
414 |
output_filename = 'lib%s.pc' % self.module.name |
416 |
output_filename = 'lib%s.pc' % os.path.basename(self.module.target) |
415 |
output_node = self.path.find_or_declare(output_filename) |
417 |
output_node = self.path.find_or_declare(output_filename) |
416 |
assert output_node is not None, str(self) |
418 |
assert output_node is not None, str(self) |
417 |
task = self.create_task('ns3pcfile') |
419 |
task = self.create_task('ns3pcfile') |
|
436 |
task = self.create_task('ns3header') |
438 |
task = self.create_task('ns3header') |
437 |
task.mode = getattr(self, 'mode', 'install') |
439 |
task.mode = getattr(self, 'mode', 'install') |
438 |
if task.mode == 'install': |
440 |
if task.mode == 'install': |
439 |
self.bld.install_files('${PREFIX}/include/ns3', [src_node]) |
441 |
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), [src_node]) |
440 |
task.set_inputs([src_node]) |
442 |
task.set_inputs([src_node]) |
441 |
task.set_outputs([dst_node]) |
443 |
task.set_outputs([dst_node]) |
442 |
else: |
444 |
else: |
|
630 |
task.mode = getattr(self, "mode", "install") |
632 |
task.mode = getattr(self, "mode", "install") |
631 |
if task.mode == 'install': |
633 |
if task.mode == 'install': |
632 |
assert module_obj is not None, self.module |
634 |
assert module_obj is not None, self.module |
633 |
self.bld.install_files('${PREFIX}/include/ns3', |
635 |
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), |
634 |
ns3_dir_node.find_or_declare("%s-module.h" % self.module)) |
636 |
ns3_dir_node.find_or_declare("%s-module.h" % self.module)) |
635 |
task.set_inputs(all_headers_inputs) |
637 |
task.set_inputs(all_headers_inputs) |
636 |
task.set_outputs(all_headers_outputs) |
638 |
task.set_outputs(all_headers_outputs) |