1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
dnl
dnl Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
dnl Copyright (C) DIGITEO - 2009 - Bruno JOFRET
dnl
dnl This file must be used under the terms of the CeCILL.
dnl This source file is licensed as described in the file COPYING, which
dnl you should have received as part of this distribution. The terms
dnl are also available at
dnl http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
dnl
dnl libhdf5 is mandatory in Scilab
dnl When we check :
dnl * if the path is provided or that we have to find it ourself
dnl * if it is available
dnl * what are the compilation flags
dnl * what are linking flags
AC_DEFUN([AC_HDF5], [
AC_ARG_WITH(hdf5_include,
AC_HELP_STRING([--with-hdf5-include=DIR],[Set the path to the HDF5 headers]),
[with_hdf5_include=$withval],
[with_hdf5_include='yes']
)
AC_ARG_WITH(hdf5_library,
AC_HELP_STRING([--with-hdf5-library=DIR],[Set the path to the HDF5 libraries]),
[with_hdf5_library=$withval],
[with_hdf5_library='yes']
)
if test "x$with_hdf5_include" != "xyes"; then
save_CFLAGS="$CFLAGS"
CFLAGS="-I$with_hdf5_include"
AC_CHECK_HEADER([hdf5.h],
[HDF5_CFLAGS="$CFLAGS"],
[AC_MSG_ERROR([Cannot find headers (hdf5.h) of the library HDF5 in $with_hdf5_include. Please install the dev package])]
)
CFLAGS="$save_CFLAGS"
else
HDF5_CFLAGS=""
if $WITH_DEVTOOLS; then # Scilab thirdparties
HDF5_CFLAGS="-I$DEVTOOLS_INCDIR"
else
if test -d /usr/include/hdf5/serial; then # New Debian packaging layout since hdf5-1.8.13
AC_CHECK_HEADER([hdf5/serial/hdf5.h],
[HDF5_CFLAGS="-I/usr/include/hdf5/serial"],
[AC_MSG_ERROR([Cannot find headers (hdf5.h) of the library HDF5. Please install the dev package])])
else
AC_CHECK_HEADER([hdf5.h],
[HDF5_CFLAGS=""],
[AC_MSG_ERROR([Cannot find headers (hdf5.h) of the library HDF5. Please install the dev package])])
fi
fi
fi
save_LIBS="$LIBS"
# --with-hdf5-library set then check in this dir
if test "x$with_hdf5_library" != "xyes"; then
HDF5_LIBS="-L$with_hdf5_library -lhdf5 -lhdf5_hl"
LIBS="$LIBS $HDF5_LIBS"
AC_CHECK_LIB([hdf5], [H5Fopen],
[],
[AC_MSG_ERROR([libhdf5 or libhdf5_hl: library missing. (Cannot find symbol H5Fopen) in $with_hdf5_library. Check if libhdf5 is installed and if the version is correct])],
[-lz]
)
else
if $WITH_DEVTOOLS; then # Scilab thirparties
HDF5_LIBS="-L$DEVTOOLS_LIBDIR -lhdf5 -lhdf5_hl"
else
if test -d /usr/include/hdf5/serial; then # New Debian packaging layout since hdf5-1.8.13
HDF5_LIBS="-lhdf5_serial -lhdf5_serial_hl"
LIBS="$LIBS $HDF5_LIBS"
AC_CHECK_LIB([hdf5_serial], [H5Fopen],
[],
[AC_MSG_ERROR([libhdf5_serial or libhdf5_serial_hl: library missing. (Cannot find symbol H5Fopen). Check if libhdf5 is installed and if the version is correct])],
[-lz]
)
else
HDF5_LIBS="-lhdf5 -lhdf5_hl"
LIBS="$LIBS $HDF5_LIBS"
AC_CHECK_LIB([hdf5], [H5Fopen],
[],
[AC_MSG_ERROR([libhdf5 or libhdf5_hl: library missing. (Cannot find symbol H5Fopen). Check if libhdf5 is installed and if the version is correct])],
[-lz]
)
fi
fi
fi
LIBS="$save_LIBS"
AC_SUBST(HDF5_LIBS)
AC_SUBST(HDF5_CFLAGS)
AC_DEFINE([WITH_HDF5], [], [With the HDF5 library])
# Gets compilation and library flags
])
|