check_version(){
# version number is calculated as: <major>*10000+<minor>*100+<release>
# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.3.2 - 30202
-gcc_ver=`gcc -dumpversion | awk -F. '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
+gcc_ver=`gcc -dumpversion | awk -F[.-] '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
if [ $gcc_ver -eq 30200 ] ; then
return 0
fi
# <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
# version number is calculated as: <major>*10000+<minor>*100+<release>
# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.3.2 - 30202
- maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
- min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
- rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
+ maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>0) print $1; else print 0}'`
+ min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>1) print $2; else print 0}'`
+ rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>2) print $3; else print 0}'`
let gcc_ver=$maj_ver*10000+$min_ver*100+$rel_ver
if [ $gcc_ver -ge 30200 ] ; then
tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}";
check_version(){
# version number is calculated as: <major>*10000+<minor>*100+<release>
# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.4.1 - 30401
-gcc_ver=`gcc -dumpversion | awk -F. '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
+gcc_ver=`gcc -dumpversion | awk -F[.-] '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
if [ $gcc_ver -eq 30401 ] ; then
return 0
fi
# <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
# version number is calculated as: <major>*10000+<minor>*100+<release>
# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.4.1 - 30401
- maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
- min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
- rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
+ maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>0) print $1; else print 0}'`
+ min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>1) print $2; else print 0}'`
+ rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>2) print $3; else print 0}'`
let gcc_ver=$maj_ver*10000+$min_ver*100+$rel_ver
if [ $gcc_ver -ge 30401 ] ; then
tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}";