Sha256: d77c32249d43d4383b46c1577a169b7f5c8a2415c233e7c7ba8aa948cad61334

Contents?: true

Size: 1.28 KB

Versions: 16

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require 'rubygems'
require 'mkmf'

use_liburing = false
force_use_libev = ENV['POLYPHONY_USE_LIBEV'] != nil

if !force_use_libev && RUBY_PLATFORM =~ /linux/ && `uname -sr` =~ /Linux 5\.([\d+])/
  kernel_minor_version = $1.gsub('.', '').to_i
  use_liburing = kernel_minor_version >= 6
end

if use_liburing
  $defs << "-DPOLYPHONY_BACKEND_LIBURING"
  $CFLAGS << " -Wno-pointer-arith"
else
  $defs << "-DPOLYPHONY_BACKEND_LIBEV"
  $defs << '-DEV_USE_LINUXAIO'     if have_header('linux/aio_abi.h')
  $defs << '-DEV_USE_SELECT'       if have_header('sys/select.h')
  $defs << '-DEV_USE_POLL'         if have_type('port_event_t', 'poll.h')
  $defs << '-DEV_USE_EPOLL'        if have_header('sys/epoll.h')
  $defs << '-DEV_USE_KQUEUE'       if have_header('sys/event.h') && have_header('sys/queue.h')
  $defs << '-DEV_USE_PORT'         if have_type('port_event_t', 'port.h')
  $defs << '-DHAVE_SYS_RESOURCE_H' if have_header('sys/resource.h')  
  $CFLAGS << " -Wno-comment"
  $CFLAGS << " -Wno-unused-result"
  $CFLAGS << " -Wno-dangling-else"
  $CFLAGS << " -Wno-parentheses"
end

$defs << '-DPOLYPHONY_PLAYGROUND' if ENV['POLYPHONY_PLAYGROUND']

CONFIG['optflags'] << ' -fno-strict-aliasing' unless RUBY_PLATFORM =~ /mswin/


dir_config 'polyphony_ext'
create_makefile 'polyphony_ext'

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
polyphony-0.51.0 ext/polyphony/extconf.rb
polyphony-0.50.1 ext/polyphony/extconf.rb
polyphony-0.50.0 ext/polyphony/extconf.rb
polyphony-0.49.2 ext/polyphony/extconf.rb
polyphony-0.49.1 ext/polyphony/extconf.rb
polyphony-0.49.0 ext/polyphony/extconf.rb
polyphony-0.48.0 ext/polyphony/extconf.rb
polyphony-0.47.5.1 ext/polyphony/extconf.rb
polyphony-0.47.5 ext/polyphony/extconf.rb
polyphony-0.47.4 ext/polyphony/extconf.rb
polyphony-0.47.3 ext/polyphony/extconf.rb
polyphony-0.47.2 ext/polyphony/extconf.rb
polyphony-0.47.1 ext/polyphony/extconf.rb
polyphony-0.47.0 ext/polyphony/extconf.rb
polyphony-0.46.1 ext/polyphony/extconf.rb
polyphony-0.46.0 ext/polyphony/extconf.rb