export CSHRC="salome.csh"
#####################################################
-# !WARNING! This is current SALOME version number
+# !WARNING! This is current SALOME version number
####################################################
export SALOME_VERSION="7.3.0"
export YACSGEN_VERSION=${SALOME_VERSION}
make_env()
{
install_root=$1; shift
-install_work=$1;
+install_work=$1;
for i in ${SHRC} ${CSHRC} ; do
if [ -e ${install_work}/${i} ]; then
#${DELIM} Environment switch: 0 for SALOME building, 1 for SALOME launching ${DELIM}
export ENV_FOR_LAUNCH=1
+#${DELIM} Setting numeric locale ${DELIM}
+export LC_NUMERIC=C
+
EOF
-### !!! The next is for RedHat 9 only !!!
+### !!! The next is for RedHat 9 only !!!
if [ -f /etc/redhat-release ] ; then
grep -e "Red Hat Linux release 9" /etc/redhat-release > /dev/null
if [ $? -eq 0 ] ; then
#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
-
# 1. first dump all environment files into the ${SHRC} file
product_sequence="$2"
install_products="$3"
# 2. writing global functions to _salome.sh file
cat >> ${install_work}/_${SHRC} <<EOF
##########################################################################
-# Functions exporta and exportp are used to append/prepend correspondingly
+# Functions exporta and exportp are used to append/prepend correspondingly
# one directory or a set of directories separated by semicolon symbol (':')
# to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
-# LD_RUN_PATH etc.
+# LD_RUN_PATH etc.
# The main purpose is to replace default setenv command behavior:
# exporta, exportp also remove duplicated entries, shortening in that way
# the environment variables.
# Note, that these functions work some slower that setenv command itself.
#
#### cleandup ###
-# appends/prepends set of directories (second parameter)
+# appends/prepends set of directories (second parameter)
# to the another set of directories (first parameter) and
# removes duplicated entries;
# the third parameter defines the mode: 0 - append, 1 - prepend
### exporta ###
# appends directory or set of directories, separated by ':' (second parameter)
# to the variable (first parameter)
-exporta () {
+exporta () {
xenv=\${!1}
if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
out_var=\`cleandup \${xenv} \$2 0\`
### exportp ###
# prepends directory or set of directories, separated by ':' (second parameter)
# to the variable (first parameter)
-exportp () {
+exportp () {
xenv=\${!1}
if [ -z "\${xenv}" ]; then xenv="<empty>"; fi
out_var=\`cleandup \${xenv} \$2 1\`
cat >> ${install_work}/_${CSHRC} <<EOF
###########################################################################
-# Aliases setenva and setenvp are used to append/prepend correspondingly
+# Aliases setenva and setenvp are used to append/prepend correspondingly
# one directory or a set of directories separated by semicolon symbol (':')
# to the environment variables like PATH, LD_LIBRARY_PATH, PYTHONPATH,
-# LD_RUN_PATH etc.
+# LD_RUN_PATH etc.
# The main purpose is to replace default setenv command behavior:
# setenva, setenvp also remove duplicated entries, shortening in that way
# the environment variables.
# Note, that these aliases work some slower that setenv command itself.
#
#### cleandup ###
-# appends/prepends set of directories (second parameter)
+# appends/prepends set of directories (second parameter)
# to the another set of directories (first parameter) and
# removes duplicated entries;
# the third parameter defines the mode: 0 - append, 1 - prepend
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
-# Setting "/usr/X11R6/lib" path in LD_LIBRARY_PATH for the libGL.so.1 file
-#if test `uname -m` = "x86_64" ; then
-#echo '# Setting /usr/X11R6/lib64 path in LD_LIBRARY_PATH for the libGL.so.1 file' >> ${INSTALL_WORK}/_tmp2
-#echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib64:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2
-#else
-#echo '# Setting /usr/X11R6/lib path in LD_LIBRARY_PATH for the libGL.so.1 file' >> ${INSTALL_WORK}/_tmp2
-#echo 'export LD_LIBRARY_PATH=/usr/X11R6/lib:${LD_LIBRARY_PATH}' >> ${INSTALL_WORK}/_tmp2
-#fi
-
cat ${INSTALL_WORK}/_tmp2 >> ${install_work}/_${SHRC}
# 5. Create a salome.csh file from salome.sh by replacing export by setenv, etc.
#check existance of lib passed as first parameter
#return 0 if lib exists
-#if you pass second parameter search will be done in it
+#if you pass second parameter search will be done in it
#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(){
}
find_in_path(){
-file=$1; shift;
+file=$1; shift;
path=$*
-for i in `echo ${path} | sed -e"s%:% %g"` ; do
+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"`
arg1=$1; val1=$2; arg2=$3; val2=$4
tmp="^${val1}$|^${val1}:|:${val1}$|:${val1}:"
#echo ${val2} | grep -E "${tmp}" >/dev/null 2>&1
-#if [ $? -eq 0 ] ; then
+#if [ $? -eq 0 ] ; then
# echo "${arg2}"
# return
#fi
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
+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}'`
if [ "${str_to_replace}" = "" ] ; then
str_to_replace="-L${gllibdir} -lGL"
fi
-
+
la_files=`find . -name "*.la"`
for la_file in ${la_files} XXX ; do
if [ "${la_file}" = "XXX" ] ; then continue; fi
if [ -n "${gl2psdir}" ] && [ -d "${gl2psdir}" ] ; then
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}
if [ -n "${tbbdir}" ] && [ -d "${tbbdir}" ] ; then
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}
if [ -n "${paraviewdir}" ] && [ -d "${paraviewdir}" ] ; then
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}