1 dnl Copyright (C) 2007-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
27 [ --with-med2=DIR root directory path to med2 installation ],
29 AC_MSG_RESULT("select $withval as path to med2")
32 AC_SUBST(MED2_INCLUDES)
34 AC_SUBST(MED2_MT_LIBS)
42 LOCAL_INCLUDES="$HDF5_INCLUDES"
43 LOCAL_LIBS="-lmed $HDF5_LIBS"
47 AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory)
48 AC_PATH_PROG(MDUMP, mdump)
49 if test "xMDUMP" != "x" ; then
51 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
52 MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
55 if test ! -z $MED2HOME
57 LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include"
58 if test "x$MED2HOME" = "x/usr"
60 LOCAL_LIBS="-lmed $LOCAL_LIBS"
62 LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS"
70 irix5.* | irix6.* | osf4.* | osf5.* | linux* )
73 expr "$host_os" : 'linux' >/dev/null && test ! x"$host_cpu" = x"x86_64" && linux64="false"
74 if test ! x"$linux64" = "xfalse" ; then
75 echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5
76 echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6
77 # Check whether --enable-int64 or --disable-int64 was given.
78 if test "${enable_int64+set}" = set; then
79 enableval="$enable_int64"
82 case "X-$enable_int64" in
84 echo "$as_me:$LINENO: result: \"disabled\"" >&5
85 echo "${ECHO_T}\"disabled\"" >&6
89 echo "$as_me:$LINENO: result: \"enabled\"" >&5
90 echo "${ECHO_T}\"enabled\"" >&6
103 test x"$linux64" = x"true" && \
104 MACHINE="PCLINUX64${SUFFIXES}" || \
112 host_os_novers=aix4.x
115 MACHINE="IRIX64${SUFFIXES}"
116 host_os_novers=irix5.x
119 MACHINE="IRIX64${SUFFIXES}"
120 host_os_novers=irix6.x
123 MACHINE="OSF1${SUFFIXES}"
124 host_os_novers=osf4.x
127 MACHINE="OSF1${SUFFIXES}"
128 host_os_novers=osf5.x
132 host_os_novers=solaris2.x
139 host_os_novers=$host_os
143 CPPFLAGS_old="$CPPFLAGS"
144 dnl we must test system : linux = -DPCLINUX
145 dnl we must test system : Alpha-OSF = -DOSF1
148 CPPFLAGS="$CPPFLAGS -D$MACHINE $LOCAL_INCLUDES"
149 dnl CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES"
152 CPPFLAGS="$CPPFLAGS -DOSF1 $LOCAL_INCLUDES"
155 AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no)
156 CPPFLAGS="$CPPFLAGS_old"
158 if test "x$med2_ok" = "xyes"
161 dnl check med2 library
164 LIBS="$LIBS $LOCAL_LIBS"
165 AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no)
170 if test "x$med2_ok" = "xyes"
174 MED2_INCLUDES="-D$MACHINE $LOCAL_INCLUDES"
175 dnl MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES"
178 MED2_INCLUDES="-DOSF1 $LOCAL_INCLUDES"
181 MED2_LIBS="$LOCAL_LIBS"
182 MED2_MT_LIBS="$LOCAL_LIBS"
185 AC_MSG_RESULT(for med2: $med2_ok)