X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=configure.ac;h=9ec3390ff43042cd69e2bbcbfc9a99c4af651270;hp=b4f6bb519285807bc556d22b9c97a1862133f48f;hb=HEAD;hpb=eaa952024d64e2e8211eb8861ad7141ad2f10b6d diff --git a/configure.ac b/configure.ac index b4f6bb519..9ec3390ff 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.64]) AC_INIT([elogind], - [233.3], + [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 ]) @@ -378,7 +386,6 @@ AC_CHECK_DECLS([ pivot_root, name_to_handle_at, setns, - getrandom, renameat2, kcmp, keyctl, @@ -393,6 +400,16 @@ AC_CHECK_DECLS([ #include #include #include +#ifdef HAVE_SYS_MMAN_H +#include +#endif +]]) + +AC_CHECK_DECLS([getrandom], + [AC_DEFINE([USE_SYS_RANDOM_H], [], [sys/random.h is usable])], + [AC_CHECK_DECLS([getrandom], [], [], [[ +#include +]])], [[ #include ]]) @@ -410,7 +427,8 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE, IFLA_PHYS_PORT_ID, IFLA_BOND_AD_INFO, IFLA_VLAN_PROTOCOL, - IFLA_VXLAN_REMCSUM_NOPARTIAL, + IFLA_VXLAN_GPE, + IFLA_GENEVE_LABEL, IFLA_IPTUN_ENCAP_DPORT, IFLA_GRE_ENCAP_DPORT, IFLA_BRIDGE_VLAN_INFO, @@ -452,6 +470,16 @@ AC_ARG_WITH([udevbindir], [with_udevbindir=$($PKG_CONFIG --variable=udevdir udev)]) AC_SUBST([udevbindir], [$with_udevbindir]) +# ------------------------------------------------------------------------------ +have_glib=no +AC_ARG_ENABLE(glib, AS_HELP_STRING([--disable-glib], [disable usage of glib,gobject,gio in tests])) +AS_IF([test "x$enable_glib" != "xno"], [ + PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0], + [AC_DEFINE(HAVE_GLIB, 1, [Define if glib,gobject,gio are available]) have_glib=yes], + [have_glib=no]) + AS_IF([test "x$have_glib" = "xno" -a "x$enable_glib" = "xyes"], + [AC_MSG_ERROR([*** glib support requested but libraries not found])])]) + # ------------------------------------------------------------------------------ have_utmp=yes AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]), @@ -459,7 +487,11 @@ AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log ha [xyes], [have_utmp=yes], [xno], [have_utmp=no], AC_MSG_ERROR(bad value ${enableval} for --enable-utmp))) -AS_IF([test "x$have_utmp" = "xyes"], [AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])]) +AS_IF([test "x$have_utmp" = "xyes"], [ + AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled]) + have_utmp=yes + M4_DEFINES="$M4_DEFINES -DHAVE_UTMP"], + [have_utmp=no]) AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"]) # ------------------------------------------------------------------------------ @@ -668,8 +700,14 @@ AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit supp if test "x$enable_polkit" != "xno"; then AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled]) have_polkit=yes + + # also enable support for *.pkla files on old polkit + PKG_CHECK_MODULES(POLKIT, [ polkit-gobject-1 < 0.106 ], + [polkit_pkla=yes], + [polkit_pkla=no]) fi AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"]) +AM_CONDITIONAL(ENABLE_POLKIT_PKLA, [test "x$polkit_pkla" = "xyes"]) # ------------------------------------------------------------------------------ AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h]) @@ -731,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]), [], @@ -814,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([ @@ -823,7 +868,7 @@ AC_CONFIG_FILES([ AC_OUTPUT AC_MSG_RESULT([ - $PACKAGE_NAME $VERSION + $PACKAGE_NAME $PACKAGE_VERSION PAM: . . . . . . . . . . . . . . . ${have_pam} SELinux: . . . . . . . . . . . . . ${have_selinux} @@ -831,12 +876,14 @@ AC_MSG_RESULT([ ACL: . . . . . . . . . . . . . . . ${have_acl} default cgroup hierarchy: . . . . ${DEFAULT_HIERARCHY} default KillUserProcesses setting: ${KILL_USER_PROCESSES} - polkit: . . . . . . . . . . . . . ${have_polkit} + polkit: . . . . . . . . . . . . . ${have_polkit} (legacy pkla support: ${polkit_pkla}) + glib: . . . . . . . . . . . . . . ${have_glib} Python: . . . . . . . . . . . . . ${have_python} man pages: . . . . . . . . . . . . ${have_manpages} 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} @@ -847,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}