Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / adm_local / unix / config_files / check_Med.m4
1 dnl  Copyright (C) 2007-2008  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 # Check availability of Med binary distribution
23 #
24 # Author : Nicolas REJNERI (OPEN CASCADE, 2003)
25 #
26
27 AC_DEFUN([CHECK_MED],[
28 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
29 AC_REQUIRE([CHECK_MED2])
30
31 AC_CHECKING(for Med)
32
33 Med_ok=no
34
35 MED_LDFLAGS=""
36 MED_CXXFLAGS=""
37
38 AC_ARG_WITH(med,
39             [  --with-med=DIR root directory path of MED installation ],
40             MED_DIR="$withval",MED_DIR="")
41
42 if test "x${MED_DIR}" == "x" ; then
43   AC_MSG_RESULT(for \${MED_ROOT_DIR}: ${MED_ROOT_DIR})
44 # no --with-med-dir option used
45    if test "x${MED_ROOT_DIR}" != "x" ; then
46
47     # MED_ROOT_DIR environment variable defined
48       MED_DIR=${MED_ROOT_DIR}
49
50    fi
51
52 fi
53
54 MED_ENABLE_MULTIPR=no
55
56 if test -f ${MED_DIR}/idl/salome/MED.idl ; then
57    AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
58    Med_ok=yes
59
60    if test "x$MED_ROOT_DIR" == "x" ; then
61       MED_ROOT_DIR=${MED_DIR}
62    fi
63
64    AC_SUBST(MED_ROOT_DIR)
65
66    MED_LDFLAGS=-L${MED_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
67    MED_CXXFLAGS=-I${MED_DIR}/include/salome
68
69    AC_SUBST(MED_LDFLAGS)
70    AC_SUBST(MED_CXXFLAGS)
71
72    # MULTIPR
73    AC_CHECK_FILE(${MED_DIR}/include/salome/MULTIPR_Obj.hxx,
74                  ENABLE_MULTIPR=yes,
75                  ENABLE_MULTIPR=no)
76    AC_SUBST(ENABLE_MULTIPR)
77    MULTIPR_CPPFLAGS=""
78    MULTIPR_LIBS=""
79    if test "x${ENABLE_MULTIPR}" = "xyes" ; then
80       MULTIPR_CPPFLAGS="-DENABLE_MULTIPR"
81       MULTIPR_LIBS="-lMULTIPR_API"
82    fi
83    AC_SUBST(MULTIPR_CPPFLAGS)
84    AC_SUBST(MULTIPR_LIBS)
85 else
86    AC_MSG_WARN("Cannot find Med module sources")
87 fi
88
89 AC_MSG_RESULT(for Med: $Med_ok)
90 AC_MSG_RESULT(for MULTIPR Med package: $ENABLE_MULTIPR)
91
92 ])dnl