4 # Tool for updating list of .in file for the SALOME project
5 # and regenerating configure script
7 # It may be called with --with-kernel[=yes,no] or --without-kernel
8 # option, default is --with-kernel=yes
10 # Author : Marc Tajchman - CEA
14 # 14/03/2007: Mikhail PONIKAROV - OCN
15 # Reorganization for uage of autotools
18 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
20 ########################################################################
21 # Check --with-kernel option
29 -with-kernel | --with-kernel)
33 -without-kernel | --without-kernel | -with-kernel=no | --with-kernel=no)
43 -with-ihm | --with-ihm)
46 -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
52 ########################################################################
53 # Test if the KERNEL_ROOT_DIR is set correctly if KERNEL required
55 if test ${MED_WITH_KERNEL} = yes; then
56 if test ! -d "${KERNEL_ROOT_DIR}"; then
57 echo "failed : KERNEL_ROOT_DIR variable is not correct !"
61 ########################################################################
62 # Test if the GUI_ROOT_DIR is set correctly if GUI required
64 if test ${MED_WITH_GUI} = yes; then
65 if test ! -d "${GUI_ROOT_DIR}"; then
66 echo "failed : GUI_ROOT_DIR variable is not correct !"
74 #######################################################################
75 # Update configure.ac script: to set MED_WITH_KERNEL and MED_WITH_GUI variables
76 sed -e s/MED_WITH_KERNEL=[a-z]*/MED_WITH_KERNEL=${MED_WITH_KERNEL}/g configure.ac > configure.tmp
77 sed -e s/MED_WITH_GUI=[a-z]*/MED_WITH_GUI=${MED_WITH_GUI}/g configure.tmp > configure.ac
80 # copy configure files
81 CONFIGURE_SOURCE_DIR=${KERNEL_ROOT_DIR}/salome_adm
82 if test ${MED_WITH_KERNEL} = no; then
83 CONFIGURE_SOURCE_DIR=${ABS_CONF_DIR}/adm_local_without_kernel
87 mkdir -p salome_adm/unix/config_files
88 #cp -f ${CONFIGURE_SOURCE_DIR}/unix/config_files/* salome_adm/unix/config_files
89 cp -f ${CONFIGURE_SOURCE_DIR}/unix/SALOMEconfig.h.in salome_adm/unix
90 #if test ${MED_WITH_KERNEL} = yes; then
91 # cp -f ${CONFIGURE_SOURCE_DIR}/unix/pythonbe.py salome_adm/unix
94 # if with GUI, cofy configure files from it
95 #if test ${MED_WITH_GUI} = yes; then
96 # cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
99 # remove KERNEL deprecated configure files
100 #for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
101 # check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
102 # check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
104 # rm -f salome_adm/unix/config_files/${deprecated}
107 # ____________________________________________________________________
108 # aclocal creates the aclocal.m4 file from the standard macro and the
109 # custom macro embedded in the directory salome_adm/unix/config_files
110 # and KERNEL config_files directory.
113 # autom4te.cache (directory)
114 echo "====================================================== aclocal"
116 if test ${MED_WITH_GUI} = yes; then
117 aclocal -I adm_local/unix/config_files \
118 -I ${CONFIGURE_SOURCE_DIR}/unix/config_files \
119 -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
121 aclocal -I adm_local/unix/config_files \
122 -I ${CONFIGURE_SOURCE_DIR}/unix/config_files || exit 1
125 # ____________________________________________________________________
126 # libtoolize creates some configuration files (ltmain.sh,
127 # config.guess and config.sub). It only depends on the libtool
128 # version. The files are created in the directory specified with the
129 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
131 # salome_adm/unix/config_files/config.guess
132 # salome_adm/unix/config_files/config.sub
133 # salome_adm/unix/config_files/ltmain.sh
134 #echo "====================================================== libtoolize"
136 libtoolize --force --copy --automake || exit 1
138 # ____________________________________________________________________
139 # make link to KERNEL configuration files to
140 #ln -sf ${KERNEL_ROOT_DIR}/salome_adm .
142 # ____________________________________________________________________
143 # autoconf creates the configure script from the file configure.ac (or
144 # configure.in if configure.ac doesn't exist)
147 echo "====================================================== autoconf"
151 # ____________________________________________________________________
152 # automake creates some scripts used in building process
153 # (install-sh, missing, ...). It only depends on the automake
154 # version. The files are created in the directory specified with the
155 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
156 # creates the Makefile.in files from the Makefile.am files.
158 # salome_adm/unix/config_files/compile
159 # salome_adm/unix/config_files/depcomp
160 # salome_adm/unix/config_files/install-sh
161 # salome_adm/unix/config_files/missing
162 # salome_adm/unix/config_files/py-compile
163 # Makefile.in (from Makefile.am)
164 echo "====================================================== automake"
166 automake --copy --gnu --add-missing