Salome HOME
Synchronize adm files
[modules/kernel.git] / salome_adm / unix / config_files / check_simanio.m4
1 dnl Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 dnl
3 dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 dnl
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License, or (at your option) any later version.
10 dnl
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 dnl Lesser General Public License for more details.
15 dnl
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 dnl
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 dnl
22
23 AC_DEFUN([CHECK_SIMANIO],[
24
25 SIMANIO_CPPFLAGS=""
26 SIMANIO_LIBS=""
27
28 AC_CHECKING(for SimanIO location)
29 AC_ARG_WITH(simanio,
30    [AC_HELP_STRING([--with-simanio=DIR],[root directory path to SimanIO installation])],
31    [SIMANIODIR="$withval"
32     AC_MSG_RESULT("select $withval as path to SimanIO installation")
33    ])
34
35 if test "x$SIMANIODIR" = "x" ; then
36   # no --with-simanio option used
37   if test "x$SIMANIO_ROOT_DIR" != "x" ; then
38     # SIMANIO_ROOT_DIR environment variable defined
39     SIMANIODIR=$SIMANIO_ROOT_DIR
40   fi
41 fi
42
43 AC_MSG_RESULT(\$SIMANIODIR = ${SIMANIODIR})
44
45 CPPFLAGS_old="${CPPFLAGS}"
46 LIBS_old=$LIBS
47
48 LIB_SUFFIX="${LIB_LOCATION_SUFFIX}"
49
50 if test "x${SIMANIODIR}" != "x" ; then
51   SIMANIO_CPPFLAGS="-I${SIMANIODIR}/include"
52   SIMANIO_LIBS="-L${SIMANIODIR}/lib"
53 fi
54
55 if test "x${SIMANIODIR}" = "x/usr" ; then
56   SIMANIO_CPPFLAGS=""
57   SIMANIO_LIBS=""
58 fi
59
60 simanio_ok=no
61 simanio_headers_ok=no
62 simanio_binaries_ok=no
63
64 dnl SIMANIO headers
65 #AC_CHECKING(for SimanIO headers)
66
67 simanio_headers_ok=yes
68 if test "x${SIMANIODIR}" != "x" ; then
69   AC_CHECK_FILE(${SIMANIODIR}/include/SimanIO_Link.hxx,
70                 simanio_headers_ok=yes,
71                 simanio_headers_ok=no)
72 fi
73
74 if test "x${simanio_headers_ok}" = "xno" ; then
75   SIMANIO_CPPFLAGS="SIMANIO_CPPFLAGS_NOT_DEFINED"
76 else
77   #AC_MSG_RESULT(\$SIMANIO_CPPFLAGS = ${SIMANIO_CPPFLAGS})
78   AC_CHECK_FILE(${SIMANIODIR}/lib/libSimanIO.so,
79                 simanio_lib_ok=yes,
80                 simanio_lib_ok=no)
81 fi
82 #AC_MSG_RESULT(for SimanIO libraries: $simanio_lib_ok)
83
84 if test "x${simanio_headers_ok}" = "xyes" ; then
85   if test "x${simanio_lib_ok}" = "xyes" ; then
86     SIMANIO_LIBS="-L${SIMANIODIR}/lib -lSimanIO"
87     simanio_ok=yes
88   fi
89 fi
90
91 AC_MSG_RESULT(for simanio: $simanio_ok)
92
93 AC_SUBST(SIMANIO_CPPFLAGS)
94 AC_SUBST(SIMANIO_LIBS)
95
96 ])dnl