Sha256: 46617b90e9c5d2e4a512a664ded0dd3627b733a7cec901e4d033921cb590a135

Contents?: true

Size: 1.78 KB

Versions: 27

Compression:

Stored size: 1.78 KB

Contents

require 'mkmf'

libs = []

$defs << "-DRUBY_VERSION_CODE=#{RUBY_VERSION.gsub(/\D/, '')}"

have_func('rb_thread_blocking_region')
have_func('rb_thread_call_without_gvl')
have_func('rb_thread_alone')
have_func('rb_str_set_len')
have_library('rt', 'clock_gettime')

if have_header('sys/select.h')
  $defs << '-DEV_USE_SELECT'
end

if have_header('poll.h')
  $defs << '-DEV_USE_POLL'
end

if have_header('sys/epoll.h')
  $defs << '-DEV_USE_EPOLL'
end

if have_header('sys/event.h') and have_header('sys/queue.h')
  $defs << '-DEV_USE_KQUEUE'
end

if have_header('port.h')
  $defs << '-DEV_USE_PORT'
end

have_header('sys/resource.h')

# ncpu detection specifics
case RUBY_PLATFORM
when /linux/
  $defs << '-DHAVE_LINUX_PROCFS'
else
  if have_func('sysctlbyname', ['sys/param.h', 'sys/sysctl.h'])
    $defs << '-DHAVE_SYSCTLBYNAME'
  end
end

if RUBY_PLATFORM =~ /solaris/
  # libev/ev.c requires NSIG which is undefined if _XOPEN_SOURCE is defined
  $defs << '-D__EXTENSIONS__'
end

$LIBS << ' ' << libs.join(' ')

dir_config('cool.io_ext')
create_makefile('cool.io_ext')

# win32 needs to link in "just the right order" for some reason or  ioctlsocket will be mapped to an [inverted] ruby specific version.  See libev mailing list for (not so helpful discussion--true cause I'm not sure, but this overcomes the symptom)
if RUBY_PLATFORM =~ /mingw|mswin/
  makefile_contents = File.read 'Makefile'

  # "Init_cool could not be found" when loading cool.io.so.
  # I'm not sure why this is needed. But this line causes "1114 A dynamic link library (DLL) initialization routine failed." So I commented out this line.
  #makefile_contents.gsub! 'DLDFLAGS = ', 'DLDFLAGS = -export-all '

  makefile_contents.gsub! /LIBS = (.*) (\S*ws2_32\S*)/i, 'LIBS = \\2 \\1'
  File.open('Makefile', 'w') { |f| f.write makefile_contents }
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
cool.io-1.6.0-x64-mingw32 ext/cool.io/extconf.rb
cool.io-1.6.0-x86-mingw32 ext/cool.io/extconf.rb
cool.io-1.6.0 ext/cool.io/extconf.rb
cool.io-1.5.4-x64-mingw32 ext/cool.io/extconf.rb
cool.io-1.5.4-x86-mingw32 ext/cool.io/extconf.rb
cool.io-1.5.4 ext/cool.io/extconf.rb
cool.io-1.5.3-x86-mingw32 ext/cool.io/extconf.rb
cool.io-1.5.3-x64-mingw32 ext/cool.io/extconf.rb
cool.io-1.5.3 ext/cool.io/extconf.rb
cool.io-1.5.2 ext/cool.io/extconf.rb
cool.io-1.5.1 ext/cool.io/extconf.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/cool.io-1.5.0/ext/cool.io/extconf.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/cool.io-1.5.0/ext/cool.io/extconf.rb
cool.io-1.5.0 ext/cool.io/extconf.rb
cool.io-1.4.6-x86-mingw32 ext/cool.io/extconf.rb
cool.io-1.4.6-x64-mingw32 ext/cool.io/extconf.rb
cool.io-1.4.6 ext/cool.io/extconf.rb
cool.io-1.4.5 ext/cool.io/extconf.rb
cool.io-1.4.5-x86-mingw32 ext/cool.io/extconf.rb
cool.io-1.4.5-x64-mingw32 ext/cool.io/extconf.rb