Salome HOME
Prepare SALOME 2.2.6 installation
[tools/install.git] / config_files / common.sh
index 917e4840b8033b18b658c367f272756d81aabc01..a7c0c47baba3f49bfa0f35b2d2bcaf27fb687bdd 100755 (executable)
@@ -386,4 +386,50 @@ else
     echo $arg1:$arg2
 fi
 return $to_tail
-}
\ No newline at end of file
+}
+
+where_tcl(){
+if test -z "${TCLHOME}"; then
+    TCLHOME=/usr
+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
+    fi
+done
+if test -n "$file"; then
+    echo `dirname $file`
+    return 0
+else
+    echo ""
+    return 1
+fi
+}
+
+where_tk(){
+if test -z "${TCLHOME}"; then
+    TCLHOME=/usr
+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
+    fi
+done
+if test -n "$file"; then
+    echo `dirname $file`
+    return 0
+else
+    echo ""
+    return 1
+fi
+}