diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 3eb04a5057c92f57097b5ba71e642ebfed33efd1..df33b35e0dae8c3fdb40362aac7221690f367378 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -635,31 +635,25 @@ def check_for_config_scripts end end -def check_for_DYLD_LIBRARY_PATH - if ENV['DYLD_LIBRARY_PATH'] - <<-EOS.undent - Setting DYLD_LIBRARY_PATH can break dynamic linking. - You should probably unset it. - EOS - end -end - -def check_for_DYLD_FALLBACK_LIBRARY_PATH - if ENV['DYLD_FALLBACK_LIBRARY_PATH'] - <<-EOS.undent - Setting DYLD_FALLBACK_LIBRARY_PATH can break dynamic linking. - You should probably unset it. +def check_DYLD_vars + found = ENV.keys.grep(/^DYLD_/) + unless found.empty? + s = <<-EOS.undent + Setting DYLD_* vars can break dynamic linking. + Set variables: EOS - end -end + found.each do |e| + s << " #{e}\n" + end + if found.include? 'DYLD_INSERT_LIBRARIES' + s += <<-EOS.undent -def check_for_DYLD_INSERT_LIBRARIES - if ENV['DYLD_INSERT_LIBRARIES'] - <<-EOS.undent Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail. Having this set is common if you use this software: http://asepsis.binaryage.com/ - EOS + EOS + end + s end end