AC_PREREQ([2.64])
AC_INIT([elogind],
- [234],
+ [234.4],
[https://github.com/elogind/elogind/issues],
[elogind],
[https://github.com/elogind/elogind])
])])
# ------------------------------------------------------------------------------
+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], [\
-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")
# ------------------------------------------------------------------------------
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>])
#include <sched.h>
#include <string.h>
#include <linux/loop.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
+#endif
]])
AC_CHECK_DECLS([getrandom],
[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]),
[],
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([
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}
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}