lattice-benchmarks/Grid/configure.ac

73 lines
1.9 KiB
Plaintext

AC_PREREQ([2.69])
AC_INIT([lattice-bench], [0.1], [antonin.portelli@me.com])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([Benchmark_Grid.cpp])
AC_CONFIG_MACRO_DIR([.buildutils/m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_ARG_WITH([grid],
[AS_HELP_STRING([--with-grid=<prefix>],
[try this for a non-standard install prefix of Grid])],
[PATH="$with_grid/bin$PATH_SEPARATOR$PATH"]
[CXXFLAGS="$CXXFLAGS -I$with_grid/include"]
[LDFLAGS="$LDFLAGS -L$with_grid/lib"])
AC_CHECK_PROG([GRIDCONF],[grid-config],[yes])
if test x"$GRIDCONF" != x"yes" ; then
AC_MSG_ERROR([grid-config not found])
fi
if test x"$CXX" == x ; then
CXX="`grid-config --cxx`"
elif test "$CXX" != "`grid-config --cxx`" ; then
AC_MSG_WARN([CXX differs from that reported by grid-config])
fi
if test x"$CXXLD" == x ; then
CXXLD="`grid-config --cxxld`"
elif test "$CXXLD" != "`grid-config --cxxld`" ; then
AC_MSG_WARN([CXXLD differs from that reported by grid-config])
fi
CXXFLAGS="$CXXFLAGS `grid-config --cxxflags`"
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
LDFLAGS="$LDFLAGS `grid-config --ldflags`"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
LIBS=" -ldl -lGrid $LIBS `grid-config --libs`"
AC_PROG_RANLIB
AM_PROG_AR
AC_LANG([C++])
AC_MSG_CHECKING([that a minimal Grid program compiles]);
AC_LINK_IFELSE(
[AC_LANG_SOURCE([[
#include <Grid/Grid.h>
using namespace Grid;
int main(int argc, char *argv[])
{
Grid_init(&argc, &argv);
Grid_finalize();
return 0;
}
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
[AC_MSG_ERROR([impossible to compile a minimal Grid program])])
AC_SUBST([CXXLD])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT