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
34 # if the first argument is not a directory, returns
36 if [ ! -d "$1" ] ; then
40 # dont look in the CVS directories
47 # for each regular file contained in the directory
48 # test if it's a .in file
54 *.in) echo " "$i" \\" >> $f;;
60 # for each subdirectory of the first argument, proceeds recursively
71 #######################################################################
72 # Generate list of .in files (Makefile.in, config.h.in, etc)
73 # appending it in file configure.in
79 # Common part of the configure.in file
81 chmod u+w configure.in.base
82 if ! \cp -f configure.in.base configure.in_tmp1
85 echo "error : can't create files in" ${CONF_DIR}
87 chmod u-w configure.in.base
90 chmod u-w configure.in.base
92 #############################################
93 echo '' >> configure.in_tmp1
94 echo 'export TEMPO=${KERNEL_ROOT_DIR}' >> configure.in_tmp1
95 echo 'export KERNEL_ROOT_DIR=${ROOT_SRCDIR}' >> configure.in_tmp1
96 #############################################
98 echo "" >> configure.in_tmp1
99 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
102 # List of .in files in the adm/unix directory
103 # These files MUST be on top of AC_OUTPUT list so we
104 # put them "manually"
107 echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
108 echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
109 echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
110 echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
111 echo " ./salome_adm/unix/make_omniorb \\" >> configure.in_tmp1
112 echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
113 echo " ./salome_adm/unix/make_commence \\" >> configure.in_tmp1
114 echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
115 echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
116 echo " ./salome_adm/Makefile \\" >> configure.in_tmp1
118 \rm -f configure.in_tmp2 configure.in_tmp3
119 touch configure.in_tmp2
120 find_in . configure.in_tmp2
121 sed '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3
122 sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
123 sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
125 echo "])" >> configure.in_tmp1
127 #############################################
128 echo 'export KERNEL_ROOT_DIR=${TEMPO}' >> configure.in_tmp1
129 #############################################
131 \mv configure.in_tmp1 configure.in_new
132 \rm -f configure.in_tmp2 configure.in_tmp3
135 ########################################################################
136 # Create new (or replace old) configure.in file
137 # Print a message if the file is write protected
141 if test ! -f configure.in
143 echo -n "Creating new file 'configure.in' ... "
144 if \mv configure.in_new configure.in >& /dev/null
148 echo "error, check your file permissions"
151 echo -n "Updating 'configure.in' file ... "
152 if ! \cp configure.in configure.in_old >& /dev/null
156 echo "Can't backup previous configure.in"
157 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
166 if \cp configure.in_new configure.in >& /dev/null
171 echo "error, can't update previous configure.in"
175 ########################################################################
176 # Use autoconf to rebuild the configure script
181 echo -n "Updating 'configure' script ... "
183 echo -n "Creating 'configure' script ... "
186 aclocal --acdir=salome_adm/unix/config_files
191 echo "failed (check file permissions and/or user quotas ...)"