khanat-opennel-code/code/ryzom/tools/scripts/linux/utilities
StudioEtrange 91e6b23d3f ** PCH Support for NMake with VS2012
NMAKE-VS2012 Error LNK2011
while NMAKE-VS2010 does not complain
we need to link the pch.obj file
see http://msdn.microsoft.com/en-us/library/3ay26wa2(v=vs.110).aspx

** PCH Support for Ninja
Ninja need to add property
        OBJECT_DEPENDS for using PCH
        OBJECT_OUTPUTS for create PCH
see http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
2013-09-05 17:18:01 +02:00

202 lines
4 KiB
Bash
Executable file

#!/bin/sh -
SSH_AGENT_FILE="$HOME/ssh_agent_file"
BASENAME=`basename $0`
LOG_INFO="$RYZOM_PATH/log/${BASENAME}_info.log"
LOG_ERROR="$RYZOM_PATH/log/${BASENAME}_error.log"
# first param is the subject line
# others params are email
send_mail()
{
SUBJECT=$1
shift
echo Send mail to $* with log $LOG_ERROR in body and subject $SUBJECT
cat $LOG_ERROR | mail -s "$SUBJECT on `hostname`" $*
}
print_success()
{
echo "*********************** $* SUCCESS !"
echo
}
print_failure()
{
echo "***************************************************"
echo "***************************************************"
echo "*********************** $* FAILED"
echo "***************************************************"
echo "***************************************************"
}
# failed fill the log and send email if necessary
# argument are the error message
failed()
{
print_failure $*
if [ "X$LOG_INFO" != "X" ]
then
print_failure $* >> $LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
print_failure $* >> $LOG_ERROR
fi
if [ "X$MAIL_ERROR" != "X" ]
then
send_mail "$* FAILED" $MAIL_ERROR
else
echo "No email to send the error mail" >> $LOG_ERROR
fi
echo "exiting..."
exit
}
# useful function to avoid continuing if something goes wrong
# first param is $? and second is the string that will display
verify()
{
if [ $1 -eq 0 ]
then
shift
print_success $*
if [ "X$LOG_INFO" != "X" ]
then
print_success $* >> $LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
print_success $* >> $LOG_ERROR
fi
else
shift
failed $*
fi
}
# step_failed() fills the log and increments $STEPS_FAILURES
step_failed()
{
print_failure $*
if [ "X$LOG_INFO" != "X" ]
then
print_failure $* >> $LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
print_failure $* >> $LOG_ERROR
fi
if [ "X$STEPS_FAILURES" = "X" ]
then
STEPS_FAILURES=0
else
STEPS_FAILURES=`expr $STEPS_FAILURES + 1`
fi
}
# call init_steps() before you use step()
# it takes a label for following steps as parameter
init_steps()
{
STEPS_LABEL="$*"
STEPS_FAILURES=0
}
# like verify() but will continue even if step failed until verify_steps() is called
# first param is $? and second is the string that will display
step()
{
if [ $1 -eq 0 ]
then
shift
print_success $*
if [ "X$LOG_INFO" != "X" ]
then
print_success $* >> $LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
print_success $* >> $LOG_ERROR
fi
else
shift
step_failed $*
fi
}
# call verify_steps() when you want to stop if error(s) occured in previous steps
verify_steps()
{
if [ $STEPS_FAILURES -eq 0 ]
then
print_success $STEPS_LABEL
if [ "X$LOG_INFO" != "X" ]
then
print_success $STEPS_LABEL >> $LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
print_success $STEPS_LABEL >> $LOG_ERROR
fi
else
if [ $STEPS_FAILURES -eq 1 ]
then
failed "1 step failed: $STEPS_LABEL"
else
failed "$STEPS_FAILURES steps failed: $STEPS_LABEL"
fi
fi
}
ask_confirmation()
{
echo "Using this script will destroy the current version, type 'yes' if you really want to do that"
read CONF
if [ "X$CONF" != "Xyes" ]; then
failed "You didn't answer 'yes', I stop the script!"
fi
}
check_host()
{
HOST=`hostname -s`
if [ "X$HOST" != "X$1" ]; then
failed "You can execute this script only on '$1' and not on '$HOST'"
fi
}
# useful function to initialize the default log for all scripts
init()
{
if [ "X$LOG_INFO" != "X" ]
then
test -d `dirname $LOG_INFO` || mkdir -p `dirname $LOG_INFO`
test ! -f $LOG_INFO || rm $LOG_INFO
touch $LOG_INFO
# display all ulimit in the log
ulimit -a >>$LOG_INFO
fi
if [ "X$LOG_ERROR" != "X" ]
then
test -d `dirname $LOG_ERROR` || mkdir -p `dirname $LOG_ERROR`
test ! -f $LOG_ERROR || rm $LOG_ERROR
touch $LOG_ERROR
fi
}
init_ssh()
{
if [ ! -f $SSH_AGENT_FILE ]
then
failed "the file $SSH_AGENT_FILE not exist, you must call create_ssh_agent_file first"
fi
eval `cat $SSH_AGENT_FILE`
}