diff options
author | thakis@chromium.org <thakis@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2012-02-10 00:17:47 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@78cadc50-ecff-11dd-a971-7dbc132099af> | 2012-02-10 00:17:47 +0000 |
commit | 044fbe1c263aef9b29e85fefca1672d530717fa7 (patch) | |
tree | 7df8765b56d5b5e6447f623b6590706b2015fc9f /pylib | |
parent | d197d57c5cc7d3271acd24a0af4618ea3d03189a (diff) | |
download | gyp-044fbe1c263aef9b29e85fefca1672d530717fa7.tar.gz |
ninja/mac, make/mac: Strip useless libtool output.
Review URL: https://chromiumcodereview.appspot.com/9370035
git-svn-id: http://gyp.googlecode.com/svn/trunk@1194 78cadc50-ecff-11dd-a971-7dbc132099af
Diffstat (limited to 'pylib')
-rw-r--r-- | pylib/gyp/generator/make.py | 2 | ||||
-rw-r--r-- | pylib/gyp/generator/ninja.py | 4 | ||||
-rwxr-xr-x | pylib/gyp/mac_tool.py | 14 |
3 files changed, 16 insertions, 4 deletions
diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 1baa034c..e93cb033 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -156,7 +156,7 @@ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE LINK_COMMANDS_MAC = """\ quiet_cmd_alink = LIBTOOL-STATIC $@ -cmd_alink = rm -f $@ && libtool -static -o $@ $(filter %.o,$^) +cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool -static -o $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py index b0b6e539..ea84ca11 100644 --- a/pylib/gyp/generator/ninja.py +++ b/pylib/gyp/generator/ninja.py @@ -1072,7 +1072,9 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, master_ninja.rule( 'alink', description='LIBTOOL-STATIC $out, POSTBUILDS', - command='rm -f $out && libtool -static -o $out $in$postbuilds') + command='rm -f $out && ' + './gyp-mac-tool filter-libtool libtool -static -o $out $in' + '$postbuilds') # TODO(thakis): The solink_module rule is likely wrong. Xcode seems to pass # -bundle -single_module here (for osmesa.so). master_ninja.rule( diff --git a/pylib/gyp/mac_tool.py b/pylib/gyp/mac_tool.py index 5ba157af..d5f8ed28 100755 --- a/pylib/gyp/mac_tool.py +++ b/pylib/gyp/mac_tool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2011 Google Inc. All rights reserved. +# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -8,9 +8,10 @@ These functions are executed via gyp-mac-tool when using the Makefile generator. """ -import os import fcntl +import os import plistlib +import re import shutil import string import subprocess @@ -151,6 +152,15 @@ class MacTool(object): fcntl.flock(fd, fcntl.LOCK_EX) return subprocess.call(cmd_list) + def ExecFilterLibtool(self, *cmd_list): + """Calls libtool and filters out 'libtool: file: foo.o has no symbols'.""" + libtool_re = re.compile(r'^libtool: file: .* has no symbols$') + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) + for line in libtoolout.stderr: + if not libtool_re.match(line): + print >> sys.stderr, line + return libtoolout.returncode + def ExecPackageFramework(self, framework, version): """Takes a path to Something.framework and the Current version of that and sets up all the symlinks.""" |