aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMisty De Meo2013-10-08 09:03:17 -0700
committerMisty De Meo2013-10-08 09:04:21 -0700
commita5f68bb874bdf06decdae38ddde776e7c2cb31c7 (patch)
tree09110975a0cc0448bca7fa99740f80cd67950d00 /Library
parent01901314e9303ddb40b391d7fab781c5de032371 (diff)
downloadbrew-a5f68bb874bdf06decdae38ddde776e7c2cb31c7.tar.bz2
detect_cxx_stdlibs: Only detect for dylibs
Fixes Homebrew/homebrew#23115.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index 3b37ccf26..c9ff7b4bc 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -43,12 +43,18 @@ class Keg
end
# Detects the C++ dynamic libraries in place, scanning the dynamic links
- # of the files within the keg.
+ # of the files within the keg. This searches only libs contained within
+ # lib/, and ignores binaries and other mach-o objects
# Note that this doesn't attempt to distinguish between libstdc++ versions,
# for instance between Apple libstdc++ and GNU libstdc++
def detect_cxx_stdlibs
+ return [] unless lib.exist?
+
results = Set.new
- mach_o_files.each do |file|
+ lib.find do |file|
+ next if file.symlink? || file.directory?
+ next unless file.dylib?
+
dylibs = file.dynamically_linked_libraries
results << :libcxx unless dylibs.grep(/libc\+\+.+\.dylib/).empty?
results << :libstdcxx unless dylibs.grep(/libstdc\+\+.+\.dylib/).empty?