1 dnl Copyright (C) 2011-2021 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, or (at your option) any later version.
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
20 AC_DEFUN([CHECK_MED2],[
21 AC_REQUIRE([AC_PROG_CC])dnl
22 AC_REQUIRE([AC_PROG_CPP])dnl
23 AC_REQUIRE([CHECK_HDF5])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)
43 LOCAL_INCLUDES="$HDF5_INCLUDES"
44 LOCAL_LIBS="-lmed $HDF5_LIBS"
48 AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory)
49 AC_PATH_PROG(MDUMP, mdump)
50 if test "xMDUMP" != "x" ; then
52 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
53 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
56 if test ! -z $MED2HOME
58 LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include"
59 if test "x$MED2HOME" = "x/usr"
61 LOCAL_LIBS="-lmed $LOCAL_LIBS"
63 LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS"
69 CPPFLAGS_old="$CPPFLAGS"
70 dnl we must test system : linux = -DPCLINUX
71 dnl we must test system : Alpha-OSF = -DOSF1
74 CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES"
77 CPPFLAGS="$CPPFLAGS -DOSF1 $LOCAL_INCLUDES"
80 AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no)
81 CPPFLAGS="$CPPFLAGS_old"
83 if test "x$med2_ok" = "xyes"
86 dnl check med2 library
89 LIBS="$LIBS $LOCAL_LIBS"
90 AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no)
95 if test "x$med2_ok" = "xyes"
99 MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES"
102 MED2_INCLUDES="-DOSF1 $LOCAL_INCLUDES"
105 MED2_LIBS="$LOCAL_LIBS"
106 MED2_MT_LIBS="$LOCAL_LIBS"
109 AC_MSG_RESULT(for med2: $med2_ok)