[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - config_host.mk.in configure.ac external/msc-externals postprocess/CustomTarget_signing.mk Repository.mk

Christian Lohmaier lohmaier+LibreOffice at googlemail.com
Thu Nov 2 21:57:58 UTC 2017


 Repository.mk                                  |    1 
 config_host.mk.in                              |    2 +
 configure.ac                                   |   28 +++++++++++++++++++++++++
 external/msc-externals/Module_msc-externals.mk |   11 +++++++++
 external/msc-externals/Package_ucrt.mk         |   16 ++++++++++++++
 postprocess/CustomTarget_signing.mk            |    1 
 6 files changed, 59 insertions(+)

New commits:
commit 67940d53fd68283c7dbc70897063c33d5ede49df
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Mon Oct 30 22:15:19 2017 +0100

    tdf#108580 ship universal crts with the program as workaround
    
    the universal crts redistributables are available as part of the Windows
    10 SDK. Point to the dir (or a copy of the dir) using --with-ucrt-dir
    
    Use --without-ucrt-dir (or --with-ucrt-dir=no) if you don't want to ship
    them as part of LO and are annoyed by the configure warning.
    
    Change-Id: I5487e3f6e583222fa053b2fc03176f061d57746c
    Reviewed-on: https://gerrit.libreoffice.org/44074
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
    (cherry picked from commit 71d9a61302e65fe091cf70c13fa72b3df09b7e3a)
    Reviewed-on: https://gerrit.libreoffice.org/44122

diff --git a/Repository.mk b/Repository.mk
index 184f5661ee10..a1e9cb7b6cf1 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -834,6 +834,7 @@ $(eval $(call gb_Helper_register_packages_for_install,ure,\
 		jvmfwk_jreproperties \
 		$(if $(filter MACOSX,$(OS)),bridges_jnilib_java_uno) \
 	) \
+	$(if $(UCRT_REDISTDIR),ucrt) \
 ))
 
 $(eval $(call gb_Helper_register_packages_for_install,postgresqlsdbc,\
diff --git a/config_host.mk.in b/config_host.mk.in
index 60e1f781b377..c74a097b937b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -575,6 +575,8 @@ export TMPDIR=@TEMP_DIRECTORY@
 export TOUCH=@TOUCH@
 export UCRTSDKDIR=@UCRTSDKDIR@
 export UCRTVERSION=@UCRTVERSION@
+export UCRT_REDISTDIR=@UCRT_REDISTDIR@
+export UCRT_DLLS=@UCRT_DLLS@
 export UNOWINREG_DLL=@UNOWINREG_DLL@
 export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@
 export USE_XINERAMA=@USE_XINERAMA@
diff --git a/configure.ac b/configure.ac
index b4a2b14a7c77..74c1a21abf89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6703,6 +6703,13 @@ fi
 AC_SUBST([JITC_PROCESSOR_TYPE])
 
 # Misc Windows Stuff
+AC_ARG_WITH(ucrt-dir,
+    AS_HELP_STRING([--with-ucrt-dir],
+        [path to the directory with the arch-specific subdirectories of the Windows Universtal CRT redistributables
+        from the Windows 10 SDK for packaging into the installsets (without those the target system needs to install
+        the Visual C++ Runtimes manually)]),
+,)
+UCRT_REDISTDIR="$with_ucrt_dir"
 if test $_os = "WINNT"; then
     find_msvc_x64_dlls
     find_msms
@@ -6710,8 +6717,29 @@ if test $_os = "WINNT"; then
     MSVC_DLLS="$msvcdlls"
     MSM_PATH="$msmdir"
     SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
+    if test "$UCRT_REDISTDIR" = "no"; then
+        dnl explicitly disabled
+        UCRT_REDISTDIR=""
+    else
+        UCRT_REDISTDIR="$UCRT_REDISTDIR/$WINDOWS_SDK_ARCH"
+        # https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/
+        # "note that the set of DLLs are necessary is different on different
+        #  versions of Windows, so you must include all of the DLLs in order for
+        #  your program to run on all supported versions of Windows"
+        if test -f "$UCRT_REDISTDIR/ucrtbase.dll"; then
+            cd "$UCRT_REDISTDIR";
+            UCRT_DLLS=$(ls *.dll | paste -d " " -s)
+            cd -
+        else
+            UCRT_REDISTDIR=""
+            AC_MSG_WARN([No --with-ucrt-dir not specified or dlls not found - installer will have runtime dependency])
+            add_warning "No --with-ucrt-dir not specified or dlls not found - installer will have runtime dependency"
+        fi
+    fi
 fi
 
+AC_SUBST(UCRT_REDISTDIR)
+AC_SUBST(UCRT_DLLS)
 AC_SUBST(MSVC_DLL_PATH)
 AC_SUBST(MSVC_DLLS)
 AC_SUBST(MSM_PATH)
diff --git a/external/msc-externals/Module_msc-externals.mk b/external/msc-externals/Module_msc-externals.mk
index 789c7bd119ab..1e37d97a0475 100644
--- a/external/msc-externals/Module_msc-externals.mk
+++ b/external/msc-externals/Module_msc-externals.mk
@@ -13,4 +13,15 @@ $(eval $(call gb_Module_add_targets,msc-externals,\
 	Package_msvc_dlls \
 ))
 
+# TODO: hackaround to install the universal crts locally (tdf#108580)
+# ideally we can create a chained installer or similar that installs them
+# systemwide using windows update
+ifneq ($(UCRT_REDISTDIR),)
+
+$(eval $(call gb_Module_add_targets,msc-externals,\
+	Package_ucrt \
+))
+
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/msc-externals/Package_ucrt.mk b/external/msc-externals/Package_ucrt.mk
new file mode 100644
index 000000000000..05d51d369f47
--- /dev/null
+++ b/external/msc-externals/Package_ucrt.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Package_Package,ucrt,$(UCRT_REDISTDIR)))
+
+$(eval $(call gb_Package_add_files,ucrt,program,\
+	   $(UCRT_DLLS) \
+))
+
+# vim:set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/postprocess/CustomTarget_signing.mk b/postprocess/CustomTarget_signing.mk
index 61336f40ac00..573c396f49de 100644
--- a/postprocess/CustomTarget_signing.mk
+++ b/postprocess/CustomTarget_signing.mk
@@ -32,6 +32,7 @@ ifneq ($(ENABLE_DBGUTIL),TRUE)
 	EXCLUDELIST=$(shell $(gb_MKTEMP)) && \
 	cat $(SRCDIR)/postprocess/signing/no_signing.txt > $$EXCLUDELIST && \
 	echo "$(foreach lib,$(gb_MERGEDLIBS),$(call gb_Library_get_filename,$(lib)))" | tr ' ' '\n' >> $$EXCLUDELIST && \
+	$(if $(UCRT_REDISTDIR),chmod u+w $(foreach lib,$(UCRT_DLLS),$(INSTDIR)/$(LIBO_URE_LIB_FOLDER)/$(lib)) &&) \
 	chmod u+w $(foreach lib,$(MSVC_DLLS),$(INSTDIR)/program/shlxthdl/$(lib)) && \
 	$(PERL) $(SRCDIR)/postprocess/signing/signing.pl \
 			-e $$EXCLUDELIST \


More information about the Libreoffice-commits mailing list