Salome HOME
cc8320f7a8f3a5fee28f2d3d75266852ad260669
[samples/component.git] / adm_local / unix / config_files / check_COMPONENT.m4
1 dnl  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 dnl
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
5 dnl
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.
10 dnl
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.
15 dnl
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
19 dnl
20 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22 #  Check availability of COMPONENT module binary distribution
23 #
24 #  Author : Marc Tajchman (CEA, 2002)
25 #------------------------------------------------------------
26
27 AC_DEFUN([CHECK_COMPONENT],[
28
29 AC_CHECKING(for Component)
30
31 Component_ok=no
32
33 AC_ARG_WITH(comp,
34             --with-component=DIR root directory path of COMPONENT module installation,
35             COMPONENT_DIR="$withval",COMPONENT_DIR="")
36
37 if test "x$COMPONENT_DIR" = "x" ; then
38
39 # no --with-component option used
40
41   if test "x$COMPONENT_ROOT_DIR" != "x" ; then
42
43     # COMPONENT_ROOT_DIR environment variable defined
44     COMPONENT_DIR=$COMPONENT_ROOT_DIR
45
46   else
47
48     # search component binaries in PATH variable
49     AC_PATH_PROG(TEMP, libCalculatorEngine.so)
50     if test "x$TEMP" != "x" ; then
51       COMPONENT_DIR=`dirname $TEMP`
52     fi
53
54   fi
55
56 fi
57
58 if test -f ${COMPONENT_DIR}/lib/salome/libCalculatorEngine.so  ; then
59   Component_ok=yes
60   AC_MSG_RESULT(Using COMPONENT module distribution in ${COMPONENT_DIR})
61
62   if test "x$COMPONENT_ROOT_DIR" == "x" ; then
63     COMPONENT_ROOT_DIR=${COMPONENT_DIR}
64   fi
65   AC_SUBST(COMPONENT_ROOT_DIR)
66 else
67   AC_MSG_WARN("Cannot find compiled COMPONENT module distribution")
68 fi
69   
70 AC_MSG_RESULT(for COMPONENT: $Component_ok)
71  
72 ])dnl
73