Salome HOME
589649f66674b4dd15e643e3512f1a0b6bf21b09
[modules/superv.git] / adm_local / unix / config_files / check_SUPERV.m4
1 #  Check availability of SUPERV module binary distribution
2 #
3 #  Author : Marc Tajchman (CEA, 2002)
4 #------------------------------------------------------------
5
6 AC_DEFUN([CHECK_SUPERV],[
7
8 AC_CHECKING(for Superv)
9
10 Superv_ok=no
11
12 SUPERV_LDFLAGS=""
13 SUPERV_CXXFLAGS=""
14
15 AC_ARG_WITH(superv,
16             --with-superv=DIR root directory path of SUPERV installation,
17             SUPERV_DIR="$withval",SUPERV_DIR="")
18
19 if test "x$SUPERV_DIR" = "x" ; then
20
21 # no --with-gui-dir option used
22
23   if test "x$SUPERV_ROOT_DIR" != "x" ; then
24
25     # SUPERV_ROOT_DIR environment variable defined
26     SUPERV_DIR=$SUPERV_ROOT_DIR
27
28   else
29
30     # search SUPERV binaries in PATH variable
31     AC_PATH_PROG(TEMP, libSUPERV.so)
32     if test "x$TEMP" != "x" ; then
33       SUPERV_BIN_DIR=`dirname $TEMP`
34       SUPERV_DIR=`dirname $SUPERV_BIN_DIR`
35     fi
36
37   fi
38 #
39 fi
40
41 if test -f ${SUPERV_DIR}/lib/salome/libSUPERV.so  ; then
42   Superv_ok=yes
43   AC_MSG_RESULT(Using SUPERV distribution in ${SUPERV_DIR})
44
45   if test "x$SUPERV_ROOT_DIR" == "x" ; then
46     SUPERV_ROOT_DIR=${SUPERV_DIR}
47   fi
48   AC_SUBST(SUPERV_ROOT_DIR)
49
50   SUPERV_LDFLAGS=-L${SUPERV_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
51   SUPERV_CXXFLAGS=-I${SUPERV_DIR}/include/salome
52
53   AC_SUBST(SUPERV_LDFLAGS)
54   AC_SUBST(SUPERV_CXXFLAGS)
55
56 else
57   AC_MSG_WARN("Cannot find compiled SUPERV distribution")
58 fi
59   
60 AC_MSG_RESULT(for SUPERV: $Superv_ok)
61  
62 ])dnl
63