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.
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:
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 -- Meet us at ClueCon! http://www.cluecon.com
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:
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:
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
-- Meet us at ClueCon! http://www.cluecon.com
_______________________________________________ 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
On May 26, 2009, at 11:20 AM, dujinfang wrote:
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
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 -- Meet us at ClueCon! http://www.cluecon.com
Hi Brian, Sorry responding late. I still cannot get this work, can you take a look? http://pastebin.freeswitch.org/9877 Everything works fine on Linux but not on my MAC. I have the default ruby framework and port install on /opt/local/bin/ruby, however, even I changed the Makefile to use the default ruby framework, it just doesn't work though the ESL.so compiled successfully. Where I'm wrong? Thanks. 2009/5/27 Brian West <brian@freeswitch.org>
On May 26, 2009, at 11:20 AM, dujinfang wrote:
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
Just to mention, there is also a Ruby library here for FreeSWITCH, similar to ESL, it might interest you. http://code.rubyists.com/projects/fs http://github.com/bougyman/freeswitcher/tree/master http://blog.rubyists.com/2009/05/19/ruby-freeswitch-love On Wed, Jul 29, 2009 at 12:45 AM, Seven Du <dujinfang@gmail.com> wrote:
Hi Brian,
Sorry responding late. I still cannot get this work, can you take a look?
http://pastebin.freeswitch.org/9877
Everything works fine on Linux but not on my MAC. I have the default ruby framework and port install on /opt/local/bin/ruby, however, even I changed the Makefile to use the default ruby framework, it just doesn't work though the ESL.so compiled successfully. Where I'm wrong?
Thanks.
2009/5/27 Brian West <brian@freeswitch.org>
On May 26, 2009, at 11:20 AM, dujinfang wrote:
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
_______________________________________________ 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
participants (4)
-
Brian West
-
Diego Viola
-
dujinfang
-
Seven Du