chiark / gitweb /
Make pam-config default to enabled
[elogind.git] / configure.ac
index df38297bfdf4c79841e4df290cd08084b891b214..9ec3390ff43042cd69e2bbcbfc9a99c4af651270 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([elogind],
-        [234],
+        [234.4],
         [https://github.com/elogind/elogind/issues],
         [elogind],
         [https://github.com/elogind/elogind])
@@ -247,14 +247,20 @@ AS_CASE([$CC], [*clang*],
         ])])
 
 # ------------------------------------------------------------------------------
+have_lto=no
 AC_ARG_ENABLE([lto], [AS_HELP_STRING([--disable-lto], [disable -flto])],
                      [], [enable_lto=yes])
 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
-        [AS_IF([test "x$enable_lto" = "xyes"],
-               [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])],
+        [AS_IF([test "x$enable_lto" = "xyes"], [have_lto=yes],
                [AC_MSG_RESULT([disabling -flto as requested])])],
         [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
 
+AS_IF([test "x$have_lto" = "xyes"],
+        [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS],
+        [-flto -fuse-linker-plugin])])
+
+AS_CASE([$with_cflags], [*-flto*], [], [have_lto=no])
+
 # ------------------------------------------------------------------------------
 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
         [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
@@ -279,8 +285,9 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
         -Wl,--no-undefined \
         -Wl,-z,relro \
         -Wl,-z,now \
-        -pie \
-        -Wl,-fuse-ld=gold])
+        -pie])
+AS_IF([test "x$have_lto" = "xyes"],
+        [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [-Wl,-fuse-ld=gold])])
 
 # ------------------------------------------------------------------------------
 AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
@@ -351,6 +358,7 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
 # ------------------------------------------------------------------------------
 
 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
+AC_CHECK_HEADERS([sys/mman.h], [], [])
 AC_CHECK_HEADERS([linux/memfd.h], [], [])
 AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
 
@@ -392,6 +400,9 @@ AC_CHECK_DECLS([
 #include <sched.h>
 #include <string.h>
 #include <linux/loop.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
 ]])
 
 AC_CHECK_DECLS([getrandom],
@@ -758,6 +769,12 @@ AC_ARG_WITH([rootlibdir],
         [with_rootlibdir=${libdir}])
 AX_NORMALIZE_PATH([with_rootlibdir])
 
+AC_ARG_WITH([rootlibexecdir],
+        AS_HELP_STRING([--with-rootlibexecdir=DIR], [Root directory for executables necessary for boot]),
+        [],
+        [with_rootlibexecdir=${with_rootprefix}/lib/elogind])
+AX_NORMALIZE_PATH([with_rootlibexecdir])
+
 AC_ARG_WITH([pamlibdir],
         AS_HELP_STRING([--with-pamlibdir=DIR], [directory for PAM modules]),
         [],
@@ -841,6 +858,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
 AC_SUBST([pamconfdir], [$with_pamconfdir])
 AC_SUBST([rootprefix], [$with_rootprefix])
 AC_SUBST([rootlibdir], [$with_rootlibdir])
+AC_SUBST([rootlibexecdir], [$with_rootlibexecdir])
 AC_SUBST([cgroup_controller], [$with_cgroupctrl])
 
 AC_CONFIG_FILES([
@@ -865,6 +883,7 @@ AC_MSG_RESULT([
         test coverage: . . . . . . . . . . ${have_coverage}
         Split /usr: . . . . . . . . . . .  ${enable_split_usr}
         utmp/wtmp support: . . . . . . . . ${have_utmp}
+        Link time optimization: . . . . .  ${have_lto}
         extra debugging: . . . . . . . . . ${enable_debug}
         cgroup controller: . . . . . . . . ${with_cgroupctrl}
 
@@ -875,6 +894,7 @@ AC_MSG_RESULT([
         includedir: . . . . . . . . . . .  ${includedir}
         lib dir: . . . . . . . . . . . . . ${libdir}
         rootlib dir: . . . . . . . . . . . ${with_rootlibdir}
+        rootlibexec dir: . . . . . . . . . ${with_rootlibexecdir}
         PAM modules dir: . . . . . . . . . ${with_pamlibdir}
         PAM configuration dir: . . . . . . ${with_pamconfdir}
         D-Bus policy dir: . . . . . . . .  ${with_dbuspolicydir}