diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 61a7004568..4017f73ee3 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -89,6 +89,30 @@ def check_for_stray_static_libs puts end +def check_for_stray_pcs + unbrewed_pcs = Dir['/usr/local/lib/pkgconfig/*.pc'].select { |f| File.file? f and not File.symlink? f } + + # Package-config files which are generally OK should be added to this list, + # with a short description of the software they come with. + white_list = { + "fuse.pc" => "MacFuse", + } + + bad_pcs = unbrewed_pcs.reject {|d| white_list.key? File.basename(d) } + return if bad_pcs.empty? + + puts <<-EOS.undent + Unbrewed .pc files were found in /usr/local/lib/pkgconfig. + + If you didn't put them there on purpose they could cause problems when + building Homebrew formulae, and may need to be deleted. + + Unexpected .pc files: + EOS + puts *bad_pcs.collect { |f| " #{f}" } + puts +end + def check_for_x11 unless x11_installed? puts <<-EOS.undent @@ -628,6 +652,7 @@ module Homebrew extend self check_for_macgpg2 check_for_stray_dylibs check_for_stray_static_libs + check_for_stray_pcs check_gcc_versions check_for_other_package_managers check_for_x11