Top Level Namespace

Defined Under Namespace

Modules: Magick

Constant Summary collapse

RMAGICK_VERS =
"2.10.0"
MIN_RUBY_VERS =
"1.8.5"
MIN_RUBY_VERS_NO =
MIN_RUBY_VERS.tr(".","").to_i
MIN_IM_VERS =
"6.3.5"
MIN_IM_VERS_NO =
MIN_IM_VERS.tr(".","").to_i
SUMMARY =
<<"END_SUMMARY"


#{"=" * 70}
#{DateTime.now.strftime("%a %d%b%y %T")}
This installation of RMagick #{RMAGICK_VERS} is configured for
Ruby #{RUBY_VERSION} (#{RUBY_PLATFORM}) and ImageMagick #{$magick_version}
#{"=" * 70}


END_SUMMARY

Instance Method Summary collapse

Instance Method Details

#check_multiple_imagemagick_versionsObject

Seems like lots of people have multiple versions of ImageMagick installed.


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'ext/RMagick/extconf.rb', line 52

def check_multiple_imagemagick_versions()
   versions = []
   path = ENV['PATH'].split(File::PATH_SEPARATOR)
   path.each do |dir|
      file = File.join(dir, "Magick-config")
      if File.executable? file
         vers = `#{file} --version`.chomp.strip
         prefix = `#{file} --prefix`.chomp.strip
         versions << [vers, prefix, dir]
      end
   end
   versions.uniq!
   if versions.size > 1
      msg = "\nWarning: Found more than one ImageMagick installation. This could cause problems at runtime.\n"
      versions.each do |vers, prefix, dir|
         msg << "         #{dir}/Magick-config reports version #{vers} is installed in #{prefix}\n"
      end
      msg << "Using #{versions[0][0]} from #{versions[0][1]}.\n\n"
      Logging::message msg
      message msg
   end
end

#exit_failure(msg) ⇒ Object


42
43
44
45
46
# File 'ext/RMagick/extconf.rb', line 42

def exit_failure(msg)
  Logging::message msg
  message msg+"\n"
  exit(1)
end

#have_enum_value(enum, value, headers = nil, &b) ⇒ Object

Test for a specific value in an enum type


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'ext/RMagick/extconf.rb', line 13

def have_enum_value(enum, value, headers=nil, &b)
  checking_for "#{enum}.#{value}" do
    if try_compile(<<"SRC", &b)
#{COMMON_HEADERS}
#{cpp_include(headers)}
/*top*/
int main() { #{enum} t = #{value}; t = t; return 0; }
SRC
      $defs.push(format("-DHAVE_ENUM_%s", value.upcase))
      true
    else
      false
    end
  end
end

#have_enum_values(enum, values, headers = nil, &b) ⇒ Object

Test for multiple values of the same enum type


33
34
35
36
37
# File 'ext/RMagick/extconf.rb', line 33

def have_enum_values(enum, values, headers=nil, &b)
  values.each do |value|
    have_enum_value(enum, value, headers, &b)
  end
end