]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
first 1/2 of automake for esl phpmod
authorBrian West <brian@freeswitch.org>
Fri, 21 Mar 2014 21:01:35 +0000 (16:01 -0500)
committerBrian West <brian@freeswitch.org>
Fri, 21 Mar 2014 21:01:35 +0000 (16:01 -0500)
configure.ac
libs/esl/php/Makefile.am [moved from libs/esl/php/Makefile with 52% similarity]

index f0b13ac7789872f20f18e2fa6af2dd5e26411224..6b7386f2768f86b5a4d6ea9c39e7a88bb0f0cf58 100644 (file)
@@ -1116,6 +1116,10 @@ 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"])
 
+#
+# perl checks
+#
+
 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"])
 
@@ -1134,6 +1138,31 @@ if test "x$ac_cv_have_perl" != "xno" ; then
    AC_SUBST(PERL_INC)
 fi
 
+#
+# php checks
+#
+
+AC_CHECK_PROG(PHP,php,[ac_cv_have_php=yes],[ac_cv_have_php=no])
+AC_CHECK_PROG(PHP_CONFIG,php-config,[ac_cv_have_php_config=yes],[ac_cv_have_php_config=no])
+AM_CONDITIONAL([HAVE_PHP],[test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"])
+
+if test "x$ac_cv_have_php" != "xno" -a "x$ac_cv_have_php_config" != "xno"; then
+   PHP=php
+   PHP_CONFIG=php-config
+   PHP_LDFLAGS="`$PHP_CONFIG --ldflags`"
+   PHP_LIBS="`$PHP_CONFIG --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g'`"
+   PHP_EXT_DIR="`$PHP_CONFIG --extension-dir`"
+   PHP_INC_DIR="`$PHP -r 'echo ini_get("include_path");' | cut -d: -f2`"
+   PHP_INI_DIR="`$PHP_CONFIG --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=`"
+   PHP_CFLAGS="`$PHP_CONFIG --includes`"
+   AC_SUBST(PHP_LDFLAGS)
+   AC_SUBST(PHP_LIBS)
+   AC_SUBST(PHP_EXT_DIR)
+   AC_SUBST(PHP_INC_DIR)
+   AC_SUBST(PHP_INI_DIR)
+   AC_SUBST(PHP_CFLAGS)
+fi
+
 #
 # Python checks for mod_python
 #
@@ -1425,6 +1454,7 @@ AC_CONFIG_FILES([Makefile
                build/modmake.rules
                 libs/esl/Makefile
                 libs/esl/perl/Makefile
+                libs/esl/php/Makefile
                libs/xmlrpc-c/include/xmlrpc-c/config.h
                libs/xmlrpc-c/xmlrpc_config.h
                libs/xmlrpc-c/config.mk
similarity index 52%
rename from libs/esl/php/Makefile
rename to libs/esl/php/Makefile.am
index 7cc42d2725e968096661612cbcf913d7c2440b27..d2c04c55c0f6dacf07b226d2d2ef72cf3891f716 100644 (file)
@@ -1,16 +1,3 @@
-PHP=php
-PHP_CONFIG=php-config
-
-PHP_LDFLAGS=$(shell $(PHP_CONFIG) --ldflags)
-PHP_LIBS=$(shell $(PHP_CONFIG) --libs | sed -r 's/ ?-l(bz2|pcre|xml2|gssapi_krb5|krb5|k5crypto|com_err|history|z|readline|gmp|ssl|crypto)//g')
-PHP_EXT_DIR=$(shell $(PHP_CONFIG) --extension-dir)
-PHP_INC_DIR=$(shell $(PHP) -r 'echo ini_get("include_path");' | cut -d: -f2)
-PHP_INI_DIR=$(shell $(PHP_CONFIG) --configure-options | tr " " "\n" | grep -- --with-config-file-scan-dir | cut -f2 -d=)
-
-LOCAL_CFLAGS=$(shell php-config --includes)
-LOCAL_LDFLAGS=$(PHP_LDFLAGS) $(PHP_LIBS)
-LOCAL_LDFLAGS+=-lpthread
-
 WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function
 
 all: ESL.so
@@ -20,10 +7,10 @@ esl_wrap.cpp:
        sed -e 's/  char \*type_name;/  const char \*type_name;/' -i esl_wrap.cpp
 
 esl_wrap.o: esl_wrap.cpp
-       $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o
+       $(CXX) -I$(switch_srcdir)/libs/esl/src/include $(SWITCH_AM_CXXFLAGS) $(CXXFLAGS) $(PHP_CFLAGS) $(WRAP_GCC_WARNING_SILENCE) -c esl_wrap.cpp -o esl_wrap.o
 
 ESL.so: esl_wrap.o
-       $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o ESL.so -L. $(LIBS)
+       $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(PHP_LDFLAGS) $(PHP_LIBS) -lpthread -o ESL.so -L. $(LIBS)
 
 clean:
        rm -f *.o *.so *~