Bläddra i källkod

Merge pull request #91 from viest/bunled_lib

Fix(build):Bunled library
viest 6 år sedan
förälder
incheckning
cfcdd48463
54 ändrade filer med 122 tillägg och 67 borttagningar
  1. 1 0
      .travis.yml
  2. 10 25
      README_zh.md
  3. 69 13
      config.m4
  4. 7 7
      config.w32
  5. 0 4
      kernel/excel.c
  6. 0 4
      kernel/format.c
  7. 4 0
      kernel/include.h
  8. 6 1
      kernel/write.c
  9. 0 0
      library/include/crypt.h
  10. 0 0
      library/include/ioapi.h
  11. 0 0
      library/include/iowin32.h
  12. 0 0
      library/include/mztools.h
  13. 0 0
      library/include/tmpfileplus.h
  14. 0 0
      library/include/unzip.h
  15. 0 0
      library/include/xlsxwriter.h
  16. 0 0
      library/include/xlsxwriter/app.h
  17. 0 0
      library/include/xlsxwriter/chart.h
  18. 0 0
      library/include/xlsxwriter/common.h
  19. 0 0
      library/include/xlsxwriter/content_types.h
  20. 0 0
      library/include/xlsxwriter/core.h
  21. 0 0
      library/include/xlsxwriter/custom.h
  22. 0 0
      library/include/xlsxwriter/drawing.h
  23. 0 0
      library/include/xlsxwriter/format.h
  24. 0 0
      library/include/xlsxwriter/hash_table.h
  25. 0 0
      library/include/xlsxwriter/packager.h
  26. 0 0
      library/include/xlsxwriter/relationships.h
  27. 0 0
      library/include/xlsxwriter/shared_strings.h
  28. 0 0
      library/include/xlsxwriter/styles.h
  29. 0 0
      library/include/xlsxwriter/theme.h
  30. 0 0
      library/include/xlsxwriter/third_party/ioapi.h
  31. 0 0
      library/include/xlsxwriter/third_party/queue.h
  32. 0 0
      library/include/xlsxwriter/third_party/tmpfileplus.h
  33. 0 0
      library/include/xlsxwriter/third_party/tree.h
  34. 0 0
      library/include/xlsxwriter/third_party/zip.h
  35. 0 0
      library/include/xlsxwriter/utility.h
  36. 0 0
      library/include/xlsxwriter/workbook.h
  37. 0 0
      library/include/xlsxwriter/worksheet.h
  38. 0 0
      library/include/xlsxwriter/xmlwriter.h
  39. 0 0
      library/include/zip.h
  40. 0 0
      library/src/format.c
  41. 1 1
      tests/001.phpt
  42. 1 1
      tests/002.phpt
  43. 1 1
      tests/003.phpt
  44. 1 1
      tests/004.phpt
  45. 1 1
      tests/005.phpt
  46. 1 1
      tests/006.phpt
  47. 1 1
      tests/007.phpt
  48. 1 1
      tests/008.phpt
  49. 1 1
      tests/009.phpt
  50. 1 1
      tests/010.phpt
  51. 1 1
      tests/011.phpt
  52. 1 1
      tests/012.phpt
  53. 1 1
      travis/run-test.sh
  54. 12 0
      xls_writer.c

+ 1 - 0
.travis.yml

@@ -11,6 +11,7 @@ php:
   - 7.0
   - 7.1
   - 7.2
+  - 7.3
 
 notifications:
   email: [email protected]

+ 10 - 25
README_zh.md

@@ -31,10 +31,6 @@ Authon: viest [[email protected]](mailto:[email protected])
 
 sudo apt-get install -y zlib1g-dev
 
-git clone https://github.com/jmcnamara/libxlsxwriter.git
-
-cd libxlsxwriter && make && sudo make install
-
 # Excel-Export
 
 git clone https://github.com/viest/php-ext-excel-export.git
@@ -53,7 +49,7 @@ make && make install
 ```bash
 # 依赖
 
-brew install libxlsxwriter
+brew install zlib
 
 # Excel-Export
 
@@ -77,25 +73,14 @@ make && make install
 ```bash
 cd PHP_BUILD_PATH/deps
 
-git clone --recursive https://github.com/jmcnamara/MSVCLibXlsxWriter.git
+DownloadFile http://zlib.net/zlib-1.2.11.tar.gz
+7z x zlib-1.2.11.tar.gz > NUL
+7z x zlib-1.2.11.tar > NUL
+cd zlib-1.2.11
+cmake -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS_RELEASE="/MT"
+cmake --build . --config "Release"
 ```
 
-要构建依赖库的DLL,打开LibXlsxWriterProj/LibXlsxWriter。在MS Visual Studio中使用sln项目,并使用`"构建 ->构建解决方案"`菜单项构建解决方案。
-
-在默认配置中,这将构建一个`x64调试`LibXlsxWriter .lib和.dll,你也可以选择`释放`版本构建,构建完成后,你可以在一下路径中找到对应的DLL
-
-```bash
-PHP_BUILD_PATH\deps\MSVCLibXlsxWriter\LibXlsxWriterProj\[x64|x86]\Debug
-
-# or
-
-PHP_BUILD_PATH\deps\MSVCLibXlsxWriter\LibXlsxWriterProj\[x64|x86]\Release
-```
-
-32\64位: 复制 .dll 文件到 c:\Windows\System*
-
-最后添加系统环境变量LIB,指向DLL文件目录
-
 ##### 扩展
 
 ```bash
@@ -103,11 +88,11 @@ cd PHP_PATH/ext
 
 git clone https://github.com/viest/php-ext-excel-export.git
 
-cd PHP_PATH
+cd EXT_PATH
 
-buildconf.bat
+phpize
 
-configure.bat --disable-all --enable-cli --with-xlswriter
+configure.bat --with-xlswriter --with-extra-libs=PATH\zlib-1.2.11\Release --with-extra-includes=PATH\zlib-1.2.11
 
 nmake
 ```

+ 69 - 13
config.m4

@@ -1,5 +1,8 @@
 PHP_ARG_WITH(xlsxwriter, xlswriter support,
-[  --with-xlswriter           Include xlswriter support])
+[  --with-xlswriter           Include xlswriter support], yes)
+
+PHP_ARG_WITH(libxlsxwriter, system libxlsswriter,
+[  --with-libxlsxwriter=DIR Use system library], no, no)
 
 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)
@@ -29,20 +32,27 @@ if test "$PHP_XLSWRITER" != "no" || $PHP_ZLIB_DIR != "no"; then
     fi
 
     xls_writer_sources="
+    xls_writer.c \
+    kernel/exception.c \
+    kernel/resource.c \
+    kernel/common.c \
+    kernel/excel.c \
+    kernel/write.c \
+    kernel/format.c \
+    "
+    libxlsxwriter_sources="
     library/third_party/minizip/ioapi.c \
     library/third_party/minizip/mztools.c \
     library/third_party/minizip/unzip.c \
     library/third_party/minizip/zip.c \
-
     library/third_party/tmpfileplus/tmpfileplus.c \
-
     library/src/app.c \
     library/src/chart.c \
     library/src/content_types.c \
     library/src/core.c \
     library/src/custom.c \
     library/src/drawing.c \
-    library/src/xlsx_format.c \
+    library/src/format.c \
     library/src/hash_table.c \
     library/src/packager.c \
     library/src/relationships.c \
@@ -53,21 +63,67 @@ if test "$PHP_XLSWRITER" != "no" || $PHP_ZLIB_DIR != "no"; then
     library/src/workbook.c \
     library/src/worksheet.c \
     library/src/xmlwriter.c \
+    "
 
-    xls_writer.c \
-    kernel/exception.c \
-    kernel/resource.c \
-    kernel/common.c \
-    kernel/excel.c \
-    kernel/write.c \
-    kernel/format.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
+            ])
+        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/include])
+
+        XLSXWRITER_VERSION=`$EGREP "define LXW_VERSION" $srcdir/library/include/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}'` -lt 800; 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
+    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_ADD_INCLUDE($XLSWRITER_DIR/include)
-    PHP_ADD_INCLUDE($ZLIB_INCDIR)
+    PHP_SUBST(XLSWRITER_SHARED_LIBADD)
 
     PHP_NEW_EXTENSION(xlswriter, $xls_writer_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
 

+ 7 - 7
config.w32

@@ -6,19 +6,19 @@ if (PHP_XLSWRITER != "no") {
 
     MESSAGE("Include Path:" + configure_module_dirname + "\\include");
 
-    if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_XLSWRITER) && 
+    if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_XLSWRITER) &&
 		CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_XLSWRITER", "..\\zlib;" + php_usual_include_suspects) &&
-        CHECK_HEADER_ADD_INCLUDE("xlsxwriter.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\include") &&
-		CHECK_HEADER_ADD_INCLUDE("packager.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\include\\xlsxwriter") &&
-		CHECK_HEADER_ADD_INCLUDE("zip.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\include\\xlsxwriter\\third_party")) {        
-	
+        CHECK_HEADER_ADD_INCLUDE("xlsxwriter.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\library\\include") &&
+		CHECK_HEADER_ADD_INCLUDE("packager.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\library\\include\\xlsxwriter") &&
+		CHECK_HEADER_ADD_INCLUDE("zip.h", "CFLAGS_XLSWRITER", PHP_XLSWRITER + ";" + configure_module_dirname + "\\library\\include\\xlsxwriter\\third_party")) {
+
 		EXTENSION("xlswriter", "xls_writer.c");
 
         ADD_SOURCES(configure_module_dirname + "\\library\\third_party\\minizip", "ioapi.c iowin32.c mztools.c unzip.c zip.c", "xlswriter");
         ADD_SOURCES(configure_module_dirname + "\\library\\third_party\\tmpfileplus", "tmpfileplus.c", "xlswriter");
-        ADD_SOURCES(configure_module_dirname + "\\library\\src", "app.c chart.c content_types.c core.c custom.c drawing.c xlsx_format.c hash_table.c packager.c relationships.c shared_strings.c styles.c theme.c utility.c workbook.c worksheet.c xmlwriter.c", "xlswriter");
+        ADD_SOURCES(configure_module_dirname + "\\library\\src", "app.c chart.c content_types.c core.c custom.c drawing.c format.c hash_table.c packager.c relationships.c shared_strings.c styles.c theme.c utility.c workbook.c worksheet.c xmlwriter.c", "xlswriter");
         ADD_SOURCES(configure_module_dirname + "\\kernel", "common.c resource.c exception.c excel.c write.c format.c", "xlswriter");
-        
+
 		ADD_FLAG("CFLAGS_XLSWRITER", ' /I "' + configure_module_dirname + '" ');
 
     } else {

+ 0 - 4
kernel/excel.c

@@ -10,10 +10,6 @@
   +----------------------------------------------------------------------+
 */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include "include.h"
 
 zend_class_entry *vtiful_xls_ce;

+ 0 - 4
kernel/format.c

@@ -10,10 +10,6 @@
   +----------------------------------------------------------------------+
 */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include "include.h"
 #include "ext/standard/php_var.h"
 

+ 4 - 0
kernel/include.h

@@ -13,6 +13,10 @@
 #ifndef PHP_XLS_WRITER_INCLUDE_H
 #define PHP_XLS_WRITER_INCLUDE_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <php.h>
 
 #include "zend_exceptions.h"

+ 6 - 1
kernel/write.c

@@ -367,8 +367,13 @@ _prepare_drawings(lxw_workbook *self)
 
         STAILQ_FOREACH(image_options, worksheet->chart_data, list_pointers) {
             chart_ref_id++;
+#ifdef HAVE_LXW_CHARTSHEET_NEW
+            lxw_worksheet_prepare_chart(worksheet, chart_ref_id, drawing_id,
+                                        image_options, 0);
+#else
             lxw_worksheet_prepare_chart(worksheet, chart_ref_id, drawing_id,
                                         image_options);
+#endif
             if (image_options->chart)
                 STAILQ_INSERT_TAIL(self->ordered_charts, image_options->chart,
                                    ordered_list_pointers);
@@ -755,4 +760,4 @@ _populate_range(lxw_workbook *self, lxw_series_range *range)
 {
     _populate_range_dimensions(self, range);
     _populate_range_data_cache(self, range);
-}
+}

+ 0 - 0
include/crypt.h → library/include/crypt.h


+ 0 - 0
include/ioapi.h → library/include/ioapi.h


+ 0 - 0
include/iowin32.h → library/include/iowin32.h


+ 0 - 0
include/mztools.h → library/include/mztools.h


+ 0 - 0
include/tmpfileplus.h → library/include/tmpfileplus.h


+ 0 - 0
include/unzip.h → library/include/unzip.h


+ 0 - 0
include/xlsxwriter.h → library/include/xlsxwriter.h


+ 0 - 0
include/xlsxwriter/app.h → library/include/xlsxwriter/app.h


+ 0 - 0
include/xlsxwriter/chart.h → library/include/xlsxwriter/chart.h


+ 0 - 0
include/xlsxwriter/common.h → library/include/xlsxwriter/common.h


+ 0 - 0
include/xlsxwriter/content_types.h → library/include/xlsxwriter/content_types.h


+ 0 - 0
include/xlsxwriter/core.h → library/include/xlsxwriter/core.h


+ 0 - 0
include/xlsxwriter/custom.h → library/include/xlsxwriter/custom.h


+ 0 - 0
include/xlsxwriter/drawing.h → library/include/xlsxwriter/drawing.h


+ 0 - 0
include/xlsxwriter/format.h → library/include/xlsxwriter/format.h


+ 0 - 0
include/xlsxwriter/hash_table.h → library/include/xlsxwriter/hash_table.h


+ 0 - 0
include/xlsxwriter/packager.h → library/include/xlsxwriter/packager.h


+ 0 - 0
include/xlsxwriter/relationships.h → library/include/xlsxwriter/relationships.h


+ 0 - 0
include/xlsxwriter/shared_strings.h → library/include/xlsxwriter/shared_strings.h


+ 0 - 0
include/xlsxwriter/styles.h → library/include/xlsxwriter/styles.h


+ 0 - 0
include/xlsxwriter/theme.h → library/include/xlsxwriter/theme.h


+ 0 - 0
include/xlsxwriter/third_party/ioapi.h → library/include/xlsxwriter/third_party/ioapi.h


+ 0 - 0
include/xlsxwriter/third_party/queue.h → library/include/xlsxwriter/third_party/queue.h


+ 0 - 0
include/xlsxwriter/third_party/tmpfileplus.h → library/include/xlsxwriter/third_party/tmpfileplus.h


+ 0 - 0
include/xlsxwriter/third_party/tree.h → library/include/xlsxwriter/third_party/tree.h


+ 0 - 0
include/xlsxwriter/third_party/zip.h → library/include/xlsxwriter/third_party/zip.h


+ 0 - 0
include/xlsxwriter/utility.h → library/include/xlsxwriter/utility.h


+ 0 - 0
include/xlsxwriter/workbook.h → library/include/xlsxwriter/workbook.h


+ 0 - 0
include/xlsxwriter/worksheet.h → library/include/xlsxwriter/worksheet.h


+ 0 - 0
include/xlsxwriter/xmlwriter.h → library/include/xlsxwriter/xmlwriter.h


+ 0 - 0
include/zip.h → library/include/zip.h


+ 0 - 0
library/src/xlsx_format.c → library/src/format.c


+ 1 - 1
tests/001.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 echo "xlswriter extension is available";
 ?>
 --EXPECT--

+ 1 - 1
tests/002.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 var_dump($excel);

+ 1 - 1
tests/003.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $fileFd = $excel->fileName('tutorial01.xlsx');

+ 1 - 1
tests/004.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $fileFd = $excel->fileName('tutorial01.xlsx');

+ 1 - 1
tests/005.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $filePath = $excel->fileName('tutorial01.xlsx')

+ 1 - 1
tests/006.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $handle = $excel->fileName('tutorial01.xlsx')

+ 1 - 1
tests/007.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $handle = $excel->fileName('tutorial01.xlsx')

+ 1 - 1
tests/008.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $handle = $excel->fileName('tutorial01.xlsx')

+ 1 - 1
tests/009.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $handle = $excel->fileName('tutorial01.xlsx')

+ 1 - 1
tests/010.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel_one  = new \Vtiful\Kernel\Excel($config);
 $fileOne = $excel_one->fileName('tutorial01.xlsx')

+ 1 - 1
tests/011.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel  = new \Vtiful\Kernel\Excel($config);
 

+ 1 - 1
tests/012.phpt

@@ -3,7 +3,7 @@ Check for vtiful presence
 --SKIPIF--
 <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 $config = ['path' => './tests'];
 $excel  = new \Vtiful\Kernel\Excel($config);
 

+ 1 - 1
travis/run-test.sh

@@ -1,7 +1,7 @@
 #!/bin/bash
 TEST_DIR="`pwd`/tests/"
 
-make test 
+make test
 
 for file in `find $TEST_DIR -name "*.diff" 2>/dev/null`
 do

+ 12 - 0
xls_writer.c

@@ -71,6 +71,18 @@ PHP_MINFO_FUNCTION(xlswriter)
 	php_info_print_table_header(2, "xlswriter support", "enabled");
 #if defined(PHP_XLSWRITER_VERSION)
     php_info_print_table_row(2, "Version", PHP_XLSWRITER_VERSION);
+#endif
+#ifdef LXW_VERSION
+#ifdef HAVE_LIBXLSXWRITER
+    /* Build time */
+    php_info_print_table_row(2, "libxlsxwriter headers version", LXW_VERSION);
+#ifdef HAVE_LXW_VERSION
+    /* Run time, available since 0.7.9 */
+    php_info_print_table_row(2, "libxlsxwriter library version", lxw_version());
+#endif
+#else
+    php_info_print_table_row(2, "bundled libxlsxwriter version", LXW_VERSION);
+#endif
 #endif
 	php_info_print_table_end();
 }