Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[samples/component.git] / adm_local / unix / config_files / check_COMPONENT.m4
1 #  Check availability of COMPONENT module binary distribution
2 #
3 #  Author : Marc Tajchman (CEA, 2002)
4 #------------------------------------------------------------
5
6 AC_DEFUN([CHECK_COMPONENT],[
7
8 AC_CHECKING(for Component)
9
10 Component_ok=no
11
12 AC_ARG_WITH(comp,
13             --with-component=DIR root directory path of COMPONENT module installation,
14             COMPONENT_DIR="$withval",COMPONENT_DIR="")
15
16 if test "x$COMPONENT_DIR" = "x" ; then
17
18 # no --with-component option used
19
20   if test "x$COMPONENT_ROOT_DIR" != "x" ; then
21
22     # COMPONENT_ROOT_DIR environment variable defined
23     COMPONENT_DIR=$COMPONENT_ROOT_DIR
24
25   else
26
27     # search component binaries in PATH variable
28     AC_PATH_PROG(TEMP, libCalculatorEngine.so)
29     if test "x$TEMP" != "x" ; then
30       COMPONENT_DIR=`dirname $TEMP`
31     fi
32
33   fi
34
35 fi
36
37 if test -f ${COMPONENT_DIR}/lib/salome/libCalculatorEngine.so  ; then
38   Component_ok=yes
39   AC_MSG_RESULT(Using COMPONENT module distribution in ${COMPONENT_DIR})
40
41   if test "x$COMPONENT_ROOT_DIR" == "x" ; then
42     COMPONENT_ROOT_DIR=${COMPONENT_DIR}
43   fi
44   AC_SUBST(COMPONENT_ROOT_DIR)
45 else
46   AC_MSG_WARN("Cannot find compiled COMPONENT module distribution")
47 fi
48   
49 AC_MSG_RESULT(for COMPONENT: $Component_ok)
50  
51 ])dnl
52