diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /m4/hdf5.m4 | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'm4/hdf5.m4')
-rwxr-xr-x | m4/hdf5.m4 | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/m4/hdf5.m4 b/m4/hdf5.m4 new file mode 100755 index 000000000..397e13c83 --- /dev/null +++ b/m4/hdf5.m4 @@ -0,0 +1,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 +]) |