Commit 07f850af authored by Hiroshi Shirosaki's avatar Hiroshi Shirosaki

Fix issues for Windows MinGW

- configure fails because `sh` is not executed
- load fails due to no libsodium.so

This fix works with [RubyInstaller](http://rubyinstaller.org/).
Fix #6
parent f66e4c47
......@@ -19,9 +19,14 @@ LIBSODIUM_DIR = File.expand_path(File.join(CWD, '..', '..', 'vendor', 'libsodium
MAKE = ENV['MAKE'] || ENV['make'] || "make"
Dir.chdir(LIBSODIUM_DIR) do
sys("./configure --prefix=#{LIBSODIUM_DIR}/dist")
# sh is required to run configure on Windows
sys("sh -c \"./configure --prefix=#{LIBSODIUM_DIR}/dist\"")
sys(MAKE)
sys("#{MAKE} install")
if !Dir.glob('dist/bin/libsodium*.dll').empty?
# copy dll to make it loadable on Windows
sys("cp dist/bin/libsodium*.dll dist/lib/libsodium.so")
end
end
File.open("Makefile", "w") do |f|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment