diff options
author | schnetter <schnetter@fb53df36-e548-4a1e-8150-ab98cbd5e786> | 2010-02-13 22:48:27 +0000 |
---|---|---|
committer | schnetter <schnetter@fb53df36-e548-4a1e-8150-ab98cbd5e786> | 2010-02-13 22:48:27 +0000 |
commit | 96c91e7ff3c06585d520e321ed4a75901d4dbf9e (patch) | |
tree | 4cbfbb5f1d805473fc90a7fd53bd28f699d5898b | |
parent | d45974b03ab6eeb823a41f4d745e31671ae73c91 (diff) |
Handle libsz and zlib
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/HDF5/trunk@7 fb53df36-e548-4a1e-8150-ab98cbd5e786
-rw-r--r-- | HDF5.sh | 58 |
1 files changed, 56 insertions, 2 deletions
@@ -29,7 +29,9 @@ unset MAKEFLAGS set -x # Output commands set -e # Abort on errors cd ${INSTALL_DIR} - if [ -e done-${NAME} -a done-${NAME} -nt ${SRCDIR}/dist/${NAME}.tar.gz ]; then + if [ -e done-${NAME} -a done-${NAME} -nt ${SRCDIR}/dist/${NAME}.tar.gz \ + -a done-${NAME} -nt ${SRCDIR}/HDF5.sh ] + then echo "HDF5: The enclosed HDF5 library has already been built; doing nothing" else echo "HDF5: Building enclosed HDF5 library" @@ -71,7 +73,7 @@ fi ################################################################################ -# Configure Cactus +# Check for additional libraries ################################################################################ # Set options @@ -79,6 +81,58 @@ HDF5_INC_DIRS="${HDF5_DIR}/include" HDF5_LIB_DIRS="${HDF5_DIR}/lib" HDF5_LIBS='hdf5' + + +# Check whether we are running on Windows +if perl -we 'exit (`uname` =~ /^CYGWIN/)'; then + is_windows=0 +else + is_windows=1 +fi + +# Check whether we are running on MacOS +if perl -we 'exit (`uname` =~ /^Darwin/)'; then + is_macos=0 +else + is_macos=1 +fi + + + +# Check whether we have to link with libsz.a +if grep -qe '#define H5_HAVE_LIBSZ 1' ${HDF5_DIR}/include/H5pubconf.h 2> /dev/null; then + test_szlib=0 +else + test_szlib=1 +fi +if [ $test_szlib -eq 0 ]; then + if [ $is_windows -eq 0 ]; then + HDF5_LIBS="$HDF5_LIBS sz" + else + HDF5_LIBS="$HDF5_LIBS szlib" + fi +fi + +# Check whether we have to link with libz.a +if grep -qe '#define H5_HAVE_LIBZ 1' ${HDF5_DIR}/include/H5pubconf.h 2> /dev/null; then + test_zlib=0 +else + test_zlib=1 +fi +if [ $test_zlib -eq 0 ]; then + if [ $is_windows -eq 0 ]; then + HDF5_LIBS="$HDF5_LIBS z" + else + HDF5_LIBS="$HDF5_LIBS zlib" + fi +fi + + + +################################################################################ +# Configure Cactus +################################################################################ + # Pass options to Cactus echo "BEGIN MAKE_DEFINITION" echo "HAVE_HDF5 = 1" |