1 From: https://issues.asterisk.org/jira/browse/ASTERISK-29905
3 From d27d75ad8058f6ed35197737b949bac57202dd54 Mon Sep 17 00:00:00 2001
4 From: "Sergey V. Lobanov" <sergey@lobanov.in>
5 Date: Wed, 9 Feb 2022 01:29:46 +0300
6 Subject: [PATCH] build: fix bininstall launchd issue on cross-platfrom build
8 configure script detects /sbin/launchd, but the result of this
9 check is not used in Makefile (bininstall). Makefile also detects
10 /sbin/launchd file to decide if it is required to install
13 configure script correctly detects cross compile build and sets
16 In case of building asterisk on MacOS host for Linux target using
17 external toolchain (e.g. OpenWrt toolchain), bininstall does not
18 install safe_asterisk (due to /sbin/launchd detection in Makefile),
19 but it is required on target (Linux).
21 This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
22 use the result of /sbin/launchd detection from configure script in
24 Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
25 decide if it is required to install safe_asterisk.
27 Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
31 2 files changed, 5 insertions(+), 3 deletions(-)
35 @@ -558,9 +558,9 @@ bininstall: _all installdirs $(SUBDIRS_I
36 $(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
37 $(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
38 $(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
39 - if [ ! -f /sbin/launchd ]; then \
40 - ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \
42 +ifneq ($(HAVE_SBIN_LAUNCHD),1)
43 + ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk";
46 ifneq ($(DISABLE_XMLDOC),yes)
47 $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
50 @@ -373,3 +373,5 @@ SNDFILE_LIB=@SNDFILE_LIB@
52 BEANSTALK_INCLUDE=@BEANSTALK_INCLUDE@
53 BEANSTALK_LIB=@BEANSTALK_LIB@
55 +HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@