1 dnl Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Check availability of Salome's KERNEL binary distribution
25 # Author : Jerome Roy (CEA, 2003)
28 AC_DEFUN([CHECK_KERNEL],[
29 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
31 AC_CHECKING(for Kernel)
33 # We check for Boost here because an exported header in Kernel depends on Boost shared
35 if test "x$boost_ok" = "x"
46 [--with-kernel=DIR root directory path of KERNEL build or installation],
47 [KERNEL_DIR="$withval"],
50 if test "x${KERNEL_DIR}" = "x" ; then
51 AC_MSG_RESULT(for \${KERNEL_ROOT_DIR}: ${KERNEL_ROOT_DIR})
52 # no --with-kernel-dir option used
53 if test "x${KERNEL_ROOT_DIR}" != "x" ; then
54 # KERNEL_ROOT_DIR environment variable defined
55 KERNEL_DIR=${KERNEL_ROOT_DIR}
57 # search Kernel binaries in PATH variable
58 AC_PATH_PROG(TEMP,runSalome.py)
59 if test "x${TEMP}" != "x" ; then
60 AC_MSG_RESULT(runSalome.py was found at : ${TEMP})
61 KERNEL_BIN_DIR=`dirname ${TEMP}`
62 KERNEL_DIR=`cd ${KERNEL_BIN_DIR}/../..; pwd`
67 if test -f ${KERNEL_DIR}/bin/salome/runSalome.py ; then
68 AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
71 if test "x${KERNEL_ROOT_DIR}" = "x" ; then
72 KERNEL_ROOT_DIR=${KERNEL_DIR}
75 if test "x${KERNEL_SITE_DIR}" = "x" ; then
76 KERNEL_SITE_DIR=${KERNEL_ROOT_DIR}
79 AC_SUBST(KERNEL_ROOT_DIR)
80 AC_SUBST(KERNEL_SITE_DIR)
82 KERNEL_LDFLAGS=-L${KERNEL_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
83 KERNEL_CXXFLAGS="-I${KERNEL_DIR}/include/salome ${BOOST_CPPFLAGS}"
85 AC_SUBST(KERNEL_LDFLAGS)
86 AC_SUBST(KERNEL_CXXFLAGS)
88 AC_MSG_WARN("Cannot find compiled Kernel module distribution")
91 AC_MSG_RESULT(for Kernel: $Kernel_ok)