summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-02-18 20:56:21 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-02-18 20:56:21 (GMT)
commitaff5c20a6ae123dd4250ee46e1cdadbae00fd823 (patch)
tree9bc8c1e2c2cdf4227053fa6beedfe14fb4a9a1a2 /configure.ac
parentdbad502865d8817fe0db94dd6d6b9656ee257790 (diff)
downloadhdf5-aff5c20a6ae123dd4250ee46e1cdadbae00fd823.zip
hdf5-aff5c20a6ae123dd4250ee46e1cdadbae00fd823.tar.gz
hdf5-aff5c20a6ae123dd4250ee46e1cdadbae00fd823.tar.bz2
[svn-r23305] HDFFV-8257: szip still used even if headers are not found. Change configure to test the result of the CHECK HEADERS call before checking for the library.
Tested: local linux, h5committest
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac183
1 files changed, 100 insertions, 83 deletions
diff --git a/configure.ac b/configure.ac
index 72bb163..b67e0e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1615,9 +1615,10 @@ AC_ARG_WITH([dmalloc],
case $withval in
yes)
HAVE_DMALLOC="yes"
- AC_CHECK_HEADERS([dmalloc.h])
- AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC])
-
+ AC_CHECK_HEADERS([dmalloc.h],, [unset HAVE_DMALLOC])
+ if test "x$HAVE_DMALLOC" = "xyes"; then
+ AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [unset HAVE_DMALLOC])
+ fi
if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find dmalloc library])
fi
@@ -1661,14 +1662,16 @@ case $withval in
AM_CPPFLAGS="$AM_CPPFLAGS -I$dmalloc_inc"
fi
- AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"])
+ AC_CHECK_HEADERS([dmalloc.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_DMALLOC])
- if test -n "$dmalloc_lib"; then
- LDFLAGS="$LDFLAGS -L$dmalloc_lib"
- AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib"
- fi
+ if test "x$HAVE_DMALLOC" = "xyes"; then
+ if test -n "$dmalloc_lib"; then
+ LDFLAGS="$LDFLAGS -L$dmalloc_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$dmalloc_lib"
+ fi
- AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC])
+ AC_CHECK_LIB([dmalloc], [dmalloc_shutdown],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_DMALLOC])
+ fi
if test -z "$HAVE_DMALLOC" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find dmalloc library])
@@ -1692,12 +1695,16 @@ AC_ARG_WITH([zlib],
case $withval in
yes)
HAVE_ZLIB="yes"
- AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"])
- AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB])
- AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"])
-
- if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
- AC_MSG_ERROR([couldn't find zlib library])
+ AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H="yes"], [unset HAVE_ZLIB])
+ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then
+ AC_CHECK_LIB([z], [compress2],, [unset HAVE_ZLIB])
+ fi
+ if test -z "$HAVE_ZLIB"; then
+ if test -n "$HDF5_CONFIG_ABORT"; then
+ AC_MSG_ERROR([couldn't find zlib library])
+ fi
+ else
+ AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"])
fi
;;
no)
@@ -1709,8 +1716,8 @@ case $withval in
HAVE_ZLIB="yes"
case "$withval" in
*,*)
- zlib_inc="`echo $withval |cut -f1 -d,`"
- zlib_lib="`echo $withval |cut -f2 -d, -s`"
+ zlib_inc="`echo $withval | cut -f1 -d,`"
+ zlib_lib="`echo $withval | cut -f2 -d, -s`"
;;
*)
if test -n "$withval"; then
@@ -1741,32 +1748,37 @@ case $withval in
AC_CHECK_HEADERS([zlib.h],
[HAVE_ZLIB_H="yes"],
- [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"])
+ [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_ZLIB])
if test -n "$zlib_lib"; then
LDFLAGS="$LDFLAGS -L$zlib_lib"
AM_LDFLAGS="$AM_LDFLAGS -L$zlib_lib"
fi
- AC_CHECK_LIB([z], [compress2],,
- [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB])
- AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"])
+ if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes"; then
+ AC_CHECK_LIB([z], [compress2],,
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_ZLIB])
+ fi
- if test -z "$HAVE_ZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
- AC_MSG_ERROR([couldn't find zlib library])
+ if test -z "$HAVE_ZLIB"; then
+ if test -n "$HDF5_CONFIG_ABORT"; then
+ AC_MSG_ERROR([couldn't find zlib library])
+ fi
+ else
+ AC_CHECK_FUNC([compress2], [HAVE_COMPRESS2="yes"])
fi
;;
esac
if test "x$HAVE_ZLIB" = "xyes" -a "x$HAVE_ZLIB_H" = "xyes" -a "x$HAVE_COMPRESS2" = "xyes"; then
- AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled])
- USE_FILTER_DEFLATE="yes"
+ AC_DEFINE([HAVE_FILTER_DEFLATE], [1], [Define if support for deflate (zlib) filter is enabled])
+ USE_FILTER_DEFLATE="yes"
- ## Add "deflate" to external filter list
- if test "X$EXTERNAL_FILTERS" != "X"; then
- EXTERNAL_FILTERS="${EXTERNAL_FILTERS},"
- fi
- EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)"
+ ## Add "deflate" to external filter list
+ if test "X$EXTERNAL_FILTERS" != "X"; then
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS},"
+ fi
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS}deflate(zlib)"
fi
@@ -1786,9 +1798,10 @@ AC_ARG_WITH([szlib],
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])
-
+ AC_CHECK_HEADERS([szlib.h], [HAVE_SZLIB_H="yes"], [unset HAVE_SZLIB])
+ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],, [unset HAVE_SZLIB])
+ fi
if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find szlib library])
fi
@@ -1834,15 +1847,17 @@ case $withval in
AC_CHECK_HEADERS([szlib.h],
[HAVE_SZLIB_H="yes"],
- [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"])
+ [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_SZIP])
if test -n "$szlib_lib"; then
LDFLAGS="$LDFLAGS -L$szlib_lib"
AM_LDFLAGS="$AM_LDFLAGS -L$szlib_lib"
fi
- AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],,
- [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB])
+ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
+ AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],,
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_SZLIB])
+ fi
if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find szlib library])
@@ -1851,21 +1866,21 @@ case $withval in
esac
if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
- ## SZLIB library is available. Check if it can encode
- AC_MSG_CHECKING([for szlib encoder])
+ ## SZLIB library is available. Check if it can encode
+ AC_MSG_CHECKING([for szlib encoder])
- ## Set LD_LIBRARY_PATH so encoder test can find the library and run.
- ## Also add LL_PATH substitution to Makefiles so they can use the
- ## path as well, for testing examples.
- if test -z "$LD_LIBRARY_PATH"; then
+ ## Set LD_LIBRARY_PATH so encoder test can find the library and run.
+ ## Also add LL_PATH substitution to Makefiles so they can use the
+ ## path as well, for testing examples.
+ if test -z "$LD_LIBRARY_PATH"; then
export LD_LIBRARY_PATH="$szlib_lib"
- else
+ else
export LD_LIBRARY_PATH="$szlib_lib:$LD_LIBRARY_PATH"
- fi
+ fi
- AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH"
+ AC_SUBST([LL_PATH]) LL_PATH="$LD_LIBRARY_PATH"
- AC_CACHE_VAL([hdf5_cv_szlib_can_encode],
+ AC_CACHE_VAL([hdf5_cv_szlib_can_encode],
[AC_TRY_RUN([
#include <szlib.h>
@@ -1879,31 +1894,30 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
}
], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)])
- AC_DEFINE([HAVE_FILTER_SZIP], [1],
+ AC_DEFINE([HAVE_FILTER_SZIP], [1],
[Define if support for szip filter is enabled])
- USE_FILTER_SZIP="yes"
+ USE_FILTER_SZIP="yes"
- if test ${hdf5_cv_szlib_can_encode} = "yes"; then
- AC_MSG_RESULT([yes])
- fi
- if test ${hdf5_cv_szlib_can_encode} = "no"; then
- AC_MSG_RESULT([no])
- fi
+ if test ${hdf5_cv_szlib_can_encode} = "yes"; then
+ AC_MSG_RESULT([yes])
+ fi
+ if test ${hdf5_cv_szlib_can_encode} = "no"; then
+ AC_MSG_RESULT([no])
+ fi
- ## Add "szip" to external filter list
- if test ${hdf5_cv_szlib_can_encode} = "yes"; then
- 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)"
+ ## Add "szip" to external filter list
+ if test ${hdf5_cv_szlib_can_encode} = "yes"; then
+ 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
AM_CONDITIONAL([BUILD_SHARED_SZIP_CONDITIONAL], [test "X$USE_FILTER_SZIP" = "Xyes" && test "X$LL_PATH" != "X"])
@@ -1918,7 +1932,7 @@ AC_CACHE_SAVE
## and/or a library path. If the library path is specified then it must
## be preceded by a comma.
##
-AC_SUBST([PTHREAD]) PTHREAD=yes
+AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes
AC_ARG_WITH([pthread],
[AS_HELP_STRING([--with-pthread=DIR],
[Use the Pthreads library [default=no]])],,
@@ -1926,13 +1940,15 @@ AC_ARG_WITH([pthread],
case "$withval" in
yes)
- AC_CHECK_HEADERS([pthread.h])
- AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD])
+ AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD])
+ if test "x$HAVE_DMALLOC" = "xyes"; then
+ AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD])
+ fi
;;
no)
AC_MSG_CHECKING([for pthread])
AC_MSG_RESULT([suppressed])
- unset PTHREAD
+ unset HAVE_PTHREAD
;;
*)
case "$withval" in
@@ -1962,21 +1978,22 @@ case "$withval" in
saved_AM_CPPFLAGS="$AM_CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$pthread_inc"
AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc"
- AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset PTHREAD])
+ AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD])
else
- AC_CHECK_HEADERS([pthread.h],, [unset PTHREAD])
+ AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD])
fi
- if test -n "$pthread_lib"; then
- saved_LDFLAGS="$LDFLAGS"
- saved_AM_LDFLAGS="$AM_LDFLAGS"
- LDFLAGS="$LDFLAGS -L$pthread_lib"
- AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib"
- AC_CHECK_LIB([pthread], [pthread_self],,
- [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset PTHREAD])
-
- else
- AC_CHECK_LIB([pthread], [pthread_self],, [unset PTHREAD])
+ if test "x$HAVE_DMALLOC" = "xyes"; then
+ if test -n "$pthread_lib"; then
+ saved_LDFLAGS="$LDFLAGS"
+ saved_AM_LDFLAGS="$AM_LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$pthread_lib"
+ AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib"
+ AC_CHECK_LIB([pthread], [pthread_self],,
+ [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD])
+ else
+ AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD])
+ fi
fi
;;
esac