kgio.git  about / heads / tags
kinder, gentler I/O for Ruby
blob a42fc9e0ffd0ae609e9a9e0a56153a5204c5f766 1382 bytes (raw)
$ git show HEAD:ext/kgio/extconf.rb	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
require 'mkmf'
$CPPFLAGS << ' -D_GNU_SOURCE'
$CPPFLAGS << ' -DPOSIX_C_SOURCE=1'
$CPPFLAGS += '-D_POSIX_C_SOURCE=200112L'
unless have_macro('CLOCK_MONOTONIC', 'time.h')
  have_func('CLOCK_MONOTONIC', 'time.h')
end
have_type('clockid_t', 'time.h')
have_library('rt', 'clock_gettime', 'time.h')
have_func('rb_io_descriptor')

# taken from ext/socket/extconf.rb in ruby/trunk:
# OpenSolaris:
have_library("nsl", "t_open")
have_library("socket", "socket")

have_func("poll", "poll.h")
have_func("getaddrinfo", %w(sys/types.h sys/socket.h netdb.h)) or
  abort "getaddrinfo required"
have_func("getnameinfo", %w(sys/types.h sys/socket.h netdb.h)) or
  abort "getnameinfo required"
have_type("struct sockaddr_storage", %w(sys/types.h sys/socket.h)) or
  abort "struct sockaddr_storage required"
have_func('accept4', %w(sys/socket.h))
have_header("sys/select.h")

have_func("writev", "sys/uio.h")

have_func('rb_io_ascii8bit_binmode')
have_func('rb_update_max_fd')
have_func('rb_fd_fix_cloexec')
have_func('rb_cloexec_open')
have_header('ruby/thread.h')
have_func('rb_thread_call_without_gvl', %w{ruby/thread.h})
have_func('rb_thread_blocking_region')
have_func('rb_thread_io_blocking_region')
have_func("rb_hash_clear", "ruby.h") # Ruby 2.0+
have_func('rb_time_interval')
have_func('rb_wait_for_single_fd')
have_func('rb_str_subseq')
have_func('rb_ary_subseq')

create_makefile('kgio_ext')

git clone git://yhbt.net/kgio.git
git clone https://yhbt.net/kgio.git