Salome HOME
sources v1.2
[modules/kernel.git] / salome_adm / unix / config_files / check_Salome.m4
1 # Check availability of Salome binary distribution
2 #
3 # Author : Marc Tajchman (CEA, 2002)
4 #
5
6 AC_DEFUN([CHECK_SALOME],[
7
8 AC_CHECKING(for Salome)
9
10 Salome_ok=no
11
12 AC_ARG_WITH(salome,
13             --with-salome=DIR root directory path of SALOME installation,
14             SALOME_DIR="$withval",SALOME_DIR="")
15
16 if test "x$SALOME_DIR" == "x" ; then
17
18 # no --with-salome-dir option used
19
20    if test "x$SALOME_ROOT_DIR" != "x" ; then
21
22     # SALOME_ROOT_DIR environment variable defined
23       SALOME_DIR=$SALOME_ROOT_DIR
24
25    else
26
27     # search Salome binaries in PATH variable
28       AC_PATH_PROG(TEMP, libMEDMEM_Swig.py)
29       if test "x$TEMP" != "x" ; then
30          SALOME_BIN_DIR=`dirname $TEMP`
31          SALOME_DIR=`dirname $SALOME_BIN_DIR`
32       fi
33       
34    fi
35
36 fi
37
38 if test -f ${SALOME_DIR}/bin/libMEDMEM_Swig.py  ; then
39    Salome_ok=yes
40    AC_MSG_RESULT(Using Salome distribution in ${SALOME_DIR})
41
42    if test "x$SALOME_ROOT_DIR" == "x" ; then
43       SALOME_ROOT_DIR=${SALOME_DIR}
44    fi
45    if test "x$SALOME_SITE_DIR" == "x" ; then
46       SALOME_SITE_DIR=${SALOME_ROOT_DIR}
47    fi
48    AC_SUBST(SALOME_ROOT_DIR)
49    AC_SUBST(SALOME_SITE_DIR)
50
51 else
52    AC_MSG_WARN("Cannot find compiled Salome distribution")
53 fi
54   
55 AC_MSG_RESULT(for Salome: $Salome_ok)
56  
57 ])dnl
58