-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
61 lines (49 loc) · 1.58 KB
/
configure.ac
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
55
56
57
58
59
60
AC_PREREQ([2.63])
AC_INIT(ScalarEMTmeas,[v1.0],[[email protected]],[ScalarEMTmeas])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([scalar_EMT_meas.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([.buildutils/m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_ARG_WITH([hadrons],
[AS_HELP_STRING([--with-hadrons=<prefix>],
[try this for a non-standard install prefix of Hadrons])],
[PATH="$with_hadrons/bin$PATH_SEPARATOR$PATH"]
[CXXFLAGS="$CXXFLAGS -I$with_hadrons/include"]
[LDFLAGS="$LDFLAGS -L$with_hadrons/lib"])
AC_CHECK_PROG([HADCONF],[hadrons-config],[yes])
if test x"$HADCONF" != x"yes" ; then
AC_MSG_ERROR([hadrons-config not found])
fi
CXXFLAGS="$CXXFLAGS `hadrons-config --cxxflags`"
LDFLAGS="$LDFLAGS `hadrons-config --ldflags`"
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
LIBS=" -lHadrons $LIBS `hadrons-config --libs`"
AC_PROG_CXX
AC_LANG([C++])
AC_MSG_CHECKING([that a minimal Hadrons program compiles]);
AC_LINK_IFELSE(
[AC_LANG_SOURCE([[
#include <Hadrons/Application.hpp>
using namespace Grid;
using namespace Hadrons;
int main(int argc, char *argv[])
{
Grid_init(&argc, &argv);
Grid_finalize();
Application application;
application.run();
return 0;
}
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])]
[AC_MSG_ERROR([Failed to compile a minimal Hadrons program])])
AC_SUBST([AM_CXXFLAGS])
AC_SUBST([AM_LDFLAGS])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT