+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
+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
+ return 0
+ fi
+ 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
+ return 0
+fi
+return 1
+}
+