Chris Roberts b494c30ced Adjust extension location for correct install path
With existing layout the built shared library will end up in the `./lib`
directory, but the expected location being checked is `./lib/vagrant`.
Adjusting the path within the extension directory results in the proper
adjustment to the installation path.
2023-06-21 09:43:28 -07:00

22 lines
692 B
Ruby

#!/usr/bin/env ruby
require "mkmf"
require "shellwords"
# If extra flags are included via the environment, append them
append_cflags(Shellwords.shellwords(ENV["CFLAGS"])) if ENV["CFLAGS"]
append_cppflags(Shellwords.shellwords(ENV["CPPFLAGS"])) if ENV["CPPFLAGS"]
append_ldflags(Shellwords.shellwords(ENV["LDFLAGS"])) if ENV["LDFLAGS"]
if have_header("openssl/opensslv.h")
append_ldflags(["-lssl", "-lcrypto"])
create_makefile("vagrant_ssl")
else
# If the header file isn't found, just create a dummy
# Makefile and stub the library to make it a noop
File.open("Makefile", "wb") do |f|
f.write(dummy_makefile(__dir__).join("\n"))
end
FileUtils.touch("vagrant_ssl.so")
end