### Home Classes Methods

### In Files

- ext/RMagick/extconf.rb

### Parent

BasicObject

### Methods

- #check_multiple_imagemagick_versions
- #check_partial_imagemagick_versions
- #exit_failure
- #have_enum_value
- #have_enum_values

### Files

- MANIFEST
- Makefile

### Class/Module Index

Quicksearch

- Magick
- Magick::DestroyedImageError
- Magick::Draw
- Magick::Enum
- Magick::FatalImageMagickError
- Magick::Geometry
- Magick::GeometryValue
- Magick::GradientFill
- Magick::HatchFill
- Magick::IPTC
- Magick::IPTC::Application
- Magick::IPTC::Envelope
- Magick::IPTC::ObjectData
- Magick::IPTC::Post_ObjectData_Descriptor
- Magick::IPTC::Pre_ObjectData_Descriptor
- Magick::Image
- Magick::Image::DrawOptions
- Magick::Image::Info
- Magick::Image::PolaroidOptions
- Magick::Image::View
- Magick::Image::View::Pixels
- Magick::Image::View::Rows
- Magick::ImageList
- Magick::ImageList::Montage
- Magick::ImageMagickError
- Magick::OptionalMethodArguments
- Magick::Pixel
- Magick::RVG
- Magick::RVG::Circle
- Magick::RVG::ClipPath
- Magick::RVG::Describable
- Magick::RVG::Duplicatable
- Magick::RVG::Ellipse
- Magick::RVG::Embellishable
- Magick::RVG::Group
- Magick::RVG::Image
- Magick::RVG::ImageConstructors
- Magick::RVG::Line
- Magick::RVG::Path
- Magick::RVG::PathData
- Magick::RVG::Pattern
- Magick::RVG::PolyShape
- Magick::RVG::Polygon
- Magick::RVG::Polyline
- Magick::RVG::PreserveAspectRatio
- Magick::RVG::Rect
- Magick::RVG::ShapeConstructors
- Magick::RVG::Stretchable
- Magick::RVG::StructureConstructors
- Magick::RVG::Stylable
- Magick::RVG::Text
- Magick::RVG::TextBase
- Magick::RVG::TextConstructors
- Magick::RVG::Transformable
- Magick::RVG::Use
- Magick::RVG::UseConstructors
- Magick::RVG::Utility
- Magick::RVG::Utility::DefaultTextStrategy
- Magick::RVG::Utility::GraphicContext
- Magick::RVG::Utility::LRTextStrategy
- Magick::RVG::Utility::RLTextStrategy
- Magick::RVG::Utility::TBTextStrategy
- Magick::RVG::Utility::TextAttributes
- Magick::RVG::Utility::TextStrategy
- Magick::TextureFill
- Object

No matching classes.

# Object

### Constants

MIN_IM_VERS
MIN_IM_VERS_NO
MIN_RUBY_VERS
MIN_RUBY_VERS_NO
RMAGICK_VERS
SUMMARY

### Public Instance Methods

check_multiple_imagemagick_versions() click to toggle source

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

    # 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

check_partial_imagemagick_versions() click to toggle source

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
    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

exit_failure(msg) click to toggle source

    # 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) click to toggle source

Test for a specific value in an enum type

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

have_enum_values(enum, values, headers=nil, &b) click to toggle source

Test for multiple values of the same enum type

    # 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.