Module: GD2::GD2FFI

Extended by:
FFI::Library
Defined in:
lib/gd2-ffij.rb

Class Method Summary collapse

Class Method Details

.gd_library_nameObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gd2-ffij.rb', line 30

def self.gd_library_name
  if ENV['GD2_LIBRARY_PATH']
    ENV['GD2_LIBRARY_PATH']
  else
    lib = case Config::CONFIG['arch']
    when /darwin/
      [ '/usr/lib', '/usr/local/lib', '/opt/local/lib' ].detect { |path|
        File.exists?("#{path}/libgd.2.dylib")
      }.to_s + '/libgd.2.dylib'
    when /mswin32/, /cygwin/
      'bgd.dll'
    else
      'libgd.so.2'
    end
  end
end