summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-07-17 23:03:59 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-09-11 18:26:51 +0200
commit114ed73a7ba56e013e6d7f886798915fb20c0946 (patch)
treeef56d7c8f04cc0541ad00f2ec3100b381833914a
parent03c65d3ed080661430d4af2424d8f525bef67c62 (diff)
WIN drop --enable-64bit to select Windows target
This changes the Windows build to use the default configure switch to select the target / host of the compiled binaries to get the possibility to cross compile on Windows the "default" way. Note that selecting i686-pc-cygwin on x86_64 doesn't do a cross- compilation, as no special build tools are needed, because x86_64 can run x86 binaries just fine. A consequence of the change is the default target host, which is now the same then the build system, instead of the previous x86 default. Change-Id: I5584f34f665573ebac40d5d7753d96addeb84dbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102479 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--RepositoryExternal.mk2
-rw-r--r--configure.ac417
-rw-r--r--distro-configs/Jenkins/windows_msc_dbgutil_322
-rw-r--r--distro-configs/LibreOfficeWin32.conf1
-rw-r--r--distro-configs/LibreOfficeWin64.conf2
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk23
6 files changed, 204 insertions, 243 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index fd653e2e89c5..2aa145698410 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -4007,7 +4007,7 @@ $(call gb_ExternalExecutable_add_dependencies,python,$(call gb_GeneratedPackage_
else
-$(call gb_ExternalExecutable_set_internal,python,$(INSTROOT)/$(LIBO_BIN_FOLDER)/$(if $(filter WNT,$(OS)),python-core-$(PYTHON_VERSION)/bin/python.exe,python.bin))
+$(call gb_ExternalExecutable_set_internal,python,$(INSTROOT_FOR_BUILD)/$(LIBO_BIN_FOLDER)/$(if $(filter WNT,$(OS)),python-core-$(PYTHON_VERSION)/bin/python.exe,python.bin))
$(call gb_ExternalExecutable_set_precommand,python,$(subst $$,$$$$,$(gb_Python_PRECOMMAND)))
$(call gb_ExternalExecutable_add_dependencies,python,$(call gb_Package_get_target_for_build,python3))
diff --git a/configure.ac b/configure.ac
index 60ad0d917006..e5b6ab7ca78a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1477,11 +1477,6 @@ AC_ARG_ENABLE(ccache,
]),
,)
-AC_ARG_ENABLE(64-bit,
- AS_HELP_STRING([--enable-64-bit],
- [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
- At the moment meaningful only for Windows.]), ,)
-
libo_FUZZ_ARG_ENABLE(online-update,
AS_HELP_STRING([--enable-online-update],
[Enable the online update service that will check for new versions of
@@ -3360,19 +3355,65 @@ reg_get_value_64()
reg_get_value "64" "$1"
}
-if test "$_os" = "WINNT"; then
- AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
- if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
- AC_MSG_RESULT([no])
- WINDOWS_SDK_ARCH="x86"
+case "$host_os" in
+cygwin*)
+ COM=MSC
+ USING_X11=
+ OS=WNT
+ RTL_OS=Windows
+ if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
+ P_SEP=";"
else
- AC_MSG_RESULT([yes])
- WINDOWS_SDK_ARCH="x64"
- BITNESS_OVERRIDE=64
+ P_SEP=:
fi
+ case "$host_cpu" in
+ x86_64)
+ CPUNAME=X86_64
+ RTL_ARCH=X86_64
+ PLATFORMID=windows_x86_64
+ WINDOWS_X64=1
+ SCPDEFS="$SCPDEFS -DWINDOWS_X64"
+ WIN_HOST_ARCH="x64"
+ WIN_MULTI_ARCH="x86"
+ WIN_HOST_BITS=64
+ ;;
+ i*86)
+ CPUNAME=INTEL
+ RTL_ARCH=x86
+ PLATFORMID=windows_x86
+ WIN_HOST_ARCH="x86"
+ WIN_HOST_BITS=32
+ WIN_OTHER_ARCH="x64"
+ ;;
+ *)
+ AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
+ ;;
+ esac
+
+ case "$build_cpu" in
+ x86_64) WIN_BUILD_ARCH="x64" ;;
+ i*86) WIN_BUILD_ARCH="x86" ;;
+ *)
+ AC_MSG_ERROR([Unsupported build_cpu $build_cpu for host_os $host_os])
+ ;;
+ esac
+
+ SCPDEFS="$SCPDEFS -D_MSC_VER"
+ ;;
+esac
+
+# multi-arch is an arch, which can execute on the host (x86 on x64), while
+# other-arch won't, but wouldn't break the build (x64 on x86).
+if test -n "$WIN_MULTI_ARCH" -a -n "$WIN_OTHER_ARCH"; then
+ AC_MSG_ERROR([Broken configure.ac file: can't have set \$WIN_MULTI_ARCH and $WIN_OTHER_ARCH])
fi
+
+
if test "$_os" = "iOS" -o "$build_cpu" != "$host_cpu"; then
- cross_compiling="yes"
+ # To allow building Windows multi-arch releases without cross-tooling
+ if test -z "$WIN_MULTI_ARCH" -a -z "$WIN_OTHER_ARCH"; then
+ cross_compiling="yes"
+ fi
fi
if test "$cross_compiling" = "yes"; then
export CROSS_COMPILING=TRUE
@@ -3524,6 +3565,46 @@ find_msvc()
fi
}
+test_cl_exe()
+{
+ AC_MSG_CHECKING([$1 compiler])
+
+ CL_EXE_PATH="$2/cl.exe"
+
+ if test ! -f "$CL_EXE_PATH"; then
+ if test "$1" = "multi-arch"; then
+ AC_MSG_WARN([no compiler (cl.exe) in $2])
+ return 1
+ else
+ AC_MSG_ERROR([no compiler (cl.exe) in $2])
+ fi
+ fi
+
+ dnl ===========================================================
+ dnl Check for the corresponding mspdb*.dll
+ dnl ===========================================================
+
+ # MSVC 15.0 has libraries from 14.0?
+ mspdbnum="140"
+
+ if test ! -e "$2/mspdb${mspdbnum}.dll"; then
+ AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $2, Visual Studio installation broken?])
+ fi
+
+ # The compiles has to find its shared libraries
+ OLD_PATH="$PATH"
+ TEMP_PATH=`cygpath -d "$2"`
+ PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
+
+ if ! "$CL_EXE_PATH" -? </dev/null >/dev/null 2>&1; then
+ AC_MSG_ERROR([no compiler (cl.exe) in $2])
+ fi
+
+ PATH="$OLD_PATH"
+
+ AC_MSG_RESULT([$CL_EXE_PATH])
+}
+
SOLARINC=
MSBUILD_PATH=
DEVENV=
@@ -3537,21 +3618,30 @@ if test "$_os" = "WINNT"; then
AC_MSG_ERROR([no Visual Studio 2019 installation found])
fi
fi
+ AC_MSG_RESULT([])
- if test "$BITNESS_OVERRIDE" = ""; then
- if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
- VC_PRODUCT_DIR=$vctest/VC
- else
- AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86])
+ VC_PRODUCT_DIR="$vctest/VC"
+ COMPATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber"
+
+ # $WIN_OTHER_ARCH is a hack to test the x64 compiler on x86, even if it's not multi-arch
+ if test -n "$WIN_MULTI_ARCH" -o -n "$WIN_OTHER_ARCH"; then
+ MSVC_MULTI_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/${WIN_MULTI_ARCH}${WIN_OTHER_ARCH}"
+ test_cl_exe "multi-arch" "$MSVC_MULTI_PATH"
+ if test $? -ne 0; then
+ WIN_MULTI_ARCH=""
+ WIN_OTHER_ARCH=""
fi
else
- if test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
- VC_PRODUCT_DIR=$vctest/VC
- else
- AC_MSG_ERROR([no compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64])
- fi
+ MSVC_BUILD_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_BUILD_ARCH"
+ test_cl_exe "build" "$MSVC_BUILD_PATH"
+ fi
+
+ if test "$WIN_BUILD_ARCH" != "$WIN_HOST_ARCH"; then
+ MSVC_HOST_PATH="$COMPATH/bin/Host$WIN_BUILD_ARCH/$WIN_HOST_ARCH"
+ test_cl_exe "host" "$MSVC_HOST_PATH"
+ else
+ MSVC_HOST_PATH="$MSVC_BUILD_PATH"
fi
- AC_MSG_RESULT([$VC_PRODUCT_DIR])
AC_MSG_CHECKING([for short pathname of VC product directory])
VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
@@ -3563,7 +3653,7 @@ if test "$_os" = "WINNT"; then
AC_MSG_CHECKING([for UCRT location])
find_ucrt
# find_ucrt errors out if it doesn't find it
- AC_MSG_RESULT([found])
+ AC_MSG_RESULT([$UCRTSDKDIR ($UCRTVERSION)])
PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
ucrtincpath_formatted=$formatted_path
# SOLARINC is used for external modules and must be set too.
@@ -3585,13 +3675,13 @@ if test "$_os" = "WINNT"; then
MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
else
if test "$vcnumwithdot" = "16.0"; then
- if test "$BITNESS_OVERRIDE" = ""; 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
else
- if test "$BITNESS_OVERRIDE" = ""; then
+ if test "$WIN_BUILD_ARCH" != "x64"; then
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
else
regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
@@ -3608,55 +3698,11 @@ if test "$_os" = "WINNT"; then
AC_MSG_WARN([No devenv.exe found - this is expected for VC++ Build Tools])
fi
- dnl ===========================================================
- dnl Check for the corresponding mspdb*.dll
- dnl ===========================================================
-
- VC_HOST_DIR=
- MSPDB_PATH=
- CL_PATH=
-
- if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
- VC_HOST_DIR="HostX64"
- MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
- else
- VC_HOST_DIR="HostX86"
- MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
- fi
-
- if test "$BITNESS_OVERRIDE" = ""; then
- CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86"
- else
- CL_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64"
- fi
-
- # MSVC 15.0 has libraries from 14.0?
- mspdbnum="140"
-
- if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
- AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
- fi
-
- dnl The path needs to be added before cl is called
- TEMP_PATH=`cygpath -d "$MSPDB_PATH"`
- PATH="`cygpath -u "$TEMP_PATH"`:$PATH"
-
- AC_MSG_CHECKING([cl.exe])
-
- # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
- # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
- # location, isn't it likely that lots of other things needs changes, too, and just setting CC
- # is not enough?
-
dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
dnl needed when building CLR code:
if test -z "$MSVC_CXX"; then
- if test -f "$CL_PATH/cl.exe"; then
- MSVC_CXX="$CL_PATH/cl.exe"
- fi
-
# This gives us a posix path with 8.3 filename restrictions
- MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
+ MSVC_CXX=`win_short_path_for_make "$MSVC_HOST_PATH/cl.exe"`
fi
if test -z "$CC"; then
@@ -3670,16 +3716,7 @@ if test "$_os" = "WINNT"; then
if test -n "$CC"; then
# Remove /cl.exe from CC case insensitive
- AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
- if test "$BITNESS_OVERRIDE" = ""; then
- COMPATH="$VC_PRODUCT_DIR"
- else
- if test -n "$VC_PRODUCT_DIR"; then
- COMPATH=$VC_PRODUCT_DIR
- fi
- fi
-
- COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
+ AC_MSG_NOTICE([found Visual C++ $vcyear])
export INCLUDE=`cygpath -d "$COMPATH\Include"`
@@ -3736,16 +3773,13 @@ if test "$_os" = "WINNT"; then
BUILD_X64=
CXX_X64_BINARY=
- if test "$BITNESS_OVERRIDE" = ""; then
- AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
- if test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib" || \
- test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/spectre/x64/atls.lib"; then
- if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
- BUILD_X64=TRUE
- CXX_X64_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x64/cl.exe"`
- fi
- fi
- if test "$BUILD_X64" = TRUE; then
+ if test "$WIN_HOST_ARCH" = "x86" -a -n "$WIN_OTHER_ARCH"; then
+ AC_MSG_CHECKING([for the libraries to build the 64-bit Explorer extensions])
+ if test -f "$COMPATH/atlmfc/lib/x64/atls.lib" -o \
+ -f "$COMPATH/atlmfc/lib/spectre/x64/atls.lib"
+ then
+ BUILD_X64=TRUE
+ CXX_X64_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
AC_MSG_RESULT([found])
else
AC_MSG_RESULT([not found])
@@ -3762,20 +3796,14 @@ if test "$_os" = "WINNT"; then
# Check for 32-bit compiler to use to build the 32-bit TWAIN shim
# needed to support TWAIN scan on both 32- and 64-bit systems
- BUILD_X86=
-
- if test "$BITNESS_OVERRIDE" = "64"; then
+ if test "$WIN_HOST_ARCH" = "x64"; then
AC_MSG_CHECKING([for a x86 compiler and libraries for 32-bit binaries required for TWAIN support])
- if test -n "$CXX_X86_BINARY"; then
- BUILD_X86=TRUE
- AC_MSG_RESULT([preset])
- elif "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe" -? </dev/null >/dev/null 2>&1; then
+ if test -n "$WIN_MULTI_ARCH"; then
BUILD_X86=TRUE
- CXX_X86_BINARY=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/$VC_HOST_DIR/x86/cl.exe"`
+ CXX_X86_BINARY=`win_short_path_for_make "$MSVC_MULTI_PATH/cl.exe"`
CXX_X86_BINARY+=" /arch:SSE"
AC_MSG_RESULT([found])
else
- CXX_X86_BINARY=
AC_MSG_RESULT([not found])
AC_MSG_WARN([Installation set will not contain 32-bit binaries required for TWAIN support])
fi
@@ -4354,34 +4382,7 @@ aix*)
;;
cygwin*)
- COM=MSC
- USING_X11=
- OS=WNT
- RTL_OS=Windows
- if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
- P_SEP=";"
- else
- P_SEP=:
- fi
- case "$host_cpu" in
- i*86|x86_64)
- if test "$BITNESS_OVERRIDE" = 64; then
- CPUNAME=X86_64
- RTL_ARCH=X86_64
- PLATFORMID=windows_x86_64
- WINDOWS_X64=1
- SCPDEFS="$SCPDEFS -DWINDOWS_X64"
- else
- CPUNAME=INTEL
- RTL_ARCH=x86
- PLATFORMID=windows_x86
- fi
- ;;
- *)
- AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
- ;;
- esac
- SCPDEFS="$SCPDEFS -D_MSC_VER"
+ # Already handled
;;
darwin*|macos*)
@@ -5947,7 +5948,7 @@ if test "$_os" = "WINNT"; then
if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
have_windows_sdk_libs=yes
- elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
+ elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/user32.lib"; then
have_windows_sdk_libs=yes
else
have_windows_sdk_libs=no
@@ -5994,13 +5995,13 @@ the Windows SDK are installed.])
if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
if ! test -e "$WINDOWS_SDK_WILANGID" ; then
- WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
+ WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WIN_BUILD_ARCH}/WiLangId.vbs"
fi
if ! test -e "$WINDOWS_SDK_WILANGID" ; then
- WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
+ WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WIN_BUILD_ARCH/WiLangId.vbs
fi
if ! test -e "$WINDOWS_SDK_WILANGID" ; then
- WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
+ WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WIN_BUILD_ARCH/WiLangId.vbs")
fi
fi
if test -n "$with_lang" -a "$with_lang" != "en-US"; then
@@ -6028,19 +6029,19 @@ if test "$build_os" = "cygwin"; then
find_winsdk
if test -n "$winsdkbinsubdir" \
- -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
+ -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/midl.exe"
then
- MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
+ MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH
WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
- elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
- MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
+ elif test -f "$winsdktest/Bin/$WIN_BUILD_ARCH/midl.exe"; then
+ MIDL_PATH=$winsdktest/Bin/$WIN_BUILD_ARCH
WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
elif test -f "$winsdktest/Bin/midl.exe"; then
MIDL_PATH=$winsdktest/Bin
WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
fi
if test ! -f "$MIDL_PATH/midl.exe"; then
- AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
+ AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WIN_BUILD_ARCH, Windows SDK installation broken?])
else
AC_MSG_RESULT([$MIDL_PATH/midl.exe])
fi
@@ -6082,11 +6083,11 @@ if test "$build_os" = "cygwin"; then
AC_MSG_CHECKING([for al.exe])
find_winsdk
if test -n "$winsdkbinsubdir" \
- -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
+ -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH/al.exe"
then
- AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
- elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
- AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
+ AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WIN_BUILD_ARCH"
+ elif test -f "$winsdktest/Bin/$WIN_BUILD_ARCH/al.exe"; then
+ AL_PATH="$winsdktest/Bin/$WIN_BUILD_ARCH"
elif test -f "$winsdktest/Bin/al.exe"; then
AL_PATH="$winsdktest/Bin"
fi
@@ -6112,15 +6113,15 @@ if test "$build_os" = "cygwin"; then
find_dotnetsdk46
PathFormat "$frametest"
frametest="$formatted_path"
- if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
+ if test -f "$frametest/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$frametest"
else
find_winsdk
- if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
+ if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib"; then
DOTNET_FRAMEWORK_HOME="$winsdktest"
fi
fi
- if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
+ if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WIN_BUILD_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_BUILD_ARCH/mscoree.lib"; then
AC_MSG_ERROR([mscoree.lib not found])
fi
AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
@@ -6314,7 +6315,7 @@ else
SAL_TYPES_SIZEOFINT=4
SAL_TYPES_SIZEOFLONG=4
SAL_TYPES_SIZEOFLONGLONG=8
- if test "$BITNESS_OVERRIDE" = ""; then
+ if test $WIN_HOST_BITS -eq 32; then
SAL_TYPES_SIZEOFPOINTER=4
else
SAL_TYPES_SIZEOFPOINTER=8
@@ -7534,6 +7535,7 @@ AC_ARG_WITH(ucrt-dir,
A zip archive including those files is available from Microsoft site:
https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
,)
+
UCRT_REDISTDIR="$with_ucrt_dir"
if test $_os = "WINNT"; then
find_msvc_x64_dlls
@@ -7545,7 +7547,7 @@ if test $_os = "WINNT"; then
done
MSVC_DLL_PATH=`win_short_path_for_make "$msvcdllpath"`
MSVC_DLLS="$msvcdlls"
- MSM_PATH=`win_short_path_for_make "$msmdir"`
+ test -n "$msmdir" && MSM_PATH=`win_short_path_for_make "$msmdir"`
# MSVC 15.3 changed it to VC141
if echo "$msvcdllpath" | grep -q "VC142.CRT$"; then
SCPDEFS="$SCPDEFS -DWITH_VC142_REDIST"
@@ -7592,19 +7594,13 @@ if test "$ENABLE_JAVA" != ""; then
# Windows-specific tests
if test "$build_os" = "cygwin"; then
- if test "$BITNESS_OVERRIDE" = 64; then
- bitness=64
- else
- bitness=32
- fi
-
if test -z "$with_jdk_home"; then
dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
dnl AB10-49F82F720027> section "Windows Registry Key Changes":
- reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
+ reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
if test -n "$regvalue"; then
ver=$regvalue
- reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
+ reg_get_value "$WIN_HOST_BITS" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
reg_jdk_home=$regvalue
fi
@@ -7612,7 +7608,7 @@ if test "$ENABLE_JAVA" != ""; then
with_jdk_home="$reg_jdk_home"
howfound="found automatically"
else
- AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK >= 9])
+ AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $WIN_HOST_BITS-bit JDK >= 9])
fi
else
test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
@@ -7642,12 +7638,12 @@ if test "$ENABLE_JAVA" != ""; then
dnl Check that the JDK found is correct architecture (at least 2 reasons to
dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
dnl loaded by java to run JunitTests:
- if test "$build_os" = "cygwin"; then
+ if test "$build_os" = "cygwin" -a "$cross_compiling" != "yes"; then
shortjdkhome=`cygpath -d "$with_jdk_home"`
- if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
+ if test $WIN_HOST_BITS -eq 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
- elif test "$BITNESS_OVERRIDE" = "" -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
+ elif test $WIN_HOST_BITS -eq 32 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != "" >/dev/null; then
AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
fi
@@ -7703,7 +7699,7 @@ if test "$ENABLE_JAVA" != ""; then
_jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
if test "$_jdk_ver" -lt 10900; then
- AC_MSG_ERROR([JDK is too old, you need at least 9])
+ AC_MSG_ERROR([JDK is too old, you need at least 9 ($_jdk_ver < 10900)])
fi
if test "$_jdk_ver" -gt 10900; then
JAVA_CLASSPATH_NOT_SET=TRUE
@@ -10629,8 +10625,9 @@ fi
dnl =========================================
dnl Check for uuidgen
dnl =========================================
-if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
- # presence is already tested above in the WINDOWS_SDK_HOME check
+if test "$_os" = "WINNT"; then
+ # we must use the uuidgen from the Windows SDK, which will be in the LO_PATH, but isn't in
+ # the PATH for AC_PATH_PROG. It is already tested above in the WINDOWS_SDK_HOME check.
UUIDGEN=uuidgen.exe
AC_SUBST(UUIDGEN)
else
@@ -10769,18 +10766,17 @@ dnl testing assembler path
dnl ***************************************
ML_EXE=""
if test "$_os" = "WINNT"; then
- if test "$BITNESS_OVERRIDE" = ""; then
- assembler=ml.exe
- else
- assembler=ml64.exe
- fi
+ case "$WIN_HOST_ARCH" in
+ x86) assembler=ml.exe ;;
+ x64) assembler=ml64.exe ;;
+ esac
AC_MSG_CHECKING([for the MSVC assembler ($assembler)])
- if test -f "$CL_PATH/$assembler"; then
- ML_EXE=`win_short_path_for_make "$CL_PATH/$assembler"`
+ if test -f "$MSVC_HOST_PATH/$assembler"; then
+ ML_EXE=`win_short_path_for_make "$MSVC_HOST_PATH/$assembler"`
AC_MSG_RESULT([$ML_EXE])
else
- AC_MSG_ERROR([not found])
+ AC_MSG_ERROR([not found in $MSVC_HOST_PATH])
fi
fi
@@ -11314,11 +11310,7 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE; then
if test -x "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"; then
CLANG_CC=`win_short_path_for_make "$VC_PRODUCT_DIR/Tools/Llvm/bin/clang-cl.exe"`
dnl explicitly set -m32/-m64
- if test "$BITNESS_OVERRIDE" = ""; then
- CLANG_CC="$CLANG_CC -m32"
- else
- CLANG_CC="$CLANG_CC -m64"
- fi
+ CLANG_CC="$CLANG_CC -m$WIN_HOST_BITS"
CLANG_CXX="$CLANG_CC"
AC_MSG_RESULT([$CLANG_CC])
else
@@ -11648,8 +11640,6 @@ elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
if test "$_os" != "WINNT"; then
GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
- elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
- AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
fi
fi
ENABLE_GPGMEPP=TRUE
@@ -13307,37 +13297,22 @@ if test "$build_os" = "cygwin"; then
ILIB="$ILIB;$JAVA_HOME/lib"
fi
ILIB1=-link
- if test "$BITNESS_OVERRIDE" = 64; then
- ILIB="$ILIB;$COMPATH/lib/x64"
- ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x64"
- ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/x64"
- ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/x64"
- if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
- ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
- ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x64"
- fi
- PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x64"
- ucrtlibpath_formatted=$formatted_path
- ILIB="$ILIB;$ucrtlibpath_formatted"
- ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
- else
- ILIB="$ILIB;$COMPATH/lib/x86"
- ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/x86"
- ILIB="$ILIB;$WINDOWS_SDK_HOME/lib"
- ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib"
- if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
- ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
- ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/x86"
- fi
- PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/x86"
- ucrtlibpath_formatted=$formatted_path
- ILIB="$ILIB;$ucrtlibpath_formatted"
- ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
- fi
+ ILIB="$ILIB;$COMPATH/lib/$WIN_HOST_ARCH"
+ ILIB1="$ILIB1 -LIBPATH:$COMPATH/lib/$WIN_HOST_ARCH"
+ ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
+ ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$WIN_HOST_ARCH"
+ if test $WINDOWS_SDK_VERSION = 80 -o $WINDOWS_SDK_VERSION = 81 -o $WINDOWS_SDK_VERSION = 10; then
+ ILIB="$ILIB;$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
+ ILIB1="$ILIB1 -LIBPATH:$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WIN_HOST_ARCH"
+ fi
+ PathFormat "${UCRTSDKDIR}lib/$UCRTVERSION/ucrt/$WIN_HOST_ARCH"
+ ucrtlibpath_formatted=$formatted_path
+ ILIB="$ILIB;$ucrtlibpath_formatted"
+ ILIB1="$ILIB1 -LIBPATH:$ucrtlibpath_formatted"
if test -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib"; then
ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/lib"
else
- ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH"
+ ILIB="$ILIB;$DOTNET_FRAMEWORK_HOME/Lib/um/$WIN_HOST_ARCH"
fi
AC_SUBST(ILIB)
@@ -13471,7 +13446,7 @@ dnl ===================================================================
dnl Checking for active Antivirus software.
dnl ===================================================================
-if test $_os = WINNT ; then
+if test $_os = WINNT -a -f "$SRC_ROOT/antivirusDetection.vbs" ; then
AC_MSG_CHECKING([for active Antivirus software])
ANTIVIRUS_LIST=`cscript.exe //Nologo $SRC_ROOT/antivirusDetection.vbs`
if [ [ "$ANTIVIRUS_LIST" != "NULL" ] ]; then
@@ -13517,11 +13492,7 @@ if test "$build_os" = "cygwin"; then
ATL_LIB="$WINDOWS_SDK_HOME/lib" # Doesn't exist for VSE
ATL_INCLUDE="$WINDOWS_SDK_HOME/include/atl"
fi
- if test "$BITNESS_OVERRIDE" = 64; then
- ATL_LIB="$ATL_LIB/x64"
- else
- ATL_LIB="$ATL_LIB/x86"
- fi
+ ATL_LIB="$ATL_LIB/$WIN_HOST_ARCH"
ATL_LIB=`win_short_path_for_make "$ATL_LIB"`
ATL_INCLUDE=`win_short_path_for_make "$ATL_INCLUDE"`
@@ -13570,6 +13541,11 @@ AC_SUBST(TEMP_DIRECTORY)
# setup the PATH for the environment
if test -n "$LO_PATH_FOR_BUILD"; then
LO_PATH="$LO_PATH_FOR_BUILD"
+ case "$host_os" in
+ cygwin*)
+ pathmunge "$MSVC_HOST_PATH" "before"
+ ;;
+ esac
else
LO_PATH="$PATH"
@@ -13586,7 +13562,7 @@ else
if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
LO_PATH=`cygpath -p -m "$PATH"`
fi
- if test "$BITNESS_OVERRIDE" = 64; then
+ if test "$WIN_BUILD_ARCH" = "x64"; then
# needed for msi packaging
pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
fi
@@ -13598,20 +13574,12 @@ else
pathmunge "$CSC_PATH" "before"
pathmunge "$MIDL_PATH" "before"
pathmunge "$AL_PATH" "before"
- pathmunge "$MSPDB_PATH" "before"
- if test "$MSPDB_PATH" != "$CL_PATH" ; then
- pathmunge "$CL_PATH" "before"
- fi
+ pathmunge "$MSVC_MULTI_PATH" "before"
+ pathmunge "$MSVC_BUILD_PATH" "before"
if test -n "$MSBUILD_PATH" ; then
pathmunge "$MSBUILD_PATH" "before"
fi
- if test "$BITNESS_OVERRIDE" = 64; then
- pathmunge "$COMPATH/bin/amd64" "before"
- pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x64" "before"
- else
- pathmunge "$COMPATH/bin" "before"
- pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/x86" "before"
- fi
+ pathmunge "$WINDOWS_SDK_BINDIR_NO_ARCH/$WIN_BUILD_ARCH" "before"
if test "$ENABLE_JAVA" != ""; then
if test -d "$JAVA_HOME/jre/bin/client"; then
pathmunge "$JAVA_HOME/jre/bin/client" "before"
@@ -13621,6 +13589,7 @@ else
fi
pathmunge "$JAVA_HOME/bin" "before"
fi
+ pathmunge "$MSVC_HOST_PATH" "before"
;;
solaris*)
diff --git a/distro-configs/Jenkins/windows_msc_dbgutil_32 b/distro-configs/Jenkins/windows_msc_dbgutil_32
index 59e083ee952a..6d0e6df2facb 100644
--- a/distro-configs/Jenkins/windows_msc_dbgutil_32
+++ b/distro-configs/Jenkins/windows_msc_dbgutil_32
@@ -1,4 +1,4 @@
+--host=i686-pc-cygwin
--enable-dbgutil
--disable-symbols
---disable-64-bit
--disable-dependency-tracking
diff --git a/distro-configs/LibreOfficeWin32.conf b/distro-configs/LibreOfficeWin32.conf
index 0ab2f1da2281..f469db3dba05 100644
--- a/distro-configs/LibreOfficeWin32.conf
+++ b/distro-configs/LibreOfficeWin32.conf
@@ -1,3 +1,4 @@
+--host=i686-pc-cygwin
--without-junit
--without-helppack-integration
--enable-extension-integration
diff --git a/distro-configs/LibreOfficeWin64.conf b/distro-configs/LibreOfficeWin64.conf
index 8e1a73ffb653..7c3c1ae4e5ac 100644
--- a/distro-configs/LibreOfficeWin64.conf
+++ b/distro-configs/LibreOfficeWin64.conf
@@ -1,4 +1,4 @@
---enable-64-bit
+--host=x86_64-pc-cygwin
--without-junit
--without-helppack-integration
--enable-extension-integration
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 7409cffa1f40..05de2691a03e 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -345,29 +345,20 @@ endif
# Helper class
ifeq ($(GNUMAKE_WIN_NATIVE),TRUE)
-gb_Helper_set_ld_path := PATH="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$$PATH"
-
-define gb_Helper_prepend_ld_path
-PATH="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$(1);$$PATH"
-endef
-
-# $(1): one directory pathname to append to the ld path
-define gb_Helper_extend_ld_path
-$(gb_Helper_set_ld_path)';$(shell cygpath -w $(1))'
-endef
-
+gb_MAKE_CYGPATH := -w
else
-gb_Helper_set_ld_path := PATH="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$$PATH"
+gb_MAKE_CYGPATH := -u
+endif
+
+gb_Helper_set_ld_path := PATH="$(shell cygpath $(gb_MAKE_CYGPATH) $(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath $(gb_MAKE_CYGPATH) $(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER));$$PATH"
define gb_Helper_prepend_ld_path
-PATH="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$(1):$$PATH"
+PATH="$(shell cygpath $(gb_MAKE_CYGPATH) $(INSTDIR_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath $(gb_MAKE_CYGPATH) $(INSTDIR_FOR_BUILD)/$(LIBO_BIN_FOLDER));$(1);$$PATH"
endef
# $(1): one directory pathname to append to the ld path
define gb_Helper_extend_ld_path
-$(gb_Helper_set_ld_path):$(shell cygpath -u $(1))
+$(gb_Helper_set_ld_path)';$(shell cygpath $(gb_MAKE_CYGPATH) $(1))'
endef
-endif
-
# vim: set noet sw=4: