diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2016-06-14 18:00:16 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-06-15 13:54:37 +0000 |
commit | b6e7ddcc7e6eec4957c1c069d0c22eb1dbb3bb28 (patch) | |
tree | b0a6ef7a14fa4112e40985c5db6f575b5b12bb83 | |
parent | 67f2aee609308ad6d43eed4f0df084e9abd50301 (diff) |
Add MS binary format validator support
bffvalidator (Microsoft Office Binary File Format Validator) basic
support in configure for later usage in export tests. It should be
installed from
https://www.microsoft.com/en-us/download/details.aspx?id=26794
and enabled in configure with new switch
--with-bffvalidator=<optional path to validator>
Change-Id: I6faa08d3277f0328b3dfa310222a11d115e5aa15
Reviewed-on: https://gerrit.libreoffice.org/25870
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | config_host/config_features.h.in | 8 | ||||
-rw-r--r-- | configure.ac | 39 |
3 files changed, 48 insertions, 0 deletions
diff --git a/config_host.mk.in b/config_host.mk.in index ddd144e48cd2..620df66b67e0 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -430,6 +430,7 @@ export ODFGEN_CFLAGS=$(gb_SPACE)@ODFGEN_CFLAGS@ export ODFGEN_LIBS=$(gb_SPACE)@ODFGEN_LIBS@ export ODFVALIDATOR=@ODFVALIDATOR@ export OFFICEOTRON=@OFFICEOTRON@ +export BFFVALIDATOR=@BFFVALIDATOR@ export OOOP_FONTS_PACK=@OOOP_FONTS_PACK@ export OOOP_GALLERY_PACK=@OOOP_GALLERY_PACK@ export OOOP_SAMPLES_PACK=@OOOP_SAMPLES_PACK@ diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in index 0a389798116f..108bfcac85fc 100644 --- a/config_host/config_features.h.in +++ b/config_host/config_features.h.in @@ -137,6 +137,14 @@ #define HAVE_EXPORT_VALIDATION 0 /* + * Whether to use export validation of binary formats (doc, xls, ppt) + * + * Requires installed Microsoft Office Binary File Format Validator + * https://www.microsoft.com/en-us/download/details.aspx?id=26794 + */ +#define HAVE_BFFVALIDATOR 0 + +/* * Whether we have glTF support. */ #define HAVE_FEATURE_GLTF 0 diff --git a/configure.ac b/configure.ac index 401a8ae4acd5..97794c8903d8 100644 --- a/configure.ac +++ b/configure.ac @@ -2031,6 +2031,14 @@ AC_ARG_WITH(export-validation, See https://cgit.freedesktop.org/libreoffice/contrib/dev-tools/tree/export-validation]), ,) +AC_ARG_WITH(bffvalidator, + AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>], + [Enables export validation for Microsoft Binary formats (doc, xls, ppt). + Requires installed Microsoft Office Binary File Format Validator. + Note: export-validation (--with-export-validation) is required to be turned on. + See https://www.microsoft.com/en-us/download/details.aspx?id=26794]), +,with_bffvalidator=no) + AC_ARG_WITH(junit, AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>], [Specifies the JUnit 4 jar file to use for JUnit-based tests. @@ -2763,6 +2771,37 @@ if test "$with_export_validation" = yes; then AC_MSG_ERROR([officeotron too old]) fi AC_SUBST(OFFICEOTRON) + +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING([for Microsoft Binary File Format Validator]) +if test "$with_bffvalidator" != "no"; then + AC_DEFINE(HAVE_BFFVALIDATOR) + + if test "$with_export_validation" != "yes"; then + AC_MSG_ERROR([Please enable export validation (-with-export-validation)!]) + fi + + if test "$with_bffvalidator" = "yes"; then + BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"` + else + BFFVALIDATOR="$with_bffvalidator" + fi + + if test "$build_os" = "cygwin"; then + if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then + AC_MSG_RESULT($BFFVALIDATOR) + else + AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator]) + fi + elif test -n "$BFFVALIDATOR" -a -e "$BFFVALIDATOR"; then + AC_MSG_RESULT($BFFVALIDATOR) + else + AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator]) + fi + AC_SUBST(BFFVALIDATOR) else AC_MSG_RESULT([no]) fi |