From 25a3cb98b54e071867d598350be9512cb5be62b6 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 16 Jan 2026 11:18:08 +0100 Subject: [PATCH 1/4] build: replace open-coded `if` in configure.ac with `AS_IF` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manual says: "This macro should be used instead of plain ‘if’ in code outside of an ‘AC_DEFUN’ macro, when the contents of the ‘if’ use ‘AC_REQUIRE’ directly or indirectly". Since one cannot know whether something is going to be AC_REQUIRED indirectly, it is safer to just always use AS_IF. Signed-off-by: Jan Engelhardt --- configure.ac | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 36ed1d0..8bf5a78 100644 --- a/configure.ac +++ b/configure.ac @@ -18,11 +18,11 @@ AM_MAINTAINER_MODE([enable]) GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])) -if test -n "$with_dbus_sys_dir" ; then +AS_IF([test -n "$with_dbus_sys_dir"], [ DBUS_SYS_DIR="$with_dbus_sys_dir" -else +], [ DBUS_SYS_DIR="/etc/dbus-1/system.d" -fi +]) AC_SUBST(DBUS_SYS_DIR) # paths @@ -34,9 +34,9 @@ PKG_PROG_PKG_CONFIG AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) -if test "x$with_systemdsystemunitdir" != xno; then +AS_IF(["x$with_systemdsystemunitdir" != xno], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) -fi +]) AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) From e9b343e0939fb2e8581b5ee13f0c26803502de88 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 16 Jan 2026 11:21:27 +0100 Subject: [PATCH 2/4] build: avoid use of `test ... -a` The use of `-a` is non-portable, and it has been actively removed from POSIX.1-2024 . Signed-off-by: Jan Engelhardt --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8bf5a78..4f79d86 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AS_IF(["x$with_systemdsystemunitdir" != xno], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ]) -AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" && test "x$with_systemdsystemunitdir" != xno]) # print configuration echo From cccbdc895cac82660f79e83d5105a4d9a4cd2a01 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 16 Jan 2026 11:41:50 +0100 Subject: [PATCH 3/4] build: fix spello in error message when libsystemd is absent Signed-off-by: Jan Engelhardt --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4f79d86..d35d75b 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ PKG_CHECK_MODULES(libnlgenl30, [libnl-genl-3.0], libnlgenl30=yes, libnlgenl30=no PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], [PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [], - AC_MSG_ERROR([libsystemd support requested but found]))]) + AC_MSG_ERROR([libsystemd support requested but not found]))]) PKG_CHECK_MODULES(UPOWER, upower-glib) From f2dd79bb36211b6f29b6ba93e33185155048a39b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 16 Jan 2026 11:43:09 +0100 Subject: [PATCH 4/4] build: apply consistent argument quoting in configure.ac Signed-off-by: Jan Engelhardt --- configure.ac | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index d35d75b..b212c4d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_PREREQ(1.0) +AC_PREREQ([1.0]) m4_define([lpmd_major_version], [0]) m4_define([lpmd_minor_version], [1.0]) @@ -9,7 +9,7 @@ AC_INIT([intel_lpmd], [lpmd_version], [], [intel_lpmd]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_AUX_DIR(build-aux) +AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.11 foreign no-define subdir-objects]) @@ -17,28 +17,28 @@ AM_MAINTAINER_MODE([enable]) GTK_DOC_CHECK([1.11],[--flavour no-tmpl]) -AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])) +AC_ARG_WITH([dbus-sys-dir], [AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is])]) AS_IF([test -n "$with_dbus_sys_dir"], [ DBUS_SYS_DIR="$with_dbus_sys_dir" ], [ DBUS_SYS_DIR="/etc/dbus-1/system.d" ]) -AC_SUBST(DBUS_SYS_DIR) +AC_SUBST([DBUS_SYS_DIR]) # paths -AC_SUBST(lpmd_binary, "$sbindir/$PACKAGE", [Binary executable]) -AC_SUBST(lpmd_confdir, "$sysconfdir/$PACKAGE", [Configuration directory]) -AC_SUBST(lpmd_rundir, "$localstatedir/run/$PACKAGE", [Runtime state directory]) +AC_SUBST([lpmd_binary], ["$sbindir/$PACKAGE"], [Binary executable]) +AC_SUBST([lpmd_confdir], ["$sysconfdir/$PACKAGE"], [Configuration directory]) +AC_SUBST([lpmd_rundir], ["$localstatedir/run/$PACKAGE"], [Runtime state directory]) PKG_PROG_PKG_CONFIG AC_ARG_WITH([systemdsystemunitdir], - AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), - [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) + [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])], + [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) AS_IF(["x$with_systemdsystemunitdir" != xno], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ]) -AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" && test "x$with_systemdsystemunitdir" != xno]) +AM_CONDITIONAL([HAVE_SYSTEMD], [test -n "$with_systemdsystemunitdir" && test "x$with_systemdsystemunitdir" != xno]) # print configuration echo @@ -52,26 +52,26 @@ echo " lpmd_rundir: $lpmd_rundir" echo GETTEXT_PACKAGE=intel_lpmd -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) +AC_SUBST([GETTEXT_PACKAGE]) +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package]) GLIB_VERSION_DEFINES="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26" -PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.22 gmodule-2.0 glib-2.0 gobject-2.0) +PKG_CHECK_MODULES([GLIB], [gio-unix-2.0 >= 2.22 gmodule-2.0 glib-2.0 gobject-2.0]) GLIB_CFLAGS="$GLIB_CFLAGS $GLIB_VERSION_DEFINES" -AC_SUBST(GLIB_CFLAGS) -AC_SUBST(GLIB_LIBS) +AC_SUBST([GLIB_CFLAGS]) +AC_SUBST([GLIB_LIBS]) -PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.4) +PKG_CHECK_MODULES([XML], [libxml-2.0 >= 2.4]) -PKG_CHECK_MODULES(libnl30, [libnl-3.0], libnl30=yes, libnl30=no) -PKG_CHECK_MODULES(libnlgenl30, [libnl-genl-3.0], libnlgenl30=yes, libnlgenl30=no) +PKG_CHECK_MODULES([libnl30], [libnl-3.0], [libnl30=yes], [libnl30=no]) +PKG_CHECK_MODULES([libnlgenl30], [libnl-genl-3.0], libnlgenl30=yes, libnlgenl30=no) PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], [PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [], - AC_MSG_ERROR([libsystemd support requested but not found]))]) + [AC_MSG_ERROR([libsystemd support requested but not found])])]) -PKG_CHECK_MODULES(UPOWER, upower-glib) +PKG_CHECK_MODULES([UPOWER], [upower-glib]) AC_PATH_PROG([GDBUS_CODEGEN],[gdbus-codegen]) @@ -81,14 +81,14 @@ AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T -AC_ARG_ENABLE(werror, AS_HELP_STRING([--disable-werror], [Disable -Werror])) +AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Disable -Werror])]) AS_IF([test "x$enable_werror" != "xno"], [CFLAGS="$CFLAGS -Werror"]) AC_CONFIG_FILES([Makefile data/Makefile tools/Makefile]) -AC_ARG_ENABLE(gdbus, +AC_ARG_ENABLE([gdbus], [AS_HELP_STRING([--disable-gdbus], [Switch DBus backend to glib-dbus. (Default: GDBus)])], [],