Improve "ext/digest/extconf.rb"
This commit is contained in:
parent
d3a264d476
commit
61c2c18e6f
1 changed files with 21 additions and 4 deletions
25
ext/digest/extconf.rb
Normal file → Executable file
25
ext/digest/extconf.rb
Normal file → Executable file
|
@ -1,9 +1,26 @@
|
||||||
|
#!/usr/bin/env ruby
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
have_header('ruby/digest.h')
|
def cflags(*args)
|
||||||
have_func('rb_str_set_len')
|
args.each do |str|
|
||||||
|
$CFLAGS += " #{str.shellescape} "
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
$CFLAGS << " -fvisibility=hidden"
|
def have_header!(*args)
|
||||||
create_makefile('digest/keccak')
|
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
|
||||||
|
|
Loading…
Reference in a new issue