configure.ac 1.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# see semver.org for version info
AC_INIT([aml],[0.0.1],[swann@anl.gov])

# are we in the right source dir ?
AC_CONFIG_SRCDIR([src/aml.h])

# build artefacts in separate dir
AC_CONFIG_AUX_DIR([m4])
AC_CONFIG_MACRO_DIR([m4])

# automake should fail on any error
AM_INIT_AUTOMAKE([-Wall -Werror foreign 1.12])
AM_PROG_AR

# check for libtool
LT_INIT

# check for programs
AC_LANG([C])
AC_PROG_CC
AC_PROG_CC_STDC
AC_PROG_CPP
AC_TYPE_SIZE_T
24
AC_TYPE_INTPTR_T
25 26 27 28 29 30 31 32 33 34 35 36 37 38

# support for testing with valgrind
AC_ARG_ENABLE(valgrind,
[AS_HELP_STRING([--enable-valgrind],[Also valgrind on checks (default is no).])],
[valgrind=true],[valgrind=false])

if [[ "x$valgrind" = xtrue ]]; then
	AC_PATH_PROG(VALGRIND, valgrind, no)
	if [[  "x$VALGRIND" = xno ]]; then
		AC_MSG_ERROR([Valgrind not found in PATH. ])
	fi
fi
AM_CONDITIONAL([TEST_VALGRIND],[test "x$valgrind" = xtrue])

39 40 41 42 43 44 45 46 47 48 49 50
# support for compiling benchmarks
AC_ARG_ENABLE(benchmarks,
[AS_HELP_STRING([--enable-benchmarks],[Compile additional benchmarks (default is no).])],
[benchmarks=true],[benchmarks=false])

if [[ "x$benchmarks" = xtrue ]]; then
	AX_OPENMP([AC_SUBST(OPENMP_FLAG, $OPENMP_CFLAGS)])
	AC_CHECK_LIB(m, sqrt)
fi
AM_CONDITIONAL([ADD_BENCHMARKS],[test "x$benchmarks" = xtrue])


51 52 53 54
# dependencies
AC_CHECK_HEADERS(numa.h)
AC_CHECK_LIB(numa, move_pages)

55
# internal jemalloc
56
ac_configure_args="$ac_configure_args \
57
			'--with-jemalloc-prefix=jemk_aml_' \
58
			'--with-install-suffix=-aml'"
59
AC_CONFIG_SUBDIRS([jemalloc])
60

61 62 63 64 65
AC_CONFIG_HEADERS([src/config.h])

AC_CONFIG_FILES([Makefile
		 src/Makefile
		 tests/Makefile
66
		 benchmarks/Makefile
67 68
		 aml.pc])
AC_OUTPUT