diff options
-rw-r--r-- | config_host/config_buildconfig.h.in | 9 | ||||
-rw-r--r-- | configure.ac | 20 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 8 |
3 files changed, 35 insertions, 2 deletions
diff --git a/config_host/config_buildconfig.h.in b/config_host/config_buildconfig.h.in new file mode 100644 index 000000000000..a3b531e34e07 --- /dev/null +++ b/config_host/config_buildconfig.h.in @@ -0,0 +1,9 @@ +/* Options passed to configure script */ + +#ifndef CONFIG_BUILDCONFIG_H +#define CONFIG_BUILDCONFIG_H + +#define BUILDCONFIG "" +#define BUILDCONFIG_RECORDED 0 + +#endif diff --git a/configure.ac b/configure.ac index 303f143df198..0234537eb02b 100644 --- a/configure.ac +++ b/configure.ac @@ -2862,6 +2862,25 @@ AC_ARG_WITH(coredumpctl, [Use coredumpctl (together with systemd-run) to retrieve core dumps of crashing test processes.])) +AC_ARG_WITH(buildconfig-recorded, + AS_HELP_STRING([--with-buildconfig-recorded], + [Put build config into version info reported by LOK. Incompatible with reproducible builds.]), +) + +AC_MSG_CHECKING([whether to record build config]) +if test -z "$with_buildconfig_recorded"; then + with_buildconfig_recorded=no +fi +if test "$with_buildconfig_recorded" = no; then + AC_MSG_RESULT([no]) +else + AC_MSG_RESULT([yes]) + # replace backslashes, to get a valid c++ string + config_args=$(echo $ac_configure_args | tr '\\' '/') + AC_DEFINE_UNQUOTED([BUILDCONFIG],[["$config_args"]],[Options passed to configure script]) + AC_DEFINE([BUILDCONFIG_RECORDED],[1],[Options passed to configure script]) +fi + dnl =================================================================== dnl Do we want to use pre-build binary tarball for recompile dnl =================================================================== @@ -15070,6 +15089,7 @@ AC_CONFIG_FILES([config_host.mk vs-code.code-workspace.template:.vscode/vs-code-template.code-workspace.in]) AC_CONFIG_HEADERS([config_host/config_atspi.h]) +AC_CONFIG_HEADERS([config_host/config_buildconfig.h]) AC_CONFIG_HEADERS([config_host/config_buildid.h]) AC_CONFIG_HEADERS([config_host/config_box2d.h]) AC_CONFIG_HEADERS([config_host/config_clang.h]) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3283cf7731e5..3ee743d4aada 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -12,6 +12,7 @@ #include <svx/sdr/contact/viewcontact.hxx> #include <svx/svdpage.hxx> #include <svx/svdpagv.hxx> +#include <config_buildconfig.h> #include <config_cairo_rgba.h> #include <config_features.h> @@ -7242,8 +7243,11 @@ static char* lo_getVersionInfo(SAL_UNUSED_PARAMETER LibreOfficeKit* /*pThis*/) "\"ProductName\": \"%PRODUCTNAME\", " "\"ProductVersion\": \"%PRODUCTVERSION\", " "\"ProductExtension\": \"%PRODUCTEXTENSION\", " - "\"BuildId\": \"%BUILDID\" " - "}"_ustr)); + "\"BuildId\": \"%BUILDID\"" +#if BUILDCONFIG_RECORDED + ", \"BuildConfig\": \"" BUILDCONFIG "\"" +#endif + " }"_ustr)); } static void aBasicErrorFunc(const OUString& rError, const OUString& rAction) |