summaryrefslogtreecommitdiffstats
path: root/fortran/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/configure.in')
-rw-r--r--fortran/configure.in82
1 files changed, 81 insertions, 1 deletions
diff --git a/fortran/configure.in b/fortran/configure.in
index 423cef7..ac937da 100644
--- a/fortran/configure.in
+++ b/fortran/configure.in
@@ -402,7 +402,8 @@ dnl If the library path is specified then it must be preceded by a comma.
dnl
AC_ARG_WITH([zlib],
[AC_HELP_STRING([--with-zlib=DIR],
- [Use GNU zlib compression [default=yes]])],,
+ [Use zlib library for external deflate I/O
+ filter [default=yes]])],,
withval=yes)
case $withval in
@@ -475,6 +476,85 @@ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2"
[Define if support for deflate filter is enabled])
fi
+dnl ----------------------------------------------------------------------
+dnl Is the szlib present? It has a header file `szlib.h' and a library
+dnl `-lsz' and their locations might be specified with the `--with-szlib'
+dnl command-line switch. The value is an include path and/or a library path.
+dnl If the library path is specified then it must be preceded by a comma.
+dnl
+AC_ARG_WITH([szlib],
+ [AC_HELP_STRING([--with-szlib=DIR],
+ [Use szlib library for external szlib I/O
+ filter [default=yes]])],,
+ withval=yes)
+
+case $withval in
+ yes)
+ HAVE_SZLIB="yes"
+ AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"])
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB])
+
+ if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
+ AC_MSG_ERROR([couldn't find szlib library])
+ fi
+ ;;
+ no)
+ HAVE_SZLIB="no"
+ AC_MSG_CHECKING([for szlib])
+ AC_MSG_RESULT([suppressed])
+ ;;
+ *)
+ HAVE_SZLIB="yes"
+ case "$withval" in
+ *,*)
+ szlib_inc="`echo $withval |cut -f1 -d,`"
+ szlib_lib="`echo $withval |cut -f2 -d, -s`"
+ ;;
+ *)
+ if test -n "$withval"; then
+ szlib_inc="$withval/include"
+ szlib_lib="$withval/lib"
+ fi
+ ;;
+ esac
+
+ dnl Trying to include -I/usr/include and -L/usr/lib is redundant and
+ dnl can mess some compilers up.
+ if test "X$szlib_inc" = "X/usr/include"; then
+ szlib_inc=""
+ fi
+ if test "X$szlib_lib" = "X/usr/lib"; then
+ szlib_lib=""
+ fi
+
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LDFLAGS="$LDFLAGS"
+
+ if test -n "$szlib_inc"; then
+ CPPFLAGS="$CPPFLAGS -I$szlib_inc"
+ fi
+
+ AC_CHECK_HEADERS([szlib.h],
+ [HAVE_SZLIB_H="yes"],
+ [CPPFLAGS="$saved_CPPFLAGS"])
+
+ if test -n "$szlib_lib"; then
+ LDFLAGS="$LDFLAGS -L$szlib_lib"
+ fi
+
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],,
+ [LDFLAGS="$saved_LDFLAGS"; unset HAVE_SZLIB])
+
+ if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
+ AC_MSG_ERROR([couldn't find szlib library])
+ fi
+ ;;
+esac
+
+if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
+ AC_DEFINE(HAVE_FILTER_SZIP, 1,
+ [Define if support for szip filter is enabled])
+fi
dnl ----------------------------------------------------------------------
dnl Checks for header files.