2 # Copyright (C) 2006-2015 CEA/DEN, EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Tool for updating list of .in file for the SALOME project
22 # and regenerating configure script
23 # Author : Marc Tajchman - CEA
28 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
30 ########################################################################
31 # Test if the KERNEL_ROOT_DIR is set correctly
33 if test ! -d "${KERNEL_ROOT_DIR}"; then
34 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
38 ########################################################################
39 # find_in - utility function
42 # find_in directory filename
44 # Finds files following the *.in pattern, recursively in the
45 # directory (first argument).
46 # Results are appended into the file (second argument)
48 # Difference from the standard unix find is that files are tested
57 # if the first argument is not a directory, returns
59 if [ ! -d "$1" ] ; then
63 # dont look in the CVS directories
70 # for each regular file contained in the directory
71 # test if it's a .in file
77 *.in) echo $i" \\" >> $f;;
83 # for each subdirectory of the first argument, proceeds recursively
94 #######################################################################
95 # Generate list of .in files (Makefile.in, config.h.in, etc)
96 # appending it in file configure.in
102 # Common part of the configure.in file
104 chmod u+w configure.in.base
105 if ! \cp -f configure.in.base configure.in_tmp1
108 echo "error : can't create files in" ${CONF_DIR}
110 chmod u-w configure.in.base
113 chmod u-w configure.in.base
115 if [ -e "${CONF_DIR}/salome_adm" ] ; then
116 \rm -f ${CONF_DIR}/salome_adm
119 # make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
120 echo "" >> configure.in_tmp1
121 echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}' >> configure.in_tmp1
123 echo "" >> configure.in_tmp1
124 echo "AC_OUTPUT([ \\" >> configure.in_tmp1
127 # List of .in files in the adm/unix directory
128 # These files MUST be on top of AC_OUTPUT list so we
129 # put them "manually"
132 echo "./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
133 echo "./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
134 echo "./salome_adm/unix/sstream \\" >> configure.in_tmp1
135 echo "./salome_adm/unix/depend \\" >> configure.in_tmp1
136 echo "./adm_local/unix/make_omniorb \\" >> configure.in_tmp1
137 echo "./salome_adm/unix/envScript \\" >> configure.in_tmp1
138 echo "./adm_local/unix/make_commence \\" >> configure.in_tmp1
139 echo "./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
140 echo "./salome_adm/unix/make_module \\" >> configure.in_tmp1
142 \rm -f configure.in_tmp2
143 touch configure.in_tmp2
144 find_in . configure.in_tmp2
146 sed -e '/^.\/salome_adm/d' \
147 -e '/configure.in/d' \
148 -e '/^.\/adm_local/d' \
150 configure.in_tmp2 >> configure.in_tmp1
152 echo "])" >> configure.in_tmp1
154 # delete the link created for AC_OUTPUT
155 echo "" >> configure.in_tmp1
156 \mv configure.in_tmp1 configure.in_new
157 \rm -f configure.in_tmp2
160 ########################################################################
161 # Create new (or replace old) configure.in file
162 # Print a message if the file is write protected
166 if test ! -f configure.in
168 echo -n "Creating new file 'configure.in' ... "
169 if \mv configure.in_new configure.in >& /dev/null
173 echo "error, check your file permissions"
176 echo -n "Updating 'configure.in' file ... "
177 if ! \cp configure.in configure.in_old >& /dev/null
181 echo "Can't backup previous configure.in"
182 echo -n "Continue (you will not be able to revert) - (Y/N) ? "
191 if \cp configure.in_new configure.in >& /dev/null
193 \rm -f configure.in_new
197 echo "error, can't update previous configure.in"
201 ########################################################################
202 # Use autoconf to rebuild the configure script
207 echo -n "Updating 'configure' script ... "
209 echo -n "Creating 'configure' script ... "
212 aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
213 -I ${GUI_ROOT_DIR}/adm_local/unix/config_files
218 echo "failed (check file permissions and/or user quotas ...)"