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