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 # find_in - utility function
19 # find_in directory filename
21 # Finds files following the *.in pattern, recursively in the
22 # directory (first argument).
23 # Results are appended into the file (second argument)
25 # Difference from the standard unix find is that files are tested
37 # if the first argument is not a directory, returns
39 if [ ! -d "$1" ] ; then
43 # dont look in the CVS directories
50 # for each regular file contained in the directory
51 # test if it's a .in file
57 *.in) echo " "$i" \\" >> $f;;
63 # for each subdirectory of the first argument, proceeds recursively
74 #######################################################################
75 # Generate list of .in files (Makefile.in, config.h.in, etc)
76 # appending it in file configure.in
82 # Common part of the configure.in file
84 chmod u+w configure.in.base
86 #if ! \cp -f configure.in.base configure.in_tmp1
87 if \cp -f configure.in.base configure.in_tmp1
92 echo "error : can't create files in" ${CONF_DIR}
94 chmod u-w configure.in.base
97 chmod u-w configure.in.base
99 #############################################
100 echo '' >> configure.in_tmp1
101 echo 'export TEMPO=${KERNEL_ROOT_DIR}' >> configure.in_tmp1
102 echo 'export KERNEL_ROOT_DIR=${ROOT_SRCDIR}' >> configure.in_tmp1
103 #############################################
105 echo "" >> configure.in_tmp1
106 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
109 # List of .in files in the adm/unix directory
110 # These files MUST be on top of AC_OUTPUT list so we
111 # put them "manually"
114 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
115 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
116 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
117 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
118 echo " ./salome_adm/unix/make_omniorb \\" >> configure.in_tmp1
119 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
120 echo " ./salome_adm/unix/make_commence \\" >> configure.in_tmp1
121 echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
122 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
123 echo " ./salome_adm/Makefile \\" >> configure.in_tmp1
125 \rm -f configure.in_tmp2 configure.in_tmp3
126 touch configure.in_tmp2
127 find_in . configure.in_tmp2
128 sed '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3
129 sed '/configure.in/d;/make_config.in/d' configure.in_tmp3 > configure.in_tmp2
130 sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
132 echo "])" >> configure.in_tmp1
134 #############################################
135 echo 'export KERNEL_ROOT_DIR=${TEMPO}' >> configure.in_tmp1
136 #############################################
138 \mv configure.in_tmp1 configure.in_new
139 \rm -f configure.in_tmp2 configure.in_tmp3
142 ########################################################################
143 # Create new (or replace old) configure.in file
144 # Print a message if the file is write protected
148 if test ! -f configure.in
150 echo -n "Creating new file 'configure.in' ... "
151 if \mv configure.in_new configure.in >& /dev/null
155 echo "error, check your file permissions"
158 echo -n "Updating 'configure.in' file ... "
160 # if ! \cp configure.in configure.in_old >& /dev/null
161 if \cp configure.in configure.in_old >& /dev/null
167 echo "Can't backup previous configure.in"
168 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
177 if \cp configure.in_new configure.in >& /dev/null
182 echo "error, can't update previous configure.in"
186 ########################################################################
187 # Use autoconf to rebuild the configure script
192 echo -n "Updating 'configure' script ... "
194 echo -n "Creating 'configure' script ... "
197 aclocal --acdir=adm_local/unix/config_files -I salome_adm/unix/config_files
202 echo "failed (check file permissions and/or user quotas ...)"
205 ###############################################################
206 # Creating make_config
208 if test -f make_config
210 echo -n "Updating 'make_config' script ... "
212 echo -n "Creating 'make_config' script ... "
215 if autoconf -o make_config make_config.in
219 echo "failed (check file permissions and/or user quotas ...)"