From ca397a2969f70328a82148b1ba0711ee3a3088f6 Mon Sep 17 00:00:00 2001 From: John Bellone Date: Wed, 30 Jan 2013 22:02:04 -0500 Subject: [PATCH] Changes to support building on Mac OS X and against Ruby 2.0 This is adding darwin12 to the list of architectures in exconf.rb, and converting from Config to RbConfig. --- extconf.rb | 6 +++--- ruby.ac | 4 ++-- test/test_rice.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/extconf.rb b/extconf.rb index 29dbc1a5d..18d426bd9 100644 --- a/extconf.rb +++ b/extconf.rb @@ -17,13 +17,13 @@ require 'ruby/lib/version.rb' prefix_dir = File.join(File.dirname(File.expand_path(__FILE__)), "ruby", "lib") -with_ruby = File.join(Config::CONFIG["bindir"], Config::CONFIG["RUBY_INSTALL_NAME"]) +with_ruby = File.join(RbConfig::CONFIG["bindir"], RbConfig::CONFIG["RUBY_INSTALL_NAME"]) other_opts = "" env = "" -if RUBY_PLATFORM =~ /darwin10/ || RUBY_PLATFORM =~ /darwin11/ - arch = Config::CONFIG["arch"].split("-")[0] +if RUBY_PLATFORM =~ /darwin1[0-2]/ + arch = RbConfig::CONFIG["arch"].split("-")[0] if arch == "universal" arch = `uname -m`.strip diff --git a/ruby.ac b/ruby.ac index bb1a172cb..4ca53fadb 100644 --- a/ruby.ac +++ b/ruby.ac @@ -1,6 +1,6 @@ dnl Get a key from ruby's configuration table AC_DEFUN([RUBY_CONFIG], [ - $RUBY -rrbconfig -e "puts(Config::CONFIG[['$1']] || '')"]) + $RUBY -rrbconfig -e "puts(RbConfig::CONFIG[['$1']] || '')"]) AC_DEFUN([RB_INIT_RUBY], [ @@ -77,7 +77,7 @@ else RUBY_SITELIBDIR=`RUBY_CONFIG(sitelibdir)` else sitelibdir_no_prefix=`$RUBY -rrbconfig \ - -e "include Config; \ + -e "include RbConfig; \ puts CONFIG[['sitelibdir']].sub(CONFIG[['prefix']], '')"` RUBY_SITELIBDIR="${prefix}/${sitelibdir_no_prefix}" fi diff --git a/test/test_rice.rb b/test/test_rice.rb index d2736d975..3d34575e3 100644 --- a/test/test_rice.rb +++ b/test/test_rice.rb @@ -5,8 +5,8 @@ class RiceTest < Test::Unit::TestCase # TODO: probably a better way to find this out... VERBOSE = ARGV.include?('-v') - EXEEXT = Config::CONFIG['EXEEXT'] - RUBY = Config::CONFIG['RUBY_INSTALL_NAME'] + EXEEXT = RbConfig::CONFIG['EXEEXT'] + RUBY = RbConfig::CONFIG['RUBY_INSTALL_NAME'] def test_unittest run_external_test("./unittest#{EXEEXT}")