aboutsummaryrefslogtreecommitdiffstats
path: root/tools/asn2wrs.py
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2013-09-05 07:38:32 +0000
committerJörg Mayer <jmayer@loplof.de>2013-09-05 07:38:32 +0000
commit8b842aeb0282cd83640f0c95c1ba3636b66ff4a5 (patch)
tree50394964d721de40e7c3761d756b3bff7f2f629a /tools/asn2wrs.py
parent854363611c67e355dc3cc01147c87cb7d71284c2 (diff)
Adapt generated output to always print paths relative to
the asn1/<proto>/ subdir. This makes cmake generated builds look identical to autotools generated builds. svn path=/trunk/; revision=51775
Diffstat (limited to 'tools/asn2wrs.py')
-rwxr-xr-xtools/asn2wrs.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index 0ee8c9ae1e..75b5830936 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -2914,7 +2914,14 @@ class EthOut:
out += self.outcomment(' '.join(sys.argv), comment)
out += '\n'
# Make Windows path separator look like Unix path separator
- return out.replace('\\', '/')
+ out = out.replace('\\', '/')
+ # Change abolute paths from cmake builds to relative paths as used
+ # in autotools for identical output of both build systems.
+ out = re.sub(r'(/[^ ]*/tools/)', '../../tools/', out)
+ out = re.sub(r'(/[^ ]*/epan/)', '../../epan/', out)
+ out = re.sub(r'(/[^ ]*/asn1/[^\s/]*)', '.', out)
+ out = re.sub(r'(/[^ ]*/asn1/[^\s]/)', './', out)
+ return out
#--- dbg_print -------------------------------------------------------
def dbg_print(self):