Skip to content

Commit

Permalink
Added --debug-build configure option.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Mar 18, 2014
1 parent b2791df commit 55e9015
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class Configure
@dtrace = false
@have_lchmod = false
@have_lchown = false
@debug_build = false
@include_dirs = []
@lib_dirs = []

Expand Down Expand Up @@ -336,6 +337,10 @@ class Configure
@gem = name
end

o.on "--debug-build", "Disable C++ optimizations and retain debugging symbols" do
@debug_build = true
end

o.on "--release-build", "Build from local files instead of accessing the network" do
@release_build = true
end
Expand Down Expand Up @@ -1727,6 +1732,7 @@ int main() { return tgetnum(""); }
:x86_64 => @x86_64,
:dtrace => @dtrace,
:fibers => @fibers,
:debug_build => @debug_build,
:sourcedir => @sourcedir,
:stagingdir => @stagingdir,
:build_prefix => @build_prefix,
Expand Down Expand Up @@ -1807,6 +1813,7 @@ int main() { return tgetnum(""); }
#define RBX_LIBC "#{@libc}"
#define RBX_HAVE_LCHMOD #{@have_lchmod}
#define RBX_HAVE_LCHOWN #{@have_lchown}
#define RBX_DEBUG_BUILD #{@debug_build.inspect}
EOC

if @little_endian
Expand Down
2 changes: 2 additions & 0 deletions kernel/delta/rubinius.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def self.version
end
end

extra << "D" if Rubinius::DEBUG_BUILD

str = "rubinius #{VERSION} (#{RUBY_VERSION} #{BUILD_REV[0..7]} #{RUBY_RELEASE_DATE}"

unless extra.empty?
Expand Down
2 changes: 1 addition & 1 deletion rakelib/blueprint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
gcc.cxxflags << Rubinius::BUILD_CONFIG[:system_cxxflags]
gcc.cxxflags << Rubinius::BUILD_CONFIG[:user_cxxflags]

if ENV['DEV']
if Rubinius::BUILD_CONFIG[:debug_build]
gcc.cflags << "-O0"
gcc.mtime_only = true
else
Expand Down
6 changes: 4 additions & 2 deletions rakelib/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def build
sh "./configure #{config}"
load_configuration

sh "rake -q clean; rake -q build"
sh "strip -S #{BUILD_CONFIG[:build_exe]}"
sh "rake -q clean"
sh "rake -q build"

sh "strip -S #{BUILD_CONFIG[:build_exe]}" unless BUILD_CONFIG[:debug_build]

if bin
sh "mkdir -p #{root}#{File.dirname(bin)}"
Expand Down
1 change: 1 addition & 0 deletions vm/ontology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ namespace rubinius {
G(rubinius)->set_const(state, "LIB_VERSION", String::create(state, RBX_LIB_VERSION));
G(rubinius)->set_const(state, "BUILD_REV", String::create(state, RBX_BUILD_REV));
G(rubinius)->set_const(state, "RELEASE_DATE", String::create(state, RBX_RELEASE_DATE));
G(rubinius)->set_const(state, "DEBUG_BUILD", RBOOL(RBX_DEBUG_BUILD));
G(rubinius)->set_const(state, "LDSHARED", String::create(state, RBX_LDSHARED));
G(rubinius)->set_const(state, "LDSHAREDXX", String::create(state, RBX_LDSHAREDXX));

Expand Down

0 comments on commit 55e9015

Please sign in to comment.