digest-keccak/ext/digest/extconf.rb

27 lines
426 B
Ruby
Raw Normal View History

2019-06-11 11:04:17 -04:00
#!/usr/bin/env ruby
2019-06-08 08:00:43 -04:00
# frozen_string_literal: true
require 'mkmf'
2019-06-11 11:04:17 -04:00
def cflags(*args)
args.each do |str|
$CFLAGS += " #{str.shellescape} "
end
end
2019-06-11 11:04:17 -04:00
def have_header!(*args)
exit 1 unless have_header(*args)
end
def have_func!(header, *args)
exit 1 unless have_func(*args, header)
end
cflags '-fvisibility=hidden'
have_header! 'ruby/digest.h'
have_func! 'rb_str_set_len'
create_makefile 'digest/keccak' or exit 1