OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
2 | 5 |
3 """Rewrites paths in -I, -L and other option to be relative to a sysroot.""" | 6 """Rewrites paths in -I, -L and other option to be relative to a sysroot.""" |
4 | 7 |
5 import sys | 8 import sys |
6 import os | 9 import os |
7 | 10 |
8 REWRITE_PREFIX = ['-I', | 11 REWRITE_PREFIX = ['-I', |
9 '-idirafter', | 12 '-idirafter', |
10 '-imacros', | 13 '-imacros', |
11 '-imultilib', | 14 '-imultilib', |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) | 55 sys.stderr.write('usage: %s /path/to/sysroot\n' % argv[0]) |
53 return 1 | 56 return 1 |
54 | 57 |
55 for line in sys.stdin.readlines(): | 58 for line in sys.stdin.readlines(): |
56 line = RewriteLine(line.strip(), sysroot) | 59 line = RewriteLine(line.strip(), sysroot) |
57 print line | 60 print line |
58 return 0 | 61 return 0 |
59 | 62 |
60 if __name__ == '__main__': | 63 if __name__ == '__main__': |
61 sys.exit(main(sys.argv)) | 64 sys.exit(main(sys.argv)) |
OLD | NEW |