0027253: Boolean cut produces invalid result shape
[occt.git] / adm / templates / env.sh
CommitLineData
910970ab 1#!/bin/bash
2
3# go to the script directory
4aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD";
5
910970ab 6# Reset values
e31a8e52 7export CASROOT="__CASROOT__"
910970ab 8export CASDEB=""
c7d774c5 9export TARGET="";
910970ab 10export HAVE_TBB="false";
11export HAVE_OPENCL="false";
12export HAVE_FREEIMAGE="false";
13export HAVE_GL2PS="false";
14export HAVE_VTK="false";
15export MACOSX_USE_GLX="false";
16export CSF_OPT_INC=""
17export CSF_OPT_LIB32=""
18export CSF_OPT_LIB64=""
19export CSF_OPT_BIN32=""
20export CSF_OPT_BIN64=""
21
22# ----- Set local settings -----
e31a8e52 23if [ "${CASROOT}" != "" ] && [ -e "${CASROOT}/custom.sh" ]; then source "${CASROOT}/custom.sh"; fi
910970ab 24if [ -e "${aScriptPath}/custom.sh" ]; then source "${aScriptPath}/custom.sh"; fi
25
e31a8e52 26if [ "${CASROOT}" != "" ] && [ -d "${aScriptPath}/${CASROOT}" ]; then
27 export CASROOT="${aScriptPath}/${CASROOT}"
28fi
29if [ "${CASROOT}" == "" ]; then
30 export CASROOT="${aScriptPath}"
31fi
32
910970ab 33# Read script arguments
34shopt -s nocasematch
c7d774c5 35for i in $*
36do
37 if [ "$i" == "d" ] || [ "$i" == "debug" ]; then
38 export CASDEB="d"
316d77d9 39 elif [ "$i" == "i" ] || [ "$i" == "relwithdeb" ]; then
40 export CASDEB="i"
c7d774c5 41 elif [ "$i" == "cbp" ]; then
42 export TARGET="cbp";
43 elif [ "$i" == "xcd" ] || [ "$i" == "xcode" ]; then
44 export TARGET="xcd";
45 fi
46done
910970ab 47shopt -u nocasematch
48
49# ----- Setup Environment Variables -----
50anArch=`uname -m`
51if [ "$anArch" != "x86_64" ] && [ "$anArch" != "ia64" ]; then
52 export ARCH="32";
53else
54 export ARCH="64";
55fi
56
57aSystem=`uname -s`
58if [ "$aSystem" == "Darwin" ]; then
59 export WOKSTATION="mac";
60 export ARCH="64";
61else
62 export WOKSTATION="lin";
63fi
64
65export CASBIN=""
66if [ "${TARGET}" == "cbp" ]; then
67 export CASBIN="${WOKSTATION}/cbp"
68elif [ "${TARGET}" == "xcd" ]; then
69 export CASBIN="adm/mac/xcd/build"
70fi
71
72export CSF_OPT_INC="${CSF_OPT_INC}:${CASROOT}/inc"
73
74if [ "${TARGET}" == "cbp" ]; then
75 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libd"
76 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libd"
77 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/lib"
78 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/lib"
316d77d9 79 export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/libi"
80 export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/libi"
910970ab 81elif [ "${TARGET}" == "xcd" ]; then
82 export CSF_OPT_LIB32D="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Debug"
83 export CSF_OPT_LIB64D="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Debug"
84 export CSF_OPT_LIB32="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/Release"
85 export CSF_OPT_LIB64="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/Release"
316d77d9 86 export CSF_OPT_LIB32I="${CSF_OPT_LIB32}:${CASROOT}/${CASBIN}/RelWithDebInfo"
87 export CSF_OPT_LIB64I="${CSF_OPT_LIB64}:${CASROOT}/${CASBIN}/RelWithDebInfo"
910970ab 88fi
89
90export CSF_OPT_CMPL=""
91
92# Optiona 3rd-parties should be enabled by HAVE macros
93if [ "$HAVE_TBB" == "true" ]; then
94 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_TBB"
95fi
96if [ "$HAVE_OPENCL" == "true" ]; then
97 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_OPENCL"
98fi
99if [ "$HAVE_FREEIMAGE" == "true" ]; then
100 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_FREEIMAGE"
101fi
102if [ "$HAVE_GL2PS" == "true" ]; then
103 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_GL2PS"
104fi
105if [ "$HAVE_VTK" == "true" ]; then
106 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DHAVE_VTK"
107fi
108# Option to compile OCCT with X11 libs on Mac OS X
109if [ "$MACOSX_USE_GLX" == "true" ]; then
110 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -DMACOSX_USE_GLX"
111fi
112
113# To split string into array
114aDelimBack=$IFS
115IFS=":"
116
117# 3rd-parties additional include paths
118set -- "$CSF_OPT_INC"
119declare -a aPartiesIncs=($*)
120for anItem in ${aPartiesIncs[*]}
121do
122 export CSF_OPT_CMPL="${CSF_OPT_CMPL} -I${anItem}";
123done
124
125# Append 3rd-parties to LD_LIBRARY_PATH
126if [ "$ARCH" == "32" ]; then
127 set -- "$CSF_OPT_LIB32"
128 declare -a aPartiesLibs=($*)
129 set -- "$CSF_OPT_LIB32D"
130 declare -a aPartiesLibsDeb=($*)
316d77d9 131 set -- "$CSF_OPT_LIB32I"
132 declare -a aPartiesLibsRelWithDebInfo=($*)
910970ab 133else
134 set -- "$CSF_OPT_LIB64"
135 declare -a aPartiesLibs=($*)
136 set -- "$CSF_OPT_LIB64D"
137 declare -a aPartiesLibsDeb=($*)
316d77d9 138 set -- "$CSF_OPT_LIB64I"
139 declare -a aPartiesLibsRelWithDebInfo=($*)
910970ab 140fi
141
142# Turn back value
143IFS=$aDelimBack
144
145OPT_LINKER_OPTIONS_DEB=""
146for anItem in ${aPartiesLibsDeb[*]}
147do
148 OPT_LINKER_OPTIONS_DEB="${OPT_LINKER_OPTIONS_DEB} -L${anItem}"
149done
150
316d77d9 151OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO=""
152for anItem in ${aPartiesLibsRelWithDebInfo[*]}
153do
154 OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO="${OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO} -L${anItem}"
155done
156
910970ab 157OPT_LINKER_OPTIONS=""
158for anItem in ${aPartiesLibs[*]}
159do
160 if [ "${LD_LIBRARY_PATH}" == "" ]; then
161 export LD_LIBRARY_PATH="${anItem}"
162 else
163 export LD_LIBRARY_PATH="${anItem}:${LD_LIBRARY_PATH}"
164 fi
165 OPT_LINKER_OPTIONS="${OPT_LINKER_OPTIONS} -L${anItem}"
166done
167
168if [ "$ARCH" == "64" ]; then
169 export CSF_OPT_LNK64="$OPT_LINKER_OPTIONS"
170 export CSF_OPT_LNK64D="$OPT_LINKER_OPTIONS_DEB"
316d77d9 171 export CSF_OPT_LNK64I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
910970ab 172else
173 export CSF_OPT_LNK32="$OPT_LINKER_OPTIONS"
174 export CSF_OPT_LNK32D="$OPT_LINKER_OPTIONS_DEB"
316d77d9 175 export CSF_OPT_LNK32I="$OPT_LINKER_OPTIONS_REL_WITH_DEB_INFO"
910970ab 176fi
177
178
179BIN_PATH="${CASBIN}/bin${CASDEB}"
180LIBS_PATH="${CASBIN}/lib${CASDEB}"
181if [ "${TARGET}" == "xcd" ]; then
182 [[ "${CASDEB}" == "d" ]] && BIN_PATH="${CASBIN}/Debug" || BIN_PATH="${CASBIN}/Release"
183 LIBS_PATH="$BIN_PATH"
184fi
185
186export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
187export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${LD_LIBRARY_PATH}"
188if [ "$WOKSTATION" == "mac" ]; then
189 export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${DYLD_LIBRARY_PATH}"
190fi
191
192# Set envoronment variables used by OCCT
193export CSF_LANGUAGE="us"
194export MMGT_CLEAR="1"
195export CSF_EXCEPTION_PROMPT="1"
196export CSF_SHMessage="${CASROOT}/src/SHMessage"
197export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures"
198export CSF_ShadersDirectory="${CASROOT}/src/Shaders"
199export CSF_XSMessage="${CASROOT}/src/XSMessage"
200export CSF_TObjMessage="${CASROOT}/src/TObj"
201export CSF_StandardDefaults="${CASROOT}/src/StdResource"
202export CSF_PluginDefaults="${CASROOT}/src/StdResource"
203export CSF_XCAFDefaults="${CASROOT}/src/StdResource"
204export CSF_TObjDefaults="${CASROOT}/src/StdResource"
205export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource"
206export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat"
207export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat"
208export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource"
209export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource"
210export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource"
211export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt"
212
213# Draw Harness special stuff
214if [ -e "${CASROOT}/src/DrawResources" ]; then
215 export DRAWHOME="${CASROOT}/src/DrawResources"
216 export CSF_DrawPluginDefaults="${DRAWHOME}"
217fi
218if [ -e "${aScriptPath}/src/DrawResourcesProducts" ]; then
219 export CSF_DrawPluginProductsDefaults="${aScriptPath}/src/DrawResourcesProducts"
220fi