summaryrefslogtreecommitdiff
path: root/ext/fiddle/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle/extconf.rb')
-rw-r--r--ext/fiddle/extconf.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
new file mode 100644
index 0000000000..87c5c9e633
--- /dev/null
+++ b/ext/fiddle/extconf.rb
@@ -0,0 +1,23 @@
+require 'mkmf'
+
+# :stopdoc:
+
+dir_config 'libffi'
+
+unless have_header('ffi.h')
+ if have_header('ffi/ffi.h')
+ $defs.push(format('-DUSE_HEADER_HACKS'))
+ else
+ abort "ffi.h is missing. Please install libffi."
+ end
+end
+
+unless have_library('ffi')
+ abort "libffi is missing. Please install libffi."
+end
+
+have_header 'sys/mman.h'
+
+create_makefile 'fiddle'
+
+# :startdoc: