Sha256: 179681f1e918ba61cd12991227f3d11d25d64dbe83929272f394337ef665d985

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

# -*- encoding: binary -*-
require 'mkmf'

have_macro("SIZEOF_OFF_T", "ruby.h") or check_sizeof("off_t", "sys/types.h")
have_macro("SIZEOF_SIZE_T", "ruby.h") or check_sizeof("size_t", "sys/types.h")
have_macro("SIZEOF_LONG", "ruby.h") or check_sizeof("long", "sys/types.h")
have_func("rb_str_set_len", "ruby.h") or abort 'Ruby 1.9.3+ required'
have_func("rb_hash_clear", "ruby.h") # Ruby 2.0+
have_func("gmtime_r", "time.h")

message('checking if String#-@ (str_uminus) dedupes... ')
begin
  a = -(%w(t e s t).join)
  b = -(%w(t e s t).join)
  if a.equal?(b)
    $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=1 '
    message("yes\n")
  else
    $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
    message("no, needs Ruby 2.5+\n")
  end
rescue NoMethodError
  $CPPFLAGS += ' -DSTR_UMINUS_DEDUPE=0 '
  message("no, String#-@ not available\n")
end

message('checking if Hash#[]= (rb_hash_aset) dedupes... ')
h = {}
x = {}
r = rand.to_s
h[%W(#{r}).join('')] = :foo
x[%W(#{r}).join('')] = :foo
if x.keys[0].equal?(h.keys[0])
  $CPPFLAGS += ' -DHASH_ASET_DEDUPE=1 '
  message("yes\n")
else
  $CPPFLAGS += ' -DHASH_ASET_DEDUPE=0 '
  message("no, needs Ruby 2.6+\n")
end

create_makefile("unicorn_http")

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
unicorn-5.6.0 ext/unicorn_http/extconf.rb
unicorn-5.5.5 ext/unicorn_http/extconf.rb
unicorn-5.5.4 ext/unicorn_http/extconf.rb
unicorn-5.5.3 ext/unicorn_http/extconf.rb
unicorn-5.5.2 ext/unicorn_http/extconf.rb
unicorn-5.5.1 ext/unicorn_http/extconf.rb
unicorn-5.5.0.1.g6836 ext/unicorn_http/extconf.rb
unicorn-5.5.0 ext/unicorn_http/extconf.rb
unicorn-5.5.0.pre1 ext/unicorn_http/extconf.rb