Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/sierpinsky.git] / adm_local / unix / config_files / check_SIERPINSKY.m4
1 dnl  Copyright (C) 2005-2008  OPEN CASCADE
2 dnl
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.
7 dnl
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.
12 dnl
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
16 dnl
17 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19 #  Check availability of SIERPINSKY binary distribution
20 #
21 #  Author : Marc Tajchman (CEA, 2002)
22 #------------------------------------------------------------
23
24 AC_DEFUN([CHECK_SIERPINSKY],[
25
26 AC_CHECKING(for Sierpinsky)
27
28 Sierpinsky_ok=no
29
30 AC_ARG_WITH(sier,
31             --with-sierpinsky=DIR  root directory path of SIERPINSKY build or installation,
32             SIERPINSKY_DIR="$withval",SIERPINSKY_DIR="")
33
34 if test "x$SIERPINSKY_DIR" = "x" ; then
35
36 # no --with-gui-dir option used
37
38   if test "x$SIERPINSKY_ROOT_DIR" != "x" ; then
39
40     # SALOME_ROOT_DIR environment variable defined
41     SIERPINSKY_DIR=$SIERPINSKY_ROOT_DIR
42
43   else
44
45     # search Salome binaries in PATH variable
46     AC_PATH_PROG(TEMP, libSIERPINSKY.so)
47     if test "x$TEMP" != "x" ; then
48       SIERPINSKY_DIR=`dirname $TEMP`
49     fi
50
51   fi
52
53 fi
54
55 if test -f ${SIERPINSKY_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libSIERPINSKY.so  ; then
56   Sierpinsky_ok=yes
57   AC_MSG_RESULT(Using SIERPINSKY module distribution in ${SIERPINSKY_DIR})
58
59   if test "x$SIERPINSKY_ROOT_DIR" == "x" ; then
60     SIERPINSKY_ROOT_DIR=${SIERPINSKY_DIR}
61   fi
62   
63   SIERPINSKY_LDFLAGS=-L${SIERPINSKY_ROOT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
64   SIERPINSKY_CXXFLAGS=-I${SIERPINSKY_ROOT_DIR}/include/salome
65
66   AC_SUBST(SIERPINSKY_ROOT_DIR)
67   AC_SUBST(SIERPINSKY_LDFLAGS)
68   AC_SUBST(SIERPINSKY_CXXFLAGS)
69
70 else
71   AC_MSG_WARN("Cannot find compiled SIERPINSKY module distribution")
72 fi
73   
74 AC_MSG_RESULT(for SIERPINSKY: $Sierpinsky_ok)
75  
76 ])dnl
77