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