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

@@ -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 *~