summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Meissner <wmeissner@gmail.com>2009-11-06 06:33:20 +1000
committerWayne Meissner <wmeissner@gmail.com>2009-11-06 06:33:51 +1000
commitf7740ad2b2cf28d8cf5f4d6861ef3b8ced2b8fc1 (patch)
treef148fb39fba44bf064582a6134e6ae50bfcf3196
parent20a495611fddd37c83cd7f44f5d92a8f1bce6bc6 (diff)
downloadffi-f7740ad2b2cf28d8cf5f4d6861ef3b8ced2b8fc1.tar.gz
Don't do libffi detection if cross-compiling for win32.
-rw-r--r--ext/ffi_c/extconf.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/ext/ffi_c/extconf.rb b/ext/ffi_c/extconf.rb
index 17b6b2c..de3b4b4 100644
--- a/ext/ffi_c/extconf.rb
+++ b/ext/ffi_c/extconf.rb
@@ -3,12 +3,14 @@ require 'mkmf'
require 'rbconfig'
dir_config("ffi_c")
-pkg_config("libffi")
-have_ffi_call = have_library("ffi", "ffi_call", [ "ffi.h" ])
-have_prep_closure = have_func("ffi_prep_closure")
-libffi_ok = have_ffi_call && have_prep_closure
-$defs << "-DHAVE_LIBFFI" if libffi_ok
-$defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
+unless Config::CONFIG['host_os'] =~ /mswin32|mingw32/
+ pkg_config("libffi")
+ have_ffi_call = have_library("ffi", "ffi_call", [ "ffi.h" ])
+ have_prep_closure = have_func("ffi_prep_closure")
+ libffi_ok = have_ffi_call && have_prep_closure
+ $defs << "-DHAVE_LIBFFI" if libffi_ok
+ $defs << "-DHAVE_RAW_API" if have_func("ffi_raw_call") && have_func("ffi_prep_raw_closure")
+end
have_func('rb_thread_blocking_region')
$defs << "-DHAVE_EXTCONF_H" if $defs.empty? # needed so create_header works