Created
November 12, 2009 17:38
-
-
Save vvs/233100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/nokogiri/ffi/libxml.rb b/lib/nokogiri/ffi/libxml.rb | |
index b08d39b..204dcb9 100644 | |
--- a/lib/nokogiri/ffi/libxml.rb | |
+++ b/lib/nokogiri/ffi/libxml.rb | |
@@ -4,7 +4,15 @@ module Nokogiri | |
extend FFI::Library | |
if RUBY_PLATFORM =~ /java/ && java.lang.System.getProperty('os.name') =~ /windows/i | |
raise(RuntimeError, "Nokogiri requires JRuby 1.4.0 or later on Windows") if JRUBY_VERSION < "1.4.0" | |
- ffi_lib 'libxml2', 'libxslt', 'libexslt', 'msvcrt' | |
+ | |
+ NOKO_DLL_DIR = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "ext", "nokogiri")) | |
+ noko_dll_names = ['libxml2', 'libxslt', 'libexslt'] | |
+ | |
+ dlls = noko_dll_names.map { |dll| | |
+ "#{NOKO_DLL_DIR}/#{dll}.dll".gsub('/', '\\') | |
+ } << "msvcrt" | |
+ | |
+ ffi_lib *dlls | |
else | |
ffi_lib 'xml2', 'xslt', 'exslt' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment