Seems like lots of people have multiple versions of ImageMagick installed.
# File ext/RMagick/extconf.rb, line 52
52: def check_multiple_imagemagick_versions()
53: versions = []
54: path = ENV['PATH'].split(File::PATH_SEPARATOR)
55: path.each do |dir|
56: file = File.join(dir, "Magick-config")
57: if File.executable? file
58: vers = `#{file} --version`.chomp.strip
59: prefix = `#{file} --prefix`.chomp.strip
60: versions << [vers, prefix, dir]
61: end
62: end
63: versions.uniq!
64: if versions.size > 1
65: msg = "\nWarning: Found more than one ImageMagick installation. This could cause problems at runtime.\n"
66: versions.each do |vers, prefix, dir|
67: msg << " #{dir}/Magick-config reports version #{vers} is installed in #{prefix}\n"
68: end
69: msg << "Using #{versions[0][0]} from #{versions[0][1]}.\n\n"
70: Logging::message msg
71: message msg
72: end
73: 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).
# File ext/RMagick/extconf.rb, line 80
80: def check_partial_imagemagick_versions()
81: prefix = config_string("prefix")
82: matches = [
83: prefix+"/lib/lib?agick*",
84: prefix+"/include/ImageMagick",
85: prefix+"/bin/Magick-config",
86: ].map do |file_glob|
87: Dir.glob(file_glob)
88: end
89: matches.delete_if { |arr| arr.empty? }
90: if 0 < matches.length and matches.length < 3
91: 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"
92: Logging::message msg
93: message msg
94: end
95: end
# File ext/RMagick/extconf.rb, line 42
42: def exit_failure(msg)
43: Logging::message msg
44: message msg+"\n"
45: exit(1)
46: end
Test for a specific value in an enum type
# File ext/RMagick/extconf.rb, line 13
13: def have_enum_value(enum, value, headers=nil, &b)
14: checking_for "#{enum}.#{value}" do
15: if try_compile(#{COMMON_HEADERS}#{cpp_include(headers)}/*top*/int main() { #{enum} t = #{value}; t = t; return 0; }, &b)
16: $defs.push(format("-DHAVE_ENUM_%s", value.upcase))
17: true
18: else
19: false
20: end
21: end
22: end
Test for multiple values of the same enum type
# File ext/RMagick/extconf.rb, line 33
33: def have_enum_values(enum, values, headers=nil, &b)
34: values.each do |value|
35: have_enum_value(enum, value, headers, &b)
36: end
37: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.