4 # version number is calculated as: <major>*10000+<minor>*100+<release>
5 # e.g. for gcc 3.2 it is equal to 30200, for gcc 3.4.1 - 30401
6 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}'`
7 if [ $gcc_ver -eq 30401 ] ; then
14 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
15 #$DELIM ${PRODUCT_TYPE} $DELIM
16 export GCC_ROOT=\${INSTALL_ROOT}/${PRODUCT}
17 export CXX=\${GCC_ROOT}/bin/g++
18 export CC=\${GCC_ROOT}/bin/gcc
19 export PATH=\${GCC_ROOT}/bin:\${PATH}
20 export LD_LIBRARY_PATH=\${GCC_ROOT}/lib:\${LD_LIBRARY_PATH}
23 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
24 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
27 # looks for the native product and collects it's environment (used by make_env())
29 gcc_root="`where_gcc 3.4.1`"
30 if [ -n "${gcc_root}" ] ; then
31 gcc_root=`cd ${gcc_root}/..; pwd`
32 # get version number: <major>, <minor> and <release>
33 # <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
34 # version number is calculated as: <major>*10000+<minor>*100+<release>
35 # e.g. for gcc 3.2 it is equal to 30200, for gcc 3.4.1 - 30401
36 maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
37 min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
38 rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
39 let gcc_ver=$maj_ver*10000+$min_ver*100+$rel_ver
40 if [ $gcc_ver -ge 30401 ] ; then
41 tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}";
42 path=`sort_path ${tmp}`
43 tmp="\${GCC_ROOT}/lib ${gcc_root}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
44 ld_library_path=`sort_path ${tmp}`
45 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
46 #$DELIM ${PRODUCT_TYPE} $DELIM
47 export GCC_ROOT=${gcc_root}
48 export CXX=\${GCC_ROOT}/bin/g++
49 export CC=\${GCC_ROOT}/bin/gcc
51 export LD_LIBRARY_PATH=${ld_library_path}
54 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
55 ####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
56 # if [ $maj_ver -eq 3 ] && [ $min_ver -eq 4 ] && [ $rel_ver -eq 1 ] ; then
57 ######################################################################################
58 if [ $maj_ver -eq 3 ] && [ $min_ver -eq 4 ] && [ $rel_ver -ge 1 ] ; then
69 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
75 echo "The installation of gcc 3.4.1 from sources is not provided! Use native gcc."
81 echo "The installation of gcc 3.4.1 from binaries is not provided! Use native gcc."
86 export INSTALL_WORK=$2;
88 export INSTALL_ROOT=$4;
89 export PRODUCT_SEQUENCE=$5;
90 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="gcc" ; fi
91 export PRODUCT="gcc-3.4.1"
92 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
93 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}