1 # =======================================================================
2 # Created on: 2012-01-26
3 # Created by: Kirill GAVRILOV
4 # Copyright (c) 2012 OPEN CASCADE SAS
6 # This file is part of Open CASCADE Technology software library.
8 # This library is free software; you can redistribute it and/or modify it under
9 # the terms of the GNU Lesser General Public License version 2.1 as published
10 # by the Free Software Foundation, with special exception defined in the file
11 # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 # distribution for complete text of the license and disclaimer of any warranty.
14 # Alternatively, this file may be used under the terms of Open CASCADE
15 # commercial license or contractual agreement.
17 # =======================================================================
18 # Tools for search of third-party libraries and generation on environment
19 # customization script
20 # =======================================================================
24 if { "$tcl_platform(platform)" == "unix" } {
25 set SYS_PATH_SPLITTER ":"
26 set SYS_LIB_PREFIX "lib"
28 if { "$tcl_platform(os)" == "Darwin" } {
29 set SYS_LIB_SUFFIX "dylib"
31 set SYS_LIB_SUFFIX "so"
35 } elseif { "$tcl_platform(platform)" == "windows" } {
36 set SYS_PATH_SPLITTER ";"
38 set SYS_LIB_SUFFIX "lib"
39 set SYS_EXE_SUFFIX ".exe"
44 set SHORTCUT_HEADERS "ShortCut"
47 set CSF_OPT_INC [list]
48 set CSF_OPT_LIB32 [list]
49 set CSF_OPT_LIB64 [list]
50 set CSF_OPT_BIN32 [list]
51 set CSF_OPT_BIN64 [list]
53 if { "$tcl_platform(pointerSize)" == "4" } {
56 if { [info exists ::env(ARCH)] } {
57 set ARCH "$::env(ARCH)"
60 if { [info exists ::env(SHORTCUT_HEADERS)] } {
61 set SHORTCUT_HEADERS "$::env(SHORTCUT_HEADERS)"
62 if { $SHORTCUT_HEADERS == "true" } {
63 set SHORTCUT_HEADERS "ShortCut"
67 # fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name
68 set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_GL2PS HAVE_ZLIB HAVE_LIBLZMA HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo}
69 foreach anEnvIter $THE_ENV_VARIABLES {
70 set ${anEnvIter} "false"
71 if { [info exists ::env(${anEnvIter})] } {
72 set ${anEnvIter} "$::env(${anEnvIter})"
75 # do not export platform-specific variables
76 if { "$::tcl_platform(os)" == "Darwin" } {
81 if { "$tcl_platform(platform)" != "windows" } {
83 set HAVE_RelWithDebInfo ""
85 foreach anEnvIter {ARCH VCVER VCVARS PRODUCTS_PATH} {
86 if { [info exists ::env(${anEnvIter})] } {
87 set ${anEnvIter} "$::env(${anEnvIter})"
91 if { [info exists ::env(CSF_OPT_INC)] } {
92 set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
94 if { [info exists ::env(CSF_OPT_LIB32)] } {
95 set CSF_OPT_LIB32 [split "$::env(CSF_OPT_LIB32)" $::SYS_PATH_SPLITTER]
97 if { [info exists ::env(CSF_OPT_LIB64)] } {
98 set CSF_OPT_LIB64 [split "$::env(CSF_OPT_LIB64)" $::SYS_PATH_SPLITTER]
100 if { [info exists ::env(CSF_OPT_BIN32)] } {
101 set CSF_OPT_BIN32 [split "$::env(CSF_OPT_BIN32)" $::SYS_PATH_SPLITTER]
103 if { [info exists ::env(CSF_OPT_BIN64)] } {
104 set CSF_OPT_BIN64 [split "$::env(CSF_OPT_BIN64)" $::SYS_PATH_SPLITTER]
107 # Search header file in $::CSF_OPT_INC and standard paths
108 proc wokdep:SearchHeader {theHeader} {
109 # search in custom paths
110 foreach anIncPath $::CSF_OPT_INC {
111 set aPath "${anIncPath}/${theHeader}"
112 if { [file exists "$aPath"] } {
118 set aPath "/usr/include/${theHeader}"
119 if { [file exists "$aPath"] } {
123 if { "$::tcl_platform(os)" == "Linux" } {
124 if { "$::ARCH" == "64" } {
125 set aPath "/usr/include/x86_64-linux-gnu/${theHeader}"
126 if { [file exists "$aPath"] } {
130 set aPath "/usr/include/i386-linux-gnu/${theHeader}"
131 if { [file exists "$aPath"] } {
140 # Search library file in $::CSF_OPT_LIB* and standard paths
141 proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
142 if { "$theSearchPath" != "" } {
143 set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
144 if { [file exists "$aPath"] } {
151 # search in custom paths
152 foreach aLibPath [set ::CSF_OPT_LIB$theBitness] {
153 set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
154 if { [file exists "$aPath"] } {
160 if { "$::ARCH" == "$theBitness"} {
161 set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
162 if { [file exists "$aPath"] } {
168 if { "$::tcl_platform(os)" == "Linux" } {
169 if { "$theBitness" == "64" } {
170 set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
171 if { [file exists "$aPath"] } {
175 set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
176 if { [file exists "$aPath"] } {
185 # Search file in $::CSF_OPT_BIN* and standard paths
186 proc wokdep:SearchBin {theBin theBitness {theSearchPath ""}} {
187 if { "$theSearchPath" != "" } {
188 set aPath "${theSearchPath}/${theBin}"
189 if { [file exists "$aPath"] } {
196 # search in custom paths
197 foreach aBinPath [set ::CSF_OPT_BIN$theBitness] {
198 set aPath "${aBinPath}/${theBin}"
199 if { [file exists "$aPath"] } {
205 if { "$::ARCH" == "$theBitness"} {
206 set aPath "/usr/bin/${theBin}"
207 if { [file exists "$aPath"] } {
215 # Detect compiler C-runtime version 'vc*' and architecture '32'/'64'
216 # to determine preferred path.
217 proc wokdep:Preferred {theList theCmpl theArch} {
218 if { [llength $theList] == 0 } {
222 # keep only two first digits in "vc141"
223 if { ! [regexp {^vc[0-9][0-9]} $theCmpl aCmpl] } {
228 foreach aPath $theList {
229 if { [string first "$aCmpl" "$aPath"] != "-1" } {
230 lappend aShortList "$aPath"
234 if { [llength $aShortList] == 0 } {
235 #return [lindex $theList 0]
236 set aShortList $theList
239 set aVeryShortList {}
240 foreach aPath $aShortList {
241 if { [string first "$theArch" "$aPath"] != "-1" } {
242 lappend aVeryShortList "$aPath"
245 if { [llength $aVeryShortList] == 0 } {
246 return [lindex [lsort -decreasing $aShortList] 0]
249 return [lindex [lsort -decreasing $aVeryShortList] 0]
252 # Search library placement
253 proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64 theName theCheckHeader theCheckLib theCheckFolders} {
254 upvar $theErrInc anErrInc
255 upvar $theErrLib32 anErrLib32
256 upvar $theErrLib64 anErrLib64
257 upvar $theErrBin32 anErrBin32
258 upvar $theErrBin64 anErrBin64
261 set aHeaderPath [wokdep:SearchHeader "$theCheckHeader"]
262 if { "$aHeaderPath" == "" } {
264 foreach aFolderIter $theCheckFolders {
265 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$::ARCH" ]
266 if { "$aPath" != "" && [file exists "$aPath/include/$theCheckHeader"] } {
267 lappend ::CSF_OPT_INC "$aPath/include"
273 lappend anErrInc "Error: '$theCheckHeader' not found ($theName)"
278 foreach anArchIter {64 32} {
279 set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter"]
280 if { "$aLibPath" == "" } {
282 foreach aFolderIter $theCheckFolders {
283 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
284 set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/lib"]
285 if { "$aLibPath" != "" } {
286 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
287 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
293 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}$theCheckLib.${::SYS_LIB_SUFFIX}' not found ($theName)"
294 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
298 if { "$::tcl_platform(platform)" == "windows" } {
299 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter"]
300 if { "$aDllPath" == "" } {
302 foreach aFolderIter $theCheckFolders {
303 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
304 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/bin"]
305 if { "$aDllPath" != "" } {
306 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
310 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/lib"]
311 if { "$aDllPath" != "" } {
312 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
319 lappend anErrBin$anArchIter "Error: '$theCheckLib.dll' not found ($theName)"
320 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
329 # Search Tcl/Tk libraries placement
330 proc wokdep:SearchTclTk {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
331 upvar $theErrInc anErrInc
332 upvar $theErrLib32 anErrLib32
333 upvar $theErrLib64 anErrLib64
334 upvar $theErrBin32 anErrBin32
335 upvar $theErrBin64 anErrBin64
341 set aTclHPath [wokdep:SearchHeader "tcl.h"]
342 set aTkHPath [wokdep:SearchHeader "tk.h"]
343 if { "$aTclHPath" == "" || "$aTkHPath" == "" } {
344 if { [file exists "/usr/include/tcl8.6/tcl.h"]
345 && [file exists "/usr/include/tcl8.6/tk.h" ] } {
346 lappend ::CSF_OPT_INC "/usr/include/tcl8.6"
347 set aTclHPath "/usr/include/tcl8.6/tcl.h"
349 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$::ARCH" ]
350 if { "$aPath" != "" && [file exists "$aPath/include/tcl.h"] && [file exists "$aPath/include/tk.h"] } {
351 lappend ::CSF_OPT_INC "$aPath/include"
352 set aTclHPath "$aPath/include/tcl.h"
354 lappend anErrInc "Error: 'tcl.h' or 'tk.h' not found (Tcl/Tk)"
360 # detect tcl version by parsing header file
362 set fh [open $aTclHPath]
365 regexp {define\s+TCL_MAJOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_maj
366 regexp {define\s+TCL_MINOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_min
369 if { "$::tcl_platform(platform)" == "windows" } {
370 set aTclLibName "tcl${tclver_maj}${tclver_min}"
371 set aTkLibName "tk${tclver_maj}${tclver_min}"
373 set aTclLibName "tcl${tclver_maj}.${tclver_min}"
374 set aTkLibName "tk${tclver_maj}.${tclver_min}"
377 foreach anArchIter {64 32} {
378 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter"]
379 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter"]
380 if { "$aTclLibPath" == "" || "$aTkLibPath" == "" } {
381 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
382 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter" "$aPath/lib"]
383 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter" "$aPath/lib"]
384 if { "$aTclLibPath" != "" && "$aTkLibPath" != "" } {
385 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
387 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aTclLibName}.${::SYS_LIB_SUFFIX}' or '${::SYS_LIB_PREFIX}${aTkLibName}.${::SYS_LIB_SUFFIX}' not found (Tcl/Tk)"
388 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
392 if { "$::tcl_platform(platform)" == "windows" } {
393 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter"]
394 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter"]
395 if { "$aTclDllPath" == "" || "$aTkDllPath" == "" } {
396 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
397 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter" "$aPath/bin"]
398 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter" "$aPath/bin"]
399 if { "$aTclDllPath" != "" && "$aTkDllPath" != "" } {
400 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
402 lappend anErrBin$anArchIter "Error: '${aTclLibName}.dll' or '${aTkLibName}.dll' not found (Tcl/Tk)"
403 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
412 # Search FreeType library placement
413 proc wokdep:SearchFreeType {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
414 upvar $theErrInc anErrInc
415 upvar $theErrLib32 anErrLib32
416 upvar $theErrLib64 anErrLib64
417 upvar $theErrBin32 anErrBin32
418 upvar $theErrBin64 anErrBin64
421 set aFtBuildPath [wokdep:SearchHeader "ft2build.h"]
423 if { "$aFtBuildPath" == "" } {
424 # TODO - use `freetype-config --cflags` instead
425 set aSysFreeType "/usr/include/freetype2"
426 if { [file exists "$aSysFreeType/ft2build.h"] } {
427 lappend ::CSF_OPT_INC "$aSysFreeType"
428 } elseif { [file exists "$aSysFreeType/freetype2/ft2build.h"] } {
429 lappend ::CSF_OPT_INC "$aSysFreeType/freetype2"
431 set aSysFreeType "/usr/X11/include/freetype2"
432 if { [file exists "$aSysFreeType/ft2build.h"] } {
433 lappend ::CSF_OPT_INC "/usr/X11/include"
434 lappend ::CSF_OPT_INC "$aSysFreeType"
436 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$::ARCH" ]
437 if {"$aPath" != ""} {
438 if {[file exists "$aPath/include/ft2build.h"]} {
439 lappend ::CSF_OPT_INC "$aPath/include"
440 } elseif {[file exists "$aPath/include/freetype2/ft2build.h"]} {
441 lappend ::CSF_OPT_INC "$aPath/include/freetype2"
444 lappend anErrInc "Error: 'freetype.h' not found (FreeType2)"
451 # parse 'freetype-config --libs'
453 if { [catch { set aConfLibs [exec freetype-config --libs] } ] == 0 } {
454 foreach aPath [split $aConfLibs " "] {
455 if { [string first "-L" "$aPath"] == 0 } {
456 set aConfLibPath [string range "$aPath" 2 [string length "$aPath"]]
461 foreach anArchIter {64 32} {
462 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter"]
463 if { "$aFtLibPath" == "" } {
464 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
465 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aPath/lib"]
466 if { "$aFtLibPath" != "" } {
467 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
469 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aConfLibPath"]
470 if { "$aFtLibPath" != "" } {
471 lappend ::CSF_OPT_LIB$anArchIter "$aConfLibPath"
473 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freetype.${::SYS_LIB_SUFFIX}' not found (FreeType2)"
474 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
478 if { "$::tcl_platform(platform)" == "windows" } {
479 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter"]
480 if { "$aFtDllPath" == "" } {
481 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
482 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/bin"]
483 if { "$aFtDllPath" != "" } {
484 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
486 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/lib"]
487 if { "$aFtDllPath" != "" } {
488 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
490 lappend anErrBin$anArchIter "Error: 'freetype.dll' not found (FreeType2)"
491 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
501 # Search FreeImage library placement
502 proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
503 upvar $theErrInc anErrInc
504 upvar $theErrLib32 anErrLib32
505 upvar $theErrLib64 anErrLib64
506 upvar $theErrBin32 anErrBin32
507 upvar $theErrBin64 anErrBin64
509 # binary distribution has another layout
510 set aFImageDist "Dist"
513 set aFImageHPath [wokdep:SearchHeader "FreeImage.h"]
514 if { "$aFImageHPath" == "" } {
515 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$::ARCH" ]
516 if { "$aPath" != "" && [file exists "$aPath/include/FreeImage.h"] } {
517 lappend ::CSF_OPT_INC "$aPath/include"
518 } elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] } {
519 lappend ::CSF_OPT_INC "$aPath/$aFImageDist"
521 lappend anErrInc "Error: 'FreeImage.h' not found (FreeImage)"
526 foreach anArchIter {64 32} {
527 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"]
528 if { "$aFImageLibPath" == "" } {
529 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
530 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/lib"]
531 if { "$aFImageLibPath" != "" } {
532 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
534 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"]
535 if { "$aFImageLibPath" != "" } {
536 lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImageDist"
538 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' not found (FreeImage)"
539 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
543 if { "$::tcl_platform(platform)" == "windows" } {
544 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"]
545 if { "$aFImageDllPath" == "" } {
546 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
547 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/bin"]
548 if { "$aFImageDllPath" != "" } {
549 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
551 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/$aFImageDist"]
552 if { "$aFImageDllPath" != "" } {
553 lappend ::CSF_OPT_BIN$anArchIter "$aPath/$aFImageDist"
555 lappend anErrBin$anArchIter "Error: 'freeimage.dll' is not found (FreeImage)"
556 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
566 # Search FFmpeg framework placement
567 proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
568 upvar $theErrInc anErrInc
569 upvar $theErrLib32 anErrLib32
570 upvar $theErrLib64 anErrLib64
571 upvar $theErrBin32 anErrBin32
572 upvar $theErrBin64 anErrBin64
575 set aFFmpegHPath [wokdep:SearchHeader "libavutil/avutil.h"]
576 if { "$aFFmpegHPath" == "" } {
577 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$::ARCH" ]
578 if { "$aPath" != "" && [file exists "$aPath/include/libavutil/avutil.h"] } {
579 lappend ::CSF_OPT_INC "$aPath/include"
581 lappend anErrInc "Error: 'libavutil/avutil.h' not found (FFmpeg)"
586 foreach anArchIter {64 32} {
587 set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter"]
588 if { "$aFFmpegLibPath" == "" } {
589 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$anArchIter" ]
590 set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter" "$aPath/lib"]
591 if { "$aFFmpegLibPath" != "" } {
592 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
593 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
595 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}avutil.${::SYS_LIB_SUFFIX}' not found (FFmpeg)"
596 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
604 # Search TBB library placement
605 proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
606 upvar $theErrInc anErrInc
607 upvar $theErrLib32 anErrLib32
608 upvar $theErrLib64 anErrLib64
609 upvar $theErrBin32 anErrBin32
610 upvar $theErrBin64 anErrBin64
612 # keep only two first digits in "vc141"
613 if { ! [regexp {^vc[0-9][0-9]} ${::VCVER} aVcLib] } {
614 set aVcLib ${::VCVER}
618 set aTbbHPath [wokdep:SearchHeader "tbb/scalable_allocator.h"]
619 if { "$aTbbHPath" == "" } {
620 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] "$::VCVER" "$::ARCH" ]
621 if { "$aPath" != "" && [file exists "$aPath/include/tbb/scalable_allocator.h"] } {
622 lappend ::CSF_OPT_INC "$aPath/include"
624 lappend anErrInc "Error: 'tbb/scalable_allocator.h' not found (Intel TBB)"
629 foreach anArchIter {64 32} {
631 if { "$anArchIter" == "64"} {
632 set aSubDir "intel64"
635 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter"]
636 if { "$aTbbLibPath" == "" } {
637 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
638 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir/$aVcLib"]
639 if { "$aTbbLibPath" == "" } {
640 # Set the path to the TBB library for Linux
641 if { "$::tcl_platform(platform)" != "windows" } {
642 set aSubDir "$aSubDir/cc4.1.0_libc2.4_kernel2.6.16.21"
644 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir"]
645 if { "$aTbbLibPath" != "" } {
646 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir"
649 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir/$aVcLib"
651 if { "$aTbbLibPath" == "" } {
652 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}tbb.${::SYS_LIB_SUFFIX}' not found (Intel TBB)"
653 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
656 if { "$::tcl_platform(platform)" == "windows" } {
657 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
658 if { "$aTbbDllPath" == "" } {
659 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
660 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
661 if { "$aTbbDllPath" != "" } {
662 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/$aVcLib"
664 lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
665 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
674 # Search OpenCL library placement
675 proc wokdep:SearchOpenCL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
676 upvar $theErrInc anErrInc
677 upvar $theErrLib32 anErrLib32
678 upvar $theErrLib64 anErrLib64
679 upvar $theErrBin32 anErrBin32
680 upvar $theErrBin64 anErrBin64
683 if { "$::tcl_platform(os)" == "Darwin" } {
684 # OpenCL framework available since Mac OS X 16
688 set aCLHPath [wokdep:SearchHeader "CL/cl_gl.h"]
689 if { "$aCLHPath" == "" } {
690 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$::ARCH" ]
691 if { "$aPath" != "" && [file exists "$aPath/include/CL/cl_gl.h"] } {
692 lappend ::CSF_OPT_INC "$aPath/include"
694 lappend anErrInc "Error: 'CL/cl_gl.h' not found (OpenCL)"
699 foreach anArchIter {64 32} {
700 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter"]
701 if { "$aCLLibPath" == "" } {
702 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$anArchIter" ]
703 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter" "$aPath/lib"]
704 if { "$aCLLibPath" != "" } {
705 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
707 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}OpenCL.${::SYS_LIB_SUFFIX}' not found (OpenCL)"
708 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
716 # Search EGL library placement
717 proc wokdep:SearchEGL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
718 upvar $theErrInc anErrInc
719 upvar $theErrLib32 anErrLib32
720 upvar $theErrLib64 anErrLib64
721 upvar $theErrBin32 anErrBin32
722 upvar $theErrBin64 anErrBin64
725 set aHeaderPath [wokdep:SearchHeader "EGL/egl.h"]
726 if { "$aHeaderPath" == "" } {
727 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$::ARCH" ]
728 if { "$aPath" == "" || ![file exists "$aPath/include/EGL/egl.h"] } {
729 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
732 if { "$aPath" != "" && [file exists "$aPath/include/EGL/egl.h"] } {
733 lappend ::CSF_OPT_INC "$aPath/include"
735 lappend anErrInc "Error: 'EGL/egl.h' not found (EGL)"
741 if { "$::tcl_platform(platform)" == "windows" } {
743 set aLibName "libEGL"
746 foreach anArchIter {64 32} {
747 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
748 if { "$aLibPath" == "" } {
749 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
750 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
751 if { "$aLibPath" == "" } {
752 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
753 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
756 if { "$aLibPath" != "" } {
757 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
759 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (EGL)"
760 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
764 if { "$::tcl_platform(platform)" == "windows" } {
765 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter"]
766 if { "$aDllPath" == "" } {
767 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
768 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
769 if { "$aDllPath" == "" } {
770 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
771 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
774 if { "$aDllPath" != "" } {
775 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
777 lappend anErrBin$anArchIter "Error: 'libEGL.dll' not found (EGL)"
778 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
787 # Search OpenGL ES 2.0 library placement
788 proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
789 upvar $theErrInc anErrInc
790 upvar $theErrLib32 anErrLib32
791 upvar $theErrLib64 anErrLib64
792 upvar $theErrBin32 anErrBin32
793 upvar $theErrBin64 anErrBin64
796 set aHeaderPath [wokdep:SearchHeader "GLES2/gl2.h"]
797 if { "$aHeaderPath" == "" } {
798 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$::ARCH" ]
799 if { "$aPath" == "" || ![file exists "$aPath/include/GLES2/gl2.h"] } {
800 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
803 if { "$aPath" != "" && [file exists "$aPath/include/GLES2/gl2.h"] } {
804 lappend ::CSF_OPT_INC "$aPath/include"
806 lappend anErrInc "Error: 'GLES2/gl2.h' not found (OpenGL ES 2.0)"
811 set aLibName "GLESv2"
812 if { "$::tcl_platform(platform)" == "windows" } {
814 set aLibName "libGLESv2"
817 foreach anArchIter {64 32} {
818 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
819 if { "$aLibPath" == "" } {
820 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$anArchIter" ]
821 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
822 if { "$aLibPath" == "" } {
823 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
824 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
827 if { "$aLibPath" != "" } {
828 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
830 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (OpenGL ES 2.0)"
831 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
835 if { "$::tcl_platform(platform)" == "windows" } {
836 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter"]
837 if { "$aDllPath" == "" } {
838 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
839 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
840 if { "$aDllPath" == "" } {
841 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
842 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
845 if { "$aDllPath" != "" } {
846 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
848 lappend anErrBin$anArchIter "Error: 'libGLESv2.dll' not found (OpenGL ES 2.0)"
849 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
858 # Auxiliary function, gets VTK version to set default search directory
859 proc wokdep:VtkVersion { thePath } {
862 set aVtkRoot [lindex [regexp -all -inline {[0-9.]*} [file tail $thePath]] 0]
863 if { "$aVtkRoot" != "" } {
864 set aVtkRoot [regexp -inline {[0-9]*.[0-9]*} $aVtkRoot]
865 if { "$aVtkRoot" != "" } {
866 set aResult $aVtkRoot
873 # Search VTK library placement
874 proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
875 upvar $theErrInc anErrInc
876 upvar $theErrLib32 anErrLib32
877 upvar $theErrLib64 anErrLib64
878 upvar $theErrBin32 anErrBin32
879 upvar $theErrBin64 anErrBin64
884 set aVtkIncPath [wokdep:SearchHeader "vtkConfigure.h"]
885 set aVtkVer [wokdep:VtkVersion $aVtkIncPath]
886 if { "$aVtkIncPath" == ""} {
887 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
888 set aVtkPath [wokdep:Preferred "$aPathList" "$::VCVER" "$::ARCH" ]
889 if { "$aVtkPath" != "" && [file exists "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]/vtkConfigure.h"]} {
890 set aVtkVer [wokdep:VtkVersion $aVtkPath]
891 lappend ::CSF_OPT_INC "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]"
892 } else { # try to search in all found paths
894 foreach anIt $aPathList {
895 if { [file exists "$anIt/include/vtk-[wokdep:VtkVersion $anIt]/vtkConfigure.h"] } {
897 set aVtkVer [wokdep:VtkVersion $aVtkPath]
898 lappend ::CSF_OPT_INC "$anIt/include/vtk-[wokdep:VtkVersion $anIt]"
904 # Bad case: we do not found vtkConfigure.h in all paths.
905 if { "$isFound" == "false"} {
906 lappend anErrInc "Error: 'vtkConfigure.h' not found (VTK)"
913 foreach anArchIter {64 32} {
914 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter"]
915 if { "$aVtkLibPath" == "" } {
916 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
917 set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
918 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aPath/lib"]
919 if { "$aVtkLibPath" != "" } {
920 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
922 set aPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aVtkPath/lib"]
923 if { "$aPath" != "" } {
924 set aLibPath $aVtkIncPath
925 lappend ::CSF_OPT_LIB$anArchIter "$aLibPath/lib"
927 # The last chance: search /lib directory in all found paths
928 foreach anIt $aPathList {
929 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$anIt/lib"]
930 if { "$aVtkLibPath" != ""} {
931 lappend ::CSF_OPT_LIB$anArchIter "$anIt/lib"
935 if { "$aVtkLibPath" == "" } {
936 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}vtkCommonCore-${aVtkVer}\.${::SYS_LIB_SUFFIX}' not found (VTK)"
937 if { "$::ARCH" == "$anArchIter" } {
947 if { "$::tcl_platform(platform)" == "windows" } {
948 foreach anArchIter {64 32} {
949 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
950 if { "$aVtkBinPath" == "" } {
951 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
952 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
953 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
955 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
956 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" }
961 # We didn't find preferred binary path => search through inc path or among all available VTK directories
962 if { "$aVtkBinPath" == "" } {
963 # Try to find in lib path
964 set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
965 if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
966 } elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
967 lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
969 lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
978 # Search Qt4 libraries placement
979 proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
980 upvar $theErrInc anErrInc
981 upvar $theErrLib32 anErrLib32
982 upvar $theErrLib64 anErrLib64
983 upvar $theErrBin32 anErrBin32
984 upvar $theErrBin64 anErrBin64
987 set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qmessagebox.h"]
988 if { "$aQMsgBoxHPath" == "" } {
989 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$::ARCH" ]
990 if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qmessagebox.h"] } {
991 lappend ::CSF_OPT_INC "$aPath/include"
992 lappend ::CSF_OPT_INC "$aPath/include/Qt"
993 lappend ::CSF_OPT_INC "$aPath/include/QtGui"
994 lappend ::CSF_OPT_INC "$aPath/include/QtCore"
996 if { [file exists "/usr/include/qt4/QtGui/qmessagebox.h"] } {
997 lappend ::CSF_OPT_INC "/usr/include/qt4"
998 lappend ::CSF_OPT_INC "/usr/include/qt4/Qt"
999 lappend ::CSF_OPT_INC "/usr/include/qt4/QtGui"
1000 lappend ::CSF_OPT_INC "/usr/include/qt4/QtCore"
1002 lappend anErrInc "Error: 'QtGui/qmessagebox.h' not found (Qt4)"
1008 set aQtGuiLibName "QtGui"
1009 if { "$::tcl_platform(platform)" == "windows" } {
1010 set aQtGuiLibName "QtGui4"
1013 foreach anArchIter {64 32} {
1014 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter"]
1015 if { "$aQMsgBoxLibPath" == "" } {
1016 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
1017 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter" "$aPath/lib"]
1018 if { "$aQMsgBoxLibPath" != "" } {
1019 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
1021 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt4)"
1022 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1025 if { "$::tcl_platform(platform)" == "windows" } {
1026 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter"]
1027 if { "$aQMsgBoxDllPath" == "" } {
1028 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
1029 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter" "$aPath/bin"]
1030 if { "$aQMsgBoxDllPath" != "" } {
1031 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
1033 lappend anErrBin$anArchIter "Error: 'QtGui4.dll' not found (Qt4)"
1034 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1043 # Search JDK placement
1044 proc wokdep:SearchJDK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
1045 upvar $theErrInc anErrInc
1046 upvar $theErrLib32 anErrLib32
1047 upvar $theErrLib64 anErrLib64
1048 upvar $theErrBin32 anErrBin32
1049 upvar $theErrBin64 anErrBin64
1052 set aJniHPath [wokdep:SearchHeader "jni.h"]
1053 set aJniMdHPath [wokdep:SearchHeader "jni_md.h"]
1054 if { "$aJniHPath" == "" || "$aJniMdHPath" == "" } {
1055 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$::ARCH" ]
1056 if { "$aPath" != "" && [file exists "$aPath/include/jni.h"] } {
1057 lappend ::CSF_OPT_INC "$aPath/include"
1058 if { "$::tcl_platform(platform)" == "windows" } {
1059 lappend ::CSF_OPT_INC "$aPath/include/win32"
1060 } elseif { [file exists "$aPath/include/linux"] } {
1061 lappend ::CSF_OPT_INC "$aPath/include/linux"
1064 if { [file exists "/System/Library/Frameworks/JavaVM.framework/Home/include/jni.h"] } {
1065 lappend ::CSF_OPT_INC "/System/Library/Frameworks/JavaVM.framework/Home/include"
1067 lappend anErrInc "Error: 'jni.h' or 'jni_md.h' not found (JDK)"
1073 foreach anArchIter {64 32} {
1074 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter"]
1075 if { "$aJavacPath" == "" } {
1076 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$anArchIter" ]
1077 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter" "$aPath/bin"]
1078 if { "$aJavacPath" != "" } {
1079 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
1081 if { "$::ARCH" == "$anArchIter" && [file exists "/System/Library/Frameworks/JavaVM.framework/Home/bin/javac${::SYS_EXE_SUFFIX}"] } {
1082 lappend ::CSF_OPT_BIN$anArchIter "/System/Library/Frameworks/JavaVM.framework/Home/bin"
1084 lappend anErrBin$anArchIter "Error: 'javac${::SYS_EXE_SUFFIX}' not found (JDK)"
1085 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1094 # Search X11 libraries placement
1095 proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
1096 upvar $theErrInc anErrInc
1097 upvar $theErrLib32 anErrLib32
1098 upvar $theErrLib64 anErrLib64
1099 upvar $theErrBin32 anErrBin32
1100 upvar $theErrBin64 anErrBin64
1103 if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
1107 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH"]
1108 if { "$aXmuLibPath" == "" } {
1109 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
1110 if { "$aXmuLibPath" != "" } {
1111 #lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
1113 lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
1121 # Generate (override) custom environment file
1122 proc wokdep:SaveCustom {} {
1123 if { "$::tcl_platform(platform)" == "windows" } {
1124 set aCustomFilePath "./custom.bat"
1125 set aFile [open $aCustomFilePath "w"]
1126 puts $aFile "@echo off"
1127 puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1130 puts $aFile "set VCVER=$::VCVER"
1131 puts $aFile "set ARCH=$::ARCH"
1132 puts $aFile "set VCVARS=$::VCVARS"
1133 puts $aFile "set SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1136 puts $aFile "set \"PRODUCTS_PATH=$::PRODUCTS_PATH\""
1139 puts $aFile "rem Optional 3rd-parties switches"
1140 foreach anEnvIter $::THE_ENV_VARIABLES {
1141 set aName ${anEnvIter}
1142 set aValue [set ::${anEnvIter}]
1143 if { "$aValue" != "" } {
1144 puts $aFile "set ${aName}=$aValue"
1148 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1150 puts $aFile "rem Additional headers search paths"
1151 puts $aFile "set \"CSF_OPT_INC=$aStringInc\""
1153 set aStringLib32 [join $::CSF_OPT_LIB32 $::SYS_PATH_SPLITTER]
1155 puts $aFile "rem Additional libraries (32-bit) search paths"
1156 puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
1158 set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
1160 puts $aFile "rem Additional libraries (64-bit) search paths"
1161 puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
1163 set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
1165 puts $aFile "rem Additional (32-bit) search paths"
1166 puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
1168 set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
1170 puts $aFile "rem Additional (64-bit) search paths"
1171 puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
1175 set aCustomFilePath "./custom.sh"
1176 set aFile [open $aCustomFilePath "w"]
1177 puts $aFile "#!/bin/bash"
1178 puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1181 puts $aFile "export ARCH=$::ARCH"
1182 puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1185 puts $aFile "export PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
1188 puts $aFile "# Optional 3rd-parties switches"
1189 foreach anEnvIter $::THE_ENV_VARIABLES {
1190 set aName ${anEnvIter}
1191 set aValue [set ::${anEnvIter}]
1192 if { "$aValue" != "" } {
1193 puts $aFile "export ${aName}=${aValue}"
1197 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1199 puts $aFile "# Additional headers search paths"
1200 puts $aFile "export CSF_OPT_INC=\"$aStringInc\""
1202 set aStringLib$::ARCH [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
1204 puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
1205 puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib$::ARCH]\""
1207 set aStringBin$::ARCH [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
1209 puts $aFile "# Additional ($::ARCH-bit) search paths"
1210 puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin$::ARCH]\""
1215 puts "Configuration saved to file '$aCustomFilePath'"