1 Star 0 Fork 96

alp/php-ext-xlswriter

forked from viest/php-ext-xlswriter 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
config.m4 8.04 KB
一键复制 编辑 原始数据 按行查看 历史
PHP_ARG_WITH(xlswriter, xlswriter support,
[ --with-xlswriter Include xlswriter support], yes)
PHP_ARG_WITH(libxlsxwriter, system libxlsxwriter,
[ --with-libxlsxwriter=DIR Use system libxlsxwriter], no, no)
PHP_ARG_WITH(libxlsxio, system libxlsxio,
[ --with-libxlsxio=DIR Use system libxlsxio], no, no)
PHP_ARG_ENABLE(reader, enable xlsx reader support,
[ --enable-reader Enable xlsx reader?], no, no)
if test "$PHP_XLSWRITER" != "no"; then
xls_writer_sources="
xlswriter.c \
kernel/exception.c \
kernel/resource.c \
kernel/common.c \
kernel/excel.c \
kernel/write.c \
kernel/format.c \
kernel/chart.c \
"
xls_read_sources="
kernel/read.c \
kernel/csv.c \
"
minizip_sources="
library/libxlsxwriter/third_party/minizip/ioapi.c \
library/libxlsxwriter/third_party/minizip/mztools.c \
library/libxlsxwriter/third_party/minizip/unzip.c \
library/libxlsxwriter/third_party/minizip/zip.c \
"
libxlsxwriter_sources="
library/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c \
library/libxlsxwriter/src/app.c \
library/libxlsxwriter/src/chart.c \
library/libxlsxwriter/src/content_types.c \
library/libxlsxwriter/src/core.c \
library/libxlsxwriter/src/custom.c \
library/libxlsxwriter/src/drawing.c \
library/libxlsxwriter/src/format.c \
library/libxlsxwriter/src/hash_table.c \
library/libxlsxwriter/src/packager.c \
library/libxlsxwriter/src/relationships.c \
library/libxlsxwriter/src/shared_strings.c \
library/libxlsxwriter/src/styles.c \
library/libxlsxwriter/src/theme.c \
library/libxlsxwriter/src/utility.c \
library/libxlsxwriter/src/workbook.c \
library/libxlsxwriter/src/worksheet.c \
library/libxlsxwriter/src/xmlwriter.c \
"
libexpat="
library/libexpat/expat/lib/loadlibrary.c \
library/libexpat/expat/lib/xmlparse.c \
library/libexpat/expat/lib/xmlrole.c \
library/libexpat/expat/lib/xmltok.c \
library/libexpat/expat/lib/xmltok_impl.c \
library/libexpat/expat/lib/xmltok_ns.c \
"
libxlsxio="
library/libxlsxio/lib/xlsxio_read.c \
library/libxlsxio/lib/xlsxio_read_sharedstrings.c \
"
AC_MSG_CHECKING([Check libxlsxwriter library])
if test "$PHP_LIBXLSXWRITER" != "no"; then
for i in $PHP_LIBXLSXWRITER /usr/local /usr; do
if test -r $i/include/xlsxwriter.h; then
XLSXWRITER_DIR=$i
AC_MSG_RESULT([found in $i])
break
fi
done
if test -z "$XLSXWRITER_DIR"; then
AC_MSG_ERROR([libxlsxwriter library not found])
else
PHP_ADD_INCLUDE($XLSXWRITER_DIR/include)
PHP_CHECK_LIBRARY(xlsxwriter, worksheet_write_string,
[
PHP_ADD_LIBRARY_WITH_PATH(xlsxwriter, $i/$PHP_LIBDIR, XLSWRITER_SHARED_LIBADD)
],[
AC_MSG_ERROR([Wrong libxlsxwriter version or library not found])
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(xlsxwriter, lxw_version,
[
AC_DEFINE(HAVE_LXW_VERSION, 1, [ lxw_version available in 0.7.9 ])
],[
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(xlsxwriter, lxw_chartsheet_new,
[
AC_DEFINE(HAVE_LXW_CHARTSHEET_NEW, 1, [ lxw_chartsheet_new available in 0.8.0 ])
],[
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(xlsxwriter, workbook_add_vba_project,
[
AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ])
],[
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
PHP_CHECK_LIBRARY(xlsxwriter, lxw_fopen,
[
AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
],[
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
fi
AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ])
else
AC_MSG_RESULT([use the bundled library])
xls_writer_sources="$xls_writer_sources $libxlsxwriter_sources"
PHP_ADD_INCLUDE([$srcdir/library/libxlsxwriter/include])
XLSXWRITER_VERSION=`$EGREP "define LXW_VERSION" $srcdir/library/include/libxlsxwriter/xlsxwriter.h | $SED -e 's/[[^0-9\.]]//g'`
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 709; then
AC_DEFINE(HAVE_LXW_VERSION, 1, [ lxw_version available in 0.7.9 ])
fi
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 800; then
AC_DEFINE(HAVE_LXW_CHARTSHEET_NEW, 1, [ lxw_chartsheet_new available in 0.8.0 ])
fi
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 807; then
AC_DEFINE(HAVE_WORKBOOK_ADD_VBA_PROJECT, 1, [ workbook_add_vba_project available in 0.8.7 ])
fi
if test `echo $XLSXWRITER_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -ge 808; then
AC_DEFINE(HAVE_LXW_OPEN, 1, [ lxw_fopen available in 0.8.8 ])
fi
dnl see library/CMakeLists.txt
LIBOPT="-DNOCRYPT -DNOUNCRYPT"
fi
if test "$PHP_READER" = "yes"; then
AC_MSG_CHECKING([Check libxlsxwriter library])
if test "$PHP_LIBXLSXIO" != "no"; then
for i in $PHP_LIBXLSXIO /usr/local /usr; do
if test -r $i/include/xlsxio_read.h; then
XLSXIO_DIR=$i
AC_MSG_RESULT([found in $i])
break
fi
done
if test -z "$XLSXIO_DIR"; then
AC_MSG_ERROR([libxlsxio library not found])
else
PHP_ADD_INCLUDE($XLSXIO_DIR/include)
PHP_CHECK_LIBRARY(xlsxio_read, xlsxioread_sheet_open,
[
PHP_ADD_LIBRARY_WITH_PATH(xlsxio_read, $i/$PHP_LIBDIR, XLSWRITER_SHARED_LIBADD)
],[
AC_MSG_ERROR([Wrong libxlsxio version or library not found])
],[
-L$XLSXWRITER_DIR/$PHP_LIBDIR -lm
])
fi
AC_DEFINE(HAVE_LIBXLSXIO, 1, [ use system libxlsxwriter ])
else
AC_MSG_RESULT([use the bundled library])
xls_writer_sources="$xls_writer_sources $libexpat"
PHP_ADD_INCLUDE([$srcdir/library/libexpat/expat/lib])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib])
LIBOPT="$LIBOPT -DXML_POOR_ENTROPY"
xls_writer_sources="$xls_writer_sources $libxlsxio"
PHP_ADD_INCLUDE([$srcdir/library/libxlsxio/include])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib])
LIBOPT="$LIBOPT -DUSE_MINIZIP"
fi
xls_writer_sources="$xls_writer_sources $xls_read_sources"
AC_DEFINE(ENABLE_READER, 1, [enable reader])
fi
if test "$PHP_LIBXLSXIO" = "no" || test "$PHP_LIBXLSXWRITER" = "no"; then
xls_writer_sources="$xls_writer_sources $minizip_sources"
fi
if test -z "$PHP_DEBUG"; then
AC_ARG_ENABLE(debug, [--enable-debug compile with debugging system], [PHP_DEBUG=$enableval],[PHP_DEBUG=no])
fi
PHP_SUBST(XLSWRITER_SHARED_LIBADD)
PHP_NEW_EXTENSION(xlswriter, $xls_writer_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $LIBOPT)
PHP_ADD_INCLUDE([$srcdir])
PHP_ADD_INCLUDE([$srcdir/include])
PHP_ADD_BUILD_DIR([$abs_builddir/kernel])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/src])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/minizip])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/tmpfileplus])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib])
PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib])
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/alpjade/php-ext-xlswriter.git
git@gitee.com:alpjade/php-ext-xlswriter.git
alpjade
php-ext-xlswriter
php-ext-xlswriter
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385