aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/pi-blaster/files/0001-handle-install-data-hook-when-cross-compile.patch
blob: 2f2a7f4c0bb071cd50808c4fb1c42803b6120e86 (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
From 28e4bc3216f8845cf278f0fbc6b2c30eebcc35aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petter=20Mab=C3=A4cker?= <petter@technux.se>
Date: Sun, 7 Jun 2015 17:17:01 +0200
Subject: [PATCH] handle install-data-hook when cross compile
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Avoid doing 'install-data-hook' when cross compiling since it isn't
suitable to update rc.d or run the service when cross
compiling.

Upstream-Status: Pending

Signed-off-by: Petter Mabäcker <petter@technux.se>
---
 Makefile.am  | 4 +++-
 configure.ac | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 6693d46..935288f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,7 @@ else
 init_ddir = $(sysconfdir)/init.d
 init_d_SCRIPTS = pi-blaster.boot.sh
 
+if !CROSS_COMPILING
 install-data-hook:
 	update-rc.d pi-blaster.boot.sh defaults
 	$(init_ddir)/pi-blaster.boot.sh start
@@ -20,4 +21,5 @@ install-data-hook:
 uninstall-hook:
 	update-rc.d pi-blaster.boot.sh remove
 	killall pi-blaster
-endif
+endif # !CROSS_COMPILING
+endif # !HAVE_SYSTEMD
diff --git a/configure.ac b/configure.ac
index 5d0c1fa..aaf4465 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,7 @@ 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 ])
+AM_CONDITIONAL(CROSS_COMPILING, [test x"$cross_compiling" = x"yes" ])
 
 # Checks for programs.
 AC_PROG_CC
-- 
1.9.1