trick/autoconf/m4/tr_hdf5_home.m4
Scott Fennell c588520727
Autoconf Update & Refactor (#1347)
Refactor autoconf, use best practices
2022-10-25 11:41:49 -05:00

28 lines
1004 B
Plaintext

AC_DEFUN([TR_HDF5_HOME],[
AC_ARG_WITH([hdf5],
AS_HELP_STRING([--with-hdf5@<:@=DIR@:>@], [HDF5 root directory]),
[HDF5_HOME="$withval"
AS_IF([test "$HDF5_HOME" = "yes"],
AC_CHECK_HEADER(hdf5.h,[HDF5_HOME="/usr"],AC_MSG_ERROR([could not find hdf5.h])),
AS_IF([test "$HDF5_HOME" = "no"],[HDF5_HOME=""],
AC_CHECK_FILE([$HDF5_HOME/include/hdf5.h],
[],
AC_MSG_ERROR([could not find $HDF5_HOME/include/hdf5.h])
)
)
)],
[
AC_CHECK_HEADER(hdf5.h, [HDF5_HOME="/usr"], [HDF5_HOME=""])
]
)
AS_IF([test "$HDF5_HOME" != ""],
[
LDFLAGS="${LDFLAGS} -L${HDF5_HOME}/lib"
AC_CHECK_LIB(hdf5, main, [],AC_MSG_ERROR([could not find libhdf5]))
]
[]
)
AC_SUBST([HDF5_HOME])
])