]> SALOME platform Git repositories - modules/yacs.git/blob - src/wrappergen/src/HXX2SALOME_GENERIC_CLASS_NAME_SRC/adm_local/unix/config_files/check_hdf5.m4
Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / wrappergen / src / HXX2SALOME_GENERIC_CLASS_NAME_SRC / adm_local / unix / config_files / check_hdf5.m4
1 dnl  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 dnl
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.
7 dnl
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.
12 dnl
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
16 dnl
17 dnl  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 dnl
19 AC_DEFUN([CHECK_HDF5],[
20 AC_REQUIRE([AC_PROG_CC])dnl
21 AC_REQUIRE([AC_PROG_CPP])dnl
22
23 AC_CHECKING(for HDF5)
24
25 AC_ARG_WITH(hdf5,
26     [  --with-hdf5=DIR                 root directory path to hdf5 installation ],
27     [HDF5HOME="$withval"
28       AC_MSG_RESULT("select $withval as path to hdf5")
29     ])
30
31 AC_SUBST(HDF5_INCLUDES)
32 AC_SUBST(HDF5_LIBS)
33 AC_SUBST(HDF5_MT_LIBS)
34
35 HDF5_INCLUDES=""
36 HDF5_LIBS=""
37 HDF5_MT_LIBS=""
38
39 hdf5_ok=no
40
41 LOCAL_INCLUDES=""
42 LOCAL_LIBS=""
43
44 if test -z $HDF5HOME
45 then
46    AC_MSG_WARN(undefined HDF5HOME variable which specify hdf5 installation directory)
47 else
48    LOCAL_INCLUDES="-I$HDF5HOME/include"
49    if test "x$HDF5HOME" = "x/usr"
50    then
51       LOCAL_LIBS=""
52    else
53       LOCAL_LIBS="-L$HDF5HOME/lib"
54    fi
55 fi
56
57 dnl hdf5 headers
58
59 CPPFLAGS_old="$CPPFLAGS"
60 CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
61 AC_CHECK_HEADER(hdf5.h,hdf5_ok=yes ,hdf5_ok=no)
62 CPPFLAGS="$CPPFLAGS_old"
63
64
65 if  test "x$hdf5_ok" = "xyes"
66 then
67
68 dnl hdf5 library
69
70   LIBS_old="$LIBS"
71   LIBS="$LIBS $LOCAL_LIBS"
72   AC_CHECK_LIB(hdf5,H5open,hdf5_ok=yes,hdf5_ok=no)
73   LIBS="$LIBS_old"
74
75 fi
76
77 if  test "x$hdf5_ok" = "xyes"
78 then
79   HDF5_INCLUDES="$LOCAL_INCLUDES"
80   HDF5_LIBS="$LOCAL_LIBS -lhdf5"
81   HDF5_MT_LIBS="$LOCAL_LIBS -lhdf5"
82 fi
83
84 AC_MSG_RESULT(for hdf5: $hdf5_ok)
85
86 ])dnl