about summary refs log tree commit homepage
path: root/ext/mwrap/extconf.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-01 01:54:15 +0000
committerEric Wong <e@80x24.org>2018-07-02 01:24:15 +0000
commitc0a29c0f7c829737782c18a0349b8655b3c0388d (patch)
tree2de91293179f6c48ce31dcd8514a2c2e4218ebd2 /ext/mwrap/extconf.rb
downloadmwrap-c0a29c0f7c829737782c18a0349b8655b3c0388d.tar.gz
Diffstat (limited to 'ext/mwrap/extconf.rb')
-rw-r--r--ext/mwrap/extconf.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/mwrap/extconf.rb b/ext/mwrap/extconf.rb
new file mode 100644
index 0000000..dbffd99
--- /dev/null
+++ b/ext/mwrap/extconf.rb
@@ -0,0 +1,13 @@
+# 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'
+if RUBY_PLATFORM =~ /linux/ # should detect glibc
+  if File.read("/proc/#$$/maps") =~ /\blibjemalloc\./
+    $defs << '-DRUBY_USES_JEMALLOC'
+  end
+end
+have_library 'dl'
+create_makefile 'mwrap'