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="`find_in_path gcc ${PATH}`"
30 if [ -z "${gcc_root}" ] ; then
31 gcc_root="`find_in_path gcc /usr/bin`"
33 if [ -n "${gcc_root}" ] ; then
34 gcc_root=`cd ${gcc_root}/..; pwd`
35 # get version number: <major>, <minor> and <release>
36 # <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
37 # version number is calculated as: <major>*10000+<minor>*100+<release>
38 # e.g. for gcc 3.2 it is equal to 30200, for gcc 3.4.1 - 30401
39 maj_ver=`gcc -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
40 min_ver=`gcc -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
41 rel_ver=`gcc -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
42 let gcc_ver=$maj_ver*10000+$min_ver*100+$rel_ver
43 if [ $gcc_ver -ge 30401 ] ; then
44 tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}";
45 path=`sort_path ${tmp}`
46 tmp="\${GCC_ROOT}/lib ${gcc_root}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
47 ld_library_path=`sort_path ${tmp}`
48 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
49 #$DELIM ${PRODUCT_TYPE} $DELIM
50 export GCC_ROOT=${gcc_root}
51 export CXX=\${GCC_ROOT}/bin/g++
52 export CC=\${GCC_ROOT}/bin/gcc
54 export LD_LIBRARY_PATH=${ld_library_path}
57 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
58 ####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
59 # if [ $maj_ver -eq 3 ] && [ $min_ver -eq 4 ] && [ $rel_ver -eq 1 ] ; then
60 ######################################################################################
61 if [ $maj_ver -eq 3 ] && [ $min_ver -eq 4 ] && [ $rel_ver -ge 1 ] ; then
72 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
78 echo "The installation of gcc 3.4.1 from sources is not provided! Use native gcc."
84 echo "The installation of gcc 3.4.1 from binaries is not provided! Use native gcc."
89 export INSTALL_WORK=$2;
91 export INSTALL_ROOT=$4;
92 export PRODUCT_SEQUENCE=$5;
93 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="gcc" ; fi
94 export PRODUCT="gcc-3.4.1"
95 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
96 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}