Reworking the MSVC-related build options
Tor Lillqvist
tml at iki.fi
Mon Dec 3 01:06:46 PST 2012
Below is what have so far, not finished yet, still bugs in the
changes, and I probably want to get rid of the remaining uses of
oowintool, and then before committing I need to verify carefully that
it produces an equivalent config_host.mk as the old one (and that it
builds, of course) for all three compilers (2008, 2010, 2012),
including VS Express 2008.
Does anybody use VS Express 2010?
BTW, just to make sure, am I correct in assuming that nobody is
intentionally, and out of *real* need, using any of these options:
--with-cl-home (in the case where you only have one Visual C++/Visual
Studio installed anyway)
--with-al-home
--mspdb-path
--midl-path
--csc-path
--dotnet-framework-home
--windows-sdk-home
--directx-home
--asm-home
If you do use some of those, please verify that it really is needed,
i.e. check what happens if you remove the option: compare the
generated config_host.mk, and compare what happens when you build an
affected module, thanks! Then report back here.
--tml
diff --git a/configure.ac b/configure.ac
index e0b8342..9e753aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil;
fill-column: 102 -*-
+dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil -*-
dnl configure.ac serves as input for the GNU autoconf package
dnl in order to create a configure script.
@@ -1776,71 +1776,19 @@ AC_ARG_WITH(
],,
[with_doxygen=yes])
-AC_ARG_WITH(cl-home,
- AS_HELP_STRING([--with-cl-home],
- [For Windows NT users, please supply the path for the Microsoft C/C++
- compiler. Note that this is not the location of the compiler
binary but
- the location of the entire distribution.])
+AC_ARG_WITH(visual-studio,
+ AS_HELP_STRING([--with-visual-studio=<2008/2010/2012>],
+ [Specifies the Visual Studio version to use in case several are
+ are installed. If not specified, the order of preference is
+ VS 2010, VS 2012, VS 2008 and VS Express 2008.])
[
- Usage: --with-cl-home=<absolute path to Microsoft
- C/C++
compiler home>
- ],
-,)
-
-AC_ARG_WITH(mspdb-path,
- AS_HELP_STRING([--with-mspdb-path],
- [For Microsoft C/C++ compiler users, please supply the path pointing to
- the mspdb80.dll (if using Visual Studio 2008) or
mspdb100.dll (if using
- Visual Studio 2010).])
- [
- Usage: --with-mspdb-path=<path to
-
mspdb80.dll/mspdb100.dll>
- ],
-,)
-
-AC_ARG_WITH(midl-path,
- AS_HELP_STRING([--with-midl-path],
- [For Microsoft compiler users, please supply the path
pointing to the midl.exe.])
- [
- Usage: --with-midl-path=<abs. path to midl.exe>
- ],
-,)
-
-AC_ARG_WITH(csc-path,
- AS_HELP_STRING([--with-csc-path],
- [For Windows builds, please supply the path pointing to the csc.exe.
- Usually found automatically when building on Windows.])
- [
- Usage: --with-csc-path=<abs. path to csc.exe>
- ],
-,)
-
-AC_ARG_WITH(dotnet-framework-home,
- AS_HELP_STRING([--with-dotnet-framework-home],
- [For Microsoft compiler users, please supply the path pointing to
- lib/mscoree.lib, usually something like:
- "/cygdrive/c/Program Files/Windows SDKs/Windows/v7.0"])
- [
- Note that in most cases it will be automatically
- found, though.
-
- Usage:
--with-dotnet-framework-home=<absolute path to .NET
- Framework>
- ],
-,)
-
-AC_ARG_WITH(windows-sdk-home,
- AS_HELP_STRING([--with-windows-sdk-home],
- [For Windows builds, please supply the path to the Windows SDK.
- Usually found automatically when building on Windows.])
- [
- Usage:
--with-windows-sdk-home=<absolute path to Windows SDK>
+ Usage: --with-visual-studio=<2008/2010/2012>
],
,)
AC_ARG_WITH(directx-home,
AS_HELP_STRING([--with-directx-home],
- [For Windows users, please supply the path to the Microsoft
DirectX SDK.])
+ [Specify the path to the Microsoft DirectX SDK.])
[
Usage: --with-directx-home=<absolute path to
Microsoft
DirectX SDK>
@@ -1849,7 +1797,7 @@ AC_ARG_WITH(directx-home,
AC_ARG_WITH(mozilla-build,
AS_HELP_STRING([--with-mozilla-build],
- [For Windows users, please supply the path to the Mozilla
build tools.])
+ [Specify the path to the Mozilla build tools.])
[
Usage: --with-mozilla-build=<absolute path to
Mozilla build tools>
@@ -2030,14 +1978,6 @@ AC_ARG_WITH(compat-oowrappers,
Has effect only with make distro-pack-install]),
,)
-AC_ARG_WITH(asm-home,
- AS_HELP_STRING([--with-asm-home],
- [For Windows, please supply the path for the ml.exe or
ml64.exe assembler.])
- [
- Usage: --with-asm-home=<path to
assembler directory>
- ],
-,)
-
AC_ARG_WITH(os-version,
AS_HELP_STRING([--with-os-version],
[For FreeBSD users, use this option option to override the
detected OSVERSION.])
@@ -2838,10 +2778,10 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; 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])
- SDK_ARCH="x86"
+ WINDOWS_SDK_ARCH="x86"
else
AC_MSG_RESULT([yes])
- SDK_ARCH="x64"
+ WINDOWS_SDK_ARCH="x64"
BITNESS_OVERRIDE=64
fi
@@ -2855,7 +2795,7 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
fi
AC_MSG_CHECKING([whether to use ActiveX])
- if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE"
-o "$enable_activex" = ""; then
+ if test "$enable_activex" = "yes" -o "$enable_activex" = ""; then
DISABLE_ACTIVEX=""
SCPDEFS="$SCPDEFS -DWITH_ACTIVEX_COMPONENT"
AC_MSG_RESULT([yes])
@@ -2865,7 +2805,7 @@ if test "$_os" = "WINNT" -a "$WITH_MINGW" != yes; then
fi
AC_MSG_CHECKING([whether to use ATL])
- if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o
"$enable_atl" = ""; then
+ if test "$enable_atl" = "yes" -o "$enable_atl" = ""; then
DISABLE_ATL=""
AC_MSG_RESULT([yes])
else
@@ -3032,139 +2972,146 @@ fi
AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
dnl ===================================================================
-dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT
+dnl Check which Visual Studio MinGW compiler is used for WINNT
dnl ===================================================================
SHOWINCLUDES_PREFIX=
if test "$_os" = "WINNT"; then
if test "$WITH_MINGW" != "yes"; then
- AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler
installation path])
- if test -z "$with_cl_home"; then
- vctest=`./oowintool --msvc-productdir`
- if test "$BITNESS_OVERRIDE" = ""; then
- if test -x "$vctest/bin/cl.exe"; then
- with_cl_home=$vctest
- fi
+ AC_MSG_CHECKING([Visual Studio])
+
+ # Keep these checks in order of preference of compilers (in case
+ # the machine has several versions installed)
+
+ set VisualStudio 2010 10.0 "Visual Studio" \
+ VisualStudio 2012 11.0 "Visual Studio" \
+ VisualStudio 2008 9.0 "Visual Studio"\
+ VCExpress 2008 9.0 "Visual Studio Express"
+
+ vs_version=""
+
+ while : ; do
+ n=$1
+ MSVSVER=$2
+ v=$3
+ MSVSNAME="$4"
+ shift 4
+ if test -z "$with_visual_studio" -o "$with_visual_studio"
= $MSVSVER; then
+ VC_PROD_DIR=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/$n/$v/Setup/VC/ProductDir
2>/dev/null`
+ VS_PROD_DIR=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/$n/$v/Setup/VS/ProductDir
2>/dev/null`
+ fi
+
+ if test -n "$VC_PROD_DIR" -a -n "$VS_PROD_DIR" -a \
+ -d "$VC_PROD_DIR" -a -d "$VS_PROD_DIR"; then
+
+ break
+ fi
+ done
+
+ if test -z "$MSVSVER"; then
+ if "$with_visual_studio" = $MSVSVER; then
+ AC_MSG_ERROR([$MSVSNAME not found])
else
- if test -x "$vctest/bin/amd64/cl.exe"; then
- with_cl_home=$vctest
- fi
+ AC_MSG_ERROR([No Visual Studio found])
fi
- else
- with_cl_home=`cygpath -u "$with_cl_home"`
fi
- with_cl_home=`cygpath -d "$with_cl_home"`
- with_cl_home=`cygpath -u "$with_cl_home"`
- AC_MSG_RESULT([$with_cl_home])
- dnl ===========================================================
- dnl Check for mspdb80.dll/mspdb100.dll/mspdb110.dll
- dnl ===========================================================
- dnl MSVS 2008/10/12 Compiler
- if test -n "$with_mspdb_path"; then
- with_mspdb_path=`cygpath -u "$with_mspdb_path"`
- fi
- if test -e "$with_mspdb_path/mspdb80.dll" -o -e
"$with_mspdb_path/mspdb100.dll" -o -e "$with_mspdb_path/mspdb110.dll";
then
- MSPDB_PATH="$with_mspdb_path"
- fi
- dnl MSVS 2008 case
- if test -z "$MSPDB_PATH" -a -e
"$with_cl_home/../Common7/IDE/mspdb80.dll"; then
- MSPDB_PATH="$with_cl_home/../Common7/IDE"
- fi
- dnl Windows SDK 6.0 case
- if test -z "$MSPDB_PATH" -a -e "$with_cl_home/bin/mspdb80.dll"; then
- MSPDB_PATH="$with_cl_home/bin"
- fi
- dnl MSVS 2010 case
- if test -z "$MSPDB_PATH" -a -e
"$with_cl_home/../Common7/IDE/mspdb100.dll"; then
- MSPDB_PATH="$with_cl_home/../Common7/IDE"
- fi
- dnl MSVS 2012 case
- if test -z "$MSPDB_PATH" -a -e
"$with_cl_home/../Common7/IDE/mspdb110.dll"; then
- MSPDB_PATH="$with_cl_home/../Common7/IDE"
+ if test "$BITNESS_OVERRIDE" = 64; then
+ case $MSVSVER in
+ 2010|2012)
+ if ! test -f "$VC_PROD_DIR/bin/amd64/cl.exe"; then
+ AC_MSG_ERROR([No 64-bit compiler found])
+ fi
+ ;;
+ *)
+ AC_MSG_ERROR([No 64-bit support in $MSVSNAME])
+ ;;
+ esac
fi
- if test -z "$MSPDB_PATH"; then
- dnl AC_PATH_PROG only checks if MSPDB_PATH is still empty
- AC_PATH_PROG(MSPDB_PATH, mspdb80.dll)
- AC_PATH_PROG(MSPDB_PATH, mspdb100.dll)
- AC_PATH_PROG(MSPDB_PATH, mspdb110.dll)
- MSPDB_PATH=`dirname "$MSPDB_PATH"`
- fi
+ # Turn them into Unix form shortnames.
+ # Do we really need both?
+ VC_PROD_DIR=`cygpath -u "$VC_PROD_DIR"`
+ VC_PROD_DIR=`cygpath -d "$VC_PROD_DIR"`
+ VC_PROD_DIR=`cygpath -u "$VC_PROD_DIR"`
+ VC_PROD_DIR=${VC_PROD_DIR%/}
- if test -z "$MSPDB_PATH"; then
- AC_MSG_ERROR([You need a mspdb80.dll or mspdb100.dll or
mspdb110.dll, make sure it is in the path or use --with-mspdb-path])
- fi
- MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
- MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
- dnl The path needs to be added before cl is called
- PATH="$MSPDB_PATH:$PATH"
+ VS_PROD_DIR=`cygpath -u "$VS_PROD_DIR"`
+ VS_PROD_DIR=`cygpath -d "$VS_PROD_DIR"`
+ VS_PROD_DIR=`cygpath -u "$VS_PROD_DIR"`
+ VS_PROD_DIR=${VS_PROD_DIR%/}
- AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
- if test -z "$CC"; then
- if test "$BITNESS_OVERRIDE" = ""; then
- if test -x "$with_cl_home/bin/cl.exe"; then
- CC="$with_cl_home/bin/cl.exe"
- fi
- else
- if test -x "$with_cl_home/bin/amd64/cl.exe"; then
- CC="$with_cl_home/bin/amd64/cl.exe"
- fi
+ # Add location of mspdb*.dll to PATH so that we can run cl.exe
+ MSPDB_DIR="$VS_PROD_DIR/Common7/IDE"
+ PATH="$PATH:$MSPDB_DIR"
+
+ if test -z "$BITNESS_OVERRIDE"; then
+ if test -f "$VC_PROD_DIR/bin/cl.exe"; then
+ CC="$VC_PROD_DIR/bin/cl.exe"
fi
- if test -z "$CC"; then
- AC_PATH_PROG(CC, cl.exe)
+ else
+ if test -f "$VC_PROD_DIR/bin/amd64/cl.exe"; then
+ CC="$VC_PROD_DIR/bin/amd64/cl.exe"
fi
- # This gives us a posix path with 8.3 filename restrictions
- CC=`cygpath -d "$CC"`
- CC=`cygpath -u "$CC"`
+ fi
+ if test -z "$CC"; then
+ AC_PATH_PROG(CC, cl.exe)
fi
- if test -n "$CC"; then
- # Remove /cl.exe from CC case insensitive
- AC_MSG_RESULT([found ($CC)])
- if test "$BITNESS_OVERRIDE" = ""; then
- COMPATH=`echo $CC | $SED -e
's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e
's@^.* @@'`
- else
- if test -n "$with_cl_home"; then
- COMPATH=`echo $with_cl_home`
- fi
- fi
- export INCLUDE=`cygpath -d "$COMPATH/Include"`
- dnl Check which Microsoft C/C++ compiler is found
- AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
- # The following finds Microsoft, matches nn.nn.nnnn then
pulls numbers out.
- CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
- x = match( \\\$0, /..\\...\\...../ )
- CCversion = substr( \\\$0, RSTART, RLENGTH)
- tokencount = split (CCversion,vertoken,\".\")
- for ( i = 1 ; i <= tokencount ; i++ ) {
- printf (\"%04d\",vertoken[[i]] )
- }
- }"`
- if test "$CCNUMVER" -ge "001700000000"; then
- COMEX=14
- MSVSVER=2012
- VCVER=110
- elif test "$CCNUMVER" -ge "001600000000"; then
- COMEX=13
- MSVSVER=2010
- VCVER=100
- elif test "$CCNUMVER" -ge "001500000000"; then
- COMEX=12
- MSVSVER=2008
- VCVER=90
- else
- AC_MSG_ERROR([Compiler too old. Use Microsoft Visual
Studio 2008 or 2010.])
- fi
- PathFormat "$COMPATH"
- COMPATH="$formatted_path"
+ # Now we can set CC
+ CC=`cygpath -d "$CC"`
+ CC=`cygpath -u "$CC"`
- AC_MSG_RESULT([found compiler version $CCNUMVER (MSVS $MSVSVER).])
+ if test -z "$CC"; then
+ AC_MSG_ERROR({No Visual Studio compiler cl.exe found})
+ fi
+
+ # Remove bin/cl.exe (bin/amd64/cl.exe) from CC, case
+ # insensitive.
+ if test "$BITNESS_OVERRIDE" = ""; then
+ COMPATH=`echo $CC | $SED -e
's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e
's@^.* @@'`
+ else
+ COMPATH=`echo $CC | $SED -e
's@\/[[Bb]][[Ii]][[Nn]]\/[[aA]][[mM]][[dD]]64\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@'
-e 's@^.* @@'`
+ fi
+
+ export INCLUDE=`cygpath -d "$VC_PROD_DIR/Include"`
+
+ # The following finds Microsoft, matches nn.nn.nnnn then pulls
+ # numbers out.
+ CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ {
+ x = match( \\\$0, /..\\...\\...../ )
+ CCversion = substr( \\\$0, RSTART, RLENGTH)
+ tokencount = split (CCversion,vertoken,\".\")
+ for ( i = 1 ; i <= tokencount ; i++ ) {
+ printf (\"%04d\",vertoken[[i]] )
+ }
+ }"`
+ if test "$CCNUMVER" -ge "001700000000"; then
+ COMEX=14
+ claimed_msvsver=2012
+ VCVER=110
+ elif test "$CCNUMVER" -ge "001600000000"; then
+ COMEX=13
+ claimed_msvsver=2010
+ VCVER=100
+ elif test "$CCNUMVER" -ge "001500000000"; then
+ COMEX=12
+ claimed_msvsver=2008
+ VCVER=90
else
- AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use
--with-cl-home or set path to cl.exe.])
+ AC_MSG_ERROR([Compiler too old. Use Microsoft Visual
Studio 2008, 2010 or 2012.])
+ fi
+
+ if test $claimed_msvsver != $MSVSVER; then
+ AC_MSG_ERROR([$MSVSNAME selected but it claims to be
$claimer_msvsvsver])
fi
- dnl We need to guess the prefix of the -showIncludes output, it can be
- dnl localized
+ PathFormat "$COMPATH"
+ COMPATH="$formatted_path"
+
+ AC_MSG_RESULT([found $MSVSNAME $MSVSVER ($CCNUMVER).])
+
+ # We need to guess the prefix of the -showIncludes output, it can be
+ # localized
AC_MSG_CHECKING([the dependency generation prefix (cl.exe
-showIncludes)])
echo "#include <stdlib.h>" > conftest.c
SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
@@ -3191,19 +3138,19 @@ if test "$_os" = "WINNT"; then
if test "$BITNESS_OVERRIDE" = ""; then
AC_MSG_CHECKING([for a x64 compiler and libraries for
64-bit Explorer extensions])
- if test -f "$with_cl_home/atlmfc/lib/amd64/atls.lib"; then
+ if test -f "$VC_PROD_DIR/atlmfc/lib/amd64/atls.lib"; then
# Prefer native x64 compiler to cross-compiler, in
case we are running
# the build on a 64-bit OS.
- if "$with_cl_home/bin/amd64/cl.exe" -? </dev/null
>/dev/null 2>&1; then
+ if "$VC_PROD_DIR/bin/amd64/cl.exe" -? </dev/null
>/dev/null 2>&1; then
BUILD_X64=TRUE
- CXX_X64_BINARY="$with_cl_home/bin/amd64/cl.exe"
- LINK_X64_BINARY="$with_cl_home/bin/amd64/link.exe"
- LIBMGR_X64_BINARY="$with_cl_home/bin/amd64/lib.exe"
- elif "$with_cl_home/bin/x86_amd64/cl.exe" -?
</dev/null >/dev/null 2>&1; then
+ CXX_X64_BINARY="$VC_PROD_DIR/bin/amd64/cl.exe"
+ LINK_X64_BINARY="$VC_PROD_DIR/bin/amd64/link.exe"
+ LIBMGR_X64_BINARY="$VC_PROD_DIR/bin/amd64/lib.exe"
+ elif "$VC_PROD_DIR/bin/x86_amd64/cl.exe" -?
</dev/null >/dev/null 2>&1; then
BUILD_X64=TRUE
- CXX_X64_BINARY="$with_cl_home/bin/x86_amd64/cl.exe"
- LINK_X64_BINARY="$with_cl_home/bin/x86_amd64/link.exe"
- LIBMGR_X64_BINARY="$with_cl_home/bin/x86_amd64/lib.exe"
+ CXX_X64_BINARY="$VC_PROD_DIR/bin/x86_amd64/cl.exe"
+ LINK_X64_BINARY="$VC_PROD_DIR/bin/x86_amd64/link.exe"
+ LIBMGR_X64_BINARY="$VC_PROD_DIR/bin/x86_amd64/lib.exe"
fi
fi
if test "$BUILD_X64" = TRUE; then
@@ -3219,7 +3166,6 @@ if test "$_os" = "WINNT"; then
AC_SUBST(CXX_X64_BINARY)
AC_SUBST(LINK_X64_BINARY)
AC_SUBST(LIBMGR_X64_BINARY)
-
else
AC_MSG_CHECKING([the compiler is MinGW])
MACHINE_PREFIX=`$CC -dumpmachine`
@@ -3233,14 +3179,16 @@ if test "$_os" = "WINNT"; then
fi
AC_SUBST(COMEX)
AC_SUBST(VCVER)
+
PathFormat "$MSPDB_PATH"
MSPDB_PATH="$formatted_path"
+
AC_SUBST(SHOWINCLUDES_PREFIX)
#
# dbghelp.dll
#
-if test "$_os" == "WINNT"; then
+if test "$_os" = "WINNT"; then
DBGHELP_DLL="13fbc2e8b37ddf28181dd6d8081c2b8e-dbghelp.dll"
fi
AC_SUBST(DBGHELP_DLL)
@@ -3252,7 +3200,7 @@
UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
AC_SUBST(UNOWINREG_DLL)
#
-# prefix C with ccache if needed
+# prefix CC with ccache if needed
#
if test "$CCACHE" != ""; then
AC_MSG_CHECKING([whether $CC is already ccached])
@@ -4710,155 +4658,110 @@ if test $_os = Darwin -a "$enable_mozilla" = no; then
fi
dnl ===================================================================
-dnl .NET needs special treatment
-dnl (does the above comment really mean .NET, or is it misusing
-dnl that to mean Visual Studio .NET 2003 ? And does this also
-dnl in fact apply equally to what we actually support, i.e.
-dnl Visual Studio 2008 and 2010?)
+dnl Look for Windows SDK and .NET Framework that work
+dnl with the Visual Studio used
dnl ===================================================================
if test "$build_os" = "cygwin"; then
- dnl Check midl.exe
- AC_PATH_PROG(MIDL_PATH, midl.exe)
- if test -n "$MIDL_PATH"; then
- MIDL_PATH=`dirname "$MIDL_PATH"`
- else
- AC_MSG_CHECKING([for midl.exe more thoroughly])
- fi
- if test -n "$with_midl_path"; then
- with_midl_path=`cygpath -u "$with_midl_path"`
- fi
- if test -x "$with_midl_path/midl.exe"; then
- MIDL_PATH="$with_midl_path"
- fi
- if test -z "$MIDL_PATH" -a -e
"$with_cl_home/../Common7/Tools/Bin/midl.exe"; then
- MIDL_PATH="$with_cl_home/../Common7/Tools/Bin"
- fi
- if test -z "$MIDL_PATH"; then
- vstest=`./oowintool --msvs-productdir`
- if test -x "$vstest/Common7/Tools/Bin/midl.exe"; then
- MIDL_PATH="$vstest/Common7/Tools/Bin"
- fi
- fi
- if test -z "$MIDL_PATH"; then
- winsdktest=`./oowintool --windows-sdk-home`
- if test -x "$winsdktest/Bin/midl.exe"; then
- MIDL_PATH="$winsdktest/Bin"
- elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then
- MIDL_PATH="$winsdktest/Bin/$SDK_ARCH"
- fi
- fi
- if test ! -x "$MIDL_PATH/midl.exe"; then
- AC_MSG_ERROR([midl.exe not found. Make sure it's in PATH or
use --with-midl-path])
- else
- AC_MSG_RESULT([$MIDL_PATH/midl.exe])
- fi
- # Convert to posix path with 8.3 filename restrictions ( No spaces )
- MIDL_PATH=`cygpath -d "$MIDL_PATH"`
- MIDL_PATH=`cygpath -u "$MIDL_PATH"`
+ case "$MSVSVER" in
+ 2008)
+ WINDOWS_SDK_HOME=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft
SDKs/Windows/v6.0A/CurrentInstallFolder 2>/dev/null`
+ WINDOWS_SDK_VERSION=60
+ WINDOWS_SDK_BIN="$WINDOWS_SDK_HOME/bin"
+ WINDOWS_SDK_LIB="$WINDOWS_SDK_HOME/Lib"
- dnl Check csc.exe
- AC_PATH_PROG(CSC_PATH, csc.exe)
- if test -n "$CSC_PATH"; then
- CSC_PATH=`dirname "$CSC_PATH"`
- fi
- if test -n "$with_csc_path"; then
- with_csc_path=`cygpath -u "$with_csc_path"`
- else
- AC_MSG_CHECKING([for csc.exe more thoroughly])
- fi
- if test -x "$with_csc_path/csc.exe"; then
- CSC_PATH="$with_csc_path"
- else
- csctest=`./oowintool --csc-compilerdir`
- if test -x "$csctest/csc.exe"; then
- CSC_PATH="$csctest"
- fi
- fi
- if test ! -x "$CSC_PATH/csc.exe"; then
- AC_MSG_ERROR([csc.exe not found. Make sure it's in the path
or use --with-csc-path])
- else
- AC_MSG_RESULT([$CSC_PATH/csc.exe])
- fi
- # Convert to posix path with 8.3 filename restrictions ( No spaces )
- CSC_PATH=`cygpath -d "$CSC_PATH"`
- CSC_PATH=`cygpath -u "$CSC_PATH"`
+ netfx_dir="$WINDOWS_SDK_HOME"
+ NETFX_BIN="$WINDOWS_SDK_BIN"
+ ;;
+ 2010)
+ WINDOWS_SDK_HOME=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft
SDKs/Windows/v7.0A/InstallationFolder 2>/dev/null`
+ WINDOWS_SDK_VERSION=70
+ WINDOWS_SDK_BIN="$WINDOWS_SDK_HOME/bin"
+ WINDOWS_SDK_LIB="$WINDOWS_SDK_HOME/Lib"
- dnl Check al.exe
- AC_PATH_PROG(AL_PATH, al.exe)
- if test -n "$AL_PATH"; then
- AL_PATH=`dirname "$AL_PATH"`
- else
- AC_MSG_CHECKING([for al.exe more thoroughly])
- fi
- if test -n "$with_al_path"; then
- with_al_path=`cygpath -u "$with_al_path"`
- fi
- if test -x "$with_al_path/al.exe"; then
- AL_PATH="$with_al_path"
- fi
- if test -z "$AL_PATH"; then
- winsdktest=`./oowintool --windows-sdk-home`
- if test -x "$winsdktest/Bin/al.exe"; then
- AL_PATH="$winsdktest/Bin"
- elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then
- AL_PATH="$winsdktest/Bin/$SDK_ARCH"
- fi
- fi
- if test -z "$AL_PATH"; then
- altest=`./oowintool --al-home`
- if test -x "$altest/bin/al.exe"; then
- AL_PATH="$altest/bin"
- elif test -x "$altest/al.exe"; then
- AL_PATH="$altest"
- fi
- fi
- if test ! -x "$AL_PATH/al.exe"; then
- AC_MSG_ERROR([al.exe not found. Make sure it's in PATH or use
--with-al-path])
- else
- AC_MSG_RESULT([$AL_PATH/al.exe])
- fi
+ netfx_dir=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft
SDKs/Windows/v7.0A/WinSDK-NetFx40Tools/InstallationFolder 2>/dev/null`
+ NETFX_BIN="$netfx_dir"
+ ;;
+ 2012)
+ # Is the Windows SDK nowadays called the "Windows Kit"?
- # Convert to posix path with 8.3 filename restrictions ( No spaces )
- AL_PATH=`cygpath -d "$AL_PATH"`
- AL_PATH=`cygpath -u "$AL_PATH"`
+ # I wonder how this registry key will change with SDK 9? Or is
+ # Microsoft's plan that this same key will always point to the
+ # latest Windows Kit?
- dnl Check mscoree.lib / .NET Framework dir
- AC_MSG_CHECKING(.NET Framework)
- if test -n "$with_dotnet_framework_home"; then
- with_dotnet_framework_home=`cygpath -u "$with_dotnet_framework_home"`
- fi
- if test -f "$with_dotnet_framework_home/lib/mscoree.lib"; then
- DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home"
- fi
- if test -z "$DOTNET_FRAMEWORK_HOME"; then
- frametest=`./oowintool --dotnetsdk-dir`
- if test -f "$frametest/lib/mscoree.lib"; then
- DOTNET_FRAMEWORK_HOME="$frametest"
- else
- frametest=`./oowintool --windows-sdk-home`
- if test -f "$frametest/lib/mscoree.lib" -o -f
"$frametest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
- DOTNET_FRAMEWORK_HOME="$frametest"
- fi
- fi
- fi
- if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f
"$DOTNET_FRAMEWORK_HOME/lib/win8/um/$SDK_ARCH/mscoree.lib"; then
- AC_MSG_ERROR([mscoree.lib (.NET Framework) not found. Make
sure you use --with-dotnet-framework-home])
+ WINDOWS_SDK_HOME=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\
Kits/Installed\ Roots/KitsRoot 2>/dev/null`
+ WINDOWS_SDK_VERSION=80
+ WINDOWS_SDK_BIN="$WINDOWS_SDK_HOME/bin/x86"
+ WINDOWS_SDK_LIB="$WINDOWS_SDK_HOME/Lib/win8/um/$WINDOWS_SDK_ARCH"
+
+ netfx_dir=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\
SDKs/Windows/v8.0A/WinSDK-NetFx40Tools/InstallationFolder 2>/dev/null`
+ NETFX_BIN="$netfx_dir"
+ ;;
+ esac
+
+ if test -z "$WINDOWS_SDK_HOME"; then
+ AC_MSG_ERROR([Windows SDK not found])
fi
- AC_MSG_RESULT(found)
- PathFormat "$MIDL_PATH"
- MIDL_PATH="$formatted_path"
+ WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
+ WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
+ WINDOWS_SDK_HOME=${WINDOWS_SDK_HOME%/}
+ PathFormat "$WINDOWS_SDK_HOME"
+ WINDOWS_SDK_HOME="$formatted_path"
+
+ WINDOWS_SDK_BIN=`cygpath -d "$WINDOWS_SDK_BIN"`
+ WINDOWS_SDK_BIN=`cygpath -u "$WINDOWS_SDK_BIN"`
+ PathFormat "$WINDOWS_SDK_BIN"
+ WINDOWS_SDK_BIN="$formatted_path"
- PathFormat "$AL_PATH"
- AL_PATH="$formatted_path"
+ NETFX_BIN=`cygpath -d "$NETFX_BIN"`
+ NETFX_BIN=`cygpath -u "$NETFX_BIN"`
+ PathFormat "$NETFX_BIN"
+ NETFX_BIN="$formatted_path"
- PathFormat "$DOTNET_FRAMEWORK_HOME"
- DOTNET_FRAMEWORK_HOME="$formatted_path"
+ for D in "$WINDOWS_SDK_BIN" \
+ "$WINDOWS_SDK_LIB" \
+ "$WINDOWS_SDK_HOME/Include" \
+ "$NETFX_BIN"; do
+ if test ! -d "$D"; then
+ AC_MSG_ERROR([Windows SDK detection failed, \"$D\" is not
a directory])
+ fi
+ done
- PathFormat "$CSC_PATH"
- CSC_PATH="$formatted_path"
+ for F in "$WINDOWS_SDK_BIN/midl.exe" \
+ "$NETFX_BIN/al.exe"; do \
+ if test ! -f "$F"; then
+ AC_MSG_ERROR([Windows SDK detection failed, \"$F\" does not exist])
+ fi
+ done
+ case $MSVSVER in
+ 2008)
+ DOTNET_DIR=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET\ Framework\
Setup/NDP/v3.5/InstallPath 2>/dev/null`
+ if test -z "$DOTNET_DIR"; then
+ DOTNET_DIR=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/InstallRoot
2>/dev/null`v2.0.50727
+ fi
+ ;;
+ 2010|2012)
+ DOTNET_DIR=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET\ Framework\
Setup/NDP/v4/Client/InstallPath 2>/dev/null`
+ ;;
+ *)
+ AC_MSG_ERROR([Assertion failed - MSVSVER=$MSVSVER])
+ ;;
+ esac
+
+ if test ! -d "$DOTNET_DIR"; then
+ AC_MSG_ERROR([.NET framework detection failed,
\"$DOTNET_DIR\" is not a directory])
+ elif test ! -f "$DOTNET_DIR/csc.exe"; then
+ AC_MSG_ERROR([.NET framework detection failed, csc.exe not
found in \"$DOTNET_DIR\"])
+ fi
+
+ DOTNET_DIR=`cygpath -d "$DOTNET_DIR"`
+ DOTNET_DIR=`cygpath -u "$DOTNET_DIR"`
+ PathFormat "$DOTNET_DIR"
+ DOTNET_DIR="$formatted_path"
fi
+AC_SUBST(WINDOWS_SDK_HOME)
+AC_SUBST(WINDOWS_SDK_VERSION)
dnl ===================================================================
dnl Check if stdc headers are available excluding MSVC.
@@ -4877,9 +4780,7 @@ if test "$_os" != "WINNT" -o "$WITH_MINGW" = "yes"; then
AC_PROG_CXX
CXXFLAGS=$save_CXXFLAGS
else
- if test -n "$CC" -a -z "$CXX"; then
- CXX="$CC"
- fi
+ CXX="$CC"
fi
dnl check if we are using a buggy version of g++ (currently 3.4.0,
3.4.1 and trunk)
@@ -8985,151 +8886,27 @@ AC_SUBST(SYSTEM_LIBC)
dnl =========================================
dnl Check for the Windows SDK.
dnl =========================================
-dnl FIXME: I don't know yet if the Windows SDK works with MinGW, keep
it until I know better,
-dnl and add "-a \( "$WITH_MINGW" != "yes" \)" then
-if test "$_os" = "WINNT"; then
- AC_MSG_CHECKING([for Windows SDK])
- if test "$build_os" = "cygwin"; then
- if test -z "$with_windows_sdk_home"; then
- # This first line will detect a February 2003 Microsoft
Platform SDK
- WINDOWS_SDK_HOME=`./oowintool --windows-sdk-home`
- # But there might be also an April 2005 PSDK,
unfortunately MS changed
- # the registry entry. (we prefer the old version!?)
- if test -z "$WINDOWS_SDK_HOME"; then
- WINDOWS_SDK_HOME=`cat
/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/*/Install\
Dir 2> /dev/null | tr '\000' '\n' | head -n 1`
- fi
- # normalize if found
- if test -n "$WINDOWS_SDK_HOME"; then
- WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
- WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
-
- # If this sdk is incomplete, lets see if the one
- # recommended to be installed is available.
-
- # This refers to the Windows SDK 8 (as distributed
- # with Visual Studio 2012, or maybe also
- # separately), I assume.
-
- # I wouldn't say that it is "incomplete", it is
- # just structured differtently. We do seem to try
- # to adapt to that structure below (look for the
- # Include/um etc stuff), so rejecting it here is a
- # bit premature... *but* then one notices that
- # compiling with MSVS2008 and trying to use SDK 8
- # leads to horrible errors in ICU at least. Oh
- # well.
-
- if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe"; then
- WINDOWS_SDK7_HOME=`cat
"/proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft
SDKs/Windows/v7.1/InstallationFolder" 2> /dev/null | tr '\000' '\n' |
head -n 1`
- if test -n "$WINDOWS_SDK7_HOME"; then
- WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK7_HOME"`
- WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
- fi
- fi
- fi
- else
- WINDOWS_SDK_HOME=`cygpath -u "$with_windows_sdk_home"`
- fi
- fi
- if test -n "$WINDOWS_SDK_HOME"; then
- # Remove a possible trailing backslash
- WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
- # Problem with current PSDK (iz 49865)
- # (What "current" does that mean?)
- if test -f "$WINDOWS_SDK_HOME/Lib/libcp.lib"; then
- AC_MSG_ERROR([
-Some modules do not build correctly with MS Platform SDK - April 2005
-Edition if the library ($WINDOWS_SDK_HOME/Lib/libcp.lib) is found.
-Remove/rename/backup that file and restart configure. Details about this
-problem can be found in issue 49856.])
- fi
-
- if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
- -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
- -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
- HAVE_PSDK_H="yes"
- elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
- -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
- -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
- HAVE_PSDK_H="yes"
- else
- HAVE_PSDK_H="no"
- fi
- if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
- HAVE_PSDK_LIB="yes"
- elif test -f "$WINDOWS_SDK_HOME/lib/win8/um/$SDK_ARCH/user32.lib"; then
- HAVE_PSDK_LIB="yes"
- else
- HAVE_PSDK_LIB="no"
- fi
-
- if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then
- AC_MSG_ERROR([Some (all?) Windows SDK files not found,
please check if all needed parts of
-the Windows SDK are installed.])
- fi
-
- if test ! -x "$WINDOWS_SDK_HOME/bin/msiinfo.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/msidb.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/uuidgen.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/msitran.exe"; then :
- elif test ! -x "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/x86/uuidgen.exe" \
- -o ! -x "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
- else
- AC_MSG_ERROR([Some (all) files of the Windows Installer
SDK are missing, please install.])
- fi
- fi
-
- if test -z "$WINDOWS_SDK_HOME"; then
- AC_MSG_RESULT([no, hoping the necessary headers and libraries
will be found anyway])
- elif echo $WINDOWS_SDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then
- WINDOWS_SDK_VERSION=61
- AC_MSG_RESULT([found Windows SDK 6.1 ($WINDOWS_SDK_HOME)])
- elif echo $WINDOWS_SDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then
- WINDOWS_SDK_VERSION=60
- AC_MSG_RESULT([found Windows SDK 6.0 ($WINDOWS_SDK_HOME)])
- elif echo $WINDOWS_SDK_HOME | grep "v7" >/dev/null 2>/dev/null; then
- WINDOWS_SDK_VERSION=70
- AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
- elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
- WINDOWS_SDK_VERSION=80
- AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
+if test "$build_os" = "cygwin"; then
+ SOLARINC="$SOLARINC -I$COMPATH/include"
+ if test -d "$WINDOWS_SDK_HOME/Include/um"; then
+ SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/um
-I$WINDOWS_SDK_HOME/Include/shared"
else
- AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
- fi
- PathFormat "$WINDOWS_SDK_HOME"
- WINDOWS_SDK_HOME="$formatted_path"
- if test "$build_os" = "cygwin"; then
- SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/include"
- if test -d "$WINDOWS_SDK_HOME/include/um"; then
- SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um
-I$WINDOWS_SDK_HOME/include/shared"
- fi
+ SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include"
fi
fi
-AC_SUBST(WINDOWS_SDK_HOME)
-AC_SUBST(WINDOWS_SDK_VERSION)
dnl =========================================
dnl Check for uuidgen
dnl =========================================
if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
- if test "$WITH_MINGW" = "yes"; then
- AC_PATH_PROG([UUIDGEN], [uuid])
- if test -z "$UUIDGEN"; then
- AC_MSG_WARN([uuid is needed for dev-install])
- fi
- else
- # presence is already tested above in the WINDOWS_SDK_HOME check
- UUIDGEN=uuidgen.exe
- AC_SUBST(UUIDGEN)
- fi
+ UUIDGEN=uuidgen.exe
else
AC_PATH_PROG([UUIDGEN], [uuidgen])
if test -z "$UUIDGEN"; then
AC_MSG_WARN([uuid is needed for dev-install])
fi
fi
+AC_SUBST(UUIDGEN)
dnl =========================================
dnl Check for the Microsoft DirectX SDK.
@@ -9291,47 +9068,22 @@ AC_SUBST(GNUPATCH)
AC_SUBST(GNUCP)
AC_SUBST(x_GNUCP)
-dnl ***************************************
-dnl testing assembler path
-dnl ***************************************
+dnl ===================================================================
+dnl Check MSVC assembler
+dnl ===================================================================
ML_EXE=""
if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
if test "$BITNESS_OVERRIDE" = ""; then
- assembler=ml.exe
- assembler_bin=bin
+ ML_EXE="$VC_PROD_DIR/bin/ml.exe"
else
- assembler=ml64.exe
- assembler_bin=bin/amd64
- fi
- if test -n "$with_asm_home"; then
- with_asm_home=`cygpath -u "$with_asm_home"`
+ ML_EXE="$VC_PROD_DIR/bin/amd64/ml64.exe"
fi
- if test -x "$with_asm_home/$assembler"; then
- AC_MSG_CHECKING([$assembler assembler path])
- AC_MSG_RESULT([$with_asm_home/$assembler])
- ML_EXE="$with_asm_home/$assembler"
- else
- AC_PATH_PROG(ML_EXE, $assembler)
- if test -z "$ML_EXE"; then
- AC_MSG_CHECKING([$with_cl_home/$assembler_bin/$assembler])
- if test -x "$with_cl_home/$assembler_bin/$assembler"; then
- with_asm_home=$with_cl_home/$assembler_bin
- AC_MSG_RESULT([found])
- ML_EXE="$with_cl_home/$assembler_bin/$assembler"
- else
- AC_MSG_ERROR([Configure did not find $assembler assembler.])
- fi
- else
- with_asm_home="ASM_IN_PATH"
- ML_EXE="$assembler"
- fi
+
+ if ! test -f "$ML_EXE"; then
+ AC_MSG_ERROR([Assembler not found at \"$ML_EXE\"])
fi
PathFormat "$with_asm_home"
- ASM_HOME="$formatted_path"
-else
- ASM_HOME=""
fi
-
AC_SUBST(ML_EXE)
dnl ===================================================================
@@ -12357,10 +12109,8 @@ else
;;
cygwin*)
- pathmunge "$DOTNET_FRAMEWORK_HOME/bin" "before"
- pathmunge "$ASM_HOME" "before"
pathmunge "$WINDOWS_SDK_HOME/bin" "before"
- pathmunge "$CSC_PATH" "before"
+ pathmunge "$DOTNET_DIR" "before"
pathmunge "$MIDL_PATH" "before"
pathmunge "$AL_PATH" "before"
pathmunge "$MSPDB_PATH" "before"
More information about the LibreOffice
mailing list