Salome HOME
Make MPI product optional
[samples/component.git] / build_configure
index 41d838aa368ec834b5c22887167e12aea7f75bf7..8dc1b2dbf325381acbcc5a7c0b9bbb5e83e05bb6 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 #
 # Tool for updating list of .in file for the SALOME project 
@@ -26,6 +26,22 @@ fi
 #    echo "failed : KERNEL_SRC variable is not correct !"
 #    exit
 #fi
+########################################################################
+# Test if the GUI_ROOT_DIR is set correctly
+
+if test ! -d "${GUI_ROOT_DIR}"; then
+    echo "failed : GUI_ROOT_DIR variable is not correct !"
+    exit
+fi
+
+########################################################################
+# Test if the MED_ROOT_DIR is set correctly
+
+if test ! -d "${MED_ROOT_DIR}"; then
+    echo "failed : MED_ROOT_DIR variable is not correct !"
+    exit
+fi
+
 ########################################################################
 # find_in - utility function
 #
@@ -42,8 +58,8 @@ fi
 
 find_in()
 {
-  local i
-  local f=$2
+  i=0
+  f=$2
 
 # if the first argument is not a directory, returns
 
@@ -55,6 +71,7 @@ find_in()
 
   case $1 in
     */CVS) return ;;
+    */adm_local/*) return ;;
     *) ;;
   esac
 
@@ -93,8 +110,10 @@ ABS_CONF_DIR=`pwd`
 # Common part of the configure.in file
 #
 chmod u+w configure.in.base
-if \cp -f configure.in.base configure.in_tmp1 
+if \cp -f configure.in.base configure.in_tmp1 
 then
+        echo
+else
        echo
        echo "error : can't create files in" ${CONF_DIR}
        echo "aborting ..."
@@ -109,7 +128,7 @@ fi
 
 # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in  files
 echo "" >> configure.in_tmp1
-echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
+echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
 
 echo  "" >> configure.in_tmp1
 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
@@ -119,23 +138,37 @@ echo "AC_OUTPUT([ \\" >> configure.in_tmp1
 # These files MUST be on top of AC_OUTPUT list so we
 # put them "manually"
 #
-
+# Attention, l'ordre d'entrée des fichiers doit être choisi avec
+# précision
+#
 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
+
 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
 echo " ./adm_local/unix/make_omniorb \\" >> configure.in_tmp1
 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
-echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1
-echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
 
+# _CS_gbo Pour assurer ls construction correct de la chaîne de
+# dépendance, il apparaît nécessaire de surcharger le make_conclude
+# (resp. make_commence) pardéfaut, c'est à dire le make_conclude de
+# salome_adm, par le make_conclude (resp. make_commence) du module,
+# c'est à dire le make_conclude (resp. make_commence) du répertoire
+# adm_local
+echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1
+echo " ./adm_local/unix/make_conclude \\" >> configure.in_tmp1
+
 \rm -f configure.in_tmp2 configure.in_tmp3
 touch configure.in_tmp2
+
 find_in . configure.in_tmp2
-sed '/^.salome_adm/d' configure.in_tmp2 >  configure.in_tmp3
-sed '/configure.in/d' configure.in_tmp3 >  configure.in_tmp2
-sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
+
+# _CS_gbo_100204 Mise à jour du filtre pour prise en compte des
+# restrictions imposées par les versions récente de autoconf.
+    sed -e '/^...salome_adm/d' \
+       -e '/configure.in/d'      \
+       -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
 
 echo  "])" >> configure.in_tmp1
 
@@ -163,8 +196,10 @@ then
        fi
 else
        echo -n "Updating 'configure.in' file ... "
-       if \cp configure.in configure.in_old >& /dev/null
+       if \cp configure.in configure.in_old >& /dev/null
        then
+                echo
+       else
                echo
                echo
                echo "Can't backup previous configure.in"
@@ -197,7 +232,9 @@ else
        echo -n "Creating 'configure' script ...  "
 fi
 
-aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
+                                       -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
+                                       -I ${MED_ROOT_DIR}/adm_local/unix/config_files
 if autoconf
 then
        echo "done"