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"
46 set HAVE_FREEIMAGE "false"
47 set HAVE_GL2PS "false"
50 set HAVE_GLES2 "false"
51 set HAVE_OPENCL "false"
53 set MACOSX_USE_GLX "false"
57 set CSF_OPT_INC [list]
58 set CSF_OPT_LIB32 [list]
59 set CSF_OPT_LIB64 [list]
60 set CSF_OPT_BIN32 [list]
61 set CSF_OPT_BIN64 [list]
63 if { "$tcl_platform(pointerSize)" == "4" } {
66 if { [info exists ::env(ARCH)] } {
67 set ARCH "$::env(ARCH)"
69 if { [info exists ::env(VCVER)] } {
70 set VCVER "$::env(VCVER)"
72 if { [info exists ::env(VCVARS)] } {
73 set VCVARS "$::env(VCVARS)"
75 if { [info exists ::env(SHORTCUT_HEADERS)] } {
76 set SHORTCUT_HEADERS "$::env(SHORTCUT_HEADERS)"
77 if { $SHORTCUT_HEADERS == "true" } {
78 set SHORTCUT_HEADERS "ShortCut"
81 if { [info exists ::env(HAVE_FREEIMAGE)] } {
82 set HAVE_FREEIMAGE "$::env(HAVE_FREEIMAGE)"
84 if { [info exists ::env(HAVE_GL2PS)] } {
85 set HAVE_GL2PS "$::env(HAVE_GL2PS)"
87 if { [info exists ::env(HAVE_TBB)] } {
88 set HAVE_TBB "$::env(HAVE_TBB)"
90 if { [info exists ::env(HAVE_D3D)] } {
91 set HAVE_D3D "$::env(HAVE_D3D)"
93 if { [info exists ::env(HAVE_GLES2)] } {
94 set HAVE_GLES2 "$::env(HAVE_GLES2)"
96 if { [info exists ::env(HAVE_OPENCL)] } {
97 set HAVE_OPENCL "$::env(HAVE_OPENCL)"
99 if { [info exists ::env(HAVE_VTK)] } {
100 set HAVE_VTK "$::env(HAVE_VTK)"
102 if { [info exists ::env(MACOSX_USE_GLX)] } {
103 set MACOSX_USE_GLX "$::env(MACOSX_USE_GLX)"
105 if { [info exists ::env(CHECK_QT4)] } {
106 set CHECK_QT4 "$::env(CHECK_QT4)"
108 if { [info exists ::env(CHECK_JDK)] } {
109 set CHECK_JDK "$::env(CHECK_JDK)"
111 if { [info exists ::env(PRODUCTS_PATH)] } {
112 set PRODUCTS_PATH "$::env(PRODUCTS_PATH)"
114 if { [info exists ::env(CSF_OPT_INC)] } {
115 set CSF_OPT_INC [split "$::env(CSF_OPT_INC)" $::SYS_PATH_SPLITTER]
117 if { [info exists ::env(CSF_OPT_LIB32)] } {
118 set CSF_OPT_LIB32 [split "$::env(CSF_OPT_LIB32)" $::SYS_PATH_SPLITTER]
120 if { [info exists ::env(CSF_OPT_LIB64)] } {
121 set CSF_OPT_LIB64 [split "$::env(CSF_OPT_LIB64)" $::SYS_PATH_SPLITTER]
123 if { [info exists ::env(CSF_OPT_BIN32)] } {
124 set CSF_OPT_BIN32 [split "$::env(CSF_OPT_BIN32)" $::SYS_PATH_SPLITTER]
126 if { [info exists ::env(CSF_OPT_BIN64)] } {
127 set CSF_OPT_BIN64 [split "$::env(CSF_OPT_BIN64)" $::SYS_PATH_SPLITTER]
130 # Search header file in $::CSF_OPT_INC and standard paths
131 proc wokdep:SearchHeader {theHeader} {
132 # search in custom paths
133 foreach anIncPath $::CSF_OPT_INC {
134 set aPath "${anIncPath}/${theHeader}"
135 if { [file exists "$aPath"] } {
141 set aPath "/usr/include/${theHeader}"
142 if { [file exists "$aPath"] } {
148 # Search library file in $::CSF_OPT_LIB* and standard paths
149 proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} {
150 if { "$theSearchPath" != "" } {
151 set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
152 if { [file exists "$aPath"] } {
159 # search in custom paths
160 foreach aLibPath [set ::CSF_OPT_LIB$theBitness] {
161 set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
162 if { [file exists "$aPath"] } {
168 if { "$::ARCH" == "$theBitness"} {
169 set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}"
170 if { [file exists "$aPath"] } {
176 if { "$::tcl_platform(os)" == "Linux" } {
177 if { "$theBitness" == "64" } {
178 set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so"
179 if { [file exists "$aPath"] } {
183 set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so"
184 if { [file exists "$aPath"] } {
193 # Search file in $::CSF_OPT_BIN* and standard paths
194 proc wokdep:SearchBin {theBin theBitness {theSearchPath ""}} {
195 if { "$theSearchPath" != "" } {
196 set aPath "${theSearchPath}/${theBin}"
197 if { [file exists "$aPath"] } {
204 # search in custom paths
205 foreach aBinPath [set ::CSF_OPT_BIN$theBitness] {
206 set aPath "${aBinPath}/${theBin}"
207 if { [file exists "$aPath"] } {
213 if { "$::ARCH" == "$theBitness"} {
214 set aPath "/usr/bin/${theBin}"
215 if { [file exists "$aPath"] } {
223 # Detect compiler C-runtime version 'vc*' and architecture '32'/'64'
224 # to determine preferred path.
225 proc wokdep:Preferred {theList theCmpl theArch} {
226 if { [llength $theList] == 0 } {
231 foreach aPath $theList {
232 if { [string first "$theCmpl" "$aPath"] != "-1" } {
233 lappend aShortList "$aPath"
237 if { [llength $aShortList] == 0 } {
238 #return [lindex $theList 0]
239 set aShortList $theList
242 set aVeryShortList {}
243 foreach aPath $aShortList {
244 if { [string first "$theArch" "$aPath"] != "-1" } {
245 lappend aVeryShortList "$aPath"
248 if { [llength $aVeryShortList] == 0 } {
249 return [lindex [lsort -decreasing $aShortList] 0]
252 return [lindex [lsort -decreasing $aVeryShortList] 0]
255 # Search Tcl/Tk libraries placement
256 proc wokdep:SearchTclTk {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
257 upvar $theErrInc anErrInc
258 upvar $theErrLib32 anErrLib32
259 upvar $theErrLib64 anErrLib64
260 upvar $theErrBin32 anErrBin32
261 upvar $theErrBin64 anErrBin64
267 set aTclHPath [wokdep:SearchHeader "tcl.h"]
268 set aTkHPath [wokdep:SearchHeader "tk.h"]
269 if { "$aTclHPath" == "" || "$aTkHPath" == "" } {
270 if { [file exists "/usr/include/tcl8.6/tcl.h"]
271 && [file exists "/usr/include/tcl8.6/tk.h" ] } {
272 lappend ::CSF_OPT_INC "/usr/include/tcl8.6"
273 set aTclHPath "/usr/include/tcl8.6/tcl.h"
275 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$::ARCH" ]
276 if { "$aPath" != "" && [file exists "$aPath/include/tcl.h"] && [file exists "$aPath/include/tk.h"] } {
277 lappend ::CSF_OPT_INC "$aPath/include"
278 set aTclHPath "$aPath/include/tcl.h"
280 lappend anErrInc "Error: 'tcl.h' or 'tk.h' not found (Tcl/Tk)"
286 # detect tcl version by parsing header file
288 set fh [open $aTclHPath]
291 regexp {define\s+TCL_MAJOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_maj
292 regexp {define\s+TCL_MINOR_VERSION\s+([0-9]+)} $tcl_h dummy tclver_min
295 if { "$::tcl_platform(platform)" == "windows" } {
296 set aTclLibName "tcl${tclver_maj}${tclver_min}"
297 set aTkLibName "tk${tclver_maj}${tclver_min}"
299 set aTclLibName "tcl${tclver_maj}.${tclver_min}"
300 set aTkLibName "tk${tclver_maj}.${tclver_min}"
303 foreach anArchIter {64 32} {
304 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter"]
305 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter"]
306 if { "$aTclLibPath" == "" || "$aTkLibPath" == "" } {
307 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
308 set aTclLibPath [wokdep:SearchLib "$aTclLibName" "$anArchIter" "$aPath/lib"]
309 set aTkLibPath [wokdep:SearchLib "$aTkLibName" "$anArchIter" "$aPath/lib"]
310 if { "$aTclLibPath" != "" && "$aTkLibPath" != "" } {
311 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
313 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aTclLibName}.${::SYS_LIB_SUFFIX}' or '${::SYS_LIB_PREFIX}${aTkLibName}.${::SYS_LIB_SUFFIX}' not found (Tcl/Tk)"
314 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
318 if { "$::tcl_platform(platform)" == "windows" } {
319 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter"]
320 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter"]
321 if { "$aTclDllPath" == "" || "$aTkDllPath" == "" } {
322 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tcl}*] "$::VCVER" "$anArchIter" ]
323 set aTclDllPath [wokdep:SearchBin "${aTclLibName}.dll" "$anArchIter" "$aPath/bin"]
324 set aTkDllPath [wokdep:SearchBin "${aTkLibName}.dll" "$anArchIter" "$aPath/bin"]
325 if { "$aTclDllPath" != "" && "$aTkDllPath" != "" } {
326 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
328 lappend anErrBin$anArchIter "Error: '${aTclLibName}.dll' or '${aTkLibName}.dll' not found (Tcl/Tk)"
329 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
338 # Search FreeType library placement
339 proc wokdep:SearchFreeType {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
340 upvar $theErrInc anErrInc
341 upvar $theErrLib32 anErrLib32
342 upvar $theErrLib64 anErrLib64
343 upvar $theErrBin32 anErrBin32
344 upvar $theErrBin64 anErrBin64
347 set aFtBuildPath [wokdep:SearchHeader "ft2build.h"]
349 if { "$aFtBuildPath" == "" } {
350 # TODO - use `freetype-config --cflags` instead
351 set aSysFreeType "/usr/include/freetype2"
352 if { [file exists "$aSysFreeType/ft2build.h"] } {
353 lappend ::CSF_OPT_INC "$aSysFreeType"
354 } elseif { [file exists "$aSysFreeType/freetype2/ft2build.h"] } {
355 lappend ::CSF_OPT_INC "$aSysFreeType/freetype2"
357 set aSysFreeType "/usr/X11/include/freetype2"
358 if { [file exists "$aSysFreeType/ft2build.h"] } {
359 lappend ::CSF_OPT_INC "/usr/X11/include"
360 lappend ::CSF_OPT_INC "$aSysFreeType"
362 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$::ARCH" ]
363 if {"$aPath" != ""} {
364 if {[file exists "$aPath/include/ft2build.h"]} {
365 lappend ::CSF_OPT_INC "$aPath/include"
366 } elseif {[file exists "$aPath/include/freetype2/ft2build.h"]} {
367 lappend ::CSF_OPT_INC "$aPath/include/freetype2"
370 lappend anErrInc "Error: 'freetype.h' not found (FreeType2)"
377 # parse 'freetype-config --libs'
379 if { [catch { set aConfLibs [exec freetype-config --libs] } ] == 0 } {
380 foreach aPath [split $aConfLibs " "] {
381 if { [string first "-L" "$aPath"] == 0 } {
382 set aConfLibPath [string range "$aPath" 2 [string length "$aPath"]]
387 foreach anArchIter {64 32} {
388 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter"]
389 if { "$aFtLibPath" == "" } {
390 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
391 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aPath/lib"]
392 if { "$aFtLibPath" != "" } {
393 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
395 set aFtLibPath [wokdep:SearchLib "freetype" "$anArchIter" "$aConfLibPath"]
396 if { "$aFtLibPath" != "" } {
397 lappend ::CSF_OPT_LIB$anArchIter "$aConfLibPath"
399 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freetype.${::SYS_LIB_SUFFIX}' not found (FreeType2)"
400 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
404 if { "$::tcl_platform(platform)" == "windows" } {
405 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter"]
406 if { "$aFtDllPath" == "" } {
407 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freetype}*] "$::VCVER" "$anArchIter" ]
408 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/bin"]
409 if { "$aFtDllPath" != "" } {
410 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
412 set aFtDllPath [wokdep:SearchBin "freetype.dll" "$anArchIter" "$aPath/lib"]
413 if { "$aFtDllPath" != "" } {
414 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
416 lappend anErrBin$anArchIter "Error: 'freetype.dll' not found (FreeType2)"
417 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
427 # Search FreeImage library placement
428 proc wokdep:SearchFreeImage {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
429 upvar $theErrInc anErrInc
430 upvar $theErrLib32 anErrLib32
431 upvar $theErrLib64 anErrLib64
432 upvar $theErrBin32 anErrBin32
433 upvar $theErrBin64 anErrBin64
435 # binary distribution has another layout
436 set aFImageDist "Dist"
439 set aFImageHPath [wokdep:SearchHeader "FreeImage.h"]
440 if { "$aFImageHPath" == "" } {
441 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$::ARCH" ]
442 if { "$aPath" != "" && [file exists "$aPath/include/FreeImage.h"] } {
443 lappend ::CSF_OPT_INC "$aPath/include"
444 } elseif { "$aPath" != "" && [file exists "$aPath/$aFImageDist/FreeImage.h"] } {
445 lappend ::CSF_OPT_INC "$aPath/$aFImageDist"
447 lappend anErrInc "Error: 'FreeImage.h' not found (FreeImage)"
452 foreach anArchIter {64 32} {
453 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter"]
454 if { "$aFImageLibPath" == "" } {
455 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
456 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/lib"]
457 if { "$aFImageLibPath" != "" } {
458 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
460 set aFImageLibPath [wokdep:SearchLib "freeimage" "$anArchIter" "$aPath/$aFImageDist"]
461 if { "$aFImageLibPath" != "" } {
462 lappend ::CSF_OPT_LIB$anArchIter "$aPath/$aFImageDist"
464 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}freeimage.${::SYS_LIB_SUFFIX}' not found (FreeImage)"
465 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
469 if { "$::tcl_platform(platform)" == "windows" } {
470 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter"]
471 if { "$aFImageDllPath" == "" } {
472 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{freeimage}*] "$::VCVER" "$anArchIter" ]
473 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/bin"]
474 if { "$aFImageDllPath" != "" } {
475 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
477 set aFImageDllPath [wokdep:SearchBin "freeimage.dll" "$anArchIter" "$aPath/$aFImageDist"]
478 if { "$aFImageDllPath" != "" } {
479 lappend ::CSF_OPT_BIN$anArchIter "$aPath/$aFImageDist"
481 lappend anErrBin$anArchIter "Error: 'freeimage.dll' is not found (FreeImage)"
482 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
492 # Search GL2PS library placement
493 proc wokdep:SearchGL2PS {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
494 upvar $theErrInc anErrInc
495 upvar $theErrLib32 anErrLib32
496 upvar $theErrLib64 anErrLib64
497 upvar $theErrBin32 anErrBin32
498 upvar $theErrBin64 anErrBin64
501 set aGl2psHPath [wokdep:SearchHeader "gl2ps.h"]
502 if { "$aGl2psHPath" == "" } {
503 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$::ARCH" ]
504 if { "$aPath" != "" && [file exists "$aPath/include/gl2ps.h"] } {
505 lappend ::CSF_OPT_INC "$aPath/include"
507 lappend anErrInc "Error: 'gl2ps.h' not found (GL2PS)"
512 foreach anArchIter {64 32} {
513 set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter"]
514 if { "$aGl2psLibPath" == "" } {
515 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
516 set aGl2psLibPath [wokdep:SearchLib "gl2ps" "$anArchIter" "$aPath/lib"]
517 if { "$aGl2psLibPath" != "" } {
518 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
520 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}gl2ps.${::SYS_LIB_SUFFIX}' not found (GL2PS)"
521 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
524 if { "$::tcl_platform(platform)" == "windows" } {
525 set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter"]
526 if { "$aGl2psDllPath" == "" } {
527 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{gl2ps}*] "$::VCVER" "$anArchIter" ]
528 set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/bin"]
529 if { "$aGl2psDllPath" != "" } {
530 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
532 set aGl2psDllPath [wokdep:SearchBin "gl2ps.dll" "$anArchIter" "$aPath/lib"]
533 if { "$aGl2psDllPath" != "" } {
534 lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib"
536 lappend anErrBin$anArchIter "Error: 'gl2ps.dll' not found (GL2PS)"
537 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
547 # Search TBB library placement
548 proc wokdep:SearchTBB {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
549 upvar $theErrInc anErrInc
550 upvar $theErrLib32 anErrLib32
551 upvar $theErrLib64 anErrLib64
552 upvar $theErrBin32 anErrBin32
553 upvar $theErrBin64 anErrBin64
556 set aTbbHPath [wokdep:SearchHeader "tbb/scalable_allocator.h"]
557 if { "$aTbbHPath" == "" } {
558 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] "$::VCVER" "$::ARCH" ]
559 if { "$aPath" != "" && [file exists "$aPath/include/tbb/scalable_allocator.h"] } {
560 lappend ::CSF_OPT_INC "$aPath/include"
562 lappend anErrInc "Error: 'tbb/scalable_allocator.h' not found (Intel TBB)"
567 foreach anArchIter {64 32} {
569 if { "$anArchIter" == "64"} {
570 set aSubDir "intel64"
573 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter"]
574 if { "$aTbbLibPath" == "" } {
575 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] "$::VCVER" "$anArchIter" ]
576 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir/${::VCVER}"]
577 if { "$aTbbLibPath" == "" } {
578 # Set the path to the TBB library for Linux
579 if { "$::tcl_platform(platform)" != "windows" } {
580 set aSubDir "$aSubDir/cc4.1.0_libc2.4_kernel2.6.16.21"
582 set aTbbLibPath [wokdep:SearchLib "tbb" "$anArchIter" "$aPath/lib/$aSubDir"]
583 if { "$aTbbLibPath" != "" } {
584 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir"
587 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib/$aSubDir/${::VCVER}"
589 if { "$aTbbLibPath" == "" } {
590 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}tbb.${::SYS_LIB_SUFFIX}' not found (Intel TBB)"
591 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
594 if { "$::tcl_platform(platform)" == "windows" } {
595 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter"]
596 if { "$aTbbDllPath" == "" } {
597 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{tbb}*] "$::VCVER" "$anArchIter" ]
598 set aTbbDllPath [wokdep:SearchBin "tbb.dll" "$anArchIter" "$aPath/bin/$aSubDir/${::VCVER}"]
599 if { "$aTbbDllPath" != "" } {
600 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin/$aSubDir/${::VCVER}"
602 lappend anErrBin$anArchIter "Error: 'tbb.dll' not found (Intel TBB)"
603 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
612 # Search OpenCL library placement
613 proc wokdep:SearchOpenCL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
614 upvar $theErrInc anErrInc
615 upvar $theErrLib32 anErrLib32
616 upvar $theErrLib64 anErrLib64
617 upvar $theErrBin32 anErrBin32
618 upvar $theErrBin64 anErrBin64
621 if { "$::tcl_platform(os)" == "Darwin" } {
622 # OpenCL framework available since Mac OS X 16
626 set aCLHPath [wokdep:SearchHeader "CL/cl_gl.h"]
627 if { "$aCLHPath" == "" } {
628 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$::ARCH" ]
629 if { "$aPath" != "" && [file exists "$aPath/include/CL/cl_gl.h"] } {
630 lappend ::CSF_OPT_INC "$aPath/include"
632 lappend anErrInc "Error: 'CL/cl_gl.h' not found (OpenCL)"
637 foreach anArchIter {64 32} {
638 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter"]
639 if { "$aCLLibPath" == "" } {
640 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{OpenCL}*] "$::VCVER" "$anArchIter" ]
641 set aCLLibPath [wokdep:SearchLib "OpenCL" "$anArchIter" "$aPath/lib"]
642 if { "$aCLLibPath" != "" } {
643 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
645 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}OpenCL.${::SYS_LIB_SUFFIX}' not found (OpenCL)"
646 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
654 # Search EGL library placement
655 proc wokdep:SearchEGL {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
656 upvar $theErrInc anErrInc
657 upvar $theErrLib32 anErrLib32
658 upvar $theErrLib64 anErrLib64
659 upvar $theErrBin32 anErrBin32
660 upvar $theErrBin64 anErrBin64
663 set aHeaderPath [wokdep:SearchHeader "EGL/egl.h"]
664 if { "$aHeaderPath" == "" } {
665 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$::ARCH" ]
666 if { "$aPath" == "" || ![file exists "$aPath/include/EGL/egl.h"] } {
667 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
670 if { "$aPath" != "" && [file exists "$aPath/include/EGL/egl.h"] } {
671 lappend ::CSF_OPT_INC "$aPath/include"
673 lappend anErrInc "Error: 'EGL/egl.h' not found (EGL)"
679 if { "$::tcl_platform(platform)" == "windows" } {
681 set aLibName "libEGL"
684 foreach anArchIter {64 32} {
685 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
686 if { "$aLibPath" == "" } {
687 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
688 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
689 if { "$aLibPath" == "" } {
690 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
691 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
694 if { "$aLibPath" != "" } {
695 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
697 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (EGL)"
698 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
702 if { "$::tcl_platform(platform)" == "windows" } {
703 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter"]
704 if { "$aDllPath" == "" } {
705 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
706 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
707 if { "$aDllPath" == "" } {
708 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
709 set aDllPath [wokdep:SearchBin "libEGL.dll" "$anArchIter" "$aPath/bin"]
712 if { "$aDllPath" != "" } {
713 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
715 lappend anErrBin$anArchIter "Error: 'libEGL.dll' not found (EGL)"
716 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
725 # Search OpenGL ES 2.0 library placement
726 proc wokdep:SearchGLES {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
727 upvar $theErrInc anErrInc
728 upvar $theErrLib32 anErrLib32
729 upvar $theErrLib64 anErrLib64
730 upvar $theErrBin32 anErrBin32
731 upvar $theErrBin64 anErrBin64
734 set aHeaderPath [wokdep:SearchHeader "GLES2/gl2.h"]
735 if { "$aHeaderPath" == "" } {
736 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$::ARCH" ]
737 if { "$aPath" == "" || ![file exists "$aPath/include/GLES2/gl2.h"] } {
738 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$::ARCH" ]
741 if { "$aPath" != "" && [file exists "$aPath/include/GLES2/gl2.h"] } {
742 lappend ::CSF_OPT_INC "$aPath/include"
744 lappend anErrInc "Error: 'GLES2/gl2.h' not found (OpenGL ES 2.0)"
749 set aLibName "GLESv2"
750 if { "$::tcl_platform(platform)" == "windows" } {
752 set aLibName "libGLESv2"
755 foreach anArchIter {64 32} {
756 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter"]
757 if { "$aLibPath" == "" } {
758 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{GLES}*] "$::VCVER" "$anArchIter" ]
759 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
760 if { "$aLibPath" == "" } {
761 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
762 set aLibPath [wokdep:SearchLib "$aLibName" "$anArchIter" "$aPath/lib"]
765 if { "$aLibPath" != "" } {
766 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
768 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aLibName}.${::SYS_LIB_SUFFIX}' not found (OpenGL ES 2.0)"
769 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
773 if { "$::tcl_platform(platform)" == "windows" } {
774 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter"]
775 if { "$aDllPath" == "" } {
776 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{EGL}*] "$::VCVER" "$anArchIter" ]
777 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
778 if { "$aDllPath" == "" } {
779 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{angle}*] "$::VCVER" "$anArchIter" ]
780 set aDllPath [wokdep:SearchBin "libGLESv2.dll" "$anArchIter" "$aPath/bin"]
783 if { "$aDllPath" != "" } {
784 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
786 lappend anErrBin$anArchIter "Error: 'libGLESv2.dll' not found (OpenGL ES 2.0)"
787 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
796 # Auxiliary function, gets VTK version to set default search directory
797 proc wokdep:VtkVersion { thePath } {
800 set aVtkRoot [lindex [regexp -all -inline {[0-9.]*} [file tail $thePath]] 0]
801 if { "$aVtkRoot" != "" } {
802 set aVtkRoot [regexp -inline {[0-9]*.[0-9]*} $aVtkRoot]
803 if { "$aVtkRoot" != "" } {
804 set aResult $aVtkRoot
811 # Search VTK library placement
812 proc wokdep:SearchVTK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
813 upvar $theErrInc anErrInc
814 upvar $theErrLib32 anErrLib32
815 upvar $theErrLib64 anErrLib64
816 upvar $theErrBin32 anErrBin32
817 upvar $theErrBin64 anErrBin64
822 set aVtkIncPath [wokdep:SearchHeader "vtkConfigure.h"]
823 set aVtkVer [wokdep:VtkVersion $aVtkIncPath]
824 if { "$aVtkIncPath" == ""} {
825 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
826 set aVtkPath [wokdep:Preferred "$aPathList" "$::VCVER" "$::ARCH" ]
827 if { "$aVtkPath" != "" && [file exists "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]/vtkConfigure.h"]} {
828 set aVtkVer [wokdep:VtkVersion $aVtkPath]
829 lappend ::CSF_OPT_INC "$aVtkPath/include/vtk-[wokdep:VtkVersion $aVtkPath]"
830 } else { # try to search in all found paths
832 foreach anIt $aPathList {
833 if { [file exists "$anIt/include/vtk-[wokdep:VtkVersion $anIt]/vtkConfigure.h"] } {
835 set aVtkVer [wokdep:VtkVersion $aVtkPath]
836 lappend ::CSF_OPT_INC "$anIt/include/vtk-[wokdep:VtkVersion $anIt]"
842 # Bad case: we do not found vtkConfigure.h in all paths.
843 if { "$isFound" == "false"} {
844 lappend anErrInc "Error: 'vtkConfigure.h' not found (VTK)"
851 foreach anArchIter {64 32} {
852 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter"]
853 if { "$aVtkLibPath" == "" } {
854 set aPathList [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*]
855 set aPath [wokdep:Preferred $aPathList "$::VCVER" "$anArchIter" ]
856 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aPath/lib"]
857 if { "$aVtkLibPath" != "" } {
858 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
860 set aPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$aVtkPath/lib"]
861 if { "$aPath" != "" } {
862 set aLibPath $aVtkIncPath
863 lappend ::CSF_OPT_LIB$anArchIter "$aLibPath/lib"
865 # The last chance: search /lib directory in all found paths
866 foreach anIt $aPathList {
867 set aVtkLibPath [wokdep:SearchLib "vtkCommonCore-$aVtkVer" "$anArchIter" "$anIt/lib"]
868 if { "$aVtkLibPath" != ""} {
869 lappend ::CSF_OPT_LIB$anArchIter "$anIt/lib"
873 if { "$aVtkLibPath" == "" } {
874 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}vtkCommonCore-${aVtkVer}\.${::SYS_LIB_SUFFIX}' not found (VTK)"
875 if { "$::ARCH" == "$anArchIter" } {
885 if { "$::tcl_platform(platform)" == "windows" } {
886 foreach anArchIter {64 32} {
887 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter"]
888 if { "$aVtkBinPath" == "" } {
889 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{VTK}*] "$::VCVER" "$anArchIter" ]
890 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/bin"]
891 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
893 set aVtkBinPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aPath/lib"]
894 if { "$aVtkBinPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aPath/lib" }
899 # We didn't find preferred binary path => search through inc path or among all available VTK directories
900 if { "$aVtkBinPath" == "" } {
901 # Try to find in lib path
902 set aPath [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/bin"]
903 if { "$aPath" != "" } { lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/bin"
904 } elseif { [wokdep:SearchBin "vtkCommonCore-${aVtkVer}.dll" "$anArchIter" "$aVtkLibPath/lib"] != "" } {
905 lappend ::CSF_OPT_BIN$anArchIter "$aVtkLibPath/lib"
907 lappend anErrBin$anArchIter "Error: 'vtkCommonCore-${aVtkVer}.dll' not found (VTK)"
916 # Search Qt4 libraries placement
917 proc wokdep:SearchQt4 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
918 upvar $theErrInc anErrInc
919 upvar $theErrLib32 anErrLib32
920 upvar $theErrLib64 anErrLib64
921 upvar $theErrBin32 anErrBin32
922 upvar $theErrBin64 anErrBin64
925 set aQMsgBoxHPath [wokdep:SearchHeader "QtGui/qmessagebox.h"]
926 if { "$aQMsgBoxHPath" == "" } {
927 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$::ARCH" ]
928 if { "$aPath" != "" && [file exists "$aPath/include/QtGui/qmessagebox.h"] } {
929 lappend ::CSF_OPT_INC "$aPath/include"
930 lappend ::CSF_OPT_INC "$aPath/include/Qt"
931 lappend ::CSF_OPT_INC "$aPath/include/QtGui"
932 lappend ::CSF_OPT_INC "$aPath/include/QtCore"
934 if { [file exists "/usr/include/qt4/QtGui/qmessagebox.h"] } {
935 lappend ::CSF_OPT_INC "/usr/include/qt4"
936 lappend ::CSF_OPT_INC "/usr/include/qt4/Qt"
937 lappend ::CSF_OPT_INC "/usr/include/qt4/QtGui"
938 lappend ::CSF_OPT_INC "/usr/include/qt4/QtCore"
940 lappend anErrInc "Error: 'QtGui/qmessagebox.h' not found (Qt4)"
946 set aQtGuiLibName "QtGui"
947 if { "$::tcl_platform(platform)" == "windows" } {
948 set aQtGuiLibName "QtGui4"
951 foreach anArchIter {64 32} {
952 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter"]
953 if { "$aQMsgBoxLibPath" == "" } {
954 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
955 set aQMsgBoxLibPath [wokdep:SearchLib "${aQtGuiLibName}" "$anArchIter" "$aPath/lib"]
956 if { "$aQMsgBoxLibPath" != "" } {
957 lappend ::CSF_OPT_LIB$anArchIter "$aPath/lib"
959 lappend anErrLib$anArchIter "Error: '${::SYS_LIB_PREFIX}${aQtGuiLibName}.${::SYS_LIB_SUFFIX}' not found (Qt4)"
960 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
963 if { "$::tcl_platform(platform)" == "windows" } {
964 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter"]
965 if { "$aQMsgBoxDllPath" == "" } {
966 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{qt4}*] "$::VCVER" "$anArchIter" ]
967 set aQMsgBoxDllPath [wokdep:SearchBin "QtGui4.dll" "$anArchIter" "$aPath/bin"]
968 if { "$aQMsgBoxDllPath" != "" } {
969 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
971 lappend anErrBin$anArchIter "Error: 'QtGui4.dll' not found (Qt4)"
972 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
981 # Search JDK placement
982 proc wokdep:SearchJDK {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
983 upvar $theErrInc anErrInc
984 upvar $theErrLib32 anErrLib32
985 upvar $theErrLib64 anErrLib64
986 upvar $theErrBin32 anErrBin32
987 upvar $theErrBin64 anErrBin64
990 set aJniHPath [wokdep:SearchHeader "jni.h"]
991 set aJniMdHPath [wokdep:SearchHeader "jni_md.h"]
992 if { "$aJniHPath" == "" || "$aJniMdHPath" == "" } {
993 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$::ARCH" ]
994 if { "$aPath" != "" && [file exists "$aPath/include/jni.h"] } {
995 lappend ::CSF_OPT_INC "$aPath/include"
996 if { "$::tcl_platform(platform)" == "windows" } {
997 lappend ::CSF_OPT_INC "$aPath/include/win32"
998 } elseif { [file exists "$aPath/include/linux"] } {
999 lappend ::CSF_OPT_INC "$aPath/include/linux"
1002 if { [file exists "/System/Library/Frameworks/JavaVM.framework/Home/include/jni.h"] } {
1003 lappend ::CSF_OPT_INC "/System/Library/Frameworks/JavaVM.framework/Home/include"
1005 lappend anErrInc "Error: 'jni.h' or 'jni_md.h' not found (JDK)"
1011 foreach anArchIter {64 32} {
1012 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter"]
1013 if { "$aJavacPath" == "" } {
1014 set aPath [wokdep:Preferred [glob -nocomplain -directory "$::PRODUCTS_PATH" -type d *{jdk,java}*] "$::VCVER" "$anArchIter" ]
1015 set aJavacPath [wokdep:SearchBin "javac${::SYS_EXE_SUFFIX}" "$anArchIter" "$aPath/bin"]
1016 if { "$aJavacPath" != "" } {
1017 lappend ::CSF_OPT_BIN$anArchIter "$aPath/bin"
1019 if { "$::ARCH" == "$anArchIter" && [file exists "/System/Library/Frameworks/JavaVM.framework/Home/bin/javac${::SYS_EXE_SUFFIX}"] } {
1020 lappend ::CSF_OPT_BIN$anArchIter "/System/Library/Frameworks/JavaVM.framework/Home/bin"
1022 lappend anErrBin$anArchIter "Error: 'javac${::SYS_EXE_SUFFIX}' not found (JDK)"
1023 if { "$::ARCH" == "$anArchIter"} { set isFound "false" }
1032 # Search X11 libraries placement
1033 proc wokdep:SearchX11 {theErrInc theErrLib32 theErrLib64 theErrBin32 theErrBin64} {
1034 upvar $theErrInc anErrInc
1035 upvar $theErrLib32 anErrLib32
1036 upvar $theErrLib64 anErrLib64
1037 upvar $theErrBin32 anErrBin32
1038 upvar $theErrBin64 anErrBin64
1041 if { "$::tcl_platform(platform)" == "windows" || ( "$::tcl_platform(os)" == "Darwin" && "$::MACOSX_USE_GLX" != "true" ) } {
1045 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH"]
1046 if { "$aXmuLibPath" == "" } {
1047 set aXmuLibPath [wokdep:SearchLib "Xmu" "$::ARCH" "/usr/X11/lib"]
1048 if { "$aXmuLibPath" != "" } {
1049 #lappend ::CSF_OPT_LIB$::ARCH "/usr/X11/lib"
1051 lappend anErrLib$::ARCH "Error: '${::SYS_LIB_PREFIX}Xmu.${::SYS_LIB_SUFFIX}' not found (X11)"
1059 # Generate (override) custom environment file
1060 proc wokdep:SaveCustom {} {
1061 if { "$::tcl_platform(platform)" == "windows" } {
1062 set aCustomFilePath "./custom.bat"
1063 set aFile [open $aCustomFilePath "w"]
1064 puts $aFile "@echo off"
1065 puts $aFile "rem This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1068 puts $aFile "set VCVER=$::VCVER"
1069 puts $aFile "set ARCH=$::ARCH"
1070 puts $aFile "set VCVARS=$::VCVARS"
1071 puts $aFile "set SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1074 puts $aFile "set \"PRODUCTS_PATH=$::PRODUCTS_PATH\""
1077 puts $aFile "rem Optional 3rd-parties switches"
1078 puts $aFile "set HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
1079 puts $aFile "set HAVE_GL2PS=$::HAVE_GL2PS"
1080 puts $aFile "set HAVE_TBB=$::HAVE_TBB"
1081 puts $aFile "set HAVE_GLES2=$::HAVE_GLES2"
1082 puts $aFile "set HAVE_D3D=$::HAVE_D3D"
1083 puts $aFile "set HAVE_OPENCL=$::HAVE_OPENCL"
1084 puts $aFile "set HAVE_VTK=$::HAVE_VTK"
1085 puts $aFile "set CHECK_QT4=$::CHECK_QT4"
1086 puts $aFile "set CHECK_JDK=$::CHECK_JDK"
1088 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1090 puts $aFile "rem Additional headers search paths"
1091 puts $aFile "set \"CSF_OPT_INC=$aStringInc\""
1093 set aStringLib32 [join $::CSF_OPT_LIB32 $::SYS_PATH_SPLITTER]
1095 puts $aFile "rem Additional libraries (32-bit) search paths"
1096 puts $aFile "set \"CSF_OPT_LIB32=$aStringLib32\""
1098 set aStringLib64 [join $::CSF_OPT_LIB64 $::SYS_PATH_SPLITTER]
1100 puts $aFile "rem Additional libraries (64-bit) search paths"
1101 puts $aFile "set \"CSF_OPT_LIB64=$aStringLib64\""
1103 set aStringBin32 [join $::CSF_OPT_BIN32 $::SYS_PATH_SPLITTER]
1105 puts $aFile "rem Additional (32-bit) search paths"
1106 puts $aFile "set \"CSF_OPT_BIN32=$aStringBin32\""
1108 set aStringBin64 [join $::CSF_OPT_BIN64 $::SYS_PATH_SPLITTER]
1110 puts $aFile "rem Additional (64-bit) search paths"
1111 puts $aFile "set \"CSF_OPT_BIN64=$aStringBin64\""
1115 set aCustomFilePath "./custom.sh"
1116 set aFile [open $aCustomFilePath "w"]
1117 puts $aFile "#!/bin/bash"
1118 puts $aFile "# This environment file was generated by wok_depsgui.tcl script at [clock format [clock seconds] -format "%Y.%m.%d %H:%M"]"
1121 puts $aFile "export ARCH=$::ARCH"
1122 puts $aFile "export SHORTCUT_HEADERS=$::SHORTCUT_HEADERS"
1125 puts $aFile "export PRODUCTS_PATH=\"$::PRODUCTS_PATH\""
1128 puts $aFile "# Optional 3rd-parties switches"
1129 puts $aFile "export HAVE_FREEIMAGE=$::HAVE_FREEIMAGE"
1130 puts $aFile "export HAVE_GL2PS=$::HAVE_GL2PS"
1131 puts $aFile "export HAVE_TBB=$::HAVE_TBB"
1132 puts $aFile "export HAVE_GLES2=$::HAVE_GLES2"
1133 puts $aFile "export HAVE_OPENCL=$::HAVE_OPENCL"
1134 puts $aFile "export HAVE_VTK=$::HAVE_VTK"
1135 if { "$::tcl_platform(os)" == "Darwin" } {
1136 puts $aFile "export MACOSX_USE_GLX=$::MACOSX_USE_GLX"
1138 puts $aFile "export CHECK_QT4=$::CHECK_QT4"
1139 puts $aFile "export CHECK_JDK=$::CHECK_JDK"
1141 set aStringInc [join $::CSF_OPT_INC $::SYS_PATH_SPLITTER]
1143 puts $aFile "# Additional headers search paths"
1144 puts $aFile "export CSF_OPT_INC=\"$aStringInc\""
1146 set aStringLib$::ARCH [join [set ::CSF_OPT_LIB$::ARCH] $::SYS_PATH_SPLITTER]
1148 puts $aFile "# Additional libraries ($::ARCH-bit) search paths"
1149 puts $aFile "export CSF_OPT_LIB$::ARCH=\"[set aStringLib$::ARCH]\""
1151 set aStringBin$::ARCH [join [set ::CSF_OPT_BIN$::ARCH] $::SYS_PATH_SPLITTER]
1153 puts $aFile "# Additional ($::ARCH-bit) search paths"
1154 puts $aFile "export CSF_OPT_BIN$::ARCH=\"[set aStringBin$::ARCH]\""
1159 puts "Configuration saved to file '$aCustomFilePath'"