Salome HOME
Remove build directory
[tools/install.git] / config_files / OCCT-6.5.2.sh
index eeab9c074b2eac770bc4fe798950935cf79f3f01..0f017db3604cfc61512647c65515c501d34fc9fc 100755 (executable)
@@ -1,4 +1,4 @@
-!/bin/bash -noprofile
+#!/bin/bash -noprofile
 
 ####################################################################################
 #  File      : OCCT-6.5.2.sh
@@ -98,9 +98,12 @@ cd ${PRODUCT_SRC_DIR}
 
 echo " +++++++++++ configure"
 
-is_mandriva2007=0
+is_mandriva2010=0
 is_mandriva2008=0
 is_debian40=0
+is_debian50=0
+is_debian60=0
+is_centos=0
 
 if [ -e /etc/issue ] ; then
   grep -e "Mandriva Linux release 2008.0" /etc/issue > /dev/null
@@ -109,7 +112,7 @@ fi
 
 if [ -e /etc/issue ] ; then
   grep -e "Mandriva Linux release 2010.0" /etc/issue > /dev/null
-  if [ $? == 0 ] ; then is_mandriva2007=1 ; fi
+  if [ $? == 0 ] ; then is_mandriva2010=1 ; fi
 fi
 
 if [ -e /etc/issue ] ; then
@@ -132,22 +135,27 @@ if [ -e /etc/issue ] ; then
   if [ $? == 0 ] ; then is_debian60=1 ; fi
 fi
 
+if [ -e /etc/issue ] ; then
+grep -e "CentOS release 5.5" /etc/issue > /dev/null
+  if [ $? == 0 ] ; then is_centos=1 ; fi
+fi
 
-if [ $is_mandriva2008 == 1 ] || [ $is_mandriva2010 == 1 ] || [ $is_debian40 == 1 ] || [ $is_debian50 == 1 ] || [ $is_debian60 == 1 ] ; then
+if [ $is_centos == 1 ] || [ $is_mandriva2008 == 1 ] || [ $is_mandriva2010 == 1 ] || [ $is_debian40 == 1 ] || [ $is_debian50 == 1 ] || [ $is_debian60 == 1 ] ; then
 where_xmu_include=/usr/include
 else
 where_xmu_include=/usr/X11R6/include
 fi
 
+flags=""
+
 flags="$flags --with-xmu-include=$where_xmu_include"
 
 if test `uname -m` = "x86_64" ; then
     flags="$flags --with-xmu-library=/usr/lib64"
 else
-    flags="$flags --with-xmu-library=/usr/X11R6/lib"
+    flags="$flags --with-xmu-library=/usr/lib"
 fi
 
-    flags="$flags LDFLAGS=-lpthread"
 glincdir="`where_gl_includes`"
 if [ $? -eq 0 ] ; then flags="$flags --with-gl-include=$glincdir"; fi
 gllibdir="`where_gl_libs`"
@@ -156,14 +164,27 @@ tcldir="`where_tcl`"
 if [ $? -eq 0 ] ; then flags="$flags --with-tcl=$tcldir"; fi
 tkdir="`where_tk`"
 if [ $? -eq 0 ] ; then flags="$flags --with-tk=$tkdir"; fi
-dpsdir="`where_dps`"
-if [ $? -eq 0 ] ; then flags="$flags --with-dps-include=$dpsdir/include --with-dps-library=$dpsdir/lib"; fi
-flags="$flags --disable-wrappers --disable-wok --disable-debug --enable-production"
+
+flags="$flags --with-tbb-include=${TBBHOME}/include" 
+
+if test `uname -m` = "x86_64" ; then
+    flags="$flags --with-tbb-library=${TBBHOME}/lib/intel64/cc4.1.0_libc2.4_kernel2.6.16.21"
+else
+    flags="$flags --with-tbb-library=${TBBHOME}/lib/ia32/cc4.1.0_libc2.4_kernel2.6.16.21"
+fi
+
+flags="$flags --with-freetype=${FREETYPEDIR}"
+flags="$flags --with-ftgl=${FTGLDIR}"
+flags="$flags --with-freeimage=${FREEIMAGEDIR}"
+flags="$flags --with-gl2ps=${GL2PSHOME}"
+
+flags="$flags --disable-debug --enable-production"
 
 export CASROOT=${PRODUCT_SRC_DIR}
 
-echo "`pwd` -> ./configure --prefix=${PRODUCT_DIR} $flags  >> ${PRODUCT_DIR}/CONFIGURE.LOG"
-./configure --prefix=${PRODUCT_DIR} $flags >> ${PRODUCT_DIR}/CONFIGURE.LOG 2> ${INSTALL_WORK}/errlog
+check_job ${PRODUCT_DIR}/BUILDCONFIGURE.LOG ./build_configure
+
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} $flags
 
 # make
 echo " +++++++++++ make"
@@ -234,6 +255,21 @@ if [ ! -d $ldir ]; then ldir=${PRODUCT_DIR}/lin/lib; fi
 cd $ldir
 # 1. set libdir correctly, correct dependencies, set tcldir correctly
 tcldir=`printenv TCLHOME`
+freetypedir=`printenv FREETYPEDIR`
+ftgldir=`printenv FTGLDIR`
+gl2psdir=`printenv GL2PSHOME`
+freeimagedir=`printenv FREEIMAGEDIR`
+tbbbasedir=`printenv TBBHOME`
+
+TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21'
+if test `uname -m` = "x86_64" ; then
+    export TBBMODE="intel64/$TBBKERNEL"
+else
+    export TBBMODE="ia32/$TBBKERNEL"
+fi
+
+tbbdir=${tbbbasedir}/lib/$TBBMODE
+
 for l in X `find . -name "*.la"`; do
     if [ "$l" != "X" ] ; then
        l=`basename $l`
@@ -245,17 +281,43 @@ for l in X `find . -name "*.la"`; do
            mv -f _$l $l
        fi
        chmod a+x $l
+       if [ -n "${freetypedir}" ] && [ -d "${freetypedir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/freetype-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freetypedir}/lib \3%g" \
+               -e 's%\(.*\)\([[:space:]].*libfreetype.la\)\(.*\)%\1 -lfreetype \3%g' $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
+       if [ -n "${ftgldir}" ] && [ -d "${ftgldir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/ftgl-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${ftgldir}/lib \3%g" \
+               -e 's%\(.*\)\([[:space:]].*libftgl.la\)\(.*\)%\1 -lftgl \3%g' $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
+       if [ -n "${gl2psdir}" ] && [ -d "${gl2psdir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/gl2ps-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${gl2psdir}/lib \3%g" $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
+       if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/freeimage-[0-9]\.[0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freeimagedir}/lib \3%g" $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
+       if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/freeimage-[0-9]\.[0-9][0-9]\.[0-9]/lib[[:space:]]\)\(.*\)%\1 -L${freeimagedir}/lib \3%g" $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
+       if [ -n "${tbbdir}" ] && [ -d "${tbbdir}" ] ; then
+           sed -e "s%\(.*\)\([[:space:]].*-L.*/tbb[^[:space:]]*/lib[^[:space:]]*\)\(.*\)%\1 -L${tbbdir} \3%g" $l > _$l
+           mv -f _$l $l
+       fi
+       chmod a+x $l
     fi
 done
 
 # 2. fix libGL dependencies
 
-#if test "$is_mandriva2008" = "1" && test `uname -m` = "x86_64" ; then
-
-#echo " +++++++++++ libGL dependencies are not updated"
-
-#else
-
 cd $ldir
 gllibdir="`where_gl_libs`"
 if [ "$gllibdir" != "" ] ; then
@@ -275,7 +337,6 @@ fi
        libTKOpenGl.la > libTKOpenGl.la.new
         mv -f libTKOpenGl.la.new libTKOpenGl.la
 fi
-#fi
 
 # to generate environment script for sources
 try_preinstalled