Skip to content

Commit

Permalink
ext: hack to cross-compile zlib v1.2.13 on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Oct 18, 2022
1 parent 76dbc8c commit 212e07d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,17 @@ def install
else
class << recipe
def configure
cflags = concat_flags(ENV["CFLAGS"], "-fPIC", "-g")
execute("configure",
["env", "CHOST=#{host}", "CFLAGS=#{cflags}", "./configure", "--static", configure_prefix])
env = {}
env["CFLAGS"] = concat_flags(ENV["CFLAGS"], "-fPIC", "-g")
env["CHOST"] = host
execute("configure", ["./configure", "--static", configure_prefix], { env: env })
if darwin?
# needed as of zlib 1.2.13
Dir.chdir(work_path) do
makefile = File.read("Makefile").gsub(/^AR=.*$/, "AR=#{host}-libtool")
File.open("Makefile", "w") { |m| m.write(makefile) }
end
end
end
end
end
Expand Down

0 comments on commit 212e07d

Please sign in to comment.