summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatsuhiko Nishimra <ktns.87@gmail.com>2013-04-29 18:32:50 +0900
committerKatsuhiko Nishimra <ktns.87@gmail.com>2013-04-29 18:35:42 +0900
commit551289d4f626167084260dbea1c7e7fec6ee6927 (patch)
treead2f7cc9e0f3ee189df5396c0b964592e6fcef25
parent9ce84ddb914eb933d59d4dfb1a40a9429ca5519b (diff)
Use running ruby executable to compile the binding
-rw-r--r--ext/openbabel/extconf.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/openbabel/extconf.rb b/ext/openbabel/extconf.rb
index 9e67b8f..2299df9 100644
--- a/ext/openbabel/extconf.rb
+++ b/ext/openbabel/extconf.rb
@@ -5,6 +5,9 @@ require 'mkmf'
ob_num_ver="2.3.1"
ob_ver="openbabel-"+ob_num_ver
+RUBY=File.join(RbConfig::CONFIG['bindir'],
+ RbConfig::CONFIG['ruby_install_name'])
+
main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..","..","src"))
lib_dir = File.expand_path(File.join(File.dirname(__FILE__),"..","..","src"))
Dir.mkdir main_dir
@@ -33,7 +36,7 @@ begin
# get include and lib from pkg-config
ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'')
ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'')
- system "ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}"
+ system "#{RUBY} extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}"
system "sed -i -e 's/-flat_namespace//' Makefile"
system "make"
end