Fix linking source-relative files (bug 6038, r=ds).
Fix linking source-relative files (
bug 6038, r=ds).
1.1 --- a/ambuild2/frontend/amb2/gen.py Fri Feb 07 22:54:58 2014 -0800
1.2 +++ b/ambuild2/frontend/amb2/gen.py Fri Feb 07 23:41:55 2014 -0800
1.3 @@ -567,7 +567,7 @@
1.4 elif util.IsLambda(val.node):
1.5 item = val.node(context, binary)
1.6 elif val.node is None:
1.7 - item = val.text
1.8 + item = self.parseInput(context, val.text).path
1.9 else:
1.10 item = val.node
1.11
2.1 --- a/ambuild2/frontend/cpp.py Fri Feb 07 22:54:58 2014 -0800
2.2 +++ b/ambuild2/frontend/cpp.py Fri Feb 07 23:41:55 2014 -0800
2.3 @@ -371,6 +371,10 @@
2.4
2.5 def linkFlag(self, cx, item):
2.6 if type(item) is Dep:
2.7 + # If the dep is a file dependency (no node attached), and has a relative
2.8 + # path, make it absolute so the linker knows where to look.
2.9 + if item.node is None and not os.path.isabs(item.text):
2.10 + return os.path.join(cx.currentSourcePath, item.text)
2.11 return item.text
2.12
2.13 if hasattr(item, 'path'):