first 1/2 of automake for esl phpmod

This commit is contained in:
Brian West 2014-03-21 16:01:35 -05:00
parent 4e734db296
commit 719d37dbf8
2 changed files with 32 additions and 15 deletions

View 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_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"]) 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]) 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"]) 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) AC_SUBST(PERL_INC)
fi 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 # Python checks for mod_python
# #
@ -1425,6 +1454,7 @@ AC_CONFIG_FILES([Makefile
build/modmake.rules build/modmake.rules
libs/esl/Makefile libs/esl/Makefile
libs/esl/perl/Makefile libs/esl/perl/Makefile
libs/esl/php/Makefile
libs/xmlrpc-c/include/xmlrpc-c/config.h libs/xmlrpc-c/include/xmlrpc-c/config.h
libs/xmlrpc-c/xmlrpc_config.h libs/xmlrpc-c/xmlrpc_config.h
libs/xmlrpc-c/config.mk libs/xmlrpc-c/config.mk

View 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 WRAP_GCC_WARNING_SILENCE=-Wno-unused-label -Wno-unused-function
all: ESL.so all: ESL.so
@ -20,10 +7,10 @@ esl_wrap.cpp:
sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp sed -e 's/ char \*type_name;/ const char \*type_name;/' -i esl_wrap.cpp
esl_wrap.o: 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 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: clean:
rm -f *.o *.so *~ rm -f *.o *.so *~