configure.vbs revision e078c42d830539a4c29a33b8f09fc28647686743
' $Id$
'' @file
' The purpose of this script is to check for all external tools, headers, and
' libraries VBox OSE depends on.
'
' The script generates the build configuration file 'AutoConfig.kmk' and the
' environment setup script 'env.bat'. A log of what has been done is
' written to 'configure.log'.
'
'
' Copyright (C) 2006-2007 Oracle Corporation
'
' This file is part of VirtualBox Open Source Edition (OSE), as
' available from http://www.virtualbox.org. This file is free software;
' General Public License (GPL) as published by the Free Software
' Foundation, in version 2 as it comes in the "COPYING" file of the
' VirtualBox OSE distribution. VirtualBox OSE is distributed in the
' hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
'
'*****************************************************************************
'* Global Variables *
'*****************************************************************************
'g_strTmpFile = g_strPath & "\configure.tmp"
dim g_objShell, g_objFileSys
dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev, g_strPathVCC, g_strPathPSDK, g_strPathDDK, g_strSubOutput
g_strPathkBuild = ""
g_strPathDev = ""
g_strPathVCC = ""
g_strPathPSDK = ""
g_strPathDDK = ""
g_blnDisableCOM = False
g_strDisableCOM = ""
' The internal mode is primarily for skipping some large libraries.
g_blnInternalMode = False
' Whether to try the internal stuff first or last.
g_blnInternalFirst = True
' Whether to try the new tools: Visual Studio 10.0, Windows 7 SDK and WDK.
dim g_blnNewTools
g_blnNewTools = False 'True
''
' Converts to unix slashes
function UnixSlashes(str)
end function
''
' Converts to dos slashes
function DosSlashes(str)
end function
''
' Read a file (typically the tmp file) into a string.
function FileToString(strFilename)
dim objLogFile, str
end function
''
' Deletes a file
sub FileDelete(strFilename)
end if
end sub
''
' Appends a line to an ascii file.
dim objFile
end sub
''
' Checks if the file exists.
function FileExists(strFilename)
end function
''
' Checks if the directory exists.
function DirExists(strDirectory)
end function
''
' Checks if this is a WOW64 process.
function IsWow64()
IsWow64 = 1
else
IsWow64 = 0
end if
end function
''
' Returns a reverse sorted array (strings).
function ArraySortStrings(arrStrings)
str1 = arrStrings(i)
str2 = arrStrings(j)
arrStrings(j) = str1
end if
next
arrStrings(i) = str1
next
end function
''
' Prints a string array.
next
end sub
''
' Returns a reverse sorted array (strings).
function ArrayRSortStrings(arrStrings)
' Sort it.
' Reverse the array.
if cnt > 0 then
j = UBound(arrStrings)
strTmp = arrStrings(i)
arrStrings(i) = arrStrings(j)
arrStrings(j) = strTmp
j = j - 1
next
end if
end function
''
' Returns the input array with the string appended.
' Note! There must be some better way of doing this...
dim i, cnt
next
end function
''
' Translates a register root name to a value
function RegTransRoot(strRoot)
const HKEY_LOCAL_MACHINE = &H80000002
const HKEY_CURRENT_USER = &H80000001
select case strRoot
case "HKLM"
case "HKCU"
case else
RegTransRoot = 0
end select
end function
'' The registry globals
dim g_objReg, g_objRegCtx
dim g_blnRegistry
g_blnRegistry = false
''
' Init the register provider globals.
function RegInit()
RegInit = false
On Error Resume Next
if g_blnRegistry = false then
' Comment out the following for lines if the cause trouble on your windows version.
if IsWow64() then
end if
g_blnRegistry = true
end if
RegInit = true
end function
''
' Gets a value from the registry. Returns "" if string wasn't found / valid.
function RegGetString(strName)
RegGetString = ""
if RegInit() then
dim iRoot
' split up into root, key and value parts.
' Must use ExecMethod to call the GetStringValue method because of the context.
On Error Resume Next
end if
else
' fallback mode
On Error Resume Next
end if
end function
''
' Returns an array of subkey strings.
dim iRoot
RegEnumSubKeys = Array()
if RegInit() then
' Must use ExecMethod to call the EnumKey method because of the context.
On Error Resume Next
end if
else
' fallback mode
On Error Resume Next
if rc = 0 then
end if
end if
end function
''
' Returns an array of full path subkey strings.
dim arrTmp
next
end function
''
' Returns an rsorted array of subkey strings.
end function
''
' Returns an rsorted array of subkey strings.
end function
''
' Gets the commandline used to invoke the script.
function GetCommandline()
dim str, i
'' @todo find an api for querying it instead of reconstructing it like this...
GetCommandline = "cscript configure.vbs"
if str = "" then
end if
next
end function
''
' Gets an environment variable.
end function
''
' Sets an environment variable.
end sub
''
' Appends a string to an environment variable
dim str
end sub
''
' Prepends a string to an environment variable
dim str
end sub
''
' Get the path of the parent directory. Returns root if root was specified.
' Expects abs path.
function PathParent(str)
end function
''
' Strips the filename from at path.
function PathStripFilename(str)
end function
''
' Get the abs path, use the short version if necessary.
if strParent = "" then
else
dim obj
set obj = Nothing
if FileExists(PathAbs) then
end if
if not (obj is nothing) then
then
then
& "need to be copied or reinstalled to a location without 'spaces', '$', ';' " _
& "or '&' in the path name. (Unless it's a problem with this script of course...)"
end if
else
end if
exit for
end if
next
end if
end if
end function
''
' Get the abs path, use the long version.
function PathAbsLong(str)
if strParent = "" then
else
dim obj
set obj = Nothing
if FileExists(PathAbsLong) then
elseif DirExists(PathAbsLong) then
end if
if not (obj is nothing) then
exit for
end if
next
end if
end if
end function
''
' Executes a command in the shell catching output in g_strShellOutput
if blnBoth = true then
else
end if
loop
LogPrint "# Start of Output"
LogPrint "# End of Output"
end function
''
' Try find the specified file in the path.
' the path
iStart = 1
if FileExists(str) then
exit function
end if
end if
loop
' registry or somewhere?
Which = ""
end function
''
' Append text to the log file and echo it to stdout
end sub
''
' Prints a test header
end sub
''
' Prints a success message
end sub
''
' Prints a successfully detected path
else
end if
end sub
''
' Warning message.
sub MsgWarning(strMsg)
end sub
''
' Fatal error.
end sub
''
' Error message, fatal unless flag to ignore errors is given.
if g_blnInternalMode = False then
end if
end sub
''
' Write a log header with some basic info.
sub LogInit
next
LogPrint "# No arguments given"
end if
' some Wscript stuff
LogPrint "# Wscript properties:"
LogPrint "#"
' the environment
LogPrint "# Environment:"
dim objEnv
next
LogPrint "#"
end sub
''
' Append text to the log file.
'Wscript.Echo "dbg: " & str
end sub
''
' Checks if the file exists and logs failures.
if LogFileExists = False then
end if
end function
''
' Finds the first file matching the pattern.
' If no file is found, log the failure.
dim str
'
' Yes, there are some facy database kinda interface to the filesystem
' however, breaking down the path and constructing a usable query is
' too much hassle. So, we'll do it the unix way...
'
then
' return the first word.
else
LogFindFile = ""
end if
end function
''
' Finds the first directory matching the pattern.
' If no directory is found, log the failure,
' else return the complete path to the found directory.
dim str
'
' Yes, there are some facy database kinda interface to the filesystem
' however, breaking down the path and constructing a usable query is
' too much hassle. So, we'll do it the unix way...
'
' List the alphabetically last names as first entries (with /O-N).
if Shell("dir /B /AD /O-N """ & DosSlashes(strPath) & "\" & DosSlashes(strPattern) & """", True) = 0 _
then
' return the first word.
else
LogFindDir = ""
end if
end function
''
' Initializes the config file.
sub CfgInit
CfgPrint "# -*- Makefile -*-"
CfgPrint "#"
CfgPrint "#"
if g_blnInternalMode = False then
CfgPrint "VBOX_OSE := 1"
end if
end sub
''
' Prints a string to the config file.
end sub
''
' Initializes the environment batch script.
sub EnvInit
EnvPrint "@echo off"
EnvPrint "rem"
EnvPrint "rem"
end sub
''
' Prints a string to the environment batch script.
end sub
''
' No COM
sub DisableCOM(strReason)
if g_blnDisableCOM = False then
g_blnDisableCOM = True
CfgPrint "VBOX_WITH_MAIN="
CfgPrint "VBOX_WITH_QTGUI="
CfgPrint "VBOX_WITH_VBOXSDL="
CfgPrint "VBOX_WITH_DEBUGGER_GUI="
CfgPrint "VBOX_WITHOUT_COM=1"
end if
end sub
''
' Checks the the path doesn't contain characters the tools cannot deal with.
sub CheckSourcePath
dim sPwd
end if
end if
end if
then
end if
Print "Source path: OK"
end sub
''
' Checks for kBuild - very simple :)
PrintHdr "kBuild"
'
' Check if there is a 'kmk' in the path somewhere without
' any PATH_KBUILD* stuff around.
'
blnNeedEnvVars = True
g_strPathkBuildBin = ""
if (g_strPathkBuild = "") _
'' @todo Need to parse out the PATH_KBUILD and PATH_KBUILD_BIN values to complete the other tests.
'blnNeedEnvVars = False
MsgWarning "You've installed kBuild it seems. configure.vbs hasn't been updated to " _
& "deal with that yet and will use the one it ships with. Sorry."
end if
'
'
if g_strPathkBuild = "" then
g_strPathkBuild = ""
end if
if g_strPathkBuild = "" then
end if
end if
'
' Determin the location of the kBuild binaries.
'
if g_strPathkBuildBin = "" then
dim str2
else ' boldly assumes there is only x86 and amd64.
end if
end if
end if
end if
'
' Perform basic validations of the kBuild installation.
'
& "incorrect PATH_KBUILD in the environment or the checkout didn't succeed."
exit sub
end if
& "incorrect PATH_KBUILD in the environment or the checkout didn't succeed."
exit sub
end if
MsgFatal "Can't execute '" & g_strPathkBuildBin & "/kmk.exe --version'. check configure.log for the out."
exit sub
end if
'
' Check for env.vars that kBuild uses.
'
if (str <> "") _
EnvPrint "set BUILD_TYPE=release"
MsgWarning "Found unknown BUILD_TYPE value '" & str &"' in your environment. Setting it to 'release'."
end if
if (str <> "") _
And (InStr(1, "win|win32|win64", str) <= 0) then '' @todo later only 'win' will be valid. remember to fix this check!
EnvPrint "set BUILD_TARGET=win"
MsgWarning "Found unknown BUILD_TARGET value '" & str &"' in your environment. Setting it to 'win32'."
end if
if (str <> "") _
EnvPrint "set BUILD_TARGET_ARCH=x86"
MsgWarning "Found unknown BUILD_TARGET_ARCH value '" & str &"' in your environment. Setting it to 'x86'."
end if
' perhaps a bit pedantic this since this isn't clearly define nor used much...
if (str <> "") _
EnvPrint "set BUILD_TARGET_CPU=i386"
MsgWarning "Found unknown BUILD_TARGET_CPU value '" & str &"' in your environment. Setting it to 'i386'."
end if
if (str <> "") _
And (InStr(1, "win|win32|win64", str) <= 0) then '' @todo later only 'win' will be valid. remember to fix this check!
EnvPrint "set BUILD_PLATFORM=win"
MsgWarning "Found unknown BUILD_PLATFORM value '" & str &"' in your environment. Setting it to 'win32'."
end if
if (str <> "") _
EnvPrint "set BUILD_PLATFORM_ARCH=x86"
MsgWarning "Found unknown BUILD_PLATFORM_ARCH value '" & str &"' in your environment. Setting it to 'x86'."
end if
' perhaps a bit pedantic this since this isn't clearly define nor used much...
if (str <> "") _
EnvPrint "set BUILD_PLATFORM_CPU=i386"
MsgWarning "Found unknown BUILD_PLATFORM_CPU value '" & str &"' in your environment. Setting it to 'i386'."
end if
'
' If PATH_DEV is set, check that it's pointing to something useful.
'
if (str <> "") _
And False then '' @todo add some proper tests here.
end if
'
' Write PATH_KBUILD to the environment script if necessary.
'
if blnNeedEnvVars = True then
end if
end sub
''
' Checks for Visual C++ version 7.1, 8 or 10.
PrintHdr "Visual C++"
'
' Try find it...
'
strPathVC = ""
strPathVCCommon = ""
end if
end if
if g_blnNewTools Then
strPathVC = ""
end if
end if
if strPathVC = "" then
strPathVC = ""
end if
end if
end if
end if
if (strPathVC = "") _
' don't know how to deal with this cl.
else
end if
end if
if str <> "" Then
end if
end if
end if
if str <> "" Then
end if
end if
end if
if strPathVC = "" then
str2 = RegGetString("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS\EnvironmentDirectory")
end if
end if
end if
if strPathVC = "" then
end if
end if
end if
if strPathVC = "" then
'' @todo check what this really looks like on 7.1
end if
end if
end if
if strPathVC = "" then
end if
end if
end if
if strPathVC = "" then
if str <> "" then
end if
end if
end if
if strPathVC = "" then
if str <> "" then
end if
end if
end if
' finally check for the express edition.
if strPathVC = "" then
str = RegGetString("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual C++ 2005 Express Edition - ENU\InstallLocation")
if str <> "" then
end if
end if
end if
strPathVC = ""
end if
end if
end if
if strPathVC = "" then
MsgError "Cannot find cl.exe (Visual C++) anywhere on your system. Check the build requirements."
exit sub
end if
'
' Clean up the path and determin the VC directory.
'
'
' Check the version.
' We'll have to make sure mspdbXX.dll is somewhere in the PATH.
'
if (strPathVCCommon <> "") Then
end if
MsgError "Executing '" & strClExe & "' (which we believe to be the Visual C++ compiler driver) failed."
exit sub
end if
MsgError "The Visual C++ compiler we found ('" & strPathVC & "') isn't 7.1, 8.0 or 10.0. Check the build requirements."
exit sub
end if
'
' Ok, emit build config variables.
'
CfgPrint "VBOX_USE_VCC100 := 1"
CfgPrint "PATH_TOOL_VCC100X86 = $(PATH_TOOL_VCC100)"
CfgPrint "PATH_TOOL_VCC100AMD64 = $(PATH_TOOL_VCC100)"
CfgPrint "TOOL_VCC100AMD64_MT = $(TOOL_VCC100X86_MT)"
CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
else
CfgPrint "TOOL_VCC100AMD64_MT = $(TOOL_VCC100X86_MT)"
CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
DisableCOM "No ATL"
end if
CfgPrint "VBOX_USE_VCC80 := 1"
CfgPrint "PATH_TOOL_VCC80X86 = $(PATH_TOOL_VCC80)"
CfgPrint "PATH_TOOL_VCC80AMD64 = $(PATH_TOOL_VCC80)"
then
CfgPrint "TOOL_VCC80AMD64_MT = $(TOOL_VCC80X86_MT)"
CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
DisableCOM "No ATL"
else
end if
else
then
CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
DisableCOM "No ATL"
else
end if
end if
' and the env.bat path fix.
if strPathVCCommon <> "" then
end if
end sub
''
' Checks if the specified path points to a usable PSDK.
CheckForVisualCPPSub = False
LogPrint "trying: strPathVC=" & strPathVC & " strPathVCCommon=" & strPathVCCommon & " blnOptVCExpressEdition=" & blnOptVCExpressEdition
then
Then
CheckForVisualCPPSub = True
end if
end if
end function
''
' Checks for a platform SDK that works with the compiler
dim strPathPSDK, str
PrintHdr "Windows Platform SDK (recent)"
strPathPSDK = ""
' Check the supplied argument first.
if str <> "" then
end if
' The tools location (first).
end if
end if
end if
' Look for it in the environment
end if
end if
' Check if there is one installed with the compiler.
end if
' Check the registry next (ASSUMES sorting). (first pair is vista, second is pre-vista)
for each strSubKey in arrSubKeys
str = RegGetString("HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\" & strSubKey & "\InstallationFolder")
end if
Next
for each strSubKey in arrSubKeys
str = RegGetString("HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\" & strSubKey & "\InstallationFolder")
end if
Next
for each strSubKey in arrSubKeys
str = RegGetString("HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\" & strSubKey & "\Install Dir")
end if
Next
for each strSubKey in arrSubKeys
str = RegGetString("HKCU\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\" & strSubKey & "\Install Dir")
end if
Next
' The tools location (post).
end if
end if
end if
' Give up.
if strPathPSDK = "" then
MsgError "Cannot find a suitable Platform SDK. Check configure.log and the build requirements."
exit sub
end if
'
' Emit the config.
'
CfgPrint "PATH_SDK_WINPSDKINCS = $(PATH_SDK_WINPSDK)"
CfgPrint "PATH_SDK_WIN32SDK = $(PATH_SDK_WINPSDK)"
CfgPrint "PATH_SDK_WIN64SDK = $(PATH_SDK_WINPSDK)"
end sub
''
' Checks if the specified path points to a usable PSDK.
function CheckForPlatformSDKSub(strPathPSDK)
CheckForPlatformSDKSub = False
then
CheckForPlatformSDKSub = True
end if
end function
''
' Checks for a Windows 2003 DDK or Windows 7 Driver Kit.
PrintHdr "Windows 2003 DDK, build 3790 or later"
'
' Find the DDK.
'
strPathDDK = ""
' The specified path.
end if
' The tools location (first).
end if
end if
' Check the environment
end if
end if
' Some array constants to ease the work.
' Windows 7 WDK.
arrLocations = array()
for each strSoftwareKey in arrSoftwareKeys
for each strSubKey in RegEnumSubKeysFull("HKLM", strSoftwareKey & "\Microsoft\KitSetup\configured-kits")
if str <> "" then
end if
next
next
next
' Vista WDK.
Next
next
' Pre-Vista WDK?
Next
next
' Check the locations we've gathered.
for each str in arrLocations
if strPathDDK = "" then
end if
next
' The tools location (post).
end if
end if
' Give up.
if strPathDDK = "" then
MsgError "Cannot find a suitable Windows 2003 DDK. Check configure.log and the build requirements."
exit sub
end if
'
' Emit the config.
'
CfgPrint "VBOX_USE_WINDDK := 1"
else
CfgPrint "PATH_SDK_W2K3DDKX86 = $(PATH_SDK_W2K3DDK)"
CfgPrint "PATH_SDK_W2K3DDKAMD64 = $(PATH_SDK_W2K3DDK)"
end if
end sub
'' Quick check if the DDK is in the specified directory or not.
CheckForWin2k3DDKSub = False
if g_blnNewTools _
then
CheckForWin2k3DDKSub = True
end if
then
CheckForWin2k3DDKSub = True
end if
end function
''
' Finds midl.exe
sub CheckForMidl()
dim strMidl
PrintHdr "Midl.exe"
if g_blnDisableCOM then
exit sub
end if
else
MsgWarning "Midl.exe not found!"
exit sub
end if
end sub
''
' Checks for a recent DirectX SDK.
PrintHdr "Direct X SDK"
'
' Find the DX SDK.
'
strPathDXSDK = ""
' The specified path.
end if
' The tools location (first).
end if
' Check the installer registry (sucks a bit).
for Each strSubKey In arrSubKeys
for Each strSubKey2 In arrSubKeys2
if CheckForDirectXSDKSub(str) then
Exit For
end if
end if
end if
Next
Next
' The tools location (post).
end if
' Give up.
if strPathDXSDK = "" then
MsgError "Cannot find a suitable Direct X SDK. Check configure.log and the build requirements."
exit sub
end if
'
' Emit the config.
'
CfgPrint "PATH_SDK_DXSDKX86 = $(PATH_SDK_DXSDK)"
CfgPrint "PATH_SDK_DXSDKAMD64 = $(PATH_SDK_DXSDK)"
end sub
'' Quick check if the DXSDK is in the specified directory or not.
function CheckForDirectXSDKSub(strPathDXSDK)
CheckForDirectXSDKSub = False
then
CheckForDirectXSDKSub = True
end if
end function
''
' Checks for a MingW32 suitable for building the recompiler.
'
' strOptW32API is currently ignored.
'
PrintHdr "MinGW GCC v3.3.x + Binutils + Runtime + W32API"
'
' Find the MinGW and W32API tools.
'
strPathMingW = ""
strPathW32API = ""
' The specified path.
end if
end if
' The tools location (first).
end if
end if
' See if there is any gcc around.
if strPathMingW = "" then
if (str <> "") then
end if
end if
if strPathMingW = "" then
if (str <> "") then
end if
end if
' The tools location (post).
end if
end if
' Success?
if strPathMingW = "" then
if strOptMingw = "" then
MsgError "Can't locate a suitable MinGW installation. Try specify the path with " _
& "the --with-MinGW=<path> argument. If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate a suitable MinGW installation. Please consult the configure.log and the build requirements."
end if
exit sub
end if
'
' Emit the config.
'
CfgPrint "PATH_SDK_W32API = $(PATH_TOOL_MINGW32)"
else
end if
end sub
''
' Checks if the specified path points to an usable MinGW or not.
g_strSubOutput = ""
_
then
' extract the version.
strVer = ""
if offVer > 0 then
else
strVer = ""
end if
end if
if strVer <> "" then
CheckForMingWSub = True
else
LogPrint "MinGW version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
end if
else
LogPrint "Couldn't locate the GCC version in the output!"
end if
else
LogPrint "Failed to run gcc.exe!"
end if
end if
end function
''
' Checks for any libSDL binaries.
dim strPathlibSDL, str
PrintHdr "libSDL"
'
' Try find some SDL library.
'
' First, the specific location.
strPathlibSDL = ""
end if
' The tools location (first).
end if
end if
' Poke about in the path.
end if
end if
' The tools location (post).
end if
end if
' Success?
if strPathlibSDL = "" then
if strOptlibSDL = "" then
MsgError "Can't locate libSDL. Try specify the path with the --with-libSDL=<path> argument. " _
& "If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate libSDL. Please consult the configure.log and the build requirements."
end if
exit sub
end if
end sub
''
' Checks if the specified path points to an usable libSDL or not.
function CheckForlibSDLSub(strPathlibSDL)
CheckForlibSDLSub = False
then
CheckForlibSDLSub = True
end if
end function
''
' Checks for libxml2.
sub CheckForXml2(strOptXml2)
dim strPathXml2, str
PrintHdr "libxml2"
if g_blnDisableCOM then
exit sub
end if
'
'
strPathXml2 = ""
end if
if strPathXml2 = "" Then
if str <> "" Then
end if
end if
' Ignore failure if we're in 'internal' mode.
exit sub
end if
' Success?
if strPathXml2 = "" then
if strOptXml2 = "" then
MsgError "Can't locate libxml2. Try specify the path with the --with-libxml2=<path> argument. " _
& "If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate libxml2. Please consult the configure.log and the build requirements."
end if
exit sub
end if
end sub
''
' Checks if the specified path points to an usable libxml2 or not.
function CheckForXml2Sub(strPathXml2)
dim str
CheckForXml2Sub = False
then
if str <> "" then
CheckForXml2Sub = True
end if
end if
end if
end function
''
' Checks for libxslt.
sub CheckForXslt(strOptXslt)
dim strPathXslt, str
PrintHdr "libxslt"
if g_blnDisableCOM then
exit sub
end if
'
'
strPathXslt = ""
end if
if strPathXslt = "" Then
if str <> "" Then
end if
end if
if strPathXslt = "" Then
if str <> "" Then
end if
end if
' Ignore failure if we're in 'internal' mode.
exit sub
end if
' Success?
if strPathXslt = "" then
if strOptXslt = "" then
MsgError "Can't locate libxslt. Try specify the path with the --with-libxslt=<path> argument. " _
& "If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate libxslt. Please consult the configure.log and the build requirements."
end if
exit sub
end if
end sub
''
' Checks if the specified path points to an usable libxslt or not.
function CheckForXsltSub(strPathXslt)
dim str
CheckForXsltSub = False
then
if str <> "" then
then
CheckForXsltSub = True
end if
end if
end if
end function
''
' Checks for openssl
sub CheckForSsl(strOptSsl)
dim strPathSsl, str
PrintHdr "openssl"
'
'
strPathSsl = ""
end if
if strPathSsl = "" Then
if str <> "" Then
end if
end if
' Ignore failure if we're in 'internal' mode.
exit sub
end if
' Success?
if strPathSsl = "" then
if strOptSsl = "" then
MsgError "Can't locate openssl. Try specify the path with the --with-openssl=<path> argument. " _
& "If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate openssl. Please consult the configure.log and the build requirements."
end if
exit sub
end if
CfgPrint "SDK_VBOX_OPENSSL_LIBS := " & strPathSsl & "/lib/ssleay32.lib" & " " & strPathSsl & "/lib/libeay32.lib"
CfgPrint "SDK_VBOX_BLD_OPENSSL_LIBS := " & strPathSsl & "/lib/ssleay32.lib" & " " & strPathSsl & "/lib/libeay32.lib"
end sub
''
' Checks if the specified path points to an usable openssl or not.
function CheckForSslSub(strPathSsl)
CheckForSslSub = False
then
CheckForSslSub = True
end if
end function
''
' Checks for libcurl
sub CheckForCurl(strOptCurl)
dim strPathCurl, str
PrintHdr "libcurl"
'
'
strPathCurl = ""
end if
if strPathCurl = "" Then
if str <> "" Then
end if
end if
' Ignore failure if we're in 'internal' mode.
exit sub
end if
' Success?
if strPathCurl = "" then
if strOptCurl = "" then
MsgError "Can't locate libcurl. Try specify the path with the --with-libcurl=<path> argument. " _
& "If still no luck, consult the configure.log and the build requirements."
else
MsgError "Can't locate libcurl. Please consult the configure.log and the build requirements."
end if
exit sub
end if
end sub
''
' Checks if the specified path points to an usable libcurl or not.
function CheckForCurlSub(strPathCurl)
CheckForCurlSub = False
then
CheckForCurlSub = True
end if
end function
''
''
' Checks for any Qt4 binaries.
sub CheckForQt4(strOptQt4)
dim strPathQt4
PrintHdr "Qt4"
'
' Try to find the Qt4 installation (user specified path with --with-qt4)
'
strPathQt4 = ""
LogPrint "Checking for user specified path of Qt4 ... "
end if
if strPathQt4 = "" then
CfgPrint "VBOX_WITH_QT4GUI="
else
CfgPrint "PATH_TOOL_QT4 = $(PATH_SDK_QT4)"
CfgPrint "VBOX_PATH_QT4 = $(PATH_SDK_QT4)"
end if
end sub
'
'
function CheckForQt4Sub(strPathQt4)
CheckForQt4Sub = False
then
CheckForQt4Sub = True
end if
end function
'
'
function CheckForPython(strPathPython)
PrintHdr "Python"
CheckForPython = False
CheckForPython = True
end if
end function
'
'
function CheckForMkisofs(strFnameMkisofs)
PrintHdr "mkisofs"
CheckForMkisofs = False
if FileExists(strFnameMkisofs) = false then
else
CheckForMkisofs = True
end if
end function
''
' Show usage.
sub usage
Print "Usage: cscript configure.vbs [options]"
Print ""
Print "Configuration:"
Print " -h, --help"
Print " --internal"
Print " --internal-last"
Print ""
Print "Components:"
Print " --disable-COM"
Print ""
Print "Locations:"
Print " --with-DDK=PATH "
Print " --with-DXSDK=PATH "
Print " --with-kBuild=PATH "
Print " --with-libSDL=PATH "
Print " --with-MinGW=PATH "
Print " --with-Qt4=PATH "
Print " --with-SDK=PATH "
Print " --with-VC=PATH "
Print " --with-VC-Common=PATH "
Print " --with-VC-Express-Edition"
Print " --with-W32API=PATH "
Print " --with-libxml2=PATH "
Print " --with-libxslt=PATH "
Print " --with-openssl=PATH "
Print " --with-libcurl=PATH "
Print " --with-python=PATH "
end sub
''
' The main() like function.
'
Sub Main
'
' Write the log header and check that we're not using wscript.
'
End If
'
' Parse arguments.
'
strOptDDK = ""
strOptDXDDK = ""
strOptkBuild = ""
strOptlibSDL = ""
strOptMingW = ""
strOptQt4 = ""
strOptSDK = ""
strOptVC = ""
strOptVCCommon = ""
blnOptVCExpressEdition = False
strOptW32API = ""
strOptXml2 = ""
strOptXslt = ""
strOptSsl = ""
strOptCurl = ""
strOptPython = ""
strOptMkisofs = ""
blnOptDisableCOM = False
' Separate argument and path value
else
strPath = ""
end if
' Process the argument
case "--with-ddk"
case "--with-dxsdk"
case "--with-kbuild"
case "--with-libsdl"
case "--with-mingw"
case "--with-qt4"
case "--with-sdk"
case "--with-vc"
case "--with-vc-common"
case "--with-vc-express-edition"
blnOptVCExpressEdition = True
case "--with-w32api"
case "--with-libxml2"
case "--with-libxslt"
case "--with-openssl"
case "--with-libcurl"
case "--with-python"
case "--with-mkisofs"
case "--disable-com"
blnOptDisableCOM = True
case "--enable-com"
blnOptDisableCOM = False
case "--internal"
g_blnInternalMode = True
case "--internal-last"
g_blnInternalFirst = False
case "-h", "--help", "-?"
case else
end select
next
'
' Initialize output files.
'
'
' Check that the Shell function is sane.
'
if Shell("set TESTING_ENVIRONMENT_INHERITANC", False) <> 0 then ' The 'E' is missing on purpose (4nt).
MsgFatal "shell execution test failed!"
end if
MsgFatal "shell inheritance or shell execution isn't working right."
end if
Print "Shell inheritance test: OK"
'
' Do the checks.
'
if blnOptDisableCOM = True then
DisableCOM "--disable-com"
end if
' Don't check for these libraries by default as they are part of OSE
' Using external libs can add a dependency to iconv
if (strOptXml2 <> "") then
end if
if (strOptXslt <> "") then
end if
if (strOptPython <> "") then
end if
if (strOptMkisofs <> "") then
end if
if g_blnInternalMode then
end if
Print ""
Print "Execute env.bat once before you start to build VBox:"
Print ""
Print " env.bat"
Print " kmk"
Print ""
End Sub