Skip to content

Instantly share code, notes, and snippets.

@vvs
Created November 12, 2009 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvs/233100 to your computer and use it in GitHub Desktop.
Save vvs/233100 to your computer and use it in GitHub Desktop.
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