From 5014b80d53cc6fe67a591dc47e4cf7027d09ce02 Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 21 Mar 2014 14:59:01 -0500 Subject: [PATCH] 1/2 of automake for esl perl, at least we have configure detecting things now --- configure.ac | 19 +++++++++++++++++++ libs/esl/Makefile.am | 2 +- libs/esl/perl/Makefile | 38 -------------------------------------- libs/esl/perl/Makefile.am | 30 ++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 39 deletions(-) delete mode 100644 libs/esl/perl/Makefile create mode 100644 libs/esl/perl/Makefile.am diff --git a/configure.ac b/configure.ac index b776db1f6a..f0b13ac778 100644 --- a/configure.ac +++ b/configure.ac @@ -1116,6 +1116,24 @@ AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"]) AM_CONDITIONAL([HAVE_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"]) AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"]) +AC_CHECK_PROG(PERL,perl,[ac_cv_have_perl=yes],[ac_cv_have_perl=no]) +AM_CONDITIONAL([HAVE_PERL],[test "x$ac_cv_have_perl" != "xno"]) + +if test "x$ac_cv_have_perl" != "xno" ; then + PERL_SITEDIR="`$PERL -MConfig -e 'print $Config{sitelibexp}'`" + PERL_LIBDIR="-L`$PERL -MConfig -e 'print $Config{archlib}'`/CORE" + PERL_LIBS="`$PERL -MConfig -e 'print $Config{libs}'`" + PERL_CFLAGS="-w -DMULTIPLICITY `$PERL -MExtUtils::Embed -e ccopts` -DEMBED_PERL" + PERL_LDFLAGS="`$PERL -MExtUtils::Embed -e ldopts` `$PERL -MConfig -e 'print $Config{libs}'`" + PERL_INC="`$PERL -MExtUtils::Embed -e perl_inc`" + AC_SUBST(PERL_SITEDIR) + AC_SUBST(PERL_LIBDIR) + AC_SUBST(PERL_LIBS) + AC_SUBST(PERL_CFLAGS) + AC_SUBST(PERL_LDFLAGS) + AC_SUBST(PERL_INC) +fi + # # Python checks for mod_python # @@ -1406,6 +1424,7 @@ AC_CONFIG_FILES([Makefile build/freeswitch.pc build/modmake.rules libs/esl/Makefile + libs/esl/perl/Makefile libs/xmlrpc-c/include/xmlrpc-c/config.h libs/xmlrpc-c/xmlrpc_config.h libs/xmlrpc-c/config.mk diff --git a/libs/esl/Makefile.am b/libs/esl/Makefile.am index e0af740b8d..b4f7e48253 100644 --- a/libs/esl/Makefile.am +++ b/libs/esl/Makefile.am @@ -67,7 +67,7 @@ swigclean: clean $(MAKE) -C managed swigclean perlmod: $(MYLIB) - $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C perl + $(MAKE) -C perl phpmod: $(MYLIB) $(MAKE) MYLIB="../$(MYLIB)" SOLINK="$(SOLINK)" CFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS)" CXXFLAGS="-I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS)" CXX_CFLAGS="$(CXX_CFLAGS)" -C php diff --git a/libs/esl/perl/Makefile b/libs/esl/perl/Makefile deleted file mode 100644 index a76e9c5e6d..0000000000 --- a/libs/esl/perl/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -PERL=$(shell which perl) -PERL_SITEDIR=$(shell perl -MConfig -e 'print $$Config{sitelibexp}') -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 - -install: ESL.so - install -m 755 ESL.so $(PERL_SITEDIR) - install -m 755 ESL.pm $(PERL_SITEDIR) - install -d -m 755 ESL $(PERL_SITEDIR)/ESL - install -m 755 ESL/* $(PERL_SITEDIR)/ESL \ No newline at end of file diff --git a/libs/esl/perl/Makefile.am b/libs/esl/perl/Makefile.am new file mode 100644 index 0000000000..fc60f15982 --- /dev/null +++ b/libs/esl/perl/Makefile.am @@ -0,0 +1,30 @@ +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) -I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CFLAGS) $(PERL_CFLAGS) -c perlxsi.c -o perlxsi.o + +esl_wrap.o: esl_wrap.cpp + $(CXX) -I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS) $(CXXFLAGS) -w $(PERL_INC) -c esl_wrap.cpp -o esl_wrap.o + +ESL.so: esl_wrap.o perlxsi.o + $(CXX) $(SOLINK) esl_wrap.o perlxsi.o ../.libs/libesl.a $(PERL__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 + +install: ESL.so + install -m 755 ESL.so $(PERL_SITEDIR) + install -m 755 ESL.pm $(PERL_SITEDIR) + install -d -m 755 ESL $(PERL_SITEDIR)/ESL + install -m 755 ESL/* $(PERL_SITEDIR)/ESL