config.m4 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. PHP_ARG_WITH(xlsxwriter, xlswriter support,
  2. [ --with-xlswriter Include xlswriter support])
  3. PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
  4. [ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
  5. if test "$PHP_XLSWRITER" != "no" || $PHP_ZLIB_DIR != "no"; then
  6. for i in /usr/local /usr $PHP_ZLIB_DIR; do
  7. if test -f $i/include/zlib/zlib.h; then
  8. ZLIB_DIR=$i
  9. ZLIB_INCDIR=$i/include/zlib
  10. elif test -f $i/include/zlib.h; then
  11. ZLIB_DIR=$i
  12. ZLIB_INCDIR=$i/include
  13. fi
  14. done
  15. if test -z "$ZLIB_DIR"; then
  16. AC_MSG_ERROR(Cannot find zlib)
  17. fi
  18. AC_MSG_CHECKING([for zlib version >= 1.2.8])
  19. ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_INCDIR/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
  20. if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100}'` -lt 1020800; then
  21. AC_MSG_ERROR([zlib version greater or equal to 1.2.8 required])
  22. fi
  23. xls_writer_sources="
  24. library/third_party/minizip/ioapi.c \
  25. library/third_party/minizip/mztools.c \
  26. library/third_party/minizip/unzip.c \
  27. library/third_party/minizip/zip.c \
  28. library/third_party/tmpfileplus/tmpfileplus.c \
  29. library/src/app.c \
  30. library/src/chart.c \
  31. library/src/content_types.c \
  32. library/src/core.c \
  33. library/src/custom.c \
  34. library/src/drawing.c \
  35. library/src/xlsx_format.c \
  36. library/src/hash_table.c \
  37. library/src/packager.c \
  38. library/src/relationships.c \
  39. library/src/shared_strings.c \
  40. library/src/styles.c \
  41. library/src/theme.c \
  42. library/src/utility.c \
  43. library/src/workbook.c \
  44. library/src/worksheet.c \
  45. library/src/xmlwriter.c \
  46. xls_writer.c \
  47. kernel/exception.c \
  48. kernel/resource.c \
  49. kernel/common.c \
  50. kernel/excel.c \
  51. kernel/write.c \
  52. kernel/format.c"
  53. if test -z "$PHP_DEBUG"; then
  54. AC_ARG_ENABLE(debug, [--enable-debug compile with debugging system], [PHP_DEBUG=$enableval],[PHP_DEBUG=no])
  55. fi
  56. PHP_ADD_INCLUDE($XLSWRITER_DIR/include)
  57. PHP_ADD_INCLUDE($ZLIB_INCDIR)
  58. PHP_NEW_EXTENSION(xlswriter, $xls_writer_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  59. PHP_ADD_BUILD_DIR([$ext_builddir/kernel])
  60. fi