Skip to content

Commit

Permalink
Changes to support building on Mac OS X and against Ruby 2.0
Browse files Browse the repository at this point in the history
This is adding darwin12 to the list of architectures in exconf.rb, and converting from Config to RbConfig.
  • Loading branch information
John Bellone authored and jasonroelofs committed Mar 26, 2013
1 parent dc188c0 commit ca397a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions extconf.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions 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], [

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_rice.rb
Expand Up @@ -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}")
Expand Down

0 comments on commit ca397a2

Please sign in to comment.