From a12d12a0089c012a9fa2f17c094f4555b8371be4 Mon Sep 17 00:00:00 2001 From: Craig Comstock Date: Thu, 11 Jan 2024 14:59:24 -0600 Subject: [PATCH] In configure.ac, force with-systemd-socket=no when with-systemd-service=no Previously --with-systemd-socket is defaulted to true always. If a system has libsystemd-dev and configure is called with --with-systemd-service=no the build would fail. Ticket: CFE-4274 Changelog: none --- configure.ac | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index c8bbde60ad..61d834039e 100644 --- a/configure.ac +++ b/configure.ac @@ -525,19 +525,6 @@ dnl defined for libntech AC_DEFINE(WITH_PCRE2, 1, [Define if PCRE2 is being used]) -dnl systemd-socket activation - -AC_ARG_WITH([systemd-socket], [AS_HELP_STRING([--with-systemd-socket[[=PATH]]], [support systemd socket activation])], [], [with_systemd_socket=check]) - - -if test "x$with_systemd_socket" != xno -then - CF3_WITH_LIBRARY(systemd_socket, [ - AC_CHECK_LIB(systemd, sd_listen_fds, [], [if test "x$with_systemd_socket" != xcheck; then AC_MSG_ERROR(Cannot find systemd library); fi]) - AC_CHECK_LIB(systemd, sd_notify_barrier, [AC_DEFINE([HAVE_SD_NOTIFY_BARRIER],[1],[sd_notify_barrier on recent systemd])]) - AC_CHECK_HEADERS(systemd/sd-daemon.h, [], [if test "x$with_systemd_socket" != xcheck; then AC_MSG_ERROR(Cannot find systemd headers); fi]) - ]) -fi dnl libvirt @@ -1611,6 +1598,22 @@ else fi AC_SUBST([OS_ENVIRONMENT_PATH]) +dnl systemd-socket activation + +AC_ARG_WITH([systemd-socket], [AS_HELP_STRING([--with-systemd-socket[[=PATH]]], [support systemd socket activation])], [], [with_systemd_socket=check]) + +dnl ######################################################################## +dnl systemd socket feature, only available if systemd init scripts requested +dnl ######################################################################## +if test "x$with_systemd_service" != xno && test "x$with_systemd_socket" != xno +then + CF3_WITH_LIBRARY(systemd_socket, [ + AC_CHECK_LIB(systemd, sd_listen_fds, [], [if test "x$with_systemd_socket" != xcheck; then AC_MSG_ERROR(Cannot find systemd library); fi]) + AC_CHECK_LIB(systemd, sd_notify_barrier, [AC_DEFINE([HAVE_SD_NOTIFY_BARRIER],[1],[sd_notify_barrier on recent systemd])]) + AC_CHECK_HEADERS(systemd/sd-daemon.h, [], [if test "x$with_systemd_socket" != xcheck; then AC_MSG_ERROR(Cannot find systemd headers); fi]) + ]) +fi + dnl ##################################################################### dnl SELinux policy build and installation dnl #####################################################################