#! /bin/csh -f
##################################################################################################
# Name : build.csh
-# Description: Build and install SALOME2 modules from sources
+# Description: Build and install SALOME modules from sources
# Author : Vadim SANDLER (VSR), Open CASCADE S.A.
# Created : 27.01.2005
##################################################################################################
export DELIM="------"
export SHRC="salome.sh"
export CSHRC="salome.csh"
-export DEBUG=1
#this function takes several parameters
#first parameter contains descriptor of output file
{
out=$1
shift
- echo -e "`pwd` -> $* >> $out"
- if [ $DEBUG == 0 ] ; then
- $* | tee $out
+ errfile=/tmp/errlog
+ 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
else
- if [ $out == "1" ] ; then
$*
- else
- $* >> $out 2>&1
- fi
fi
if [ "$?" -ne "0" ] ; then
if [ $out != "1" ] ; then
cat $out
+ cat $errfile >&2
+ cat $errfile >> $out
fi
# VSR : 10/11/05: disable answer mode ==>
#echo -n " " >&2
# 1. first dump all environment files into the $SHRC file
product_sequence="$2"
for i in $product_sequence ; do
- cat ${install_work}/env_${i}.sh >> ${install_work}/$SHRC 2>/dev/null
+ env_file=${install_work}/env_${i}.sh
+ ( test -e $env_file && cat $env_file >> ${install_work}/$SHRC 2>/dev/null )
done
# 2. writing global functions to _salome.sh file