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 @@ -136,6 +136,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. */ 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=], + [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=], [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