Skip to content

Commit

Permalink
fix(configure): rename cmdline option --with-systemd
Browse files Browse the repository at this point in the history
  Rename --with-systemd to --enable-systemd for consistency
  with the other optional boolean options.

Signed-off-by: Davide Madrisan <d.madrisan@proton.me>
  • Loading branch information
madrisan committed Jan 30, 2024
1 parent 789fff4 commit b48f8aa
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])])
Expand All @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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

0 comments on commit b48f8aa

Please sign in to comment.