From 1be5dad0430089cb9042c13bb1784151954eb90d Mon Sep 17 00:00:00 2001
From: Raymond Chandler <intralanman@freeswitch.org>
Date: Thu, 18 Feb 2010 02:35:08 +0000
Subject: [PATCH] add beginning of Makefile for osx

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16684 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 libs/esl/perl/Makefile.Darwin | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 libs/esl/perl/Makefile.Darwin

diff --git a/libs/esl/perl/Makefile.Darwin b/libs/esl/perl/Makefile.Darwin
new file mode 100644
index 0000000000..058e0d3849
--- /dev/null
+++ b/libs/esl/perl/Makefile.Darwin
@@ -0,0 +1,32 @@
+PERL=$(shell 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}')
+GCC_WARNING_JUNK=-w
+PERL_INC=$(shell $(PERL) -MExtUtils::Embed -e perl_inc)
+all: ESL.so
+
+esl_wrap.cpp:
+	swig -module ESL -shadow -perl5 -c++ -DMULTIPLICITY -I../src/include -o esl_wrap.cpp ../ESL.i
+
+perlxsi.c:
+	$(PERL) -MExtUtils::Embed -e xsinit -- -o perlxsi.c
+
+perlxsi.o: perlxsi.c
+	$(CC) $(CC_CFLAGS) $(CFLAGS) $(LOCAL_CFLAGS) -c perlxsi.c -o perlxsi.o
+
+esl_wrap.o: esl_wrap.cpp
+	$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(GCC_WARNING_JUNK) $(PERL_INC) -c esl_wrap.cpp -o esl_wrap.o
+
+ESL.so: esl_wrap.o perlxsi.o
+	$(CXX) $(SOLINK) esl_wrap.o perlxsi.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+
+clean:
+	rm -f *.o *.so *~
+
+swigclean:
+	rm -f esl_wrap.* ESL.so ESL.pm perlxsi.*
+
+reswig:	swigclean esl_wrap.cpp perlxsi.c
+