Skip to content

Commit 726438e

Browse files
committed
improved compilation, reused some code from debugger gem including ruby_core_sources fork
1 parent 0e78cc1 commit 726438e

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

ext/ruby_debug/extconf.rb

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
# autodetect ruby headers
2+
unless ARGV.any? {|arg| arg.include?('--with-ruby-include') }
3+
require 'rbconfig'
4+
bindir = RbConfig::CONFIG['bindir']
5+
if bindir =~ %r{(^.*/\.rbenv/versions)/([^/]+)/bin$}
6+
ruby_include = "#{$1}/#{$2}/include/ruby-1.9.1/ruby-#{$2}"
7+
ARGV << "--with-ruby-include=#{ruby_include}"
8+
elsif bindir =~ %r{(^.*/\.rvm/rubies)/([^/]+)/bin$}
9+
ruby_include = "#{$1}/#{$2}/include/ruby-1.9.1/#{$2}"
10+
ruby_include = "#{ENV['rvm_path']}/src/#{$2}" unless File.exist?(ruby_include)
11+
ARGV << "--with-ruby-include=#{ruby_include}"
12+
end
13+
end
14+
115
require "mkmf"
2-
require "ruby_core_source"
16+
require "debugger/ruby_core_source"
317

418
hdrs = proc {
519
begin
@@ -24,21 +38,11 @@
2438
}
2539

2640
dir_config("ruby")
27-
name = "ruby_debug"
28-
if (ENV['rvm_ruby_string'])
29-
dest_dir = RbConfig::CONFIG["rubyhdrdir"]
30-
with_cppflags("-I" + dest_dir) {
31-
if hdrs.call
32-
create_makefile(name)
33-
exit 0
34-
end
35-
}
36-
end
37-
if !Ruby_core_source::create_makefile_with_core(hdrs, name)
41+
if !Debugger::RubyCoreSource.create_makefile_with_core(hdrs, "ruby_debug")
3842
STDERR.print("Makefile creation failed\n")
3943
STDERR.print("*************************************************************\n\n")
40-
STDERR.print(" NOTE: For Ruby 1.9 installation instructions, please see:\n\n")
41-
STDERR.print(" http://wiki.github.com/mark-moseley/ruby-debug\n\n")
44+
STDERR.print(" NOTE: If your headers were not found, try passing\n")
45+
STDERR.print(" --with-ruby-include=PATH_TO_HEADERS \n\n")
4246
STDERR.print("*************************************************************\n\n")
4347
exit(1)
4448
end

ext/ruby_debug/ruby_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <insns_info.inc>
1010
#include "ruby_debug.h"
1111

12-
#define DEBUG_VERSION "0.11.30.pre10"
12+
#define DEBUG_VERSION "0.11.30.pre11"
1313

1414
#define FRAME_N(n) (&debug_context->frames[debug_context->stack_size-(n)-1])
1515
#define GET_FRAME (FRAME_N(check_frame_number(debug_context, frame)))

ruby-debug-base19x.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ EOF
4141
spec.required_ruby_version = '>= 1.9'
4242
spec.date = Time.now
4343
spec.rubyforge_project = 'ruby-debug19'
44-
spec.add_dependency('ruby_core_source', [">= 0.1.4"])
44+
spec.add_dependency "debugger-ruby_core_source", '~> 1.1.4'
4545
spec.add_dependency("rake", ">= 0.8.1")
4646

4747
# rdoc

0 commit comments

Comments
 (0)