Salome HOME
Update for Salome series 4x
[tools/install.git] / config_files / build.sh
index b0adfa571971a9d772b7c253fb4eedb17bd46a2a..c6fd4dd7825e472aa8176429e2701481b4358a8f 100755 (executable)
@@ -6,7 +6,7 @@
 #  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
 #  Project   : SALOME
 #  Module    : Installation Wizard
-#  Copyright : 2002-2006 CEA
+#  Copyright : 2002-2007 CEA
 #
 #  This script is the part of the SALOME installation procedure.
 #
@@ -25,7 +25,7 @@ usage(){
     echo "            make install commands"
     echo ""
     echo "Usage:"
-    echo "            build.csh [ <option> ] ... [ <module> [ <module> ... ] ]"
+    echo "            build.sh [ <option> ] ... [ <module> [ <module> ... ] ]"
     echo ""
     echo "<module>    Modules to build, separated by space(s)."
     echo "            If no modules are given - all SALOME modules are assumed."
@@ -38,6 +38,10 @@ usage(){
     echo ""
     echo "-c          Perform configure command for all given modules. Default is off."
     echo ""
+    echo "-w          Add --without-ihm key to build_configure and configure"
+    echo "            commands for MED module to build its sources without GUI."
+    echo "            By default MED sources are built with GUI."
+    echo ""
     echo "-d          Delete build directories before calling configure, to enforce full"
     echo "            rebuild (and reinstall if -i or -p option is used) of module."
     echo "            Use this option carefully."
@@ -79,11 +83,12 @@ usage(){
 
 is_build_configure=0
 is_configure=0
+med_with_gui=1
 is_delete=0
 verbose_level=2
 params=""
 b_params=""
-modules="KERNEL GUI GEOM MED SMESH VISU SUPERV NETGENPLUGIN GHS3DPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT"
+modules="KERNEL GUI GEOM MED SMESH VISU SUPERV NETGENPLUGIN GHS3DPLUGIN BLSURFPLUGIN HexoticPLUGIN GHS3DPRLPLUGIN COMPONENT PYCALCULATOR CALCULATOR HELLO PYHELLO LIGHT SIERPINSKY RANDOMIZER FILTER YACS MULTIPR"
 optim=""
 is_install=0
 is_tui=0
@@ -92,11 +97,12 @@ prefix=""
 #########################################################
 # parse parameters
 #########################################################
-while getopts ":hbcdoitv:p:" option ; do
+while getopts ":hbcwdoitv:p:" option ; do
     case $option in
         h ) usage ;;
         b ) is_build_configure=1 ; is_configure=1 ;;
         c ) is_configure=1 ;;
+        w ) med_with_gui=0 ;;
         d ) is_delete=1 ;;
         o ) optim="--enable-production=yes --disable-debug" ;;
         i ) is_install=1 ;;
@@ -249,13 +255,16 @@ for module in ${modules}; do
                #########################################################
                 # call build_configure
                #########################################################
+               if [ $med_with_gui -eq 0 ] && [ ${module} == "MED" ] ; then
+                   add_keys="--without-ihm"
+               fi
                cd ${module_src}
-               ./build_configure >& ${LOG_DIR}/build_configure_${module}.log
+               ./build_configure ${add_keys} >& ${LOG_DIR}/build_configure_${module}.log
                #########################################################
                # echo possible errors
                #########################################################
                if [ $verbose_level -gt 0 ] ; then
-                   cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" > /dev/stderr
+                   cat ${LOG_DIR}/build_configure_${module}.log | grep -E "(failed|: error:)" >&2
                fi
            fi
        fi
@@ -325,7 +334,13 @@ for module in ${modules}; do
                echo '!!! Warning !!! Can not find configure script in '${module_src}'.'
                echo
            else
-               if [  "${module}" == "NETGENPLUGIN" ] && [ "$NETGENHOME" != "" ] ; then
+               if [ $med_with_gui -eq 0 ] && [ "${module}" == "MED" ] ; then
+                   add_keys="--without-ihm"
+               fi
+               if [  "${module}" == "MED" ] && [ "${METISDIR}" != "" ] && [ "${SCOTCHDIR}" != "" ] ; then
+                   add_keys="--enable-splitter=yes --with-metis=${METISDIR} --with-scotch=${SCOTCHDIR}"
+               fi
+               if [ "${module}" == "NETGENPLUGIN" ] && [ "$NETGENHOME" != "" ] ; then
                    add_keys="--with-netgen=${NETGENHOME}"
                fi
                ${module_src}/configure --prefix=$px ${optim} ${add_keys} >& ${LOG_DIR}/configure_${module}.log
@@ -333,10 +348,10 @@ for module in ${modules}; do
                # echo possible errors
                #########################################################
                if [ $verbose_level -gt 0 ] ; then
-                   cat ${LOG_DIR}/configure_${module}.log | grep ": error:" > /dev/stderr
+                   cat ${LOG_DIR}/configure_${module}.log | grep ": error:" >&2
                fi
                if [ $verbose_level -gt 1 ] ; then
-                   cat ${LOG_DIR}/configure_${module}.log | grep ": WARNING:" > /dev/stderr
+                   cat ${LOG_DIR}/configure_${module}.log | grep ": WARNING:" >&2
                fi
            fi
        fi
@@ -360,7 +375,7 @@ for module in ${modules}; do
         #########################################################
         # print make errors
         #########################################################
-       cat ${LOG_DIR}/make_${module}.log | grep '[*][*][*]' > /dev/stderr
+       cat ${LOG_DIR}/make_${module}.log | grep '[*][*][*]' >&2
         #########################################################
         # print compiler errors and warnings
         # Note: here awk is used to concatenate together several lines of single
@@ -369,10 +384,10 @@ for module in ${modules}; do
         #########################################################
        if [ $verbose_level -gt 0 ] ; then
            ###cat ${LOG_DIR}/make_${module}.log | grep ": error"
-           cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep "${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@ > /dev/stderr
+           cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep "${module_src}/[A-Za-z_0-9./]*:" | sed s@"^${module_src}/src/"@@ >&2
        fi
        if [ $verbose_level -gt 1 ] ; then
-           cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep ": warning" | sed s@"^${module_src}/src/"@@ > /dev/stderr
+           cat ${LOG_DIR}/make_${module}.log | awk 'substr($0,0,1)!=" " {print ""} {printf $0} END {print ""}' | grep ": warning" | sed s@"^${module_src}/src/"@@ >&2
        fi
         #########################################################
         # perform make dev_docs step if -t flag is given
@@ -383,7 +398,7 @@ for module in ${modules}; do
            if [ "$dd" != "" ] ; then
                echo "... Performing make dev_docs"
                make dev_docs >& ${LOG_DIR}/make_dev_docs_${module}.log
-               cat ${LOG_DIR}/make_dev_docs_${module}.log | grep '[*][*][*]' > /dev/stderr
+               cat ${LOG_DIR}/make_dev_docs_${module}.log | grep '[*][*][*]' >&2
            fi
        fi
        cd ${module_build}