Salome HOME
*** empty log message ***
[tools/install.git] / config_files / common.sh
index c8d9a8a88ddc30b18033a9bd9ec565d6a4b4b124..beaff54802a6d67c74eba7334e0448261b98ea3a 100755 (executable)
@@ -6,7 +6,7 @@
 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
 #  Project   : SALOME
 #  Module    : Installation Wizard
-#  Copyright : 2002-2007 CEA
+#  Copyright : 2002-2008 CEA
 #
 #  This script is the part of the SALOME installation procedure.
 #
@@ -16,14 +16,17 @@ export DELIM="------"
 export SHRC="salome.sh"
 export CSHRC="salome.csh"
 
+#####################################################
+# !WARNING! This is current SALOME version number 
+####################################################
+export SALOME_VERSION="5.1.2"
 
-#this function takes several parameters
-#first parameter contains path to module source filder
-#second parameters is value of $VERSION variables form MODULE.sh file
+# Name of the single directory for SALOME modules
+export SDIR_NAME="SALOME_${SALOME_VERSION}"
 
+#this function takes one parameter - path to module source folder
 check_salome_src_version(){
 root_dir=`printenv $1`
-module_version=$2
 
 if [ -n "$root_dir" ]; then
     cfg_file=configure.ac
@@ -32,7 +35,7 @@ if [ -n "$root_dir" ]; then
     fi
     if [ -f ${root_dir}/${cfg_file} ] ; then
        ver=`grep -e "^AC_INIT" ${root_dir}/${cfg_file} | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
-       if [ "$ver" = "${module_version}" ]; then
+       if [ "$ver" = "${SALOME_VERSION}" ]; then
            return 0
        fi
     fi
@@ -113,10 +116,10 @@ if [ $# -eq 4 ] ; then
     product_env=${install_work}/env_${product_name}.sh
     (test -e ${product_env} && rm ${product_env} )
 fi
-### !!! writing salome.sh file !!!  -> define INSTALL_ROOT
+### !!! writing salome.sh file !!!  -> define INST_ROOT
 cat >> ${install_work}/$SHRC <<EOF
 #${DELIM} Setting products installation directory ${DELIM}
-export INSTALL_ROOT=${install_root}
+export INST_ROOT=${install_root}
 
 #${DELIM} Environment switch: 0 for SALOME building, 1 for SALOME launching ${DELIM}
 export ENV_FOR_LAUNCH=1
@@ -672,10 +675,10 @@ if [ "$l" != "X" ] ; then
            sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[^[:space:]/]*/lib% \1${moddir}/lib%g" \
                -e "s%^libdir='[^[:space:]]*${mod}[^[:space:]]*/\(lib.*\)'%libdir='${moddir}/\1'%g" $l > $l"_"
            mv -f $l"_" $l
-           for mod1 in $SALOME_MODULES; do
-               sed     -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod1}[^[:space:]]*/${mod1}_build%%g" $l > $l"_"
-               mv -f $l"_" $l
-           done
+#          for mod1 in $SALOME_MODULES; do
+#              sed     -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod1}[^[:space:]]*/${mod1}_build%%g" $l > $l"_"
+#              mv -f $l"_" $l
+#          done
        fi
     done
 
@@ -689,6 +692,9 @@ if [ "$l" != "X" ] ; then
            -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lin/lib% \1${casdir}%g"   \
            -e "s%[[:space:]]\(-L\)\?[^[:space:]]*\(OCT\|CAS\)[^[:space:]/]*/lib% \1${casdir}%g" $l > $l"_"
        mv -f $l"_" $l
+       sed -e "s%-L[^[:space:]]*OCCT[^[:space:]]*/Linux/lib%-L${casdir}%g" \
+           -e "s%[^[:space:]]*OCCT[^[:space:]]*/lib/%${casdir}/%g" $l > $l"_"
+       mv -f $l"_" $l
     fi
     # 3. process omniORB dependencies
     omnidir=`printenv OMNIORBDIR`/lib/i586_linux_2.0_glibc2.1
@@ -700,13 +706,16 @@ if [ "$l" != "X" ] ; then
        mv -f $l"_" $l
     fi
     # 4. process VTK dependencies
-    if test `uname -m` = "x86_64" ; then
-    vtkdir=`printenv VTKHOME`/lib64/vtk-5.0
-    vtkldir=`printenv VTKHOME`/lib64
+    vtkpath=`printenv VTKHOME`
+    if [ `uname -m` = "x86_64" ] && [ -d ${vtkpath}/lib64 ] ; then
+       LIB_PREFIX=64
+    elif [ -d ${vtkpath}/lib ] ; then
+       LIB_PREFIX=""
     else
-    vtkdir=`printenv VTKHOME`/lib/vtk-5.0
-    vtkldir=`printenv VTKHOME`/lib
+       LIB_PREFIX=64
     fi
+    vtkldir=${vtkpath}/lib${LIB_PREFIX}
+    vtkdir=${vtkldir}/vtk-5.0
     if [ -n "${VTKHOME}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then
        # echo $l $VTKHOME $vtkdir
        sed -e "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g" \
@@ -759,7 +768,7 @@ if [ "$l" != "X" ] ; then
        mv -f $l"_" $l
     fi
     # 11. process PyQt dependencies
-    pyqtdir=`find_in_path qt.so ${LD_LIBRARY_PATH}`
+    pyqtdir=`find_in_path Qt.so ${LD_LIBRARY_PATH}`
     if [ -n "${pyqtdir}" ] && [ -d "${pyqtdir}" ] ; then
        # echo $l $pyqtdir
        sed -e "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" $l > $l"_"
@@ -797,9 +806,10 @@ if [ "$l" != "X" ] ; then
     # 15. process libxml dependencies
     libxmldir=`printenv LIBXML_DIR`/lib
     if [ ! -d ${libxmldir} ] ; then libxmldir=`printenv  LIBXML_DIR`/lib ; fi
-    sed -e "s%\(.*\)\([[:space:]].*/lib/libxml2.la[[:space:]]\)\(.*\)%\1 ${libxmldir}/libxml2.la \3%g" \
-        -e "s%-L[^[:space:]]*libxml2[^[:space:]]*/lib%-L${libxmldir}%g" $l > $l"_"
+    sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9][0-9]/lib% \1${libxmldir}%g" $l > $l"_"
     mv -f $l"_" $l     
+    sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" $l > $l"_"
+    mv -f $l"_" $l
 
     # 16. process metis dependencies
     metisdir=`printenv METISDIR`
@@ -823,12 +833,19 @@ if [ "$l" != "X" ] ; then
        mv -f $l"_" $l
 
     # 19. process graphviz dependencies
-    graphvizdir=`printenv GRAPHVIZHOME`
-    if [ -n "${graphvizdir}" ] && [ -d "${graphvizdir}" ] ; then
-       sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\+\.[0-9]\+\.[0-9]\+% \1${graphvizdir}%g" $l > $l"_"
-       chmod -f --reference=$l $l"_"
-       mv -f $l"_" $l  
-    fi
+    graphvizdir=`printenv GRAPHVIZHOME`/lib
+    if [ ! -d ${graphvizdir} ] ; then graphvizdir=`printenv GRAPHVIZHOME`/lib ; fi
+    sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g" \
+       -e "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" $l > $l"_"
+    chmod -f --reference=$l $l"_"
+    mv -f $l"_" $l     
+   # 20. process QScintilla-2.3 dependencies
+    qscintilladir=`printenv QSCINTILLA_DIR`/lib
+    if [ ! -d ${qscintilladir} ] ; then qscintilladir=`printenv QSCINTILLA_DIR`/lib ; fi
+    sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\.[0-9]/lib% \1${qscintilladir}%g" $l > $l"_"
+    chmod -f --reference=$l $l"_"
+    mv -f $l"_" $l     
 
 fi
 done