Salome HOME
Merge from V6_main 01/04/2013
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
1 dnl Copyright (C) 2007-2013  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.
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 # no --with-med-dir option 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 MED_ENABLE_MULTIPR=no
56
57 if test -f ${MED_DIR}/idl/salome/MED.idl ; then
58    AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
59    Med_ok=yes
60
61    if test "x$MED_ROOT_DIR" == "x" ; then
62       MED_ROOT_DIR=${MED_DIR}
63    fi
64
65    AC_SUBST(MED_ROOT_DIR)
66
67    MED_LDFLAGS=-L${MED_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
68    MED_CXXFLAGS=-I${MED_DIR}/include/salome
69
70    AC_SUBST(MED_LDFLAGS)
71    AC_SUBST(MED_CXXFLAGS)
72
73    # MULTIPR
74    AC_CHECK_FILE(${MED_DIR}/include/salome/MULTIPR_Obj.hxx,
75                  ENABLE_MULTIPR=yes,
76                  ENABLE_MULTIPR=no)
77    AC_SUBST(ENABLE_MULTIPR)
78    MULTIPR_CPPFLAGS=""
79    MULTIPR_LIBS=""
80    if test "x${ENABLE_MULTIPR}" = "xyes" ; then
81       MULTIPR_CPPFLAGS="-DENABLE_MULTIPR"
82       MULTIPR_LIBS="-lMULTIPR_API"
83    fi
84    AC_SUBST(MULTIPR_CPPFLAGS)
85    AC_SUBST(MULTIPR_LIBS)
86 else
87    AC_MSG_WARN("Cannot find Med module sources")
88 fi
89
90 AC_MSG_RESULT(for Med: $Med_ok)
91 AC_MSG_RESULT(for MULTIPR Med package: $ENABLE_MULTIPR)
92
93 ])dnl