diff options
-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.""" |