VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
dujinfang at gmail.com Guest
|
Posted: Tue May 26, 2009 10:23 am Post subject: [Freeswitch-users] how to enable ESL for ruby? |
|
|
Hi,
Following the wiki: http://wiki.freeswitch.org/wiki/Event_Socket_Library
On MacOSX 10.5, I can't get ESL for ruby work. make throws error:
sevens-mac-pro:~/workspace/test/freeswitch/trunk/libs/esl$ make rubymod
make MYLIB="../libesl.a" SOLINK="-shared -Xlinker -x" CFLAGS="-I/Users/
seven/workspace/test/freeswitch/trunk/libs/esl/src/include -
DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-
math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes" CXXFLAGS="-I/Users/seven/workspace/
test/freeswitch/trunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -
I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable"
CXX_CFLAGS="" -C ruby
g++ -I/Users/seven/workspace/test/freeswitch/trunk/libs/esl/src/
include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall
-Werror -Wno-unused-variable -I/opt/local/lib/ruby/1.8/i686-darwin9 -c
esl_wrap.cpp -o esl_wrap.o
g++ -shared -Xlinker -x esl_wrap.o ../libesl.a -lruby -o ESL.so -L.
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [ESL.so] Error 1
Thanks for any help.
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Tue May 26, 2009 10:36 am Post subject: [Freeswitch-users] how to enable ESL for ruby? |
|
|
The makefile will have to be changed to work with OS X since the linking is done differently.
It would be very similar to this one http://www.bkw.org/esl.imac.diff
Below will get it to compile:
imac:esl brian$ svn diff
Index: ruby/Makefile
===================================================================
--- ruby/Makefile (revision 13432)
+++ ruby/Makefile (working copy)
@@ -1,6 +1,7 @@
## 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["LIBRUBYARG"]')
+LOCAL_LDFLAGS += -framework Ruby
all: ESL.so
Index: ruby/esl_wrap.cpp
===================================================================
--- ruby/esl_wrap.cpp (revision 13432)
+++ ruby/esl_wrap.cpp (working copy)
@@ -823,7 +823,7 @@
-#include <ruby.h>
+#include <ruby/ruby.h>
/* Remove global macros defined in Ruby's win32.h */
#ifdef write
Index: Makefile
===================================================================
--- Makefile (revision 13432)
+++ Makefile (working copy)
@@ -12,7 +12,7 @@
OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o
SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp
HEADERS=src/include/esl_config.h src/include/esl_event.h src/include/esl.h src/include/esl_threadmutex.h src/include/esl_oop.h
-SOLINK=-shared -Xlinker -x
+SOLINK=-dynamiclib -Xlinker -x
# comment the next line to disable c++ (no swig mods for you then)
OBJS += src/esl_oop.o
/b
On May 26, 2009, at 10:22 AM, dujinfang wrote:
Quote: | Hi,
Following the wiki: http://wiki.freeswitch.org/wiki/Event_Socket_Library
On MacOSX 10.5, I can't get ESL for ruby work. make throws error:
sevens-mac-pro:~/workspace/test/freeswitch/trunk/libs/esl$ make rubymod
make MYLIB="../libesl.a" SOLINK="-shared -Xlinker -x" CFLAGS="-I/Users/
seven/workspace/test/freeswitch/trunk/libs/esl/src/include -
DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-
math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes" CXXFLAGS="-I/Users/seven/workspace/
test/freeswitch/trunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -
I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable"
CXX_CFLAGS="" -C ruby
g++ -I/Users/seven/workspace/test/freeswitch/trunk/libs/esl/src/
include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall
-Werror -Wno-unused-variable -I/opt/local/lib/ruby/1.8/i686-darwin9 -c
esl_wrap.cpp -o esl_wrap.o
g++ -shared -Xlinker -x esl_wrap.o ../libesl.a -lruby -o ESL.so -L.
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [ESL.so] Error 1
Thanks for any help. |
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Tue May 26, 2009 11:29 am Post subject: [Freeswitch-users] how to enable ESL for ruby? |
|
|
On May 26, 2009, at 11:20 AM, dujinfang wrote:
Quote: | Thanks Brain. Got ESL.so, however on my Mac it is #include <ruby.h> instead of <ruby/ruby.h>.
|
Actually since we do -framework Ruby it should be ruby/ruby but I think the line above the -framework Ruby should be removed since you're doing i tthe Mac way.
/b
Quote: |
But it can't find the ESL when I require 'ESL' in ruby. Even I put ESL.so in one of the dir of $:
Any clue for me?
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl$ make rubymod
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl.c -o src/esl.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_event.c -o src/esl_event.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_threadmutex.c -o src/esl_threadmutex.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_config.c -o src/esl_config.o
g++ -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable -c src/esl_oop.cpp -o src/esl_oop.o
ar rcs libesl.a src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o src/esl_oop.o
ranlib libesl.a
make MYLIB="../libesl.a" SOLINK="-dynamiclib -Xlinker -x" CFLAGS="-I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" CXXFLAGS="-I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable" CXX_CFLAGS="" -C ruby
g++ -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable -I/opt/local/lib/ruby/1.8/i686-darwin9 -c esl_wrap.cpp -o esl_wrap.o
g++ -dynamiclib -Xlinker -x esl_wrap.o ../libesl.a -lruby -framework Ruby -o ESL.so -L.
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl$ cd ruby/
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl/ruby$ ruby single_command.rb
single_command.rb:3:in `require': no such file to load -- ESL (LoadError)
from single_command.rb:3
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl/ruby$ irb
irb(main):001:0> $:
=> ["/opt/local/lib/ruby/site_ruby/1.8", "/opt/local/lib/ruby/site_ruby/1.8/i686-darwin9", "/opt/local/lib/ruby/site_ruby", "/opt/local/lib/ruby/vendor_ruby/1.8", "/opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9", "/opt/local/lib/ruby/vendor_ruby", "/opt/local/lib/ruby/1.8", "/opt/local/lib/ruby/1.8/i686-darwin9", "."]
irb(main):002:0>
|
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
dujinfang at gmail.com Guest
|
Posted: Tue May 26, 2009 11:33 am Post subject: [Freeswitch-users] how to enable ESL for ruby? |
|
|
Thanks Brain. Got ESL.so, however on my Mac it is #include <ruby.h> instead of <ruby/ruby.h>.
But it can't find the ESL when I require 'ESL' in ruby. Even I put ESL.so in one of the dir of $:
Any clue for me?
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl$ make rubymod
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl.c -o src/esl.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_event.c -o src/esl_event.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_threadmutex.c -o src/esl_threadmutex.o
cc -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -c src/esl_config.c -o src/esl_config.o
g++ -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable -c src/esl_oop.cpp -o src/esl_oop.o
ar rcs libesl.a src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o src/esl_oop.o
ranlib libesl.a
make MYLIB="../libesl.a" SOLINK="-dynamiclib -Xlinker -x" CFLAGS="-I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes" CXXFLAGS="-I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable" CXX_CFLAGS="" -C ruby
g++ -I/Users/seven/workspace/test/freeswitch/oldtrunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable -I/opt/local/lib/ruby/1.8/i686-darwin9 -c esl_wrap.cpp -o esl_wrap.o
g++ -dynamiclib -Xlinker -x esl_wrap.o ../libesl.a -lruby -framework Ruby -o ESL.so -L.
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl$ cd ruby/
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl/ruby$ ruby single_command.rb
single_command.rb:3:in `require': no such file to load -- ESL (LoadError)
from single_command.rb:3
seven@du-sevens-mac-pro:~/workspace/test/freeswitch/oldtrunk/libs/esl/ruby$ irb
irb(main):001:0> $:
=> ["/opt/local/lib/ruby/site_ruby/1.8", "/opt/local/lib/ruby/site_ruby/1.8/i686-darwin9", "/opt/local/lib/ruby/site_ruby", "/opt/local/lib/ruby/vendor_ruby/1.8", "/opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin9", "/opt/local/lib/ruby/vendor_ruby", "/opt/local/lib/ruby/1.8", "/opt/local/lib/ruby/1.8/i686-darwin9", "."]
irb(main):002:0>
On May 26, 2009, at 11:27 PM, Brian West wrote: Quote: | The makefile will have to be changed to work with OS X since the linking is done differently.
It would be very similar to this one http://www.bkw.org/esl.imac.diff
Below will get it to compile:
imac:esl brian$ svn diff
Index: ruby/Makefile
===================================================================
--- ruby/Makefile (revision 13432)
+++ ruby/Makefile (working copy)
@@ -1,6 +1,7 @@
## 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["LIBRUBYARG"]')
+LOCAL_LDFLAGS += -framework Ruby
all: ESL.so
Index: ruby/esl_wrap.cpp
===================================================================
--- ruby/esl_wrap.cpp (revision 13432)
+++ ruby/esl_wrap.cpp (working copy)
@@ -823,7 +823,7 @@
-#include <ruby.h>
+#include <ruby/ruby.h>
/* Remove global macros defined in Ruby's win32.h */
#ifdef write
Index: Makefile
===================================================================
--- Makefile (revision 13432)
+++ Makefile (working copy)
@@ -12,7 +12,7 @@
OBJS=src/esl.o src/esl_event.o src/esl_threadmutex.o src/esl_config.o
SRC=src/esl.c src/esl_event.c src/esl_threadmutex.c src/esl_config.c src/esl_oop.cpp
HEADERS=src/include/esl_config.h src/include/esl_event.h src/include/esl.h src/include/esl_threadmutex.h src/include/esl_oop.h
-SOLINK=-shared -Xlinker -x
+SOLINK=-dynamiclib -Xlinker -x
# comment the next line to disable c++ (no swig mods for you then)
OBJS += src/esl_oop.o
/b
On May 26, 2009, at 10:22 AM, dujinfang wrote:
Quote: | Hi,
Following the wiki: http://wiki.freeswitch.org/wiki/Event_Socket_Library
On MacOSX 10.5, I can't get ESL for ruby work. make throws error:
sevens-mac-pro:~/workspace/test/freeswitch/trunk/libs/esl$ make rubymod
make MYLIB="../libesl.a" SOLINK="-shared -Xlinker -x" CFLAGS="-I/Users/
seven/workspace/test/freeswitch/trunk/libs/esl/src/include -
DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -O2 -ffast-
math -Wall -Werror -Wunused-variable -Wwrite-strings -Wstrict-
prototypes -Wmissing-prototypes" CXXFLAGS="-I/Users/seven/workspace/
test/freeswitch/trunk/libs/esl/src/include -DHAVE_EDITLINE -g -ggdb -
I../../libs/libedit/src/ -fPIC -Wall -Werror -Wno-unused-variable"
CXX_CFLAGS="" -C ruby
g++ -I/Users/seven/workspace/test/freeswitch/trunk/libs/esl/src/
include -DHAVE_EDITLINE -g -ggdb -I../../libs/libedit/src/ -fPIC -Wall
-Werror -Wno-unused-variable -I/opt/local/lib/ruby/1.8/i686-darwin9 -c
esl_wrap.cpp -o esl_wrap.o
g++ -shared -Xlinker -x esl_wrap.o ../libesl.a -lruby -o ESL.so -L.
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [ESL.so] Error 1
Thanks for any help. |
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|