2 $CPPFLAGS << ' -D_GNU_SOURCE'
3 $CPPFLAGS << ' -DPOSIX_C_SOURCE=1'
5 have_func("poll", "poll.h")
6 have_func("getaddrinfo", %w(sys/types.h sys/socket.h netdb.h)) or
7 abort "getaddrinfo required"
8 have_func("getnameinfo", %w(sys/types.h sys/socket.h netdb.h)) or
9 abort "getnameinfo required"
10 have_type("struct sockaddr_storage", %w(sys/types.h sys/socket.h)) or
11 abort "struct sockaddr_storage required"
12 have_func('accept4', %w(sys/socket.h))
13 if have_header('ruby/io.h')
14 rubyio = %w(ruby.h ruby/io.h)
15 have_struct_member("rb_io_t", "fd", rubyio)
16 have_struct_member("rb_io_t", "mode", rubyio)
18 rubyio = %w(ruby.h rubyio.h)
19 rb_io_t = have_type("OpenFile", rubyio) ? "OpenFile" : "rb_io_t"
20 have_struct_member(rb_io_t, "f", rubyio)
21 have_struct_member(rb_io_t, "f2", rubyio)
22 have_struct_member(rb_io_t, "mode", rubyio)
23 have_func('rb_fdopen')
25 have_type("struct RFile", rubyio) and check_sizeof("struct RFile", rubyio)
26 have_type("struct RObject") and check_sizeof("struct RObject")
28 have_func('rb_io_ascii8bit_binmode')
29 have_func('rb_thread_blocking_region')
30 have_func('rb_thread_io_blocking_region')
31 have_func('rb_str_set_len')
33 create_makefile('kgio_ext')