2
AC_INIT([nova-agent], [0.0.1.2], [chris.behrens@rackspace.com])
3
AC_CONFIG_SRCDIR([src/nova-agent.c])
4
AC_CONFIG_HEADERS([include/config.h])
6
AM_INIT_AUTOMAKE([foreign -Wall -Werror tar-ustar])
8
AC_PREFIX_DEFAULT([/usr])
10
AC_ARG_ENABLE([coverage],
11
[AS_HELP_STRING([--enable-coverage],
12
[Toggle coverage @<:@default=off@:>@])],
13
[ac_coverage="$enableval"],
16
AS_IF([test "$ac_coverage" = "yes"],
18
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -lgcov -O0"
25
AC_CONFIG_MACRO_DIR([m4])
30
echo "The $what is missing and is required for building"
34
if test "$PYTHON_CFLAGS" = "" -a "$PYTHON_LIB" = ""; then
35
AC_MSG_CHECKING([for python build requisites])
37
for python in "python2.7" "python2.6" "python2.5" "python2.4" ; do
38
for dir in $prefix "/usr/local" "/usr"; do
39
if test -f ${dir}/include/${python}/Python.h ; then
40
if test -f ${dir}/lib/lib${python}.so ; then
41
# We're done. Found header and library
43
PYTHON_CFLAGS="-I${dir}/include/${python}"
44
PYTHON_LIB="-l${python}"
51
if test "x${PYTHON_CFLAGS}" = "x" ; then
52
AC_MSG_RESULT([not found])
54
AC_MSG_RESULT([adding ${PYTHON_CFLAGS} and ${PYTHON_LIB}])
58
AC_MSG_CHECKING([that the python library can be linked])
63
CFLAGS="$CFLAGS $PYTHON_CFLAGS"
64
LIBS="$LIBS $PYTHON_LIB"
66
AC_TRY_LINK([#include <Python.h>], [
67
int main(int argc, char **argv)
71
], [AC_MSG_RESULT([yes])], [
75
AC_MSG_RESULT([A working python header and/or library could not be found])
76
AC_MSG_RESULT([Re-run configure specifying PYTHON_CFLAGS and PYTHON_LIB])
77
AC_MSG_RESULT([and/or CFLAGS and LDFLAGS correctly])
86
AC_CHECK_PROG([PATCHELF], [patchelf], [yes])
87
if test "$PATCHELF" != "yes"; then
92
AC_CHECK_LIB([pthread], [pthread_create], [], [
93
missing "the pthread library"
99
AC_SUBST([GCOV_CFLAGS])
100
AC_SUBST([PYTHON_VER])
101
AC_SUBST([PYTHON_CFLAGS])
102
AC_SUBST([PYTHON_LIB])
105
AC_CONFIG_FILES([Makefile