Salome HOME
Add autoconf macros
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
1 dnl Copyright (C) 2007-2016  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 # Check availability of Med binary distribution
24 #
25 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
26 #
27
28 AC_DEFUN([CHECK_MED],[
29 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
30 AC_REQUIRE([CHECK_MED3])
31
32 AC_CHECKING(for Med)
33
34 Med_ok=no
35
36 MED_LDFLAGS=""
37 MED_CXXFLAGS=""
38
39 AC_ARG_WITH(med,
40             [  --with-med=DIR root directory path of MED installation ],
41             MED_DIR="$withval",MED_DIR="")
42
43 if test "x${MED_DIR}" == "x" ; then
44   AC_MSG_RESULT(for \${MED_ROOT_DIR}: ${MED_ROOT_DIR})
45    # --with-med option is not used
46    if test "x${MED_ROOT_DIR}" != "x" ; then
47
48     # MED_ROOT_DIR environment variable defined
49       MED_DIR=${MED_ROOT_DIR}
50
51    fi
52
53 fi
54
55 if test -f ${MED_DIR}/idl/salome/MEDCouplingCorbaServant.idl ; then
56    AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
57    Med_ok=yes
58
59    if test "x$MED_ROOT_DIR" == "x" ; then
60       MED_ROOT_DIR=${MED_DIR}
61    fi
62
63    AC_SUBST(MED_ROOT_DIR)
64
65    MED_LDFLAGS=-L${MED_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
66    MED_CXXFLAGS=-I${MED_DIR}/include/salome
67
68    AC_SUBST(MED_LDFLAGS)
69    AC_SUBST(MED_CXXFLAGS)
70
71 else
72    AC_MSG_WARN("Cannot find Med module sources")
73 fi
74
75 AC_MSG_RESULT(for Med: $Med_ok)
76
77 ])dnl