diff options
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 73 |
1 files changed, 48 insertions, 25 deletions
diff --git a/configure.in b/configure.in index eadf1fe..9a98df4 100644 --- a/configure.in +++ b/configure.in @@ -1487,34 +1487,34 @@ case $withval in 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 + 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 @@ -1522,19 +1522,26 @@ case $withval in 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]) - USE_FILTER_SZIP="yes" - dnl SZLIB library is available. Check if it can encode AC_MSG_CHECKING([for szlib encoder]) - + + AC_CACHE_VAL([hdf5_cv_szlib_functional], + [AC_TRY_RUN([ + #include <szlib.h> + + int main(void) + { + SZ_encoder_enabled(); + exit(0); + } + ], [hdf5_cv_szlib_functional=yes], [hdf5_cv_szlib_functional=no],)]) + AC_CACHE_VAL([hdf5_cv_szlib_can_encode], [AC_TRY_RUN([ #include <szlib.h> - + int main(void) - { + { /* SZ_encoder_enabled returns 1 if encoder is present */ if(SZ_encoder_enabled() == 1) exit(0); @@ -1542,23 +1549,39 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then exit(1); } ], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)]) - + + if test ${hdf5_cv_szlib_functional} = "no"; then + hdf5_cv_szlib_can_encode=broken + else + AC_DEFINE(HAVE_FILTER_SZIP, 1, + [Define if support for szip filter is enabled]) + USE_FILTER_SZIP="yes" + fi + if test ${hdf5_cv_szlib_can_encode} = "yes"; then AC_MSG_RESULT([yes]) - else + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then AC_MSG_RESULT([no]) + fi + if test ${hdf5_cv_szlib_can_encode} = "broken"; then + AC_MSG_RESULT([shared szlib doesn't work. disabling szip.]) fi - + dnl Add "szip" to external filter list - if test "X$EXTERNAL_FILTERS" != "X"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," - fi - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip" if test ${hdf5_cv_szlib_can_encode} = "yes"; then - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(encoder)" - else - EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(no encoder)" + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(encoder)" + fi + if test ${hdf5_cv_szlib_can_encode} = "no"; then + if test "X$EXTERNAL_FILTERS" != "X"; then + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}," + fi + EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip(no encoder)" fi + fi dnl Checkpoint the cache |