summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2001-01-04 06:34:06 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2001-01-04 06:34:06 (GMT)
commit8a2eebbc58bed2fdb39e84a95972630558a8133a (patch)
tree994ceaf611af5284dfb8b20d5bb5dfe5cde3eb9b /configure.in
parentad08120b6d393abe69778504ce914dedcc74b4c9 (diff)
downloadhdf5-8a2eebbc58bed2fdb39e84a95972630558a8133a.zip
hdf5-8a2eebbc58bed2fdb39e84a95972630558a8133a.tar.gz
hdf5-8a2eebbc58bed2fdb39e84a95972630558a8133a.tar.bz2
[svn-r3238] Purpose:
Bug fix Description: The zlib.h header check was skipped if it thought it had found -lz already. That resulted in H5_HAVE_ZLIB_H not defined which caused compression feature not compiled even though everything else said it was in. The --with-hdf4 was default to yes but configure had no clue where to find them. A plain waste of time and affected ZLIB's searching later. Solution: Basically restored what it was before--checking the optional switch of with-hdf4 first, then with-zlib. (with-hdf4 now defaults to no.) Added a big chunk of comments explaining why these two options must be checked in this order. Changes applied to configure.in. Then ran autoconf to generate configure. Platforms tested: eirene (default and with-hdf4), modi4-64-parallel (with-hdf4), arabica (with-hdf4) and, gondoline. That is right, even tested it out with gondoline (with-hdf4 too.) All except modi4 configured, compiled and tested correctly. Modi4 died in the compiling of src/H5Zdeflate.c but that was not due to the configure changes.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in98
1 files changed, 51 insertions, 47 deletions
diff --git a/configure.in b/configure.in
index cc85103..0e28e50 100644
--- a/configure.in
+++ b/configure.in
@@ -494,33 +494,26 @@ dnl Checkpoint the cache
AC_CACHE_SAVE
dnl ----------------------------------------------------------------------
-dnl If the user specified the --with-zlib flag, then we want to place
-dnl the specified `include' and `lib' directories in the CPPFLAGS and
-dnl LDFLAGS respec. This will cause the subsequent checks to check this
-dnl place first for zlib
+dnl Is HDF4 present? If so then we can compile the hdf4 related tools.
+dnl The HDF4 software has 4 component libraries (df, mfhdf, z, jpeg)
+dnl and many header files. Will just verify the presence of mfhdf.h
+dnl because it includes many other HDF4 header files.
+dnl Their locations might be specified with the `--with-hdf4' command-line
+dnl 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(zlib,[ --with-zlib=INC,LIB Use the GNU zlib compression],
- ,withval=yes)
-case "$withval" in
- yes | no)
- ;;
- *)
- zlib_inc="`echo $withval |cut -f1 -d,`"
- if test -n "$zlib_inc"; then
- CPPFLAGS="$CPPFLAGS -I$zlib_inc"
- fi
-
- zlib_lib="`echo $withval |cut -f2 -d, -s`"
- if test -n "$zlib_lib"; then
- LDFLAGS="$LDFLAGS -L$zlib_lib"
- fi
- ;;
-esac
-
-dnl ----------------------------------------------------------------------
-dnl Is HDF4 present? If so then we can compile the h5toh4 and h5toh4 converters.
-dnl We assume they can be compiled and then prove otherwise when we don't find
-dnl a header file or library.
+dnl To check, we first assume HDF4 is present and then prove otherwise
+dnl when we cannot find all its components.
+dnl Notice that HDF4 (when wanted) must be checked before checking for
+dnl the ZLIB components because:
+dnl 1. HDF4 components contain ZLIB components.
+dnl 2. ZLIB components are always checked while HDF4 components are optional.
+dnl If ZLIB is checked first and not found, the libz value is set to no.
+dnl That will cause the later checking of HDF4 components, which also
+dnl include libz, to always fail.
+dnl If HDF4 components are checked first and the libz is not found, it will
+dnl cause the later checking of ZLIB componenets to fail too. But in this
+dnl case, one can configure again without the optional with-hdf4 option.
dnl
AC_SUBST(H5TOH4) H5TOH4=h5toh4
AC_SUBST(TESTH5TOH4) TESTH5TOH4='$(srcdir)/testh5toh4'
@@ -528,7 +521,7 @@ AC_SUBST(TESTH5TOH4) TESTH5TOH4='$(srcdir)/testh5toh4'
AC_SUBST(H4TOH5) H4TOH5=h4toh5
AC_SUBST(TESTH4TOH5) TESTH4TOH5='$(srcdir)/testh4toh5'
-AC_ARG_WITH(hdf4,[ --with-hdf4=INC,LIB Use the HDF4 library],,withval=yes)
+AC_ARG_WITH(hdf4,[ --with-hdf4=INC,LIB Use the HDF4 library],,withval=no)
case "$withval" in
yes)
AC_CHECK_HEADERS(mfhdf.h,,unset H5TOH4 TESTH5TOH4 H4TOH5 TESTH4TOH5)
@@ -573,31 +566,42 @@ esac
dnl ----------------------------------------------------------------------
dnl Is the GNU zlib present? It has a header file `zlib.h' and a library
-dnl `-lz' and their locations might be specified with the `--enable-zlib'
+dnl `-lz' and their locations might be specified with the `--with-zlib'
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
-FOUND_ZLIB="no"
-for d in $LIBS ; do
- if test "$d" = "-lz"; then
- FOUND_ZLIB="yes"
- fi
-done
+
AC_ARG_WITH(zlib,[ --with-zlib=INC,LIB Use the GNU zlib compression],
,withval=yes)
-if test "X$FOUND_ZLIB" = "Xno"; then
- dnl Only check for zlib if we haven't found it above in the HDF4 stuff.
- case "$withval" in
- no)
- AC_MSG_CHECKING(for GNU zlib)
- AC_MSG_RESULT(suppressed)
- ;;
- *)
- dnl The INC,LIB stuff was already parsed above
- AC_CHECK_HEADERS(zlib.h)
- AC_CHECK_LIB(z, compress)
- esac
-fi
+case $withval in
+ yes)
+ AC_CHECK_HEADERS(zlib.h)
+ AC_CHECK_LIB(z, compress)
+ ;;
+ no)
+ AC_MSG_CHECKING(for GNU zlib)
+ AC_MSG_RESULT(suppressed)
+ ;;
+ *)
+ zlib_inc="`echo $withval |cut -f1 -d,`"
+ if test -n "$zlib_inc"; then
+ saved_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$zlib_inc"
+ AC_CHECK_HEADERS(zlib.h,,CPPFLAGS="$saved_CPPFLAGS")
+ else
+ AC_CHECK_HEADERS(zlib.h)
+ fi
+
+ zlib_lib="`echo $withval |cut -f2 -d, -s`"
+ if test -n "$zlib_lib"; then
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -L$zlib_lib"
+ AC_CHECK_LIB(z, compress,,LDFLAGS="$saved_LDFLAGS")
+ else
+ AC_CHECK_LIB(z, compress)
+ fi
+ ;;
+esac
dnl ----------------------------------------------------------------------
dnl Is SSL library present? It is needed by GLOBUS-GASS and Grid Storage