From: vsr Date: Fri, 29 Nov 2013 15:16:01 +0000 (+0000) Subject: Prepare SALOME 7.3.0 X-Git-Tag: V7_3_0rc1~33 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=969649987078935651441fd407feff6df96b4344;p=tools%2Finstall.git Prepare SALOME 7.3.0 --- diff --git a/config_files/build.csh b/config_files/build.csh index f4a689e..2a3536d 100755 --- a/config_files/build.csh +++ b/config_files/build.csh @@ -338,13 +338,12 @@ foreach module (${modules}) if ( $inst_with_gui == 0 ) then set myconf_keys="${myconf_keys} --without-gui" endif - if ( "${module}" == "MED" && ($?METISDIR) && ($?SCOTCHDIR) ) then - set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}" + if ( "${module}" == "MED" && ($?METIS_ROOT_DIR) && ($?SCOTCH_ROOT_DIR) ) then + set myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METIS_ROOT_DIR} --with-scotch=${SCOTCH_ROOT_DIR}" endif - if ( "${module}" == "NETGENPLUGIN" && ($?NETGENHOME) ) then - set myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}" + if ( "${module}" == "NETGENPLUGIN" && ($?NETGEN_ROOT_DIR) ) then + set myconf_keys="${myconf_keys} --with-netgen=${NETGEN_ROOT_DIR}" endif - if ( "${module}" == "PARAVIS" ) then cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log else diff --git a/config_files/build.sh b/config_files/build.sh index 8b6a636..547d5b4 100755 --- a/config_files/build.sh +++ b/config_files/build.sh @@ -116,7 +116,7 @@ b_params="" for arg in $@ ; do known=0 for m in $modules ; do - if [ "$m" == "$arg" ] ; then known=1 ; break ; fi + if [ "$m" = "$arg" ] ; then known=1 ; break ; fi done if [ $known -eq 0 ] ; then echo @@ -135,7 +135,7 @@ if [ "${params}" != "" ] ; then for module in ${modules} ; do found=0 for p in $params ; do - if [ "$p" == "$module" ] ; then found=1 ; break ; fi + if [ "$p" = "$module" ] ; then found=1 ; break ; fi done if [ $found -eq 1 ] ; then xparams="$xparams $module" @@ -178,12 +178,12 @@ LOG_DIR=${BUILD_DIR}/LOGS ######################################################### # define installation prefix ######################################################### -if [ "$prefix" == "" ] ; then +if [ "$prefix" = "" ] ; then echo echo '!!! Warning !!! Installation directory is not set.' echo "All the modules will be installed to the ${BUILD_DIR}${def_install_dir}" else - if [ "`echo $prefix | grep -E '^/'`" == "" ] ; then + if [ "`echo $prefix | grep -E '^/'`" = "" ] ; then prefix=${BUILD_DIR}/$prefix echo echo '!!! Warning !!! Relative prefix is used.' @@ -244,7 +244,7 @@ for module in ${modules}; do if [ ! -e ${module_src}/build_configure ] && [ "${module}" != "PARAVIS" ] ; then echo '!!! Warning !!! Cannot find build_configure script in '${module_src}'.' else - if [ "${module}" == "PARAVIS" ]; then + if [ "${module}" = "PARAVIS" ]; then echo '!!! Warning !!! build_configure step is not executed for '${module}'.' else ######################################################### @@ -312,7 +312,7 @@ for module in ${modules}; do vx=`grep -e "^AC_INIT" ${module_src}/configure.ac | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` elif [ -e ${module_src}/configure.in.base ] ; then vx=`grep -e "^VERSION=" ${module_src}/configure.in.base | awk -F= '{ if (NF>1) print $NF; }' | tr -d '[:space:]'` - if [ "$vx" == "" ] ; then + if [ "$vx" = "" ] ; then vx=`grep -e "^AC_INIT" ${module_src}/configure.in.base | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` fi elif [ -e ${module_src}/CMakeLists.txt ] ; then @@ -324,7 +324,7 @@ for module in ${modules}; do if [ "$vx" != "" ] ; then vx="_$vx" fi - if [ "$prefix" == "" ] ; then + if [ "$prefix" = "" ] ; then px=${BUILD_DIR}${def_install_dir}/${module}${vx} else px=$prefix/${module}${vx} @@ -347,14 +347,14 @@ for module in ${modules}; do if [ $inst_with_gui -eq 0 ] ; then myconf_keys="${myconf_keys} --without-gui" fi - if [ "${module}" == "MED" ] && [ "${METISDIR}" != "" ] && [ "${SCOTCHDIR}" != "" ] ; then - myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}" + if [ "${module}" = "MED" ] && [ "${METIS_ROOT_DIR}" != "" ] && [ "${SCOTCH_ROOT_DIR}" != "" ] ; then + myconf_keys="${myconf_keys} --enable-splitter=yes --with-metis=${METIS_ROOT_DIR} --with-scotch=${SCOTCH_ROOT_DIR}" fi - if [ "${module}" == "NETGENPLUGIN" ] && [ "$NETGENHOME" != "" ] ; then - myconf_keys="${myconf_keys} --with-netgen=${NETGENHOME}" + if [ "${module}" = "NETGENPLUGIN" ] && [ "$NETGEN_ROOT_DIR" != "" ] ; then + myconf_keys="${myconf_keys} --with-netgen=${NETGEN_ROOT_DIR}" fi - if [ "${module}" == "PARAVIS" ] ; then + if [ "${module}" = "PARAVIS" ] ; then cd ${module_build}; cmake ${module_src} -DCMAKE_INSTALL_PREFIX=$px >& ${LOG_DIR}/configure_${module}.log else ${module_src}/configure --prefix=$px ${optim} ${myconf_keys} >& ${LOG_DIR}/configure_${module}.log @@ -382,13 +382,13 @@ for module in ${modules}; do ######################################################### # then make ######################################################### - if [ "${module}" == "PARAVIS" ] ; then + if [ "${module}" = "PARAVIS" ] ; then VTK_AUTOLOAD_PATH_BACKUP=${VTK_AUTOLOAD_PATH} test "${VTK_AUTOLOAD_PATH}" != "" && unset VTK_AUTOLOAD_PATH fi make >& ${LOG_DIR}/make_${module}.log sts=$? - if [ "${module}" == "PARAVIS" ] ; then + if [ "${module}" = "PARAVIS" ] ; then test "${VTK_AUTOLOAD_PATH_BACKUP}" != "" && export VTK_AUTOLOAD_PATH=${VTK_AUTOLOAD_PATH_BACKUP} fi ######################################################### @@ -431,7 +431,7 @@ for module in ${modules}; do ######################################################### # perform make if -i or -p flags are given ######################################################### - if [ $is_install -eq 1 ] && [ $sts -eq 0 ] || [ "${module}" == "KERNEL" ] ; then + if [ $is_install -eq 1 ] && [ $sts -eq 0 ] || [ "${module}" = "KERNEL" ] ; then ######################################################### # deleting build directory if -d flag is given ######################################################### diff --git a/config_files/common.sh b/config_files/common.sh index f02f37a..00e801c 100755 --- a/config_files/common.sh +++ b/config_files/common.sh @@ -28,9 +28,9 @@ export SDIR_NAME="SALOME_${SALOME_VERSION}" #this function takes one parameter - path to module source folder check_salome_src_version(){ -root_dir=`printenv $1` +root_dir=${!1} -if [ -n "$root_dir" ]; then +if [ -n "${root_dir}" ]; then cfg_file=configure.ac if [ ! -f ${root_dir}/${cfg_file} ] ; then cfg_file=configure.in.base @@ -47,7 +47,7 @@ if [ -n "$root_dir" ]; then ver=`grep -e "^AC_INIT" ${root_dir}/${cfg_file} | sed -e "s%.*\[\([[:digit:].]*\)\].*%\1%g"` fi - if [ "$ver" = "${SALOME_VERSION}" ]; then + if [ "${ver}" = "${SALOME_VERSION}" ]; then return 0 fi fi @@ -65,28 +65,28 @@ check_job() out=$1 shift errfile=/tmp/errlog - if [ -n "$INSTALL_WORK" ] ; then errfile=$INSTALL_WORK/errlog; fi + if [ -n "${INSTALL_WORK}" ] ; then errfile=${INSTALL_WORK}/errlog; fi cmd="`pwd` -> $*" - if [ "$out" != "1" ] ; then cmd="$cmd >> $out" ; fi - echo -e $cmd - if [ "$out" != "1" ] ; then - $* >> $out 2>$errfile + if [ "${out}" != "1" ] ; then cmd="${cmd} >> ${out}" ; fi + echo -e ${cmd} + if [ "${out}" != "1" ] ; then + $* >> ${out} 2>${errfile} else $* fi if [ "$?" -ne "0" ] ; then - if [ $out != "1" ] ; then - cat $out - cat $errfile >&2 - cat $errfile >> $out + if [ ${out} != "1" ] ; then + cat ${out} + cat ${errfile} >&2 + cat ${errfile} >> ${out} fi # VSR : 10/11/05: disable answer mode ==> #echo -n " " >&2 #echo -e "NOT DONE !!! => $*" #echo -n "Would you like to continue to install this product: (Y,N) [Y] : " #read rep; - #rep=`echo $rep | tr "[A-Z]" "[a-z]"` - #if test -z $rep || [ $rep = "y" ] ; then + #rep=`echo ${rep} | tr "[A-Z]" "[a-z]"` + #if test -z ${rep} || [ ${rep} = "y" ] ; then # return 1 #fi # VSR : 10/11/05: disable answer mode <== @@ -116,11 +116,11 @@ make_env() install_root=$1; shift install_work=$1; -for i in $SHRC $CSHRC ; do - if [ -e ${install_work}/$i ]; then - rm ${install_work}/$i +for i in ${SHRC} ${CSHRC} ; do + if [ -e ${install_work}/${i} ]; then + rm ${install_work}/${i} fi - touch ${install_work}/$i + touch ${install_work}/${i} done if [ $# -eq 4 ] ; then @@ -129,7 +129,7 @@ if [ $# -eq 4 ] ; then (test -e ${product_env} && rm ${product_env} ) fi ### !!! writing salome.sh file !!! -> define INST_ROOT -cat >> ${install_work}/$SHRC <> ${install_work}/${SHRC} < /dev/null if [ $? -eq 0 ] ; then - cat >> ${install_work}/$SHRC <> ${install_work}/${SHRC} < set inital variables pre_vars="PATH LD_LIBRARY_PATH LD_RUN_PATH PYTHONPATH TCLLIBPATH" -for i in $pre_vars ; do -cat >> ${install_work}/$CSHRC <> ${install_work}/${CSHRC} <> ${install_work}/$SHRC 2>/dev/null -#echo '' >> ${install_work}/$SHRC 2>/dev/null +#echo 'export LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null +#echo '' >> ${install_work}/${SHRC} 2>/dev/null #else -#echo 'export LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}' >> ${install_work}/$SHRC 2>/dev/null -#echo '' >> ${install_work}/$SHRC 2>/dev/null +#echo 'export LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}' >> ${install_work}/${SHRC} 2>/dev/null +#echo '' >> ${install_work}/${SHRC} 2>/dev/null #fi # Licence activation # Source of license environment file -echo '#------ License activation ------' >> ${install_work}/$SHRC 2>/dev/null -echo 'export LICENSE_FILE=/product/distene/dlim8.var.sh' >> ${install_work}/$SHRC 2>/dev/null -echo '' >> ${install_work}/$SHRC 2>/dev/null -echo 'if [ -e "${LICENSE_FILE}" ] ; then' >> ${install_work}/$SHRC 2>/dev/null -echo 'export SIMULOGD_LICENSE_FILE=29029@soleil' >> ${install_work}/$SHRC 2>/dev/null -echo 'source ${LICENSE_FILE}' >> ${install_work}/$SHRC 2>/dev/null -echo 'fi' >> ${install_work}/$SHRC 2>/dev/null -echo '' >> ${install_work}/$SHRC 2>/dev/null +echo '#------ License activation ------' >> ${install_work}/${SHRC} 2>/dev/null +echo 'export LICENSE_FILE=/product/distene/dlim8.var.sh' >> ${install_work}/${SHRC} 2>/dev/null +echo '' >> ${install_work}/${SHRC} 2>/dev/null +echo 'if [ -e "${LICENSE_FILE}" ] ; then' >> ${install_work}/${SHRC} 2>/dev/null +echo 'export SIMULOGD_LICENSE_FILE=29029@soleil' >> ${install_work}/${SHRC} 2>/dev/null +echo 'source ${LICENSE_FILE}' >> ${install_work}/${SHRC} 2>/dev/null +echo 'fi' >> ${install_work}/${SHRC} 2>/dev/null +echo '' >> ${install_work}/${SHRC} 2>/dev/null -# 1. first dump all environment files into the $SHRC file +# 1. first dump all environment files into the ${SHRC} file product_sequence="$2" install_products="$3" -for i in $product_sequence ; do +for i in ${product_sequence} ; do env_file=${install_work}/env_${i}.sh _env_file=${install_work}/_env_${i}.sh - if [ -e $_env_file ] ; then - cat $_env_file >> ${install_work}/$SHRC 2>/dev/null - elif [ -e $env_file ] ; then - echo $install_products | grep -q "\b${i}\b" + if [ -e ${_env_file} ] ; then + cat ${_env_file} >> ${install_work}/${SHRC} 2>/dev/null + elif [ -e ${env_file} ] ; then + echo ${install_products} | grep -q "\b${i}\b" if [ $? -eq 1 ] ; then - cat $env_file | sed 's/^/## /' >> ${install_work}/$SHRC 2>/dev/null + cat ${env_file} | sed 's/^/## /' >> ${install_work}/${SHRC} 2>/dev/null else - cat $env_file >> ${install_work}/$SHRC 2>/dev/null + cat ${env_file} >> ${install_work}/${SHRC} 2>/dev/null fi fi done # 2. writing global functions to _salome.sh file -cat >> ${install_work}/_$SHRC <> ${install_work}/_${SHRC} <> ${install_work}/_$CSHRC <> ${install_work}/_${CSHRC} <> ${install_work}/_$CSHRC +cat ${install_work}/${CSHRC} >> ${install_work}/_${CSHRC} # 4. put the contents of salome.sh to _salome.sh replacing export by export(a|p) aliases where necessary -sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null +sed -e 's%export\([[:blank:]]*\)PATH=\$[{]\?PATH[}]\?:\(.*\)%exporta\1PATH \2%g' -e 's%export\([[:blank:]]*\)PATH=\(.*\):\$[{]\?PATH[}]\?%exportp\1PATH \2%g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null sed -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\$[{]\?LD_LIBRARY_PATH[}]\?:\(.*\)%exporta\1LD_LIBRARY_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_LIBRARY_PATH=\(.*\):\$[{]\?LD_LIBRARY_PATH[}]\?%exportp\1LD_LIBRARY_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null sed -e 's%export\([[:blank:]]*\)PYTHONPATH=\$[{]\?PYTHONPATH[}]\?:\(.*\)%exporta\1PYTHONPATH \2%g' -e 's%export\([[:blank:]]*\)PYTHONPATH=\(.*\):\$[{]\?PYTHONPATH[}]\?%exportp\1PYTHONPATH \2%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%exporta\1LD_RUN_PATH \2%g' -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\(.*\):\$[{]\?LD_RUN_PATH[}]\?%exportp\1LD_RUN_PATH \2%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 @@ -385,11 +385,11 @@ sed -e 's%export\([[:blank:]]*\)LD_RUN_PATH=\$[{]\?LD_RUN_PATH[}]\?:\(.*\)%expor #echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2 #fi -cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_$SHRC +cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_${SHRC} # 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc. -sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/$SHRC > ${INSTALL_WORK}/_tmp1 2>/dev/null -cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/$CSHRC +sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${install_work}/${SHRC} > ${INSTALL_WORK}/_tmp1 2>/dev/null +cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/${CSHRC} # 6. Create a _salome.csh file from _salome.sh by replacing export by setenv, exporta by setenva, etc. sed -e 's%export \([[:alnum:]_[:blank:]]*\)\=%setenv \1 %g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null @@ -402,38 +402,38 @@ sed -e 's%^\([[:blank:]]*\)fi\([[:blank:]]*\)$%\1endif\2%g' ${INSTALL_WORK}/_tmp sed -e 's%var.sh%var.csh%g' ${INSTALL_WORK}/_tmp1 > ${INSTALL_WORK}/_tmp2 2>/dev/null sed -e 's%if \[ -e "\${LICENSE_FILE}" \] ; then%if ( -e ${LICENSE_FILE} ) then%g' ${INSTALL_WORK}/_tmp2 > ${INSTALL_WORK}/_tmp1 2>/dev/null -cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/_$CSHRC 2>/dev/null +cat ${INSTALL_WORK}/_tmp1 >> ${install_work}/_${CSHRC} 2>/dev/null rm -f ${INSTALL_WORK}/_tmp1 ${INSTALL_WORK}/_tmp2 if [ $# -eq 5 ] ; then product_dir=$5 if [ -e ${product_dir} ] ; then - test -e ${product_dir}/$SHRC && mv ${product_dir}/$SHRC ${product_dir}/${SHRC}_`date +%F_%T` - cp ${install_work}/_$SHRC ${product_dir}/$SHRC - test -e ${product_dir}/$CSHRC && mv ${product_dir}/$CSHRC ${product_dir}/${CSHRC}_`date +%F_%T` - cp ${install_work}/_$CSHRC ${product_dir}/$CSHRC + test -e ${product_dir}/${SHRC} && mv ${product_dir}/${SHRC} ${product_dir}/${SHRC}_`date +%F_%T` + cp ${install_work}/_${SHRC} ${product_dir}/${SHRC} + test -e ${product_dir}/${CSHRC} && mv ${product_dir}/${CSHRC} ${product_dir}/${CSHRC}_`date +%F_%T` + cp ${install_work}/_${CSHRC} ${product_dir}/${CSHRC} fi fi -sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_$CSHRC > ${install_root}/env_build.csh -sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_$SHRC > ${install_root}/env_build.sh +sed -e 's%setenv ENV_FOR_LAUNCH 1%setenv ENV_FOR_LAUNCH 0%' ${install_work}/_${CSHRC} > ${install_root}/env_build.csh +sed -e 's%export ENV_FOR_LAUNCH=1%export ENV_FOR_LAUNCH=0%' ${install_work}/_${SHRC} > ${install_root}/env_build.sh -cp -f ${install_work}/_$CSHRC ${install_root}/env_products.csh -cp -f ${install_work}/_$SHRC ${install_root}/env_products.sh +cp -f ${install_work}/_${CSHRC} ${install_root}/env_products.csh +cp -f ${install_work}/_${SHRC} ${install_root}/env_products.sh -rm -f ${install_work}/_$SHRC ${install_work}/_$CSHRC +rm -f ${install_work}/_${SHRC} ${install_work}/_${CSHRC} ### !!! copying build.csh and build.sh scripts -if [ -e ./build.csh ]; then +if [ -e ./build.csh ] && [ ! -e ${install_root}/build.csh ]; then cp -f ./build.csh ${install_root} fi -if [ -e ./build.sh ]; then +if [ -e ./build.sh ] && [ ! -e ${install_root}/build.sh ]; then cp -f ./build.sh ${install_root} fi ### !!! copying release notes for p in `ls ../` ; do export pdf=`echo ${p} | sed s/[.]/" "/g | awk '{print $2}'` if [ "${pdf}" = "pdf" ]; then - export RN=$p + export RN=${p} if [ ! -e ${install_root}/${RN} ]; then cp -f ../${RN} ${install_root} fi @@ -451,7 +451,7 @@ env_file=${product_dir}/env_${product_type}.sh if [ -f ${env_file} ] ; then cp -f ${env_file} ${install_work}/_env_${product_type}.sh make_env ${install_root} ${install_work} "${product_sequence}" "${installed_products}" - source ${install_work}/$SHRC + source ${install_work}/${SHRC} check_version if [ $? -eq 0 ] ; then return 0 @@ -469,18 +469,18 @@ return 0 #check existance of lib passed as first parameter #return 0 if lib exists #if you pass second parameter search will be done in it -#otherwise search will be done in $LD_LIBRARY_PATH +#otherwise search will be done in ${LD_LIBRARY_PATH} #you should use : as dilimeter if you are going to pass second parameter check_lib_version(){ if [ -n "$2" ]; then whereIs=$2 else - whereIs=$LD_LIBRARY_PATH + whereIs=${LD_LIBRARY_PATH} fi -for L in `echo ${whereIs} | sed -e"s%:% %g"` ; do - ret=`find $L -name $1 2>/dev/null` - if [ -n "$ret" ] ; then - #echo "The $1 exists on yours system in a $L folder" +for d in `echo ${whereIs} | sed -e"s%:% %g"` ; do + ret=`find ${d} -name $1 2>/dev/null` + if [ -n "${ret}" ] ; then + #echo "The $1 exists on yours system in a ${d} folder" return 0 fi done @@ -491,10 +491,10 @@ find_in_path(){ file=$1; shift; path=$* for i in `echo ${path} | sed -e"s%:% %g"` ; do - ret=`find $i -name $file -maxdepth 1 2>/dev/null` - if [ -n "$ret" ] ; then - ret=`echo $ret | sed -e"s%/\$file$%%g"` - echo $ret + ret=`find ${i} -name ${file} -maxdepth 1 2>/dev/null` + if [ -n "${ret}" ] ; then + ret=`echo ${ret} | sed -e"s%/\${file}$%%g"` + echo ${ret} return 0 fi done @@ -503,54 +503,54 @@ return 1 sort_path(){ arg1=$1; val1=$2; arg2=$3; val2=$4 -tmp="^$val1$|^$val1:|:$val1$|:$val1:" -#echo $val2 | grep -E "$tmp" >/dev/null 2>&1 +tmp="^${val1}$|^${val1}:|:${val1}$|:${val1}:" +#echo ${val2} | grep -E "${tmp}" >/dev/null 2>&1 #if [ $? -eq 0 ] ; then -# echo "$arg2" +# echo "${arg2}" # return #fi to_tail=1 exclude_list="usr lib bin sbin etc" for i in ${exclude_list} ; do - tmp="^/$i/|^/$i\$" - echo ${val1} | grep -E "$tmp" >/dev/null 2>&1 - if [ $? == 0 ] ; then to_tail=0; break; fi + tmp="^/${i}/|^/${i}\$" + echo ${val1} | grep -E "${tmp}" >/dev/null 2>&1 + if [ "$?" = "0" ] ; then to_tail=0; break; fi done -if [ $to_tail -eq 0 ] ; then - echo $arg2:$arg1 +if [ ${to_tail} -eq 0 ] ; then + echo ${arg2}:${arg1} else - echo $arg1:$arg2 + echo ${arg1}:${arg2} fi -return $to_tail +return ${to_tail} } 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 +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 + 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"` + 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 +if [ -n "${newer}" ] ; then + echo ${newer} return 0 fi return 1 @@ -563,15 +563,15 @@ 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 +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` +if test -n "${file}"; then + echo `dirname ${file}` return 0 else echo "" @@ -586,15 +586,15 @@ 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 +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` +if test -n "${file}"; then + echo `dirname ${file}` return 0 else echo "" @@ -618,7 +618,7 @@ return 1 where_gl_includes(){ for d in /usr/X11R6/include /usr/include ; do if [ -d ${d}/GL ] && [ -f ${d}/GL/gl.h ] ; then - echo "$d" + echo "${d}" return 0 fi done @@ -633,8 +633,8 @@ local libdir for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] && [ -f ${d}/libGL.la ]; then libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"` - if [ "$libdir" == "$d" ] ; then - echo "$d" + if [ "${libdir}" = "${d}" ] ; then + echo "${d}" return 0 fi fi @@ -643,8 +643,8 @@ done for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do if [ -f ${d}/libGL.la ] ; then libdir=`grep "libdir=" ${d}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"` - if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then - echo "$d" + if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then + echo "${d}" return 0 fi fi @@ -652,7 +652,7 @@ done # then search libGL.so* file for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do if [ "`ls ${d}/libGL.so* 2>/dev/null`" ] ; then - echo "$d" + echo "${d}" return 0 fi done @@ -662,15 +662,15 @@ return 1 fix_gl_libs(){ local gllibdir="`where_gl_libs`" - if [ "$gllibdir" != "" ] ; then + if [ "${gllibdir}" != "" ] ; then #VSR: 02/04/2013 - next block is commented as it seems to be wrong :( libGL.la should not be ever mentioned # if [ -f ${gllibdir}/libGL.la ] ; then # libdir=`grep "libdir=" ${gllibdir}/libGL.la | sed -e "s%libdir='\(.*\)'%\1%"` -# if [ "`ls $libdir/libGL.so* 2>/dev/null`" ] ; then +# if [ "`ls ${libdir}/libGL.so* 2>/dev/null`" ] ; then # str_to_replace="${gllibdir}/libGL.la" # fi # fi - if [ "$str_to_replace" == "" ] ; then + if [ "${str_to_replace}" = "" ] ; then str_to_replace="-L${gllibdir} -lGL" fi @@ -689,45 +689,45 @@ fix_gl_libs(){ modif_la_files(){ ldir=$1 -if [ -z "$ldir" ] || [ ! -d "$ldir" ]; then return 1; fi +if [ -z "${ldir}" ] || [ ! -d "${ldir}" ]; then return 1; fi srcdir=`pwd` SALOME_MODULES="`env | awk -F_ '/[a-zA-Z0-9]*_ROOT_DIR/ { print $1 }'`" -cd $ldir +cd ${ldir} ldir=`pwd` la_files=`find . -name "*.la"` # netgen dir -netgendir=`printenv NETGENHOME` +netgendir=${NETGEN_ROOT_DIR} # freetype dir -freetypedir=`printenv FREETYPEDIR` +freetypedir=${FREETYPE_ROOT_DIR} # ftgl dir -ftgldir=`printenv FTGLDIR` +ftgldir=${FTGL_ROOT_DIR} # gl2ps dir -gl2psdir=`printenv GL2PSHOME` +gl2psdir=${GL2PS_ROOT_DIR} # freeimage dir -freeimagedir=`printenv FREEIMAGEDIR` +freeimagedir=${FREEIMAGE_ROOT_DIR} # tbb dir -tbbbasedir=`printenv TBBHOME` +tbbbasedir=${TBB_ROOT_DIR} TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21' if test `uname -m` = "x86_64" ; then - export TBBMODE="intel64/$TBBKERNEL" + export TBBMODE="intel64/${TBBKERNEL}" else - export TBBMODE="ia32/$TBBKERNEL" + export TBBMODE="ia32/${TBBKERNEL}" fi -tbbdir=${tbbbasedir}/lib/$TBBMODE +tbbdir=${tbbbasedir}/lib/${TBBMODE} # cgns dir -cgnslibdir=`printenv CGNSHOME` +cgnslibdir=${CGNS_ROOT_DIR} # occt dir -casdir=`printenv CASROOT`/lib -if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/Linux/lib ; fi -if [ ! -d ${casdir} ] ; then casdir=`printenv CASROOT`/lin/lib ; fi +casdir=${CAS_ROOT_DIR}/lib +if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/Linux/lib ; fi +if [ ! -d ${casdir} ] ; then casdir=${CAS_ROOT_DIR}/lin/lib ; fi # omniorb dir -omnidir=`printenv OMNIORBDIR`/lib +omnidir=${OMNIORB_ROOT_DIR}/lib # vtk dir -vtkpath=`printenv VTKHOME` +vtkpath=${VTK_DIR} if [ `uname -m` = "x86_64" ] && [ -d ${vtkpath}/lib64 ] ; then LIB_PREFIX=64 elif [ -d ${vtkpath}/lib ] ; then @@ -738,16 +738,16 @@ fi vtkldir=${vtkpath}/lib${LIB_PREFIX} vtkdir=${vtkldir}/vtk-5.0 # hdf dir -hdfdir=`printenv HDF5HOME`/lib +hdfdir=${HDF5_ROOT_DIR}/lib # med dir -meddir=`printenv MED3HOME`/lib +meddir=${MEDFILE_ROOT_DIR}/lib # qwt dir qwtdir=`find_in_path libqwt.so ${LD_LIBRARY_PATH}` # python dir where_python=`which python` # e.g. /usr/bin/python -if [ -n "$where_python" ] ; then - where_python=`dirname $where_python` # --> /usr/bin - where_python=`dirname $where_python` # --> /usr +if [ -n "${where_python}" ] ; then + where_python=`dirname ${where_python}` # --> /usr/bin + where_python=`dirname ${where_python}` # --> /usr python_version=`python -c "import sys; print sys.version[:3]"` pythondir=${where_python}/lib/python${python_version} fi @@ -756,18 +756,18 @@ sipdir=`find_in_path sip.so ${LD_LIBRARY_PATH}` # pyqt dir pyqtdir=`find_in_path Qt.so ${LD_LIBRARY_PATH}` # tcl/tk dir -tcldir=`printenv TCLHOME`/lib +tcldir=${TCLHOME}/lib # boost dir -boostdir=`printenv BOOSTDIR`/lib +boostdir=${BOOST_ROOT_DIR}/lib # blsurf dir -blsurfdir=`printenv BLSURFHOME`/lib +blsurfdir=${BLSURFHOME}/lib # libxml2 dir -libxmldir=`printenv LIBXML_DIR`/lib +libxmldir=${LIBXML2_ROOT_DIR}/lib # metis dir -metisdir=`printenv METISDIR` +metisdir=${METIS_ROOT_DIR} # scotch dir -scotchbindir=`printenv SCOTCHDIR`/bin -scotchlibdir=`printenv SCOTCHDIR`/lib +scotchbindir=${SCOTCH_ROOT_DIR}/bin +scotchlibdir=${SCOTCH_ROOT_DIR}/lib # gl dir if test `uname -m` = "x86_64" ; then libGLpath=/usr/lib64/libGL.la @@ -775,194 +775,195 @@ else libGLpath=/usr/lib/libGL.la fi # graphviz dir -graphvizdir=`printenv GRAPHVIZHOME`/lib +graphvizdir=${GRAPHVIZ_ROOT_DIR}/lib # qscintilla dir -qscintilladir=`printenv QSCINTILLA_DIR`/lib +qscintilladir=${QSCINTILLA_ROOT_DIR}/lib # expat dir -expatdir=${EXPAT_ROOT}/lib +expatdir=${EXPAT_ROOT_DIR}/lib # paraview dir -paraviewdir=`printenv PVHOME`/lib +paraviewdir=${PARAVIEW_ROOT_DIR}/lib # qt dir -qtdir=`printenv QTDIR`/lib +qtdir=${QT4_ROOT_DIR}/lib # distene meshgems dir if test `uname -m` = "x86_64" ; then - mgemsdir=`printenv MESHGEMSHOME`/lib/Linux_64 + mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux_64 else - mgemsdir=`printenv MESHGEMSHOME`/lib/Linux + mgemsdir=${MESHGEMS_ROOT_DIR}/lib/Linux fi for l in X ${la_files}; do -if [ "$l" != "X" ] ; then - d=`dirname $l` - l=`basename $l` - cd $ldir; cd $d +if [ "${l}" != "X" ] ; then + d=`dirname ${l}` + l=`basename ${l}` + cd ${ldir}; cd ${d} # . process salome modules dependencies - for mod in $SALOME_MODULES; do - moddir=`printenv ${mod}_ROOT_DIR` + for mod in ${SALOME_MODULES} ; do + moddir=${mod}_ROOT_DIR + moddir=${!moddir} if [ -n "${moddir}" ] ; then sed -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}[1]\?/lib% \1${moddir}/lib%g" \ -e "s%[[:space:]]\(-L\)\?[^[:space:]]*${mod}WOGUI[1]\?/lib% \1${moddir}/lib%g" \ -e "s%^libdir='[^[:space:]]*${mod}[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" \ - -e "s%^libdir='[^[:space:]]*${mod}WOGUI[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" $l > $l"_" - mv -f $l"_" $l + -e "s%^libdir='[^[:space:]]*${mod}WOGUI[1]\?/\(lib.*\)'%libdir='${moddir}/\1'%g" ${l} > ${l}"_" + mv -f ${l}"_" ${l} fi done # . process netgen dependencies if [ -n "${netgendir}" ] && [ -d "${netgendir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*netgen-[0-9.]\+/lib% \1${netgendir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*netgen-[0-9.]\+/lib% \1${netgendir}/lib%g" ${l} fi # . process freetype dependencies if [ -n "${freetypedir}" ] && [ -d "${freetypedir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freetype-[0-9.]\+/lib% \1${freetypedir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freetype-[0-9.]\+/lib% \1${freetypedir}/lib%g" ${l} fi # . process ftgl dependencies if [ -n "${ftgldir}" ] && [ -d "${ftgldir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ftgl-[0-9.]\+/lib% \1${ftgldir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ftgl-[0-9.]\+/lib% \1${ftgldir}/lib%g" ${l} fi # . process gl2ps dependencies if [ -n "${gl2psdir}" ] && [ -d "${gl2psdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*gl2ps-[0-9.]\+/lib% \1${gl2psdir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*gl2ps-[0-9.]\+/lib% \1${gl2psdir}/lib%g" ${l} fi # . process freeimage dependencies if [ -n "${freeimagedir}" ] && [ -d "${freeimagedir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freeimage-[0-9.]\+/lib% \1${freeimagedir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*freeimage-[0-9.]\+/lib% \1${freeimagedir}/lib%g" ${l} fi # . process tbb dependencies if [ -n "${tbbdir}" ] && [ -d "${tbbdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*tbb[^[:space:]]*/lib[^[:space:]]*% \1${tbbdir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*tbb[^[:space:]]*/lib[^[:space:]]*% \1${tbbdir}%g" ${l} fi # . process cgns dependencies if [ -n "${cgnslibdir}" ] && [ -d "${cgnslibdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*cgnslib-[0-9.]\+/lib% \1${cgnslibdir}/lib%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*cgnslib-[0-9.]\+/lib% \1${cgnslibdir}/lib%g" ${l} fi # . process CAS.CADE dependencies - if [ -n "${CASROOT}" ] && [ -d "${casdir}" ] ; then + if [ -n "${CAS_ROOT_DIR}" ] && [ -d "${casdir}" ] ; then sed -e "s%-L[^[:space:]]*OCCT[^[:space:]]*/install/lib%-L${casdir}%g" \ -e "s%[^[:space:]]*OCCT[^[:space:]]*/install/lib/%${casdir}/%g" \ - -e "s%[[:space:]]-L[^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib\?% -L${CASROOT}/lib%g" \ - -e "s%[[:space:]][^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib/lib\?% ${CASROOT}/lib/lib%g" $l > $l"_" - mv -f $l"_" $l + -e "s%[[:space:]]-L[^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib\?% -L${CAS_ROOT_DIR}/lib%g" \ + -e "s%[[:space:]][^[:space:]]*\(OCCT\|CAS\)[^[:space:]]*/lib/lib\?% ${CAS_ROOT_DIR}/lib/lib%g" ${l} > ${l}"_" + mv -f ${l}"_" ${l} fi # . process omniORB dependencies - if [ -n "${OMNIORBDIR}" ] && [ -d "${omnidir}" ] ; then - sed -i "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g;s%-R[^[:space:]]*omni[^[:space:]]*%-R${omnidir}%g" $l + if [ -n "${OMNIORB_ROOT_DIR}" ] && [ -d "${omnidir}" ] ; then + sed -i "s%-L[^[:space:]]*omni[^[:space:]]*%-L${omnidir}%g;s%-R[^[:space:]]*omni[^[:space:]]*%-R${omnidir}%g" ${l} fi # . process VTK dependencies - if [ -n "${VTKHOME}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then - sed -i "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g;s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)%-L${vtkldir}%g" $l + if [ -n "${VTK_DIR}" ] && [ -d "${vtkdir}" ] && [ -d "${vtkldir}" ] ; then + sed -i "s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)/vtk\-5\.0%-L${vtkdir}%g;s%-L[^[:space:]]*VTK[^[:space:]]*/\(lib\|lib64\)%-L${vtkldir}%g" ${l} fi # . process HDF dependencies - if [ -n "${HDF5HOME}" ] && [ -d "${hdfdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" $l + if [ -n "${HDF5_ROOT_DIR}" ] && [ -d "${hdfdir}" ] ; then + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*hdf[^[:space:]/]*/lib% \1${hdfdir}%g" ${l} fi # . process MED dependencies - if [ -n "${MED3HOME}" ] && [ -d "${meddir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" $l + if [ -n "${MEDFILE_ROOT_DIR}" ] && [ -d "${meddir}" ] ; then + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*med[^[:space:]/]*/lib% \1${meddir}%g" ${l} fi # . process qwt dependencies if [ -n "${qwtdir}" ] && [ -d "${qwtdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qwt[^[:space:]/]*/lib% \1${qwtdir}%g" ${l} fi # . process qt dependencies - if [ -n "${QTDIR}" ] && [ -d "${qtdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" $l + if [ -n "${QT4_ROOT_DIR}" ] && [ -d "${qtdir}" ] ; then + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt[^[:space:]/]*/lib% \1${qtdir}%g" ${l} fi # . process python dependencies if [ -n "${pythondir}" ] && [ -d "${pythondir}" ] ; then - sed -i "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${pythondir}\1%g" $l + sed -i "s%-L[^[:space:]]*python[0-9]\.[0-9]\([^[:space:]]*\)%-L${pythondir}\1%g" ${l} fi # . process sip dependencies if [ -n "${sipdir}" ] && [ -d "${sipdir}" ] ; then - sed -i "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" $l + sed -i "s%-L[^[:space:]]*sip[^[:space:]]*%-L${sipdir}%g" ${l} fi # . process PyQt dependencies if [ -n "${pyqtdir}" ] && [ -d "${pyqtdir}" ] ; then - sed -i "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" $l + sed -i "s%-L[^[:space:]]*PyQt[^[:space:]]*%-L${pyqtdir}%g" ${l} fi # . process tcl/tk dependencies if [ -n "${tcldir}" ] && [ -d "${tcldir}" ] ; then - sed -i "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" $l + sed -i "s%-L[^[:space:]]*tcltk[^[:space:]]*/lib%-L${tcldir}%g" ${l} fi # . process boost dependencies if [ -n "${boostdir}" ] && [ -d "${boostdir}" ] ; then - sed -i "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" $l + sed -i "s%-L[^[:space:]]*boost[^[:space:]]*/lib%-L${boostdir}%g" ${l} fi # . process blsurf dependencies if [ -n "${blsurfdir}" ] && [ -d "${blsurfdir}" ] ; then - sed -i "s%-L[^[:space:]]*BLSurf[^[:space:]]*/lib%-L${blsurfdir}%g" $l + sed -i "s%-L[^[:space:]]*BLSurf[^[:space:]]*/lib%-L${blsurfdir}%g" ${l} fi # . process libxml dependencies if [ -n "${libxmldir}" ] && [ -d "${libxmldir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9]/lib% \1${libxmldir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2-[0-9]\.[0-9]\.[0-9]/lib% \1${libxmldir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*libxml2/lib% \1${libxmldir}%g" ${l} fi # . process metis dependencies if [ -n "${metisdir}" ] && [ -d "${metisdir}" ] ; then - sed -i "s%-L[^[:space:]]*metis[^[:space:]]*%-L${metisdir}%g" $l + sed -i "s%-L[^[:space:]]*metis[^[:space:]]*%-L${metisdir}%g" ${l} fi # . process scotch dependencies if [ -n "${scotchbindir}" ] && [ -d "${scotchbindir}" ] ; then - sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/bin%-L${scotchbindir}%g" $l + sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/bin%-L${scotchbindir}%g" ${l} fi if [ -n "${scotchlibdir}" ] && [ -d "${scotchlibdir}" ] ; then - sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/lib%-L${scotchlibdir}%g" $l + sed -i "s%-L[^[:space:]]*scotch[^[:space:]]*/lib%-L${scotchlibdir}%g" ${l} fi # . process libGL.la dependencies - sed -i "s%$libGLpath%""%g" $l + sed -i "s%${libGLpath}%""%g" ${l} # . process graphviz dependencies if [ -n "${graphvizdir}" ] && [ -d "${graphvizdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz-[0-9]\.[0-9]\+\.[0-9]/lib% \1${graphvizdir}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*graphviz/lib% \1${graphvizdir}%g" ${l} fi # . process QScintilla dependencies if [ -n "${qscintilladir}" ] && [ -d "${qscintilladir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\(\.[0-9]\)\?/lib% \1${qscintilladir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*QScintilla-[0-9]\.[0-9]\(\.[0-9]\)\?/lib% \1${qscintilladir}%g" ${l} fi # . process expat-2.0.1 dependencies if [ -n "${expatdir}" ] && [ -d "${expatdir}" ] ; then - sed -i "s%-L[^[:space:]]*expat[^[:space:]]*/lib%-L${expatdir}%g;s%[^[:space:]]*expat[^[:space:]]*/lib/libexpat.la%-lexpat%g" $l + sed -i "s%-L[^[:space:]]*expat[^[:space:]]*/lib%-L${expatdir}%g;s%[^[:space:]]*expat[^[:space:]]*/lib/libexpat.la%-lexpat%g" ${l} fi # . process ParaView dependencies if [ -n "${paraviewdir}" ] && [ -d "${paraviewdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ParaView-[0-9]\.[0-9]\+\.[0-9]/lib% \1${paraviewdir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*ParaView-[0-9]\.[0-9]\+\.[0-9]/lib% \1${paraviewdir}%g" ${l} fi # . process DISTENE MeshGems dependencies if [ -n "${mgemsdir}" ] && [ -d "${mgemsdir}" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*MeshGems-[0-9.]\+/Products/lib/Linux\(_64\)\?% \1${mgemsdir}%g" $l + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*MeshGems-[0-9.]\+/Products/lib/Linux\(_64\)\?% \1${mgemsdir}%g" ${l} fi fi done -cd $srcdir +cd ${srcdir} return 0 } diff --git a/config_files/qt.sh b/config_files/qt.sh index 46273c7..472c9e7 100755 --- a/config_files/qt.sh +++ b/config_files/qt.sh @@ -12,14 +12,14 @@ # #################################################################################### -QT_REF_VERSION="4.8.4" +VERSION_QT="4.8.4" check_version(){ -if [ -z "$QTDIR" ]; then +if [ -z "${QT4_ROOT_DIR}" ]; then return 1 fi -ver=`grep "QT_VERSION_STR" ${QTDIR}/include/Qt/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'` -if [ "$ver" == "${QT_REF_VERSION}" ] ; then +ver=`grep "QT_VERSION_STR" ${QT4_ROOT_DIR}/include/Qt/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'` +if [ "${ver}" = "${VERSION_QT}" ] ; then return 0 fi return 1 @@ -28,12 +28,11 @@ return 1 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <& /dev/null if [ "$?" != "0" ] ; then - cd ${PRODUCT_SRC_DIR}/src/3rdparty/webkit/Source/WebCore - sed -i "s%glib-2.0 gio-2.0 gstreamer-0.10%glib-2.0 gio-2.0 '\\\\'gstreamer-0.10 >= 0.10.28\\\\''%g" features.pri + sed -i "s%glib-2.0 gio-2.0 gstreamer-0.10%glib-2.0 gio-2.0 '\\\\'gstreamer-0.10 >= 0.10.28\\\\''%g" ${PRODUCT_SRC_DIR}/src/3rdparty/webkit/Source/WebCore/features.pri >& /dev/null fi fi +if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then + du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + # to generate environment scripts try_preinstalled } @@ -94,7 +96,7 @@ check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure -prefix ${PRODUCT_DIR} -no-se GCC=`which gcc` cat >> ${PRODUCT_DIR}/MAKE.LOG <& /dev/null + sed -i "s% -L../../WebCore/release%%g;s% -L../../JavaScriptCore/release%%g;s% -lwebcore%%g;s% -ljscore%%g" ${PRODUCT_DIR}/lib/libQtWebKit.la >& /dev/null +fi + +cd ${PRODUCT_DIR} + +if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then + du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi + +# remove sources and temporary files after building +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then + test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi # to generate environment scripts @@ -125,60 +131,49 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR} -# modify libdir -cd ${PRODUCT_DIR}/lib +# change installation path -# modify qt la files -for l in `find $ldir -name "*.la"`; do - sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" $l - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*${PRODUCT}% \1${PRODUCT_DIR}%g" $l - sed -i "s%^dependency_libs='\(-L\)\?[^[:space:]]*${PRODUCT}%dependency_libs=\'\1${PRODUCT_DIR}%g" $l +# - modify qt la files +for l in X `find ${PRODUCT_DIR}/lib -name "*.la"` ; do + if [ "${l}" != "X" ] ; then + sed -i "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" ${l} + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*${PRODUCT}% \1${PRODUCT_DIR}%g" ${l} + sed -i "s%^dependency_libs='\(-L\)\?[^[:space:]]*${PRODUCT}%dependency_libs=\'\1${PRODUCT_DIR}%g" ${l} + fi done -# modify libGL.so flags -has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libQtOpenGL.la` +# - modify libGL.so flags +has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libQtOpenGL.la` gllibdir="`where_gl_libs`" -if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then - sed -e "s%-lGL\b%%g" \ - -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \ - libQtOpenGL.la > libQtOpenGL.la.new - mv -f libQtOpenGL.la.new libQtOpenGL.la +if [ "${has_gl_dep}" != "" ] && [ "${gllibdir}" != "" ] ; then + sed -i "s%-lGL\b%%g;s%^dependency_libs='\(.*\)%dependency_libs='-L${gllibdir} -lGL \1%g" ${PRODUCT_DIR}/lib/libQtOpenGL.la fi -# modify qt package config -cd ${PRODUCT_DIR}/lib/pkgconfig -for l in X `find . -name "*.pc"`; do +# - modify qt package config +for l in X `find ${PRODUCT_DIR}/lib/pkgconfig -name "*.pc"` ; do if [ "${l}" != "X" ] ; then - sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" \ - -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" \ - -e "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" \ - -e "s%moc_location=.*%moc_location=${PRODUCT_DIR}/bin/moc%g" \ - -e "s%uic_location=.*%uic_location=${PRODUCT_DIR}/bin/uic%g" \ - -e "s%rcc_location=.*%uic_location=${PRODUCT_DIR}/bin/rcc%g" \ - -e "s%lupdate_location=.*%uic_location=${PRODUCT_DIR}/bin/lupdate%g" \ - -e "s%lrelease_location=.*%uic_location=${PRODUCT_DIR}/bin/lrelease%g" \ - ${l} > ${l}_ - chmod -f --reference=${l} ${l}_ ; mv -f ${l}_ ${l} + sed -i "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${VERSION_QT}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${VERSION_QT}% \1${PRODUCT_DIR}%g" ${l} + sed -i "s%moc_location=.*%moc_location=${PRODUCT_DIR}/bin/moc%g;s%uic_location=.*%uic_location=${PRODUCT_DIR}/bin/uic%g;s%rcc_location=.*%uic_location=${PRODUCT_DIR}/bin/rcc%g" ${l} + sed -i "s%lupdate_location=.*%uic_location=${PRODUCT_DIR}/bin/lupdate%g;s%lrelease_location=.*%uic_location=${PRODUCT_DIR}/bin/lrelease%g" ${l} fi done -# modify qt prl files -cd ${PRODUCT_DIR}/lib -for l in X `find . -name "*.prl"`; do + +# - modify qt prl files +for l in X `find ${PRODUCT_DIR}/lib -name "*.prl"` ; do if [ "${l}" != "X" ] ; then - sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${QT_REF_VERSION}% \1${PRODUCT_DIR}%g" ${l} + sed -i "s%[[:space:]]\(-L\)\?[^[:space:]]*qt-${VERSION_QT}% \1${PRODUCT_DIR}%g;s%[[:space:]]\(-L\)\?[^[:space:]]*qt-x11-opensource-src-${VERSION_QT}% \1${PRODUCT_DIR}%g" ${l} fi done -# modify qt mkspecs -cd ${PRODUCT_DIR}/mkspecs -sed -i "s%QMAKE_RPATHDIR += \".*\"%QMAKE_RPATHDIR += \"${PRODUCT_DIR}/lib\"%g" qconfig.pri +# - modify qt mkspecs +sed -i "s%QMAKE_RPATHDIR += \".*\"%QMAKE_RPATHDIR += \"${PRODUCT_DIR}/lib\"%g" ${PRODUCT_DIR}/mkspecs/qconfig.pri # generate qt.conf file cat > ${PRODUCT_DIR}/bin/qt.conf < ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + +# to generate environment scripts +try_preinstalled +} + +install_source_and_build() +{ +# install sources +install_source + +# build sources +cd ${PRODUCT_SRC_DIR} +test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} + +# workaround : clear INSTALL_ROOT env.var if it is set unset INSTALL_ROOT # configure with qmake @@ -115,7 +118,7 @@ qmake GCC=`which gcc` cat >> ${PRODUCT_DIR}/MAKE.LOG < ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi # remove sources and temporary files after building -if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi @@ -142,7 +146,7 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} @@ -150,7 +154,7 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR} # patch features files (required for Qwt 6.x only) -if [ "${QWT_MAJOR_VERSION}" == "6" ] ; then +if [ "${QWT_MAJOR_VERSION}" = "6" ] ; then test -f ${PRODUCT_DIR}/features/qwtconfig.pri && cd ${PRODUCT_DIR}/features && sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri fi @@ -167,10 +171,10 @@ export PRODUCT_TYPE=$6; export INSTALL_PRODUCTS=$7; shift REMOVE_SRC_TMP=$8; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="qwt-${QWT_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="qwt-${VERSION_QWT}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/release_notes.sh b/config_files/release_notes.sh index f00f3e0..5d83878 100755 --- a/config_files/release_notes.sh +++ b/config_files/release_notes.sh @@ -19,15 +19,15 @@ check_enabled() ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`; # 1. check if there is appropriate PDF files viewer for r in acroread kpdf kghostview xpdf ; do - reader=`which $r 2>/dev/null` - if [ "$?" == "0" ] ; then + reader=`which ${r} 2>/dev/null` + if [ "$?" = "0" ] ; then break; fi done # 2. check if Release Notes file is available if [ "${ROOT_DIR}" != "" ] ; then rn_files=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"` - if [ "$?" == "0" ] && [ "$rn_files" != "" ] && [ "$reader" != "" ] ; then + if [ "$?" = "0" ] && [ "${rn_files}" != "" ] && [ "${reader}" != "" ] ; then return 0; fi fi @@ -41,16 +41,16 @@ execute() ROOT_DIR=`(cd ${SCRIPT_DIR}/.. ; pwd)`; # 1. find appropriate PDF files viewer for r in acroread kpdf kghostview xpdf ; do - reader=`which $r 2> /dev/null` - if [ "$?" == "0" ] ; then + reader=`which ${r} 2> /dev/null` + if [ "$?" = "0" ] ; then break; fi done # 2. find Release Notes file and open it in the viewer if [ "${ROOT_DIR}" != "" ] ; then rn_file=`find ${ROOT_DIR} -maxdepth 1 -name "*Release_Notes.pdf"` - if [ "$?" == "0" ] && [ "$rn_file" != "" ] && [ "$reader" != "" ] ; then - $reader ${rn_file} & + if [ "$?" = "0" ] && [ "${rn_file}" != "" ] && [ "${reader}" != "" ] ; then + ${reader} ${rn_file} & return 0; fi fi @@ -68,4 +68,4 @@ INST_ROOT=$2; INSTALL_WORK=$3; # Run the procedure -$PROCEDURE +${PROCEDURE} diff --git a/config_files/remove_tmp.sh b/config_files/remove_tmp.sh index d9d2bb4..9c708e0 100755 --- a/config_files/remove_tmp.sh +++ b/config_files/remove_tmp.sh @@ -14,9 +14,9 @@ install_work=$1; product_sequence=$2 source ./common.sh -for i in $product_sequence ; do +for i in ${product_sequence} ; do file=${install_work}/env_${i}.sh (test -f ${file} && rm -f ${file}) done -(file=${install_work}/$SHRC && test -f ${file} && rm -f ${file}) -(file=${install_work}/$CSHRC && test -f ${file} && rm -f ${file}) +(file=${install_work}/${SHRC} && test -f ${file} && rm -f ${file}) +(file=${install_work}/${CSHRC} && test -f ${file} && rm -f ${file}) diff --git a/config_files/scotch.sh b/config_files/scotch.sh index a9ec81c..313a58e 100755 --- a/config_files/scotch.sh +++ b/config_files/scotch.sh @@ -15,7 +15,7 @@ # # scotch version # -SCOTCH_VERSION=5.1.11 +VERSION_SCOTCH=5.1.11 check_version(){ # No way to check version! @@ -25,8 +25,8 @@ return 0 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + # to generate environment scripts try_preinstalled } @@ -93,10 +97,15 @@ check_job ${PRODUCT_DIR}/MAKE.LOG make prefix=${PRODUCT_DIR} # make install check_job ${PRODUCT_DIR}/INSTALL.LOG make prefix=${PRODUCT_DIR} install -cd ${PRODUCT_DIR}; +cd ${PRODUCT_DIR} + +if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then + du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi # remove sources and temporary files after building -if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi @@ -107,7 +116,7 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} @@ -127,10 +136,10 @@ export PRODUCT_TYPE=$6; export INSTALL_PRODUCTS=$7; shift REMOVE_SRC_TMP=$8; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="scotch-${SCOTCH_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="scotch-${VERSION_SCOTCH}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/sip.sh b/config_files/sip.sh index 169c0dd..b38bc0d 100755 --- a/config_files/sip.sh +++ b/config_files/sip.sh @@ -15,18 +15,18 @@ # # sip version # -SIP_VERSION=4.14.2 -SIP_XVERSION=`echo ${SIP_VERSION} | awk -F. '{printf("%d",$1*10000+$2*100+$3)}'` +VERSION_SIP=4.14.2 +SIP_XVERSION=`echo ${VERSION_SIP} | awk -F. '{printf("%d",$1*10000+$2*100+$3)}'` check_version() { -if [ -n "${SIPDIR}" ]; then - ver=`${SIPDIR}/bin/sip -V | awk '{print $1}'` - maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` - min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` - rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` - let ver=$maj_ver*10000+$min_ver*100+$rel_ver - if [ $ver -eq ${SIP_XVERSION} ] ; then +if [ -n "${SIP_ROOT_DIR}" ]; then + ver=`${SIP_ROOT_DIR}/bin/sip -V | awk '{print $1}'` + maj_ver=`echo ${ver} | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` + min_ver=`echo ${ver} | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` + rel_ver=`echo ${ver} | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'` + let ver=${maj_ver}*10000+${min_ver}*100+${rel_ver} + if [ ${ver} -eq ${SIP_XVERSION} ] ; then return 0 fi fi @@ -36,12 +36,11 @@ return 1 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + # to generate environment scripts try_preinstalled } @@ -96,15 +99,20 @@ fi check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${SIP_CONFIGURE_OPTIONS} GCC=`which gcc` cat >> ${PRODUCT_DIR}/MAKE.LOG < ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi + # remove sources and temporary files after building -if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi @@ -115,7 +123,7 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} @@ -131,29 +139,23 @@ if test `uname -m` = "x86_64" ; then fi # modify sipconfig.py file -if [ -n "${PYTHONROOT}" ] && [ -n "${QTDIR}" ] ; then - cd ${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages +if [ -n "${PYTHON_ROOT_DIR}" ] && [ -n "${QT4_ROOT_DIR}" ] ; then + cfg_file=${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages/sipconfig.py python_version=`python -V 2>&1 | awk '{print $2}' | awk -F. '{printf("0x%02d%02d%02d",$1,$2,$3)}'` - qt_version=`grep -e "^#define[[:space:]]\+QT_VERSION[[:space:]]\+" ${QTDIR}/include/Qt/qglobal.h | sed -e 's%^#define[[:space:]\+QT_VERSION[[:space:]]\+\(.*\)$%\1%g'` - sed -e "s%\('default_bin_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/bin',%g" \ - -e "s%\('default_mod_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/lib/python${PYTHON_VERSION}/site-packages',%g" \ - -e "s%\('default_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" \ - -e "s%\('sip_bin':[[:space:]]*\).*%\1'${PRODUCT_DIR}/bin/sip',%g" \ - -e "s%\('sip_inc_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/include/python${PYTHON_VERSION}',%g" \ - -e "s%\('sip_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g" \ - -e "s%\('qt_dir':[[:space:]]*\).*%\1'${QTDIR}',%g" \ - -e "s%\('qt_version':[[:space:]]*\).*%\1${qt_version},%g" \ - -e "s%\('qt_inc_dir':[[:space:]]*\).*%\1'${QTDIR}/include',%g" \ - -e "s%\('qt_lib_dir':[[:space:]]*\).*%\1'${QTDIR}/lib',%g" \ - -e "s%\('INCDIR_QT':[[:space:]]*\).*%\1'${QTDIR}/include',%g" \ - -e "s%\('LIBDIR_QT':[[:space:]]*\).*%\1'${QTDIR}/lib',%g" \ - -e "s%\('MOC':[[:space:]]*\).*%\1'${QTDIR}/bin/moc',%g" \ - -e "s%\('py_version':[[:space:]]*\).*%\1${python_version},%g" \ - -e "s%\('sip_config_args':[[:space:]]*\).*%\1'${SIP_CONFIGURE_OPTIONS}',%g" \ - -e "s%\('py_inc_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/include/python${PYTHON_VERSION}',%g" \ - -e "s%\('py_lib_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/lib/python${PYTHON_VERSION}/config',%g" \ - -e "s%\('py_conf_inc_dir':[[:space:]]*\).*%\1'${PYTHONROOT}/include/python${PYTHON_VERSION}',%g" sipconfig.py > sipconfig.py.1 - mv -f sipconfig.py.1 sipconfig.py + qt_version=`grep -e "^#define[[:space:]]\+QT_VERSION[[:space:]]\+" ${QT4_ROOT_DIR}/include/Qt/qglobal.h | sed -e 's%^#define[[:space:]\+QT_VERSION[[:space:]]\+\(.*\)$%\1%g'` + sed -i "s%\('default_bin_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/bin',%g" ${cfg_file} + sed -i "s%\('default_mod_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g" ${cfg_file} + sed -i "s%\('default_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g;s%\('sip_bin':[[:space:]]*\).*%\1'${PRODUCT_DIR}/bin/sip',%g" ${cfg_file} + sed -i "s%\('sip_inc_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/include/python${PYTHON_VERSION}',%g" ${cfg_file} + sed -i "s%\('sip_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/lib/python${PYTHON_VERSION}/site-packages',%g" ${cfg_file} + sed -i "s%\('qt_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}',%g;s%\('qt_version':[[:space:]]*\).*%\1${qt_version},%g" ${cfg_file} + sed -i "s%\('qt_inc_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/include',%g;s%\('qt_lib_dir':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/lib',%g" ${cfg_file} + sed -i "s%\('INCDIR_QT':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/include',%g;s%\('LIBDIR_QT':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/lib',%g" ${cfg_file} + sed -i "s%\('MOC':[[:space:]]*\).*%\1'${QT4_ROOT_DIR}/bin/moc',%g;s%\('py_version':[[:space:]]*\).*%\1${python_version},%g" ${cfg_file} + sed -i "s%\('sip_config_args':[[:space:]]*\).*%\1'${SIP_CONFIGURE_OPTIONS}',%g" ${cfg_file} + sed -i "s%\('py_inc_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}',%g" ${cfg_file} + sed -i "s%\('py_lib_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/config',%g" ${cfg_file} + sed -i "s%\('py_conf_inc_dir':[[:space:]]*\).*%\1'${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}',%g" ${cfg_file} fi # to generate environment scripts @@ -169,10 +171,10 @@ export PRODUCT_TYPE=$6; export INSTALL_PRODUCTS=$7; shift REMOVE_SRC_TMP=$8; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="sip-${SIP_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="sip-${VERSION_SIP}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/start_salome.sh b/config_files/start_salome.sh index e500cc1..5216471 100755 --- a/config_files/start_salome.sh +++ b/config_files/start_salome.sh @@ -36,7 +36,7 @@ execute() if [ "${KERNEL_ROOT_DIR}" != "" ] && [ "${GUI_ROOT_DIR}" != "" ] && [ -f ${KERNEL_ROOT_DIR}/bin/salome/runSalome ] ; then env SALOME_TEST_MODE=1 runSalome >& /dev/null - if [ "$?" == "0" ] ; then + if [ "$?" = "0" ] ; then return 0; fi fi @@ -54,4 +54,4 @@ INST_ROOT=$2; INSTALL_WORK=$3; # Run the procedure -$PROCEDURE +${PROCEDURE} diff --git a/config_files/swig.sh b/config_files/swig.sh index 9d1c9c3..e319039 100755 --- a/config_files/swig.sh +++ b/config_files/swig.sh @@ -15,12 +15,13 @@ # # swig version # -SWIG_VERSION=2.0.8 +VERSION_SWIG=2.0.8 +SWIG_VERSION_SUFFIX=`echo ${VERSION_SWIG} | awk -F. '{printf("%d.%d", $1, $2)}'` check_version(){ if [ -n "`which swig 2>/dev/null`" ]; then ver=`swig -version 2>&1 | grep -i version | awk '{ print $3 }' | sed -e 's/^\([0-9.]*\)\(.*\)/\1/'` - if [ "$ver" == "${SWIG_VERSION}" ] ; then + if [ "${ver}" = "${VERSION_SWIG}" ] ; then return 0; fi fi @@ -30,11 +31,10 @@ return 1; print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi + # to generate environment scripts try_preinstalled } @@ -76,7 +80,7 @@ install_source # build sources cd ${PRODUCT_SRC_DIR} -SWIG_CONFIGURE_FLAGS="--with-boost=${BOOSTDIR} --with-python=${PYTHONHOME}/bin/python --without-octave --with-tcl=${TCLHOME}" +SWIG_CONFIGURE_FLAGS="--with-boost=${BOOST_ROOT_DIR} --with-python=${PYTHON_ROOT_DIR}/bin/python --without-octave --with-tcl=${TCLHOME} --program-suffix=${SWIG_VERSION_SUFFIX}" if test `uname -m` = "x86_64" ; then SWIG_CONFIGURE_FLAGS="${SWIG_CONFIGURE_FLAGS} CFLAGS=-m64 CXXFLAGS=-m64" fi @@ -85,15 +89,26 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${SWIG_CONFIGURE_FLAGS} GCC=`which gcc` cat >> ${PRODUCT_DIR}/MAKE.LOG < ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi # remove sources and temporary files after building -if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi @@ -104,7 +119,7 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} @@ -125,10 +140,10 @@ export INSTALL_PRODUCTS=$7; SRC_DIR=$8; shift REMOVE_SRC_TMP=$8; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="swig-${SWIG_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="swig-${VERSION_SWIG}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/tbb.sh b/config_files/tbb.sh index cd048ea..5675581 100755 --- a/config_files/tbb.sh +++ b/config_files/tbb.sh @@ -12,13 +12,13 @@ # #################################################################################### -TBB_VERSION=30_018oss +VERSION_TBB=30_018oss TBBKERNEL='cc4.1.0_libc2.4_kernel2.6.16.21' if test `uname -m` = "x86_64" ; then - export TBBMODE="intel64/$TBBKERNEL" + export TBBMODE="intel64/${TBBKERNEL}" else - export TBBMODE="ia32/$TBBKERNEL" + export TBBMODE="ia32/${TBBKERNEL}" fi check_version(){ @@ -29,10 +29,10 @@ return 0 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size + cp ${INST_ROOT}/${PRODUCT_TYPE}.bin.size ${INST_ROOT}/${PRODUCT_TYPE}.build.size +fi } install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} check_jb tar xfz ${BIN_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR} - # to generate environment script try_preinstalled } @@ -92,10 +97,10 @@ SRC_DIR=$8; REMOVE_SRC_TMP=$9; shift BIN_DIR=$9; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="tbb${TBB_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="tbb-${VERSION_TBB}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/tcltk.sh b/config_files/tcltk.sh index b3a97d0..e29620d 100755 --- a/config_files/tcltk.sh +++ b/config_files/tcltk.sh @@ -15,17 +15,17 @@ # # tcl, tk and tclX versions # -TCL_VERSION=8.6.0 -TK_VERSION=8.6.0 -TCLX_VERSION=8.4.1 +VERSION_TCL=8.6.0 +VERSION_TK=8.6.0 +VERSION_TCLX=8.4.1 # -TCL_LIBVERSION=`echo $TCL_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'` -TK_LIBVERSION=`echo $TK_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'` -TCLX_LIBVERSION=`echo $TCLX_VERSION | awk -F. '{printf("%d.%d", $1, $2)}'` +TCL_LIBVERSION=`echo ${VERSION_TCL} | awk -F. '{printf("%d.%d", $1, $2)}'` +TK_LIBVERSION=`echo ${VERSION_TK} | awk -F. '{printf("%d.%d", $1, $2)}'` +TCLX_LIBVERSION=`echo ${VERSION_TCLX} | awk -F. '{printf("%d.%d", $1, $2)}'` check_version() { -if [ -z "$TCLHOME" ]; then +if [ -z "${TCLHOME}" ]; then echo "TCLHOME doesn't set" return 1 fi @@ -36,8 +36,8 @@ if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/tcl${TCL_LIBVERSION}/lib/tclConf if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${TCL_LIBVERSION}/tclConfig.sh; fi if [ ! -f ${tcl_cfg} ]; then tcl_cfg=${TCLHOME}/lib/tcl${TCL_LIBVERSION}/lib/tclConfig.sh; fi if [ -f ${tcl_cfg} ]; then - tcl_ver=`awk '/^TCL_VERSION=.*/ {gsub("TCL_VERSION=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2` - if [ "$tcl_ver" != ${TCL_LIBVERSION} ] ; then + tcl_ver=`awk '/^VERSION_TCL=.*/ {gsub("VERSION_TCL=","",$1);print $1}' ${tcl_cfg} | cut -d "'" -f 2` + if [ "${tcl_ver}" != ${TCL_LIBVERSION} ] ; then return 1 fi else @@ -50,8 +50,8 @@ if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/tk${TK_LIBVERSION}/tkConfig.sh; fi if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${TK_LIBVERSION}/tkConfig.sh; fi if [ ! -f ${tk_cfg} ]; then tk_cfg=${TCLHOME}/lib/tk${TK_LIBVERSION}/lib/tkConfig.sh; fi if [ -f ${tk_cfg} ]; then - tk_ver=`awk '/^TK_VERSION=.*/ {gsub("TK_VERSION=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2` - if [ "$tk_ver" != ${TK_LIBVERSION} ] ; then + tk_ver=`awk '/^VERSION_TK=.*/ {gsub("VERSION_TK=","",$1);print $1}' ${tk_cfg} | cut -d "'" -f 2` + if [ "${tk_ver}" != ${TK_LIBVERSION} ] ; then return 1 fi else @@ -64,7 +64,7 @@ return 0 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh < ${INST_ROOT}/${PRODUCT_TYPE}.src.size +fi # to generate environment scripts try_preinstalled @@ -115,7 +119,7 @@ install_source # build sources test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} -cd ${PRODUCT_SRC_DIR}/tcl-${TCL_VERSION}_SRC/unix +cd ${PRODUCT_SRC_DIR}/tcl-${VERSION_TCL}_SRC/unix cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <> ${PRODUCT_DIR}/MAKE.LOG <> ${PRODUCT_DIR}/CONFIGURE.LOG <> ${PRODUCT_DIR}/MAKE.LOG <> ${PRODUCT_DIR}/CONFIGURE.LOG <> ${PRODUCT_DIR}/MAKE.LOG < ${INST_ROOT}/${PRODUCT_TYPE}.build.size + du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size +fi # remove sources and temporary files after building -if [ ${REMOVE_SRC_TMP} == "TRUE" ] ; then +if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR} fi @@ -219,31 +223,23 @@ try_preinstalled install_binary() { make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE} -source ${INSTALL_WORK}/$SHRC +source ${INSTALL_WORK}/${SHRC} # create a product directory test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR} check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR} -# overriding installation path -cd ${PRODUCT_DIR}/lib -old_prefix=`grep -e "^TCL_PREFIX='.*'" tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"` -sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" tclConfig.sh -sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" tkConfig.sh - -cd ${PRODUCT_DIR} -test `uname -m` = "x86_64" && test ! -e lib64 && ln -s lib lib64 +# add symbolic link for 64bit platforms (VSR: is it indeed needed?) +(cd ${PRODUCT_DIR} && test `uname -m` = "x86_64" && test ! -e lib64 && ln -sf lib lib64) -# modify pkgconfig -if [ -d ${PRODUCT_DIR}/lib/pkgconfig ] ; then - cd ${PRODUCT_DIR}/lib/pkgconfig - for l in X `find . -name "*.pc"`; do +# overriding installation path +old_prefix=`grep -e "^TCL_PREFIX='.*'" ${PRODUCT_DIR}/lib/tclConfig.sh | sed -e "s%^TCL_PREFIX='\(.*\)'%\1%g"` +for l in X `find ${PRODUCT_DIR}/lib -name "*Config.sh"` `find ${PRODUCT_DIR}/lib/pkgconfig -name "*.pc"` ; do if [ "${l}" != "X" ] ; then - sed -i "s%^prefix=.*%prefix=${PRODUCT_DIR}%g;s%exec_prefix=.*%exec_prefix=${PRODUCT_DIR}%g;s%libdir=.*%libdir=${PRODUCT_DIR}/lib%g" ${l} + sed -i "s%${old_prefix}%${PRODUCT_DIR}%g" ${l} fi - done -fi +done # to generate environment scripts try_preinstalled @@ -258,10 +254,10 @@ export PRODUCT_TYPE=$6; export INSTALL_PRODUCTS=$7; shift REMOVE_SRC_TMP=$8; -test $# == 10 && shift && SINGLE_DIR=$9 -export PRODUCT="tcltk-${TCL_VERSION}" +test $# = 10 && shift && SINGLE_DIR=$9 +export PRODUCT="tcltk-${VERSION_TCL}" export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}} export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT} export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC source ./common.sh -$PROCEDURE +${PROCEDURE} diff --git a/config_files/xdata.sh b/config_files/xdata.sh index 451b8eb..c195d19 100755 --- a/config_files/xdata.sh +++ b/config_files/xdata.sh @@ -25,7 +25,7 @@ return 0 print_env_bin() { cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh < ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <> ${PRODUCT_DIR}/MAKE.LOG <