diff options
author | Maarten Lankhorst <m.b.lankhorst@gmail.com> | 2010-05-06 21:30:01 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-06 21:30:01 +0200 |
commit | 41160f3dbf0cb61e23a02338da1f289a2ff00066 (patch) | |
tree | 116412a494fe5fc292d3836e93c1ea3afcab89b5 /configure.ac | |
parent | b9cd233f49f384ea4b8a91c5d1734aae3172bcae (diff) |
build-sys: support non-git versions of libcgroup
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 044dc6febb..f4e10367e0 100644 --- a/configure.ac +++ b/configure.ac @@ -65,7 +65,23 @@ PKG_CHECK_MODULES(GTK, [ gtk+-2.0 ]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) -PKG_CHECK_MODULES(CGROUP, [ libcgroup ]) +PKG_CHECK_MODULES( CGROUP, [ libcgroup >= 0.35 ], [], + [AC_CHECK_HEADER( [libcgroup.h], [], [AC_MSG_ERROR([*** libcgroup.h not found])], ) + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + CGROUP_LIBS=${CGROUP_LIBS:--lcgroup} + LIBS="$LIBS $CGROUP_LIBS" + CPPFLAGS="$CPPFLAGS $CGROUP_CFLAGS" + AC_MSG_CHECKING([for libcgroup >= 0.35]) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include <libcgroup.h>]], [[ CGFLAG_DELETE_RECURSIVE; cgroup_init(); ]])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]); AC_MSG_ERROR([*** systemd needs libcgroup 0.35 or newer])], + [${CGROUP_LIBS}]) + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + ]) + AC_SUBST(CGROUP_CFLAGS) AC_SUBST(CGROUP_LIBS) |