2008-04-25 22:12:01 +00:00
|
|
|
BASE=../../../..
|
|
|
|
PERL = `which perl`
|
|
|
|
PERL_LIBDIR =-L$(shell perl -MConfig -e 'print $$Config{archlib}')/CORE
|
|
|
|
PERL_LIBS =$(shell perl -MConfig -e 'print $$Config{libs}')
|
|
|
|
LOCAL_CFLAGS= -w -DMULTIPLICITY $(shell $(PERL) -MExtUtils::Embed -e ccopts) -DEMBED_PERL
|
|
|
|
LOCAL_LDFLAGS=$(shell $(PERL) -MExtUtils::Embed -e ldopts) $(shell $(PERL) -MConfig -e 'print $$Config{libs}')
|
|
|
|
LOCAL_OBJS=freeswitch_perl.o mod_perl_wrap.o perlxsi.o
|
|
|
|
VERBOSE=1
|
|
|
|
|
|
|
|
include $(BASE)/build/modmake.rules
|
|
|
|
|
2008-04-30 19:42:26 +00:00
|
|
|
|
2008-07-14 20:37:36 +00:00
|
|
|
reswig: swigclean mod_perl_wrap.cpp
|
|
|
|
|
2008-04-25 22:12:01 +00:00
|
|
|
swigclean: clean
|
2008-05-02 16:43:54 +00:00
|
|
|
rm -f mod_perl_wrap.* freeswitch.so freeswitch.pm
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2008-04-30 19:42:26 +00:00
|
|
|
mod_perl_wrap.cpp:
|
2008-04-25 22:12:01 +00:00
|
|
|
swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i
|
2008-05-01 22:56:14 +00:00
|
|
|
echo "#include \"mod_perl_extra.c\"" >> mod_perl_wrap.cpp
|
2008-07-14 20:37:36 +00:00
|
|
|
patch -s -p0 -i hack.diff
|
2008-05-01 22:56:14 +00:00
|
|
|
|
2008-07-16 21:06:14 +00:00
|
|
|
orig: mod_perl_wrap.cpp
|
|
|
|
patch -R -s -p0 -i hack.diff
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2009-04-17 20:21:35 +00:00
|
|
|
freeswitch.$(LIBTOOL_LIB_EXTEN): $(LOCAL_OBJS) $(LOCAL_LIBADD)
|
|
|
|
$(CXXLINK) $(SOLINK) -o freeswitch.$(LIBTOOL_LIB_EXTEN) $(LOCAL_OBJS) $(LOCAL_LIBADD) $(LDFLAGS)
|
2008-04-25 22:12:01 +00:00
|
|
|
|
2009-04-17 20:21:35 +00:00
|
|
|
local_all: freeswitch.$(LIBTOOL_LIB_EXTEN)
|
2008-04-25 22:12:01 +00:00
|
|
|
|
|
|
|
.perlok:
|
|
|
|
@(${PERL} -V | grep -i usemultiplicity=define >/dev/null && echo Phew, You have the right perl.) \
|
|
|
|
|| ((echo Sorry, you need to compile perl with threads and multiplicity.&& exit 1))
|
|
|
|
@touch .perlok
|
|
|
|
|
|
|
|
local_clean:
|
2009-04-17 20:21:35 +00:00
|
|
|
rm -fr *~ .perlok .libs freeswitch.$(LIBTOOL_LIB_EXTEN) 2>/dev/null
|
2008-04-25 22:12:01 +00:00
|
|
|
|
|
|
|
depend_install:
|
2010-01-11 18:07:48 +00:00
|
|
|
mkdir -p $(DESTDIR)$(prefix)/perl
|
|
|
|
$(LTINSTALL) freeswitch.$(LIBTOOL_LIB_EXTEN) freeswitch.pm $(DESTDIR)$(prefix)/perl
|
|
|
|
if [ ! -f $(DESTDIR)$(prefix)/perl/freeswitch.pm ] ; then $(LTINSTALL) freeswitch.pm $(DESTDIR)$(prefix)/perl ; fi
|