digest-keccak/ext/digest/extconf.rb

32 lines
523 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
2019-06-11 11:18:38 -04:00
cflags '-std=c11'
cflags '-Wall'
cflags '-Wextra'
2019-06-11 11:04:17 -04:00
cflags '-fvisibility=hidden'
have_header! 'ruby/digest.h'
2019-06-11 11:14:45 -04:00
have_header! 'stdio.h'
have_header! 'string.h'
2019-06-11 11:04:17 -04:00
have_func! 'rb_str_set_len'
create_makefile 'digest/keccak' or exit 1