diff options
| author | Misty De Meo | 2013-10-08 09:03:17 -0700 |
|---|---|---|
| committer | Misty De Meo | 2013-10-08 09:04:21 -0700 |
| commit | a5f68bb874bdf06decdae38ddde776e7c2cb31c7 (patch) | |
| tree | 09110975a0cc0448bca7fa99740f80cd67950d00 | |
| parent | 01901314e9303ddb40b391d7fab781c5de032371 (diff) | |
| download | brew-a5f68bb874bdf06decdae38ddde776e7c2cb31c7.tar.bz2 | |
detect_cxx_stdlibs: Only detect for dylibs
Fixes Homebrew/homebrew#23115.
| -rw-r--r-- | Library/Homebrew/keg_fix_install_names.rb | 10 |
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? |
