Skip to contentSkip to conversation

systemd: allow --with-systemd to take a path arg

PATCH In review Joe MacDonald 2 participants 2 messages Nov 1, 2013 – Nov 19, 2013 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: allow --with-systemd to take a path arg

If building for a cross-compile environment with systemd it is convenient to be able to specify a systemd path for the target that may not be the same as that on the host.

---

I encountered a problem while working with autofs in a cross-compile environment where the host and target have either differing systemd paths or where one may not have systemd support at all. The common solution I've seen in other projects is to have a --with-systemddir=[path] option, but I thought it'd be simpler to add an optional path argument to the extant '--with-systemd' configure parameter and leave the default =y+probe for path logic in place.

 aclocal.m4 |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
aclocal.m4 +8 -2
index 3e6f223..105e3e9 100644
@@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory
 dnl --------------------------------------------------------------------------
 AC_DEFUN([AF_WITH_SYSTEMD],
 [AC_ARG_WITH(systemd,
-[  --with-systemd         install systemd unit file if systemd unit directory
-			  is found on system],
+[  --with-systemd@<:@=systemddir@:>@  install systemd unit file.  If 'yes'
+			  probe the system for unit directory.
+			  If a path is specified, assume that
+			  is a valid install path.],
 [if test "$withval" = yes; then
   if test -z "$systemddir"; then
     AC_MSG_CHECKING([location of the systemd unit files directory])
@@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD],
   else
     AC_MSG_RESULT(not found)
   fi
+else
+ if test "$withval" != no; then
+  systemddir=$withval
+ fi
 fi])
 ])
 
Signature · 1 line
1.7.10.4
maintainer
#1 lore raw
Quoted 3 lines · Joe MacDonald

If building for a cross-compile environment with systemd it is convenient to be able to specify a systemd path for the target that may not be the same as that on the host.

There was a similar request recently which I didn't act on. There was a bit more to it than this one.

Hopefully adding this will cover the needs of the other request too. I've added the patch to my queue of patches and it will get committed next time I push changes, not sure when that will be though.

Quoted 43 lines

---

I encountered a problem while working with autofs in a cross-compile environment where the host and target have either differing systemd paths or where one may not have systemd support at all. The common solution I've seen in other projects is to have a --with-systemddir=[path] option, but I thought it'd be simpler to add an optional path argument to the extant '--with-systemd' configure parameter and leave the default =y+probe for path logic in place.

 aclocal.m4 |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
aclocal.m4 +8 -2
index 3e6f223..105e3e9 100644
@@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory
 dnl --------------------------------------------------------------------------
 AC_DEFUN([AF_WITH_SYSTEMD],
 [AC_ARG_WITH(systemd,
-[  --with-systemd         install systemd unit file if systemd unit directory
-			  is found on system],
+[  --with-systemd@<:@=systemddir@:>@  install systemd unit file.  If 'yes'
+			  probe the system for unit directory.
+			  If a path is specified, assume that
+			  is a valid install path.],
 [if test "$withval" = yes; then
   if test -z "$systemddir"; then
     AC_MSG_CHECKING([location of the systemd unit files directory])
@@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD],
   else
     AC_MSG_RESULT(not found)
   fi
+else
+ if test "$withval" != no; then
+  systemddir=$withval
+ fi
 fi])
 ])