AC_PREREQ([2.64])
AC_INIT([elogind],
- [226],
+ [226.5],
[https://github.com/elogind/elogind/issues],
[elogind],
[https://github.com/elogind/elogind])
AC_MSG_ERROR([*** gperf not found])
fi
+
+# ------------------------------------------------------------------------------
+# Find running cgroup controller
+with_cgroupctrl=
+AS_IF( [test -f /proc/self/cgroup], [
+ # If the init system is a cgroup controler, it will be position 1.
+ # Secondary controllers, like cgmanager, do not work.
+ with_cgroupctrl=`grep "^1:name=" /proc/self/cgroup | cut -d ':' -f 2`
+ AS_IF( [test -z "$with_cgroupctrl"], [
+ # Try to be our own cgroup controller
+ with_cgroupctrl="name=elogind"
+ ])
+])
+AS_IF( [test -z "$with_cgroupctrl"],
+ AC_MSG_ERROR([No running cgroup controller found]))
+
+
# ------------------------------------------------------------------------------
address_sanitizer_cflags=
address_sanitizer_cppflags=
])
GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
-
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-error"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([
#include <string.h>
[AC_MSG_ERROR([** unable to determine gperf len type])]
)]
)
+CFLAGS="$save_CFLAGS"
AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
AC_CHECK_HEADERS([linux/btrfs.h], [], [])
AC_CHECK_HEADERS([linux/memfd.h], [], [])
+AC_CHECK_HEADERS([printf.h], [have_printf_h=yes], [have_printf_h=no])
+AS_IF([test x$have_printf_h = xyes], [
+ AC_DEFINE(HAVE_PRINTF_H, 1, [Define if printf.h was found])
+])
+
+
+
# unconditionally pull-in librt with old glibc versions
dnl AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
dnl AC_SEARCH_LIBS([mq_unlink], [rt], [], [])
AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
AC_ARG_ENABLE(debug,
- [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
+ [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (elogind,hashmap,mmap-cache)])],
[if test "x$enableval" = "xyes"; then
- enableval="hashmap,mmap-cache"
+ enableval="elogind,hashmap,mmap-cache"
fi
saved_ifs="$IFS"
IFS="$IFS$PATH_SEPARATOR,"
for name in $enableval; do
case $name in
+ elogind)
+ enable_debug_elogind=yes
+ ;;
hashmap)
enable_debug_hashmap=yes
;;
IFS="$saved_ifs"],[])
enable_debug=""
+AS_IF([test x$enable_debug_elogind = xyes], [
+ AC_DEFINE(ENABLE_DEBUG_ELOGIND, 1, [Define if elogind debugging is to be enabled])
+ enable_debug="elogind $enable_debug"
+])
AS_IF([test x$enable_debug_hashmap = xyes], [
AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
enable_debug="hashmap $enable_debug"
AC_SUBST([pamconfdir], [$with_pamconfdir])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
+AC_SUBST([cgroup_controller], [$with_cgroupctrl])
AC_CONFIG_FILES([
Makefile
test coverage: ${have_coverage}
Split /usr: ${enable_split_usr}
extra debugging: ${enable_debug}
+ cgroup controller: ${with_cgroupctrl}
prefix: ${prefix}
rootprefix: ${with_rootprefix}