1From c41653e856d05ed430d22f8b311714ff756a0e0b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 23 Mar 2023 18:05:27 -0700
4Subject: [PATCH] cmake: Do not check for upstart on build host
5
6Some ubuntu distros might have this directory /usr/share/upstart around
7and yocto based distros not using systemd will process this piece of
8code and falsely assume that target supports upstart, which may not be
9true in case of cross-compilation.
10
11This also can end up in configure errors e.g.
12
13| CMake Error at src/CMakeLists.txt:496 (install):
14|   install DIRECTORY given unknown argument "/etc/td-agent-bit/".
15|
16|
17| -- Configuring incomplete, errors occurred!
18
19Upstream-Status: Inappropriate [ Cross-compile Specific ]
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21---
22 src/CMakeLists.txt | 8 --------
23 1 file changed, 8 deletions(-)
24
25diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
26index bb30b2a..c63b6d8 100644
27--- a/src/CMakeLists.txt
28+++ b/src/CMakeLists.txt
29@@ -486,14 +486,6 @@ if(FLB_BINARY)
30       )
31     install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_UNITDIR})
32     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
33-  elseif(IS_DIRECTORY /usr/share/upstart)
34-    set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
35-    configure_file(
36-      "${PROJECT_SOURCE_DIR}/init/upstart.in"
37-      ${FLB_UPSTART_SCRIPT}
38-      )
39-    install(FILES ${FLB_UPSTART_SCRIPT} COMPONENT binary DESTINATION /etc/init)
40-    install(DIRECTORY DESTINATION COMPONENT binary ${FLB_INSTALL_CONFDIR})
41   else()
42     # FIXME: should we support Sysv init script ?
43   endif()
44--
452.40.0
46
47