Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: pylib/gyp/mac_tool.py

Issue 26912003: Fix warning linking static libraries on OS X 10.9 (Closed) Base URL: https://chromium.googlesource.com/external/gyp@master
Patch Set: Update comment Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Utility functions to perform Xcode-style build steps. 6 """Utility functions to perform Xcode-style build steps.
7 7
8 These functions are executed via gyp-mac-tool when using the Makefile generator. 8 These functions are executed via gyp-mac-tool when using the Makefile generator.
9 """ 9 """
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 fp.close() 193 fp.close()
194 194
195 def ExecFlock(self, lockfile, *cmd_list): 195 def ExecFlock(self, lockfile, *cmd_list):
196 """Emulates the most basic behavior of Linux's flock(1).""" 196 """Emulates the most basic behavior of Linux's flock(1)."""
197 # Rely on exception handling to report errors. 197 # Rely on exception handling to report errors.
198 fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) 198 fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666)
199 fcntl.flock(fd, fcntl.LOCK_EX) 199 fcntl.flock(fd, fcntl.LOCK_EX)
200 return subprocess.call(cmd_list) 200 return subprocess.call(cmd_list)
201 201
202 def ExecFilterLibtool(self, *cmd_list): 202 def ExecFilterLibtool(self, *cmd_list):
203 """Calls libtool and filters out 'libtool: file: foo.o has no symbols'.""" 203 """Calls libtool and filters out '/path/to/libtool: file: foo.o has no
204 libtool_re = re.compile(r'^libtool: file: .* has no symbols$') 204 symbols'."""
205 libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$')
205 libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) 206 libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE)
206 _, err = libtoolout.communicate() 207 _, err = libtoolout.communicate()
207 for line in err.splitlines(): 208 for line in err.splitlines():
208 if not libtool_re.match(line): 209 if not libtool_re.match(line):
209 print >>sys.stderr, line 210 print >>sys.stderr, line
210 return libtoolout.returncode 211 return libtoolout.returncode
211 212
212 def ExecPackageFramework(self, framework, version): 213 def ExecPackageFramework(self, framework, version):
213 """Takes a path to Something.framework and the Current version of that and 214 """Takes a path to Something.framework and the Current version of that and
214 sets up all the symlinks.""" 215 sets up all the symlinks."""
(...skipping 26 matching lines...) Expand all
241 def _Relink(self, dest, link): 242 def _Relink(self, dest, link):
242 """Creates a symlink to |dest| named |link|. If |link| already exists, 243 """Creates a symlink to |dest| named |link|. If |link| already exists,
243 it is overwritten.""" 244 it is overwritten."""
244 if os.path.lexists(link): 245 if os.path.lexists(link):
245 os.remove(link) 246 os.remove(link)
246 os.symlink(dest, link) 247 os.symlink(dest, link)
247 248
248 249
249 if __name__ == '__main__': 250 if __name__ == '__main__':
250 sys.exit(main(sys.argv[1:])) 251 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698