From: kgv Date: Mon, 16 Sep 2019 09:11:30 +0000 (+0300) Subject: 0030966: Configuration, genproj.tcl - look for an optional libraries e57 and xerces X-Git-Tag: V7_4_0~12 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=27bd52b5400a453e3f77cfc4b19adb1318633496 0030966: Configuration, genproj.tcl - look for an optional libraries e57 and xerces Added missing HAVE_RAPIDJSON to env.sh. genconf.tcl has been extended with new option HAVE_E57 which enables looking for E57 and xerces libraries. Added new libraries CSF_E57 and CSF_xerces to genproj.tcl. --- diff --git a/adm/genconf.tcl b/adm/genconf.tcl index 6e5aabe057..88b17d46b7 100644 --- a/adm/genconf.tcl +++ b/adm/genconf.tcl @@ -202,6 +202,14 @@ proc wokdep:gui:UpdateList {} { } wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "liblzma" "lzma.h" "$aCheckLib" {"lzma" "xz"} } + if { "$::HAVE_E57" == "true" } { + wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "e57" "e57/E57Foundation.h" "E57RefImpl" {"e57"} + set aCheckLib "xerces-c" + if { "$::tcl_platform(platform)" == "windows" } { + set aCheckLib "xerces-c_3" + } + wokdep:SearchStandardLibrary anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs "xerces-c" "xercesc/sax2/XMLReaderFactory.hpp" "$aCheckLib" {"xerces"} + } if { "$::HAVE_RAPIDJSON" == "true" } { wokdep:SearchRapidJson anIncErrs anLib32Errs anLib64Errs anBin32Errs anBin64Errs } @@ -462,6 +470,9 @@ checkbutton .myFrame.myChecks.myFFmpegCheck -offvalue "false" -onvalue "true ttk::label .myFrame.myChecks.myFFmpegLbl -text "Use FFmpeg" #checkbutton .myFrame.myChecks.myOpenClCheck -offvalue "false" -onvalue "true" -variable HAVE_OPENCL -command wokdep:gui:UpdateList #ttk::label .myFrame.myChecks.myOpenClLbl -text "Use OpenCL" +checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList +ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON" + checkbutton .myFrame.myChecks.myMacGLXCheck -offvalue "false" -onvalue "true" -variable MACOSX_USE_GLX ttk::label .myFrame.myChecks.myMacGLXLbl -text "Use X11 for windows drawing" ttk::label .myFrame.myChecks.myVtkLbl -text "Use VTK" @@ -471,9 +482,8 @@ checkbutton .myFrame.myChecks.myZLibCheck -offvalue "false" -onvalue "true ttk::label .myFrame.myChecks.myZLibLbl -text "Use zlib" checkbutton .myFrame.myChecks.myLzmaCheck -offvalue "false" -onvalue "true" -variable HAVE_LIBLZMA -command wokdep:gui:UpdateList ttk::label .myFrame.myChecks.myLzmaLbl -text "Use liblzma" - -checkbutton .myFrame.myChecks.myRapidJsonCheck -offvalue "false" -onvalue "true" -variable HAVE_RAPIDJSON -command wokdep:gui:UpdateList -ttk::label .myFrame.myChecks.myRapidJsonLbl -text "Use RapidJSON" +checkbutton .myFrame.myChecks.myE57Check -offvalue "false" -onvalue "true" -variable HAVE_E57 -command wokdep:gui:UpdateList +ttk::label .myFrame.myChecks.myE57Lbl -text "Use E57" checkbutton .myFrame.myChecks.myQt4Check -offvalue "false" -onvalue "true" -variable CHECK_QT4 -command wokdep:gui:UpdateList ttk::label .myFrame.myChecks.myQt4Lbl -text "Search Qt4" @@ -594,6 +604,9 @@ grid .myFrame.myChecks.myVtkLbl -row $aCheckRowIter -column 3 -sticky w if { "$::tcl_platform(platform)" == "windows" } { grid .myFrame.myChecks.myD3dCheck -row $aCheckRowIter -column 4 -sticky e grid .myFrame.myChecks.myD3dLbl -row $aCheckRowIter -column 5 -sticky w +} elseif { "$::tcl_platform(os)" == "Darwin" } { + grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 4 -sticky e + grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 5 -sticky w } grid .myFrame.myChecks.myLzmaCheck -row $aCheckRowIter -column 6 -sticky e grid .myFrame.myChecks.myLzmaLbl -row $aCheckRowIter -column 7 -sticky w @@ -601,14 +614,11 @@ grid .myFrame.myChecks.myJDKCheck -row $aCheckRowIter -column 12 -sticky e grid .myFrame.myChecks.myJDKLbl -row $aCheckRowIter -column 13 -sticky w incr aCheckRowIter -if { "$::tcl_platform(os)" == "Darwin" } { - grid .myFrame.myChecks.myMacGLXCheck -row $aCheckRowIter -column 0 -sticky e - grid .myFrame.myChecks.myMacGLXLbl -row $aCheckRowIter -column 1 -sticky w - incr aCheckRowIter -} +grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 0 -sticky e +grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 1 -sticky w +grid .myFrame.myChecks.myE57Check -row $aCheckRowIter -column 6 -sticky e +grid .myFrame.myChecks.myE57Lbl -row $aCheckRowIter -column 7 -sticky w -grid .myFrame.myChecks.myRapidJsonCheck -row $aCheckRowIter -column 6 -sticky e -grid .myFrame.myChecks.myRapidJsonLbl -row $aCheckRowIter -column 7 -sticky w incr aCheckRowIter # Additional headers search paths diff --git a/adm/genconfdeps.tcl b/adm/genconfdeps.tcl index d5005f5542..030879dc15 100644 --- a/adm/genconfdeps.tcl +++ b/adm/genconfdeps.tcl @@ -68,7 +68,7 @@ if { [info exists ::env(SHORTCUT_HEADERS)] } { } # fetch environment variables (e.g. set by custom.sh or custom.bat) and set them as tcl variables with the same name -set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo} +set THE_ENV_VARIABLES {HAVE_FREEIMAGE HAVE_FFMPEG HAVE_TBB HAVE_GLES2 HAVE_D3D HAVE_VTK HAVE_ZLIB HAVE_LIBLZMA HAVE_E57 HAVE_RAPIDJSON HAVE_OPENCL CHECK_QT4 CHECK_JDK MACOSX_USE_GLX HAVE_RelWithDebInfo} foreach anEnvIter $THE_ENV_VARIABLES { set ${anEnvIter} "false" if { [info exists ::env(${anEnvIter})] } { @@ -146,9 +146,12 @@ proc wokdep:SearchHeader {theHeader} { # Search library file in $::CSF_OPT_LIB* and standard paths proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} { if { "$theSearchPath" != "" } { - set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath2 "${theSearchPath}/${::SYS_LIB_PREFIX}${theLib}.a" if { [file exists "$aPath"] } { return "$aPath" + } elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } { + return "$aPath2" } else { return "" } @@ -156,31 +159,42 @@ proc wokdep:SearchLib {theLib theBitness {theSearchPath ""}} { # search in custom paths foreach aLibPath [set ::CSF_OPT_LIB$theBitness] { - set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath2 "${aLibPath}/${::SYS_LIB_PREFIX}${theLib}.a" if { [file exists "$aPath"] } { return "$aPath" + } elseif { "$::tcl_platform(platform)" != "windows" && [file exists "$aPath2"] } { + return "$aPath2" } } # search in system if { "$::ARCH" == "$theBitness"} { - set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.${::SYS_LIB_SUFFIX}" + set aPath2 "/usr/lib/${::SYS_LIB_PREFIX}${theLib}.a" if { [file exists "$aPath"] } { return "$aPath" + } elseif { [file exists "$aPath2"] } { + return "$aPath2" } } - if { "$::tcl_platform(os)" == "Linux" } { if { "$theBitness" == "64" } { - set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so" + set aPath "/usr/lib/x86_64-linux-gnu/lib${theLib}.so" + set aPath2 "/usr/lib/x86_64-linux-gnu/lib${theLib}.a" if { [file exists "$aPath"] } { return "$aPath" + } elseif { [file exists "$aPath2"] } { + return "$aPath2" } } else { - set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so" + set aPath "/usr/lib/i386-linux-gnu/lib${theLib}.so" + set aPath2 "/usr/lib/i386-linux-gnu/lib${theLib}.a" if { [file exists "$aPath"] } { return "$aPath" + } elseif { [file exists "$aPath2"] } { + return "$aPath2" } } } diff --git a/adm/genproj.tcl b/adm/genproj.tcl index 57323a494c..68f9871592 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -1370,6 +1370,11 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } { if { "$::HAVE_LIBLZMA" == "true" } { set aLibsMap(CSF_LIBLZMA) "liblzma" } + if { "$::HAVE_E57" == "true" && "$theOS" != "wnt" } { + # exclude wnt, as there are different pragma lib depending on debug/release + set aLibsMap(CSF_E57) "E57RefImpl" + set aLibsMap(CSF_xerces) "xerces-c" + } if { "$theOS" == "wnt" } { # WinAPI libraries diff --git a/adm/templates/env.bat b/adm/templates/env.bat index a478670b0c..ec330d4c08 100644 --- a/adm/templates/env.bat +++ b/adm/templates/env.bat @@ -25,6 +25,7 @@ set "HAVE_D3D=false" set "HAVE_ZLIB=false" set "HAVE_LIBLZMA=false" set "HAVE_RAPIDJSON=false" +set "HAVE_E57=false" set "CSF_OPT_INC=" set "CSF_OPT_LIB32=" set "CSF_OPT_LIB64=" @@ -165,6 +166,7 @@ if ["%HAVE_D3D%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DH if ["%HAVE_ZLIB%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_ZLIB" & set "CSF_DEFINES=HAVE_ZLIB;%CSF_DEFINES%" if ["%HAVE_LIBLZMA%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_LIBLZMA" & set "CSF_DEFINES=HAVE_LIBLZMA;%CSF_DEFINES%" if ["%HAVE_RAPIDJSON%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_RAPIDJSON" & set "CSF_DEFINES=HAVE_RAPIDJSON;%CSF_DEFINES%" +if ["%HAVE_E57%"] == ["true"] set "PRODUCTS_DEFINES=%PRODUCTS_DEFINES% -DHAVE_E57" & set "CSF_DEFINES=HAVE_E57;%CSF_DEFINES%" rem Eliminate VS warning if ["%CSF_DEFINES%"] == [""] set "CSF_DEFINES=;" diff --git a/adm/templates/env.sh b/adm/templates/env.sh index 22672b97be..b761534b18 100644 --- a/adm/templates/env.sh +++ b/adm/templates/env.sh @@ -16,6 +16,7 @@ export HAVE_GLES2="false"; export HAVE_ZLIB="false"; export HAVE_LIBLZMA="false"; export HAVE_RAPIDJSON="false"; +export HAVE_E57="false"; export MACOSX_USE_GLX="false"; export CSF_OPT_INC="" export CSF_OPT_LIB32="" @@ -105,6 +106,7 @@ if [ "$HAVE_VTK" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -D if [ "$HAVE_ZLIB" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_ZLIB"; fi if [ "$HAVE_LIBLZMA" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_LIBLZMA"; fi if [ "$HAVE_RAPIDJSON" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_RAPIDJSON"; fi +if [ "$HAVE_E57" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_E57"; fi # Option to compile OCCT with X11 libs on Mac OS X if [ "$MACOSX_USE_GLX" == "true" ]; then export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"; fi