Skip to content

Commit

Permalink
OpenSSL: Adapt dll names to 1.1.0 scheme
Browse files Browse the repository at this point in the history
* libeay -> libcrypto
* ssleay -> libssl
  • Loading branch information
orgads committed Mar 4, 2017
1 parent 7a96cf6 commit baa591f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
gemplat = spec.platform.to_s
host = platform_host_map[gemplat]
dlls = [
"libeay32-#{OPENSSL_VERSION}-#{host}.dll",
"ssleay32-#{OPENSSL_VERSION}-#{host}.dll",
"libcrypto32-#{OPENSSL_VERSION}-#{host}.dll",
"libssl32-#{OPENSSL_VERSION}-#{host}.dll",
'libiconv-2.dll',
'libsybdb-5.dll'
]
Expand Down
14 changes: 7 additions & 7 deletions ext/tiny_tds/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,20 @@ def dllwrap(dllname, outputlib, deffile, linkto)

def compile
super
# OpenSSL DLLs are called "libeay32.dll" and "ssleay32.dll" per default,
# OpenSSL DLLs are called "libcrypto32.dll" and "libssl32.dll" per default,
# regardless to the version. This is best suited to meet the Windows DLL hell.
# To avoid any conflicts we do a static build and build DLLs afterwards,
# with our own naming scheme.
execute "mkdef-libeay32", "(perl util/mkdef.pl 32 libeay >libeay32.def)"
execute "mkdef-ssleay32", "(perl util/mkdef.pl 32 ssleay >ssleay32.def)"
dllwrap("libeay32-#{version}-#{host}", "libcrypto.dll.a", "libeay32.def", "libcrypto.a -lws2_32 -lgdi32 -lcrypt32")
dllwrap("ssleay32-#{version}-#{host}", "libssl.dll.a", "ssleay32.def", "libssl.a libcrypto.dll.a")
execute "mkdef-crypto32", "(perl util/mkdef.pl crypto 32 >libcrypto32.def)"
execute "mkdef-ssl32", "(perl util/mkdef.pl ssl 32 >libssl32.def)"
dllwrap("libcrypto32-#{version}-#{host}", "libcrypto.dll.a", "libcrypto32.def", "libcrypto.a -lws2_32 -lgdi32 -lcrypt32")
dllwrap("libssl32-#{version}-#{host}", "libssl.dll.a", "libssl32.def", "libssl.a libcrypto.dll.a")
end

def install
super
FileUtils.cp "#{work_path}/libeay32-#{version}-#{host}.dll", "#{path}/bin/"
FileUtils.cp "#{work_path}/ssleay32-#{version}-#{host}.dll", "#{path}/bin/"
FileUtils.cp "#{work_path}/libcrypto32-#{version}-#{host}.dll", "#{path}/bin/"
FileUtils.cp "#{work_path}/libssl32-#{version}-#{host}.dll", "#{path}/bin/"
FileUtils.cp "#{work_path}/libcrypto.dll.a", "#{path}/lib/"
FileUtils.cp "#{work_path}/libssl.dll.a", "#{path}/lib/"
end
Expand Down

0 comments on commit baa591f

Please sign in to comment.