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 # Check --with-kernel option
23 -with-ihm | --with-ihm)
26 -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
32 ########################################################################
33 # Test if the KERNEL_ROOT_DIR is set correctly
35 if test ! -d "${KERNEL_ROOT_DIR}"; then
36 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
40 # Test if the KERNEL_SRC is set correctly
42 #if test ! -d "${KERNEL_SRC}"; then
43 # echo "failed : KERNEL_SRC variable is not correct !"
46 ########################################################################
47 # Test if the GUI_ROOT_DIR is set correctly
49 if test ${SUPERV_WITH_GUI} = yes; then
50 if test ! -d "${GUI_ROOT_DIR}"; then
51 echo "failed : GUI_ROOT_DIR variable is not correct !"
56 ########################################################################
57 # find_in - utility function
60 # find_in directory filename
62 # Finds files following the *.in pattern, recursively in the
63 # directory (first argument).
64 # Results are appended into the file (second argument)
66 # Difference from the standard unix find is that files are tested
75 # if the first argument is not a directory, returns
77 if [ ! -d "$1" ] ; then
81 # dont look in the CVS directories
85 */adm_local/*) return ;;
89 # for each regular file contained in the directory
90 # test if it's a .in file
96 *.in) echo " "$i" \\" >> $f;;
102 # for each subdirectory of the first argument, proceeds recursively
106 if [ -d "$i" ] ; then
113 #######################################################################
114 # Generate list of .in files (Makefile.in, config.h.in, etc)
115 # appending it in file configure.in
121 # Common part of the configure.in file
123 chmod u+w configure.in.base
124 if ! \cp -f configure.in.base configure.in_tmp1
127 echo "error : can't create files in" ${CONF_DIR}
129 chmod u-w configure.in.base
132 chmod u-w configure.in.base
134 if [ -e "${CONF_DIR}/salome_adm" ] ; then
135 \rm -f ${CONF_DIR}/salome_adm
138 # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
139 echo "" >> configure.in_tmp1
140 echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
142 echo "" >> configure.in_tmp1
143 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
146 # List of .in files in the adm/unix directory
147 # These files MUST be on top of AC_OUTPUT list so we
148 # put them "manually"
151 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
152 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
153 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
154 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
155 echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1
156 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
157 echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1
158 echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
159 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
161 \rm -f configure.in_tmp2 configure.in_tmp3
162 touch configure.in_tmp2
163 find_in . configure.in_tmp2
164 sed -e '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3
165 sed -e '/^...adm_local.unix.make_omniorb/d' configure.in_tmp3 > configure.in_tmp2
166 sed -e '/^...adm_local.unix.make_commence/d' configure.in_tmp2 > configure.in_tmp3
167 sed -e '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
168 sed -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
169 #sed '/^.*salome_adm/d' configure.in_tmp2 > configure.in_tmp3
170 #sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
171 #sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
173 echo "])" >> configure.in_tmp1
175 # delete the link created for AC_OUTPUT
176 #echo "" >> configure.in_tmp1
177 #echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
178 \mv configure.in_tmp1 configure.in_new
179 \rm -f configure.in_tmp2 configure.in_tmp3
182 ########################################################################
183 # Create new (or replace old) configure.in file
184 # Print a message if the file is write protected
188 if test ! -f configure.in
190 echo -n "Creating new file 'configure.in' ... "
191 if \mv configure.in_new configure.in >& /dev/null
195 echo "error, check your file permissions"
198 echo -n "Updating 'configure.in' file ... "
199 if ! \cp configure.in configure.in_old >& /dev/null
203 echo "Can't backup previous configure.in"
204 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
213 if \cp configure.in_new configure.in >& /dev/null
218 echo "error, can't update previous configure.in"
222 ########################################################################
223 # Use autoconf to rebuild the configure script
228 echo -n "Updating 'configure' script ... "
230 echo -n "Creating 'configure' script ... "
233 if test ${SUPERV_WITH_GUI} = yes; then
234 aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
235 -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED \
236 -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
238 aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
239 -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/DEPRECATED
246 echo "failed (check file permissions and/or user quotas ...)"