1 dnl Copyright (C) 2006-2008 CEA/DEN, EDF R&D
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.
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.
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
17 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 # Check availability of Med binary distribution
21 # Author : Anthony GEAY (CEA, 2005)
24 AC_DEFUN([CHECK_MED],[
34 [ --with-med=DIR root directory path of MED installation ],
35 MED_DIR="$withval",MED_DIR="")
37 if test "x$MED_DIR" == "x" ; then
39 # no --with-med-dir option used
41 if test "x$MED_ROOT_DIR" != "x" ; then
43 # MED_ROOT_DIR environment variable defined
48 # search Med binaries in PATH variable
49 AC_PATH_PROG(TEMP, libMEDMEM_Swig.py)
50 if test "x$TEMP" != "x" ; then
51 MED_BIN_DIR=`dirname $TEMP`
52 MED_DIR=`dirname $MED_BIN_DIR`
59 if test -f ${MED_DIR}/bin/salome/libMEDMEM_Swig.py ; then
61 AC_MSG_RESULT(Using Med module distribution in ${MED_DIR})
63 if test "x$MED_ROOT_DIR" == "x" ; then
64 MED_ROOT_DIR=${MED_DIR}
66 AC_SUBST(MED_ROOT_DIR)
67 MED_INCLUDES="-I${MED_ROOT_DIR}/include/salome ${MED2_INCLUDES} ${HDF5_INCLUDES} -I${KERNEL_ROOT_DIR}/include/salome"
68 MED_LIBS="-L${MED_ROOT_DIR}/lib/salome -lmedmem"
69 AC_SUBST(MED_INCLUDES)
73 AC_MSG_WARN("Cannot find Med module sources")
76 AC_MSG_CHECKING([for MED memory version])
77 [medmem_version=`cat ${MED_ROOT_DIR}/bin/salome/VERSION | cut -d" " -f7`]
78 [medmem_version=`expr $medmem_version : '\([0-9.]*\).*'`]
79 AC_MSG_RESULT([$medmem_version])
80 AC_MSG_CHECKING([for g++ version])
81 [gpp_version=`g++ --version | sed -e '2,$d' | cut -d" " -f3`]
82 AC_MSG_RESULT([$gpp_version])
83 [available=$gpp_version]
84 dnl Analyzing g++ version
85 [available_major=`echo $available | sed 's/[^0-9].*//'`]
86 if test -z "$available_major" ; then
89 [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
90 [available_minor=`echo $available | sed 's/[^0-9].*//'`]
91 if test -z "$available_minor" ; then
94 [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
95 [available_patch=`echo $available | sed 's/[^0-9].*//'`]
96 if test -z "$available_patch" ; then
99 dnl Testing if g++ verion >= 3.4.0 or not
100 if test $available_major -ne "3" \
101 -o $available_minor -ne "4" \
102 -o $available_patch -lt "0" ; then
103 [required_medmem_major=2]
104 [required_medmem_minor=2]
105 [required_medmem_patch=0]
107 [required_medmem_major=2]
108 [required_medmem_minor=2]
109 [required_medmem_patch=4]
111 [available=$medmem_version]
112 [available_major=`echo $available | sed 's/[^0-9].*//'`]
113 if test -z "$available_major" ; then
116 [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
117 [available_minor=`echo $available | sed 's/[^0-9].*//'`]
118 if test -z "$available_minor" ; then
121 [available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
122 [available_patch=`echo $available | sed 's/[^0-9].*//'`]
123 if test -z "$available_patch" ; then
126 [available_num=`expr $available_major \* 100 + $available_minor \* 10 + $available_patch`]
127 [required_num=`expr $required_medmem_major \* 100 + $required_medmem_minor \* 10 + $required_medmem_patch`]
128 if test "x$Med_ok" == "xyes" ; then
129 if test $available_num -lt $required_num ; then
130 AC_MSG_WARN([MEDMEM version invalid with your compiler : MEDMEM version >=2.2.4 required !!!])
134 AC_MSG_RESULT(for MED memory: $Med_ok)