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"] } {
125 # Search library file in $::CSF_OPT_LIB* and standard paths
126 proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
127 if { "$theSearchPath" != "" } {
128 set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
129 if { [file exists "$aPath"] } {
136 # search in custom paths
137 foreach aLibPath [set ::CSF_OPT_LIB$theBitness] {
138 set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
139 if { [file exists "$aPath"] } {
145 if { "$::ARCH" == "$theBitness"} {
146 set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
147 if { [file exists "$aPath"] } {
153 if { "$::tcl_platform(os)" == "Linux" } {
154 if { "$theBitness" == "64" } {
155 set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
156 if { [file exists "$aPath"] } {
160 set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
161 if { [file exists "$aPath"] } {
170 # Search file in $::CSF_OPT_BIN* and standard paths
171 proc wokdep:SearchBin {theBin theBitness {theSearchPath ""}} {
172 if { "$theSearchPath" != "" } {
173 set aPath "${theSearchPath}/${theBin}"
174 if { [file exists "$aPath"] } {
181 # search in custom paths
182 foreach aBinPath [set ::CSF_OPT_BIN$theBitness] {
183 set aPath "${aBinPath}/${theBin}"
184 if { [file exists "$aPath"] } {
190 if { "$::ARCH" == "$theBitness"} {
191 set aPath "/usr/bin/${theBin}"
192 if { [file exists "$aPath"] } {
200 # Detect compiler C-runtime version 'vc*' and architecture '32'/'64'
201 # to determine preferred path.
202 proc wokdep:Preferred {theList theCmpl theArch} {
203 if { [llength $theList] == 0 } {
207 # keep only two first digits in "vc141"
208 if { ! [regexp {^vc[0-9][0-9]} $theCmpl aCmpl] } {
213 foreach aPath $theList {
214 if { [string first "$aCmpl" "$aPath"] != "-1" } {
215 lappend aShortList "$aPath"
219 if { [llength $aShortList] == 0 } {
220 #return [lindex $theList 0]
221 set aShortList $theList
224 set aVeryShortList {}
225 foreach aPath $aShortList {
226 if { [string first "$theArch" "$aPath"] != "-1" } {
227 lappend aVeryShortList "$aPath"
230 if { [llength $aVeryShortList] == 0 } {
231 return [lindex [lsort -decreasing $aShortList] 0]
234 return [lindex [lsort -decreasing $aVeryShortList] 0]
237 # Search library placement
238 proc wokdep:SearchStandardLibrary {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64 theName theCheckHeader theCheckLib theCheckFolders} {
239 upvar $theErrInc anErrInc
240 upvar $theErrLib32 anErrLib32
241 upvar $theErrLib64 anErrLib64
242 upvar $theErrBin32 anErrBin32
243 upvar $theErrBin64 anErrBin64
246 set aHeaderPath [wokdep:SearchHeader "$theCheckHeader"]
247 if { "$aHeaderPath" == "" } {
249 foreach aFolderIter $theCheckFolders {
250 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$::ARCH" ]
251 if { "$aPath" != "" && [file exists "$aPath/include/$theCheckHeader"] } {
252 lappend ::CSF_OPT_INC "$aPath/include"
258 lappend anErrInc "Error: '$theCheckHeader' not found ($theName)"
263 foreach anArchIter {64 32} {
264 set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter"]
265 if { "$aLibPath" == "" } {
267 foreach aFolderIter $theCheckFolders {
268 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
269 set aLibPath [wokdep:SearchLib "$theCheckLib" "$anArchIter" "$aPath/lib"]
270 if { "$aLibPath" != "" } {
271 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
272 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
278 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}$theCheckLib.${::SYS_LIB_SUFFIX}' not found ($theName)"
279 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
283 if { "$::tcl_platform(platform)" == "windows" } {
284 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter"]
285 if { "$aDllPath" == "" } {
287 foreach aFolderIter $theCheckFolders {
288 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{$aFolderIter}*] "$::VCVER" "$anArchIter" ]
289 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/bin"]
290 if { "$aDllPath" != "" } {
291 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
295 set aDllPath [wokdep:SearchBin "$theCheckLib.dll" "$anArchIter" "$aPath/lib"]
296 if { "$aDllPath" != "" } {
297 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
304 lappend anErrBin$anArchIter "Error: '$theCheckLib.dll' not found ($theName)"
305 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
314 # Search Tcl/Tk libraries placement
315 proc wokdep:SearchTclTk {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
316 upvar $theErrInc anErrInc
317 upvar $theErrLib32 anErrLib32
318 upvar $theErrLib64 anErrLib64
319 upvar $theErrBin32 anErrBin32
320 upvar $theErrBin64 anErrBin64
326 set aTclHPath [wokdep:SearchHeader "tcl.h"]
327 set aTkHPath [wokdep:SearchHeader "tk.h"]
328 if { "$aTclHPath" == "" || "$aTkHPath" == "" } {
329 if { [file exists "/usr/include/tcl8.6/tcl.h"]
330 && [file exists "/usr/include/tcl8.6/tk.h" ] } {
331 lappend ::CSF_OPT_INC "/usr/include/tcl8.6"
332 set aTclHPath "/usr/include/tcl8.6/tcl.h"
334 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$::ARCH" ]
335 if { "$aPath" != "" && [file exists "$aPath/include/tcl.h"] && [file exists "$aPath/include/tk.h"] } {
336 lappend ::CSF_OPT_INC "$aPath/include"
337 set aTclHPath "$aPath/include/tcl.h"
339 lappend anErrInc "Error: 'tcl.h' or 'tk.h' not found (Tcl/Tk)"
345 # detect tcl version by parsing header file
347 set fh [open $aTclHPath]
350 regexp {define\s+TCL_MAJOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_maj
351 regexp {define\s+TCL_MINOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_min
354 if { "$::tcl_platform(platform)" == "windows" } {
355 set aTclLibName "tcl${tclver_maj}${tclver_min}"
356 set aTkLibName "tk${tclver_maj}${tclver_min}"
358 set aTclLibName "tcl${tclver_maj}.${tclver_min}"
359 set aTkLibName "tk${tclver_maj}.${tclver_min}"
362 foreach anArchIter {64 32} {
363 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter"]
364 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter"]
365 if { "$aTclLibPath" == "" || "$aTkLibPath" == "" } {
366 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
367 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter" "$aPath/lib"]
368 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter" "$aPath/lib"]
369 if { "$aTclLibPath" != "" && "$aTkLibPath" != "" } {
370 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
372 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aTclLibName}.${::SYS_LIB_SUFFIX}' or '${::SYS_LIB_PREFIX}${aTkLibName}.${::SYS_LIB_SUFFIX}' not found (Tcl/Tk)"
373 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
377 if { "$::tcl_platform(platform)" == "windows" } {
378 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter"]
379 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter"]
380 if { "$aTclDllPath" == "" || "$aTkDllPath" == "" } {
381 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
382 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter" "$aPath/bin"]
383 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter" "$aPath/bin"]
384 if { "$aTclDllPath" != "" && "$aTkDllPath" != "" } {
385 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
387 lappend anErrBin$anArchIter "Error: '${aTclLibName}.dll' or '${aTkLibName}.dll' not found (Tcl/Tk)"
388 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
397 # Search FreeType library placement
398 proc wokdep:SearchFreeType {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
399 upvar $theErrInc anErrInc
400 upvar $theErrLib32 anErrLib32
401 upvar $theErrLib64 anErrLib64
402 upvar $theErrBin32 anErrBin32
403 upvar $theErrBin64 anErrBin64
406 set aFtBuildPath [wokdep:SearchHeader "ft2build.h"]
408 if { "$aFtBuildPath" == "" } {
409 # TODO - use `freetype-config --cflags` instead
410 set aSysFreeType "/usr/include/freetype2"
411 if { [file exists "$aSysFreeType/ft2build.h"] } {
412 lappend ::CSF_OPT_INC "$aSysFreeType"
413 } elseif { [file exists "$aSysFreeType/freetype2/ft2build.h"] } {
414 lappend ::CSF_OPT_INC "$aSysFreeType/freetype2"
416 set aSysFreeType "/usr/X11/include/freetype2"
417 if { [file exists "$aSysFreeType/ft2build.h"] } {
418 lappend ::CSF_OPT_INC "/usr/X11/include"
419 lappend ::CSF_OPT_INC "$aSysFreeType"
421 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$::ARCH" ]
422 if {"$aPath" != ""} {
423 if {[file exists "$aPath/include/ft2build.h"]} {
424 lappend ::CSF_OPT_INC "$aPath/include"
425 } elseif {[file exists "$aPath/include/freetype2/ft2build.h"]} {
426 lappend ::CSF_OPT_INC "$aPath/include/freetype2"
429 lappend anErrInc "Error: 'freetype.h' not found (FreeType2)"
436 # parse 'freetype-config --libs'
438 if { [catch { set aConfLibs [exec freetype-config --libs] } ] == 0 } {
439 foreach aPath [split $aConfLibs " "] {
440 if { [string first "-L" "$aPath"] == 0 } {
441 set aConfLibPath [string range "$aPath" 2 [string length "$aPath"]]
446 foreach anArchIter {64 32} {
447 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter"]
448 if { "$aFtLibPath" == "" } {
449 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
450 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aPath/lib"]
451 if { "$aFtLibPath" != "" } {
452 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
454 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aConfLibPath"]
455 if { "$aFtLibPath" != "" } {
456 lappend ::CSF_OPT_LIB$anArchIter "$aConfLibPath"
458 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freetype.${::SYS_LIB_SUFFIX}' not found (FreeType2)"
459 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
463 if { "$::tcl_platform(platform)" == "windows" } {
464 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter"]
465 if { "$aFtDllPath" == "" } {
466 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
467 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/bin"]
468 if { "$aFtDllPath" != "" } {
469 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
471 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/lib"]
472 if { "$aFtDllPath" != "" } {
473 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
475 lappend anErrBin$anArchIter "Error: 'freetype.dll' not found (FreeType2)"
476 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
486 # Search FreeImage library placement
487 proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
488 upvar $theErrInc anErrInc
489 upvar $theErrLib32 anErrLib32
490 upvar $theErrLib64 anErrLib64
491 upvar $theErrBin32 anErrBin32
492 upvar $theErrBin64 anErrBin64
494 # binary distribution has another layout
495 set aFImageDist "Dist"
498 set aFImageHPath [wokdep:SearchHeader "FreeImage.h"]
499 if { "$aFImageHPath" == "" } {
500 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$::ARCH" ]
501 if { "$aPath" != "" && [file exists "$aPath/include/FreeImage.h"] } {
502 lappend ::CSF_OPT_INC "$aPath/include"
503 } elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] } {
504 lappend ::CSF_OPT_INC "$aPath/$aFImageDist"
506 lappend anErrInc "Error: 'FreeImage.h' not found (FreeImage)"
511 foreach anArchIter {64 32} {
512 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"]
513 if { "$aFImageLibPath" == "" } {
514 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
515 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/lib"]
516 if { "$aFImageLibPath" != "" } {
517 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
519 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"]
520 if { "$aFImageLibPath" != "" } {
521 lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImageDist"
523 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' not found (FreeImage)"
524 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
528 if { "$::tcl_platform(platform)" == "windows" } {
529 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"]
530 if { "$aFImageDllPath" == "" } {
531 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
532 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/bin"]
533 if { "$aFImageDllPath" != "" } {
534 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
536 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/$aFImageDist"]
537 if { "$aFImageDllPath" != "" } {
538 lappend ::CSF_OPT_BIN$anArchIter "$aPath/$aFImageDist"
540 lappend anErrBin$anArchIter "Error: 'freeimage.dll' is not found (FreeImage)"
541 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
551 # Search FFmpeg framework placement
552 proc wokdep:SearchFFmpeg {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
553 upvar $theErrInc anErrInc
554 upvar $theErrLib32 anErrLib32
555 upvar $theErrLib64 anErrLib64
556 upvar $theErrBin32 anErrBin32
557 upvar $theErrBin64 anErrBin64
560 set aFFmpegHPath [wokdep:SearchHeader "libavutil/avutil.h"]
561 if { "$aFFmpegHPath" == "" } {
562 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$::ARCH" ]
563 if { "$aPath" != "" && [file exists "$aPath/include/libavutil/avutil.h"] } {
564 lappend ::CSF_OPT_INC "$aPath/include"
566 lappend anErrInc "Error: 'libavutil/avutil.h' not found (FFmpeg)"
571 foreach anArchIter {64 32} {
572 set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter"]
573 if { "$aFFmpegLibPath" == "" } {
574 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{ffmpeg}*] "$::VCVER" "$anArchIter" ]
575 set aFFmpegLibPath [wokdep:SearchLib "avutil" "$anArchIter" "$aPath/lib"]
576 if { "$aFFmpegLibPath" != "" } {
577 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
578 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
580 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}avutil.${::SYS_LIB_SUFFIX}' not found (FFmpeg)"
581 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
589 # Search TBB library placement
590 proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
591 upvar $theErrInc anErrInc
592 upvar $theErrLib32 anErrLib32
593 upvar $theErrLib64 anErrLib64
594 upvar $theErrBin32 anErrBin32
595 upvar $theErrBin64 anErrBin64
597 # keep only two first digits in "vc141"
598 if { ! [regexp {^vc[0-9][0-9]} ${::VCVER} aVcLib] } {
599 set aVcLib ${::VCVER}
603 set aTbbHPath [wokdep:SearchHeader "tbb/scalable_allocator.h"]
604 if { "$aTbbHPath" == "" } {
605 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] "$::VCVER" "$::ARCH" ]
606 if { "$aPath" != "" && [file exists "$aPath/include/tbb/scalable_allocator.h"] } {
607 lappend ::CSF_OPT_INC "$aPath/include"
609 lappend anErrInc "Error: 'tbb/scalable_allocator.h' not found (Intel TBB)"
614 foreach anArchIter {64 32} {
616 if { "$anArchIter" == "64"} {
617 set aSubDir "intel64"
620 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter"]
621 if { "$aTbbLibPath" == "" } {
622 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
623 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir/$aVcLib"]
624 if { "$aTbbLibPath" == "" } {
625 # Set the path to the TBB library for Linux
626 if { "$::tcl_platform(platform)" != "windows" } {
627 set aSubDir "$aSubDir/cc4.1.0_libc2.4_kernel2.6.16.21"
629 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir"]
630 if { "$aTbbLibPath" != "" } {
631 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir"
634 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir/$aVcLib"
636 if { "$aTbbLibPath" == "" } {
637 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}tbb.${::SYS_LIB_SUFFIX}' not found (Intel TBB)"
638 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
641 if { "$::tcl_platform(platform)" == "windows" } {
642 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
643 if { "$aTbbDllPath" == "" } {
644 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] $aVcLib "$anArchIter" ]
645 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/$aVcLib"]
646 if { "$aTbbDllPath" != "" } {
647 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/$aVcLib"
649 lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
650 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
659 # Search OpenCL library placement
660 proc wokdep:SearchOpenCL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
661 upvar $theErrInc anErrInc
662 upvar $theErrLib32 anErrLib32
663 upvar $theErrLib64 anErrLib64
664 upvar $theErrBin32 anErrBin32
665 upvar $theErrBin64 anErrBin64
668 if { "$::tcl_platform(os)" == "Darwin" } {
669 # OpenCL framework available since Mac OS X 16
673 set aCLHPath [wokdep:SearchHeader "CL/cl_gl.h"]
674 if { "$aCLHPath" == "" } {
675 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$::ARCH" ]
676 if { "$aPath" != "" && [file exists "$aPath/include/CL/cl_gl.h"] } {
677 lappend ::CSF_OPT_INC "$aPath/include"
679 lappend anErrInc "Error: 'CL/cl_gl.h' not found (OpenCL)"
684 foreach anArchIter {64 32} {
685 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter"]
686 if { "$aCLLibPath" == "" } {
687 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$anArchIter" ]
688 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter" "$aPath/lib"]
689 if { "$aCLLibPath" != "" } {
690 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
692 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}OpenCL.${::SYS_LIB_SUFFIX}' not found (OpenCL)"
693 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
701 # Search EGL library placement
702 proc wokdep:SearchEGL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
703 upvar $theErrInc anErrInc
704 upvar $theErrLib32 anErrLib32
705 upvar $theErrLib64 anErrLib64
706 upvar $theErrBin32 anErrBin32
707 upvar $theErrBin64 anErrBin64
710 set aHeaderPath [wokdep:SearchHeader "EGL/egl.h"]
711 if { "$aHeaderPath" == "" } {
712 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$::ARCH" ]
713 if { "$aPath" == "" || ![file exists "$aPath/include/EGL/egl.h"] } {
714 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
717 if { "$aPath" != "" && [file exists "$aPath/include/EGL/egl.h"] } {
718 lappend ::CSF_OPT_INC "$aPath/include"
720 lappend anErrInc "Error: 'EGL/egl.h' not found (EGL)"
726 if { "$::tcl_platform(platform)" == "windows" } {
728 set aLibName "libEGL"
731 foreach anArchIter {64 32} {
732 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
733 if { "$aLibPath" == "" } {
734 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
735 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
736 if { "$aLibPath" == "" } {
737 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
738 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
741 if { "$aLibPath" != "" } {
742 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
744 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (EGL)"
745 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
749 if { "$::tcl_platform(platform)" == "windows" } {
750 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter"]
751 if { "$aDllPath" == "" } {
752 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
753 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
754 if { "$aDllPath" == "" } {
755 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
756 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
759 if { "$aDllPath" != "" } {
760 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
762 lappend anErrBin$anArchIter "Error: 'libEGL.dll' not found (EGL)"
763 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
772 # Search OpenGL ES 2.0 library placement
773 proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
774 upvar $theErrInc anErrInc
775 upvar $theErrLib32 anErrLib32
776 upvar $theErrLib64 anErrLib64
777 upvar $theErrBin32 anErrBin32
778 upvar $theErrBin64 anErrBin64
781 set aHeaderPath [wokdep:SearchHeader "GLES2/gl2.h"]
782 if { "$aHeaderPath" == "" } {
783 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$::ARCH" ]
784 if { "$aPath" == "" || ![file exists "$aPath/include/GLES2/gl2.h"] } {
785 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
788 if { "$aPath" != "" && [file exists "$aPath/include/GLES2/gl2.h"] } {
789 lappend ::CSF_OPT_INC "$aPath/include"
791 lappend anErrInc "Error: 'GLES2/gl2.h' not found (OpenGL ES 2.0)"
796 set aLibName "GLESv2"
797 if { "$::tcl_platform(platform)" == "windows" } {
799 set aLibName "libGLESv2"
802 foreach anArchIter {64 32} {
803 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
804 if { "$aLibPath" == "" } {
805 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$anArchIter" ]
806 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
807 if { "$aLibPath" == "" } {
808 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
809 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
812 if { "$aLibPath" != "" } {
813 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
815 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (OpenGL ES 2.0)"
816 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
820 if { "$::tcl_platform(platform)" == "windows" } {
821 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter"]
822 if { "$aDllPath" == "" } {
823 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
824 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
825 if { "$aDllPath" == "" } {
826 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
827 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
830 if { "$aDllPath" != "" } {
831 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
833 lappend anErrBin$anArchIter "Error: 'libGLESv2.dll' not found (OpenGL ES 2.0)"
834 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
843 # Auxiliary function, gets VTK version to set default search directory
844 proc wokdep:VtkVersion { thePath } {
847 set aVtkRoot [lindex [regexp -all -inline {[0-9.]*} [file tail $thePath]] 0]
848 if { "$aVtkRoot" != "" } {
849 set aVtkRoot [regexp -inline {[0-9]*.[0-9]*} $aVtkRoot]
850 if { "$aVtkRoot" != "" } {
851 set aResult $aVtkRoot
858 # Search VTK library placement
859 proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
860 upvar $theErrInc anErrInc
861 upvar $theErrLib32 anErrLib32
862 upvar $theErrLib64 anErrLib64
863 upvar $theErrBin32 anErrBin32
864 upvar $theErrBin64 anErrBin64
869 set aVtkIncPath [wokdep:SearchHeader "vtkConfigure.h"]
870 set aVtkVer [wokdep:VtkVersion $aVtkIncPath]
871 if { "$aVtkIncPath" == ""} {
872 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
873 set aVtkPath [wokdep:Preferred "$aPathList" "$::VCVER" "$::ARCH" ]
874 if { "$aVtkPath" != "" && [file exists "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]/vtkConfigure.h"]} {
875 set aVtkVer [wokdep:VtkVersion $aVtkPath]
876 lappend ::CSF_OPT_INC "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]"
877 } else { # try to search in all found paths
879 foreach anIt $aPathList {
880 if { [file exists "$anIt/include/vtk-[wokdep:VtkVersion $anIt]/vtkConfigure.h"] } {
882 set aVtkVer [wokdep:VtkVersion $aVtkPath]
883 lappend ::CSF_OPT_INC "$anIt/include/vtk-[wokdep:VtkVersion $anIt]"
889 # Bad case: we do not found vtkConfigure.h in all paths.
890 if { "$isFound" == "false"} {
891 lappend anErrInc "Error: 'vtkConfigure.h' not found (VTK)"
898 foreach anArchIter {64 32} {
899 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter"]
900 if { "$aVtkLibPath" == "" } {
901 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
902 set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
903 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aPath/lib"]
904 if { "$aVtkLibPath" != "" } {
905 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
907 set aPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aVtkPath/lib"]
908 if { "$aPath" != "" } {
909 set aLibPath $aVtkIncPath
910 lappend ::CSF_OPT_LIB$anArchIter "$aLibPath/lib"
912 # The last chance: search /lib directory in all found paths
913 foreach anIt $aPathList {
914 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$anIt/lib"]
915 if { "$aVtkLibPath" != ""} {
916 lappend ::CSF_OPT_LIB$anArchIter "$anIt/lib"
920 if { "$aVtkLibPath" == "" } {
921 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}vtkCommonCore-${aVtkVer}\.${::SYS_LIB_SUFFIX}' not found (VTK)"
922 if { "$::ARCH" == "$anArchIter" } {
932 if { "$::tcl_platform(platform)" == "windows" } {
933 foreach anArchIter {64 32} {
934 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
935 if { "$aVtkBinPath" == "" } {
936 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
937 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
938 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
940 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
941 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" }
946 # We didn't find preferred binary path => search through inc path or among all available VTK directories
947 if { "$aVtkBinPath" == "" } {
948 # Try to find in lib path
949 set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
950 if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
951 } elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
952 lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
954 lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
963 # Search Qt4 libraries placement
964 proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
965 upvar $theErrInc anErrInc
966 upvar $theErrLib32 anErrLib32
967 upvar $theErrLib64 anErrLib64
968 upvar $theErrBin32 anErrBin32
969 upvar $theErrBin64 anErrBin64
972 set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qmessagebox.h"]
973 if { "$aQMsgBoxHPath" == "" } {
974 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$::ARCH" ]
975 if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qmessagebox.h"] } {
976 lappend ::CSF_OPT_INC "$aPath/include"
977 lappend ::CSF_OPT_INC "$aPath/include/Qt"
978 lappend ::CSF_OPT_INC "$aPath/include/QtGui"
979 lappend ::CSF_OPT_INC "$aPath/include/QtCore"
981 if { [file exists "/usr/include/qt4/QtGui/qmessagebox.h"] } {
982 lappend ::CSF_OPT_INC "/usr/include/qt4"
983 lappend ::CSF_OPT_INC "/usr/include/qt4/Qt"
984 lappend ::CSF_OPT_INC "/usr/include/qt4/QtGui"
985 lappend ::CSF_OPT_INC "/usr/include/qt4/QtCore"
987 lappend anErrInc "Error: 'QtGui/qmessagebox.h' not found (Qt4)"
993 set aQtGuiLibName "QtGui"
994 if { "$::tcl_platform(platform)" == "windows" } {
995 set aQtGuiLibName "QtGui4"
998 foreach anArchIter {64 32} {
999 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter"]
1000 if { "$aQMsgBoxLibPath" == "" } {
1001 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
1002 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter" "$aPath/lib"]
1003 if { "$aQMsgBoxLibPath" != "" } {
1004 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
1006 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt4)"
1007 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1010 if { "$::tcl_platform(platform)" == "windows" } {
1011 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter"]
1012 if { "$aQMsgBoxDllPath" == "" } {
1013 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
1014 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter" "$aPath/bin"]
1015 if { "$aQMsgBoxDllPath" != "" } {
1016 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
1018 lappend anErrBin$anArchIter "Error: 'QtGui4.dll' not found (Qt4)"
1019 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1028 # Search JDK placement
1029 proc wokdep:SearchJDK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
1030 upvar $theErrInc anErrInc
1031 upvar $theErrLib32 anErrLib32
1032 upvar $theErrLib64 anErrLib64
1033 upvar $theErrBin32 anErrBin32
1034 upvar $theErrBin64 anErrBin64
1037 set aJniHPath [wokdep:SearchHeader "jni.h"]
1038 set aJniMdHPath [wokdep:SearchHeader "jni_md.h"]
1039 if { "$aJniHPath" == "" || "$aJniMdHPath" == "" } {
1040 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$::ARCH" ]
1041 if { "$aPath" != "" && [file exists "$aPath/include/jni.h"] } {
1042 lappend ::CSF_OPT_INC "$aPath/include"
1043 if { "$::tcl_platform(platform)" == "windows" } {
1044 lappend ::CSF_OPT_INC "$aPath/include/win32"
1045 } elseif { [file exists "$aPath/include/linux"] } {
1046 lappend ::CSF_OPT_INC "$aPath/include/linux"
1049 if { [file exists "/System/Library/Frameworks/JavaVM.framework/Home/include/jni.h"] } {
1050 lappend ::CSF_OPT_INC "/System/Library/Frameworks/JavaVM.framework/Home/include"
1052 lappend anErrInc "Error: 'jni.h' or 'jni_md.h' not found (JDK)"
1058 foreach anArchIter {64 32} {
1059 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter"]
1060 if { "$aJavacPath" == "" } {
1061 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$anArchIter" ]
1062 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter" "$aPath/bin"]
1063 if { "$aJavacPath" != "" } {
1064 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
1066 if { "$::ARCH" == "$anArchIter" && [file exists "/System/Library/Frameworks/JavaVM.framework/Home/bin/javac${::SYS_EXE_SUFFIX}"] } {
1067 lappend ::CSF_OPT_BIN$anArchIter "/System/Library/Frameworks/JavaVM.framework/Home/bin"
1069 lappend anErrBin$anArchIter "Error: 'javac${::SYS_EXE_SUFFIX}' not found (JDK)"
1070 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1079 # Search X11 libraries placement
1080 proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
1081 upvar $theErrInc anErrInc
1082 upvar $theErrLib32 anErrLib32
1083 upvar $theErrLib64 anErrLib64
1084 upvar $theErrBin32 anErrBin32
1085 upvar $theErrBin64 anErrBin64
1088 if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
1092 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH"]
1093 if { "$aXmuLibPath" == "" } {
1094 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
1095 if { "$aXmuLibPath" != "" } {
1096 #lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
1098 lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
1106 # Generate (override) custom environment file
1107 proc wokdep:SaveCustom {} {
1108 if { "$::tcl_platform(platform)" == "windows" } {
1109 set aCustomFilePath "./custom.bat"
1110 set aFile [open $aCustomFilePath "w"]
1111 puts $aFile "@echo off"
1112 puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1115 puts $aFile "set VCVER=$::VCVER"
1116 puts $aFile "set ARCH=$::ARCH"
1117 puts $aFile "set VCVARS=$::VCVARS"
1118 puts $aFile "set SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1121 puts $aFile "set \"PRODUCTS_PATH=$::PRODUCTS_PATH\""
1124 puts $aFile "rem Optional 3rd-parties switches"
1125 foreach anEnvIter $::THE_ENV_VARIABLES {
1126 set aName ${anEnvIter}
1127 set aValue [set ::${anEnvIter}]
1128 if { "$aValue" != "" } {
1129 puts $aFile "set ${aName}=$aValue"
1133 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1135 puts $aFile "rem Additional headers search paths"
1136 puts $aFile "set \"CSF_OPT_INC=$aStringInc\""
1138 set aStringLib32 [join $::CSF_OPT_LIB32 $::SYS_PATH_SPLITTER]
1140 puts $aFile "rem Additional libraries (32-bit) search paths"
1141 puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
1143 set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
1145 puts $aFile "rem Additional libraries (64-bit) search paths"
1146 puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
1148 set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
1150 puts $aFile "rem Additional (32-bit) search paths"
1151 puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
1153 set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
1155 puts $aFile "rem Additional (64-bit) search paths"
1156 puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
1160 set aCustomFilePath "./custom.sh"
1161 set aFile [open $aCustomFilePath "w"]
1162 puts $aFile "#!/bin/bash"
1163 puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1166 puts $aFile "export ARCH=$::ARCH"
1167 puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1170 puts $aFile "export PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
1173 puts $aFile "# Optional 3rd-parties switches"
1174 foreach anEnvIter $::THE_ENV_VARIABLES {
1175 set aName ${anEnvIter}
1176 set aValue [set ::${anEnvIter}]
1177 if { "$aValue" != "" } {
1178 puts $aFile "export ${aName}=${aValue}"
1182 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1184 puts $aFile "# Additional headers search paths"
1185 puts $aFile "export CSF_OPT_INC=\"$aStringInc\""
1187 set aStringLib$::ARCH [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
1189 puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
1190 puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib$::ARCH]\""
1192 set aStringBin$::ARCH [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
1194 puts $aFile "# Additional ($::ARCH-bit) search paths"
1195 puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin$::ARCH]\""
1200 puts "Configuration saved to file '$aCustomFilePath'"