luajit: fix debug build

This commit is contained in:
Jack Nagel committed 2013-11-12 11:59:31 -06:00
1 parent 3f09de8a6d
commit efaba3846d
1 file changed
+10 -16
+10 -16
View File
@@ -11,27 +11,21 @@ class Luajit < Formula
option "enable-debug", "Build with debugging symbols"
def install
# 1 - Remove the '-O2' so we can set Og if needed. Leave the -fomit part.
# 2 - Override the hardcoded gcc.
# 3 - Remove the '-march=i686' so we can set the march in cflags.
# All three changes should persist and were discussed upstream.
# 1 - Override the hardcoded gcc.
# 2 - Remove the '-march=i686' so we can set the march in cflags.
# Both changes should persist and were discussed upstream.
inreplace 'src/Makefile' do |f|
f.change_make_var! 'CCOPT', '-fomit-frame-pointer'
f.change_make_var! 'CC', ENV.cc
f.change_make_var! 'CCOPT_x86', ''
end
ENV.O2 # Respect the developer's choice.
args = ["PREFIX=#{prefix}"]
if build.include? 'enable-debug' then
ENV.Og if ENV.compiler == :clang
args << 'CCDEBUG=-g'
end
ENV.O2 # Respect the developer's choice.
bldargs = args
bldargs << 'amalg'
system 'make', *bldargs
args << 'install'
system 'make', *args # Build requires args during install
args = %W[PREFIX=#{prefix}]
# This doesn't yet work under superenv because it removes '-g'
args << 'CCDEBUG=-g' if build.include? 'enable-debug'
system 'make', 'amalg', 'install', *args
end
end