Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luajit: add option to build in gc64 mode #20036

Merged
merged 1 commit into from
Nov 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions Formula/luajit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ class Luajit < Formula
url "https://luajit.org/download/LuaJIT-2.0.5.tar.gz"
sha256 "874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979"

head "https://luajit.org/git/luajit-2.0.git"

bottle do
sha256 "4848129fc7affc5949c240f571c5e8d0684bbd142f8dc2e18176b3a8f165b2bb" => :high_sierra
sha256 "bdebedd2ab2bea98e10591308a5246c81aa7628ee7d17a0f20aeebeebf8bec22" => :sierra
Expand All @@ -16,6 +14,14 @@ class Luajit < Formula
devel do
url "https://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz"
sha256 "1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3"

option "with-gc64", "Build with 64-bit support"
end

head do
url "https://luajit.org/git/luajit-2.0.git", :branch => "v2.1"

option "with-gc64", "Build with 64-bit support"
end

deprecated_option "enable-debug" => "with-debug"
Expand All @@ -35,7 +41,12 @@ def install
ENV.O2 # Respect the developer's choice.

args = %W[PREFIX=#{prefix}]
args << "XCFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT" if build.with? "52compat"

cflags = []
cflags << "-DLUAJIT_ENABLE_LUA52COMPAT" if build.with? "52compat"
cflags << "-DLUAJIT_ENABLE_GC64" if !build.stable && build.with?("gc64")

args << "XCFLAGS=#{cflags.join(" ")}" unless cflags.zero?

# This doesn't yet work under superenv because it removes "-g"
args << "CCDEBUG=-g" if build.with? "debug"
Expand All @@ -58,8 +69,10 @@ def install
"INSTALL_LMOD=#{HOMEBREW_PREFIX}/share/lua/${abiver}"
s.gsub! "INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver}",
"INSTALL_CMOD=#{HOMEBREW_PREFIX}/${multilib}/lua/${abiver}"
s.gsub! "Libs:",
"Libs: -pagezero_size 10000 -image_base 100000000"
if build.without? "gc64"
s.gsub! "Libs:",
"Libs: -pagezero_size 10000 -image_base 100000000"
end
end

# Having an empty Lua dir in lib/share can mess with other Homebrew Luas.
Expand Down