From efaba3846de1007ab71ed94e50346db7a2494d30 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 12 Nov 2013 11:50:44 -0600 Subject: luajit: fix debug build --- Library/Formula/luajit.rb | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/luajit.rb b/Library/Formula/luajit.rb index f128fde65..bead80ba3 100644 --- a/Library/Formula/luajit.rb +++ b/Library/Formula/luajit.rb @@ -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. + + args = %W[PREFIX=#{prefix}] + + # This doesn't yet work under superenv because it removes '-g' + args << 'CCDEBUG=-g' if build.include? 'enable-debug' - bldargs = args - bldargs << 'amalg' - system 'make', *bldargs - args << 'install' - system 'make', *args # Build requires args during install + system 'make', 'amalg', 'install', *args end end -- cgit v1.2.3