1 | ' $Id: configure.vbs 6079 2007-12-15 03:55:18Z vboxsync $
|
---|
2 | '' @file
|
---|
3 | ' The purpose of this script is to check for all external tools, headers, and
|
---|
4 | ' libraries VBox OSE depends on.
|
---|
5 | '
|
---|
6 | ' The script generates the build configuration file 'AutoConfig.kmk' and the
|
---|
7 | ' environment setup script 'env.bat'. A log of what has been done is
|
---|
8 | ' written to 'configure.log'.
|
---|
9 | '
|
---|
10 |
|
---|
11 | '
|
---|
12 | ' Copyright (C) 2006-2007 innotek GmbH
|
---|
13 | '
|
---|
14 | ' This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
15 | ' available from http://www.215389.xyz. This file is free software;
|
---|
16 | ' you can redistribute it and/or modify it under the terms of the GNU
|
---|
17 | ' General Public License (GPL) as published by the Free Software
|
---|
18 | ' Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
19 | ' VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
20 | ' hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
21 | '
|
---|
22 |
|
---|
23 |
|
---|
24 | '*****************************************************************************
|
---|
25 | '* Global Variables *
|
---|
26 | '*****************************************************************************
|
---|
27 | dim g_strPath, g_strEnvFile, g_strLogFile, g_strCfgFile, g_strShellOutput
|
---|
28 | g_strPath = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName) - Len("\configure.vbs"))
|
---|
29 | g_strEnvFile = g_strPath & "\env.bat"
|
---|
30 | g_strCfgFile = g_strPath & "\AutoConfig.kmk"
|
---|
31 | g_strLogFile = g_strPath & "\configure.log"
|
---|
32 | 'g_strTmpFile = g_strPath & "\configure.tmp"
|
---|
33 |
|
---|
34 | dim g_objShell, g_objFileSys
|
---|
35 | Set g_objShell = WScript.CreateObject("WScript.Shell")
|
---|
36 | Set g_objFileSys = WScript.CreateObject("Scripting.FileSystemObject")
|
---|
37 |
|
---|
38 | dim g_strPathkBuild, g_strPathkBuildBin, g_strPathDev, g_strPathVCC, g_strPathPSDK, g_strPathDDK, g_strSubOutput
|
---|
39 | g_strPathkBuild = ""
|
---|
40 | g_strPathDev = ""
|
---|
41 | g_strPathVCC = ""
|
---|
42 | g_strPathPSDK = ""
|
---|
43 | g_strPathDDK = ""
|
---|
44 |
|
---|
45 | dim g_blnDisableCOM, g_strDisableCOM
|
---|
46 | g_blnDisableCOM = False
|
---|
47 | g_strDisableCOM = ""
|
---|
48 |
|
---|
49 | ' The internal mode is primarily for skipping the xerces and xalan monsters.
|
---|
50 | dim g_blnInternalMode
|
---|
51 | g_blnInternalMode = False
|
---|
52 |
|
---|
53 |
|
---|
54 |
|
---|
55 | ''
|
---|
56 | ' Converts to unix slashes
|
---|
57 | function UnixSlashes(str)
|
---|
58 | UnixSlashes = replace(str, "\", "/")
|
---|
59 | end function
|
---|
60 |
|
---|
61 |
|
---|
62 | ''
|
---|
63 | ' Converts to dos slashes
|
---|
64 | function DosSlashes(str)
|
---|
65 | DosSlashes = replace(str, "/", "\")
|
---|
66 | end function
|
---|
67 |
|
---|
68 |
|
---|
69 | ''
|
---|
70 | ' Read a file (typically the tmp file) into a string.
|
---|
71 | function FileToString(strFilename)
|
---|
72 | const ForReading = 1, TristateFalse = 0
|
---|
73 | dim objLogFile, str
|
---|
74 |
|
---|
75 | set objFile = g_objFileSys.OpenTextFile(DosSlashes(strFilename), ForReading, False, TristateFalse)
|
---|
76 | str = objFile.ReadAll()
|
---|
77 | objFile.Close()
|
---|
78 |
|
---|
79 | FileToString = str
|
---|
80 | end function
|
---|
81 |
|
---|
82 |
|
---|
83 | ''
|
---|
84 | ' Deletes a file
|
---|
85 | sub FileDelete(strFilename)
|
---|
86 | if g_objFileSys.FileExists(DosSlashes(strFilename)) then
|
---|
87 | g_objFileSys.DeleteFile(DosSlashes(strFilename))
|
---|
88 | end if
|
---|
89 | end sub
|
---|
90 |
|
---|
91 |
|
---|
92 | ''
|
---|
93 | ' Appends a line to an ascii file.
|
---|
94 | sub FileAppendLine(strFilename, str)
|
---|
95 | const ForAppending = 8, TristateFalse = 0
|
---|
96 | dim objFile
|
---|
97 |
|
---|
98 | set objFile = g_objFileSys.OpenTextFile(DosSlashes(strFilename), ForAppending, True, TristateFalse)
|
---|
99 | objFile.WriteLine(str)
|
---|
100 | objFile.Close()
|
---|
101 | end sub
|
---|
102 |
|
---|
103 |
|
---|
104 | ''
|
---|
105 | ' Checks if the file exists.
|
---|
106 | function FileExists(strFilename)
|
---|
107 | FileExists = g_objFileSys.FileExists(DosSlashes(strFilename))
|
---|
108 | end function
|
---|
109 |
|
---|
110 |
|
---|
111 | ''
|
---|
112 | ' Checks if the directory exists.
|
---|
113 | function DirExists(strDirectory)
|
---|
114 | DirExists = g_objFileSys.FolderExists(DosSlashes(strDirectory))
|
---|
115 | end function
|
---|
116 |
|
---|
117 |
|
---|
118 | ''
|
---|
119 | ' Checks if this is a WOW64 process.
|
---|
120 | function IsWow64()
|
---|
121 | if g_objShell.Environment("PROCESS")("PROCESSOR_ARCHITEW6432") <> "" then
|
---|
122 | IsWow64 = 1
|
---|
123 | else
|
---|
124 | IsWow64 = 0
|
---|
125 | end if
|
---|
126 | end function
|
---|
127 |
|
---|
128 |
|
---|
129 | ''
|
---|
130 | ' Translates a register root name to a value
|
---|
131 | function RegTransRoot(strRoot)
|
---|
132 | const HKEY_LOCAL_MACHINE = &H80000002
|
---|
133 | const HKEY_CURRENT_USER = &H80000001
|
---|
134 | select case strRoot
|
---|
135 | case "HKLM"
|
---|
136 | RegTransRoot = HKEY_LOCAL_MACHINE
|
---|
137 | case "HKCU"
|
---|
138 | RegTransRoot = HKEY_CURRENT_USER
|
---|
139 | case else
|
---|
140 | MsgFatal "RegEnumSubKeys: Unknown root: " & strRoot
|
---|
141 | RegTransRoot = 0
|
---|
142 | end select
|
---|
143 | end function
|
---|
144 |
|
---|
145 |
|
---|
146 | '' The registry globals
|
---|
147 | dim g_objReg, g_objRegCtx
|
---|
148 | dim g_blnRegistry
|
---|
149 | g_blnRegistry = false
|
---|
150 |
|
---|
151 |
|
---|
152 | ''
|
---|
153 | ' Init the register provider globals.
|
---|
154 | function RegInit()
|
---|
155 | RegInit = false
|
---|
156 | On Error Resume Next
|
---|
157 | if g_blnRegistry = false then
|
---|
158 | set g_objRegCtx = CreateObject("WbemScripting.SWbemNamedValueSet")
|
---|
159 | ' Comment out the following for lines if the cause trouble on your windows version.
|
---|
160 | if IsWow64() then
|
---|
161 | g_objRegCtx.Add "__ProviderArchitecture", 64
|
---|
162 | g_objRegCtx.Add "__RequiredArchitecture", true
|
---|
163 | end if
|
---|
164 | set objLocator = CreateObject("Wbemscripting.SWbemLocator")
|
---|
165 | set objServices = objLocator.ConnectServer("", "root\default", "", "", , , , g_objRegCtx)
|
---|
166 | set g_objReg = objServices.Get("StdRegProv")
|
---|
167 | g_blnRegistry = true
|
---|
168 | end if
|
---|
169 | RegInit = true
|
---|
170 | end function
|
---|
171 |
|
---|
172 |
|
---|
173 | ''
|
---|
174 | ' Gets a value from the registry. Returns "" if string wasn't found / valid.
|
---|
175 | function RegGetString(strName)
|
---|
176 | RegGetString = ""
|
---|
177 | if RegInit() then
|
---|
178 | dim strRoot, strKey, strValue
|
---|
179 | dim iRoot
|
---|
180 |
|
---|
181 | ' split up into root, key and value parts.
|
---|
182 | strRoot = left(strName, instr(strName, "\") - 1)
|
---|
183 | strKey = mid(strName, instr(strName, "\") + 1, instrrev(strName, "\") - instr(strName, "\"))
|
---|
184 | strValue = mid(strName, instrrev(strName, "\") + 1)
|
---|
185 |
|
---|
186 | ' Must use ExecMethod to call the GetStringValue method because of the context.
|
---|
187 | Set InParms = g_objReg.Methods_("GetStringValue").Inparameters
|
---|
188 | InParms.hDefKey = RegTransRoot(strRoot)
|
---|
189 | InParms.sSubKeyName = strKey
|
---|
190 | InParms.sValueName = strValue
|
---|
191 | On Error Resume Next
|
---|
192 | set OutParms = g_objReg.ExecMethod_("GetStringValue", InParms, , g_objRegCtx)
|
---|
193 | if OutParms.ReturnValue = 0 then
|
---|
194 | RegGetString = OutParms.sValue
|
---|
195 | end if
|
---|
196 | else
|
---|
197 | ' fallback mode
|
---|
198 | On Error Resume Next
|
---|
199 | RegGetString = g_objShell.RegRead(strName)
|
---|
200 | end if
|
---|
201 | end function
|
---|
202 |
|
---|
203 |
|
---|
204 | ''
|
---|
205 | ' Returns an array of subkey strings.
|
---|
206 | function RegEnumSubKeys(strRoot, strKeyPath)
|
---|
207 | dim iRoot
|
---|
208 | iRoot = RegTransRoot(strRoot)
|
---|
209 | RegEnumSubKeys = Array()
|
---|
210 |
|
---|
211 | if RegInit() then
|
---|
212 | ' Must use ExecMethod to call the EnumKey method because of the context.
|
---|
213 | Set InParms = g_objReg.Methods_("EnumKey").Inparameters
|
---|
214 | InParms.hDefKey = RegTransRoot(strRoot)
|
---|
215 | InParms.sSubKeyName = strKeyPath
|
---|
216 | On Error Resume Next
|
---|
217 | set OutParms = g_objReg.ExecMethod_("EnumKey", InParms, , g_objRegCtx)
|
---|
218 | if OutParms.ReturnValue = 0 then
|
---|
219 | RegEnumSubKeys = OutParms.sNames
|
---|
220 | end if
|
---|
221 | else
|
---|
222 | ' fallback mode
|
---|
223 | dim objReg, rc, arrSubKeys
|
---|
224 | set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
|
---|
225 | On Error Resume Next
|
---|
226 | rc = objReg.EnumKey(iRoot, strKeyPath, arrSubKeys)
|
---|
227 | if rc = 0 then
|
---|
228 | RegEnumSubKeys = arrSubKeys
|
---|
229 | end if
|
---|
230 | end if
|
---|
231 | end function
|
---|
232 |
|
---|
233 |
|
---|
234 | ''
|
---|
235 | ' Gets the commandline used to invoke the script.
|
---|
236 | function GetCommandline()
|
---|
237 | dim str, i
|
---|
238 |
|
---|
239 | '' @todo find an api for querying it instead of reconstructing it like this...
|
---|
240 | GetCommandline = "cscript configure.vbs"
|
---|
241 | for i = 1 to WScript.Arguments.Count
|
---|
242 | str = WScript.Arguments.Item(i - 1)
|
---|
243 | if str = "" then
|
---|
244 | str = """"""
|
---|
245 | elseif (InStr(1, str, " ")) then
|
---|
246 | str = """" & str & """"
|
---|
247 | end if
|
---|
248 | GetCommandline = GetCommandline & " " & str
|
---|
249 | next
|
---|
250 | end function
|
---|
251 |
|
---|
252 |
|
---|
253 | ''
|
---|
254 | ' Gets an environment variable.
|
---|
255 | function EnvGet(strName)
|
---|
256 | EnvGet = g_objShell.Environment("PROCESS")(strName)
|
---|
257 | end function
|
---|
258 |
|
---|
259 |
|
---|
260 | ''
|
---|
261 | ' Sets an environment variable.
|
---|
262 | sub EnvSet(strName, strValue)
|
---|
263 | g_objShell.Environment("PROCESS")(strName) = strValue
|
---|
264 | LogPrint "EnvSet: " & strName & "=" & strValue
|
---|
265 | end sub
|
---|
266 |
|
---|
267 |
|
---|
268 | ''
|
---|
269 | ' Appends a string to an environment variable
|
---|
270 | sub EnvAppend(strName, strValue)
|
---|
271 | dim str
|
---|
272 | str = g_objShell.Environment("PROCESS")(strName)
|
---|
273 | g_objShell.Environment("PROCESS")(strName) = str & strValue
|
---|
274 | LogPrint "EnvAppend: " & strName & "=" & str & strValue
|
---|
275 | end sub
|
---|
276 |
|
---|
277 |
|
---|
278 | ''
|
---|
279 | ' Prepends a string to an environment variable
|
---|
280 | sub EnvPrepend(strName, strValue)
|
---|
281 | dim str
|
---|
282 | str = g_objShell.Environment("PROCESS")(strName)
|
---|
283 | g_objShell.Environment("PROCESS")(strName) = strValue & str
|
---|
284 | LogPrint "EnvPrepend: " & strName & "=" & strValue & str
|
---|
285 | end sub
|
---|
286 |
|
---|
287 |
|
---|
288 | ''
|
---|
289 | ' Get the path of the parent directory. Returns root if root was specified.
|
---|
290 | ' Expects abs path.
|
---|
291 | function PathParent(str)
|
---|
292 | PathParent = g_objFileSys.GetParentFolderName(DosSlashes(str))
|
---|
293 | end function
|
---|
294 |
|
---|
295 |
|
---|
296 | ''
|
---|
297 | ' Strips the filename from at path.
|
---|
298 | function PathStripFilename(str)
|
---|
299 | PathStripFilename = g_objFileSys.GetParentFolderName(DosSlashes(str))
|
---|
300 | end function
|
---|
301 |
|
---|
302 |
|
---|
303 | ''
|
---|
304 | ' Get the abs path, use the short version if necessary.
|
---|
305 | function PathAbs(str)
|
---|
306 | PathAbs = g_objFileSys.GetAbsolutePathName(DosSlashes(str))
|
---|
307 | if (InStr(1, PathAbs, " ") > 0) _
|
---|
308 | Or (InStr(1, PathAbs, "&") > 0) _
|
---|
309 | Or (InStr(1, PathAbs, "$") > 0) _
|
---|
310 | then
|
---|
311 | if FileExists(PathAbs) then
|
---|
312 | dim objFile
|
---|
313 | set objFile = g_objFileSys.GetFile(PathAbs)
|
---|
314 | PathAbs = objFile.ShortPath
|
---|
315 | elseif DirExists(PathAbs) then
|
---|
316 | dim objFolder
|
---|
317 | set objFolder = g_objFileSys.GetFolder(PathAbs)
|
---|
318 | PathAbs = objFolder.ShortPath
|
---|
319 | else
|
---|
320 | ' ignore non-existing paths.
|
---|
321 | end if
|
---|
322 | end if
|
---|
323 |
|
---|
324 |
|
---|
325 | if (FileExists(PathAbs) Or DirExists(PathAbs)) _
|
---|
326 | And ( (InStr(1, PathAbs, " ") > 0) _
|
---|
327 | Or (InStr(1, PathAbs, "&") > 0) _
|
---|
328 | Or (InStr(1, PathAbs, "$") > 0)) _
|
---|
329 | then
|
---|
330 | MsgFatal "PathAbs(" & str & ") attempted to return filename with problematic " _
|
---|
331 | & "characters in it (" & PathAbs & "). The tool/sdk referenced will probably " _
|
---|
332 | & "need to be copied or reinstalled to a location without 'spaces', '$', ';' " _
|
---|
333 | & "or '&' in the path name. (Unless it's a problem with this script of course...)"
|
---|
334 | end if
|
---|
335 | end function
|
---|
336 |
|
---|
337 |
|
---|
338 | ''
|
---|
339 | ' Executes a command in the shell catching output in g_strShellOutput
|
---|
340 | function Shell(strCommand, blnBoth)
|
---|
341 | dim strShell, strCmdline, objExec, str
|
---|
342 |
|
---|
343 | strShell = g_objShell.ExpandEnvironmentStrings("%ComSpec%")
|
---|
344 | if blnBoth = true then
|
---|
345 | strCmdline = strShell & " /c " & strCommand & " 2>&1"
|
---|
346 | else
|
---|
347 | strCmdline = strShell & " /c " & strCommand & " 2>nul"
|
---|
348 | end if
|
---|
349 |
|
---|
350 | LogPrint "# Shell: " & strCmdline
|
---|
351 | Set objExec = g_objShell.Exec(strCmdLine)
|
---|
352 | g_strShellOutput = objExec.StdOut.ReadAll()
|
---|
353 | objExec.StdErr.ReadAll()
|
---|
354 | do while objExec.Status = 0
|
---|
355 | Wscript.Sleep 20
|
---|
356 | g_strShellOutput = g_strShellOutput & objExec.StdOut.ReadAll()
|
---|
357 | objExec.StdErr.ReadAll()
|
---|
358 | loop
|
---|
359 |
|
---|
360 | LogPrint "# Status: " & objExec.ExitCode
|
---|
361 | LogPrint "# Start of Output"
|
---|
362 | LogPrint g_strShellOutput
|
---|
363 | LogPrint "# End of Output"
|
---|
364 |
|
---|
365 | Shell = objExec.ExitCode
|
---|
366 | end function
|
---|
367 |
|
---|
368 |
|
---|
369 | ''
|
---|
370 | ' Try find the specified file in the path.
|
---|
371 | function Which(strFile)
|
---|
372 | dim strPath, iStart, iEnd, str
|
---|
373 |
|
---|
374 | ' the path
|
---|
375 | strPath = EnvGet("Path")
|
---|
376 | iStart = 1
|
---|
377 | do while iStart <= Len(strPath)
|
---|
378 | iEnd = InStr(iStart, strPath, ";")
|
---|
379 | if iEnd <= 0 then iEnd = Len(strPath) + 1
|
---|
380 | if iEnd > iStart then
|
---|
381 | str = Mid(strPath, iStart, iEnd - iStart) & "/" & strFile
|
---|
382 | if FileExists(str) then
|
---|
383 | Which = str
|
---|
384 | exit function
|
---|
385 | end if
|
---|
386 | end if
|
---|
387 | iStart = iEnd + 1
|
---|
388 | loop
|
---|
389 |
|
---|
390 | ' registry or somewhere?
|
---|
391 |
|
---|
392 | Which = ""
|
---|
393 | end function
|
---|
394 |
|
---|
395 |
|
---|
396 | ''
|
---|
397 | ' Append text to the log file and echo it to stdout
|
---|
398 | sub Print(str)
|
---|
399 | LogPrint str
|
---|
400 | Wscript.Echo str
|
---|
401 | end sub
|
---|
402 |
|
---|
403 |
|
---|
404 | ''
|
---|
405 | ' Prints a test header
|
---|
406 | sub PrintHdr(strTest)
|
---|
407 | LogPrint "***** Checking for " & strTest & " *****"
|
---|
408 | Wscript.Echo "Checking for " & StrTest & "..."
|
---|
409 | end sub
|
---|
410 |
|
---|
411 |
|
---|
412 | ''
|
---|
413 | ' Prints a success message
|
---|
414 | sub PrintResult(strTest, strResult)
|
---|
415 | LogPrint "** " & strTest & ": " & strResult
|
---|
416 | Wscript.Echo " Found "& strTest & ": " & strResult
|
---|
417 | end sub
|
---|
418 |
|
---|
419 |
|
---|
420 | ''
|
---|
421 | ' Warning message.
|
---|
422 | sub MsgWarning(strMsg)
|
---|
423 | Print "warning: " & strMsg
|
---|
424 | end sub
|
---|
425 |
|
---|
426 |
|
---|
427 | ''
|
---|
428 | ' Fatal error.
|
---|
429 | sub MsgFatal(strMsg)
|
---|
430 | Print "fatal error: " & strMsg
|
---|
431 | Wscript.Quit
|
---|
432 | end sub
|
---|
433 |
|
---|
434 |
|
---|
435 | ''
|
---|
436 | ' Error message, fatal unless flag to ignore errors is given.
|
---|
437 | sub MsgError(strMsg)
|
---|
438 | Print "error: " & strMsg
|
---|
439 | if g_blnInternalMode = False then
|
---|
440 | Wscript.Quit
|
---|
441 | end if
|
---|
442 | end sub
|
---|
443 |
|
---|
444 |
|
---|
445 | ''
|
---|
446 | ' Write a log header with some basic info.
|
---|
447 | sub LogInit
|
---|
448 | FileDelete g_strLogFile
|
---|
449 | LogPrint "# Log file generated by " & Wscript.ScriptFullName
|
---|
450 | for i = 1 to WScript.Arguments.Count
|
---|
451 | LogPrint "# Arg #" & i & ": " & WScript.Arguments.Item(i - 1)
|
---|
452 | next
|
---|
453 | if Wscript.Arguments.Count = 0 then
|
---|
454 | LogPrint "# No arguments given"
|
---|
455 | end if
|
---|
456 | LogPrint "# Reconstructed command line: " & GetCommandline()
|
---|
457 |
|
---|
458 | ' some Wscript stuff
|
---|
459 | LogPrint "# Wscript properties:"
|
---|
460 | LogPrint "# ScriptName: " & Wscript.ScriptName
|
---|
461 | LogPrint "# Version: " & Wscript.Version
|
---|
462 | LogPrint "# Build: " & Wscript.BuildVersion
|
---|
463 | LogPrint "# Name: " & Wscript.Name
|
---|
464 | LogPrint "# Full Name: " & Wscript.FullName
|
---|
465 | LogPrint "# Path: " & Wscript.Path
|
---|
466 | LogPrint "#"
|
---|
467 |
|
---|
468 |
|
---|
469 | ' the environment
|
---|
470 | LogPrint "# Environment:"
|
---|
471 | dim objEnv
|
---|
472 | for each strVar in g_objShell.Environment("PROCESS")
|
---|
473 | LogPrint "# " & strVar
|
---|
474 | next
|
---|
475 | LogPrint "#"
|
---|
476 | end sub
|
---|
477 |
|
---|
478 |
|
---|
479 | ''
|
---|
480 | ' Append text to the log file.
|
---|
481 | sub LogPrint(str)
|
---|
482 | FileAppendLine g_strLogFile, str
|
---|
483 | 'Wscript.Echo "dbg: " & str
|
---|
484 | end sub
|
---|
485 |
|
---|
486 |
|
---|
487 | ''
|
---|
488 | ' Checks if the file exists and logs failures.
|
---|
489 | function LogFileExists(strPath, strFilename)
|
---|
490 | LogFileExists = FileExists(strPath & "/" & strFilename)
|
---|
491 | if LogFileExists = False then
|
---|
492 | LogPrint "Testing '" & strPath & "': " & strFilename & " not found"
|
---|
493 | end if
|
---|
494 |
|
---|
495 | end function
|
---|
496 |
|
---|
497 |
|
---|
498 | ''
|
---|
499 | ' Finds the first file matching the pattern.
|
---|
500 | ' If no file is found, log the failure.
|
---|
501 | function LogFindFile(strPath, strPattern)
|
---|
502 | dim str
|
---|
503 |
|
---|
504 | '
|
---|
505 | ' Yes, there are some facy database kinda interface to the filesystem
|
---|
506 | ' however, breaking down the path and constructing a usable query is
|
---|
507 | ' too much hassle. So, we'll do it the unix way...
|
---|
508 | '
|
---|
509 | if Shell("dir /B """ & DosSlashes(strPath) & "\" & DosSlashes(strPattern) & """", True) = 0 _
|
---|
510 | And InStr(1, g_strShellOutput, Chr(13)) > 1 _
|
---|
511 | then
|
---|
512 | ' return the first word.
|
---|
513 | LogFindFile = Left(g_strShellOutput, InStr(1, g_strShellOutput, Chr(13)) - 1)
|
---|
514 | else
|
---|
515 | LogPrint "Testing '" & strPath & "': " & strPattern & " not found"
|
---|
516 | LogFindFile = ""
|
---|
517 | end if
|
---|
518 | end function
|
---|
519 |
|
---|
520 |
|
---|
521 | ''
|
---|
522 | ' Initializes the config file.
|
---|
523 | sub CfgInit
|
---|
524 | FileDelete g_strCfgFile
|
---|
525 | CfgPrint "# -*- Makefile -*-"
|
---|
526 | CfgPrint "#"
|
---|
527 | CfgPrint "# Build configuration generated by " & GetCommandline()
|
---|
528 | CfgPrint "#"
|
---|
529 | if g_blnInternalMode = False then
|
---|
530 | CfgPrint "VBOX_OSE := 1"
|
---|
531 | end if
|
---|
532 | end sub
|
---|
533 |
|
---|
534 |
|
---|
535 | ''
|
---|
536 | ' Prints a string to the config file.
|
---|
537 | sub CfgPrint(str)
|
---|
538 | FileAppendLine g_strCfgFile, str
|
---|
539 | end sub
|
---|
540 |
|
---|
541 |
|
---|
542 | ''
|
---|
543 | ' Initializes the environment batch script.
|
---|
544 | sub EnvInit
|
---|
545 | FileDelete g_strEnvFile
|
---|
546 | EnvPrint "@echo off"
|
---|
547 | EnvPrint "rem"
|
---|
548 | EnvPrint "rem Environment setup script generated by " & GetCommandline()
|
---|
549 | EnvPrint "rem"
|
---|
550 | end sub
|
---|
551 |
|
---|
552 |
|
---|
553 | ''
|
---|
554 | ' Prints a string to the environment batch script.
|
---|
555 | sub EnvPrint(str)
|
---|
556 | FileAppendLine g_strEnvFile, str
|
---|
557 | end sub
|
---|
558 |
|
---|
559 |
|
---|
560 | ''
|
---|
561 | ' No COM
|
---|
562 | sub DisableCOM(strReason)
|
---|
563 | if g_blnDisableCOM = False then
|
---|
564 | LogPrint "Disabled COM components: " & strReason
|
---|
565 | g_blnDisableCOM = True
|
---|
566 | g_strDisableCOM = strReason
|
---|
567 | CfgPrint "VBOX_WITH_MAIN="
|
---|
568 | CfgPrint "VBOX_WITH_QTGUI="
|
---|
569 | CfgPrint "VBOX_WITH_VBOXSDL="
|
---|
570 | CfgPrint "VBOX_WITH_DEBUGGER_GUI="
|
---|
571 | CfgPrint "VBOX_WITHOUT_COM=1"
|
---|
572 | end if
|
---|
573 | end sub
|
---|
574 |
|
---|
575 |
|
---|
576 | ''
|
---|
577 | ' Checks the the path doesn't contain characters the tools cannot deal with.
|
---|
578 | sub CheckSourcePath
|
---|
579 | dim sPwd
|
---|
580 |
|
---|
581 | sPwd = PathAbs(g_strPath)
|
---|
582 | if InStr(1, sPwd, " ") > 0 then
|
---|
583 | MsgError "Source path contains spaces! Please move it. (" & sPwd & ")"
|
---|
584 | end if
|
---|
585 | if InStr(1, sPwd, "$") > 0 then
|
---|
586 | MsgError "Source path contains the '$' char! Please move it. (" & sPwd & ")"
|
---|
587 | end if
|
---|
588 | if InStr(1, sPwd, "%") > 0 then
|
---|
589 | MsgError "Source path contains the '%' char! Please move it. (" & sPwd & ")"
|
---|
590 | end if
|
---|
591 | if InStr(1, sPwd, Chr(10)) > 0 _
|
---|
592 | Or InStr(1, sPwd, Chr(13)) > 0 _
|
---|
593 | Or InStr(1, sPwd, Chr(9)) > 0 _
|
---|
594 | then
|
---|
595 | MsgError "Source path contains control characters! Please move it. (" & sPwd & ")"
|
---|
596 | end if
|
---|
597 | Print "Source path: OK"
|
---|
598 | end sub
|
---|
599 |
|
---|
600 |
|
---|
601 | ''
|
---|
602 | ' Checks for kBuild - very simple :)
|
---|
603 | sub CheckForkBuild(strOptkBuild)
|
---|
604 | PrintHdr "kBuild"
|
---|
605 |
|
---|
606 | '
|
---|
607 | ' Check if there is a 'kmk' in the path somewhere without
|
---|
608 | ' any PATH_KBUILD* stuff around.
|
---|
609 | '
|
---|
610 | blnNeedEnvVars = True
|
---|
611 | g_strPathkBuild = strOptkBuild
|
---|
612 | g_strPathkBuildBin = ""
|
---|
613 | if (g_strPathkBuild = "") _
|
---|
614 | And (EnvGet("PATH_KBUILD") = "") _
|
---|
615 | And (EnvGet("PATH_KBUILD_BIN") = "") _
|
---|
616 | And (Shell("kmk.exe --version", True) = 0) _
|
---|
617 | And (InStr(1,g_strShellOutput, "kBuild Make 0.1") > 0) _
|
---|
618 | And (InStr(1,g_strShellOutput, "PATH_KBUILD") > 0) _
|
---|
619 | And (InStr(1,g_strShellOutput, "PATH_KBUILD_BIN") > 0) then
|
---|
620 | '' @todo Need to parse out the PATH_KBUILD and PATH_KBUILD_BIN values to complete the other tests.
|
---|
621 | 'blnNeedEnvVars = False
|
---|
622 | MsgWarning "You've installed kBuild it seems. configure.vbs hasn't been updated to " _
|
---|
623 | & "deal with that yet and will use the one it ships with. Sorry."
|
---|
624 | end if
|
---|
625 |
|
---|
626 | '
|
---|
627 | ' Check for the PATH_KBUILD env.var. and fall back on root/kBuild otherwise.
|
---|
628 | '
|
---|
629 | if g_strPathkBuild = "" then
|
---|
630 | g_strPathkBuild = EnvGet("PATH_KBUILD")
|
---|
631 | if (g_strPathkBuild <> "") and (FileExists(g_strPathkBuild & "/footer.kmk") = False) then
|
---|
632 | MsgWarning "Ignoring incorrect kBuild path (PATH_KBUILD=" & g_strPathkBuild & ")"
|
---|
633 | g_strPathkBuild = ""
|
---|
634 | end if
|
---|
635 |
|
---|
636 | if g_strPathkBuild = "" then
|
---|
637 | g_strPathkBuild = g_strPath & "/kBuild"
|
---|
638 | end if
|
---|
639 | end if
|
---|
640 |
|
---|
641 | g_strPathkBuild = UnixSlashes(PathAbs(g_strPathkBuild))
|
---|
642 |
|
---|
643 | '
|
---|
644 | ' Determin the location of the kBuild binaries.
|
---|
645 | '
|
---|
646 | if g_strPathkBuildBin = "" then
|
---|
647 | dim str2
|
---|
648 | if EnvGet("PROCESSOR_ARCHITECTURE") = "x86" then
|
---|
649 | g_strPathkBuildBin = g_strPathkBuild & "/bin/win.x86"
|
---|
650 | else ' boldly assumes there is only x86 and amd64.
|
---|
651 | g_strPathkBuildBin = g_strPathkBuild & "/bin/win.amd64"
|
---|
652 | if FileExists(g_strPathkBuild & "/kmk.exe") = False then
|
---|
653 | g_strPathkBuildBin = g_strPathkBuild & "/bin/win.x86"
|
---|
654 | end if
|
---|
655 | end if
|
---|
656 | if FileExists(g_strPathkBuild & "/kmk.exe") = False then
|
---|
657 | g_strPathkBuildBin = g_strPathkBuild & "/bin/win.x86"
|
---|
658 | end if
|
---|
659 | end if
|
---|
660 |
|
---|
661 | '
|
---|
662 | ' Perform basic validations of the kBuild installation.
|
---|
663 | '
|
---|
664 | if (FileExists(g_strPathkBuild & "/footer.kmk") = False) _
|
---|
665 | Or (FileExists(g_strPathkBuild & "/header.kmk") = False) _
|
---|
666 | Or (FileExists(g_strPathkBuild & "/rules.kmk") = False) then
|
---|
667 | MsgFatal "Can't find valid kBuild at '" & g_strPathkBuild & "'. Either there is an " _
|
---|
668 | & "incorrect PATH_KBUILD in the environment or the checkout didn't succeed."
|
---|
669 | exit sub
|
---|
670 | end if
|
---|
671 | if (FileExists(g_strPathkBuildBin & "/kmk.exe") = False) _
|
---|
672 | Or (FileExists(g_strPathkBuildBin & "/kmk_ash.exe") = False) then
|
---|
673 | MsgFatal "Can't find valid kBuild binaries at '" & g_strPathkBuildBin & "'. Either there is an " _
|
---|
674 | & "incorrect PATH_KBUILD in the environment or the checkout didn't succeed."
|
---|
675 | exit sub
|
---|
676 | end if
|
---|
677 |
|
---|
678 | if (Shell(DosSlashes(g_strPathkBuildBin & "/kmk.exe") & " --version", True) <> 0) Then
|
---|
679 | MsgFatal "Can't execute '" & g_strPathkBuildBin & "/kmk.exe --version'. check configure.log for the out."
|
---|
680 | exit sub
|
---|
681 | end if
|
---|
682 |
|
---|
683 | '
|
---|
684 | ' Check for env.vars that kBuild uses.
|
---|
685 | '
|
---|
686 | str = EnvGet("BUILD_TYPE")
|
---|
687 | if (str <> "") _
|
---|
688 | And (InStr(1, "|release|debug|profile|kprofile", str) <= 0) then
|
---|
689 | EnvPrint "set BUILD_TYPE=release"
|
---|
690 | EnvSet "BUILD_TYPE", "release"
|
---|
691 | MsgWarning "Found unknown BUILD_TYPE value '" & str &"' in your environment. Setting it to 'release'."
|
---|
692 | end if
|
---|
693 |
|
---|
694 | str = EnvGet("BUILD_TARGET")
|
---|
695 | if (str <> "") _
|
---|
696 | And (InStr(1, "win|win32|win64", str) <= 0) then '' @todo later only 'win' will be valid. remember to fix this check!
|
---|
697 | EnvPrint "set BUILD_TARGET=win"
|
---|
698 | EnvSet "BUILD_TARGET", "win"
|
---|
699 | MsgWarning "Found unknown BUILD_TARGET value '" & str &"' in your environment. Setting it to 'win32'."
|
---|
700 | end if
|
---|
701 |
|
---|
702 | str = EnvGet("BUILD_TARGET_ARCH")
|
---|
703 | if (str <> "") _
|
---|
704 | And (InStr(1, "x86|amd64", str) <= 0) then
|
---|
705 | EnvPrint "set BUILD_TARGET_ARCH=x86"
|
---|
706 | EnvSet "BUILD_TARGET_ARCH", "x86"
|
---|
707 | MsgWarning "Found unknown BUILD_TARGET_ARCH value '" & str &"' in your environment. Setting it to 'x86'."
|
---|
708 | end if
|
---|
709 |
|
---|
710 | str = EnvGet("BUILD_TARGET_CPU")
|
---|
711 | ' perhaps a bit pedantic this since this isn't clearly define nor used much...
|
---|
712 | if (str <> "") _
|
---|
713 | And (InStr(1, "i386|i486|i686|i786|i868|k5|k6|k7|k8", str) <= 0) then
|
---|
714 | EnvPrint "set BUILD_TARGET_CPU=i386"
|
---|
715 | EnvSet "BUILD_TARGET_CPU", "i386"
|
---|
716 | MsgWarning "Found unknown BUILD_TARGET_CPU value '" & str &"' in your environment. Setting it to 'i386'."
|
---|
717 | end if
|
---|
718 |
|
---|
719 | str = EnvGet("BUILD_PLATFORM")
|
---|
720 | if (str <> "") _
|
---|
721 | And (InStr(1, "win|win32|win64", str) <= 0) then '' @todo later only 'win' will be valid. remember to fix this check!
|
---|
722 | EnvPrint "set BUILD_PLATFORM=win"
|
---|
723 | EnvSet "BUILD_PLATFORM", "win"
|
---|
724 | MsgWarning "Found unknown BUILD_PLATFORM value '" & str &"' in your environment. Setting it to 'win32'."
|
---|
725 | end if
|
---|
726 |
|
---|
727 | str = EnvGet("BUILD_PLATFORM_ARCH")
|
---|
728 | if (str <> "") _
|
---|
729 | And (InStr(1, "x86|amd64", str) <= 0) then
|
---|
730 | EnvPrint "set BUILD_PLATFORM_ARCH=x86"
|
---|
731 | EnvSet "BUILD_PLATFORM_ARCH", "x86"
|
---|
732 | MsgWarning "Found unknown BUILD_PLATFORM_ARCH value '" & str &"' in your environment. Setting it to 'x86'."
|
---|
733 | end if
|
---|
734 |
|
---|
735 | str = EnvGet("BUILD_PLATFORM_CPU")
|
---|
736 | ' perhaps a bit pedantic this since this isn't clearly define nor used much...
|
---|
737 | if (str <> "") _
|
---|
738 | And (InStr(1, "i386|i486|i686|i786|i868|k5|k6|k7|k8", str) <= 0) then
|
---|
739 | EnvPrint "set BUILD_PLATFORM_CPU=i386"
|
---|
740 | EnvSet "BUILD_PLATFORM_CPU", "i386"
|
---|
741 | MsgWarning "Found unknown BUILD_PLATFORM_CPU value '" & str &"' in your environment. Setting it to 'i386'."
|
---|
742 | end if
|
---|
743 |
|
---|
744 | '
|
---|
745 | ' If PATH_DEV is set, check that it's pointing to something useful.
|
---|
746 | '
|
---|
747 | str = EnvGet("PATH_DEV")
|
---|
748 | g_strPathDev = str
|
---|
749 | if (str <> "") _
|
---|
750 | And False then '' @todo add some proper tests here.
|
---|
751 | strNew = UnixSlashes(g_strPath & "/tools")
|
---|
752 | EnvPrint "set PATH_DEV=" & strNew
|
---|
753 | EnvSet "PATH_DEV", strNew
|
---|
754 | MsgWarning "Found PATH_DEV='" & str &"' in your environment. Setting it to '" & strNew & "'."
|
---|
755 | g_strPathDev = strNew
|
---|
756 | end if
|
---|
757 | if g_strPathDev = "" then g_strPathDev = UnixSlashes(g_strPath & "/tools")
|
---|
758 |
|
---|
759 | '
|
---|
760 | ' Write PATH_KBUILD to the environment script if necessary.
|
---|
761 | '
|
---|
762 | if blnNeedEnvVars = True then
|
---|
763 | EnvPrint "set PATH_KBUILD=" & g_strPathkBuild
|
---|
764 | EnvSet "PATH_KBUILD", g_strPathkBuild
|
---|
765 | EnvPrint "set PATH=" & g_strPathkBuildBin & ";%PATH%"
|
---|
766 | EnvPrepend "PATH", g_strPathkBuildBin & ";"
|
---|
767 | end if
|
---|
768 |
|
---|
769 | PrintResult "kBuild", g_strPathkBuild
|
---|
770 | PrintResult "kBuild binaries", g_strPathkBuildBin
|
---|
771 | end sub
|
---|
772 |
|
---|
773 |
|
---|
774 | ''
|
---|
775 | ' Checks for Visual C++ version 7 or 8.
|
---|
776 | sub CheckForVisualCPP(strOptVC, strOptVCCommon, blnOptVCExpressEdition)
|
---|
777 | dim strPathVC, strPathVCCommon, str, str2, blnNeedMsPDB
|
---|
778 | PrintHdr "Visual C++"
|
---|
779 |
|
---|
780 | '
|
---|
781 | ' Try find it...
|
---|
782 | '
|
---|
783 | strPathVC = ""
|
---|
784 | strPathVCCommon = ""
|
---|
785 | if (strPathVC = "") And (strOptVC <> "") then
|
---|
786 | if CheckForVisualCPPSub(strOptVC, strOptVCCommon, blnOptVCExpressEdition) then
|
---|
787 | strPathVC = strOptVC
|
---|
788 | strPathVCCommon = strOptVCCommon
|
---|
789 | end if
|
---|
790 | end if
|
---|
791 |
|
---|
792 | if strPathVC = "" Then
|
---|
793 | strPathVC = g_strPathDev & "/win.x86/vcc/v8"
|
---|
794 | if CheckForVisualCPPSub(strPathVC, "", blnOptVCExpressEdition) = False then
|
---|
795 | strPathVC = g_strPathDev & "/win.x86/vcc/v7"
|
---|
796 | if CheckForVisualCPPSub(strPathVC, "", blnOptVCExpressEdition) = False then
|
---|
797 | strPathVC = ""
|
---|
798 | end if
|
---|
799 | end if
|
---|
800 | end if
|
---|
801 |
|
---|
802 | if (strPathVC = "") _
|
---|
803 | And (Shell("cl.exe", True) = 0) then
|
---|
804 | str = Which("cl.exe")
|
---|
805 | if FileExists(PathStripFilename(strClExe) & "/build.exe") then
|
---|
806 | ' don't know how to deal with this cl.
|
---|
807 | Warning "Ignoring DDK cl.exe (" & str & ")."
|
---|
808 | else
|
---|
809 | strPathVC = PathParent(PathStripFilename(str))
|
---|
810 | strPathVCCommon = PathParent(strPathVC) & "/Common7"
|
---|
811 | end if
|
---|
812 | end if
|
---|
813 |
|
---|
814 | if strPathVC = "" then
|
---|
815 | str = RegGetString("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS\ProductDir")
|
---|
816 | str2 = RegGetString("HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Setup\VS\EnvironmentDirectory")
|
---|
817 | if str <> "" And str2 <> "" Then
|
---|
818 | str = str & "VC"
|
---|
819 | str2 = PathParent(str2)
|
---|
820 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
821 | strPathVC = str
|
---|
822 | strPathVCCommon = str2
|
---|
823 | end if
|
---|
824 | end if
|
---|
825 | end if
|
---|
826 |
|
---|
827 | if strPathVC = "" then
|
---|
828 | str = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\ProductDir")
|
---|
829 | str2 = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS\EnvironmentDirectory")
|
---|
830 | if str <> "" And str2 <> "" Then
|
---|
831 | str = str & "VC"
|
---|
832 | str2 = PathParent(str2)
|
---|
833 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
834 | strPathVC = str
|
---|
835 | strPathVCCommon = str2
|
---|
836 | end if
|
---|
837 | end if
|
---|
838 | end if
|
---|
839 |
|
---|
840 | if strPathVC = "" then
|
---|
841 | '' @todo check what this really looks like on 7.1
|
---|
842 | str = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VS\ProductDir")
|
---|
843 | str2 = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VS\EnvironmentDirectory")
|
---|
844 | if str <> "" And str2 <> "" Then
|
---|
845 | str = str & "VC7"
|
---|
846 | str2 = PathParent(str2)
|
---|
847 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
848 | strPathVC = str
|
---|
849 | strPathVCCommon = str2
|
---|
850 | end if
|
---|
851 | end if
|
---|
852 | end if
|
---|
853 |
|
---|
854 | if strPathVC = "" then
|
---|
855 | str = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\7.0\Setup\VS\ProductDir")
|
---|
856 | str2 = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\7.0\Setup\VS\EnvironmentDirectory")
|
---|
857 | if str <> "" And str2 <> "" Then
|
---|
858 | str = str & "VC7"
|
---|
859 | str2 = PathParent(str2)
|
---|
860 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
861 | strPathVC = str
|
---|
862 | strPathVCCommon = str2
|
---|
863 | end if
|
---|
864 | end if
|
---|
865 | end if
|
---|
866 |
|
---|
867 | if strPathVC = "" then
|
---|
868 | str = RegGetString("HKLM\SOFTWARE\Microsoft\Wow6432Node\VisualStudio\SxS\VC7\8.0")
|
---|
869 | if str <> "" then
|
---|
870 | str2 = PathParent(str) & "/Common7"
|
---|
871 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
872 | strPathVC = str
|
---|
873 | strPathVCCommon = str2
|
---|
874 | end if
|
---|
875 | end if
|
---|
876 | end if
|
---|
877 |
|
---|
878 | if strPathVC = "" then
|
---|
879 | str = RegGetString("HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VC7\8.0")
|
---|
880 | if str <> "" then
|
---|
881 | str2 = PathParent(str) & "/Common7"
|
---|
882 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
883 | strPathVC = str
|
---|
884 | strPathVCCommon = str2
|
---|
885 | end if
|
---|
886 | end if
|
---|
887 | end if
|
---|
888 |
|
---|
889 | ' finally check for the express edition.
|
---|
890 | if strPathVC = "" then
|
---|
891 | str = RegGetString("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Visual C++ 2005 Express Edition - ENU\InstallLocation")
|
---|
892 | if str <> "" then
|
---|
893 | str2 = str & "Common7"
|
---|
894 | str = str & "VC/"
|
---|
895 | if CheckForVisualCPPSub(str, str2, blnOptVCExpressEdition) then
|
---|
896 | strPathVC = str
|
---|
897 | strPathVCCommon = str2
|
---|
898 | end if
|
---|
899 | end if
|
---|
900 | end if
|
---|
901 |
|
---|
902 | if strPathVC = "" then
|
---|
903 | MsgError "Cannot find cl.exe (Visual C++) anywhere on your system. Check the build requirements."
|
---|
904 | exit sub
|
---|
905 | end if
|
---|
906 |
|
---|
907 | '
|
---|
908 | ' Clean up the path and determin the VC directory.
|
---|
909 | '
|
---|
910 | strPathVC = UnixSlashes(PathAbs(strPathVC))
|
---|
911 | g_strPathVCC = strPathVC
|
---|
912 |
|
---|
913 | '
|
---|
914 | ' Check the version.
|
---|
915 | ' We'll have to make sure mspdbXX.dll is somewhere in the PATH.
|
---|
916 | '
|
---|
917 | if (strPathVCCommon <> "") Then
|
---|
918 | EnvAppend "PATH", ";" & strPathVCCommon & "/IDE"
|
---|
919 | end if
|
---|
920 | if Shell(DosSlashes(strPathVC & "/bin/cl.exe"), True) <> 0 then
|
---|
921 | MsgError "Executing '" & strClExe & "' (which we believe to be the Visual C++ compiler driver) failed."
|
---|
922 | exit sub
|
---|
923 | end if
|
---|
924 |
|
---|
925 | if (InStr(1, g_strShellOutput, "Version 13.10") <= 0) _
|
---|
926 | And (InStr(1, g_strShellOutput, "Version 14.") <= 0) then
|
---|
927 | MsgError "The Visual C++ compiler we found ('" & strPathVC & "') isn't 7.1 or 8.0. Check the build requirements."
|
---|
928 | exit sub
|
---|
929 | end if
|
---|
930 |
|
---|
931 | '
|
---|
932 | ' Ok, emit build config variables.
|
---|
933 | '
|
---|
934 | if InStr(1, g_strShellOutput, "Version 14.") > 0 then
|
---|
935 | CfgPrint "VBOX_USE_VCC80 := 1"
|
---|
936 | CfgPrint "PATH_TOOL_VCC80 := " & g_strPathVCC
|
---|
937 | CfgPrint "PATH_TOOL_VCC80X86 = $(PATH_TOOL_VCC80)"
|
---|
938 | CfgPrint "PATH_TOOL_VCC80AMD64 = $(PATH_TOOL_VCC80)"
|
---|
939 | if blnOptVCExpressEdition _
|
---|
940 | And LogFileExists(strPathVC, "atlmfc/include/atlbase.h") = False _
|
---|
941 | then
|
---|
942 | CfgPrint "TOOL_VCC80X86_MT = $(PATH_SDK_WINPSDK)/Bin/mt.exe"
|
---|
943 | CfgPrint "TOOL_VCC80AMD64_MT = $(TOOL_VCC80X86_MT)"
|
---|
944 | CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
|
---|
945 | DisableCOM "No ATL"
|
---|
946 | PrintResult "Visual C++ v8 (or later) without ATL", g_strPathVCC
|
---|
947 | else
|
---|
948 | PrintResult "Visual C++ v8 (or later)", g_strPathVCC
|
---|
949 | end if
|
---|
950 | else
|
---|
951 | CfgPrint "PATH_TOOL_VCC70 := " & g_strPathVCC
|
---|
952 | if blnOptVCExpressEdition _
|
---|
953 | And LogFileExists(strPathVC, "atlmfc/include/atlbase.h") = False _
|
---|
954 | then
|
---|
955 | CfgPrint "VBOX_WITHOUT_COMPILER_REDIST=1"
|
---|
956 | DisableCOM "No ATL"
|
---|
957 | PrintResult "Visual C++ v7.1 without ATL", g_strPathVCC
|
---|
958 | else
|
---|
959 | PrintResult "Visual C++ v7.1", g_strPathVCC
|
---|
960 | end if
|
---|
961 | end if
|
---|
962 |
|
---|
963 | ' and the env.bat path fix.
|
---|
964 | if strPathVCCommon <> "" then
|
---|
965 | EnvPrint "set PATH=%PATH%;" & strPathVCCommon & "/IDE;"
|
---|
966 | end if
|
---|
967 | end sub
|
---|
968 |
|
---|
969 | ''
|
---|
970 | ' Checks if the specified path points to a usable PSDK.
|
---|
971 | function CheckForVisualCPPSub(strPathVC, strPathVCCommon, blnOptVCExpressEdition)
|
---|
972 | strPathVC = UnixSlashes(PathAbs(strPathVC))
|
---|
973 | CheckForVisualCPPSub = False
|
---|
974 | LogPrint "trying: strPathVC=" & strPathVC & " strPathVCCommon=" & strPathVCCommon & " blnOptVCExpressEdition=" & blnOptVCExpressEdition
|
---|
975 | if LogFileExists(strPathVC, "bin/cl.exe") _
|
---|
976 | And LogFileExists(strPathVC, "bin/link.exe") _
|
---|
977 | And LogFileExists(strPathVC, "include/string.h") _
|
---|
978 | And LogFileExists(strPathVC, "lib/libcmt.lib") _
|
---|
979 | And LogFileExists(strPathVC, "lib/msvcrt.lib") _
|
---|
980 | then
|
---|
981 | if blnOptVCExpressEdition _
|
---|
982 | Or ( LogFileExists(strPathVC, "atlmfc/include/atlbase.h") _
|
---|
983 | And LogFileExists(strPathVC, "atlmfc/lib/atls.lib")) _
|
---|
984 | Then
|
---|
985 | '' @todo figure out a way we can verify the version/build!
|
---|
986 | CheckForVisualCPPSub = True
|
---|
987 | end if
|
---|
988 | end if
|
---|
989 | end function
|
---|
990 |
|
---|
991 |
|
---|
992 | ''
|
---|
993 | ' Checks for a platform SDK that works with the compiler
|
---|
994 | sub CheckForPlatformSDK(strOptSDK)
|
---|
995 | dim strPathPSDK, str
|
---|
996 | PrintHdr "Windows Platform SDK (recent)"
|
---|
997 |
|
---|
998 | strPathPSDK = ""
|
---|
999 |
|
---|
1000 | ' Check the supplied argument first.
|
---|
1001 | str = strOptSDK
|
---|
1002 | if str <> "" then
|
---|
1003 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1004 | end if
|
---|
1005 |
|
---|
1006 | ' The tools location.
|
---|
1007 | if strPathPSDK = "" then
|
---|
1008 | str = g_strPathDev & "/win.x86/sdk/200604"
|
---|
1009 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1010 | end if
|
---|
1011 |
|
---|
1012 | if strPathPSDK = "" then
|
---|
1013 | str = g_strPathDev & "/win.x86/sdk/200504"
|
---|
1014 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1015 | end if
|
---|
1016 |
|
---|
1017 | if strPathPSDK = "" then
|
---|
1018 | str = g_strPathDev & "/win.x86/sdk/200209"
|
---|
1019 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1020 | end if
|
---|
1021 |
|
---|
1022 | ' Look for it in the environment
|
---|
1023 | str = EnvGet("MSSdk")
|
---|
1024 | if (strPathPSDK = "") And (str <> "") then
|
---|
1025 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1026 | end if
|
---|
1027 |
|
---|
1028 | str = EnvGet("Mstools")
|
---|
1029 | if (strPathPSDK = "") And (str <> "") then
|
---|
1030 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1031 | end if
|
---|
1032 |
|
---|
1033 | ' Check if there is one installed with the compiler.
|
---|
1034 | if (strPathPSDK = "") And (str <> "") then
|
---|
1035 | str = g_strPathVCC & "/PlatformSDK"
|
---|
1036 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1037 | end if
|
---|
1038 |
|
---|
1039 | ' Check the registry next. (first pair is vista, second is pre-vista)
|
---|
1040 | arrSubKeys = RegEnumSubKeys("HKLM", "SOFTWARE\Microsoft\Microsoft SDKs\Windows")
|
---|
1041 | for Each strSubKey In arrSubKeys
|
---|
1042 | str = RegGetString("HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\" & strSubKey & "\InstallationFolder")
|
---|
1043 | if (strPathPSDK = "") And (str <> "") then
|
---|
1044 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1045 | end if
|
---|
1046 | Next
|
---|
1047 | arrSubKeys = RegEnumSubKeys("HKCU", "SOFTWARE\Microsoft\Microsoft SDKs\Windows")
|
---|
1048 | for Each strSubKey In arrSubKeys
|
---|
1049 | str = RegGetString("HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\" & strSubKey & "\InstallationFolder")
|
---|
1050 | if (strPathPSDK = "") And (str <> "") then
|
---|
1051 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1052 | end if
|
---|
1053 | Next
|
---|
1054 |
|
---|
1055 | arrSubKeys = RegEnumSubKeys("HKLM", "SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs")
|
---|
1056 | for Each strSubKey In arrSubKeys
|
---|
1057 | str = RegGetString("HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\" & strSubKey & "\Install Dir")
|
---|
1058 | if (strPathPSDK = "") And (str <> "") then
|
---|
1059 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1060 | end if
|
---|
1061 | Next
|
---|
1062 | arrSubKeys = RegEnumSubKeys("HKCU", "SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs")
|
---|
1063 | for Each strSubKey In arrSubKeys
|
---|
1064 | str = RegGetString("HKCU\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\" & strSubKey & "\Install Dir")
|
---|
1065 | if (strPathPSDK = "") And (str <> "") then
|
---|
1066 | if CheckForPlatformSDKSub(str) then strPathPSDK = str
|
---|
1067 | end if
|
---|
1068 | Next
|
---|
1069 |
|
---|
1070 | ' Give up.
|
---|
1071 | if strPathPSDK = "" then
|
---|
1072 | MsgError "Cannot find a suitable Platform SDK. Check configure.log and the build requirements."
|
---|
1073 | exit sub
|
---|
1074 | end if
|
---|
1075 |
|
---|
1076 | '
|
---|
1077 | ' Emit the config.
|
---|
1078 | '
|
---|
1079 | strPathPSDK = UnixSlashes(PathAbs(strPathPSDK))
|
---|
1080 | CfgPrint "PATH_SDK_WINPSDK := " & strPathPSDK
|
---|
1081 | CfgPrint "PATH_SDK_WINPSDKINCS = $(PATH_SDK_WINPSDK)"
|
---|
1082 | CfgPrint "PATH_SDK_WIN32SDK = $(PATH_SDK_WINPSDK)"
|
---|
1083 | CfgPrint "PATH_SDK_WIN64SDK = $(PATH_SDK_WINPSDK)"
|
---|
1084 |
|
---|
1085 | PrintResult "Windows Platform SDK", strPathPSDK
|
---|
1086 | g_strPathPSDK = strPathPSDK
|
---|
1087 | end sub
|
---|
1088 |
|
---|
1089 | ''
|
---|
1090 | ' Checks if the specified path points to a usable PSDK.
|
---|
1091 | function CheckForPlatformSDKSub(strPathPSDK)
|
---|
1092 | CheckForPlatformSDKSub = False
|
---|
1093 | LogPrint "trying: strPathPSDK=" & strPathPSDK
|
---|
1094 | if LogFileExists(strPathPSDK, "include/Windows.h") _
|
---|
1095 | And LogFileExists(strPathPSDK, "lib/Kernel32.Lib") _
|
---|
1096 | And LogFileExists(strPathPSDK, "lib/User32.Lib") _
|
---|
1097 | then
|
---|
1098 | CheckForPlatformSDKSub = True
|
---|
1099 | end if
|
---|
1100 | end function
|
---|
1101 |
|
---|
1102 |
|
---|
1103 | ''
|
---|
1104 | ' Checks for a Windows 2003 DDK that works with the compiler intrinsics.
|
---|
1105 | sub CheckForWin2k3DDK(strOptDDK)
|
---|
1106 | dim strPathDDK, str, strSubKeys
|
---|
1107 | PrintHdr "Windows 2003 DDK, build 3790 or later"
|
---|
1108 |
|
---|
1109 | '
|
---|
1110 | ' Find the DDK.
|
---|
1111 | '
|
---|
1112 | strPathDDK = ""
|
---|
1113 | ' The specified path.
|
---|
1114 | if (strPathDDK = "") And (strOptDDK <> "") then
|
---|
1115 | if CheckForWin2k3DDKSub(strOptDDK, True) then strPathDDK = strOptDDK
|
---|
1116 | end if
|
---|
1117 |
|
---|
1118 | ' The tools location.
|
---|
1119 | if strPathDDK = "" then
|
---|
1120 | str = g_strPathDev & "/win.x86/ddkwin2k3/200503"
|
---|
1121 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1122 | end if
|
---|
1123 |
|
---|
1124 | if strPathDDK = "" then
|
---|
1125 | str = g_strPathDev & "/win.x86/ddkwin2k3/2004"
|
---|
1126 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1127 | end if
|
---|
1128 |
|
---|
1129 | ' Check the environment
|
---|
1130 | str = EnvGet("DDK_INC_PATH")
|
---|
1131 | if (strPathDDK = "") And (str <> "") then
|
---|
1132 | str = PathParent(PathParent(str))
|
---|
1133 | if CheckForWin2k3DDKSub(str, True) then strPathDDK = str
|
---|
1134 | end if
|
---|
1135 |
|
---|
1136 | str = EnvGet("BASEDIR")
|
---|
1137 | if (strPathDDK = "") And (str <> "") then
|
---|
1138 | if CheckForWin2k3DDKSub(str, True) then strPathDDK = str
|
---|
1139 | end if
|
---|
1140 |
|
---|
1141 | ' Check the registry next. (the first pair is for vista (WDK), the second for pre-vista (DDK))
|
---|
1142 | arrSubKeys = RegEnumSubKeys("HKLM", "SOFTWARE\Microsoft\WINDDK") '' @todo Need some sorting stuff here.
|
---|
1143 | for Each strSubKey In arrSubKeys
|
---|
1144 | str = RegGetString("HKLM\SOFTWARE\Microsoft\WINDDK\" & strSubKey & "\Setup\BUILD")
|
---|
1145 | if (strPathDDK = "") And (str <> "") then
|
---|
1146 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1147 | end if
|
---|
1148 | Next
|
---|
1149 | arrSubKeys = RegEnumSubKeys("HKCU", "SOFTWARE\Microsoft\WINDDK") '' @todo Need some sorting stuff here.
|
---|
1150 | for Each strSubKey In arrSubKeys
|
---|
1151 | str = RegGetString("HKCU\SOFTWARE\Microsoft\WINDDK\" & strSubKey & "\Setup\BUILD")
|
---|
1152 | if (strPathDDK = "") And (str <> "") then
|
---|
1153 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1154 | end if
|
---|
1155 | Next
|
---|
1156 |
|
---|
1157 | arrSubKeys = RegEnumSubKeys("HKLM", "SOFTWARE\Microsoft\WINDDK") '' @todo Need some sorting stuff here.
|
---|
1158 | for Each strSubKey In arrSubKeys
|
---|
1159 | str = RegGetString("HKLM\SOFTWARE\Microsoft\WINDDK\" & strSubKey & "\SFNDirectory")
|
---|
1160 | if (strPathDDK = "") And (str <> "") then
|
---|
1161 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1162 | end if
|
---|
1163 | Next
|
---|
1164 | arrSubKeys = RegEnumSubKeys("HKCU", "SOFTWARE\Microsoft\WINDDK") '' @todo Need some sorting stuff here.
|
---|
1165 | for Each strSubKey In arrSubKeys
|
---|
1166 | str = RegGetString("HKCU\SOFTWARE\Microsoft\WINDDK\" & strSubKey & "\SFNDirectory")
|
---|
1167 | if (strPathDDK = "") And (str <> "") then
|
---|
1168 | if CheckForWin2k3DDKSub(str, False) then strPathDDK = str
|
---|
1169 | end if
|
---|
1170 | Next
|
---|
1171 |
|
---|
1172 | if strPathDDK = "" then
|
---|
1173 | MsgError "Cannot find a suitable Windows 2003 DDK. Check configure.log and the build requirements."
|
---|
1174 | exit sub
|
---|
1175 | end if
|
---|
1176 |
|
---|
1177 | '
|
---|
1178 | ' Emit the config.
|
---|
1179 | '
|
---|
1180 | strPathDDK = UnixSlashes(PathAbs(strPathDDK))
|
---|
1181 | CfgPrint "PATH_SDK_W2K3DDK := " & strPathDDK
|
---|
1182 | CfgPrint "PATH_SDK_W2K3DDKX86 = $(PATH_SDK_W2K3DDK)"
|
---|
1183 | CfgPrint "PATH_SDK_W2K3DDKAMD64 = $(PATH_SDK_W2K3DDK)"
|
---|
1184 |
|
---|
1185 | PrintResult "Windows 2003 DDK", strPathDDK
|
---|
1186 | g_strPathDDK = strPathDDK
|
---|
1187 | end sub
|
---|
1188 |
|
---|
1189 | '' Quick check if the DDK is in the specified directory or not.
|
---|
1190 | function CheckForWin2k3DDKSub(strPathDDK, blnCheckBuild)
|
---|
1191 | CheckForWin2k3DDKSub = False
|
---|
1192 | LogPrint "trying: strPathDDK=" & strPathDDK & " blnCheckBuild=" & blnCheckBuild
|
---|
1193 | '' @todo vista: if ( LogFileExists(strPathDDK, "inc/ddk/wnet/ntdef.h") _
|
---|
1194 | ' Or LogFileExists(strPathDDK, "inc/api/ntdef.h")) _
|
---|
1195 | if LogFileExists(strPathDDK, "inc/ddk/wnet/ntdef.h") _
|
---|
1196 | And LogFileExists(strPathDDK, "lib/wnet/i386/int64.lib") _
|
---|
1197 | then
|
---|
1198 | '' @todo figure out a way we can verify the version/build!
|
---|
1199 | CheckForWin2k3DDKSub = True
|
---|
1200 | end if
|
---|
1201 | end function
|
---|
1202 |
|
---|
1203 |
|
---|
1204 | ''
|
---|
1205 | ' Finds midl.exe
|
---|
1206 | sub CheckForMidl()
|
---|
1207 | dim strMidl
|
---|
1208 | PrintHdr "Midl.exe"
|
---|
1209 |
|
---|
1210 | ' Skip if no COM/ATL.
|
---|
1211 | if g_blnDisableCOM then
|
---|
1212 | PrintResult "Xerces", "Skipped (" & g_strDisableCOM & ")"
|
---|
1213 | exit sub
|
---|
1214 | end if
|
---|
1215 |
|
---|
1216 | if LogFileExists(g_strPathPSDK, "bin/Midl.exe") then
|
---|
1217 | strMidl = g_strPathPSDK & "/bin/Midl.exe"
|
---|
1218 | elseif LogFileExists(g_strPathVCC, "Common7/Tools/Bin/Midl.exe") then
|
---|
1219 | strMidl = g_strPathVCC & "/Common7/Tools/Bin/Midl.exe"
|
---|
1220 | elseif LogFileExists(g_strPathDDK, "bin/x86/Midl.exe") then
|
---|
1221 | strMidl = g_strPathDDK & "/bin/x86/Midl.exe"
|
---|
1222 | elseif LogFileExists(g_strPathDDK, "bin/Midl.exe") then
|
---|
1223 | strMidl = g_strPathDDK & "/bin/Midl.exe"
|
---|
1224 | elseif LogFileExists(g_strPathDev, "win.x86/bin/Midl.exe") then
|
---|
1225 | strMidl = g_strPathDev & "/win.x86/bin/Midl.exe"
|
---|
1226 | else
|
---|
1227 | MsgWarning "Midl.exe not found!"
|
---|
1228 | exit sub
|
---|
1229 | end if
|
---|
1230 |
|
---|
1231 | CfgPrint "MAIN_IDL = " & strMidl
|
---|
1232 | PrintResult "Midl.exe", strMidl
|
---|
1233 | end sub
|
---|
1234 |
|
---|
1235 |
|
---|
1236 | ''
|
---|
1237 | ' Checks for a recent DirectX SDK.
|
---|
1238 | sub CheckForDirectXSDK(strOptDXSDK)
|
---|
1239 | dim strPathDXSDK, str, arrSubKeys, arrSubKeys2, strKey, strKey2
|
---|
1240 | PrintHdr "Direct X SDK"
|
---|
1241 |
|
---|
1242 | '
|
---|
1243 | ' Find the DX SDK.
|
---|
1244 | '
|
---|
1245 | strPathDXSDK = ""
|
---|
1246 | ' The specified path.
|
---|
1247 | if (strPathDXSDK = "") And (strOptDXSDK <> "") then
|
---|
1248 | if CheckForDirectXSDKSub(strOptDXSDK) then strPathDXSDK = strOptDXSDK
|
---|
1249 | end if
|
---|
1250 |
|
---|
1251 | ' The tools location.
|
---|
1252 | if strPathDXSDK = "" then
|
---|
1253 | str = g_strPathDev & "/win.x86/dxsdk/200610"
|
---|
1254 | if CheckForDirectXSDKSub(str) then strPathDXSDK = str
|
---|
1255 | end if
|
---|
1256 |
|
---|
1257 | ' Check the installer registry (sucks a bit).
|
---|
1258 | arrSubKeys = RegEnumSubKeys("HKLM", "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData")
|
---|
1259 | for Each strSubKey In arrSubKeys
|
---|
1260 | strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\" & strSubKey & "\Products"
|
---|
1261 | arrSubKeys2 = RegEnumSubKeys("HKLM", strKey)
|
---|
1262 | for Each strSubKey2 In arrSubKeys2
|
---|
1263 | strKey2 = "HKLM\" & strKey & "\" & strSubKey2 & "\InstallProperties"
|
---|
1264 | str = RegGetString(strKey2 & "\DisplayName")
|
---|
1265 | if InStr(1, str, "Microsoft DirectX SDK") > 0 then
|
---|
1266 | str = RegGetString(strKey2 & "\InstallLocation")
|
---|
1267 | if (str <> "") And (strPathDXSDK = "") then
|
---|
1268 | if CheckForDirectXSDKSub(str) then
|
---|
1269 | strPathDXSDK = str
|
---|
1270 | Exit For
|
---|
1271 | end if
|
---|
1272 | end if
|
---|
1273 | end if
|
---|
1274 | Next
|
---|
1275 | Next
|
---|
1276 |
|
---|
1277 | if strPathDXSDK = "" then
|
---|
1278 | MsgError "Cannot find a suitable Direct X SDK. Check configure.log and the build requirements."
|
---|
1279 | exit sub
|
---|
1280 | end if
|
---|
1281 |
|
---|
1282 | '
|
---|
1283 | ' Emit the config.
|
---|
1284 | '
|
---|
1285 | strPathDXSDK = UnixSlashes(PathAbs(strPathDXSDK))
|
---|
1286 | CfgPrint "PATH_SDK_DXSDK := " & strPathDXSDK
|
---|
1287 | CfgPrint "PATH_SDK_DXSDKX86 = $(PATH_SDK_DXSDK)"
|
---|
1288 | CfgPrint "PATH_SDK_DXSDKAMD64 = $(PATH_SDK_DXSDK)"
|
---|
1289 |
|
---|
1290 | PrintResult "Direct X SDK", strPathDXSDK
|
---|
1291 | end sub
|
---|
1292 |
|
---|
1293 | '' Quick check if the DXSDK is in the specified directory or not.
|
---|
1294 | function CheckForDirectXSDKSub(strPathDXSDK)
|
---|
1295 | CheckForDirectXSDKSub = False
|
---|
1296 | LogPrint "trying: strPathDXSDK=" & strPathDXSDK
|
---|
1297 | if LogFileExists(strPathDXSDK, "Lib/x86/dxguid.lib") _
|
---|
1298 | then
|
---|
1299 | '' @todo figure out a way we can verify the version/build!
|
---|
1300 | CheckForDirectXSDKSub = True
|
---|
1301 | end if
|
---|
1302 | end function
|
---|
1303 |
|
---|
1304 |
|
---|
1305 | ''
|
---|
1306 | ' Checks for a MingW32 suitable for building the recompiler.
|
---|
1307 | '
|
---|
1308 | ' strOptW32API is currently ignored.
|
---|
1309 | '
|
---|
1310 | sub CheckForMingW(strOptMingw, strOptW32API)
|
---|
1311 | dim strPathMingW, strPathW32API, str
|
---|
1312 | PrintHdr "MinGW GCC v3.3.x + Binutils + Runtime + W32API"
|
---|
1313 |
|
---|
1314 | '
|
---|
1315 | ' Find the MinGW and W32API tools.
|
---|
1316 | '
|
---|
1317 | strPathMingW = ""
|
---|
1318 | strPathW32API = ""
|
---|
1319 |
|
---|
1320 | ' The specified path.
|
---|
1321 | if (strPathMingW = "") And (strOptMingW <> "") then
|
---|
1322 | if CheckForMingWSub(strOptMingW, strOptW32API) then
|
---|
1323 | strPathMingW = strOptMingW
|
---|
1324 | strPathW32API = strOptW32API
|
---|
1325 | end if
|
---|
1326 | end if
|
---|
1327 |
|
---|
1328 | ' The tools location.
|
---|
1329 | if strPathMingW = "" then
|
---|
1330 | str = g_strPathDev & "/win.x86/mingw32/v3.3.3"
|
---|
1331 | str2 = g_strPathDev & "/win.x86/w32api/v2.5"
|
---|
1332 | if CheckForMingWSub(str, str2) then
|
---|
1333 | strPathMingW = str
|
---|
1334 | strPathW32API = str2
|
---|
1335 | end if
|
---|
1336 | end if
|
---|
1337 |
|
---|
1338 | ' See if there is any gcc around.
|
---|
1339 | if strPathMingW = "" then
|
---|
1340 | str = Which("mingw32-gcc.exe")
|
---|
1341 | if (str <> "") then
|
---|
1342 | str = PathParent(PathStripFilename(str))
|
---|
1343 | if CheckForMingWSub(str, str) then strPathMingW = str
|
---|
1344 | end if
|
---|
1345 | end if
|
---|
1346 |
|
---|
1347 | if strPathMingW = "" then
|
---|
1348 | str = Which("gcc.exe")
|
---|
1349 | if (str <> "") then
|
---|
1350 | str = PathParent(PathStripFilename(str))
|
---|
1351 | if CheckForMingWSub(str, str) then strPathMingW = str
|
---|
1352 | end if
|
---|
1353 | end if
|
---|
1354 |
|
---|
1355 | ' Success?
|
---|
1356 | if strPathMingW = "" then
|
---|
1357 | if strOptMingw = "" then
|
---|
1358 | MsgError "Can't locate a suitable MinGW installation. Try specify the path with " _
|
---|
1359 | & "the --with-MinGW=<path> argument. If still no luck, consult the configure.log and the build requirements."
|
---|
1360 | else
|
---|
1361 | MsgError "Can't locate a suitable MinGW installation. Please consult the configure.log and the build requirements."
|
---|
1362 | end if
|
---|
1363 | exit sub
|
---|
1364 | end if
|
---|
1365 |
|
---|
1366 | '
|
---|
1367 | ' Emit the config.
|
---|
1368 | '
|
---|
1369 | strPathMingW = UnixSlashes(PathAbs(strPathMingW))
|
---|
1370 | CfgPrint "PATH_TOOL_MINGW32 := " & strPathMingW
|
---|
1371 | PrintResult "MinGW (GCC v" & g_strSubOutput & ")", strPathMingW
|
---|
1372 | if (strPathMingW = strPathW32API) Or strPathW32API = "" then
|
---|
1373 | CfgPrint "PATH_SDK_W32API = $(PATH_TOOL_MINGW32)"
|
---|
1374 | else
|
---|
1375 | CfgPrint "PATH_SDK_W32API = " & strPathW32API
|
---|
1376 | PrintResult "W32API", strPathW32API
|
---|
1377 | end if
|
---|
1378 | end sub
|
---|
1379 |
|
---|
1380 | ''
|
---|
1381 | ' Checks if the specified path points to an usable MinGW or not.
|
---|
1382 | function CheckForMingWSub(strPathMingW, strPathW32API)
|
---|
1383 | g_strSubOutput = ""
|
---|
1384 | if strPathW32API = "" then strPathW32API = strPathMingW
|
---|
1385 | LogPrint "trying: strPathMingW=" &strPathMingW & " strPathW32API=" & strPathW32API
|
---|
1386 |
|
---|
1387 | if LogFileExists(strPathMingW, "bin/mingw32-gcc.exe") _
|
---|
1388 | And LogFileExists(strPathMingW, "bin/ld.exe") _
|
---|
1389 | And LogFileExists(strPathMingW, "bin/objdump.exe") _
|
---|
1390 | And LogFileExists(strPathMingW, "bin/dllwrap.exe") _
|
---|
1391 | And LogFileExists(strPathMingW, "bin/as.exe") _
|
---|
1392 | And LogFileExists(strPathMingW, "include/string.h") _
|
---|
1393 | And LogFileExists(strPathMingW, "include/_mingw.h") _
|
---|
1394 | And LogFileExists(strPathMingW, "lib/dllcrt1.o") _
|
---|
1395 | And LogFileExists(strPathMingW, "lib/dllcrt2.o") _
|
---|
1396 | And LogFileExists(strPathMingW, "lib/libmsvcrt.a") _
|
---|
1397 | _
|
---|
1398 | And LogFileExists(strPathW32API, "lib/libkernel32.a") _
|
---|
1399 | And LogFileExists(strPathW32API, "include/windows.h") _
|
---|
1400 | then
|
---|
1401 | if Shell(DosSlashes(strPathMingW & "/bin/gcc.exe") & " --version", True) = 0 then
|
---|
1402 | dim offVer, iMajor, iMinor, iPatch, strVer
|
---|
1403 |
|
---|
1404 | ' extract the version.
|
---|
1405 | strVer = ""
|
---|
1406 | offVer = InStr(1, g_strShellOutput, "(GCC) ")
|
---|
1407 | if offVer > 0 then
|
---|
1408 | strVer = LTrim(Mid(g_strShellOutput, offVer + Len("(GCC) ")))
|
---|
1409 | strVer = RTrim(Left(strVer, InStr(1, strVer, " ")))
|
---|
1410 | if (Mid(strVer, 2, 1) = ".") _
|
---|
1411 | And (Mid(strVer, 4, 1) = ".") then
|
---|
1412 | iMajor = Int(Left(strVer, 1)) ' Is Int() the right thing here? I want atoi()!!!
|
---|
1413 | iMinor = Int(Mid(strVer, 3, 1))
|
---|
1414 | iPatch = Int(Mid(strVer, 5))
|
---|
1415 | else
|
---|
1416 | LogPrint "Malformed version: '" & strVer & "'"
|
---|
1417 | strVer = ""
|
---|
1418 | end if
|
---|
1419 | end if
|
---|
1420 | if strVer <> "" then
|
---|
1421 | if (iMajor = 3) And (iMinor = 3) then
|
---|
1422 | CheckForMingWSub = True
|
---|
1423 | g_strSubOutput = strVer
|
---|
1424 | else
|
---|
1425 | LogPrint "MinGW version '" & iMajor & "." & iMinor & "." & iPatch & "' is not supported (or configure.vbs failed to parse it correctly)."
|
---|
1426 | end if
|
---|
1427 | else
|
---|
1428 | LogPrint "Couldn't locate the GCC version in the output!"
|
---|
1429 | end if
|
---|
1430 |
|
---|
1431 | else
|
---|
1432 | LogPrint "Failed to run gcc.exe!"
|
---|
1433 | end if
|
---|
1434 | end if
|
---|
1435 | end function
|
---|
1436 |
|
---|
1437 |
|
---|
1438 | ''
|
---|
1439 | ' Checks for any libSDL binaries.
|
---|
1440 | sub CheckForlibSDL(strOptlibSDL)
|
---|
1441 | dim strPathlibSDL, str
|
---|
1442 | PrintHdr "libSDL"
|
---|
1443 |
|
---|
1444 | '
|
---|
1445 | ' Try find some SDL library.
|
---|
1446 | '
|
---|
1447 |
|
---|
1448 | ' First, the specific location.
|
---|
1449 | strPathlibSDL = ""
|
---|
1450 | if (strPathlibSDL = "") And (strOptlibSDL <> "") then
|
---|
1451 | if CheckForlibSDLSub(strOptlibSDL) then strPathlibSDL = strOptlibSDL
|
---|
1452 | end if
|
---|
1453 |
|
---|
1454 | ' The tools location.
|
---|
1455 | if strPathlibSDL = "" Then
|
---|
1456 | str = g_strPathDev & "/win.x86/libsdl/v1.2.11"
|
---|
1457 | if CheckForlibSDLSub(str) then strPathlibSDL = str
|
---|
1458 | end if
|
---|
1459 |
|
---|
1460 | if strPathlibSDL = "" Then
|
---|
1461 | str = g_strPathDev & "/win.x86/libsdl/v1.2.7-InnoTek"
|
---|
1462 | if CheckForlibSDLSub(str) then strPathlibSDL = str
|
---|
1463 | end if
|
---|
1464 |
|
---|
1465 | ' Poke about in the path.
|
---|
1466 | str = Which("SDLmain.lib")
|
---|
1467 | if (strPathlibSDL = "") And (str <> "") Then
|
---|
1468 | str = PathParent(PathStripFilename(str))
|
---|
1469 | if CheckForlibSDLSub(str) then strPathlibSDL = str
|
---|
1470 | end if
|
---|
1471 |
|
---|
1472 | str = Which("SDL.dll")
|
---|
1473 | if (strPathlibSDL = "") And (str <> "") Then
|
---|
1474 | str = PathParent(PathStripFilename(str))
|
---|
1475 | if CheckForlibSDLSub(str) then strPathlibSDL = str
|
---|
1476 | end if
|
---|
1477 |
|
---|
1478 | ' Success?
|
---|
1479 | if strPathlibSDL = "" then
|
---|
1480 | if strOptlibSDL = "" then
|
---|
1481 | MsgError "Can't locate libSDL. Try specify the path with the --with-libSDL=<path> argument. " _
|
---|
1482 | & "If still no luck, consult the configure.log and the build requirements."
|
---|
1483 | else
|
---|
1484 | MsgError "Can't locate libSDL. Please consult the configure.log and the build requirements."
|
---|
1485 | end if
|
---|
1486 | exit sub
|
---|
1487 | end if
|
---|
1488 |
|
---|
1489 | strPathLibSDL = UnixSlashes(PathAbs(strPathLibSDL))
|
---|
1490 | CfgPrint "PATH_SDK_LIBSDL := " & strPathlibSDL
|
---|
1491 |
|
---|
1492 | PrintResult "libSDL", strPathlibSDL
|
---|
1493 | end sub
|
---|
1494 |
|
---|
1495 | ''
|
---|
1496 | ' Checks if the specified path points to an usable libSDL or not.
|
---|
1497 | function CheckForlibSDLSub(strPathlibSDL)
|
---|
1498 | CheckForlibSDLSub = False
|
---|
1499 | LogPrint "trying: strPathlibSDL=" & strPathlibSDL
|
---|
1500 | if LogFileExists(strPathlibSDL, "lib/SDL.lib") _
|
---|
1501 | And LogFileExists(strPathlibSDL, "lib/SDLmain.lib") _
|
---|
1502 | And LogFileExists(strPathlibSDL, "lib/SDL.dll") _
|
---|
1503 | And LogFileExists(strPathlibSDL, "include/SDL.h") _
|
---|
1504 | And LogFileExists(strPathlibSDL, "include/SDL_syswm.h") _
|
---|
1505 | And LogFileExists(strPathlibSDL, "include/SDL_version.h") _
|
---|
1506 | then
|
---|
1507 | CheckForlibSDLSub = True
|
---|
1508 | end if
|
---|
1509 | end function
|
---|
1510 |
|
---|
1511 |
|
---|
1512 | dim g_strXercesVer
|
---|
1513 | g_strXercesVer = ""
|
---|
1514 |
|
---|
1515 | ''
|
---|
1516 | ' Checks for xerces.
|
---|
1517 | sub CheckForXerces(strOptXerces)
|
---|
1518 | dim strPathXerces, str
|
---|
1519 | PrintHdr "Xerces"
|
---|
1520 |
|
---|
1521 | ' Skip if no COM/ATL.
|
---|
1522 | if g_blnDisableCOM then
|
---|
1523 | PrintResult "Xerces", "Skipped (" & g_strDisableCOM & ")"
|
---|
1524 | exit sub
|
---|
1525 | end if
|
---|
1526 |
|
---|
1527 | '
|
---|
1528 | ' Try find some xerces dll/lib.
|
---|
1529 | '
|
---|
1530 | strPathXerces = ""
|
---|
1531 | if (strPathXerces = "") And (strOptXerces <> "") then
|
---|
1532 | if CheckForXercesSub(strOptXerces) then strPathXerces = strOptXerces
|
---|
1533 | end if
|
---|
1534 |
|
---|
1535 | if strPathXerces = "" Then
|
---|
1536 | str = Which("xerces-c_2_9.lib")
|
---|
1537 | if str = "" then str = Which("xerces-c_2_8.lib")
|
---|
1538 | if str = "" then str = Which("xerces-c_2_7.lib")
|
---|
1539 | if str = "" then str = Which("xerces-c_2_6.lib")
|
---|
1540 | if str <> "" Then
|
---|
1541 | str = PathParent(PathStripFilename(str))
|
---|
1542 | if CheckForXercesSub(str) then strPathXerces = str
|
---|
1543 | end if
|
---|
1544 | end if
|
---|
1545 |
|
---|
1546 | if strPathXerces = "" Then
|
---|
1547 | str = Which("xerces-c_2_9.dll")
|
---|
1548 | if str = "" then str = Which("xerces-c_2_8.dll")
|
---|
1549 | if str = "" then str = Which("xerces-c_2_7.dll")
|
---|
1550 | if str = "" then str = Which("xerces-c_2_6.dll")
|
---|
1551 | if str <> "" Then
|
---|
1552 | str = PathParent(PathStripFilename(str))
|
---|
1553 | if CheckForXercesSub(str) then strPathXerces = str
|
---|
1554 | end if
|
---|
1555 | end if
|
---|
1556 |
|
---|
1557 | ' Ignore failure if we're in 'internal' mode.
|
---|
1558 | if (strPathXerces = "") and g_blnInternalMode then
|
---|
1559 | PrintResult "Xerces", "ignored (internal mode)"
|
---|
1560 | exit sub
|
---|
1561 | end if
|
---|
1562 |
|
---|
1563 | ' Success?
|
---|
1564 | if strPathXerces = "" then
|
---|
1565 | if strOptXerces = "" then
|
---|
1566 | MsgError "Can't locate Xerces. Try specify the path with the --with-xerces=<path> argument. " _
|
---|
1567 | & "If still no luck, consult the configure.log and the build requirements."
|
---|
1568 | else
|
---|
1569 | MsgError "Can't locate Xerces. Please consult the configure.log and the build requirements."
|
---|
1570 | end if
|
---|
1571 | exit sub
|
---|
1572 | end if
|
---|
1573 |
|
---|
1574 | strPathXerces = UnixSlashes(PathAbs(strPathXerces))
|
---|
1575 | CfgPrint "SDK_VBOX_XERCES_INCS := " & strPathXerces & "/include"
|
---|
1576 | CfgPrint "SDK_VBOX_XERCES_LIBS := " & strPathXerces & "/lib/xerces-c_" & Left(g_strXercesVer, 1) & ".lib"
|
---|
1577 | CfgPrint "DLL_SDK_VBOX_XERCES_XERCES := " & strPathXerces & "/bin/xerces-c_" & g_strXercesVer & ".dll"
|
---|
1578 |
|
---|
1579 | PrintResult "Xerces", strPathXerces
|
---|
1580 | end sub
|
---|
1581 |
|
---|
1582 | ''
|
---|
1583 | ' Checks if the specified path points to an usable libSDL or not.
|
---|
1584 | function CheckForXercesSub(strPathXerces)
|
---|
1585 | dim str
|
---|
1586 |
|
---|
1587 | CheckForXercersSub = False
|
---|
1588 | LogPrint "trying: strPathXerces=" & strPathXerces
|
---|
1589 | if LogFileExists(strPathXerces, "include/xercesc/dom/DOM.hpp") _
|
---|
1590 | And LogFileExists(strPathXerces, "include/xercesc/validators/datatype/DatatypeValidator.hpp") _
|
---|
1591 | then
|
---|
1592 | ' The version is encoded in the dll/lib name, so try first
|
---|
1593 | ' to find the dll and then a matching lib.
|
---|
1594 | str = LogFindFile(strPathXerces, "bin/xerces-c_*.dll")
|
---|
1595 | if str <> "" then
|
---|
1596 | g_strXercesVer = Mid(str, Len("xerces-c_") + 1, Len(str) - Len("xerces-c_.dll"))
|
---|
1597 | ' the library omits the minor version (in the current distro).
|
---|
1598 | if LogFileExists(strPathXerces, "lib/xerces-c_" & Left(g_strXercesVer, 1) & ".lib") then
|
---|
1599 | CheckForXercesSub = True
|
---|
1600 | end if
|
---|
1601 | end if
|
---|
1602 | end if
|
---|
1603 | end function
|
---|
1604 |
|
---|
1605 |
|
---|
1606 | dim g_strXalanVer
|
---|
1607 | g_strXalanVer = ""
|
---|
1608 |
|
---|
1609 | ''
|
---|
1610 | ' Checks for Xalan.
|
---|
1611 | sub CheckForXalan(strOptXalan)
|
---|
1612 | dim strPathXalan, str
|
---|
1613 | PrintHdr "Xalan"
|
---|
1614 |
|
---|
1615 | ' Skip if no COM/ATL.
|
---|
1616 | if g_blnDisableCOM then
|
---|
1617 | PrintResult "Xalan", "Skipped (" & g_strDisableCOM & ")"
|
---|
1618 | exit sub
|
---|
1619 | end if
|
---|
1620 |
|
---|
1621 | '
|
---|
1622 | ' Try find some Xalan dll/lib.
|
---|
1623 | '
|
---|
1624 | strPathXalan = ""
|
---|
1625 | if (strPathXalan = "") And (strOptXalan <> "") then
|
---|
1626 | if CheckForXalanSub(strOptXalan) then strPathXalan = strOptXalan
|
---|
1627 | end if
|
---|
1628 |
|
---|
1629 | if strPathXalan = "" Then
|
---|
1630 | str = Which("Xalan-c_1_12.lib")
|
---|
1631 | if str = "" then str = Which("Xalan-c_1_11.lib")
|
---|
1632 | if str = "" then str = Which("Xalan-c_1_10.lib")
|
---|
1633 | if str = "" then str = Which("Xalan-c_1_9.lib")
|
---|
1634 | if str <> "" Then
|
---|
1635 | str = PathParent(PathStripFilename(str))
|
---|
1636 | if CheckForXalanSub(str) then strPathXalan = str
|
---|
1637 | end if
|
---|
1638 | end if
|
---|
1639 |
|
---|
1640 | if strPathXalan = "" Then
|
---|
1641 | str = Which("Xalan-c_1_12.dll")
|
---|
1642 | if str = "" then str = Which("Xalan-c_1_11.dll")
|
---|
1643 | if str = "" then str = Which("Xalan-c_1_10.dll")
|
---|
1644 | if str = "" then str = Which("Xalan-c_1_9.dll")
|
---|
1645 | if str <> "" Then
|
---|
1646 | str = PathParent(PathStripFilename(str))
|
---|
1647 | if CheckForXalanSub(str) then strPathXalan = str
|
---|
1648 | end if
|
---|
1649 | end if
|
---|
1650 |
|
---|
1651 | ' Ignore failure if we're in 'internal' mode.
|
---|
1652 | if (strPathXalan = "") and g_blnInternalMode then
|
---|
1653 | PrintResult "Xalan", "ignored (internal mode)"
|
---|
1654 | exit sub
|
---|
1655 | end if
|
---|
1656 |
|
---|
1657 | ' Success?
|
---|
1658 | if strPathXalan = "" then
|
---|
1659 | if strOptXalan = "" then
|
---|
1660 | MsgError "Can't locate Xalan. Try specify the path with the --with-Xalan=<path> argument. " _
|
---|
1661 | & "If still no luck, consult the configure.log and the build requirements."
|
---|
1662 | else
|
---|
1663 | MsgError "Can't locate Xalan. Please consult the configure.log and the build requirements."
|
---|
1664 | end if
|
---|
1665 | exit sub
|
---|
1666 | end if
|
---|
1667 |
|
---|
1668 | strPathXalan = UnixSlashes(PathAbs(strPathXalan))
|
---|
1669 | CfgPrint "SDK_VBOX_XALAN_INCS := " & strPathXalan & "/include"
|
---|
1670 | CfgPrint "SDK_VBOX_XALAN_LIBS := " & strPathXalan & "/lib/Xalan-C_" & Left(g_strXalanVer, 1) & ".lib"
|
---|
1671 | CfgPrint "DLL_SDK_VBOX_XALAN_XALAN := " & strPathXalan & "/bin/Xalan-C_" & g_strXalanVer & ".dll"
|
---|
1672 | CfgPrint "DLL_SDK_VBOX_XALAN_XALAN-MESSAGES := " & strPathXalan & "/bin/XalanMessages_" & g_strXalanVer & ".dll"
|
---|
1673 |
|
---|
1674 | PrintResult "Xalan", strPathXalan
|
---|
1675 | end sub
|
---|
1676 |
|
---|
1677 | ''
|
---|
1678 | ' Checks if the specified path points to an usable Xalan or not.
|
---|
1679 | function CheckForXalanSub(strPathXalan)
|
---|
1680 | dim str
|
---|
1681 |
|
---|
1682 | CheckForXercersSub = False
|
---|
1683 | LogPrint "trying: strPathXalan=" & strPathXalan
|
---|
1684 |
|
---|
1685 | if LogFileExists(strPathXalan, "include/xalanc/DOMSupport/DOMSupport.hpp") _
|
---|
1686 | And LogFileExists(strPathXalan, "include/xalanc/XalanDOM/XalanText.hpp") _
|
---|
1687 | then
|
---|
1688 | ' The version is encoded in the dll/lib name, so try first
|
---|
1689 | ' to find the dll and then a matching lib.
|
---|
1690 | str = LogFindFile(strPathXalan, "bin/Xalan-C_*.dll")
|
---|
1691 | if str <> "" then
|
---|
1692 | g_strXalanVer = Mid(str, Len("Xalan-C_") + 1, Len(str) - Len("Xalan-C_.dll"))
|
---|
1693 | ' the library omits the minor version (in the current distro).
|
---|
1694 | if LogFileExists(strPathXalan, "bin/XalanMessages_" & g_strXalanVer & ".dll") _
|
---|
1695 | And LogFileExists(strPathXalan, "lib/Xalan-C_" & Left(g_strXalanVer, 1) & ".lib") _
|
---|
1696 | then
|
---|
1697 | CheckForXalanSub = True
|
---|
1698 | end if
|
---|
1699 | end if
|
---|
1700 | end if
|
---|
1701 | end function
|
---|
1702 |
|
---|
1703 |
|
---|
1704 | dim g_strQtVer
|
---|
1705 | g_strQtVer = ""
|
---|
1706 |
|
---|
1707 | ''
|
---|
1708 | ' Checks for any Qt binaries. Failure here isn't fatal.
|
---|
1709 | sub CheckForQt(strOptQt)
|
---|
1710 | dim strPathQt, str
|
---|
1711 |
|
---|
1712 | PrintHdr "Qt"
|
---|
1713 |
|
---|
1714 | '
|
---|
1715 | ' Try find the Qt installation.
|
---|
1716 | '
|
---|
1717 | strPathQt = ""
|
---|
1718 |
|
---|
1719 | if (strPathQt = "") And (strOptQt <> "") then
|
---|
1720 | if CheckForQtSub(strOptQt) then strPathQt = strOptQt
|
---|
1721 | end if
|
---|
1722 |
|
---|
1723 | if strPathQt = "" then
|
---|
1724 | str = g_strPathDev & "/win.x86/qt/v3.3.3"
|
---|
1725 | if CheckForQtSub(str) then strPathQt = str
|
---|
1726 | end if
|
---|
1727 |
|
---|
1728 | '' @todo check for Qt installations and stuff later.
|
---|
1729 |
|
---|
1730 | ' Found anything?
|
---|
1731 | if strPathQt = "" then
|
---|
1732 | CfgPrint "VBOX_WITH_QTGUI="
|
---|
1733 | PrintResult "Qt", "not found"
|
---|
1734 | else
|
---|
1735 | CfgPrint "VBOX_PATH_QT := " & strPathQt
|
---|
1736 | CfgPrint "QTDIR = $(VBOX_PATH_QT)"
|
---|
1737 | CfgPrint "LIB_QT = $(VBOX_PATH_QT)/lib/dynamic/qt-mt" & g_strQtVer & ".lib"
|
---|
1738 | CfgPrint "VBOX_DLL_QT = $(VBOX_PATH_QT)/bin/qt-mt" & g_strQtVer & ".dll"
|
---|
1739 | PrintResult "Qt (" & g_strQtVer & ")", strPathQt
|
---|
1740 | end if
|
---|
1741 | end sub
|
---|
1742 |
|
---|
1743 | ''
|
---|
1744 | ' Checks if the specified path points to an usable Qt install or not.
|
---|
1745 | function CheckForQtSub(strPathQt)
|
---|
1746 |
|
---|
1747 | CheckForQtSub = False
|
---|
1748 | LogPrint "trying: strPathQt=" & strPathQt
|
---|
1749 | if LogFileExists(strPathQt, "bin/moc.exe") _
|
---|
1750 | And LogFileExists(strPathQt, "bin/uic.exe") _
|
---|
1751 | And LogFileExists(strPathQt, "include/qvbox.h") _
|
---|
1752 | And LogFileExists(strPathQt, "include/qt_windows.h") _
|
---|
1753 | And LogFileExists(strPathQt, "include/qapplication.h") _
|
---|
1754 | And LogFileExists(strPathQt, "include/qtextedit.h") _
|
---|
1755 | And LogFileExists(strPathQt, "lib/dynamic/qtmain.lib") _
|
---|
1756 | then
|
---|
1757 | dim str
|
---|
1758 |
|
---|
1759 | ' This check might need improving.
|
---|
1760 | str = LogFindFile(strPathQt, "lib/dynamic/qt-mt33*.lib")
|
---|
1761 | if str <> "" then
|
---|
1762 | g_strQtVer = Mid(str, Len("qt-mt") + 1, Len(str) - Len("qt-mt.lib"))
|
---|
1763 | if LogFileExists(strPathQt, "bin/qt-mt" & g_strQtVer & ".dll") then
|
---|
1764 | CheckForQtSub = True
|
---|
1765 | end if
|
---|
1766 | end if
|
---|
1767 | end if
|
---|
1768 | end function
|
---|
1769 |
|
---|
1770 |
|
---|
1771 | ''
|
---|
1772 | ' Show usage.
|
---|
1773 | sub usage
|
---|
1774 | Print "Usage: cscript configure.vbs [options]"
|
---|
1775 | Print ""
|
---|
1776 | Print "Configuration:"
|
---|
1777 | Print " -h, --help"
|
---|
1778 | Print " --internal"
|
---|
1779 | Print ""
|
---|
1780 | Print "Components:"
|
---|
1781 | Print " --disable-COM"
|
---|
1782 | Print ""
|
---|
1783 | Print "Locations:"
|
---|
1784 | Print " --with-DDK=PATH "
|
---|
1785 | Print " --with-DXSDK=PATH "
|
---|
1786 | Print " --with-kBuild=PATH "
|
---|
1787 | Print " --with-libSDL=PATH "
|
---|
1788 | Print " --with-MinGW=PATH "
|
---|
1789 | Print " --with-Qt3=PATH "
|
---|
1790 | Print " --with-SDK=PATH "
|
---|
1791 | Print " --with-VC=PATH "
|
---|
1792 | Print " --with-VC-Common=PATH "
|
---|
1793 | Print " --with-VC-Express-Edition"
|
---|
1794 | Print " --with-W32API=PATH "
|
---|
1795 | Print " --with-Xalan=PATH "
|
---|
1796 | Print " --with-Xerces=PATH "
|
---|
1797 | end sub
|
---|
1798 |
|
---|
1799 |
|
---|
1800 | ''
|
---|
1801 | ' The main() like function.
|
---|
1802 | '
|
---|
1803 | Sub Main
|
---|
1804 | '
|
---|
1805 | ' Write the log header and check that we're not using wscript.
|
---|
1806 | '
|
---|
1807 | LogInit
|
---|
1808 | If UCase(Right(Wscript.FullName, 11)) = "WSCRIPT.EXE" Then
|
---|
1809 | Wscript.Echo "This script must be run under CScript."
|
---|
1810 | Wscript.Quit(1)
|
---|
1811 | End If
|
---|
1812 |
|
---|
1813 | '
|
---|
1814 | ' Parse arguments.
|
---|
1815 | '
|
---|
1816 | strOptDDK = ""
|
---|
1817 | strOptDXDDK = ""
|
---|
1818 | strOptkBuild = ""
|
---|
1819 | strOptlibSDL = ""
|
---|
1820 | strOptMingW = ""
|
---|
1821 | strOptQt = ""
|
---|
1822 | strOptSDK = ""
|
---|
1823 | strOptVC = ""
|
---|
1824 | strOptVCCommon = ""
|
---|
1825 | blnOptVCExpressEdition = False
|
---|
1826 | strOptW32API = ""
|
---|
1827 | blnOptXalan = ""
|
---|
1828 | blnOptXerces = ""
|
---|
1829 | blnOptDisableCOM = False
|
---|
1830 | for i = 1 to Wscript.Arguments.Count
|
---|
1831 | dim str, strArg, strPath
|
---|
1832 |
|
---|
1833 | ' Separate argument and path value
|
---|
1834 | str = Wscript.Arguments.item(i - 1)
|
---|
1835 | if InStr(1, str, "=") > 0 then
|
---|
1836 | strArg = Mid(str, 1, InStr(1, str, "=") - 1)
|
---|
1837 | strPath = Mid(str, InStr(1, str, "=") + 1)
|
---|
1838 | if strPath = "" then MsgFatal "Syntax error! Argument #" & i & " is missing the path."
|
---|
1839 | else
|
---|
1840 | strArg = str
|
---|
1841 | strPath = ""
|
---|
1842 | end if
|
---|
1843 |
|
---|
1844 | ' Process the argument
|
---|
1845 | select case LCase(strArg)
|
---|
1846 | case "--with-ddk"
|
---|
1847 | strOptDDK = strPath
|
---|
1848 | case "--with-dxsdk"
|
---|
1849 | strOptDXSDK = strPath
|
---|
1850 | case "--with-kbuild"
|
---|
1851 | strOptkBuild = strPath
|
---|
1852 | case "--with-libsdl"
|
---|
1853 | strOptlibSDL = strPath
|
---|
1854 | case "--with-mingw"
|
---|
1855 | strOptMingW = strPath
|
---|
1856 | case "--with-qt"
|
---|
1857 | strOptQt = strPath
|
---|
1858 | case "--with-sdk"
|
---|
1859 | strOptSDK = strPath
|
---|
1860 | case "--with-vc"
|
---|
1861 | strOptVC = strPath
|
---|
1862 | case "--with-vc-common"
|
---|
1863 | strOptVCCommon = strPath
|
---|
1864 | case "--with-vc-express-edition"
|
---|
1865 | blnOptVCExpressEdition = True
|
---|
1866 | case "--with-w32api"
|
---|
1867 | strOptW32API = strPath
|
---|
1868 | case "--with-xalan"
|
---|
1869 | strOptXalan = strPath
|
---|
1870 | case "--with-xerces"
|
---|
1871 | strOptXerces = strPath
|
---|
1872 | case "--disable-com"
|
---|
1873 | blnOptDisableCOM = True
|
---|
1874 | case "--enable-com"
|
---|
1875 | blnOptDisableCOM = False
|
---|
1876 | case "--internal"
|
---|
1877 | g_blnInternalMode = True
|
---|
1878 | case "-h", "--help", "-?"
|
---|
1879 | usage
|
---|
1880 | Wscript.Quit(0)
|
---|
1881 | case else
|
---|
1882 | Wscript.echo "syntax error: Unknown option '" & str &"'."
|
---|
1883 | usage
|
---|
1884 | Wscript.Quit(1)
|
---|
1885 | end select
|
---|
1886 | next
|
---|
1887 |
|
---|
1888 | '
|
---|
1889 | ' Initialize output files.
|
---|
1890 | '
|
---|
1891 | CfgInit
|
---|
1892 | EnvInit
|
---|
1893 |
|
---|
1894 | '
|
---|
1895 | ' Check that the Shell function is sane.
|
---|
1896 | '
|
---|
1897 | g_objShell.Environment("PROCESS")("TESTING_ENVIRONMENT_INHERITANCE") = "This works"
|
---|
1898 | if Shell("set TESTING_ENVIRONMENT_INHERITANC", False) <> 0 then ' The 'E' is missing on purpose (4nt).
|
---|
1899 | MsgFatal "shell execution test failed!"
|
---|
1900 | end if
|
---|
1901 | if g_strShellOutput <> "TESTING_ENVIRONMENT_INHERITANCE=This works" & CHR(13) & CHR(10) then
|
---|
1902 | MsgFatal "shell inheritance or shell execution isn't working right."
|
---|
1903 | end if
|
---|
1904 | g_objShell.Environment("PROCESS")("TESTING_ENVIRONMENT_INHERITANCE") = ""
|
---|
1905 | Print "Shell inheritance test: OK"
|
---|
1906 |
|
---|
1907 | '
|
---|
1908 | ' Do the checks.
|
---|
1909 | '
|
---|
1910 | if blnOptDisableCOM = True then
|
---|
1911 | DisableCOM "--disable-com"
|
---|
1912 | end if
|
---|
1913 | CheckSourcePath
|
---|
1914 | CheckForkBuild strOptkBuild
|
---|
1915 | CheckForVisualCPP strOptVC, strOptVCCommon, blnOptVCExpressEdition
|
---|
1916 | CheckForPlatformSDK strOptSDK
|
---|
1917 | CheckForWin2k3DDK strOptDDK
|
---|
1918 | CheckForMidl
|
---|
1919 | CheckForDirectXSDK strOptDXSDK
|
---|
1920 | CheckForMingW strOptMingw, strOptW32API
|
---|
1921 | CheckForlibSDL strOptlibSDL
|
---|
1922 | CheckForXerces strOptXerces
|
---|
1923 | CheckForXalan strOptXalan
|
---|
1924 | CheckForQt strOptQt
|
---|
1925 | if g_blnInternalMode then
|
---|
1926 | EnvPrint "call " & g_strPathDev & "/env.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9"
|
---|
1927 | end if
|
---|
1928 |
|
---|
1929 | End Sub
|
---|
1930 |
|
---|
1931 |
|
---|
1932 | Main
|
---|
1933 |
|
---|