Skip to content

Commit

Permalink
Added warning for partial installations.
Browse files Browse the repository at this point in the history
  • Loading branch information
baror committed Dec 7, 2009
1 parent 9885720 commit c5eb0ac
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ext/RMagick/extconf.rb
Expand Up @@ -73,6 +73,27 @@ def check_multiple_imagemagick_versions()
end


# Ubuntu (maybe other systems) comes with a partial installation of
# ImageMagick in the prefix /usr (some libraries, no includes, and no
# binaries). This causes problems when /usr/lib is in the path (e.g., using
# the default Ruby installation).
def check_partial_imagemagick_versions()
prefix = config_string("prefix")
matches = [
prefix+"/lib/lib?agick*",
prefix+"/include/ImageMagick",
prefix+"/bin/Magick-config",
].map do |file_glob|
Dir.glob(file_glob)
end
matches.delete_if { |arr| arr.empty? }
if 0 < matches.length and matches.length < 3
msg = "\nWarning: Found a partial ImageMagick installation. Your operating system likely has some built-in ImageMagick libraries but not all of ImageMagick. This will most likely cause problems at both compile and runtime.\nFound partial installation at: "+prefix+"\n"
Logging::message msg
message msg
end
end



if RUBY_PLATFORM =~ /mswin/
Expand Down Expand Up @@ -115,6 +136,7 @@ def check_multiple_imagemagick_versions()
end

check_multiple_imagemagick_versions()
check_partial_imagemagick_versions()

# Ensure minimum ImageMagick version
unless checking_for("ImageMagick version >= #{MIN_IM_VERS}") do
Expand Down

0 comments on commit c5eb0ac

Please sign in to comment.