aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/openlldp/files/0001-autotools-Add-option-to-disable-installation-of-syst.patch
blob: b1d746f8bc5e05b007788742b87c7119ad94cd23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 7147add9fedfb28909639ae419f995041d086266 Mon Sep 17 00:00:00 2001
From: Jonathan Richardson <jonathan.richardson@broadcom.com>
Date: Fri, 6 Apr 2018 10:49:04 -0700
Subject: [PATCH] autotools: Add option to disable installation of systemd conf
 files

Add option to configure.ac to enable or disable install of systemd conf
files. If --with-systemdsystemunitdir is passed to configure then the
files will be installed to the provided directory. If the option isn't
provided then the value is determined from the systemd pkgconfig file,
if found in PKG_CONFIG_PATH.

This change is required because Makefile.am always installed the files
to a hard coded path that couldn't be changed.


Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
---
Upstream-Status: Pending

 Makefile.am  | 3 ++-
 configure.ac | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 86174e9..e90e966 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -141,8 +141,9 @@ install-data-hook:	installdirs-local
 pkgconfigdir = ${libdir}/pkgconfig
 pkgconfig_DATA = lldpad.pc liblldp_clif.pc
 
-systemdsystemunitdir = $(prefix)/lib/systemd/system
+if HAVE_SYSTEMD
 dist_systemdsystemunit_DATA = lldpad.service lldpad.socket
+endif
 
 bashcompletiondir = $(sysconfdir)/bash_completion.d
 dist_bashcompletion_DATA = contrib/bash_completion/lldpad contrib/bash_completion/lldptool
diff --git a/configure.ac b/configure.ac
index fa2f3a0..1a038cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,6 +132,15 @@ AC_TYPE_UINT16_T
 AC_TYPE_UINT32_T
 AC_TYPE_UINT8_T
 
+# Support for systemd unit files.
+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])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
 AC_CONFIG_FILES([Makefile include/version.h lldpad.spec lldpad.pc liblldp_clif.pc])
 AC_CONFIG_MACRO_DIR([m4])
 AC_OUTPUT