]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Prepare SALOME 7.3.0
authorvsr <vsr@opencascade.com>
Fri, 29 Nov 2013 15:16:01 +0000 (15:16 +0000)
committervsr <vsr@opencascade.com>
Fri, 29 Nov 2013 15:16:01 +0000 (15:16 +0000)
14 files changed:
config_files/build.csh
config_files/build.sh
config_files/common.sh
config_files/qt.sh
config_files/qwt.sh
config_files/release_notes.sh
config_files/remove_tmp.sh
config_files/scotch.sh
config_files/sip.sh
config_files/start_salome.sh
config_files/swig.sh
config_files/tbb.sh
config_files/tcltk.sh
config_files/xdata.sh

index f4a689ea2aa903796d91324520da3ab80eb0e7b0..2a3536df8a4f42bfbcaedd330056987cac685c2f 100755 (executable)
@@ -338,13 +338,12 @@ foreach module (${modules})
                if ( $inst_with_gui == 0 ) then
                    set myconf_keys="${myconf_keys} --without-gui"
                endif
-               if ( "${module}" == "MED" && ($?METISDIR) && ($?SCOTCHDIR) ) then
-                   set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}"
+               if ( "${module}" == "MED" && ($?METIS_ROOT_DIR) && ($?SCOTCH_ROOT_DIR) ) then
+                   set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METIS_ROOT_DIR} --with-scotch=${SCOTCH_ROOT_DIR}"
                endif
-               if ( "${module}" == "NETGENPLUGIN" && ($?NETGENHOME) ) then
-                   set myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}"
+               if ( "${module}" == "NETGENPLUGIN" && ($?NETGEN_ROOT_DIR) ) then
+                   set myconf_keys="${myconf_keys} --with-netgen=${NETGEN_ROOT_DIR}"
                endif
-               
                if ( "${module}" == "PARAVIS" )  then
                    cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log
                else
index 8b6a636d3afa3b5ba27a7795bd8c8089eda92581..547d5b45b5805f61a7c88022b2d2c9817092f428 100755 (executable)
@@ -116,7 +116,7 @@ b_params=""
 for arg in $@ ; do
     known=0
     for m in $modules ; do
-       if [ "$m" == "$arg" ] ; then known=1 ; break ; fi
+       if [ "$m" = "$arg" ] ; then known=1 ; break ; fi
     done
     if [ $known -eq 0 ] ; then
        echo
@@ -135,7 +135,7 @@ if [ "${params}" != "" ] ; then
     for module in ${modules} ; do
        found=0
        for p in $params ; do
-           if [ "$p" == "$module" ] ; then found=1 ; break ; fi
+           if [ "$p" = "$module" ] ; then found=1 ; break ; fi
        done
        if [ $found -eq 1 ] ; then 
            xparams="$xparams $module"
@@ -178,12 +178,12 @@ LOG_DIR=${BUILD_DIR}/LOGS
 #########################################################
 # define installation prefix
 #########################################################
-if [ "$prefix" == "" ] ; then
+if [ "$prefix" = "" ] ; then
     echo
     echo '!!! Warning !!! Installation directory is not set.'
     echo "All the modules will be installed to the ${BUILD_DIR}${def_install_dir}"
 else
-    if [ "`echo $prefix | grep -E '^/'`" == "" ] ; then
+    if [ "`echo $prefix | grep -E '^/'`" = "" ] ; then
        prefix=${BUILD_DIR}/$prefix
        echo
        echo '!!! Warning !!! Relative prefix is used.'
@@ -244,7 +244,7 @@ for module in ${modules}; do
            if [ ! -e ${module_src}/build_configure ] && [ "${module}" != "PARAVIS" ] ; then
                echo '!!! Warning !!! Cannot find build_configure script in '${module_src}'.'
            else
-               if [ "${module}" == "PARAVIS" ]; then
+               if [ "${module}" = "PARAVIS" ]; then
                    echo '!!! Warning !!! build_configure step is not executed for '${module}'.'                    
                else
                    #########################################################
@@ -312,7 +312,7 @@ for module in ${modules}; do
            vx=`grep -e "^AC_INIT" ${module_src}/configure.ac | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
        elif [ -e ${module_src}/configure.in.base ] ; then
            vx=`grep -e "^VERSION=" ${module_src}/configure.in.base | awk -F= '{ if (NF>1) print $NF; }' | tr -d '[:space:]'`
-           if [ "$vx" == "" ] ; then
+           if [ "$vx" = "" ] ; then
                vx=`grep -e "^AC_INIT" ${module_src}/configure.in.base | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
            fi
        elif [ -e ${module_src}/CMakeLists.txt ] ; then
@@ -324,7 +324,7 @@ for module in ${modules}; do
        if [ "$vx" != "" ] ; then
            vx="_$vx"
        fi
-       if [ "$prefix" == "" ] ; then
+       if [ "$prefix" = "" ] ; then
            px=${BUILD_DIR}${def_install_dir}/${module}${vx}
        else
            px=$prefix/${module}${vx}
@@ -347,14 +347,14 @@ for module in ${modules}; do
                if [ $inst_with_gui -eq 0 ] ; then
                    myconf_keys="${myconf_keys} --without-gui"
                fi
-               if [ "${module}" == "MED" ] && [ "${METISDIR}" != "" ] && [ "${SCOTCHDIR}" != "" ] ; then
-                   myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}"
+               if [ "${module}" = "MED" ] && [ "${METIS_ROOT_DIR}" != "" ] && [ "${SCOTCH_ROOT_DIR}" != "" ] ; then
+                   myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METIS_ROOT_DIR} --with-scotch=${SCOTCH_ROOT_DIR}"
                fi
-               if [ "${module}" == "NETGENPLUGIN" ] && [ "$NETGENHOME" != "" ] ; then
-                   myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}"
+               if [ "${module}" = "NETGENPLUGIN" ] && [ "$NETGEN_ROOT_DIR" != "" ] ; then
+                   myconf_keys="${myconf_keys} --with-netgen=${NETGEN_ROOT_DIR}"
                fi
 
-               if [ "${module}" == "PARAVIS" ] ; then
+               if [ "${module}" = "PARAVIS" ] ; then
                    cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log
                else
                    ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log
@@ -382,13 +382,13 @@ for module in ${modules}; do
         #########################################################
         # then make
         #########################################################
-       if [ "${module}" == "PARAVIS" ] ; then
+       if [ "${module}" = "PARAVIS" ] ; then
            VTK_AUTOLOAD_PATH_BACKUP=${VTK_AUTOLOAD_PATH}
            test "${VTK_AUTOLOAD_PATH}" != "" && unset VTK_AUTOLOAD_PATH
        fi
        make >& ${LOG_DIR}/make_${module}.log
        sts=$?
-       if [ "${module}" == "PARAVIS" ] ; then
+       if [ "${module}" = "PARAVIS" ] ; then
            test "${VTK_AUTOLOAD_PATH_BACKUP}" != "" && export VTK_AUTOLOAD_PATH=${VTK_AUTOLOAD_PATH_BACKUP}
        fi
         #########################################################
@@ -431,7 +431,7 @@ for module in ${modules}; do
         #########################################################
         # perform make if -i or -p flags are given
         #########################################################
-       if [ $is_install -eq 1 ] && [ $sts -eq 0 ] || [ "${module}" == "KERNEL" ] ; then
+       if [ $is_install -eq 1 ] && [ $sts -eq 0 ] || [ "${module}" = "KERNEL" ] ; then
            #########################################################
            # deleting build directory if -d flag is given
            #########################################################
index f02f37a3274f08b556a9195680f524248aeb10b2..00e801c2c76b76f01db09b645cabdad2fbcd1334 100755 (executable)
@@ -28,9 +28,9 @@ export SDIR_NAME="SALOME_${SALOME_VERSION}"
 
 #this function takes one parameter - path to module source folder
 check_salome_src_version(){
-root_dir=`printenv $1`
+root_dir=${!1}
 
-if [ -n "$root_dir" ]; then
+if [ -n "${root_dir}" ]; then
     cfg_file=configure.ac
     if [ ! -f ${root_dir}/${cfg_file} ] ; then
        cfg_file=configure.in.base
@@ -47,7 +47,7 @@ if [ -n "$root_dir" ]; then
            ver=`grep -e "^AC_INIT" ${root_dir}/${cfg_file} | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"`
        fi
 
-       if [ "$ver" = "${SALOME_VERSION}" ]; then
+       if [ "${ver}" = "${SALOME_VERSION}" ]; then
            return 0
        fi
     fi
@@ -65,28 +65,28 @@ check_job()
   out=$1
   shift
   errfile=/tmp/errlog
-  if [ -n "$INSTALL_WORK" ] ; then errfile=$INSTALL_WORK/errlog; fi
+  if [ -n "${INSTALL_WORK}" ] ; then errfile=${INSTALL_WORK}/errlog; fi
   cmd="`pwd` -> $*"
-  if [ "$out" != "1" ] ; then cmd="$cmd >> $out" ; fi
-  echo -e $cmd
-  if [ "$out" != "1" ] ; then
-      $* >> $out 2>$errfile
+  if [ "${out}" != "1" ] ; then cmd="${cmd} >> ${out}" ; fi
+  echo -e ${cmd}
+  if [ "${out}" != "1" ] ; then
+      $* >> ${out} 2>${errfile}
   else
       $*
   fi
   if [ "$?" -ne "0" ] ; then
-    if [ $out != "1" ] ; then
-      cat $out
-      cat $errfile >&2
-      cat $errfile >> $out
+    if [ ${out} != "1" ] ; then
+      cat ${out}
+      cat ${errfile} >&2
+      cat ${errfile} >> ${out}
     fi
     # VSR : 10/11/05: disable answer mode ==>
     #echo -n " " >&2
     #echo -e "NOT DONE !!! => $*"
     #echo -n "Would you like to continue to install this product: (Y,N) [Y] : "
     #read rep;
-    #rep=`echo $rep  | tr "[A-Z]" "[a-z]"`
-    #if test -z $rep || [ $rep = "y" ] ; then
+    #rep=`echo ${rep}  | tr "[A-Z]" "[a-z]"`
+    #if test -z ${rep} || [ ${rep} = "y" ] ; then
     #  return 1
     #fi
     # VSR : 10/11/05: disable answer mode <==
@@ -116,11 +116,11 @@ make_env()
 install_root=$1;  shift
 install_work=$1; 
 
-for i in $SHRC $CSHRC ; do
-    if [ -e ${install_work}/$i ]; then
-       rm ${install_work}/$i
+for i in ${SHRC} ${CSHRC} ; do
+    if [ -e ${install_work}/${i} ]; then
+       rm ${install_work}/${i}
     fi
-    touch ${install_work}/$i
+    touch ${install_work}/${i}
 done
 
 if [ $# -eq 4 ] ; then
@@ -129,7 +129,7 @@ if [ $# -eq 4 ] ; then
     (test -e ${product_env} && rm ${product_env} )
 fi
 ### !!! writing salome.sh file !!!  -> define INST_ROOT
-cat >> ${install_work}/$SHRC <<EOF
+cat >> ${install_work}/${SHRC} <<EOF
 #${DELIM} Setting products installation directory ${DELIM}
 export INST_ROOT=${install_root}
 
@@ -141,7 +141,7 @@ EOF
 if [ -f /etc/redhat-release ] ; then
   grep -e "Red Hat Linux release 9" /etc/redhat-release > /dev/null
   if [ $? -eq 0 ] ; then
-    cat >> ${install_work}/$SHRC <<EOF
+    cat >> ${install_work}/${SHRC} <<EOF
 #${DELIM} Force RH9 to use old implementation of threads ${DELIM}
 export LD_ASSUME_KERNEL=2.4.18
 
@@ -150,11 +150,11 @@ EOF
 fi
 ### !!! writing salome.csh file !!! -> set inital variables
 pre_vars="PATH LD_LIBRARY_PATH LD_RUN_PATH PYTHONPATH TCLLIBPATH"
-for i in $pre_vars ; do
-cat >> ${install_work}/$CSHRC <<EOF
+for i in ${pre_vars} ; do
+cat >> ${install_work}/${CSHRC} <<EOF
 #${DELIM} setting initial ${i} ${DELIM}
 if (! (\$?${i}) ) then
-  setenv $i
+  setenv ${i}
 endif
 
 EOF
@@ -166,46 +166,46 @@ done
 
 # 0. add /usr/lib or /usr/lib64 dir to the LD_LIBRARY_PATH
 #if test `uname -m` = "x86_64" ; then
-#echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> ${install_work}/$SHRC 2>/dev/null
-#echo '' >> ${install_work}/$SHRC 2>/dev/null
+#echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null
+#echo '' >> ${install_work}/${SHRC} 2>/dev/null
 #else
-#echo 'export LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}' >> ${install_work}/$SHRC 2>/dev/null
-#echo '' >> ${install_work}/$SHRC 2>/dev/null
+#echo 'export LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null
+#echo '' >> ${install_work}/${SHRC} 2>/dev/null
 #fi
 
 # Licence activation 
 
 # Source of license environment file
 
-echo '#------ License activation ------' >> ${install_work}/$SHRC 2>/dev/null
-echo 'export LICENSE_FILE=/product/distene/dlim8.var.sh' >> ${install_work}/$SHRC 2>/dev/null
-echo '' >> ${install_work}/$SHRC 2>/dev/null
-echo 'if [ -e "${LICENSE_FILE}" ] ; then' >> ${install_work}/$SHRC 2>/dev/null
-echo 'export SIMULOGD_LICENSE_FILE=29029@soleil' >> ${install_work}/$SHRC 2>/dev/null
-echo 'source ${LICENSE_FILE}' >> ${install_work}/$SHRC 2>/dev/null
-echo 'fi' >> ${install_work}/$SHRC 2>/dev/null
-echo '' >> ${install_work}/$SHRC 2>/dev/null
+echo '#------ License activation ------' >> ${install_work}/${SHRC} 2>/dev/null
+echo 'export LICENSE_FILE=/product/distene/dlim8.var.sh' >> ${install_work}/${SHRC} 2>/dev/null
+echo '' >> ${install_work}/${SHRC} 2>/dev/null
+echo 'if [ -e "${LICENSE_FILE}" ] ; then' >> ${install_work}/${SHRC} 2>/dev/null
+echo 'export SIMULOGD_LICENSE_FILE=29029@soleil' >> ${install_work}/${SHRC} 2>/dev/null
+echo 'source ${LICENSE_FILE}' >> ${install_work}/${SHRC} 2>/dev/null
+echo 'fi' >> ${install_work}/${SHRC} 2>/dev/null
+echo '' >> ${install_work}/${SHRC} 2>/dev/null
 
-# 1. first dump all environment files into the $SHRC file
+# 1. first dump all environment files into the ${SHRC} file
 product_sequence="$2"
 install_products="$3"
-for i in $product_sequence ; do
+for i in ${product_sequence} ; do
     env_file=${install_work}/env_${i}.sh
     _env_file=${install_work}/_env_${i}.sh
-    if [ -e $_env_file ] ; then
-       cat $_env_file >> ${install_work}/$SHRC 2>/dev/null
-    elif [ -e $env_file ] ; then
-       echo $install_products | grep -q "\b${i}\b"
+    if [ -e ${_env_file} ] ; then
+       cat ${_env_file} >> ${install_work}/${SHRC} 2>/dev/null
+    elif [ -e ${env_file} ] ; then
+       echo ${install_products} | grep -q "\b${i}\b"
        if [ $? -eq 1 ] ; then
-           cat $env_file | sed 's/^/## /' >> ${install_work}/$SHRC 2>/dev/null
+           cat ${env_file} | sed 's/^/## /' >> ${install_work}/${SHRC} 2>/dev/null
        else
-           cat $env_file >> ${install_work}/$SHRC 2>/dev/null
+           cat ${env_file} >> ${install_work}/${SHRC} 2>/dev/null
        fi
     fi
 done
 
 # 2. writing global functions to _salome.sh file
-cat >> ${install_work}/_$SHRC <<EOF
+cat >> ${install_work}/_${SHRC} <<EOF
 ##########################################################################
 # Functions exporta and exportp are used to append/prepend correspondingly 
 # one directory or a set of directories separated by semicolon symbol (':')
@@ -264,32 +264,32 @@ out_var=\`echo \$1 \$2 | awk -v dir=\$3 '{                   \\
        }                                                 \\
      }                                                   \\
    }' | sed -e 's/\(.*\):/\1/g'\`
-echo \$out_var
+echo \${out_var}
 }
 ### exporta ###
 # appends directory or set of directories, separated by ':' (second parameter)
 # to the variable (first parameter)
 exporta () { 
-xenv=\`printenv \$1\`
-if [ -z "\$xenv" ]; then xenv="<empty>"; fi
-out_var=\`cleandup \$xenv \$2 0\`
-export \$1=\$out_var
+xenv=\${!1}
+if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
+out_var=\`cleandup \${xenv} \$2 0\`
+export \$1=\${out_var}
 }
 ### exportp ###
 # prepends directory or set of directories, separated by ':' (second parameter)
 # to the variable (first parameter)
 exportp () { 
-xenv=\`printenv \$1\`
-if [ -z "\$xenv" ]; then xenv="<empty>"; fi
-out_var=\`cleandup \$xenv \$2 1\`
-export \$1=\$out_var
+xenv=\${!1}
+if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
+out_var=\`cleandup \${xenv} \$2 1\`
+export \$1=\${out_var}
 }
 ###########################################################################
 
 EOF
 
 # 3. writing global functions to _salome.csh file
-cat >> ${install_work}/_$CSHRC <<EOF
+cat >> ${install_work}/_${CSHRC} <<EOF
 
 ###########################################################################
 # Aliases setenva and setenvp are used to append/prepend correspondingly 
@@ -351,27 +351,27 @@ alias cleandup "echo \!:1 \!:2 | awk -v dir=\!:3         \\\\
 ### setenva ###
 # appends directory or set of directories, separated by ':' (second parameter)
 # to the variable (first parameter)
-alias setenva 'set a=\!:1 ; set b=\!:2 ;  \\
-               set c=\`printenv \$a\` ;      \\
-               set b=\`cleandup \$c \$b 0\` ; \\
-               setenv \$a \$b ;             \\
+alias setenva 'set a=\!:1 ; set b=\!:2 ;      \\
+               set c=\`printenv \${a}\` ;        \\
+               set b=\`cleandup \${c} \${b} 0\` ; \\
+               setenv \${a} \${b} ;             \\
                unset a, b, c'
 
 ### setenvp ###
 # prepends directory or set of directories, separated by ':' (second parameter)
 # to the variable (first parameter)
-alias setenvp 'set a=\!:1 ; set b=\!:2 ;  \\
-               set c=\`printenv \$a\` ;      \\
-               set b=\`cleandup \$c \$b 1\` ; \\
-               setenv \$a \$b ;             \\
+alias setenvp 'set a=\!:1 ; set b=\!:2 ;      \\
+               set c=\`printenv \${a}\` ;        \\
+               set b=\`cleandup \${c} \${b} 1\` ; \\
+               setenv \${a} \${b} ;             \\
                unset a, b, c'
 ###########################################################################
 
 EOF
-cat ${install_work}/$CSHRC >> ${install_work}/_$CSHRC
+cat ${install_work}/${CSHRC} >> ${install_work}/_${CSHRC}
 
 # 4. put the contents of salome.sh to _salome.sh replacing export by export(a|p) aliases where necessary
-sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null
+sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null
 sed -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\$[{]\?LD_LIBRARY_PATH[}]\?:\(.*\)%exporta\1LD_LIBRARY_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\(.*\):\$[{]\?LD_LIBRARY_PATH[}]\?%exportp\1LD_LIBRARY_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
 sed -e 's%export\([[:blank:]]*\)PYTHONPATH=\$[{]\?PYTHONPATH[}]\?:\(.*\)%exporta\1PYTHONPATH \2%g' -e 's%export\([[:blank:]]*\)PYTHONPATH=\(.*\):\$[{]\?PYTHONPATH[}]\?%exportp\1PYTHONPATH \2%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
 sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%exporta\1LD_RUN_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\(.*\):\$[{]\?LD_RUN_PATH[}]\?%exportp\1LD_RUN_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2
@@ -385,11 +385,11 @@ sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%expor
 #echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2
 #fi
 
-cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_$SHRC
+cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_${SHRC}
 
 # 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc.
-sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null
-cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/$CSHRC
+sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null
+cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/${CSHRC}
 
 # 6. Create a _salome.csh file from _salome.sh by replacing export by setenv, exporta by setenva, etc.
 sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
@@ -402,38 +402,38 @@ sed -e 's%^\([[:blank:]]*\)fi\([[:blank:]]*\)$%\1endif\2%g' ${INSTALL_WORK}/_tmp
 sed -e 's%var.sh%var.csh%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null
 sed -e 's%if \[ -e "\${LICENSE_FILE}" \] ; then%if ( -e ${LICENSE_FILE} ) then%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null
 
-cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/_$CSHRC 2>/dev/null
+cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/_${CSHRC} 2>/dev/null
 
 rm -f ${INSTALL_WORK}/_tmp1 ${INSTALL_WORK}/_tmp2
 
 if [ $# -eq 5 ] ; then
     product_dir=$5
     if [ -e ${product_dir} ] ; then
-       test -e ${product_dir}/$SHRC && mv ${product_dir}/$SHRC ${product_dir}/${SHRC}_`date +%F_%T`
-       cp ${install_work}/_$SHRC  ${product_dir}/$SHRC
-       test -e ${product_dir}/$CSHRC && mv ${product_dir}/$CSHRC ${product_dir}/${CSHRC}_`date +%F_%T`
-       cp ${install_work}/_$CSHRC ${product_dir}/$CSHRC
+       test -e ${product_dir}/${SHRC} && mv ${product_dir}/${SHRC} ${product_dir}/${SHRC}_`date +%F_%T`
+       cp ${install_work}/_${SHRC}  ${product_dir}/${SHRC}
+       test -e ${product_dir}/${CSHRC} && mv ${product_dir}/${CSHRC} ${product_dir}/${CSHRC}_`date +%F_%T`
+       cp ${install_work}/_${CSHRC} ${product_dir}/${CSHRC}
     fi
 fi
-sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_$CSHRC > ${install_root}/env_build.csh
-sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_$SHRC  > ${install_root}/env_build.sh
+sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_${CSHRC} > ${install_root}/env_build.csh
+sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_${SHRC}  > ${install_root}/env_build.sh
 
-cp -f ${install_work}/_$CSHRC ${install_root}/env_products.csh
-cp -f ${install_work}/_$SHRC  ${install_root}/env_products.sh
+cp -f ${install_work}/_${CSHRC} ${install_root}/env_products.csh
+cp -f ${install_work}/_${SHRC}  ${install_root}/env_products.sh
 
-rm -f ${install_work}/_$SHRC ${install_work}/_$CSHRC
+rm -f ${install_work}/_${SHRC} ${install_work}/_${CSHRC}
 ### !!! copying build.csh and build.sh scripts
-if [ -e ./build.csh ]; then
+if [ -e ./build.csh ] && [ ! -e ${install_root}/build.csh ]; then
     cp -f ./build.csh ${install_root}
 fi
-if [ -e ./build.sh ]; then
+if [ -e ./build.sh ] && [ ! -e ${install_root}/build.sh ]; then
     cp -f ./build.sh ${install_root}
 fi
 ### !!! copying release notes
 for p in `ls ../` ; do
     export pdf=`echo ${p} | sed s/[.]/" "/g | awk '{print $2}'`
     if [ "${pdf}" = "pdf" ]; then
-       export RN=$p
+       export RN=${p}
        if [ ! -e ${install_root}/${RN} ]; then
            cp -f ../${RN} ${install_root}
        fi
@@ -451,7 +451,7 @@ env_file=${product_dir}/env_${product_type}.sh
 if [ -f ${env_file} ] ; then
     cp -f ${env_file} ${install_work}/_env_${product_type}.sh
     make_env ${install_root} ${install_work} "${product_sequence}" "${installed_products}"
-    source ${install_work}/$SHRC
+    source ${install_work}/${SHRC}
     check_version
     if [ $? -eq 0 ] ; then
        return 0
@@ -469,18 +469,18 @@ return 0
 #check existance of lib passed as first parameter
 #return 0 if lib exists
 #if you pass second parameter search will be done in it 
-#otherwise search will be done in $LD_LIBRARY_PATH
+#otherwise search will be done in ${LD_LIBRARY_PATH}
 #you should use : as dilimeter if you are going to pass second parameter
 check_lib_version(){
 if [ -n "$2" ]; then
    whereIs=$2
 else
-   whereIs=$LD_LIBRARY_PATH
+   whereIs=${LD_LIBRARY_PATH}
 fi
-for L in `echo ${whereIs} | sed -e"s%:% %g"` ;  do
-    ret=`find $L -name $1 2>/dev/null`
-    if [ -n "$ret" ] ; then
-       #echo "The $1 exists on yours system in a $L folder"
+for d in `echo ${whereIs} | sed -e"s%:% %g"` ;  do
+    ret=`find ${d} -name $1 2>/dev/null`
+    if [ -n "${ret}" ] ; then
+       #echo "The $1 exists on yours system in a ${d} folder"
        return 0
     fi
 done
@@ -491,10 +491,10 @@ find_in_path(){
 file=$1;  shift; 
 path=$*
 for i in `echo ${path} | sed -e"s%:% %g"` ; do 
-    ret=`find $i -name $file -maxdepth 1 2>/dev/null`
-    if [ -n "$ret" ] ; then
-       ret=`echo $ret | sed -e"s%/\$file$%%g"`
-       echo $ret
+    ret=`find ${i} -name ${file} -maxdepth 1 2>/dev/null`
+    if [ -n "${ret}" ] ; then
+       ret=`echo ${ret} | sed -e"s%/\${file}$%%g"`
+       echo ${ret}
        return 0
     fi
 done
@@ -503,54 +503,54 @@ return 1
 
 sort_path(){
 arg1=$1;  val1=$2;  arg2=$3;  val2=$4
-tmp="^$val1$|^$val1:|:$val1$|:$val1:"
-#echo $val2 | grep -E "$tmp" >/dev/null 2>&1
+tmp="^${val1}$|^${val1}:|:${val1}$|:${val1}:"
+#echo ${val2} | grep -E "${tmp}" >/dev/null 2>&1
 #if [ $? -eq 0 ] ; then 
-#    echo "$arg2"
+#    echo "${arg2}"
 #    return
 #fi
 to_tail=1
 exclude_list="usr lib bin sbin etc"
 for i in ${exclude_list} ; do
-    tmp="^/$i/|^/$i\$"
-    echo ${val1} | grep -E "$tmp" >/dev/null 2>&1
-    if [ $? == 0 ] ; then to_tail=0; break; fi
+    tmp="^/${i}/|^/${i}\$"
+    echo ${val1} | grep -E "${tmp}" >/dev/null 2>&1
+    if [ "$?" = "0" ] ; then to_tail=0; break; fi
 done
-if [ $to_tail -eq 0 ] ; then
-    echo $arg2:$arg1
+if [ ${to_tail} -eq 0 ] ; then
+    echo ${arg2}:${arg1}
 else
-    echo $arg1:$arg2
+    echo ${arg1}:${arg2}
 fi
-return $to_tail
+return ${to_tail}
 }
 
 where_gcc(){
 maj_ver=`echo $1 | awk -F. '{if(NF>0) print $1; else print 0}'`
 min_ver=`echo $1 | awk -F. '{if(NF>1) print $2; else print 0}'`
 rel_ver=`echo $1 | awk -F. '{if(NF>2) print $3; else print 0}'`
-let ver=$maj_ver*10000+$min_ver*100+$rel_ver
+let ver=${maj_ver}*10000+${min_ver}*100+${rel_ver}
 newer=""
 newerver=0
 for i in `echo ${PATH}:/usr/bin:/usr/local/bin | sed -e"s%:% %g"` ; do 
-    ret=`find $i -name gcc -maxdepth 1 2>/dev/null`
-    if [ -n "$ret" ] ; then
-       maj_ver=`$ret -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
-       min_ver=`$ret -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
-       rel_ver=`$ret -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
-       let ver1=$maj_ver*10000+$min_ver*100+$rel_ver
-       if [ $ver1 -eq $ver ] ; then
-           ret=`echo $ret | sed -e"s%/gcc$%%g"`
-           echo $ret
+    ret=`find ${i} -name gcc -maxdepth 1 2>/dev/null`
+    if [ -n "${ret}" ] ; then
+       maj_ver=`${ret} -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
+       min_ver=`${ret} -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
+       rel_ver=`${ret} -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
+       let ver1=${maj_ver}*10000+${min_ver}*100+${rel_ver}
+       if [ ${ver1} -eq ${ver} ] ; then
+           ret=`echo ${ret} | sed -e"s%/gcc$%%g"`
+           echo ${ret}
            return 0
        fi
-       if [ $ver1 -gt $ver ] && [ $ver1 -gt $newerver ] ; then
-           let newerver=$ver1
-           newer=`echo $ret | sed -e"s%/gcc$%%g"`
+       if [ ${ver1} -gt ${ver} ] && [ ${ver1} -gt ${newerver} ] ; then
+           let newerver=${ver1}
+           newer=`echo ${ret} | sed -e"s%/gcc$%%g"`
        fi
     fi
 done
-if [ -n "$newer" ] ; then
-    echo $newer
+if [ -n "${newer}" ] ; then
+    echo ${newer}
     return 0
 fi
 return 1
@@ -563,15 +563,15 @@ fi
 tclcfg=`find ${TCLHOME}/lib -name "tclConfig.sh" 2> /dev/null`
 file=""
 maxver=0
-for f in $tclcfg; do
-    ver=`cat $f | grep -e "TCL_VERSION=.*" | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
-    if [ $maxver -lt $ver ]; then
-        maxver=$ver
-       file=$f
+for f in ${tclcfg} ; do
+    ver=`cat ${f} | grep -e "TCL_VERSION=.*" | sed -e "s%TCL_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
+    if [ ${maxver} -lt ${ver} ]; then
+        maxver=${ver}
+       file=${f}
     fi
 done
-if test -n "$file"; then
-    echo `dirname $file`
+if test -n "${file}"; then
+    echo `dirname ${file}`
     return 0
 else
     echo ""
@@ -586,15 +586,15 @@ fi
 tclcfg=`find ${TCLHOME}/lib -name "tkConfig.sh" 2> /dev/null`
 file=""
 maxver=0
-for f in $tclcfg; do
-    ver=`cat $f | grep -e "TK_VERSION=.*" | sed -e "s%TK_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
-    if [ $maxver -lt $ver ]; then
-        maxver=$ver
-       file=$f
+for f in ${tclcfg} ; do
+    ver=`cat ${f} | grep -e "TK_VERSION=.*" | sed -e "s%TK_VERSION=[\'|\"]\(.*\)[\'|\"]%\1%g" | awk -F. '{x=0;for(i=1;i<=3;i++){x=x*100;if(i<=NF)x+=$i;}print x;}'`
+    if [ ${maxver} -lt ${ver} ]; then
+        maxver=${ver}
+       file=${f}
     fi
 done
-if test -n "$file"; then
-    echo `dirname $file`
+if test -n "${file}"; then
+    echo `dirname ${file}`
     return 0
 else
     echo ""
@@ -618,7 +618,7 @@ return 1
 where_gl_includes(){
 for d in /usr/X11R6/include /usr/include ; do
     if [ -d ${d}/GL ] && [ -f ${d}/GL/gl.h ] ; then
-       echo "$d"
+       echo "${d}"
        return 0
     fi
 done
@@ -633,8 +633,8 @@ local libdir
 for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
     if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] && [ -f ${d}/libGL.la ]; then
        libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"`
-       if [ "$libdir" == "$d" ] ; then
-           echo "$d"
+       if [ "${libdir}" = "${d}" ] ; then
+           echo "${d}"
            return 0
        fi
     fi
@@ -643,8 +643,8 @@ done
 for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
     if [ -f ${d}/libGL.la ] ; then
        libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
-       if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
-           echo "$d"
+       if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then
+           echo "${d}"
            return 0
        fi
     fi
@@ -652,7 +652,7 @@ done
 # then search libGL.so* file
 for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do
     if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] ; then
-       echo "$d"
+       echo "${d}"
        return 0
     fi
 done
@@ -662,15 +662,15 @@ return 1
 
 fix_gl_libs(){
     local gllibdir="`where_gl_libs`"
-    if [ "$gllibdir" != "" ] ; then
+    if [ "${gllibdir}" != "" ] ; then
 #VSR: 02/04/2013 - next block is commented as it seems to be wrong :( libGL.la should not be ever mentioned
 #      if [ -f ${gllibdir}/libGL.la ] ; then
 #          libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"`
-#          if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then
+#          if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then
 #              str_to_replace="${gllibdir}/libGL.la"
 #          fi
 #      fi
-       if [ "$str_to_replace" == "" ] ; then
+       if [ "${str_to_replace}" = "" ] ; then
            str_to_replace="-L${gllibdir} -lGL"
        fi
        
@@ -689,45 +689,45 @@ fix_gl_libs(){
 
 modif_la_files(){
 ldir=$1
-if [ -z "$ldir" ] || [ ! -d "$ldir" ]; then return 1; fi
+if [ -z "${ldir}" ] || [ ! -d "${ldir}" ]; then return 1; fi
 
 srcdir=`pwd`
 
 SALOME_MODULES="`env | awk -F_ '/[a-zA-Z0-9]*_ROOT_DIR/ { print $1 }'`"
 
-cd $ldir
+cd ${ldir}
 ldir=`pwd`
 la_files=`find . -name "*.la"`
 
 # netgen dir
-netgendir=`printenv NETGENHOME`
+netgendir=${NETGEN_ROOT_DIR}
 # freetype dir
-freetypedir=`printenv FREETYPEDIR`
+freetypedir=${FREETYPE_ROOT_DIR}
 # ftgl dir
-ftgldir=`printenv FTGLDIR`
+ftgldir=${FTGL_ROOT_DIR}
 # gl2ps dir
-gl2psdir=`printenv GL2PSHOME`
+gl2psdir=${GL2PS_ROOT_DIR}
 # freeimage dir
-freeimagedir=`printenv FREEIMAGEDIR`
+freeimagedir=${FREEIMAGE_ROOT_DIR}
 # tbb dir
-tbbbasedir=`printenv TBBHOME`
+tbbbasedir=${TBB_ROOT_DIR}
 TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21'
 if test `uname -m` = "x86_64" ; then
-    export TBBMODE="intel64/$TBBKERNEL"
+    export TBBMODE="intel64/${TBBKERNEL}"
 else
-    export TBBMODE="ia32/$TBBKERNEL"
+    export TBBMODE="ia32/${TBBKERNEL}"
 fi
-tbbdir=${tbbbasedir}/lib/$TBBMODE
+tbbdir=${tbbbasedir}/lib/${TBBMODE}
 # cgns dir
-cgnslibdir=`printenv CGNSHOME`
+cgnslibdir=${CGNS_ROOT_DIR}
 # occt dir
-casdir=`printenv CASROOT`/lib
-if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/Linux/lib ; fi
-if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/lin/lib ; fi
+casdir=${CAS_ROOT_DIR}/lib
+if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/Linux/lib ; fi
+if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/lin/lib ; fi
 # omniorb dir
-omnidir=`printenv OMNIORBDIR`/lib
+omnidir=${OMNIORB_ROOT_DIR}/lib
 # vtk dir
-vtkpath=`printenv VTKHOME`
+vtkpath=${VTK_DIR}
 if [ `uname -m` = "x86_64" ] && [ -d ${vtkpath}/lib64 ] ; then
     LIB_PREFIX=64
 elif [ -d ${vtkpath}/lib ] ; then
@@ -738,16 +738,16 @@ fi
 vtkldir=${vtkpath}/lib${LIB_PREFIX}
 vtkdir=${vtkldir}/vtk-5.0
 # hdf dir
-hdfdir=`printenv HDF5HOME`/lib
+hdfdir=${HDF5_ROOT_DIR}/lib
 # med dir
-meddir=`printenv MED3HOME`/lib
+meddir=${MEDFILE_ROOT_DIR}/lib
 # qwt dir
 qwtdir=`find_in_path libqwt.so ${LD_LIBRARY_PATH}`
 # python dir
 where_python=`which python`                 # e.g. /usr/bin/python
-if [ -n "$where_python" ] ; then
-    where_python=`dirname $where_python`    # --> /usr/bin
-    where_python=`dirname $where_python`    # --> /usr
+if [ -n "${where_python}" ] ; then
+    where_python=`dirname ${where_python}`    # --> /usr/bin
+    where_python=`dirname ${where_python}`    # --> /usr
     python_version=`python -c "import sys; print sys.version[:3]"`
     pythondir=${where_python}/lib/python${python_version}
 fi
@@ -756,18 +756,18 @@ sipdir=`find_in_path sip.so ${LD_LIBRARY_PATH}`
 # pyqt dir
 pyqtdir=`find_in_path Qt.so ${LD_LIBRARY_PATH}`
 # tcl/tk dir
-tcldir=`printenv TCLHOME`/lib
+tcldir=${TCLHOME}/lib
 # boost dir
-boostdir=`printenv BOOSTDIR`/lib
+boostdir=${BOOST_ROOT_DIR}/lib
 # blsurf dir
-blsurfdir=`printenv BLSURFHOME`/lib
+blsurfdir=${BLSURFHOME}/lib
 # libxml2 dir
-libxmldir=`printenv LIBXML_DIR`/lib
+libxmldir=${LIBXML2_ROOT_DIR}/lib
 # metis dir
-metisdir=`printenv METISDIR`
+metisdir=${METIS_ROOT_DIR}
 # scotch dir
-scotchbindir=`printenv SCOTCHDIR`/bin
-scotchlibdir=`printenv SCOTCHDIR`/lib
+scotchbindir=${SCOTCH_ROOT_DIR}/bin
+scotchlibdir=${SCOTCH_ROOT_DIR}/lib
 # gl dir
 if test `uname -m` = "x86_64" ; then
     libGLpath=/usr/lib64/libGL.la
@@ -775,194 +775,195 @@ else
     libGLpath=/usr/lib/libGL.la
 fi
 # graphviz dir
-graphvizdir=`printenv GRAPHVIZHOME`/lib
+graphvizdir=${GRAPHVIZ_ROOT_DIR}/lib
 # qscintilla dir
-qscintilladir=`printenv QSCINTILLA_DIR`/lib
+qscintilladir=${QSCINTILLA_ROOT_DIR}/lib
 # expat dir
-expatdir=${EXPAT_ROOT}/lib
+expatdir=${EXPAT_ROOT_DIR}/lib
 # paraview dir
-paraviewdir=`printenv PVHOME`/lib
+paraviewdir=${PARAVIEW_ROOT_DIR}/lib
 # qt dir
-qtdir=`printenv QTDIR`/lib
+qtdir=${QT4_ROOT_DIR}/lib
 # distene meshgems dir
 if test `uname -m` = "x86_64" ; then
-    mgemsdir=`printenv MESHGEMSHOME`/lib/Linux_64
+    mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux_64
 else
-    mgemsdir=`printenv MESHGEMSHOME`/lib/Linux
+    mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux
 fi
 
 for l in X ${la_files}; do
 
-if [ "$l" != "X" ] ; then
-    d=`dirname $l`
-    l=`basename $l`
-    cd $ldir; cd $d
+if [ "${l}" != "X" ] ; then
+    d=`dirname ${l}`
+    l=`basename ${l}`
+    cd ${ldir}; cd ${d}
 
     # . process salome modules dependencies
-    for mod in $SALOME_MODULES; do
-       moddir=`printenv ${mod}_ROOT_DIR`
+    for mod in ${SALOME_MODULES} ; do
+       moddir=${mod}_ROOT_DIR
+       moddir=${!moddir}
        if [ -n "${moddir}" ] ; then
            sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[1]\?/lib% \1${moddir}/lib%g" \
                -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}WOGUI[1]\?/lib% \1${moddir}/lib%g" \
                -e "s%^libdir='[^[:space:]]*${mod}[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" \
-               -e "s%^libdir='[^[:space:]]*${mod}WOGUI[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" $l > $l"_"
-           mv -f $l"_" $l
+               -e "s%^libdir='[^[:space:]]*${mod}WOGUI[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" ${l} > ${l}"_"
+           mv -f ${l}"_" ${l}
        fi
     done
 
     # . process netgen dependencies
     if [ -n "${netgendir}" ] && [ -d "${netgendir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*netgen-[0-9.]\+/lib% \1${netgendir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*netgen-[0-9.]\+/lib% \1${netgendir}/lib%g" ${l}
     fi
 
     # . process freetype dependencies
     if [ -n "${freetypedir}" ] && [ -d "${freetypedir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freetype-[0-9.]\+/lib% \1${freetypedir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freetype-[0-9.]\+/lib% \1${freetypedir}/lib%g" ${l}
     fi
 
     # . process ftgl dependencies
     if [ -n "${ftgldir}" ] && [ -d "${ftgldir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ftgl-[0-9.]\+/lib% \1${ftgldir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ftgl-[0-9.]\+/lib% \1${ftgldir}/lib%g" ${l}
     fi
 
     # . process gl2ps dependencies
     if [ -n "${gl2psdir}" ] && [ -d "${gl2psdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*gl2ps-[0-9.]\+/lib% \1${gl2psdir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*gl2ps-[0-9.]\+/lib% \1${gl2psdir}/lib%g" ${l}
     fi
     
     # . process freeimage dependencies
     if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freeimage-[0-9.]\+/lib% \1${freeimagedir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freeimage-[0-9.]\+/lib% \1${freeimagedir}/lib%g" ${l}
     fi
 
     # . process tbb dependencies
     if [ -n "${tbbdir}" ] && [ -d "${tbbdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*tbb[^[:space:]]*/lib[^[:space:]]*% \1${tbbdir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*tbb[^[:space:]]*/lib[^[:space:]]*% \1${tbbdir}%g" ${l}
     fi
     
     # . process cgns dependencies
     if [ -n "${cgnslibdir}" ] && [ -d "${cgnslibdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*cgnslib-[0-9.]\+/lib% \1${cgnslibdir}/lib%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*cgnslib-[0-9.]\+/lib% \1${cgnslibdir}/lib%g" ${l}
     fi
 
     # . process CAS.CADE dependencies
-    if [ -n "${CASROOT}" ] && [ -d "${casdir}" ] ; then
+    if [ -n "${CAS_ROOT_DIR}" ] && [ -d "${casdir}" ] ; then
         sed -e "s%-L[^[:space:]]*OCCT[^[:space:]]*/install/lib%-L${casdir}%g" \
            -e "s%[^[:space:]]*OCCT[^[:space:]]*/install/lib/%${casdir}/%g"   \
-           -e "s%[[:space:]]-L[^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib\?% -L${CASROOT}/lib%g" \
-           -e "s%[[:space:]][^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib/lib\?% ${CASROOT}/lib/lib%g" $l > $l"_"
-       mv -f $l"_" $l
+           -e "s%[[:space:]]-L[^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib\?% -L${CAS_ROOT_DIR}/lib%g" \
+           -e "s%[[:space:]][^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib/lib\?% ${CAS_ROOT_DIR}/lib/lib%g" ${l} > ${l}"_"
+       mv -f ${l}"_" ${l}
     fi
 
     # . process omniORB dependencies
-    if [ -n "${OMNIORBDIR}" ] && [ -d "${omnidir}" ] ; then
-       sed -i "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g;s%-R[^[:space:]]*omni[^[:space:]]*%-R${omnidir}%g" $l
+    if [ -n "${OMNIORB_ROOT_DIR}" ] && [ -d "${omnidir}" ] ; then
+       sed -i "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g;s%-R[^[:space:]]*omni[^[:space:]]*%-R${omnidir}%g" ${l}
     fi
 
     # . process VTK dependencies
-    if [ -n "${VTKHOME}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then
-       sed -i "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g;s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)%-L${vtkldir}%g" $l
+    if [ -n "${VTK_DIR}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then
+       sed -i "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g;s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)%-L${vtkldir}%g" ${l}
     fi
 
     # . process HDF dependencies
-    if [ -n "${HDF5HOME}" ] && [ -d "${hdfdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" $l
+    if [ -n "${HDF5_ROOT_DIR}" ] && [ -d "${hdfdir}" ] ; then
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" ${l}
     fi
 
     # . process MED dependencies
-    if [ -n "${MED3HOME}" ] && [ -d "${meddir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" $l
+    if [ -n "${MEDFILE_ROOT_DIR}" ] && [ -d "${meddir}" ] ; then
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" ${l}
     fi
 
     # . process qwt dependencies
     if [ -n "${qwtdir}" ] && [ -d "${qwtdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" ${l}
     fi
 
     # . process qt dependencies
-    if [ -n "${QTDIR}" ] && [ -d "${qtdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" $l
+    if [ -n "${QT4_ROOT_DIR}" ] && [ -d "${qtdir}" ] ; then
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" ${l}
     fi
 
     # . process python dependencies
     if [ -n "${pythondir}" ] && [ -d "${pythondir}" ] ; then
-       sed -i "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${pythondir}\1%g" $l
+       sed -i "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${pythondir}\1%g" ${l}
     fi
 
     # . process sip dependencies
     if [ -n "${sipdir}" ] && [ -d "${sipdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" $l
+       sed -i "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" ${l}
     fi
 
     # . process PyQt dependencies
     if [ -n "${pyqtdir}" ] && [ -d "${pyqtdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" $l
+       sed -i "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" ${l}
     fi
 
     # . process tcl/tk dependencies
     if [ -n "${tcldir}" ] && [ -d "${tcldir}" ] ; then
-       sed -i "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" $l
+       sed -i "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" ${l}
     fi
 
     # . process boost dependencies
     if [ -n "${boostdir}" ] && [ -d "${boostdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" $l
+       sed -i "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" ${l}
     fi
 
     # . process blsurf dependencies
     if [ -n "${blsurfdir}" ] && [ -d "${blsurfdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*BLSurf[^[:space:]]*/lib%-L${blsurfdir}%g" $l
+       sed -i "s%-L[^[:space:]]*BLSurf[^[:space:]]*/lib%-L${blsurfdir}%g" ${l}
     fi
 
     # . process libxml dependencies
     if [ -n "${libxmldir}" ] && [ -d "${libxmldir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9]/lib% \1${libxmldir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9]/lib% \1${libxmldir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" ${l}
     fi
 
     # . process metis dependencies
     if [ -n "${metisdir}" ] && [ -d "${metisdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*metis[^[:space:]]*%-L${metisdir}%g" $l
+       sed -i "s%-L[^[:space:]]*metis[^[:space:]]*%-L${metisdir}%g" ${l}
     fi
 
     # . process scotch dependencies
     if [ -n "${scotchbindir}" ] && [ -d "${scotchbindir}" ] ; then
-       sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/bin%-L${scotchbindir}%g" $l
+       sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/bin%-L${scotchbindir}%g" ${l}
     fi
     if [ -n "${scotchlibdir}" ] && [ -d "${scotchlibdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/lib%-L${scotchlibdir}%g" $l
+       sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/lib%-L${scotchlibdir}%g" ${l}
     fi
 
     # . process libGL.la dependencies
-    sed -i "s%$libGLpath%""%g" $l
+    sed -i "s%${libGLpath}%""%g" ${l}
 
     # . process graphviz dependencies
     if [ -n "${graphvizdir}" ] && [ -d "${graphvizdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" ${l}
     fi
 
     # . process QScintilla dependencies
     if [ -n "${qscintilladir}" ] && [ -d "${qscintilladir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\(\.[0-9]\)\?/lib% \1${qscintilladir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\(\.[0-9]\)\?/lib% \1${qscintilladir}%g" ${l}
     fi
 
     # . process expat-2.0.1 dependencies
     if [ -n "${expatdir}" ] && [ -d "${expatdir}" ] ; then
-       sed -i "s%-L[^[:space:]]*expat[^[:space:]]*/lib%-L${expatdir}%g;s%[^[:space:]]*expat[^[:space:]]*/lib/libexpat.la%-lexpat%g" $l
+       sed -i "s%-L[^[:space:]]*expat[^[:space:]]*/lib%-L${expatdir}%g;s%[^[:space:]]*expat[^[:space:]]*/lib/libexpat.la%-lexpat%g" ${l}
     fi
 
     # . process ParaView dependencies
     if [ -n "${paraviewdir}" ] && [ -d "${paraviewdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ParaView-[0-9]\.[0-9]\+\.[0-9]/lib% \1${paraviewdir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ParaView-[0-9]\.[0-9]\+\.[0-9]/lib% \1${paraviewdir}%g" ${l}
     fi
     
     # . process DISTENE MeshGems dependencies
     if [ -n "${mgemsdir}" ] && [ -d "${mgemsdir}" ] ; then
-       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*MeshGems-[0-9.]\+/Products/lib/Linux\(_64\)\?% \1${mgemsdir}%g" $l
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*MeshGems-[0-9.]\+/Products/lib/Linux\(_64\)\?% \1${mgemsdir}%g" ${l}
     fi
 
 fi
 done
 
-cd $srcdir
+cd ${srcdir}
 return 0
 }
index 46273c7356f327c8867c49a6d994f1c44b290ff0..472c9e7231c42b8828ff6b7ac95559d662cbd8b9 100755 (executable)
 #
 ####################################################################################
 
-QT_REF_VERSION="4.8.4"
+VERSION_QT="4.8.4"
 
 check_version(){
-if [ -z "$QTDIR" ]; then
+if [ -z "${QT4_ROOT_DIR}" ]; then
    return 1
 fi
-ver=`grep "QT_VERSION_STR" ${QTDIR}/include/Qt/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
-if [ "$ver" == "${QT_REF_VERSION}" ] ; then
+ver=`grep "QT_VERSION_STR" ${QT4_ROOT_DIR}/include/Qt/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
+if [ "${ver}" = "${VERSION_QT}" ] ; then
     return 0
 fi
 return 1
@@ -28,12 +28,11 @@ return 1
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export QTDIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export QT_ROOT_DIR=\${QTDIR}
-export QT_PLUGIN_PATH=\${QTDIR}/plugins
-export PATH=\${QTDIR}/bin:\$PATH 
-export LD_LIBRARY_PATH=\${QTDIR}/lib:\${LD_LIBRARY_PATH}
+#${DELIM} ${PRODUCT_TYPE} ${DELIM}
+export QT4_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export QT_PLUGIN_PATH=\${QT4_ROOT_DIR}/plugins
+export PATH=\${QT4_ROOT_DIR}/bin:\${PATH} 
+export LD_LIBRARY_PATH=\${QT4_ROOT_DIR}/lib:\${LD_LIBRARY_PATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -43,7 +42,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -60,7 +59,7 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
@@ -70,11 +69,14 @@ if [ "${patch_for_gstreamer}" = "1" ] ; then
     # check that we need a patch for problem with gstreamer (note that it does not always help!)
     pkg-config --libs gstreamer-app-0.10 >& /dev/null
     if [ "$?" != "0" ] ; then
-       cd ${PRODUCT_SRC_DIR}/src/3rdparty/webkit/Source/WebCore
-       sed -i "s%glib-2.0 gio-2.0 gstreamer-0.10%glib-2.0 gio-2.0 '\\\\'gstreamer-0.10 >= 0.10.28\\\\''%g" features.pri
+       sed -i "s%glib-2.0 gio-2.0 gstreamer-0.10%glib-2.0 gio-2.0 '\\\\'gstreamer-0.10 >= 0.10.28\\\\''%g" ${PRODUCT_SRC_DIR}/src/3rdparty/webkit/Source/WebCore/features.pri >& /dev/null
     fi
 fi
 
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
+
 # to generate environment scripts
 try_preinstalled
 }
@@ -94,7 +96,7 @@ check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure -prefix ${PRODUCT_DIR} -no-se
 
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 EOF
 
 check_job ${PRODUCT_DIR}/MAKE.LOG make 
@@ -104,18 +106,22 @@ check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
 #    ( cd ${PRODUCT_DIR} && ln -sf lib lib64 )
 #fi
 
-cd ${PRODUCT_DIR};
-
-# remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
-    test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
-fi
-
 # patch binaries
 local patch_webkit_deps=1
 if [ "${patch_webkit_deps}" = "1" ] ; then
-    cd ${PRODUCT_DIR}/lib
-    sed -i "s% -L../../WebCore/release%%g;s% -L../../JavaScriptCore/release%%g;s% -lwebcore%%g;s% -ljscore%%g" libQtWebKit.la >& /dev/null
+    sed -i "s% -L../../WebCore/release%%g;s% -L../../JavaScriptCore/release%%g;s% -lwebcore%%g;s% -ljscore%%g" ${PRODUCT_DIR}/lib/libQtWebKit.la >& /dev/null
+fi
+
+cd ${PRODUCT_DIR}
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
+
+# remove sources and temporary files after building
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
+    test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
 # to generate environment scripts
@@ -125,60 +131,49 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
 
-# modify libdir
-cd ${PRODUCT_DIR}/lib
+# change installation path
 
-# modify qt la files
-for l in `find $ldir -name "*.la"`; do
-    sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" $l
-    sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*${PRODUCT}% \1${PRODUCT_DIR}%g" $l
-    sed -i "s%^dependency_libs='\(-L\)\?[^[:space:]]*${PRODUCT}%dependency_libs=\'\1${PRODUCT_DIR}%g" $l
+# - modify qt la files
+for l in X `find ${PRODUCT_DIR}/lib -name "*.la"` ; do
+    if [ "${l}" != "X" ] ; then
+       sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" ${l}
+       sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*${PRODUCT}% \1${PRODUCT_DIR}%g" ${l}
+       sed -i "s%^dependency_libs='\(-L\)\?[^[:space:]]*${PRODUCT}%dependency_libs=\'\1${PRODUCT_DIR}%g" ${l}
+    fi
 done
 
-# modify libGL.so flags
-has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libQtOpenGL.la`
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libQtOpenGL.la`
 gllibdir="`where_gl_libs`"
-if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
-    sed -e "s%-lGL\b%%g" \
-       -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
-       libQtOpenGL.la > libQtOpenGL.la.new
-    mv -f libQtOpenGL.la.new libQtOpenGL.la
+if [ "${has_gl_dep}" != "" ] && [ "${gllibdir}" != "" ] ; then
+    sed -i "s%-lGL\b%%g;s%^dependency_libs='\(.*\)%dependency_libs='-L${gllibdir} -lGL \1%g" ${PRODUCT_DIR}/lib/libQtOpenGL.la
 fi
 
-# modify qt package config
-cd ${PRODUCT_DIR}/lib/pkgconfig
-for l in X `find . -name "*.pc"`; do
+# - modify qt package config
+for l in X `find ${PRODUCT_DIR}/lib/pkgconfig -name "*.pc"` ; do
     if [ "${l}" != "X" ] ; then
-        sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" \
-            -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" \
-            -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" \
-            -e "s%moc_location=.*%moc_location=${PRODUCT_DIR}/bin/moc%g" \
-            -e "s%uic_location=.*%uic_location=${PRODUCT_DIR}/bin/uic%g" \
-            -e "s%rcc_location=.*%uic_location=${PRODUCT_DIR}/bin/rcc%g" \
-            -e "s%lupdate_location=.*%uic_location=${PRODUCT_DIR}/bin/lupdate%g" \
-            -e "s%lrelease_location=.*%uic_location=${PRODUCT_DIR}/bin/lrelease%g" \
-            ${l} > ${l}_
-        chmod -f --reference=${l} ${l}_ ; mv -f ${l}_ ${l}
+        sed -i "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${VERSION_QT}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${VERSION_QT}% \1${PRODUCT_DIR}%g" ${l}
+        sed -i "s%moc_location=.*%moc_location=${PRODUCT_DIR}/bin/moc%g;s%uic_location=.*%uic_location=${PRODUCT_DIR}/bin/uic%g;s%rcc_location=.*%uic_location=${PRODUCT_DIR}/bin/rcc%g" ${l}
+        sed -i "s%lupdate_location=.*%uic_location=${PRODUCT_DIR}/bin/lupdate%g;s%lrelease_location=.*%uic_location=${PRODUCT_DIR}/bin/lrelease%g" ${l}
     fi
 done
-# modify qt prl files
-cd ${PRODUCT_DIR}/lib
-for l in X `find . -name "*.prl"`; do
+
+# - modify qt prl files
+for l in X `find ${PRODUCT_DIR}/lib -name "*.prl"` ; do
     if [ "${l}" != "X" ] ; then
-        sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" ${l}
+        sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${VERSION_QT}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${VERSION_QT}% \1${PRODUCT_DIR}%g" ${l}
     fi
 done
-# modify qt mkspecs
-cd ${PRODUCT_DIR}/mkspecs
-sed -i "s%QMAKE_RPATHDIR += \".*\"%QMAKE_RPATHDIR += \"${PRODUCT_DIR}/lib\"%g" qconfig.pri
 
+# - modify qt mkspecs
+sed -i "s%QMAKE_RPATHDIR += \".*\"%QMAKE_RPATHDIR += \"${PRODUCT_DIR}/lib\"%g" ${PRODUCT_DIR}/mkspecs/qconfig.pri
 
 # generate qt.conf file
 cat > ${PRODUCT_DIR}/bin/qt.conf <<EOF
@@ -198,10 +193,10 @@ export PRODUCT_TYPE=$6;
 export INSTALL_PRODUCTS=$7;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="qt-${QT_REF_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="qt-${VERSION_QT}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE 
+${PROCEDURE} 
index f82675a56a06bca240efb6a27ef1f386e1318158..6e99ec332904036c2a7ebbb2a6e24cd7806b0a4c 100755 (executable)
 #
 # QWT version
 #
-QWT_VERSION=5.2.1
-QWT_MAJOR_VERSION=`echo ${QWT_VERSION} | awk -F. '{print $1}'`
+VERSION_QWT=5.2.1
+QWT_MAJOR_VERSION=`echo ${VERSION_QWT} | awk -F. '{print $1}'`
 
 check_version()
 {
-if [ -n "${QWTHOME}" ] ; then 
-    qwtinc=${QWTHOME}/include/qwt_global.h
-    if [ ! -f $qwtinc ] ; then
-       qwtinc=${QWTHOME}/include/qwt/qwt_global.h
+if [ -n "${QWT_ROOT_DIR}" ] ; then 
+    qwtinc=${QWT_ROOT_DIR}/include/qwt_global.h
+    if [ ! -f ${qwtinc} ] ; then
+       qwtinc=${QWT_ROOT_DIR}/include/qwt/qwt_global.h
     fi
-    if [ -f $qwtinc ] ; then
-       ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" $qwtinc | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
-       if [ "$ver" == "${QWT_VERSION}" ]; then
+    if [ -f ${qwtinc} ] ; then
+       ver=`grep -e "^#define[[:space:]]\+QWT_VERSION_STR" ${qwtinc} | sed -e 's/^#define[[:space:]]\+QWT_VERSION_STR[[:space:]]*"\(.*\)"/\1/'`
+       if [ "${ver}" = "${VERSION_QWT}" ]; then
            return 0
        fi
     fi
@@ -38,10 +38,9 @@ return 1
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export QWTHOME=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export QWT_ROOT_DIR=\${QWTHOME}
-export LD_LIBRARY_PATH=\${QWTHOME}/lib:\${LD_LIBRARY_PATH} 
+#${DELIM} ${PRODUCT_TYPE} ${DELIM}
+export QWT_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export LD_LIBRARY_PATH=\${QWT_ROOT_DIR}/lib:\${LD_LIBRARY_PATH} 
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -51,7 +50,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -68,27 +67,14 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
-# to generate environment scripts
-try_preinstalled
-}
-
-install_source_and_build()
-{
-# install sources
-install_source
-
-# build sources
-cd ${PRODUCT_SRC_DIR}
-test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-
 local patch_build_procedure=1
 if [ "${patch_build_procedure}" = "1" ] ; then
     # specify install path
-    if [ "${QWT_MAJOR_VERSION}" == "5" ] ; then
+    if [ "${QWT_MAJOR_VERSION}" = "5" ] ; then
         # for Qwt 5.x the variable is INSTALLBASE
        sed -i "s%\(INSTALLBASE[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
     else
@@ -96,7 +82,7 @@ if [ "${patch_build_procedure}" = "1" ] ; then
        sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
     fi
     
-    if [ "${QWT_MAJOR_VERSION}" == "5" ] ; then
+    if [ "${QWT_MAJOR_VERSION}" = "5" ] ; then
         # include QwtSvg support (required only for qwt 5.x)
        sed -i "s%#\(CONFIG[[:space:]]*+=[[:space:]]*QwtSVGItem\)%\1%g" qwtconfig.pri
         # specify correct installation path for the designer plugin (required only for qwt 5.x)
@@ -104,7 +90,24 @@ if [ "${patch_build_procedure}" = "1" ] ; then
     fi
 fi
 
-INSTALL_ROOT_PREV=$INSTALL_ROOT
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
+
+# to generate environment scripts
+try_preinstalled
+}
+
+install_source_and_build()
+{
+# install sources
+install_source
+
+# build sources
+cd ${PRODUCT_SRC_DIR}
+test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+
+# workaround : clear INSTALL_ROOT env.var if it is set
 unset INSTALL_ROOT
 
 # configure with qmake
@@ -115,7 +118,7 @@ qmake
 
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 EOF
 
 check_job ${PRODUCT_DIR}/MAKE.LOG make
@@ -124,14 +127,15 @@ check_job ${PRODUCT_DIR}/MAKE.LOG make
 
 check_job ${PRODUCT_DIR}/MAKE_INSTALL.LOG make install
 
-if [ "${INSTALL_ROOT_PREV}" != "" ] ; then
-    export INSTALL_ROOT=$INSTALL_ROOT_PREV
-fi
+cd ${PRODUCT_DIR}
 
-cd ${PRODUCT_DIR};
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
 
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -142,7 +146,7 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
@@ -150,7 +154,7 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
 
 # patch features files (required for Qwt 6.x only)
-if [ "${QWT_MAJOR_VERSION}" == "6" ] ; then
+if [ "${QWT_MAJOR_VERSION}" = "6" ] ; then
     test -f ${PRODUCT_DIR}/features/qwtconfig.pri && cd ${PRODUCT_DIR}/features && sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
 fi
 
@@ -167,10 +171,10 @@ export PRODUCT_TYPE=$6;
 export INSTALL_PRODUCTS=$7;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="qwt-${QWT_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="qwt-${VERSION_QWT}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE 
+${PROCEDURE} 
index f00f3e0c5d1dabe349cda8046fa34ce9c82a2fd0..5d83878a3731103290f5e39ffdea8288855f9bb0 100755 (executable)
@@ -19,15 +19,15 @@ check_enabled()
     ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`;
     # 1. check if there is appropriate PDF files viewer
     for r in acroread kpdf kghostview xpdf ; do
-       reader=`which $r 2>/dev/null`
-       if [ "$?" == "0" ] ; then
+       reader=`which ${r} 2>/dev/null`
+       if [ "$?" = "0" ] ; then
            break;
        fi
     done
     # 2. check if Release Notes file is available
     if [ "${ROOT_DIR}" != "" ] ; then 
        rn_files=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"`
-       if [ "$?" == "0" ] && [ "$rn_files" != "" ] && [ "$reader" != "" ] ; then
+       if [ "$?" = "0" ] && [ "${rn_files}" != "" ] && [ "${reader}" != "" ] ; then
            return 0;
        fi
     fi
@@ -41,16 +41,16 @@ execute()
     ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`;
     # 1. find appropriate PDF files viewer
     for r in acroread kpdf kghostview xpdf ; do
-       reader=`which $r 2> /dev/null`
-       if [ "$?" == "0" ] ; then
+       reader=`which ${r} 2> /dev/null`
+       if [ "$?" = "0" ] ; then
            break;
        fi
     done
     # 2. find Release Notes file and open it in the viewer
     if [ "${ROOT_DIR}" != "" ] ; then 
        rn_file=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"`
-       if [ "$?" == "0" ] && [ "$rn_file" != "" ] && [ "$reader" != "" ] ; then
-           $reader ${rn_file} &
+       if [ "$?" = "0" ] && [ "${rn_file}" != "" ] && [ "${reader}" != "" ] ; then
+           ${reader} ${rn_file} &
            return 0;
        fi
     fi
@@ -68,4 +68,4 @@ INST_ROOT=$2;
 INSTALL_WORK=$3;
 
 # Run the procedure
-$PROCEDURE
+${PROCEDURE}
index d9d2bb40b98230f5d4384fbec4c513f1a4f27942..9c708e03b035f4706647a2676d9df4d268eac340 100755 (executable)
@@ -14,9 +14,9 @@
 
 install_work=$1;  product_sequence=$2
 source ./common.sh
-for i in $product_sequence ; do
+for i in ${product_sequence} ; do
     file=${install_work}/env_${i}.sh
     (test -f ${file} && rm -f ${file})
 done 
-(file=${install_work}/$SHRC && test -f ${file} && rm -f ${file})
-(file=${install_work}/$CSHRC && test -f ${file} && rm -f ${file})
+(file=${install_work}/${SHRC}  && test -f ${file} && rm -f ${file})
+(file=${install_work}/${CSHRC} && test -f ${file} && rm -f ${file})
index a9ec81cedc6eb2f40f13c3fdd699996fe19114f5..313a58ebb3fca775c1053d9bb0ec279ffd570d5c 100755 (executable)
@@ -15,7 +15,7 @@
 #
 # scotch version
 #
-SCOTCH_VERSION=5.1.11
+VERSION_SCOTCH=5.1.11
 
 check_version(){
 # No way to check version!
@@ -25,8 +25,8 @@ return 0
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM 
-export SCOTCHDIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+#${DELIM} ${PRODUCT_TYPE} ${DELIM} 
+export SCOTCH_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -36,7 +36,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -53,10 +53,14 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
+
 # to generate environment scripts
 try_preinstalled
 }
@@ -93,10 +97,15 @@ check_job ${PRODUCT_DIR}/MAKE.LOG make prefix=${PRODUCT_DIR}
 # make install
 check_job ${PRODUCT_DIR}/INSTALL.LOG make prefix=${PRODUCT_DIR} install
 
-cd ${PRODUCT_DIR};
+cd ${PRODUCT_DIR}
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
 
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -107,7 +116,7 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
@@ -127,10 +136,10 @@ export PRODUCT_TYPE=$6;
 export INSTALL_PRODUCTS=$7;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="scotch-${SCOTCH_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="scotch-${VERSION_SCOTCH}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE
+${PROCEDURE}
index 169c0dde9b20b10e2139d74f42333bcd33be6408..b38bc0df47422510eef8dcef3ca7fdcb3bbcc179 100755 (executable)
 #
 # sip version
 #
-SIP_VERSION=4.14.2
-SIP_XVERSION=`echo ${SIP_VERSION} | awk -F. '{printf("%d",$1*10000+$2*100+$3)}'`
+VERSION_SIP=4.14.2
+SIP_XVERSION=`echo ${VERSION_SIP} | awk -F. '{printf("%d",$1*10000+$2*100+$3)}'`
 
 check_version()
 {
-if [ -n "${SIPDIR}" ]; then
-    ver=`${SIPDIR}/bin/sip -V | awk '{print $1}'`
-    maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
-    min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
-    rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
-    let ver=$maj_ver*10000+$min_ver*100+$rel_ver
-    if [ $ver -eq ${SIP_XVERSION} ] ; then
+if [ -n "${SIP_ROOT_DIR}" ]; then
+    ver=`${SIP_ROOT_DIR}/bin/sip -V | awk '{print $1}'`
+    maj_ver=`echo ${ver} | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
+    min_ver=`echo ${ver} | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
+    rel_ver=`echo ${ver} | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
+    let ver=${maj_ver}*10000+${min_ver}*100+${rel_ver}
+    if [ ${ver} -eq ${SIP_XVERSION} ] ; then
        return 0
     fi
 fi
@@ -36,12 +36,11 @@ return 1
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export SIPDIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export SIP_ROOT_DIR=\${SIPDIR}
-export PATH=\${SIPDIR}/bin:\${PATH}
-export PYTHONPATH=\${SIPDIR}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
-export LD_LIBRARY_PATH=\${SIPDIR}/lib/python\${PYTHON_VERSION}/site-packages:\${LD_LIBRARY_PATH}
+#${DELIM} ${PRODUCT_TYPE} ${DELIM}
+export SIP_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export PATH=\${SIP_ROOT_DIR}/bin:\${PATH}
+export PYTHONPATH=\${SIP_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages:\${PYTHONPATH}
+export LD_LIBRARY_PATH=\${SIP_ROOT_DIR}/lib/python\${PYTHON_VERSION}/site-packages:\${LD_LIBRARY_PATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -51,7 +50,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -68,10 +67,14 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
+
 # to generate environment scripts
 try_preinstalled
 }
@@ -96,15 +99,20 @@ fi
 check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${SIP_CONFIGURE_OPTIONS}
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 EOF
 check_job ${PRODUCT_DIR}/MAKE.LOG make
 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
 
 cd ${PRODUCT_DIR};
 
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
+
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -115,7 +123,7 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
@@ -131,29 +139,23 @@ if test `uname -m` = "x86_64" ; then
 fi
 
 # modify sipconfig.py file
-if [ -n "${PYTHONROOT}" ] && [ -n "${QTDIR}" ] ; then
-    cd ${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages
+if [ -n "${PYTHON_ROOT_DIR}" ] && [ -n "${QT4_ROOT_DIR}" ] ; then
+    cfg_file=${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages/sipconfig.py
     python_version=`python -V 2>&1 | awk '{print $2}' | awk -F. '{printf("0x%02d%02d%02d",$1,$2,$3)}'`
-    qt_version=`grep -e "^#define[[:space:]]\+QT_VERSION[[:space:]]\+" ${QTDIR}/include/Qt/qglobal.h | sed -e 's%^#define[[:space:]\+QT_VERSION[[:space:]]\+\(.*\)$%\1%g'`
-    sed -e "s%\('default_bin_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/bin',%g" \
-       -e "s%\('default_mod_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/lib/python${PYTHON_VERSION}/site-packages',%g" \
-       -e "s%\('default_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" \
-       -e "s%\('sip_bin':[[:space:]]*\).*%\1'${PRODUCT_DIR}/bin/sip',%g" \
-       -e "s%\('sip_inc_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/include/python${PYTHON_VERSION}',%g" \
-       -e "s%\('sip_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g" \
-       -e "s%\('qt_dir':[[:space:]]*\).*%\1'${QTDIR}',%g" \
-       -e "s%\('qt_version':[[:space:]]*\).*%\1${qt_version},%g" \
-       -e "s%\('qt_inc_dir':[[:space:]]*\).*%\1'${QTDIR}/include',%g" \
-       -e "s%\('qt_lib_dir':[[:space:]]*\).*%\1'${QTDIR}/lib',%g" \
-       -e "s%\('INCDIR_QT':[[:space:]]*\).*%\1'${QTDIR}/include',%g" \
-       -e "s%\('LIBDIR_QT':[[:space:]]*\).*%\1'${QTDIR}/lib',%g" \
-       -e "s%\('MOC':[[:space:]]*\).*%\1'${QTDIR}/bin/moc',%g" \
-       -e "s%\('py_version':[[:space:]]*\).*%\1${python_version},%g" \
-       -e "s%\('sip_config_args':[[:space:]]*\).*%\1'${SIP_CONFIGURE_OPTIONS}',%g" \
-       -e "s%\('py_inc_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/include/python${PYTHON_VERSION}',%g" \
-       -e "s%\('py_lib_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/lib/python${PYTHON_VERSION}/config',%g" \
-       -e "s%\('py_conf_inc_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/include/python${PYTHON_VERSION}',%g" sipconfig.py > sipconfig.py.1
-    mv -f sipconfig.py.1 sipconfig.py
+    qt_version=`grep -e "^#define[[:space:]]\+QT_VERSION[[:space:]]\+" ${QT4_ROOT_DIR}/include/Qt/qglobal.h | sed -e 's%^#define[[:space:]\+QT_VERSION[[:space:]]\+\(.*\)$%\1%g'`
+    sed -i "s%\('default_bin_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/bin',%g"                                                          ${cfg_file}
+    sed -i "s%\('default_mod_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g"                    ${cfg_file}
+    sed -i "s%\('default_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g;s%\('sip_bin':[[:space:]]*\).*%\1'${PRODUCT_DIR}/bin/sip',%g" ${cfg_file}
+    sed -i "s%\('sip_inc_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/include/python${PYTHON_VERSION}',%g"                                      ${cfg_file}
+    sed -i "s%\('sip_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g"                            ${cfg_file}
+    sed -i "s%\('qt_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}',%g;s%\('qt_version':[[:space:]]*\).*%\1${qt_version},%g"                     ${cfg_file}
+    sed -i "s%\('qt_inc_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/include',%g;s%\('qt_lib_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/lib',%g" ${cfg_file}
+    sed -i "s%\('INCDIR_QT':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/include',%g;s%\('LIBDIR_QT':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/lib',%g"   ${cfg_file}
+    sed -i "s%\('MOC':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/bin/moc',%g;s%\('py_version':[[:space:]]*\).*%\1${python_version},%g"            ${cfg_file}
+    sed -i "s%\('sip_config_args':[[:space:]]*\).*%\1'${SIP_CONFIGURE_OPTIONS}',%g"                                                        ${cfg_file}
+    sed -i "s%\('py_inc_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}',%g"                                   ${cfg_file}
+    sed -i "s%\('py_lib_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/config',%g"                                ${cfg_file}
+    sed -i "s%\('py_conf_inc_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}',%g"                              ${cfg_file}
 fi
 
 # to generate environment scripts
@@ -169,10 +171,10 @@ export PRODUCT_TYPE=$6;
 export INSTALL_PRODUCTS=$7;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="sip-${SIP_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="sip-${VERSION_SIP}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE 
+${PROCEDURE} 
index e500cc134daf505d31428da4af367e3ea1caf1cc..5216471b438a6887de4d23c99175043801be92f1 100755 (executable)
@@ -36,7 +36,7 @@ execute()
     if [ "${KERNEL_ROOT_DIR}" != "" ] && [ "${GUI_ROOT_DIR}" != "" ] && 
        [ -f ${KERNEL_ROOT_DIR}/bin/salome/runSalome ] ; then
        env SALOME_TEST_MODE=1 runSalome >& /dev/null
-       if [ "$?" == "0" ] ; then
+       if [ "$?" = "0" ] ; then
            return 0;
        fi
     fi
@@ -54,4 +54,4 @@ INST_ROOT=$2;
 INSTALL_WORK=$3;
 
 # Run the procedure
-$PROCEDURE
+${PROCEDURE}
index 9d1c9c3ae8b215bc663beebbe981dbf6bcd938fd..e3190398cc8d6c3211c7fe1faef37e7fcd2f3385 100755 (executable)
 #
 # swig version
 #
-SWIG_VERSION=2.0.8
+VERSION_SWIG=2.0.8
+SWIG_VERSION_SUFFIX=`echo ${VERSION_SWIG} | awk -F. '{printf("%d.%d", $1, $2)}'`
 
 check_version(){
 if [ -n "`which swig 2>/dev/null`" ]; then
     ver=`swig -version 2>&1 | grep -i version | awk '{ print $3 }' | sed -e 's/^\([0-9.]*\)\(.*\)/\1/'`
-    if [ "$ver" == "${SWIG_VERSION}" ] ;  then 
+    if [ "${ver}" = "${VERSION_SWIG}" ] ;  then 
        return 0;
     fi
 fi
@@ -30,11 +31,10 @@ return 1;
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM 
-export SWIG_ROOT=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export SWIG_ROOT_DIR=\${SWIG_ROOT}
-export SWIG_LIB=\${SWIG_ROOT}/share/swig/${SWIG_VERSION}
-export PATH=\${SWIG_ROOT}/bin:\${PATH}
+#${DELIM} ${PRODUCT_TYPE} ${DELIM} 
+export SWIG_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export SWIG_LIB=\${SWIG_ROOT_DIR}/share/swig/${VERSION_SWIG}
+export PATH=\${SWIG_ROOT_DIR}/bin:\${PATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -44,7 +44,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -61,10 +61,14 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SRC_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
+
 # to generate environment scripts
 try_preinstalled
 }
@@ -76,7 +80,7 @@ install_source
 
 # build sources
 cd ${PRODUCT_SRC_DIR}
-SWIG_CONFIGURE_FLAGS="--with-boost=${BOOSTDIR} --with-python=${PYTHONHOME}/bin/python --without-octave --with-tcl=${TCLHOME}"
+SWIG_CONFIGURE_FLAGS="--with-boost=${BOOST_ROOT_DIR} --with-python=${PYTHON_ROOT_DIR}/bin/python --without-octave --with-tcl=${TCLHOME} --program-suffix=${SWIG_VERSION_SUFFIX}"
 if test `uname -m` = "x86_64" ; then
     SWIG_CONFIGURE_FLAGS="${SWIG_CONFIGURE_FLAGS} CFLAGS=-m64 CXXFLAGS=-m64"
 fi
@@ -85,15 +89,26 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${SWIG_CONFIGURE_FLAGS}
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 EOF
 check_job ${PRODUCT_DIR}/MAKE.LOG make
 check_job ${PRODUCT_DIR}/INSTALL.LOG make install 
 
-cd ${PRODUCT_DIR};
+for l in swig ccache-swig ; do
+    if [ -e ${PRODUCT_DIR}/bin/${l}${SWIG_VERSION_SUFFIX} ] ; then
+       ( cd ${PRODUCT_DIR}/bin && ln -fs ${l}${SWIG_VERSION_SUFFIX} ${l} )
+    fi
+done
+
+cd ${PRODUCT_DIR}
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
 
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -104,7 +119,7 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
@@ -125,10 +140,10 @@ export INSTALL_PRODUCTS=$7;
 SRC_DIR=$8;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="swig-${SWIG_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="swig-${VERSION_SWIG}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE
+${PROCEDURE}
index cd048ea931fdf55a2988aa08445aead1b82b827f..5675581440e145c066c65bb1abe6fc47bd9efc01 100755 (executable)
 #
 ####################################################################################
 
-TBB_VERSION=30_018oss
+VERSION_TBB=30_018oss
 TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21'
 
 if test `uname -m` = "x86_64" ; then
-    export TBBMODE="intel64/$TBBKERNEL"
+    export TBBMODE="intel64/${TBBKERNEL}"
 else
-    export TBBMODE="ia32/$TBBKERNEL"
+    export TBBMODE="ia32/${TBBKERNEL}"
 fi
 
 check_version(){
@@ -29,10 +29,10 @@ return 0
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM
-export TBBHOME=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export PATH=\${TBBHOME}/bin/$TBBMODE:\$PATH 
-export LD_LIBRARY_PATH=\${TBBHOME}/lib/$TBBMODE:\${LD_LIBRARY_PATH}
+#${DELIM} ${PRODUCT_TYPE} ${DELIM}
+export TBB_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
+export PATH=\${TBB_ROOT_DIR}/bin/${TBBMODE}:\${PATH} 
+export LD_LIBRARY_PATH=\${TBB_ROOT_DIR}/lib/${TBBMODE}:\${LD_LIBRARY_PATH}
 ##
 EOF
 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
@@ -42,7 +42,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -64,19 +64,24 @@ echo "It's impossible to install ${PRODUCT} from sources"
 install_source_and_build()
 {
 install_binary
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    echo "0" > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+    du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+    cp ${INST_ROOT}/${PRODUCT_TYPE}.bin.size ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+fi
 }
 
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
 check_jb tar xfz ${BIN_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
 
-
 # to generate environment script
 try_preinstalled
 }
@@ -92,10 +97,10 @@ SRC_DIR=$8;
 REMOVE_SRC_TMP=$9;
 shift
 BIN_DIR=$9;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="tbb${TBB_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="tbb-${VERSION_TBB}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE 
+${PROCEDURE} 
index b3a97d06b813bf98f4bc12242c4c750153c4017c..e29620db838a84779f6a34c27b3c6c518aacd981 100755 (executable)
 #
 # tcl, tk and tclX versions
 #
-TCL_VERSION=8.6.0
-TK_VERSION=8.6.0
-TCLX_VERSION=8.4.1
+VERSION_TCL=8.6.0
+VERSION_TK=8.6.0
+VERSION_TCLX=8.4.1
 #
-TCL_LIBVERSION=`echo $TCL_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'`
-TK_LIBVERSION=`echo $TK_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'`
-TCLX_LIBVERSION=`echo $TCLX_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'`
+TCL_LIBVERSION=`echo ${VERSION_TCL} | awk -F. '{printf("%d.%d", $1, $2)}'`
+TK_LIBVERSION=`echo ${VERSION_TK} | awk -F. '{printf("%d.%d", $1, $2)}'`
+TCLX_LIBVERSION=`echo ${VERSION_TCLX} | awk -F. '{printf("%d.%d", $1, $2)}'`
 
 check_version()
 {
-if [ -z "$TCLHOME" ]; then
+if [ -z "${TCLHOME}" ]; then
    echo "TCLHOME doesn't set"
    return 1
 fi
@@ -36,8 +36,8 @@ if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/tcl${TCL_LIBVERSION}/lib/tclConf
 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${TCL_LIBVERSION}/tclConfig.sh; fi
 if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${TCL_LIBVERSION}/lib/tclConfig.sh; fi
 if [ -f ${tcl_cfg} ]; then
-    tcl_ver=`awk '/^TCL_VERSION=.*/ {gsub("TCL_VERSION=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2`
-    if [ "$tcl_ver" != ${TCL_LIBVERSION} ] ; then
+    tcl_ver=`awk '/^VERSION_TCL=.*/ {gsub("VERSION_TCL=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2`
+    if [ "${tcl_ver}" != ${TCL_LIBVERSION} ] ; then
        return 1
     fi
 else
@@ -50,8 +50,8 @@ if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/tk${TK_LIBVERSION}/tkConfig.sh; fi
 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${TK_LIBVERSION}/tkConfig.sh; fi
 if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${TK_LIBVERSION}/lib/tkConfig.sh; fi
 if [ -f ${tk_cfg} ]; then
-    tk_ver=`awk '/^TK_VERSION=.*/ {gsub("TK_VERSION=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2`
-    if [ "$tk_ver" != ${TK_LIBVERSION} ] ; then
+    tk_ver=`awk '/^VERSION_TK=.*/ {gsub("VERSION_TK=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2`
+    if [ "${tk_ver}" != ${TK_LIBVERSION} ] ; then
        return 1
     fi
 else
@@ -64,7 +64,7 @@ return 0
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM
+#${DELIM} ${PRODUCT_TYPE} ${DELIM}
 export TCLHOME=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export TCLLIBPATH="\${TCLHOME}/lib \${TCLHOME}/lib/tcl${TCL_LIBVERSION} \${TCLHOME}/lib/tk${TK_LIBVERSION}"
 export PATH=\${TCLHOME}/bin:\${PATH}
@@ -78,7 +78,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -95,13 +95,17 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 mkdir -p ${PRODUCT_SRC_DIR}
 
-check_jb tar xfz ${SOURCE_DIR}/tcl-${TCL_VERSION}.tar.gz -C ${PRODUCT_SRC_DIR}
-check_jb tar xfz ${SOURCE_DIR}/tk-${TK_VERSION}.tar.gz -C ${PRODUCT_SRC_DIR}
-check_jb tar xfz ${SOURCE_DIR}/tclx-${TCLX_VERSION}.tar.gz -C ${PRODUCT_SRC_DIR}
+check_jb tar xfz ${SOURCE_DIR}/tcl-${VERSION_TCL}.tar.gz   -C ${PRODUCT_SRC_DIR}
+check_jb tar xfz ${SOURCE_DIR}/tk-${VERSION_TK}.tar.gz     -C ${PRODUCT_SRC_DIR}
+check_jb tar xfz ${SOURCE_DIR}/tclx-${VERSION_TCLX}.tar.gz -C ${PRODUCT_SRC_DIR}
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
+fi
 
 # to generate environment scripts
 try_preinstalled
@@ -115,7 +119,7 @@ install_source
 # build sources
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
-cd ${PRODUCT_SRC_DIR}/tcl-${TCL_VERSION}_SRC/unix
+cd ${PRODUCT_SRC_DIR}/tcl-${VERSION_TCL}_SRC/unix
 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
 -------------------
 Configuring tcl...
@@ -125,11 +129,10 @@ local TCL_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads"
 if test `uname -m` = "x86_64" ; then
     TCL_CONFIGURE_FLAGS="${TCL_CONFIGURE_FLAGS} --enable-64bit"
 fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure \
-    --prefix=${PRODUCT_DIR} ${TCL_CONFIGURE_FLAGS}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TCL_CONFIGURE_FLAGS}
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 -------------------
 Making tcl...
 -------------------
@@ -142,11 +145,11 @@ Installing tcl...
 EOF
 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
 
-(cd ${PRODUCT_DIR}/bin; ln -fs tclsh${TCL_LIBVERSION} tclsh)
-(cd ${PRODUCT_DIR}/lib; ln -fs libtcl${TCL_LIBVERSION}.so libtcl.so)
-(cd ${PRODUCT_DIR}/lib; ln -fs libtclstub${TCL_LIBVERSION}.a libtclstub.a)
+(cd ${PRODUCT_DIR}/bin && ln -fs tclsh${TCL_LIBVERSION} tclsh)
+(cd ${PRODUCT_DIR}/lib && ln -fs libtcl${TCL_LIBVERSION}.so libtcl.so)
+(cd ${PRODUCT_DIR}/lib && ln -fs libtclstub${TCL_LIBVERSION}.a libtclstub.a)
 
-cd ${PRODUCT_SRC_DIR}/tk-${TK_VERSION}_SRC/unix
+cd ${PRODUCT_SRC_DIR}/tk-${VERSION_TK}_SRC/unix
 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
 -------------------
 Configuring tk...
@@ -156,7 +159,7 @@ local TK_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads --with-t
 if test `uname -m` = "x86_64" ; then
     TK_CONFIGURE_FLAGS="${TK_CONFIGURE_FLAGS} --enable-64bit"
 fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${TK_CONFIGURE_FLAGS} --prefix=${PRODUCT_DIR}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TK_CONFIGURE_FLAGS}
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
 -------------------
 Making tk...
@@ -170,13 +173,9 @@ Installing tk...
 EOF
 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
 
-(cd ${PRODUCT_DIR}/bin; ln -fs wish${TK_LIBVERSION} wish)
-(cd ${PRODUCT_DIR}/lib; ln -fs libtk${TK_LIBVERSION}.so libtk.so)
-(cd ${PRODUCT_DIR}/lib; ln -fs libtkstub${TK_LIBVERSION}.a libtkstub.a)
-
-#cd ${PRODUCT_SRC_DIR}/tclx-${TCLX_VERSION}_SRC
-##INV - bug in a tclx configure 
-#chmod +w configure && sed -i "s/relid'/relid/" configure
+(cd ${PRODUCT_DIR}/bin && ln -fs wish${TK_LIBVERSION} wish)
+(cd ${PRODUCT_DIR}/lib && ln -fs libtk${TK_LIBVERSION}.so libtk.so)
+(cd ${PRODUCT_DIR}/lib && ln -fs libtkstub${TK_LIBVERSION}.a libtkstub.a)
 
 cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
 -------------------
@@ -187,8 +186,7 @@ local TCLX_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads --with
 if test `uname -m` = "x86_64" ; then
     TCLX_CONFIGURE_FLAGS="${TCLX_CONFIGURE_FLAGS} --enable-64bit"
 fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure \
-    --prefix=${PRODUCT_DIR} ${TCLX_CONFIGURE_FLAGS}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TCLX_CONFIGURE_FLAGS}
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
 -------------------
 Making tclx...
@@ -202,13 +200,19 @@ Installing tclx...
 EOF
 check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
 
-(cd ${PRODUCT_DIR}/lib; ln -fs tclx${TCLX_LIBVERSION}/libtclx${TCLX_LIBVERSION}.so libtclx.so)
+(cd ${PRODUCT_DIR}/lib && ln -fs tclx${TCLX_LIBVERSION}/libtclx${TCLX_LIBVERSION}.so .)
+(cd ${PRODUCT_DIR}/lib && ln -fs libtclx${TCLX_LIBVERSION}.so libtclx.so)
+###(cd ${PRODUCT_DIR} && test `uname -m` = "x86_64" && test ! -e lib64 && ln -sf lib lib64)
 
-#cd ${PRODUCT_DIR}
-#test `uname -m` = "x86_64" && test ! -e lib64 && ln -s lib lib64
+cd ${PRODUCT_DIR}
+
+if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
+    du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
+    du -sk ${PRODUCT_DIR}     > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
+fi
 
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -219,31 +223,23 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a product directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
 
-# overriding installation path
-cd ${PRODUCT_DIR}/lib
-old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
-sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh
-sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh
-
-cd ${PRODUCT_DIR}
-test `uname -m` = "x86_64" && test ! -e lib64 && ln -s lib lib64
+# add symbolic link for 64bit platforms (VSR: is it indeed needed?)
+(cd ${PRODUCT_DIR} && test `uname -m` = "x86_64" && test ! -e lib64 && ln -sf lib lib64)
 
-# modify pkgconfig
-if [ -d ${PRODUCT_DIR}/lib/pkgconfig ] ; then
-  cd ${PRODUCT_DIR}/lib/pkgconfig
-  for l in X `find . -name "*.pc"`; do
+# overriding installation path
+old_prefix=`grep -e "^TCL_PREFIX='.*'" ${PRODUCT_DIR}/lib/tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"`
+for l in X `find ${PRODUCT_DIR}/lib -name "*Config.sh"` `find ${PRODUCT_DIR}/lib/pkgconfig -name "*.pc"` ; do
     if [ "${l}" != "X" ] ; then
-      sed -i "s%^prefix=.*%prefix=${PRODUCT_DIR}%g;s%exec_prefix=.*%exec_prefix=${PRODUCT_DIR}%g;s%libdir=.*%libdir=${PRODUCT_DIR}/lib%g" ${l}
+       sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" ${l}
     fi
-  done
-fi
+done
 
 # to generate environment scripts
 try_preinstalled
@@ -258,10 +254,10 @@ export PRODUCT_TYPE=$6;
 export INSTALL_PRODUCTS=$7;
 shift
 REMOVE_SRC_TMP=$8;
-test $# == 10 && shift && SINGLE_DIR=$9
-export PRODUCT="tcltk-${TCL_VERSION}"
+test $# = 10 && shift && SINGLE_DIR=$9
+export PRODUCT="tcltk-${VERSION_TCL}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
 source ./common.sh
-$PROCEDURE 
+${PROCEDURE} 
index 451b8eb08fea9855ded88bd3b58da41abcccbcc4..c195d19666a15293834759d679d9a8bd3340b919 100755 (executable)
@@ -25,7 +25,7 @@ return 0
 print_env_bin()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
-#$DELIM ${PRODUCT_TYPE} $DELIM 
+#${DELIM} ${PRODUCT_TYPE} ${DELIM} 
 export XDATAROOT=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PATH=\${XDATAROOT}/bin:\${PATH}
 export PYTHONPATH=\${XDATAROOT}/lib/python\${PYTHON_VERSION}/site-packages/xdata:\${PYTHONPATH}
@@ -38,7 +38,7 @@ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}
 print_env_src()
 {
 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#$DELIM ${PRODUCT_TYPE}_src $DELIM
+#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
 # nothing to do
 ##
 EOF
@@ -55,7 +55,7 @@ return $?
 install_source()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 check_jb tar xfz ${SRC_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
 
@@ -76,7 +76,7 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} 
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=$GCC
+used gcc=${GCC}
 EOF
 check_job ${PRODUCT_DIR}/MAKE.LOG make
 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
@@ -84,7 +84,7 @@ check_job ${PRODUCT_DIR}/INSTALL.LOG make install
 cd ${PRODUCT_DIR};
 
 # remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then
+if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
     test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
 fi
 
@@ -95,7 +95,7 @@ try_preinstalled
 install_binary()
 {
 make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/$SHRC
+source ${INSTALL_WORK}/${SHRC}
 
 # create a module directory
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
@@ -120,8 +120,8 @@ shift
 REMOVE_SRC_TMP=$8;
 shift
 SINGLE_DIR=$9;
-if [ -n "$SINGLE_DIR" ] ; then SINGLE_DIR=$SDIR_NAME; fi
+if [ -n "${SINGLE_DIR}" ] ; then SINGLE_DIR=${SDIR_NAME}; fi
 export PRODUCT="xdata-${XDATA_VERSION}"
 export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
 export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
-$PROCEDURE
+${PROCEDURE}