From: David M. Lee Date: Thu, 18 Sep 2014 15:07:12 +0000 (+0000) Subject: Only install dahdi_span_config_hook if DAHDI is enabled X-Git-Tag: 14.0.0-beta1~1653 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b89491e39c130811d21e3c1229112f732837647d;p=thirdparty%2Fasterisk.git Only install dahdi_span_config_hook if DAHDI is enabled This patch changes the install to only install the hook script if DAHDI is enabled. It also adds the script to the uninstall task, and moves the DAHDI_UDEV_HOOK_DIR variable so that it's not between the _MAKEOPTS variables and their comment. This allows installs which specify a --prefix to work normally, as long as they don't enable DAHDI. Review: https://reviewboard.asterisk.org/r/3972/ ........ Merged revisions 423281 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423283 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/Makefile b/Makefile index 886f976f8d..2602d6dc51 100644 --- a/Makefile +++ b/Makefile @@ -151,14 +151,15 @@ LINKER_SYMBOL_PREFIX= # Uncomment this to use the older DSP routines #_ASTCFLAGS+=-DOLD_DSP_ROUTINES +# Default install directory for DAHDI hooks. +DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d + # If the file .asterisk.makeopts is present in your home directory, you can # include all of your favorite menuselect options so that every time you download # a new version of Asterisk, you don't have to run menuselect to set them. # The file /etc/asterisk.makeopts will also be included but can be overridden # by the file in your home directory. -DAHDI_UDEV_HOOK_DIR = /usr/share/dahdi/span_config.d - GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts) USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts) @@ -591,8 +592,10 @@ bininstall: _all installdirs $(SUBDIRS_INSTALL) main-bininstall if [ -f contrib/firmware/iax/iaxy.bin ] ; then \ $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin "$(DESTDIR)$(ASTDATADIR)/firmware/iax/iaxy.bin"; \ fi +ifeq ($(HAVE_DAHDI),1) $(INSTALL) -d $(DESTDIR)/$(DAHDI_UDEV_HOOK_DIR) $(INSTALL) -m 644 contrib/scripts/dahdi_span_config_hook $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk +endif $(SUBDIRS_INSTALL): +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install @@ -870,6 +873,9 @@ _uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall rm -f "$(DESTDIR)$(ASTMANDIR)/man8/astgenkey.8" rm -f "$(DESTDIR)$(ASTMANDIR)/man8/autosupport.8" rm -f "$(DESTDIR)$(ASTMANDIR)/man8/safe_asterisk.8" +ifeq ($(HAVE_DAHDI),1) + rm -f $(DESTDIR)$(DAHDI_UDEV_HOOK_DIR)/40-asterisk +endif $(MAKE) -C sounds uninstall uninstall: _uninstall diff --git a/makeopts.in b/makeopts.in index 3b3d2d92f7..5c3b605bd1 100644 --- a/makeopts.in +++ b/makeopts.in @@ -305,6 +305,7 @@ VORBIS_LIB=@VORBIS_LIB@ VPB_INCLUDE=@VPB_INCLUDE@ VPB_LIB=@VPB_LIB@ +HAVE_DAHDI=@PBX_DAHDI@ DAHDI_INCLUDE=@DAHDI_INCLUDE@ ZLIB_INCLUDE=@ZLIB_INCLUDE@