From 5efc579f76b30a0f2503e5e525676516a4cf956b Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Mon, 9 Aug 2010 22:15:10 -0700 Subject: [PATCH] brew doctor - add libiconv check --- Library/Homebrew/brew_doctor.rb | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb index 204337754d..fae8939b02 100644 --- a/Library/Homebrew/brew_doctor.rb +++ b/Library/Homebrew/brew_doctor.rb @@ -310,8 +310,9 @@ def check_pkg_config_paths end def check_for_gettext - if File.exist? "#{HOMEBREW_PREFIX}/lib/libgettextlib.dylib" or - File.exist? "#{HOMEBREW_PREFIX}/lib/libintl.dylib" + if %w[lib/libgettextlib.dylib + lib/libintl.dylib + include/libintl.h ].any? { |f| File.exist? "#{HOMEBREW_PREFIX}/#{f}" } puts <<-EOS.undent gettext was detected in your PREFIX. @@ -322,6 +323,26 @@ def check_for_gettext otherwise have a `depends_on 'gettext'` will pick up gettext anyway during the `./configure` step. + If you have a non-Homebrew provided gettext, other problems will happen + especially if it wasn't compiled with the proper architectures. + + EOS + end +end + +def check_for_iconv + if %w[lib/libiconv.dylib + include/iconv.h ].any? { |f| File.exist? "#{HOMEBREW_PREFIX}/#{f}" } + puts <<-EOS.undent + libiconv was detected in your PREFIX. + + Homebrew doesn't provide a libiconv formula, and expects to link against + the system version in /usr/lib. + + If you have a non-Homebrew provided libiconv, many formulae will fail + to compile or link, especially if it wasn't compiled with the proper + architectures. + EOS end end