]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
ESL-66
authorBrian West <brian@freeswitch.org>
Fri, 7 Feb 2014 19:10:08 +0000 (13:10 -0600)
committerBrian West <brian@freeswitch.org>
Fri, 7 Feb 2014 19:10:08 +0000 (13:10 -0600)
libs/esl/ruby/Makefile
libs/esl/ruby/cflags.rb [new file with mode: 0644]

index 227e9f33fab10e6e87e3e6a90c8f3452e39d346d..21ed211a4482d7ef36017805ff2fdef412497b7d 100644 (file)
@@ -1,6 +1,5 @@
-## no idea how to simply ask ruby which one to use
-LOCAL_CFLAGS=-I$(shell ruby -e 'require "rbconfig"; puts RbConfig::CONFIG["topdir"]')
-LOCAL_LDFLAGS=$(shell ruby -e 'require "rbconfig"; puts RbConfig::CONFIG["LIBS"]')
+LOCAL_LDFLAGS=$(shell ruby -rrbconfig -e 'puts RbConfig::CONFIG["LIBRUBYARG"]')
+LOCAL_CFLAGS=$(shell ruby cflags.rb)
 
 all: ESL.so
 
@@ -20,4 +19,3 @@ swigclean:
        rm -f esl_wrap.* ESL.so
 
 reswig:        swigclean esl_wrap.cpp
-
diff --git a/libs/esl/ruby/cflags.rb b/libs/esl/ruby/cflags.rb
new file mode 100644 (file)
index 0000000..45c10b1
--- /dev/null
@@ -0,0 +1,8 @@
+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"]}"
+end
+puts cflags
\ No newline at end of file