Sha256: 2a5ca5100b36fd613947b85c684bed07b75915fff96e6001e0acf3a1d2e156b2

Contents?: true

Size: 995 Bytes

Versions: 2

Compression:

Stored size: 995 Bytes

Contents

# frozen_string_literal: true

require "mkmf"

have_header("unistd.h")

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

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

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

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

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

$defs << "-DHAVE_SYS_RESOURCE_H" if have_header("sys/resource.h")

CONFIG["optflags"] << " -fno-strict-aliasing"

dir_config "nio4r_ext"
create_makefile "nio4r_ext"

# win32 needs to link in "just the right order" for some reason or
# ioctlsocket will be mapped to an [inverted] ruby specific version.
if RUBY_PLATFORM =~ /mingw|win32/
  makefile_contents = File.read "Makefile"

  makefile_contents.gsub! "DLDFLAGS = ", "DLDFLAGS = -export-all "

  makefile_contents.gsub! "LIBS = $(LIBRUBYARG_SHARED)", "LIBS = -lws2_32 $(LIBRUBYARG_SHARED)"
  File.open("Makefile", "w") { |f| f.write makefile_contents }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nio4r-2.1.0-java ext/nio4r/extconf.rb
nio4r-2.1.0 ext/nio4r/extconf.rb