summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-11 16:59:31 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-11 21:31:35 +0100
commitab4e40941e9ebae83f98ba918440b03eac5bdcaa (patch)
tree2d981c4ee04093494a97797aca79037f050e3340 /configure.ac
parentdd1610146528cba8642caad3bf72e27b9ca6c153 (diff)
Fix VS2022 MSMs detection
After commits 42da199753515584e615cdcdd8601d2ffc27245b (more VS2022 integration, Oct 14 10:58:25 2021 +0200) and 9ea17a6331ca9491e7012dca837d3815cd4309ac (Adapt to latest VS 2022 MSM versions, Apr 08 09:15:19 2022 +0200), the new 143 version of MSMs gets detected and passed to SCP, but not used there, so MSIs lack CRT. Additionally, it may happen that a redist is configured that does not match the actual CRT used in the build, because it picked a latest available version, and then an error happens when building MSI, because it expects MSMs in wrong source directory. This simplifies the checks, makes sure to look for the correct MSM version, and adds an error message in SCP in case when the passed version is not handled, to detect the incomplete support early. Change-Id: I47d45472309c584314730e7f5f46a9596fc8d21d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142587 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac60
1 files changed, 24 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index a3f00fddd585..f6937648fe2d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6703,35 +6703,23 @@ find_winsdk()
find_msms()
{
# Return value: $msmdir
+ local version="$1"
- AC_MSG_CHECKING([for MSVC merge modules directory])
- local my_msm_files
+ AC_MSG_CHECKING([for MSVC $version merge modules directory])
+ local my_msm_file="Microsoft_VC${version}_CRT_x86.msm"
local my_msm_dir
- dnl Order my_msm_files in increasing order. Then check the directories returned
- dnl by ls in an inner loop; assuming they are also ordered in increasing order,
- dnl the result will be the highest MSM version found in the highest directory.
-
- case "$VCVER" in
- 16.0 | 17.0 | 17.4)
- my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm Microsoft_VC143_CRT_x86.msm ${my_msm_files}"
- ;;
- esac
- for f in $my_msm_files; do
- echo "$as_me:$LINENO: searching for $f" >&5
- done
+ echo "$as_me:$LINENO: searching for $my_msm_file" >&5
msmdir=
case "$VCVER" in
16.0 | 17.0 | 17.4)
- for f in ${my_msm_files}; do
- for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
- my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
- echo "$as_me:$LINENO: looking for $my_msm_dir${f}])" >&5
- if test -e "$my_msm_dir${f}"; then
- msmdir=$my_msm_dir
- fi
- done
+ for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
+ my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
+ echo "$as_me:$LINENO: looking for $my_msm_dir${my_msm_file}])" >&5
+ if test -e "$my_msm_dir${my_msm_file}"; then
+ msmdir=$my_msm_dir
+ fi
done
;;
esac
@@ -6744,7 +6732,7 @@ find_msms()
AC_MSG_FAILURE([not found])
else
AC_MSG_WARN([not found (check config.log)])
- add_warning "MSM none of ${my_msm_files} found"
+ add_warning "MSM ${my_msm_file} not found"
fi
fi
}
@@ -8565,25 +8553,25 @@ AC_ARG_WITH(ucrt-dir,
UCRT_REDISTDIR="$with_ucrt_dir"
if test $_os = "WINNT"; then
find_msvc_x64_dlls
- for i in $PKGFORMAT; do
- if test "$i" = msi; then
- find_msms
- break
- fi
- done
MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
MSVC_DLLS="$msvcdlls"
- test -n "$msmdir" && MSM_PATH=`win_short_path_for_make "$msmdir"`
- # MSVC 15.3 changed it to VC141
if echo "$msvcdllpath" | grep -q "VC143.CRT$"; then
- SCPDEFS="$SCPDEFS -DWITH_VC143_REDIST"
+ with_redist=143
elif echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
- SCPDEFS="$SCPDEFS -DWITH_VC142_REDIST"
+ with_redist=142
elif echo "$msvcdllpath" | grep -q "VC141.CRT$"; then
- SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
- else
- SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
+ with_redist=141
fi
+ for i in $PKGFORMAT; do
+ if test "$i" = msi; then
+ find_msms "$with_redist"
+ if test -n "$msmdir"; then
+ MSM_PATH=`win_short_path_for_make "$msmdir"`
+ SCPDEFS="$SCPDEFS -DWITH_VC_REDIST=$with_redist"
+ fi
+ break
+ fi
+ done
if test "$UCRT_REDISTDIR" = "no"; then
dnl explicitly disabled