3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 if [ -z "$CASROOT" ]; then
20 check_lib_version ${CASROOT}/inc/Standard_Version.hxx
21 if [ "$?" -ne "0" ] ; then
24 ver_major=`grep "#define OCC_VERSION_MAJOR" ${CASROOT}/inc/Standard_Version.hxx | awk '{print $3}'`
25 ver_minor=`grep "#define OCC_VERSION_MINOR" ${CASROOT}/inc/Standard_Version.hxx | awk '{print $3}'`
26 ver_maint=`grep "#define OCC_VERSION_MAINTENANCE" ${CASROOT}/inc/Standard_Version.hxx | awk '{print $3}'`
27 ver="$ver_major.$ver_minor.$ver_maint"
28 if [ "$ver" == "6.2" ] ; then
36 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
37 #$DELIM ${PRODUCT_TYPE} $DELIM
38 export CASROOT=\${INSTALL_ROOT}/${PRODUCT}
39 export PATH=\${CASROOT}/bin:\${PATH}
40 export LD_LIBRARY_PATH=\${CASROOT}/lib:\${CASROOT}/lin/lib:\${LD_LIBRARY_PATH}
41 # Variable for Foundation Classes :
42 export CSF_UnitsLexicon=\${CASROOT}/src/UnitsAPI/Lexi_Expr.dat
43 export CSF_UnitsDefinition=\${CASROOT}/src/UnitsAPI/Units.dat
44 # Variable for DataExchange :
45 export CSF_SHMessage=\${CASROOT}/src/SHMessage
46 export CSF_XSMessage=\${CASROOT}/src/XSMessage
48 export CSF_MDTVFontDirectory=\${CASROOT}/src/FontMFT
49 export CSF_MDTVTexturesDirectory=\${CASROOT}/src/Textures
50 # Activation of OCCT Kernel multithreading :
51 export MMGT_REENTRANT=1
54 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
55 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
58 # looks for the native product and collects it's environment (used by make_env())
61 if [ $? -eq 0 ] ; then
62 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
63 #$DELIM ${PRODUCT_TYPE} $DELIM
64 export CASROOT=${CASROOT}
65 export PATH=\${CASROOT}/bin:\${PATH}
66 export LD_LIBRARY_PATH=\${CASROOT}/lib:\${CASROOT}/lin/lib:\${LD_LIBRARY_PATH}
67 # Variable for Foundation Classes :
68 export CSF_UnitsLexicon=\${CASROOT}/src/UnitsAPI/Lexi_Expr.dat
69 export CSF_UnitsDefinition=\${CASROOT}/src/UnitsAPI/Units.dat
70 # Variable for DataExchange :
71 export CSF_SHMessage=\${CASROOT}/src/SHMessage
72 export CSF_XSMessage=\${CASROOT}/src/XSMessage
74 export CSF_MDTVFontDirectory=\${CASROOT}/src/FontMFT
75 export CSF_MDTVTexturesDirectory=\${CASROOT}/src/Textures
78 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
85 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
91 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
92 source ${INSTALL_WORK}/$SHRC
94 makedir ${PRODUCT_DIR}
97 check_jb tar xfz ${SOURCE_DIR}/CAS-6.2.tar.gz -C ${INSTALL_WORK}
101 if test `uname -m` = "x86_64" ; then
102 flags="$flags CFLAGS=-m64 -D_OCC64"
103 flags="$flags CXXFLAGS=-m64 -D_OCC64"
104 flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
105 flags="$flags --with-xmu-library=/usr/X11R6/lib64"
107 flags="$flags --with-xmu-include=/usr/X11R6/include/X11"
108 flags="$flags --with-xmu-library=/usr/X11R6/lib"
110 flags="$flags LDFLAGS=-lpthread"
111 glincdir="`where_gl_includes`"
112 if [ $? -eq 0 ] ; then flags="$flags --with-gl-include=$glincdir"; fi
113 gllibdir="`where_gl_libs`"
114 if [ $? -eq 0 ] ; then flags="$flags --with-gl-library=$gllibdir"; fi
116 if [ $? -eq 0 ] ; then flags="$flags --with-tcl=$tcldir"; fi
118 if [ $? -eq 0 ] ; then flags="$flags --with-tk=$tkdir"; fi
120 if [ $? -eq 0 ] ; then flags="$flags --with-dps-include=$dpsdir/include --with-dps-library=$dpsdir/lib"; fi
121 flags="$flags --disable-debug --enable-production"
123 export CASROOT=${PRODUCT_WORK}
124 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $flags --prefix=${PRODUCT_DIR}
128 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
131 check_job ${PRODUCT_DIR}/MAKE.LOG make -j4 install-strip
134 cp -fr inc ${PRODUCT_DIR}
135 cp -f config.h ${PRODUCT_DIR}
136 (cd ${PRODUCT_DIR}/inc; ln -fs ../config.h config.h)
138 makedir ${PRODUCT_DIR}/src
139 for d in UnitsAPI SHMessage FontMFT Textures XSMessage DrawResources ; do
140 cp -rp src/${d} ${PRODUCT_DIR}/src
142 (cd ${PRODUCT_DIR}; mkdir -p Linux; cd Linux; ln -fs ../lib lib; ln -fs ../bin bin)
143 (cd ${PRODUCT_DIR}; mkdir -p lin; cd lin; ln -fs ../lib lib; ln -fs ../bin bin)
145 # fix libGL dependencies
146 cd ${PRODUCT_DIR}/lib
147 gllibdir="`where_gl_libs`"
148 if [ "$gllibdir" != "" ] ; then
149 if [ -f ${gllibdir}/libGL.la ] ; then
150 libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
151 if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
152 str_to_replace="${gllibdir}/libGL.la"
155 if [ "$str_to_replace" == "" ] ; then
156 str_to_replace="-L${gllibdir} -lGL"
159 -e "s%[^[:space:]]*libGL.la[[:space:]]%%g" \
160 -e "s%^dependency_libs='\(.*\)%dependency_libs='${str_to_replace} \1%" \
161 libTKOpenGl.la > libTKOpenGl.la.new
162 mv -f libTKOpenGl.la.new libTKOpenGl.la
165 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
166 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
172 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
173 source ${INSTALL_WORK}/$SHRC
175 check_jb tar xfz ${SOURCE_DIR}/CAS-6.2.tar.gz -C ${INSTALL_ROOT}
178 ldir=${PRODUCT_DIR}/lib
179 if [ ! -d $ldir ]; then ldir=${PRODUCT_DIR}/Linux/lib; fi
180 if [ ! -d $ldir ]; then ldir=${PRODUCT_DIR}/lin/lib; fi
182 # 1. set libdir correctly, correct dependencies, set tcldir correctly
183 tcldir=`printenv TCLHOME`
184 for l in X `find . -name "*.la"`; do
185 if [ "$l" != "X" ] ; then
187 libdir=`grep -e "libdir=.*" $l | sed -e "s/libdir=[\'|\"]\(.*\)[\'|\"]/\1/g"`
188 sed -e "s%${libdir}%${ldir}%g" $l > _$l
190 if [ -n "${tcldir}" ] && [ -d "${tcldir}" ] ; then
191 sed -e "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}/lib%g" $l > _$l
198 # 2. fix libGL dependencies
200 gllibdir="`where_gl_libs`"
201 if [ "$gllibdir" != "" ] ; then
202 if [ -f ${gllibdir}/libGL.la ] ; then
203 libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
204 if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
205 str_to_replace="${gllibdir}/libGL.la"
208 if [ "$str_to_replace" == "" ] ; then
209 str_to_replace="-L${gllibdir} -lGL"
212 -e "s%[^[:space:]]*libGL.la[[:space:]]%%g" \
213 -e "s%^dependency_libs='\(.*\)%dependency_libs='${str_to_replace} \1%" \
214 libTKOpenGl.la > libTKOpenGl.la.new
215 mv -f libTKOpenGl.la.new libTKOpenGl.la
222 export INSTALL_WORK=$2;
223 export SOURCE_DIR=$3;
224 export INSTALL_ROOT=$4;
225 export PRODUCT_SEQUENCE=$5;
226 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="cas" ; fi
227 export PRODUCT="CAS-6.2"
228 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
229 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}