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 AC_DEFUN([CHECK_MED2],[
20 AC_REQUIRE([AC_PROG_CC])dnl
21 AC_REQUIRE([AC_PROG_CPP])dnl
22 AC_REQUIRE([CHECK_HDF5])dnl
23 AC_REQUIRE([AC_DEPEND_FLAG])dnl
28 [ --with-med2=DIR root directory path to med2 installation ],
30 AC_MSG_RESULT("select $withval as path to med2")
33 AC_SUBST(MED2_INCLUDES)
35 AC_SUBST(MED2_MT_LIBS)
46 dnl check, if there is MED library
49 AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory)
50 AC_PATH_PROG(MDUMP, mdump)
51 if test "xMDUMP" != "x" ; then
53 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
54 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
57 if test ! -z $MED2HOME
59 LOCAL_INCLUDES="$HDF5_INCLUDES -I$MED2HOME/include"
60 if test "x$MED2HOME" = "x/usr"
62 LOCAL_LIBS="-lmed $HDF5_LIBS"
64 LOCAL_LIBS="-L$MED2HOME/lib -lmed $HDF5_LIBS"
69 CPPFLAGS_old="$CPPFLAGS"
70 CPPFLAGS="$CPPFLAGS -D$MACHINE $LOCAL_INCLUDES"
71 AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no)
72 CPPFLAGS="$CPPFLAGS_old"
74 dnl check med2 library
75 if test "x$med2_ok" = "xyes"
78 LIBS="$LIBS $LOCAL_LIBS"
79 AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no)
83 if test "x$med2_ok" = "xyes"
85 MED2_INCLUDES="-D$MACHINE $LOCAL_INCLUDES"
86 MED2_LIBS="$LOCAL_LIBS"
87 MED2_MT_LIBS="$LOCAL_LIBS"
90 AC_MSG_RESULT(for med2: $med2_ok)