+dnl remember MED_WITH_KERNEL set by build configure
+old_with_kernel=${MED_WITH_KERNEL}
+
+dnl
+dnl Check --with-kernel option
+echo
+dnl ---------------------------------------------
+ WITH_KERNEL
+dnl ---------------------------------------------
+dnl
+
+dnl Update and re-run configure if there was build_configure --without-kernel
+dnl but configure --with-kernel=DIR is being called
+
+if test "x${old_with_kernel}" != "x${MED_WITH_KERNEL}"; then
+ if test "x${old_with_kernel}" = "xno" ; then
+ if test ! -d "${KERNEL_ROOT_DIR}"; then
+ echo "failed : KERNEL_ROOT_DIR variable is not correct !"
+ exit
+ fi
+ kernel_check_in_aclocal=`grep KERNEL_ROOT_DIR ${ROOT_SRCDIR}/aclocal.m4`
+ if test "x${kernel_check_in_aclocal}" = "x"; then
+ echo "Configuration changed: without KERNEL -> with KERNEL"
+ echo -n "Updating 'configure' script ... "
+ cd $ROOT_SRCDIR
+ aclocal --acdir=adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+ if autoconf; then
+ echo "done"
+ else
+ echo "failed (check file permissions and/or user quotas ...)"
+ cd $ROOT_BUILDDIR
+ exit
+ fi
+ cd $ROOT_BUILDDIR
+ $0 $*
+ exit
+ fi
+ fi
+fi
+
+
+dnl AC_CONFIG_AUX_DIR - path to install-sh, config.sub, config.guess,
+dnl Automake and Libtool scripts etc.
+dnl config.sub, config.guess are needed for AC_CANONICAL_HOST
+
+WITHOUT_KERNEL_CONFIG_DIR=${ROOT_SRCDIR}/adm_local_without_kernel/unix/config_files
+AUX_CONFIG_DIR=""
+if test "${MED_WITH_KERNEL}" = "yes"; then
+ AUX_CONFIG_DIR=${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
+else
+ AUX_CONFIG_DIR=${WITHOUT_KERNEL_CONFIG_DIR}
+fi
+AC_CONFIG_AUX_DIR(${AUX_CONFIG_DIR})
+AC_CANONICAL_HOST
+
+