OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2015 Google Inc. All rights reserved. | 3 # Copyright (c) 2015 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies duplicate ldflags are not removed. | 8 Verifies duplicate ldflags are not removed. |
9 """ | 9 """ |
10 | 10 |
| 11 from __future__ import print_function |
| 12 |
11 import sys | 13 import sys |
12 | 14 |
13 def CheckContainsFlags(args, substring): | 15 def CheckContainsFlags(args, substring): |
14 if args.find(substring) is -1: | 16 if args.find(substring) is -1: |
15 print 'ERROR: Linker arguments "%s" are missing in "%s"' % (substring, args) | 17 print('ERROR: Linker arguments "%s" are missing in "%s"' % (substring, args)
) |
16 return False; | 18 return False; |
17 return True; | 19 return True; |
18 | 20 |
19 if __name__ == '__main__': | 21 if __name__ == '__main__': |
20 args = " ".join(sys.argv) | 22 args = " ".join(sys.argv) |
21 print "args = " +args | 23 print("args = " +args) |
22 if not CheckContainsFlags(args, 'lib1.a -Wl,--no-whole-archive') \ | 24 if not CheckContainsFlags(args, 'lib1.a -Wl,--no-whole-archive') \ |
23 or not CheckContainsFlags(args, 'lib2.a -Wl,--no-whole-archive'): | 25 or not CheckContainsFlags(args, 'lib2.a -Wl,--no-whole-archive'): |
24 sys.exit(1); | 26 sys.exit(1); |
25 sys.exit(0) | 27 sys.exit(0) |
OLD | NEW |