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
93 echo "" >> configure.in_tmp1
94 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
97 # List of .in files in the adm/unix directory
98 # These files MUST be on top of AC_OUTPUT list so we
102 echo " ./adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
103 echo " ./adm/unix/F77config.h \\" >> configure.in_tmp1
104 echo " ./adm/unix/sstream \\" >> configure.in_tmp1
105 echo " ./adm/unix/depend \\" >> configure.in_tmp1
106 echo " ./adm/unix/make_omniorb \\" >> configure.in_tmp1
107 echo " ./adm/unix/envScript \\" >> configure.in_tmp1
108 echo " ./adm/unix/make_commence \\" >> configure.in_tmp1
109 echo " ./adm/unix/make_conclude \\" >> configure.in_tmp1
110 echo " ./adm/unix/make_module \\" >> configure.in_tmp1
112 \rm -f configure.in_tmp2 configure.in_tmp3
113 touch configure.in_tmp2
114 find_in . configure.in_tmp2
115 sed '/^...adm/d' configure.in_tmp2 > configure.in_tmp3
116 sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
117 sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
119 echo "])" >> configure.in_tmp1
120 \mv configure.in_tmp1 configure.in_new
121 \rm -f configure.in_tmp2 configure.in_tmp3
124 ########################################################################
125 # Create new (or replace old) configure.in file
126 # Print a message if the file is write protected
130 if test ! -f configure.in
132 echo -n "Creating new file 'configure.in' ... "
133 if \mv configure.in_new configure.in >& /dev/null
137 echo "error, check your file permissions"
140 echo -n "Updating 'configure.in' file ... "
141 if ! \cp configure.in configure.in_old >& /dev/null
145 echo "Can't backup previous configure.in"
146 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
155 if \cp configure.in_new configure.in >& /dev/null
160 echo "error, can't update previous configure.in"
164 ########################################################################
165 # Use autoconf to rebuild the configure script
170 echo -n "Updating 'configure' script ... "
172 echo -n "Creating 'configure' script ... "
175 aclocal --acdir=adm_local/unix/config_files -I salome_adm/unix/config_files
180 echo "failed (check file permissions and/or user quotas ...)"