X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=config_files%2Fcommon.sh;h=a7c0c47baba3f49bfa0f35b2d2bcaf27fb687bdd;hb=1a5386dd06e7c8b847fc15a343947fa05658f112;hp=917e4840b8033b18b658c367f272756d81aabc01;hpb=15d500ad3ebc31eec8b286677cf4cee0e9899307;p=tools%2Finstall.git diff --git a/config_files/common.sh b/config_files/common.sh index 917e484..a7c0c47 100755 --- a/config_files/common.sh +++ b/config_files/common.sh @@ -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 +}