4 # Tool for updating list of .in file for the SALOME project
5 # and regenerating configure script
7 # Author : Marc Tajchman - CEA
13 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
15 ########################################################################
16 # Test if the KERNEL_ROOT_DIR is set correctly
18 if test ! -d "${KERNEL_ROOT_DIR}"; then
19 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
23 # Test if the KERNEL_SRC is set correctly
25 #if test ! -d "${KERNEL_SRC}"; then
26 # echo "failed : KERNEL_SRC variable is not correct !"
29 ########################################################################
30 # find_in - utility function
33 # find_in directory filename
35 # Finds files following the *.in pattern, recursively in the
36 # directory (first argument).
37 # Results are appended into the file (second argument)
39 # Difference from the standard unix find is that files are tested
48 # if the first argument is not a directory, returns
50 if [ ! -d "$1" ] ; then
54 # dont look in the CVS directories
61 # for each regular file contained in the directory
62 # test if it's a .in file
68 *.in) echo " "$i" \\" >> $f;;
74 # for each subdirectory of the first argument, proceeds recursively
85 #######################################################################
86 # Generate list of .in files (Makefile.in, config.h.in, etc)
87 # appending it in file configure.in
93 # Common part of the configure.in file
95 chmod u+w configure.in.base
96 if \cp -f configure.in.base configure.in_tmp1
101 echo "error : can't create files in" ${CONF_DIR}
103 chmod u-w configure.in.base
106 chmod u-w configure.in.base
108 if [ -e "${CONF_DIR}/salome_adm" ] ; then
109 \rm -f ${CONF_DIR}/salome_adm
112 # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
113 echo "" >> configure.in_tmp1
114 echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
116 echo "" >> configure.in_tmp1
117 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
120 # List of .in files in the adm/unix directory
121 # These files MUST be on top of AC_OUTPUT list so we
122 # put them "manually"
124 # Attention, l'ordre d'entrée des fichiers doit être choisi avec
127 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
128 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
129 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
131 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
132 echo " ./adm_local/unix/make_omniorb \\" >> configure.in_tmp1
133 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
134 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
136 # _CS_gbo Pour assurer ls construction correct de la chaîne de
137 # dépendance, il apparaît nécessaire de surcharger le make_conclude
138 # (resp. make_commence) pardéfaut, c'est à dire le make_conclude de
139 # salome_adm, par le make_conclude (resp. make_commence) du module,
140 # c'est à dire le make_conclude (resp. make_commence) du répertoire
142 echo " ./adm_local/unix/make_commence \\" >> configure.in_tmp1
143 echo " ./adm_local/unix/make_conclude \\" >> configure.in_tmp1
145 \rm -f configure.in_tmp2 configure.in_tmp3
146 touch configure.in_tmp2
148 find_in . configure.in_tmp2
150 # _CS_gbo_100204 Mise à jour du filtre pour prise en compte des
151 # restrictions imposées par les versions récente de autoconf.
152 sed -e '/^ \.\/salome_adm/d' \
153 -e '/configure.in/d' \
154 -e '/^ \.\/adm_local/d' \
155 -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
157 echo "])" >> configure.in_tmp1
159 # delete the link created for AC_OUTPUT
160 echo "" >> configure.in_tmp1
161 #echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
162 \mv configure.in_tmp1 configure.in_new
163 \rm -f configure.in_tmp2 configure.in_tmp3
166 ########################################################################
167 # Create new (or replace old) configure.in file
168 # Print a message if the file is write protected
172 if test ! -f configure.in
174 echo -n "Creating new file 'configure.in' ... "
175 if \mv configure.in_new configure.in >& /dev/null
179 echo "error, check your file permissions"
182 echo -n "Updating 'configure.in' file ... "
183 if \cp configure.in configure.in_old >& /dev/null
189 echo "Can't backup previous configure.in"
190 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
199 if \cp configure.in_new configure.in >& /dev/null
204 echo "error, can't update previous configure.in"
208 ########################################################################
209 # Use autoconf to rebuild the configure script
214 echo -n "Updating 'configure' script ... "
216 echo -n "Creating 'configure' script ... "
219 aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
224 echo "failed (check file permissions and/or user quotas ...)"