Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More things to try to get cross compilation working

  • Loading branch information...
commit 85a308d37ff3444da38c8d9b858ff98db465eaa5 1 parent a6f4f9d
Mitchell Hashimoto authored
Showing with 14 additions and 4 deletions.
  1. +12 −3 ext/libssh2_ruby_c/extconf.rb
  2. +2 −1  tasks/extension.rake
15 ext/libssh2_ruby_c/extconf.rb
View
@@ -1,4 +1,5 @@
-require 'mkmf'
+require "mkmf"
+require "rbconfig"
# Allow "--with-libssh2-dir" configuration directives...
dir_config("libssh2")
@@ -12,8 +13,16 @@ def asplode(missing)
# Verify that we have libssh2
asplode("libssh2.h") if !find_header("libssh2.h")
-asplode("libcrypto") if !find_library("crypto", "CRYPTO_num_locks")
-asplode("openssl") if !find_library("ssl", "SSL_library_init")
+
+# On Mac OS X, we can't actually statically compile a 64-bit version
+# of OpenSSL, so we just link against the shared versions as well.
+# Kind of a hack but it works fine.
+if RbConfig::CONFIG["host_os"] =~ /^darwin/
+ asplode("libcrypto") if !find_library("crypto", "CRYPTO_num_locks")
+ asplode("openssl") if !find_library("ssl", "SSL_library_init")
+end
+
+# Verify libssh2 is usable
asplode("libssh2") if !find_library("ssh2", "libssh2_init")
# Create the makefile with the expected library name.
3  tasks/extension.rake
View
@@ -5,5 +5,6 @@ require "rake/extensiontask"
# This requires Bundler 1.1.0.
gem_helper = Bundler::GemHelper.new(Dir.pwd)
Rake::ExtensionTask.new("libssh2_ruby_c", gem_helper.gemspec) do |ext|
- ext.cross_compile = true
+ ext.cross_compile = true
+ ext.cross_platform = "i686-w64-mingw32"
end
Please sign in to comment.
Something went wrong with that request. Please try again.