From d6fa81b4b740ea8a20507aed97be7db684948a8b Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 7 Apr 2014 15:27:24 -0400 Subject: [PATCH] ESL-89: --resolve add rubymod-install and add ability to use a ruby not in your path by setting RUBY env var --- libs/esl/Makefile.am | 3 +++ libs/esl/ruby/Makefile | 10 ++++++++-- libs/esl/ruby/cflags.rb | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/libs/esl/Makefile.am b/libs/esl/Makefile.am index 34220ee0d7..3d701a7951 100644 --- a/libs/esl/Makefile.am +++ b/libs/esl/Makefile.am @@ -96,4 +96,7 @@ phpmod-install: phpmod pymod-install: pymod $(MAKE) -C python install +rubymod-install: rubymod + $(MAKE) -C ruby install + everymod: perlmod phpmod luamod pymod rubymod javamod managedmod diff --git a/libs/esl/ruby/Makefile b/libs/esl/ruby/Makefile index 177b448143..ef7cbacc80 100644 --- a/libs/esl/ruby/Makefile +++ b/libs/esl/ruby/Makefile @@ -1,5 +1,7 @@ -LOCAL_LDFLAGS=$(shell ruby -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBYARG"]') -LOCAL_CFLAGS=$(shell ruby cflags.rb) +RUBY:=ruby +LOCAL_LDFLAGS=$(shell $(RUBY) -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBYARG"]') +LOCAL_CFLAGS=$(shell $(RUBY) cflags.rb) +RUBY_GEM_DIR=$(shell $(RUBY) -e 'puts Gem.dir') all: ESL.so @@ -12,6 +14,10 @@ esl_wrap.o: esl_wrap.cpp ESL.so: esl_wrap.o $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS) + +install: ESL.so + install -m 755 ESL.so $(RUBY_GEM_DIR) + clean: rm -f *.o *.so *~ diff --git a/libs/esl/ruby/cflags.rb b/libs/esl/ruby/cflags.rb index 45c10b1727..5a269c9468 100644 --- a/libs/esl/ruby/cflags.rb +++ b/libs/esl/ruby/cflags.rb @@ -3,6 +3,6 @@ require 'rbconfig' cflags = if RUBY_VERSION =~ /1.9/ then "-I#{RbConfig::CONFIG['rubyhdrdir']} -I#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']}" else - "-I#{RbConfig::CONFIG["topdir"]}" + "-I#{RbConfig::CONFIG["topdir"]} -I#{RbConfig::CONFIG['rubyhdrdir']} -I#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']}" end -puts cflags \ No newline at end of file +puts cflags