Sha256: d1681fb9c2e3756780cda63c1f566f9f1bbe064200a789ba244bda9898e58466

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

#----------------------------------
# extconf.rb
# $Revision: $
# $Date: $
#----------------------------------
require 'mkmf'

class Path

  def initialize()
    if File::ALT_SEPARATOR.nil?
      @file_separator = File::SEPARATOR
    else
      @file_separator = File::ALT_SEPARATOR
    end
  end

  def include(parent, child)
    inc = joint(parent, child)
    $INCFLAGS += " -I#{inc}"
    $CFLAGS += " -I#{inc}"
    inc
  end

  def joint(parent, child)
    parent + @file_separator + child
  end

end

javahome = ENV['JAVA_HOME']
if !javahome.nil?
  p = Path.new
  inc = p.include(javahome, 'include')
  Dir.open(inc).each do |d|
    next if d[0] == ?.
    if File.directory?(p.joint(inc, d))
      p.include(inc, d)
      break
    end
  end
end

def create_rjb_makefile
  if have_header("jni.h")
    have_func("locale_charset", "iconv.h")
    have_func("nl_langinfo", "langinfo.h")
    have_func("setlocale", "locale.h")
    have_func("getenv")
    create_header
    create_makefile("rjbcore")
  end
end

case RUBY_PLATFORM
when /mswin32/
  $CFLAGS += ' /W3'
when /cygwin/, /mingw/
  $defs << '-DNONAMELESSUNION'
end
create_rjb_makefile

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rjb-1.0.11 ext/extconf.rb