Skip to contentSkip to conversation

configure: don't silently disable systemd support

PATCH Superseded Wei Liu 2 participants 4 messages Sep 9, 2015 – Sep 10, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 configure: don't silently disable systemd support

Originally when user runs ./configure --enable-systemd and systemd development library is not available the build system silently disables systemd support. This is not in line with normal expectation.

Instead, configure should error out when user has asked for systemd support but development libraries can't be found.

---
Please rerun ./autogen.sh.

---
 m4/systemd.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
m4/systemd.m4 +5 -1
index 8284993..84508a1 100644
@@ -85,7 +85,11 @@ AC_DEFUN([AX_CHECK_SYSTEMD], [
 		AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and enabled])
 			systemd=y
 			AX_CHECK_SYSTEMD_LIBS()
-	    ],[systemd=n])
+	    ],[
+		AS_IF([test "x$enable_systemd" != "x"],
+			[AC_MSG_ERROR([Unable to find systemd development library])],
+			[systemd=n])
+	    ])
 	],[systemd=n])
 ])
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 20 lines · Wei Liu

Originally when user runs ./configure --enable-systemd and systemd development library is not available the build system silently disables systemd support. This is not in line with normal expectation.

Instead, configure should error out when user has asked for systemd support but development libraries can't be found.

---
Please rerun ./autogen.sh.

---
 m4/systemd.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
m4/systemd.m4 +0 -0
index 8284993..84508a1 100644

m4/systemd.m4 AC_DEFUN([AX_CHECK_SYSTEMD], [ · line 90

Quoted 7 lines
m4/systemd.m4 +2 -1
@@ -85,7 +85,11 @@ AC_DEFUN([AX_CHECK_SYSTEMD], [
 		AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and
 enabled])
 			systemd=y
 			AX_CHECK_SYSTEMD_LIBS()
-	    ],[systemd=n])
+	    ],[
+> 	> 	> AS_IF([test "x$enable_systemd" != "x"],

At this point the value of enable_systemd is either empty or ...what...? I think "yes"?, with "no" having been ruled out earlier?

Or can it be just "y"?

I could live with this version, but I think it would be less of a brain ben der if the check was inverted to be "x$enable_systemd" = "xyes" i.e. more explicit.

Ian.

author
#2 lore raw
Quoted 32 lines · Ian Campbell
Quoted 20 lines · Wei Liu

Originally when user runs ./configure --enable-systemd and systemd development library is not available the build system silently disables systemd support. This is not in line with normal expectation.

Instead, configure should error out when user has asked for systemd support but development libraries can't be found.

---
Please rerun ./autogen.sh.

---
 m4/systemd.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
m4/systemd.m4 +0 -0
index 8284993..84508a1 100644

m4/systemd.m4 AC_DEFUN([AX_CHECK_SYSTEMD], [ · line 90

Quoted 7 lines
m4/systemd.m4 +2 -1
@@ -85,7 +85,11 @@ AC_DEFUN([AX_CHECK_SYSTEMD], [
 		AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and
 enabled])
 			systemd=y
 			AX_CHECK_SYSTEMD_LIBS()
-	    ],[systemd=n])
+	    ],[
+> 	> 	> AS_IF([test "x$enable_systemd" != "x"],

At this point the value of enable_systemd is either empty or ...what...? I think "yes"?, with "no" having been ruled out earlier?

Quoted 2 lines

Or can it be just "y"?

At this point, it can't be no. It's either empty or "yes" (or "y"?). I printed it out when I wrote this patch but could remember exactly what it was.

Quoted 4 lines

I could live with this version, but I think it would be less of a brain ben der if the check was inverted to be "x$enable_systemd" = "xyes" i.e. more explicit.

I can do that as well. V2 coming soon.

Wei.

Quoted 1 line

Ian.

author
#3 lore raw
Quoted 33 lines · Wei Liu
Quoted 32 lines · Ian Campbell
Quoted 20 lines · Wei Liu

Originally when user runs ./configure --enable-systemd and systemd development library is not available the build system silently disables systemd support. This is not in line with normal expectation.

Instead, configure should error out when user has asked for systemd support but development libraries can't be found.

---
Please rerun ./autogen.sh.

---
 m4/systemd.m4 | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
m4/systemd.m4 +0 -0
index 8284993..84508a1 100644

m4/systemd.m4 AC_DEFUN([AX_CHECK_SYSTEMD], [ · line 90

Quoted 7 lines
m4/systemd.m4 +2 -1
@@ -85,7 +85,11 @@ AC_DEFUN([AX_CHECK_SYSTEMD], [
 		AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and
 enabled])
 			systemd=y
 			AX_CHECK_SYSTEMD_LIBS()
-	    ],[systemd=n])
+	    ],[
+> 	> 	> AS_IF([test "x$enable_systemd" != "x"],

At this point the value of enable_systemd is either empty or ...what...? I think "yes"?, with "no" having been ruled out earlier?

Quoted 4 lines
Quoted 2 lines

Or can it be just "y"?

At this point, it can't be no. It's either empty or "yes" (or "y"?). I

For the record, it was "yes".