Salome HOME
845d745f3d7e2f9f110499ecb67c84334595f24c
[modules/yacs.git] / src / wrappergen / bin / Cpp_Template__SRC / adm / unix / config_files / check_Kernel.m4
1 dnl Copyright (C) 2006-2021  CEA/DEN, EDF R&D
2 dnl
3 dnl This library is free software; you can redistribute it and/or
4 dnl modify it under the terms of the GNU Lesser General Public
5 dnl License as published by the Free Software Foundation; either
6 dnl version 2.1 of the License, or (at your option) any later version.
7 dnl
8 dnl This library is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 dnl Lesser General Public License for more details.
12 dnl
13 dnl You should have received a copy of the GNU Lesser General Public
14 dnl License along with this library; if not, write to the Free Software
15 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 dnl
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19
20 # Check availability of Salome's KERNEL binary distribution
21 #
22 # Author : Jerome Roy (CEA, 2003)
23 #
24
25 AC_DEFUN([CHECK_KERNEL],[
26
27 AC_CHECKING(for Kernel)
28
29 Kernel_ok=no
30
31 AC_ARG_WITH(kernel,
32             [  --with-kernel=DIR               root directory path of KERNEL build or installation],
33             KERNEL_DIR="$withval",KERNEL_DIR="")
34
35 if test "x$KERNEL_DIR" = "x" ; then
36
37 # no --with-kernel-dir option used
38
39    if test "x$KERNEL_ROOT_DIR" != "x" ; then
40
41     # KERNEL_ROOT_DIR environment variable defined
42       KERNEL_DIR=$KERNEL_ROOT_DIR
43
44    else
45
46     # search Kernel binaries in PATH variable
47       AC_PATH_PROG(TEMP, runSalome.py)
48       if test "x$TEMP" != "x" ; then
49          KERNEL_BIN_DIR=`dirname $TEMP`
50          KERNEL_DIR=`dirname $KERNEL_BIN_DIR`
51       fi
52
53    fi
54 #
55 fi
56
57 if test -f ${KERNEL_DIR}/bin/salome/runSalome.py ; then
58    Kernel_ok=yes
59    AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
60
61    if test "x$KERNEL_ROOT_DIR" = "x" ; then
62       KERNEL_ROOT_DIR=${KERNEL_DIR}
63    fi
64    if test "x$KERNEL_SITE_DIR" = "x" ; then
65       KERNEL_SITE_DIR=${KERNEL_ROOT_DIR}
66    fi
67    AC_SUBST(KERNEL_ROOT_DIR)
68    AC_SUBST(KERNEL_SITE_DIR)
69
70 else
71    AC_MSG_WARN("Cannot find compiled Kernel module distribution")
72 fi
73
74 AC_MSG_RESULT(for Kernel: $Kernel_ok)
75
76 ])dnl
77