1 # -*- encoding: binary -*-
4 unless RUBY_VERSION < '3.1'
5 warn "Unicorn was only tested against MRI up to 3.0.\n" \
6 "It might not properly work with #{RUBY_VERSION}"
9 have_macro("SIZEOF_OFF_T", "ruby.h") or check_sizeof("off_t", "sys/types.h")
10 have_macro("SIZEOF_SIZE_T", "ruby.h") or check_sizeof("size_t", "sys/types.h")
11 have_macro("SIZEOF_LONG", "ruby.h") or check_sizeof("long", "sys/types.h")
12 have_func("rb_str_set_len", "ruby.h") or abort 'Ruby 2.0+ required'
13 have_func("rb_hash_clear", "ruby.h") or abort 'Ruby 2.0+ required'
14 have_func("gmtime_r", "time.h")
16 message('checking if String#-@ (str_uminus) dedupes... ')
18 a = -(%w(t e s t).join)
19 b = -(%w(t e s t).join)
21 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=1 '
24 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
25 message("no, needs Ruby 2.5+\n")
28 $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
29 message("no, String#-@ not available\n")
32 message('checking if Hash#[]= (rb_hash_aset) dedupes... ')
36 h[%W(#{r}).join('')] = :foo
37 x[%W(#{r}).join('')] = :foo
38 if x.keys[0].equal?(h.keys[0])
39 $CPPFLAGS += ' -DHASH_ASET_DEDUPE=1 '
42 $CPPFLAGS += ' -DHASH_ASET_DEDUPE=0 '
43 message("no, needs Ruby 2.6+\n")
46 create_makefile("unicorn_http")