mwrap.git  about / heads / tags
LD_PRELOAD malloc wrapper + line stats for Ruby
blob e9dbb1e4e2e44858e9d631f6473110b096a67ff5 768 bytes (raw)
$ git show heavy:ext/mwrap/extconf.rb	# shows this blob on the CLI

 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
 
# frozen_string_literal: true
# Copyright (C) 2018 mwrap hackers <mwrap-public@80x24.org>
# License: GPL-2.0+ <https://www.gnu.org/licenses/gpl-2.0.txt>
require 'mkmf'

have_func 'mempcpy'
have_library 'urcu-cds' or abort 'userspace RCU not installed'
have_header 'urcu/rculfhash.h' or abort 'rculfhash.h not found'
have_library 'urcu-bp' or abort 'liburcu-bp not found'
have_library 'dl'
have_library 'c'
have_library 'execinfo' # FreeBSD

if try_link(<<'')
int main(void) { return __builtin_add_overflow_p(0,0,(int)1); }

  $defs << '-DHAVE_BUILTIN_ADD_OVERFLOW_P'
end

if try_link(<<'')
int main(int a) { return __builtin_add_overflow(0,0,&a); }

  $defs << '-DHAVE_BUILTIN_ADD_OVERFLOW_P'
else
  abort 'missing __builtin_add_overflow'
end

create_makefile 'mwrap'

git clone https://80x24.org/mwrap.git