Salome HOME
Update copyrights 2014.
[samples/light.git] / adm_local / unix / config_files / check_LIGHT.m4
1 dnl Copyright (C) 2005-2014  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 LIGHT module binary distribution
21
22 AC_DEFUN([CHECK_LIGHT],[
23
24 AC_CHECKING(for Light)
25
26 Light_ok=no
27
28 LIGHT_LDFLAGS=""
29 LIGHT_CXXFLAGS=""
30
31 AC_ARG_WITH(gui,
32             --with-light=DIR root directory path of LIGHT installation,
33             LIGHT_DIR="$withval",LIGHT_DIR="")
34
35 if test "x$LIGHT_DIR" = "x" ; then
36
37 # no --with-light option used
38
39   if test "x$LIGHT_ROOT_DIR" != "x" ; then
40
41     # LIGHT_ROOT_DIR environment variable defined
42     LIGHT_DIR=$LIGHT_ROOT_DIR
43
44   else
45
46     # search LIGHT binaries in PATH variable
47     AC_PATH_PROG(TEMP, libLIGHT.so)
48     if test "x$TEMP" != "x" ; then
49       LIGHT_BIN_DIR=`dirname $TEMP`
50       LIGHT_DIR=`dirname $LIGHT_BIN_DIR`
51     fi
52
53   fi
54 #
55 fi
56
57 if test -f ${LIGHT_DIR}/lib/salome/libLIGHT.so  ; then
58   Light_ok=yes
59   AC_MSG_RESULT(Using LIGHT distribution in ${LIGHT_DIR})
60
61   if test "x$LIGHT_ROOT_DIR" == "x" ; then
62     LIGHT_ROOT_DIR=${LIGHT_DIR}
63   fi
64   AC_SUBST(LIGHT_ROOT_DIR)
65
66   LIGHT_LDFLAGS=-L${LIGHT_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
67   LIGHT_CXXFLAGS=-I${LIGHT_DIR}/include/salome
68
69   AC_SUBST(LIGHT_LDFLAGS)
70   AC_SUBST(LIGHT_CXXFLAGS)
71 else
72   AC_MSG_WARN("Cannot find compiled LIGHT distribution")
73 fi
74   
75 AC_MSG_RESULT(for LIGHT: $Light_ok)
76  
77 ])dnl
78