File: extconf.rb

package info (click to toggle)
ruby-eb 2.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 292 kB
  • sloc: ansic: 2,823; ruby: 291; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'mkmf'

have_library("z")
have_library("intl") if /freebsd/ =~ RUBY_PLATFORM
have_library('eb')
have_func("rb_block_proc")
have_func("eb_bitmap_to_png")
have_header('eb/sysdefs.h')
have_type('rb_encoding', ['ruby/ruby.h', 'ruby/encoding.h'])

if have_func("eb_pthread_enabled")
  print "checking that the EB library is pthread enabled... "
  STDOUT.flush
  if try_run(<<EOS)
#include <eb/eb.h>

int main()
{
    printf("eb_pthread_enabled() => %d\\n", eb_pthread_enabled());
    return eb_pthread_enabled() ? 0 : 1;
}
EOS
    puts "yes"
    $defs << '-DRUBY_EB_ENABLE_PTHREAD'
  else
    puts "no"
  end
end

create_makefile("eb")