chiark / gitweb /
Add support for building elogind against musl libc
[elogind.git] / configure.ac
index 8eb72842de950727ab9d42d3ca5510824482a994..d410162462428cf398a9078c0f8c99819a266475 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([elogind],
-        [226.1],
+        [226.2],
         [https://github.com/elogind/elogind/issues],
         [elogind],
         [https://github.com/elogind/elogind])
@@ -114,9 +114,9 @@ fi
 # Find running cgroup controller
 with_cgroupctrl=
 AS_IF(  [test -f /proc/self/cgroup],
-        [with_cgroupctrl=`grep "^1:" /proc/self/cgroup | cut -d ':' -f 2`])
+        [with_cgroupctrl=`grep "^1:name=" /proc/self/cgroup | cut -d ':' -f 2`])
 AS_IF(  [test -z "$with_cgroupctrl"],
-        AC_MSG_ERROR([No running cgroup controller found]))
+        [with_cgroupctrl="name=elogind"])
 
 
 # ------------------------------------------------------------------------------
@@ -243,7 +243,8 @@ AC_CHECK_SIZEOF(rlim_t,,[
 ])
 
 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>
@@ -261,6 +262,7 @@ AC_COMPILE_IFELSE(
                 [AC_MSG_ERROR([** unable to determine gperf len type])]
         )]
 )
+CFLAGS="$save_CFLAGS"
 
 AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
 
@@ -296,6 +298,13 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 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], [], [])