1 dnl Copyright (C) 2007-2011 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.
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)
39 [--with-kernel=DIR root directory path of KERNEL build or installation],
40 [KERNEL_DIR="$withval"],
43 if test "x${KERNEL_DIR}" = "x" ; then
44 AC_MSG_RESULT(for \${KERNEL_ROOT_DIR}: ${KERNEL_ROOT_DIR})
45 # no --with-kernel-dir option used
46 if test "x${KERNEL_ROOT_DIR}" != "x" ; then
47 # KERNEL_ROOT_DIR environment variable defined
48 KERNEL_DIR=${KERNEL_ROOT_DIR}
50 # search Kernel binaries in PATH variable
51 AC_PATH_PROG(TEMP,runSalome)
52 if test "x${TEMP}" != "x" ; then
53 AC_MSG_RESULT(runSalome was found at : ${TEMP})
54 KERNEL_BIN_DIR=`dirname ${TEMP}`
55 KERNEL_DIR=`cd ${KERNEL_BIN_DIR}/../..; pwd`
60 if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
61 AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
64 if test "x${KERNEL_ROOT_DIR}" = "x" ; then
65 KERNEL_ROOT_DIR=${KERNEL_DIR}
68 if test "x${KERNEL_SITE_DIR}" = "x" ; then
69 KERNEL_SITE_DIR=${KERNEL_ROOT_DIR}
72 AC_SUBST(KERNEL_ROOT_DIR)
73 AC_SUBST(KERNEL_SITE_DIR)
75 KERNEL_LDFLAGS=-L${KERNEL_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
76 KERNEL_CXXFLAGS=-I${KERNEL_DIR}/include/salome
78 AC_SUBST(KERNEL_LDFLAGS)
79 AC_SUBST(KERNEL_CXXFLAGS)
81 AC_MSG_WARN("Cannot find compiled Kernel module distribution")
84 AC_MSG_RESULT(for Kernel: $Kernel_ok)