1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
AC_INIT(DESCRIPTION)
AC_PROG_CC
AC_ARG_WITH(zlib,
[ --with-zlib=DIR Use zlib installed in DIR])
if test -n "$with_zlib"; then
ZLIBLDFLAGS=-L${with_zlib}/lib
ZLIBCPPFLAGS=-I${with_zlib}/include
fi
AC_ARG_WITH(hdf5,
[ --with-hdf5=DIR Use HDF5 installed in DIR])
if test -n "$with_hdf5"; then
HDF5LDFLAGS="-L${with_hdf5}/lib"
if test `uname -s` != "Darwin"; then
HDF5LDFLAGS="-Wl,-L,${with_hdf5}/lib"
fi
HDF5CPPFLAGS=-I${with_hdf5}/include
fi
LIBS=-lm
CPPFLAGS="$ZLIBCPPFLAGS $HDF5CPPFLAGS $CPPFLAGS"
LDFLAGS="$HDF5LDFLAGS $ZLIBLDFLAGS $LDFLAGS"
AC_SEARCH_LIBS(inflate, z, have_zlib=yes, have_zlib=no)
AC_SEARCH_LIBS(H5open, hdf5, have_hdf5=yes, have_hdf5=no)
if test $have_zlib = no; then
AC_MSG_ERROR(Can't find zlib)
fi
if test "$have_hdf5" = yes; then
AC_MSG_CHECKING(for sufficiently new HDF5)
AC_TRY_LINK([#include <hdf5.h>],
[ H5T_pers_t convtype = H5T_PERS_SOFT;
H5Tclose ((hid_t) 0);],
have_hdf5=yes,
have_hdf5=no)
AC_MSG_RESULT($have_hdf5)
fi
if test $have_hdf5 = no; then
AC_MSG_ERROR(Can't find HDF5)
fi
AC_SUBST(ZLIBCPPFLAGS)
AC_SUBST(ZLIBLDFLAGS)
AC_SUBST(HDF5CPPFLAGS)
AC_SUBST(HDF5LDFLAGS)
AC_OUTPUT(src/Makevars)
|