3 ########################################################################
4 # LIGHT : sample (no-corba-engine) SALOME module
6 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
7 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
9 # This library is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public
11 # License as published by the Free Software Foundation; either
12 # version 2.1 of the License.
14 # This library is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with this library; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 # See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
25 # Author : Marc Tajchman - CEA
29 # Tool for updating list of .in file for the SALOME project
30 # and regenerating configure script
32 ########################################################################
35 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
37 ########################################################################
38 # Test if the KERNEL_ROOT_DIR is set correctly
40 if test ! -d "${KERNEL_ROOT_DIR}"; then
41 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
45 # Test if the KERNEL_SRC is set correctly
47 #if test ! -d "${KERNEL_SRC}"; then
48 # echo "failed : KERNEL_SRC variable is not correct !"
51 ########################################################################
52 # find_in - utility function
55 # find_in directory filename
57 # Finds files following the *.in pattern, recursively in the
58 # directory (first argument).
59 # Results are appended into the file (second argument)
61 # Difference from the standard unix find is that files are tested
70 # if the first argument is not a directory, returns
72 if [ ! -d "$1" ] ; then
76 # dont look in the CVS directories
83 # for each regular file contained in the directory
84 # test if it's a .in file
90 *.in) echo " "$i" \\" >> $f;;
96 # for each subdirectory of the first argument, proceeds recursively
100 if [ -d "$i" ] ; then
107 #######################################################################
108 # Generate list of .in files (Makefile.in, config.h.in, etc)
109 # appending it in file configure.in
115 # Common part of the configure.in file
117 chmod u+w configure.in.base
118 if \cp -f configure.in.base configure.in_tmp1
123 echo "error : can't create files in" ${CONF_DIR}
125 chmod u-w configure.in.base
128 chmod u-w configure.in.base
130 if [ -e "${CONF_DIR}/salome_adm" ] ; then
131 \rm -f ${CONF_DIR}/salome_adm
134 # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
135 echo "" >> configure.in_tmp1
136 echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
138 echo "" >> configure.in_tmp1
139 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
142 # List of .in files in the adm/unix directory
143 # These files MUST be on top of AC_OUTPUT list so we
144 # put them "manually"
146 # Attention, l'ordre d'entrée des fichiers doit être choisi avec
149 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
150 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
151 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
153 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
154 echo " ./salome_adm/unix/make_omniorb \\" >> configure.in_tmp1
155 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
156 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
158 # _CS_gbo Pour assurer ls construction correct de la chaîne de
159 # dépendance, il apparaît nécessaire de surcharger le make_conclude
160 # (resp. make_commence) pardéfaut, c'est à dire le make_conclude de
161 # salome_adm, par le make_conclude (resp. make_commence) du module,
162 # c'est à dire le make_conclude (resp. make_commence) du répertoire
164 echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1
165 echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
167 \rm -f configure.in_tmp2 configure.in_tmp3
168 touch configure.in_tmp2
170 find_in . configure.in_tmp2
172 # _CS_gbo_100204 Mise à jour du filtre pour prise en compte des
173 # restrictions imposées par les versions récente de autoconf.
174 sed -e '/^ \.\/salome_adm/d' \
175 -e '/configure.in/d' \
176 -e '/^ \.\/adm_local/d' \
177 -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
179 echo "])" >> configure.in_tmp1
181 # delete the link created for AC_OUTPUT
182 echo "" >> configure.in_tmp1
183 #echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
184 \mv configure.in_tmp1 configure.in_new
185 \rm -f configure.in_tmp2 configure.in_tmp3
188 ########################################################################
189 # Create new (or replace old) configure.in file
190 # Print a message if the file is write protected
194 if test ! -f configure.in
196 echo -n "Creating new file 'configure.in' ... "
197 if \mv configure.in_new configure.in >& /dev/null
201 echo "error, check your file permissions"
204 echo -n "Updating 'configure.in' file ... "
205 if \cp configure.in configure.in_old >& /dev/null
211 echo "Can't backup previous configure.in"
212 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
221 if \cp configure.in_new configure.in >& /dev/null
226 echo "error, can't update previous configure.in"
230 ########################################################################
231 # Use autoconf to rebuild the configure script
236 echo -n "Updating 'configure' script ... "
238 echo -n "Creating 'configure' script ... "
241 aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
246 echo "failed (check file permissions and/or user quotas ...)"