diff options
author | Peter Foley <pefoley2@verizon.net> | 2012-12-03 18:11:54 -0500 |
---|---|---|
committer | Peter Foley <pefoley2@verizon.net> | 2012-12-05 19:48:44 -0500 |
commit | f9a687719960a6636186cbd2db917ad660139a11 (patch) | |
tree | 9a03a0d69a6326ec7b7ad986ba7fa50ecff6c4c5 /configure.ac | |
parent | 3be458578445b82c718b1a8512d16d706fc2329b (diff) |
kill oowintool
Change-Id: Ifb0c8a34ecb7b77a92fb67ca947b4ed46f51fd9a
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 229 |
1 files changed, 208 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac index b09f2c2bd3a1..fc908e3c2e4b 100644 --- a/configure.ac +++ b/configure.ac @@ -2829,6 +2829,18 @@ AC_SUBST(XCRUN) dnl =================================================================== dnl Windows specific tests and stuff dnl =================================================================== + +reg_get_value() +{ + unset regvalue + _regvalue=`cat "/proc/registry/$1" 2> /dev/null` + + if test $? -eq 0; then + regvalue=$_regvalue + fi +} + + 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 @@ -3029,12 +3041,44 @@ AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS) dnl =================================================================== dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT dnl =================================================================== +find_msvs() { +# find Visual Studio 2012/2010/2008 +for ver in 11.0 10.0 9.0; do + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/ProductDir + if test -n "$regvalue"; then + vstest=$regvalue + break + fi + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VS/ProductDir + if test -n "$regvalue"; then + vstest=$regvalue + break + fi +done +} + +find_msvc() { +# find Visual Studio 2012/2010/2008 +for ver in 11.0 10.0 9.0; do + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir + if test -n "$regvalue"; then + vctest=$regvalue + break + fi + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VCExpress/$ver/Setup/VC/ProductDir + if test -n "$regvalue"; then + vctest=$regvalue + break + fi +done +} + 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` + find_msvc if test "$BITNESS_OVERRIDE" = ""; then if test -x "$vctest/bin/cl.exe"; then with_cl_home=$vctest @@ -4099,7 +4143,6 @@ if test "$cross_compiling" = "yes"; then config.guess \ config_host.mk.in \ configure \ - oowintool \ bin/get_config_variables \ solenv/bin/getcompver.awk \ solenv/inc/langlist.mk \ @@ -4697,7 +4740,146 @@ 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 =================================================================== +find_csc() { +if test $VCVER -eq 90; then + reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v3.5/InstallPath" + if test -n "$regvalue"; then + csctest=$regvalue + return + fi + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/InstallRoot + if test -n "$regvalue"; then + csctest=${regvalue}"v2.0.50727" + fi +else + reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath" + if test -n "$regvalue"; then + csctest=$regvalue + break + fi +fi +} + +find_al() { +for x in `ls /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do + reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder" + if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then + altest=$regvalue + break + fi +done +} + +find_dotnetsdk() { +for ver in 1.1 2.0; do + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv$ver + if test -n "$regvalue"; then + frametest=$regvalue + break + fi +done +} + +find_winsdk() { +reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot" +if test -n "$regvalue"; then + winsdktest=$regvalue + return +fi +reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/CurrentInstallFolder" +if test -n "$regvalue"; then + winsdktest=$regvalue + return +fi +reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/Directories/Install Dir" +if test -n "$regvalue"; then + winsdktest=$regvalue + return +fi +for x in `ls /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs`; do + reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/$x/Install Dir" + if test -n "$regvalue"; then + winsdktest=$regvalue + break + fi +done +} + +#TODO: move copy_* functions to external/ module once gbuildified +copy_msms() { +for ver in 9.0 10.0 11.0; do + reg_get_value HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir + if test -n "$regvalue"; then + if test -e "$regvalue/Microsoft_VC${VCVER}_CRT_x86.msm"; then + msmdir=$regvalue + break + fi + fi +done +msmdir=`cygpath -d "$msmdir"` +msmdir=`cygpath -u "$msmdir"` +if test -z "$msmdir"; then + AC_MSG_ERROR([Merge modules not found]) +fi + +if test $VCVER -eq 90; then + cp $msmdir/policy_9_0_Microsoft_VC90_CRT_x86.msm ./external/msm90 + if test $? -ne 0; then + AC_MSG_ERROR([Failed to copy merge modules]) + fi +fi +cp $msmdir/Microsoft_VC${VCVER}_CRT_x86.msm ./external/msm${VCVER} +if test $? -ne 0; then + AC_MSG_ERROR([Failed to copy merge modules]) +fi +cp $msmdir/Microsoft_VC${VCVER}_CRT_x64.msm ./external/msm${VCVER} +if test $? -ne 0; then + AC_MSG_WARN([Failed to copy x64 merge modules, installation will lack the 64-bit Explorer extension]) +fi +} + +copy_msvc_dlls() { + +if test $CPUNAME == INTEL; then + vsarch=x86 +else + vsarch=amd64 +fi + +if test -f $with_cl_home/redist/$vsarch/Microsoft.VC${VCVER}.CRT/msvcp${VCVER}.dll; then + vsdlldir=$with_cl_home/redist/$vsarch/Microsoft.VC${VCVER}.CRT +else + AC_MSG_ERROR([can't find VS dll $with_cl_home/redist/$vsarch/Microsoft.VC${VCVER}.CRT/msvcp${VCVER}.dll]) +fi + +cp $vsdlldir/msvcp${VCVER}.dll $vsdlldir/msvcr${VCVER}.dll ./external/msvcp${VCVER} + +if test $VCVER == 90; then + cp $vsdlldir/msvcm${VCVER}.dll $vsdlldir/Microsoft.VC90.CRT.manifest ./external/msvcp${VCVER} + if test $? -ne 0; then + AC_MSG_ERROR([Failed to copy VS dlls]) + fi +fi +} + +copy_dbghelp_dll() { +if test ! -f ./external/dbghelp/dbghelp.dll -a -f $TARFILE_LOCATION/$DBGHELP_DLL; then + cp $TARFILE_LOCATION/$DBGHELP_DLL ./external/dbghelp/dbghelp.dll; +fi +if test ! -f ./external/dbghelp/dbghelp.dll; then + echo "dbghelp.dll is missing in external/dbghelp/." + echo "Get it from the Microsoft site and put it there." + echo "(Note: Microsoft seems to enjoy changing the exact location of this file." + echo "You may have to search Microsoft's website.) Last time it was seen at:" + echo "<http://www.microsoft.com/downloads/release.asp?releaseid=30682>." + exit 1 +fi +} + if test "$build_os" = "cygwin"; then + copy_msvc_dlls + copy_dbghelp_dll + dnl Check midl.exe AC_PATH_PROG(MIDL_PATH, midl.exe) if test -n "$MIDL_PATH"; then @@ -4715,13 +4897,13 @@ if test "$build_os" = "cygwin"; then MIDL_PATH="$with_cl_home/../Common7/Tools/Bin" fi if test -z "$MIDL_PATH"; then - vstest=`./oowintool --msvs-productdir` + find_msvs 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` + find_winsdk if test -x "$winsdktest/Bin/midl.exe"; then MIDL_PATH="$winsdktest/Bin" elif test -x "$winsdktest/Bin/$SDK_ARCH/midl.exe"; then @@ -4750,7 +4932,7 @@ if test "$build_os" = "cygwin"; then if test -x "$with_csc_path/csc.exe"; then CSC_PATH="$with_csc_path" else - csctest=`./oowintool --csc-compilerdir` + find_csc if test -x "$csctest/csc.exe"; then CSC_PATH="$csctest" fi @@ -4778,7 +4960,7 @@ if test "$build_os" = "cygwin"; then AL_PATH="$with_al_path" fi if test -z "$AL_PATH"; then - winsdktest=`./oowintool --windows-sdk-home` + find_winsdk if test -x "$winsdktest/Bin/al.exe"; then AL_PATH="$winsdktest/Bin" elif test -x "$winsdktest/Bin/$SDK_ARCH/al.exe"; then @@ -4786,7 +4968,7 @@ if test "$build_os" = "cygwin"; then fi fi if test -z "$AL_PATH"; then - altest=`./oowintool --al-home` + find_al if test -x "$altest/bin/al.exe"; then AL_PATH="$altest/bin" elif test -x "$altest/al.exe"; then @@ -4812,13 +4994,13 @@ if test "$build_os" = "cygwin"; then DOTNET_FRAMEWORK_HOME="$with_dotnet_framework_home" fi if test -z "$DOTNET_FRAMEWORK_HOME"; then - frametest=`./oowintool --dotnetsdk-dir` + find_dotnetsdk 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" + find_winsdk + if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/win8/um/$SDK_ARCH/mscoree.lib"; then + DOTNET_FRAMEWORK_HOME="$winsdktest" fi fi fi @@ -5803,9 +5985,10 @@ AC_SUBST([JITC_PROCESSOR_TYPE]) if test $_os = "WINNT"; then AC_MSG_CHECKING([for Microsoft_VC${VCVER}_CRT_x86.msm]) - if ./oowintool --msvc-find-msms; then + copy_msms + if test -n $msms_copied ; then AC_MSG_RESULT([yes]) - SCPDEFS="$SCPDEFS -DWITH_VC"$VCVER"_REDIST" + SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST" else AC_MSG_RESULT([no]) fi @@ -5827,16 +6010,19 @@ if test "$SOLAR_JAVA" != ""; then fi if test -z "$with_jdk_home"; then - - # Unfortunately apparently no way to find, if needed, the 64-bit - # JDK in the Registry from the 32-bit Perl oowintool - - _jdk_home=`./oowintool --jdk-home` + # Currently only auto-detects 32-bit JDK + for ver in 1.7 1.6 1.5 1.4 1.3; do + reg_get_value "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome" + if test -n "$regvalue"; then + _jdk_home=$regvalue + break + fi + done if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then with_jdk_home="$_jdk_home" - howfound="found by oowintool" + howfound="found automatically" else - AC_MSG_ERROR([No JDK found by oowintool, pass the --with-jdk-home option pointing to a $bitness JDK]) + AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness JDK]) fi else test "$build_os" = "cygwin" && with_jdk_home=`cygpath -u "$with_jdk_home"` @@ -8824,7 +9010,8 @@ if test "$_os" = "WINNT"; then 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` + find_winsdk + WINDOWS_SDK_HOME=$winsdktest # 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 |