[systemd-devel] [PATCH] man/daemon: Use pkg-config as default for --with-systemdsystemunitdir

Dave Reisner d at falconindy.com
Mon Jun 27 06:28:59 PDT 2011


Behavior is such that:

* if --with-systemdsystemunitdir is specified without arguments, it
  tries to autodetect it using pkg-config
* if --without-systemdsystemunitdir is specified, it does nothing
* if --with-systemdsystemunitdir is specified with an argument, it
  uses that directory

Suggested-by: Balazs Scheidler <bazsi at balabit.hu>
---
This is basically a convenience for development builds of daemons outside the
realm of a package manager where systemd is installed. We're already calling
pkg-config in the help string, but the default value is never assigned. As an
example, if you configure udev with no argument to --with-ssud, it's defined as
"yes" and no units are ever installed.

 man/daemon.xml |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/man/daemon.xml b/man/daemon.xml
index d5a8491..6c34200 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -785,8 +785,15 @@
 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
-        AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+if test "x$with_systemdsystemunitdir" = "xyes"; then
+        systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd);
+        if test "$systemdsystemunitdir" = ""; then
+                AC_MSG_ERROR([Error autodetecting systemdsystemunitdir, systemd pkg-config file not found?])
+        fi
+elif test "$systemdsystemunitdir" = "no"; then
+        systemdsystemunitdir=""
+else
+        systemdsystemunitdir="$with_systemdsystemunitdir"
 fi
 AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])</programlisting>
 
-- 
1.7.5.4



More information about the systemd-devel mailing list