]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
build: fix bininstall launchd issue on cross-platform build
authorSergey V. Lobanov <sergey@lobanov.in>
Fri, 18 Feb 2022 21:59:02 +0000 (00:59 +0300)
committerSean Bright <sean@seanbright.com>
Sun, 24 Jul 2022 16:52:20 +0000 (11:52 -0500)
configure script detects /sbin/launchd, but the result of this
check is not used in Makefile (bininstall). Makefile also detects
/sbin/launchd file to decide if it is required to install
safe_asterisk.

configure script correctly detects cross compile build and sets
PBX_LAUNCHD=0

In case of building asterisk on MacOS host for Linux target using
external toolchain (e.g. OpenWrt toolchain), bininstall does not
install safe_asterisk (due to /sbin/launchd detection in Makefile),
but it is required on target (Linux).

This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
use the result of /sbin/launchd detection from configure script in
Makefile.
Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
decide if it is required to install safe_asterisk.

ASTERISK-29905 #close

Change-Id: Iff61217276cd188f43f51ef4cdbffe39d9f07f65

Makefile
makeopts.in

index 2c8fb97e8847268d9af6e882e034864ead3c0452..fb06f714d326908c45bb7865fd2484f5dbd6de89 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -561,9 +561,9 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall
        $(INSTALL) -m 755 contrib/scripts/astversion "$(DESTDIR)$(ASTSBINDIR)/"
        $(INSTALL) -m 755 contrib/scripts/astgenkey "$(DESTDIR)$(ASTSBINDIR)/"
        $(INSTALL) -m 755 contrib/scripts/autosupport "$(DESTDIR)$(ASTSBINDIR)/"
-       if [ ! -f /sbin/launchd ]; then \
-               ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk"; \
-       fi
+ifneq ($(HAVE_SBIN_LAUNCHD),1)
+       ./build_tools/install_subst contrib/scripts/safe_asterisk "$(DESTDIR)$(ASTSBINDIR)/safe_asterisk";
+endif
 
 ifneq ($(DISABLE_XMLDOC),yes)
        $(INSTALL) -m 644 doc/core-*.xml "$(DESTDIR)$(ASTDATADIR)/documentation"
index 54eaa04a630e159d3048c1c97ffd505c6fbf3089..e99cd502a60285f2751d399585848de97c4473f7 100644 (file)
@@ -350,3 +350,5 @@ SNDFILE_LIB=@SNDFILE_LIB@
 
 BEANSTALK_INCLUDE=@BEANSTALK_INCLUDE@
 BEANSTALK_LIB=@BEANSTALK_LIB@
+
+HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@