# -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.67]) AC_INIT([nagg], [1.3.1-pre1], [help@hdfgroup.org], [HDF NPP Aggregator]) AC_CONFIG_SRCDIR([src/nagg.h]) AM_CONFIG_HEADER([src/nagg_config.h]) AC_CONFIG_AUX_DIR([bin]) dnl AM_INIT_AUTOMAKE takes a list of options that should be applied to dnl every Makefile.am when automake is run. AM_INIT_AUTOMAKE([foreign]) dnl AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies dnl for Makefiles, configure, src/nagg_config.h, etc. If AM_MAINTAINER_MODE dnl is *not* included here, these files will be rebuilt if out of date. dnl This is a problem because if users try to build on a machine with dnl the wrong versions of autoconf and automake, these files will be dnl rebuilt with the wrong versions and bad things can happen. dnl Also, CVS doesn't preserve dependencies between timestamps, so dnl Makefiles will often think rebuilding needs to occur when it doesn't. dnl Developers should './configure --enable-maintainer-mode' to turn on dnl rebuild rules. AM_MAINTAINER_MODE dnl Set prefix default (install directory) to a directory in the build area. dnl This allows multiple src-dir builds within one host. AC_PREFIX_DEFAULT([`pwd`/nagg]) dnl Checks for programs. dnl Make sure they are set to something. CC="${CC:-h5cc}" AC_PROG_CC dnl Check if CC can compile HDF5 code. dnl Must check this before check other things that depends on HDF5. AC_CHECK_HEADERS([hdf5.h],, [AC_MSG_ERROR([couldn't find hdf5.h])]) AC_CHECK_LIB([hdf5], [H5open],, [AC_MSG_ERROR([couldn't find hdf5 library])]) dnl Checks for libraries. dnl ---------------------------------------------------------------------- dnl Is the High Level Region library present? AC_ARG_WITH([hlregion], [AC_HELP_STRING([--with-hlregion=DIR], [Use hdf5_hl_region library [default=yes]])],, [withval=yes]) case "$withval" in yes) HAVE_HLREGION="yes" AC_CHECK_HEADERS([h5hl_region.h],, [unset HAVE_HLREGION]) AC_CHECK_LIB([hdf5_hl_region], [H5LRread_region],, [unset HAVE_HLREGION]) if test -z "$HAVE_HLREGION"; then AC_MSG_ERROR([couldn't find hdf5_hl_region library]) fi ;; no) AC_MSG_ERROR([hdf5_hl_region library required to build nagg]) ;; *) HAVE_HLREGION="yes" case "$withval" in *,*) dnl include/ and lib/ are separately defined. hlregion_inc="`echo $withval | cut -f1 -d,`" hlregion_lib="`echo $withval | cut -f2 -d, -s`" ;; *) dnl include/ and lib/ share a parent directory. if test -n "$withval"; then hlregion_inc="$withval/include" hlregion_lib="$withval/lib" fi ;; esac dnl Trying to include -I/usr/include and -L/usr/lib is redundant and dnl can mess some compilers up. if test "X$hlregion_inc" = "X/usr/include"; then hlregion_inc="" fi if test "X$hlregion_lib" = "X/usr/lib"; then hlregion_lib="" fi if test -n "$hlregion_inc"; then CPPFLAGS="$CPPFLAGS -I$hlregion_inc" fi AC_CHECK_HEADERS([h5hl_region.h],, [unset HAVE_HLREGION]) if test -n "$hlregion_lib"; then LDFLAGS="$LDFLAGS -L$hlregion_lib" fi AC_CHECK_LIB([hdf5_hl_region], [H5LRread_region],, [unset HAVE_HLREGION]) if test -z "$HAVE_HLREGION"; then AC_MSG_ERROR([couldn't find hdf5_hl_region library]) fi ;; esac dnl Checks for header files. AC_CHECK_HEADERS([getopt.h]) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_CHECK_FUNCS(getopt_long) dnl We don't need to say when we're entering directories if we're using dnl GNU make because make does it for us. if test "X$GMAKE" = "Xyes"; then AC_SUBST([SETX]) SETX=":" else AC_SUBST([SETX]) SETX="set -x" fi AC_CONFIG_FILES([Makefile src/Makefile test/Makefile]) AC_OUTPUT