|
@@ -1,7 +1,33 @@
|
|
|
PHP_ARG_WITH(xlsxwriter, xlswriter support,
|
|
|
[ --with-xlswriter Include xlswriter support])
|
|
|
|
|
|
-if test "$PHP_XLSWRITER" != "no"; then
|
|
|
+PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
|
|
|
+[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
|
|
|
+
|
|
|
+if test "$PHP_XLSWRITER" != "no" || $PHP_ZLIB_DIR != "no"; then
|
|
|
+
|
|
|
+ for i in /usr/local /usr $PHP_ZLIB_DIR; do
|
|
|
+ if test -f $i/include/zlib/zlib.h; then
|
|
|
+ ZLIB_DIR=$i
|
|
|
+ ZLIB_INCDIR=$i/include/zlib
|
|
|
+ elif test -f $i/include/zlib.h; then
|
|
|
+ ZLIB_DIR=$i
|
|
|
+ ZLIB_INCDIR=$i/include
|
|
|
+ fi
|
|
|
+ done
|
|
|
+
|
|
|
+ if test -z "$ZLIB_DIR"; then
|
|
|
+ AC_MSG_ERROR(Cannot find zlib)
|
|
|
+ fi
|
|
|
+
|
|
|
+ AC_MSG_CHECKING([for zlib version >= 1.2.8])
|
|
|
+
|
|
|
+ ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_INCDIR/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
|
|
|
+
|
|
|
+ if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100}'` -lt 1020800; then
|
|
|
+ AC_MSG_ERROR([zlib version greater or equal to 1.2.8 required])
|
|
|
+ fi
|
|
|
+
|
|
|
xls_writer_sources="
|
|
|
library/third_party/minizip/ioapi.c \
|
|
|
library/third_party/minizip/mztools.c \
|
|
@@ -41,6 +67,7 @@ if test "$PHP_XLSWRITER" != "no"; then
|
|
|
fi
|
|
|
|
|
|
PHP_ADD_INCLUDE($XLSWRITER_DIR/include)
|
|
|
+ PHP_ADD_INCLUDE($ZLIB_INCDIR)
|
|
|
|
|
|
PHP_NEW_EXTENSION(xlswriter, $xls_writer_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
|
|
|