Sha256: aa4e99cf6ab2fab3ec5dc8b5099264e883da02e5926b74c887647752bf6f13a2

Contents?: true

Size: 1.88 KB

Versions: 7

Compression:

Stored size: 1.88 KB

Contents

if defined?(RUBY_ENGINE) && 'rbx' == RUBY_ENGINE
  # create dummy Makefile to indicate success
  f = File.open(File.join(File.dirname(__FILE__), "Makefile"), "w")
  f.write("all:\n\techo all\ninstall:\n\techo installed\n")
  f.close
  return
end

# autodetect ruby headers
unless ARGV.any? {|arg| arg.include?('--with-ruby-include') }
  require 'rbconfig'
  bindir = RbConfig::CONFIG['bindir']
  if bindir =~ %r{(^.*/\.rbenv/versions)/([^/]+)/bin$}
    ruby_include = "#{$1}/#{$2}/include/ruby-1.9.1/ruby-#{$2}"
    ruby_include = "#{ENV['RBENV_ROOT']}/sources/#{$2}/ruby-#{$2}" unless File.exist?(ruby_include)
    ARGV << "--with-ruby-include=#{ruby_include}"
  elsif bindir =~ %r{(^.*/\.rvm/rubies)/([^/]+)/bin$}
    ruby_include = "#{$1}/#{$2}/include/ruby-1.9.1/#{$2}"
    ruby_include = "#{ENV['rvm_path']}/src/#{$2}" unless File.exist?(ruby_include)
    ARGV << "--with-ruby-include=#{ruby_include}"
  end
end

require "mkmf"

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

require "debase/ruby_core_source"

hdrs = proc {
  have_header("vm_core.h")
}

# Allow use customization of compile options. For example, the
# following lines could be put in config_options to to turn off
# optimization:
#   $CFLAGS='-fPIC -fno-strict-aliasing -g3 -ggdb -O2 -fPIC'
config_file = File.join(File.dirname(__FILE__), 'config_options.rb')
load config_file if File.exist?(config_file)

if ENV['debase_debug']
  $CFLAGS+=' -Wall -Werror' 
  $CFLAGS+=' -g3'
end

dir_config("ruby")
if !Debase::RubyCoreSource.create_makefile_with_core(hdrs, "attach")
  STDERR.print("Makefile creation failed\n")
  STDERR.print("*************************************************************\n\n")
  STDERR.print("  NOTE: If your headers were not found, try passing\n")
  STDERR.print("        --with-ruby-include=PATH_TO_HEADERS      \n\n")
  STDERR.print("*************************************************************\n\n")
  exit(1)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
debase-0.2.2 ext/attach/extconf.rb
debase-0.2.2.beta14 ext/attach/extconf.rb
debase-0.2.2.beta13 ext/attach/extconf.rb
debase-0.2.2.beta12 ext/attach/extconf.rb
debase-0.2.2.beta11 ext/attach/extconf.rb
debase-0.2.2.beta10 ext/attach/extconf.rb
debase-0.2.2.beta9 ext/attach/extconf.rb