|
Bugzilla – Full Text Bug Listing |
| Summary: | Regression/duplication after #2630 | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Alex Afanasyev <alexander.afanasyev> |
| Component: | general | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | tomh |
| Priority: | P3 | ||
| Version: | ns-3.27 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://www.nsnam.org/bugzilla/show_bug.cgi?id=2630 | ||
| Attachments: | patch to remove code duplication in contrib/wscript | ||
|
Description
Alex Afanasyev
2018-02-23 17:15:32 UTC
I am working on a new patch to fix. Great. Can you also include the following patch to support export of include paths for the installed modules in .pc file:
diff --git a/src/wscript b/src/wscript
index 5e1b791b8..5c20ffa77 100644
--- a/src/wscript
+++ b/src/wscript
@@ -385,9 +385,9 @@ class ns3pcfile_task(Task.Task):
def _includes(self, dep):
includes = self.env['INCLUDES_%s' % dep]
- return [self.env['CPPPATH_ST'] % include for include in includes]
+ return [self.env['CPPPATH_ST'] % include for include in Utils.to_list(includes)]
- def _generate_pcfile(self, name, use, env, outfilename):
+ def _generate_pcfile(self, name, use, env, outfilename, module):
outfile = open(outfilename, 'wt')
prefix = env.PREFIX
includedir = Utils.subst_vars('${INCLUDEDIR}/%s%s' % (wutils.APPNAME, wutils.VERSION), env)
@@ -398,6 +398,10 @@ class ns3pcfile_task(Task.Task):
for dep in env.LIBS:
libs += self.env['LIB_ST'] % dep
cflags = [self.env['CPPPATH_ST'] % '${includedir}']
+
+ if getattr(module, 'export_includes', None):
+ for include in module.to_incnodes(module.export_includes):
+ cflags += [self.env['CPPPATH_ST'] % include.abspath()]
requires = []
for dep in use:
cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \
@@ -424,7 +428,7 @@ Requires: %s\
output_filename = self.outputs[0].abspath()
self._generate_pcfile(self.module.name,
self.module.to_list(self.module.use),
- self.env, output_filename)
+ self.env, output_filename, self.module)
@TaskGen.feature('ns3pcfile')
I pushed the above patch to ns-3-dev in 13392:ddd44291f7b3; leaving open for the contrib/ code duplication. Created attachment 3078 [details]
patch to remove code duplication in contrib/wscript
I was able to reduce some of the duplicated code, including what I think was bothering you. Would you mind testing this patch?
It was creating a bit of a problem with my pcfile customization. I checked, with the patch, everything seem to work properly.
I suggest one more small patch, that not directly related (removing \n in task description in a few places):
diff --git a/src/wscript b/src/wscript
index 5997e8038..1b004ef60 100644
--- a/src/wscript
+++ b/src/wscript
@@ -336,7 +336,7 @@ class ns3pcfile_task(Task.Task):
def __str__(self):
"string to display to the user"
tgt_str = ' '.join([a.bldpath() for a in self.outputs])
- return 'pcfile: %s\n' % (tgt_str)
+ return 'pcfile: %s' % (tgt_str)
def runnable_status(self):
return super(ns3pcfile_task, self).runnable_status()
diff --git a/waf-tools/command.py b/waf-tools/command.py
index e47a6043c..dcfb6af9f 100644
--- a/waf-tools/command.py
+++ b/waf-tools/command.py
@@ -31,7 +31,7 @@ class command_task(Task.Task):
pipeline = shellcmd.Pipeline()
pipeline.parse(self.generator.command)
cmd = pipeline.get_abbreviated_command()
- return 'command (%s): %s%s%s\n' % (cmd, src_str, sep, tgt_str)
+ return 'command (%s): %s%s%s' % (cmd, src_str, sep, tgt_str)
def _subst_arg(self, arg, direction, namespace):
"""
fixed in changesets 13411 and 13412:6ff8a70148e0 |