summaryrefslogtreecommitdiff
blob: f47319dcd39a8475e354aa00fe6b16dd86ed4274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
https://github.com/madrisan/nagios-plugins-linux/commit/63914284097e3a59e3407bf894376b859a0d1a2e

From 63914284097e3a59e3407bf894376b859a0d1a2e Mon Sep 17 00:00:00 2001
From: Davide Madrisan <d.madrisan@proton.me>
Date: Tue, 30 Jan 2024 18:57:16 +0100
Subject: [PATCH] fix(configure): rename cmdline option --with-systemd

  Rename --with-systemd to --enable-systemd for consistency
  with the other optional boolean options.

Signed-off-by: Davide Madrisan <d.madrisan@proton.me>
--- a/configure.ac
+++ b/configure.ac
@@ -337,7 +337,7 @@ AC_CHECK_DECLS([CPU_ALLOC], [], [],
 
 dnl Check for libcurl
 AC_ARG_ENABLE([libcurl],
-  AS_HELP_STRING([--enable-libcurl], [Enable libcurl]))
+  AS_HELP_STRING([--enable-libcurl], [enable libcurl]))
 AS_IF([test "x$enable_libcurl" = "xyes"], [
   LIBCURL_CHECK_CONFIG([], [7.40.0], [],
     [AC_MSG_ERROR([Missing required libcurl >= 7.40.0])])
@@ -346,27 +346,9 @@ AS_IF([test "x$enable_libcurl" = "xyes"], [
   AM_CONDITIONAL(HAVE_LIBCURL, [test "$libcurl_cv_lib_curl_usable" = "yes"])
 ], [AM_CONDITIONAL(HAVE_LIBCURL, false)])
 
-dnl Check for systemd-login libraries
-AC_ARG_WITH([systemd],
-  AS_HELP_STRING([--without-systemd], [do not build with systemd support]),
-  [], [with_systemd=check]
-)
-have_systemd=no
-AS_IF([test "x$with_systemd" != "xno"], [
-  PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
-  AS_CASE([$with_systemd:$have_systemd],
-    [yes:no],
-      [AC_MSG_ERROR([systemd expected but libsystemd not found])],
-    [*:yes],
-       AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
-       AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted ])
-  )
-])
-AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"])
-
 dnl Check for libvarlink
 AC_ARG_ENABLE([libvarlink],
-  AS_HELP_STRING([--enable-libvarlink], [Enable libvarlink]))
+  AS_HELP_STRING([--enable-libvarlink], [enable libvarlink]))
 AS_IF([test "x$enable_libvarlink" = "xyes"], [
   PKG_CHECK_EXISTS([libvarlink],
     [PKG_CHECK_MODULES(LIBVARLINK, [libvarlink >= 18],
@@ -394,6 +376,24 @@ AS_IF([test "x$enable_libprocps" = "xyes"], [
 ])
 AM_CONDITIONAL(HAVE_LIBPROCPS, [test "$have_libprocps" = "yes"])
 
+dnl Check for systemd-login libraries
+AC_ARG_ENABLE([systemd],
+  AS_HELP_STRING([--enable-systemd], [enable systemd related features]),
+  [], [enable_systemd=check]
+)
+have_systemd=no
+AS_IF([test "x$enable_systemd" != "xno"], [
+  PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [have_systemd=yes], [have_systemd=no])
+  AS_CASE([$enable_systemd:$have_systemd],
+    [yes:no],
+      [AC_MSG_ERROR([systemd expected but libsystemd not found])],
+    [*:yes],
+       AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if libsystemd is available])
+       AC_DEFINE([USE_SYSTEMD], [1], [Define if systemd support is wanted])
+  )
+])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"])
+
 dnl Add the option '--with-proc-meminfo=PATH'
 AC_ARG_WITH(proc-meminfo,
   AS_HELP_STRING([--with-proc-meminfo=PATH],
@@ -604,3 +604,9 @@ if test "$have_libvarlink" = "yes"; then
   echo "  VARLINK_ADDRESS    = $VARLINK_ADDRESS"
   echo
 fi
+
+if test "$have_systemd" = "yes"; then
+  echo "Optional systemd library support is enabled:"
+  echo "  SYSTEMD_CFLAGS    = $SYSTEMD_CFLAGS"
+  echo "  SYSTEMD_LIBS      = $SYSTEMD_LIBS"
+fi