summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2021-09-15 10:08:43 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-09-16 19:50:56 +0200
commitc156a8c708f74dd31e1ef024edc578c3915619cb (patch)
treef7134a5a8c2f3815abfdb232c29f916de3100bfa /configure.ac
parentbf89ac73fdb1ca8c083913f6ad8aaf8cec9114c5 (diff)
Add preliminary VS 2022 support
This patch changes the configure.ac, so that LibreOffice compiles with the latest VS 2022 preview. The option --with-visual-studio=2022 should be added to the autogen.input, in order to use VS 2022 preview. Change-Id: Ia1d9bbeabbbd44ffe82af3624151b69d36c0a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122133 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac109
1 files changed, 41 insertions, 68 deletions
diff --git a/configure.ac b/configure.ac
index 4af48fc034d7..0a2d098b252c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3840,6 +3840,8 @@ map_vs_year_to_version()
case $1 in
2019)
vsversion=16;;
+ 2022)
+ vsversion=17;;
*)
AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
esac
@@ -3931,7 +3933,7 @@ find_msvc()
PathFormat "$vswhere"
vswhere=$formatted_path_unix
for ver in $vsversions; do
- vswhereoutput=`$vswhere -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
+ vswhereoutput=`$vswhere -prerelease -version "@<:@ $ver , $(expr $ver + 1) @:}@" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | head -1`
# Fall back to all MS products (this includes VC++ Build Tools)
if ! test -n "$vswhereoutput"; then
AC_MSG_CHECKING([VC++ Build Tools and similar])
@@ -3951,6 +3953,10 @@ find_msvc()
vcyear=2019
vcnum=160
;;
+ 17.0)
+ vcyear=2022
+ vcnum=170
+ ;;
esac
vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
@@ -4064,25 +4070,18 @@ if test "$_os" = "WINNT"; then
AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
# Find the proper version of MSBuild.exe to use based on the VS version
reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
- if test -n "$regvalue" ; then
- AC_MSG_RESULT([found: $regvalue])
- MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
- else
- if test "$vcnumwithdot" = "16.0"; then
- if test "$WIN_BUILD_ARCH" != "x64"; then
- regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
- else
- regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
- fi
+ if test -z "$regvalue" ; then
+ if test "$WIN_BUILD_ARCH" != "x64"; then
+ regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin"
else
- if test "$WIN_BUILD_ARCH" != "x64"; then
- regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
- else
- regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
- fi
+ regvalue="$VC_PRODUCT_DIR/../MSBuild/Current/Bin/amd64"
fi
+ fi
+ if test -d "$regvalue" ; then
MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
AC_MSG_RESULT([$regvalue])
+ else
+ AC_MSG_ERROR([MSBuild.exe location not found])
fi
# Find the version of devenv.exe
@@ -4125,7 +4124,7 @@ if test "$_os" = "WINNT"; then
# are always "better", we list them in reverse chronological order.
case "$vcnum" in
- 160)
+ 160 | 170)
WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0"
;;
esac
@@ -6410,11 +6409,15 @@ find_msms()
# Return value: $msmdir
AC_MSG_CHECKING([for MSVC merge modules directory])
- local my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
+ local my_msm_files
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
- 160)
+ 160 | 170)
my_msm_files="Microsoft_VC141_CRT_x86.msm Microsoft_VC142_CRT_x86.msm ${my_msm_files}"
;;
esac
@@ -6423,45 +6426,14 @@ find_msms()
done
msmdir=
- for ver in 14.0 15.0; do
- reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
- if test -n "$regvalue"; then
- for f in ${my_msm_files}; do
- if test -e "$regvalue/${f}"; then
- msmdir=$regvalue
- break
- fi
- done
- fi
- done
- dnl Is the following fallback really necessary, or was it added in response
- dnl to never having started Visual Studio on a given machine, so the
- dnl registry keys checked above had presumably not yet been created?
- dnl Anyway, if it really is necessary, it might be worthwhile to extend it
- dnl to also check %CommonProgramFiles(X86)% (typically expanding to
- dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
- dnl expanding to "C:\Program Files\Common Files"), which would need
- dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
- dnl obtain its value from cygwin:
- if test -z "$msmdir"; then
- my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
- for f in ${my_msm_files}; do
- if test -e "$my_msm_dir/${f}"; then
- msmdir=$my_msm_dir
- fi
- done
- fi
-
- dnl Starting from MSVC 15.0, merge modules are located in different directory
case "$VCVER" in
- 160)
- for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
- echo "$as_me:$LINENO: looking in $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])" >&5
- my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
- for f in ${my_msm_files}; do
- if test -e "$my_msm_dir/${f}"; then
+ 160 | 170)
+ 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
- break
fi
done
done
@@ -6486,20 +6458,21 @@ find_msvc_x64_dlls()
# Return value: $msvcdllpath, $msvcdlls
AC_MSG_CHECKING([for MSVC x64 DLL path])
+
+ dnl Order crtver in increasing order. Then check the directories returned by
+ dnl ls in an inner loop; assuming they are also ordered in increasing order,
+ dnl the result will be the highest CRT version found in the highest directory.
+
msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
case "$VCVER" in
- 160)
- for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
- echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT" >&5
- if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
- msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
- break
- fi
- echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT" >&5
- if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"; then
- msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC142.CRT"
- break
- fi
+ 160 | 170)
+ for crtver in 141 142; do
+ for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
+ echo "$as_me:$LINENO: testing $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT" >&5
+ if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"; then
+ msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC$crtver.CRT"
+ fi
+ done
done
;;
esac