1 dnl Copyright (C) 2009-2012 CEA/DEN, EDF R&D
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.
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.
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
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 # Check availability of Salome's KERNEL binary distribution
21 # Author : Jerome Roy (CEA, 2003)
24 AC_DEFUN([AC_CHECK_KERNEL],[
26 AC_CHECKING(for Kernel)
32 [ --with-kernel=DIR root directory path of KERNEL build or installation],
33 KERNEL_DIR="$withval",KERNEL_DIR="")
35 if test "x$KERNEL_DIR" = "x" ; then
37 # no --with-kernel-dir option used
39 if test "x$KERNEL_ROOT_DIR" != "x" ; then
41 # KERNEL_ROOT_DIR environment variable defined
42 KERNEL_DIR=$KERNEL_ROOT_DIR
46 # search Kernel binaries in PATH variable
47 AC_PATH_PROG(TEMP, runSalome)
48 if test "x$TEMP" != "x" ; then
49 KERNEL_BIN_DIR=`dirname $TEMP`
50 KERNEL_DIR=`dirname $KERNEL_BIN_DIR`
58 if test -f ${KERNEL_DIR}/bin/salome/runSalome ; then
60 AC_MSG_RESULT(Using Kernel module distribution in ${KERNEL_DIR})
61 AC_DEFINE(SALOME_KERNEL,,[With Salome KERNEL])
63 if test "x$KERNEL_ROOT_DIR" = "x" ; then
64 KERNEL_ROOT_DIR=${KERNEL_DIR}
66 if test "x$KERNEL_SITE_DIR" = "x" ; then
67 KERNEL_SITE_DIR=${KERNEL_ROOT_DIR}
69 SALOME_ROOT_DIR=`AS_DIRNAME(["$KERNEL_ROOT_DIR"])`
70 SALOME_VERSION="`echo $KERNEL_ROOT_DIR | sed s@$SALOME_ROOT_DIR/KERNEL@@`"
72 if test -f ${KERNEL_DIR}/idl/salome/DSC_Engines.idl ; then
73 # DSC extension available
75 AC_MSG_RESULT(Using DSC Ports module distribution in ${KERNEL_DIR})
76 AC_DEFINE(DSC_PORTS,,[With DSC ports])
78 AC_MSG_WARN("Cannot find DSC Ports module distribution")
81 KERNEL_LDFLAGS=-L${KERNEL_ROOT_DIR}/lib/salome
82 KERNEL_CXXFLAGS=-I${KERNEL_ROOT_DIR}/include/salome
84 AC_SUBST(KERNEL_ROOT_DIR)
85 AC_SUBST(KERNEL_SITE_DIR)
86 AC_SUBST(SALOME_ROOT_DIR)
87 AC_SUBST(SALOME_VERSION)
88 AC_SUBST(KERNEL_LDFLAGS)
89 AC_SUBST(KERNEL_CXXFLAGS)
92 AC_MSG_WARN("Cannot find compiled Kernel module distribution")
95 AC_MSG_RESULT(for Kernel: $Kernel_ok)
99 # -----------------------------------------------------------------------------
100 # --- from GUI_SRC 3.2.3
101 # Check availability of Salome binary distribution
103 # Author : Marc Tajchman (CEA, 2002)
104 #------------------------------------------------------------
106 AC_DEFUN([CHECK_GUI],[
107 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
109 AC_CHECKING(for $2 $1 )
117 [ --with-gui=DIR root directory path of SALOME GUI installation],
118 [SALOME_GUI_DIR="$withval"],[SALOME_GUI_DIR=""])
120 if test "x${SALOME_GUI_DIR}" = "x" ; then
121 # no --with-gui-dir option used
122 AC_MSG_RESULT(try \${GUI_ROOT_DIR}: ${GUI_ROOT_DIR})
123 if test "x${GUI_ROOT_DIR}" != "x" ; then
124 # SALOME_ROOT_DIR environment variable defined
125 SALOME_GUI_DIR=${GUI_ROOT_DIR}
127 # search Salome binaries in PATH variable
128 AC_PATH_PROG(TEMP, $1)
129 if test "x${TEMP}" != "x" ; then
130 AC_MSG_RESULT($1 was found at : ${TEMP})
131 SALOME_BIN_DIR=`dirname ${TEMP}`
132 SALOME_GUI_DIR=`cd ${SALOME_BIN_DIR}/../..; pwd`
137 if test -f ${SALOME_GUI_DIR}/bin/salome/$1 ; then
139 AC_MSG_RESULT(Using SALOME GUI distribution in ${SALOME_GUI_DIR})
141 if test "x${GUI_ROOT_DIR}" == "x" ; then
142 GUI_ROOT_DIR=${SALOME_GUI_DIR}
145 AC_SUBST(GUI_ROOT_DIR)
147 GUI_LDFLAGS=-L${SALOME_GUI_DIR}/lib/salome
148 GUI_CXXFLAGS=-I${SALOME_GUI_DIR}/include/salome
150 AC_SUBST(GUI_LDFLAGS)
151 AC_SUBST(GUI_CXXFLAGS)
153 AC_MSG_WARN("Cannot find compiled SALOME GUI distribution")
156 AC_MSG_RESULT(for $2: ${SalomeGUI_ok})
160 AC_DEFUN([CHECK_SALOME_GUI],[