diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2007-03-08 16:57:36 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2007-03-08 16:57:36 (GMT) |
commit | 2996c917afa9d8dc27ac0360d6e34cd637a513f6 (patch) | |
tree | 8c0676b2cf0db0b99cb229a411b25a540c8e38c9 /configure.in | |
parent | 5a4bf8171df9473047d1eda534ed9a6a4d0749d9 (diff) | |
download | hdf5-2996c917afa9d8dc27ac0360d6e34cd637a513f6.zip hdf5-2996c917afa9d8dc27ac0360d6e34cd637a513f6.tar.gz hdf5-2996c917afa9d8dc27ac0360d6e34cd637a513f6.tar.bz2 |
[svn-r13475] There's a configure issue linking szip's shared libraries when running on kagiso.
The static szip libraries are working as intended, but when shared szip
libraries are present and intended for use they cannot be opened. A check
has been implemented to test if shared szip libraries are functional on
current platform. If they are not, and the user is trying to use them,
szip is now disbaled and the user is informed.
This issue occurs on kagiso, and the resolution was tested on kagiso.
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 |