asterisk/Makefile

1166 lines
42 KiB
Makefile
Raw Normal View History

#
# Asterisk -- An open source telephony toolkit.
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
#
# Top level Makefile
#
# Copyright (C) 1999-2010, Digium, Inc.
#
# Mark Spencer <markster@digium.com>
#
# This program is free software, distributed under the terms of
# the GNU General Public License
#
# All Makefiles use the following variables:
#
# ASTCFLAGS - compiler options provided by the user (if any)
# _ASTCFLAGS - compiler options provided by the build system
# ASTLDFLAGS - linker flags (not libraries) provided by the user (if any)
# _ASTLDFLAGS - linker flags (not libraries) provided by the build system
# LIBS - additional libraries, at top-level for all links,
# on a single object just for that object
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
# SOLINK - linker flags used only for creating dynamically loadable modules
# as .so files
# DYLINK - linker flags used only for creating shared libraries
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
# (.so files on Unix-type platforms, .dylib on Darwin)
#
# Values for ASTCFLAGS and ASTLDFLAGS can be specified in the
# environment when running make, as follows:
#
# $ ASTCFLAGS="-Werror" make ...
#
# or as a variable value on the make command line itself:
#
# $ make ASTCFLAGS="-Werror" ...
export ASTTOPDIR # Top level dir, used in subdirs' Makefiles
export ASTERISKVERSION
export ASTERISKVERSIONNUM
#--- values used for default paths
# DESTDIR is the staging (or final) directory where files are copied
# during the install process. Define it before 'export', otherwise
# export will set it to the empty string making ?= fail.
# Trying to run asterisk from the DESTDIR is completely unsupported
# behavior.
# WARNING: do not put spaces or comments after the value.
DESTDIR?=$(INSTALL_PATH)
export DESTDIR
export INSTALL_PATH # Additional prefix for the following paths
export ASTCACHEDIR
export ASTETCDIR # Path for config files
export ASTVARRUNDIR
export ASTSPOOLDIR
export ASTVARLIBDIR
export ASTDATADIR
export ASTDBDIR
export ASTLOGDIR
export ASTLIBDIR
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
export ASTMODDIR
export ASTMANDIR
export ASTHEADERDIR
export ASTSBINDIR
export AGI_DIR
export ASTCONFPATH
export ASTKEYDIR
export OSARCH # Operating system
export NOISY_BUILD # Used in Makefile.rules
export MENUSELECT_CFLAGS # Options selected in menuselect.
export AST_DEVMODE # Set to "yes" for additional compiler
# and runtime checks
export AST_DEVMODE_STRICT # Enables shadow warnings (-Wshadow)
export _SOLINK # linker flags for all shared objects
export SOLINK # linker flags for loadable modules
export DYLINK # linker flags for shared libraries
#--- paths to various commands
# The makeopts include below tries to set these if they're found during
# configure.
export CC
export CXX
export AR
export RANLIB
export HOST_CC
export BUILD_CC
export INSTALL
export STRIP
export DOWNLOAD
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
export AWK
export GREP
export MD5
export WGET_EXTRA_ARGS
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
export LDCONFIG
export LDCONFIG_FLAGS
export PYTHON
export TAR
export PATCH
export SED
export NM
export FIND
export BASENAME
export DIRNAME
export XMLLINT
export XMLSTARLET
# makeopts is required unless the goal is just {dist{-}}clean
ifeq ($(MAKECMDGOALS),clean)
else ifeq ($(MAKECMDGOALS),distclean)
else ifeq ($(MAKECMDGOALS),dist-clean)
else
include makeopts
endif
# start the primary CFLAGS and LDFLAGS with any that were provided
# to the configure script
_ASTCFLAGS:=$(CONFIG_CFLAGS) $(CONFIG_SIGNED_CHAR)
_ASTLDFLAGS:=$(CONFIG_LDFLAGS)
# Some build systems, such as the one in openwrt, like to pass custom target
# CFLAGS and LDFLAGS in the COPTS and LDOPTS variables; these should also
# go before any build-system computed flags, since they are defaults, not
# overrides
_ASTCFLAGS+=$(COPTS)
_ASTLDFLAGS+=$(LDOPTS)
# libxml2 cflags
_ASTCFLAGS+=$(LIBXML2_INCLUDE)
# BIND_8_COMPAT
_ASTCFLAGS+=$(BIND8_CFLAGS)
#Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes
empty:=
space:=$(empty) $(empty)
ASTTOPDIR:=$(subst $(space),\$(space),$(CURDIR))
# Overwrite config files on "make samples" or other config installation targets
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
DEBUG=-g3
# Asterisk.conf is located in ASTETCDIR or by using the -C flag
# when starting Asterisk
ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
AGI_DIR=$(ASTDATADIR)/agi-bin
# If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
HTTP_DOCSDIR=/var/www/html
# Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
HTTP_CGIDIR=/var/www/cgi-bin
# If your platform's linker expects a prefix on symbols generated from compiling C
# source files, set LINKER_SYMBOL_PREFIX to that value. On some systems, exported symbols
# from C source files are prefixed with '_', for example. If this value is not set
# properly, the linker scripts that live in the '*.exports' files in various places
# in this tree will unintentionally suppress symbols that should be visible
# in the final binary objects.
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
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
# 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.
ifeq ($(wildcard menuselect.makeopts),)
USER_MAKEOPTS=$(wildcard ~/.asterisk.makeopts)
GLOBAL_MAKEOPTS=$(wildcard /etc/asterisk.makeopts)
else
USER_MAKEOPTS=
GLOBAL_MAKEOPTS=
endif
MOD_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
OTHER_SUBDIR_CFLAGS="-I$(ASTTOPDIR)/include"
# Create OPTIONS variable, but probably we can assign directly to ASTCFLAGS
OPTIONS=
ifeq ($(findstring -save-temps,$(_ASTCFLAGS) $(ASTCFLAGS)),)
ifeq ($(findstring -pipe,$(_ASTCFLAGS) $(ASTCFLAGS)),)
_ASTCFLAGS+=-pipe
endif
endif
ifeq ($(findstring -Wall,$(_ASTCFLAGS) $(ASTCFLAGS)),)
_ASTCFLAGS+=-Wall
endif
Add support for the clang compiler; update RAII_VAR to use BlocksRuntime RAII_VAR, which is used extensively in Asterisk to manage reference counted resources, uses a GCC extension to automatically invoke a cleanup function when a variable loses scope. While this functionality is incredibly useful and has prevented a large number of memory leaks, it also prevents Asterisk from being compiled with clang. This patch updates the RAII_VAR macro such that it can be compiled with clang. It makes use of the BlocksRuntime, which allows for a closure to be created that performs the actual cleanup. Note that this does not attempt to address the numerous warnings that the clang compiler catches in Asterisk. Much thanks for this patch goes to: * The folks on StackOverflow who asked this question and Leushenko for providing the answer that formed the basis of this code: http://stackoverflow.com/questions/24959440/rewrite-gcc-cleanup-macro-with-nested-function-for-clang * Diederik de Groot, who has been extremely patient in working on getting this patch into Asterisk. Review: https://reviewboard.asterisk.org/r/4370/ ASTERISK-24133 ASTERISK-23666 ASTERISK-20399 ASTERISK-20850 #close Reported by: Diederik de Groot patches: RAII_CLANG.patch uploaded by Diederik de Groot (License 6600) ........ Merged revisions 432807 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432808 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-12 12:40:23 +00:00
_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_NESTED_FUNCTIONS) $(AST_CLANG_BLOCKS) $(DEBUG)
ADDL_TARGETS=
ifeq ($(AST_DEVMODE),yes)
_ASTCFLAGS+=-Werror
_ASTCFLAGS+=-Wunused
_ASTCFLAGS+=$(AST_DECLARATION_AFTER_STATEMENT)
_ASTCFLAGS+=$(AST_TRAMPOLINES)
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
_ASTCFLAGS+=-Wundef
_ASTCFLAGS+=-Wmissing-format-attribute
_ASTCFLAGS+=-Wformat=2
ifeq ($(AST_DEVMODE_STRICT),yes)
_ASTCFLAGS+=-Wshadow
endif
ifneq ($(DISABLE_XMLDOC),yes)
ADDL_TARGETS+=validate-docs
endif
endif
ifeq ($(OSARCH),NetBSD)
_ASTCFLAGS+=-isystem /usr/pkg/include
else ifneq ($(findstring BSD,$(OSARCH)),)
_ASTCFLAGS+=-isystem /usr/local/include
endif
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
_ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
endif
ifeq ($(OSARCH),NetBSD)
_ASTCFLAGS+=-pthread -D__LIBPTHREAD_SOURCE__ -I/usr/pkg/include
endif
ifeq ($(OSARCH),OpenBSD)
_ASTCFLAGS+=-pthread -ftrampolines
endif
ifeq ($(OSARCH),linux-uclibc)
AST_LIBS+=-lpthread -ldl
endif
ifeq ($(OSARCH),SunOS)
_ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
endif
ifeq ($(GREP),)
else ifeq ($(GREP),:)
else
ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
endif
ifneq ($(AWK),)
ifneq ($(wildcard .version),)
ASTERISKVERSIONNUM:=$(shell $(SED) -e 's/^certified\///' -e 's/-cert/./' .version | $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}')
endif
endif
ifneq ($(wildcard .svn),)
ASTERISKVERSIONNUM:=999999
endif
ifneq ($(DISABLE_XMLDOC),yes)
CORE_XMLDOC=doc/core-en_US.xml
FULL_XMLDOC=doc/full-en_US.xml
else
CORE_XMLDOC=
FULL_XMLDOC=
endif
_ASTCFLAGS+=$(OPTIONS)
build-system: Allow building with static pjproject Background here: http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html From CHANGES: * To help insure that Asterisk is compiled and run with the same known version of pjproject, a new option (--with-pjproject-bundled) has been added to ./configure. When specified, the version of pjproject specified in third-party/versions.mak will be downloaded and configured. When you make Asterisk, the build process will also automatically build pjproject and Asterisk will be statically linked to it. Once a particular version of pjproject is configured and built, it won't be configured or built again unless you run a 'make distclean'. To facilitate testing, when 'make install' is run, the pjsua and pjsystest utilities and the pjproject python bindings will be installed in ASTDATADIR/third-party/pjproject. The default behavior remains building with the shared pjproject installation, if any. Building: All you have to do is include the --with-pjproject-bundled option on the ./configure command line (and remove any existing --with-pjproject option if specified). Everything else is automatic. Behind the scenes: The top-level Makefile was modified to include 'third-party' in the list of MOD_SUBDIRS. The third-party directory was created to contain any third party packages that may be needed in the future. Its Makefile automatically iterates over any subdirectories passing on targets. The third-party/pjproject directory was created to house the pjproject source distribution. Its Makefile contains targets to download, patch configure, generate dependencies, compile libs, apps and python bindings, sanitized build.mak and generate a symbols list. When bootstrap.sh is run, it automatically includes the configure.m4 file in third-party/pjproject. This file has a macro to download and conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR and PJPROJECT_BUNDLED. It also tests for the capabilities like PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to trying to compile. Of course, bootstrap.sh is only run once and the configure file is incldued in the patch. When configure is run with the new options, the macro in configure.m4 triggers the download, patch, conifgure and tests. No compilation is performed at this time. The downloaded tarball is cached in /tmp so it doesn't get downloaded again on a distclean. When make is run in the top-level Asterisk source directory, it will automatically descend all the subdirectories in third_party just as it does for addons, apps, etc. The top-level Makefile makes sure that the 'third-party' is built before 'main' so that dependencies from the other directories are built first. When main does build, a new shared library (libasteriskpj) is created that links statically to the pjproject .a files and exports all their symbols. The asterisk binary links to that, just as it does with libasteriskssl. When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject python bindings are installed in ASTDATADIR/third-party/pjproject. This will facilitate testing, including running the testsuite which will be updated to check that directory for the pjsua module ahead of the system python library. Modules should continue to depend on pjproject if they use pjproject APIs directly. They should not care about the implementation. No changes to any res_pjsip modules were made. Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
MOD_SUBDIRS:=third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons $(LOCAL_MOD_SUBDIRS)
OTHER_SUBDIRS:=utils agi contrib
SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
SUBDIRS_UNINSTALL:=$(SUBDIRS:%=%-uninstall)
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
MOD_SUBDIRS_MENUSELECT_TREE:=$(MOD_SUBDIRS:%=%-menuselect-tree)
ifneq ($(findstring darwin,$(OSARCH)),)
_ASTCFLAGS+=-D__Darwin__ -mmacosx-version-min=10.6
_SOLINK=-mmacosx-version-min=10.6 -Wl,-undefined,dynamic_lookup
_SOLINK+=/usr/lib/bundle1.o
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
SOLINK=-bundle $(_SOLINK)
DYLINK=-Wl,-dylib $(_SOLINK)
_ASTLDFLAGS+=-L/usr/local/lib
else
# These are used for all but Darwin
SOLINK=-shared
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
DYLINK=$(SOLINK)
ifeq ($(OSARCH),NetBSD)
_ASTLDFLAGS+=-L/usr/pkg/lib
else ifneq ($(findstring BSD,$(OSARCH)),)
_ASTLDFLAGS+=-L/usr/local/lib
endif
endif
# Include rpath settings
_ASTLDFLAGS+=$(AST_RPATH)
ifeq ($(OSARCH),SunOS)
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
DYLINK=$(SOLINK)
endif
ifeq ($(OSARCH),OpenBSD)
SOLINK=-shared -fpic
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
DYLINK=$(SOLINK)
endif
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
# comment to print directories during submakes
#PRINT_DIR=yes
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
ifneq ($(INSIDE_EMACS),)
PRINT_DIR=yes
endif
SILENTMAKE:=$(MAKE) --quiet --no-print-directory
ifneq ($(PRINT_DIR)$(NOISY_BUILD),)
SUBMAKE:=$(MAKE)
else
SUBMAKE:=$(MAKE) --quiet --no-print-directory
endif
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
# $(MAKE) is printed in several places, and we want it to be a
# fixed size string. Define a variable whose name has also the
# same size, so we can easily align text.
ifeq ($(MAKE), gmake)
mK="gmake"
else
mK=" make"
endif
all: _all
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, and +"
@echo " + can be installed by running: +"
@echo " + +"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " + $(mK) install +"
@echo " +-------------------------------------------+"
full: _full
@echo " +--------- Asterisk Build Complete ---------+"
@echo " + Asterisk has successfully been built, and +"
@echo " + can be installed by running: +"
@echo " + +"
@echo " + $(mK) install +"
@echo " +-------------------------------------------+"
_all: makeopts $(SUBDIRS) $(CORE_XMLDOC) $(ADDL_TARGETS)
_full: makeopts $(SUBDIRS) $(FULL_XMLDOC) $(ADDL_TARGETS)
makeopts: configure
@echo "****"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo "**** The configure script must be executed before running '$(MAKE)'."
@echo "**** Please run \"./configure\"."
@echo "****"
@exit 1
menuselect.makeopts: menuselect/menuselect menuselect-tree makeopts build_tools/menuselect-deps $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
ifeq ($(filter %.menuselect,$(MAKECMDGOALS)),)
menuselect/menuselect --check-deps $@
menuselect/menuselect --check-deps $@ $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS)
endif
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
$(MOD_SUBDIRS_MENUSELECT_TREE):
+@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
+@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
make_buildopts_h, et. al. Allow adding all cflags to buildopts.h The previous behavior of make_buildopts_h was to not add the non-ABI-breaking MENUSELECT_CFLAGS like DETECT_DEADLOCKS, REF_DEBUG, etc. to the buildopts.h file because "it caused ccache to invalidate files and extended compile times". They're only defined by passing them on the gcc command line with '-D' options. In practice, including them in the include file rarely causes any impact because the only time ccache cares is if you actually change an option so the hit occurrs only once after you change it. OK so why would we want to include them? Many IDEs follow the include files to resolve defines and if the options aren't in an include file, it can cause the IDE to mark blocks of "ifdeffed" code as unused when they're really not. So... * Added a new menuselect compile option ADD_CFLAGS_TO_BUILDOPTS_H which tells make_buildopts_h to include the non-ABI-breaking flags in buildopts.h as well as the ABI-breaking ones. The default is disabled to preserve current behavior. As before though, only the ABI-breaking flags appear in AST_BUILDOPTS and only those are used to calculate AST_BUILDOPT_SUM. A new AST_BUILDOPT_ALL define was created to capture all of the flags. * make_version_c was streamlined to use buildopts.h and also to create asterisk_build_opts_all[] and ast_get_build_opts_all(void) * "core show settings" now shows both AST_BUILDOPTS and AST_BUILDOPTS_ALL. UserNote: The "Build Options" entry in the "core show settings" CLI command has been renamed to "ABI related Build Options" and a new entry named "All Build Options" has been added that shows both breaking and non-breaking options.
2023-09-13 20:08:02 +00:00
$(SUBDIRS): makeopts .lastclean main/version.c include/asterisk/build.h defaults.h
ifeq ($(findstring $(OSARCH), mingw32 cygwin ),)
build-system: Allow building with static pjproject Background here: http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html From CHANGES: * To help insure that Asterisk is compiled and run with the same known version of pjproject, a new option (--with-pjproject-bundled) has been added to ./configure. When specified, the version of pjproject specified in third-party/versions.mak will be downloaded and configured. When you make Asterisk, the build process will also automatically build pjproject and Asterisk will be statically linked to it. Once a particular version of pjproject is configured and built, it won't be configured or built again unless you run a 'make distclean'. To facilitate testing, when 'make install' is run, the pjsua and pjsystest utilities and the pjproject python bindings will be installed in ASTDATADIR/third-party/pjproject. The default behavior remains building with the shared pjproject installation, if any. Building: All you have to do is include the --with-pjproject-bundled option on the ./configure command line (and remove any existing --with-pjproject option if specified). Everything else is automatic. Behind the scenes: The top-level Makefile was modified to include 'third-party' in the list of MOD_SUBDIRS. The third-party directory was created to contain any third party packages that may be needed in the future. Its Makefile automatically iterates over any subdirectories passing on targets. The third-party/pjproject directory was created to house the pjproject source distribution. Its Makefile contains targets to download, patch configure, generate dependencies, compile libs, apps and python bindings, sanitized build.mak and generate a symbols list. When bootstrap.sh is run, it automatically includes the configure.m4 file in third-party/pjproject. This file has a macro to download and conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR and PJPROJECT_BUNDLED. It also tests for the capabilities like PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to trying to compile. Of course, bootstrap.sh is only run once and the configure file is incldued in the patch. When configure is run with the new options, the macro in configure.m4 triggers the download, patch, conifgure and tests. No compilation is performed at this time. The downloaded tarball is cached in /tmp so it doesn't get downloaded again on a distclean. When make is run in the top-level Asterisk source directory, it will automatically descend all the subdirectories in third_party just as it does for addons, apps, etc. The top-level Makefile makes sure that the 'third-party' is built before 'main' so that dependencies from the other directories are built first. When main does build, a new shared library (libasteriskpj) is created that links statically to the pjproject .a files and exports all their symbols. The asterisk binary links to that, just as it does with libasteriskssl. When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject python bindings are installed in ASTDATADIR/third-party/pjproject. This will facilitate testing, including running the testsuite which will be updated to check that directory for the pjsua module ahead of the system python library. Modules should continue to depend on pjproject if they use pjproject APIs directly. They should not care about the implementation. No changes to any res_pjsip modules were made. Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
main: third-party
else
# Windows: we need to build main (i.e. the asterisk dll) first,
# followed by res, followed by the other directories, because
# dll symbols must be resolved during linking and not at runtime.
D1:= $(filter-out main,$(MOD_SUBDIRS))
D1:= $(filter-out res,$(D1))
$(D1): res
res: main
endif
$(MOD_SUBDIRS): makeopts
+@_ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
$(OTHER_SUBDIRS): makeopts
+@_ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(_ASTCFLAGS)" ASTCFLAGS="$(ASTCFLAGS)" _ASTLDFLAGS="$(_ASTLDFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
defaults.h: makeopts .lastclean build_tools/make_defaults_h
@build_tools/make_defaults_h > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
make_buildopts_h, et. al. Allow adding all cflags to buildopts.h The previous behavior of make_buildopts_h was to not add the non-ABI-breaking MENUSELECT_CFLAGS like DETECT_DEADLOCKS, REF_DEBUG, etc. to the buildopts.h file because "it caused ccache to invalidate files and extended compile times". They're only defined by passing them on the gcc command line with '-D' options. In practice, including them in the include file rarely causes any impact because the only time ccache cares is if you actually change an option so the hit occurrs only once after you change it. OK so why would we want to include them? Many IDEs follow the include files to resolve defines and if the options aren't in an include file, it can cause the IDE to mark blocks of "ifdeffed" code as unused when they're really not. So... * Added a new menuselect compile option ADD_CFLAGS_TO_BUILDOPTS_H which tells make_buildopts_h to include the non-ABI-breaking flags in buildopts.h as well as the ABI-breaking ones. The default is disabled to preserve current behavior. As before though, only the ABI-breaking flags appear in AST_BUILDOPTS and only those are used to calculate AST_BUILDOPT_SUM. A new AST_BUILDOPT_ALL define was created to capture all of the flags. * make_version_c was streamlined to use buildopts.h and also to create asterisk_build_opts_all[] and ast_get_build_opts_all(void) * "core show settings" now shows both AST_BUILDOPTS and AST_BUILDOPTS_ALL. UserNote: The "Build Options" entry in the "core show settings" CLI command has been renamed to "ABI related Build Options" and a new entry named "All Build Options" has been added that shows both breaking and non-breaking options.
2023-09-13 20:08:02 +00:00
main/version.c: FORCE include/asterisk/buildopts.h menuselect.makeopts .lastclean
@build_tools/make_version_c > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
include/asterisk/buildopts.h: menuselect.makeopts .lastclean
@build_tools/make_buildopts_h > $@.tmp
@cmp -s $@.tmp $@ || mv $@.tmp $@
@rm -f $@.tmp
# build.h must depend on .lastclean, or parallel make may wipe it out after it's
# been created.
include/asterisk/build.h: .lastclean
@build_tools/make_build_h > $@
$(SUBDIRS_CLEAN):
+@$(SUBMAKE) -C $(@:-clean=) clean
$(SUBDIRS_DIST_CLEAN):
+@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
clean: $(SUBDIRS_CLEAN) _clean
_clean:
rm -f defaults.h
rm -f include/asterisk/build.h
rm -f main/version.c
rm -f doc/core-en_US.xml
rm -f doc/full-en_US.xml
rm -f doc/rest-api/*.wiki
rm -f doxygen.log
rm -rf latex
rm -f rest-api-templates/*.pyc
@$(MAKE) -C menuselect clean
cp -f .cleancount .lastclean
dist-clean: distclean
distclean: $(SUBDIRS_DIST_CLEAN) _clean
@$(MAKE) -C menuselect dist-clean
@$(MAKE) -C sounds dist-clean
rm -f menuselect.makeopts makeopts menuselect-tree menuselect.makedeps
rm -f config.log config.status config.cache
rm -rf autom4te.cache
rm -f include/asterisk/autoconfig.h
rm -f include/asterisk/buildopts.h
rm -rf doc/api
rm -f doc/Doxyfile
rm -f build_tools/menuselect-deps
datafiles: _all $(CORE_XMLDOC)
CFLAGS="$(_ASTCFLAGS) $(ASTCFLAGS)" build_tools/mkpkgconfig "$(DESTDIR)$(libdir)/pkgconfig";
# # Recursively install contents of the static-http directory, in case
# # extra content is provided there. See contrib/scripts/get_swagger_ui.sh
find static-http | while read x; do \
if test -d $$x; then \
$(INSTALL) -m 755 -d "$(DESTDIR)$(ASTDATADIR)/$$x"; \
else \
$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/$$x" ; \
fi \
done
ifneq ($(DISABLE_XMLDOC),yes)
$(INSTALL) -m 644 doc/core-en_US.xml "$(DESTDIR)$(ASTDATADIR)/static-http";
$(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/static-http";
endif
if [ -d doc/tex/asterisk ] ; then \
$(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \
for n in doc/tex/asterisk/* ; do \
$(INSTALL) -m 644 $$n "$(DESTDIR)$(ASTDATADIR)/static-http/docs" ; \
done \
fi
for x in images/*.jpg; do \
$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/images" ; \
done
$(MAKE) -C sounds install
find rest-api -name "*.json" | while read x; do \
$(INSTALL) -m 644 $$x "$(DESTDIR)$(ASTDATADIR)/rest-api" ; \
done
Makefile: Allow XML documentation to exist outside source files Moved the xmldoc build logic from the top-level Makefile into its own script "make_xml_documentation" in the build_tools directory. Created a new utility script "get_sourceable_makeopts", also in the build_tools directory, that dumps the top-level "makeopts" file in a format that can be "sourced" from shell sscripts. This allows scripts to easily get the values of common make build variables such as the location of the GREP, SED, AWK, etc. utilities as well as the AST* and library *_LIB and *_INCLUDE variables. Besides moving logic out of the Makefile, some optimizations were done like removing "third-party" from the list of subdirectories to be searched for documentation and changing some assignments from "=" to ":=" so they're only evaluated once. The speed increase is noticeable. The makeopts.in file was updated to include the paths to REALPATH and DIRNAME. The ./conifgure script was setting them but makeopts.in wasn't including them. So... With this change, you can now place documentation in any"c" source file AND you can now place it in a separate XML file altogether. The following are examples of valid locations: res/res_pjsip.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_configuration.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_doc.xml A fully-formed XML file. The "configInfo", "manager", "managerEvent", etc. elements that would be in the "c" file DOCUMENTATION fragment should be wrapped in proper XML. Example for "somemodule.xml": <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE docs SYSTEM "appdocsxml.dtd"> <docs> <configInfo> ... </configInfo> </docs> It's the "appdocsxml.dtd" that tells make_xml_documentation that this is a documentation XML file and not some other XML file. It also allows many XML-capable editors to do formatting and validation. Other than the ".xml" suffix, the name of the file is not significant. As a start... This change also moves the documentation that was in res_pjsip.c to 2 new XML files in res/res_pjsip: pjsip_config.xml and pjsip_manager.xml. This cut the number of lines in res_pjsip.c in half. :) Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
2022-02-14 13:31:25 +00:00
DOC_MOD_SUBDIRS := $(filter-out third-party,$(MOD_SUBDIRS))
XML_core_en_US := $(shell build_tools/make_xml_documentation --command=print_dependencies --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)")
# core-en_US.xml is the normal documentation created with asterisk builds.
doc/core-en_US.xml: makeopts .lastclean $(XML_core_en_US)
Makefile: Allow XML documentation to exist outside source files Moved the xmldoc build logic from the top-level Makefile into its own script "make_xml_documentation" in the build_tools directory. Created a new utility script "get_sourceable_makeopts", also in the build_tools directory, that dumps the top-level "makeopts" file in a format that can be "sourced" from shell sscripts. This allows scripts to easily get the values of common make build variables such as the location of the GREP, SED, AWK, etc. utilities as well as the AST* and library *_LIB and *_INCLUDE variables. Besides moving logic out of the Makefile, some optimizations were done like removing "third-party" from the list of subdirectories to be searched for documentation and changing some assignments from "=" to ":=" so they're only evaluated once. The speed increase is noticeable. The makeopts.in file was updated to include the paths to REALPATH and DIRNAME. The ./conifgure script was setting them but makeopts.in wasn't including them. So... With this change, you can now place documentation in any"c" source file AND you can now place it in a separate XML file altogether. The following are examples of valid locations: res/res_pjsip.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_configuration.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_doc.xml A fully-formed XML file. The "configInfo", "manager", "managerEvent", etc. elements that would be in the "c" file DOCUMENTATION fragment should be wrapped in proper XML. Example for "somemodule.xml": <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE docs SYSTEM "appdocsxml.dtd"> <docs> <configInfo> ... </configInfo> </docs> It's the "appdocsxml.dtd" that tells make_xml_documentation that this is a documentation XML file and not some other XML file. It also allows many XML-capable editors to do formatting and validation. Other than the ".xml" suffix, the name of the file is not significant. As a start... This change also moves the documentation that was in res_pjsip.c to 2 new XML files in res/res_pjsip: pjsip_config.xml and pjsip_manager.xml. This cut the number of lines in res_pjsip.c in half. :) Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
2022-02-14 13:31:25 +00:00
@build_tools/make_xml_documentation --command=create_xml --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)" \
--with-moduleinfo --output-file=$@
Makefile: Allow XML documentation to exist outside source files Moved the xmldoc build logic from the top-level Makefile into its own script "make_xml_documentation" in the build_tools directory. Created a new utility script "get_sourceable_makeopts", also in the build_tools directory, that dumps the top-level "makeopts" file in a format that can be "sourced" from shell sscripts. This allows scripts to easily get the values of common make build variables such as the location of the GREP, SED, AWK, etc. utilities as well as the AST* and library *_LIB and *_INCLUDE variables. Besides moving logic out of the Makefile, some optimizations were done like removing "third-party" from the list of subdirectories to be searched for documentation and changing some assignments from "=" to ":=" so they're only evaluated once. The speed increase is noticeable. The makeopts.in file was updated to include the paths to REALPATH and DIRNAME. The ./conifgure script was setting them but makeopts.in wasn't including them. So... With this change, you can now place documentation in any"c" source file AND you can now place it in a separate XML file altogether. The following are examples of valid locations: res/res_pjsip.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_configuration.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_doc.xml A fully-formed XML file. The "configInfo", "manager", "managerEvent", etc. elements that would be in the "c" file DOCUMENTATION fragment should be wrapped in proper XML. Example for "somemodule.xml": <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE docs SYSTEM "appdocsxml.dtd"> <docs> <configInfo> ... </configInfo> </docs> It's the "appdocsxml.dtd" that tells make_xml_documentation that this is a documentation XML file and not some other XML file. It also allows many XML-capable editors to do formatting and validation. Other than the ".xml" suffix, the name of the file is not significant. As a start... This change also moves the documentation that was in res_pjsip.c to 2 new XML files in res/res_pjsip: pjsip_config.xml and pjsip_manager.xml. This cut the number of lines in res_pjsip.c in half. :) Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
2022-02-14 13:31:25 +00:00
# The full-en_US.xml target is only called by the wiki documentation generation process
# and does special post-processing in preparation for uploading to the wiki.
# It creates full-en_US.xml but then re-creates core-en_US.xml as well.
doc/full-en_US.xml: makeopts .lastclean $(XML_core_en_US)
ifeq ($(PYTHON),:)
@echo "--------------------------------------------------------------------------"
@echo "--- Please install python to build full documentation ---"
@echo "--------------------------------------------------------------------------"
else
Makefile: Allow XML documentation to exist outside source files Moved the xmldoc build logic from the top-level Makefile into its own script "make_xml_documentation" in the build_tools directory. Created a new utility script "get_sourceable_makeopts", also in the build_tools directory, that dumps the top-level "makeopts" file in a format that can be "sourced" from shell sscripts. This allows scripts to easily get the values of common make build variables such as the location of the GREP, SED, AWK, etc. utilities as well as the AST* and library *_LIB and *_INCLUDE variables. Besides moving logic out of the Makefile, some optimizations were done like removing "third-party" from the list of subdirectories to be searched for documentation and changing some assignments from "=" to ":=" so they're only evaluated once. The speed increase is noticeable. The makeopts.in file was updated to include the paths to REALPATH and DIRNAME. The ./conifgure script was setting them but makeopts.in wasn't including them. So... With this change, you can now place documentation in any"c" source file AND you can now place it in a separate XML file altogether. The following are examples of valid locations: res/res_pjsip.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_configuration.c Using the existing /*** DOCUMENTATION ***/ fragment. res/res_pjsip/pjsip_doc.xml A fully-formed XML file. The "configInfo", "manager", "managerEvent", etc. elements that would be in the "c" file DOCUMENTATION fragment should be wrapped in proper XML. Example for "somemodule.xml": <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE docs SYSTEM "appdocsxml.dtd"> <docs> <configInfo> ... </configInfo> </docs> It's the "appdocsxml.dtd" that tells make_xml_documentation that this is a documentation XML file and not some other XML file. It also allows many XML-capable editors to do formatting and validation. Other than the ".xml" suffix, the name of the file is not significant. As a start... This change also moves the documentation that was in res_pjsip.c to 2 new XML files in res/res_pjsip: pjsip_config.xml and pjsip_manager.xml. This cut the number of lines in res_pjsip.c in half. :) Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
2022-02-14 13:31:25 +00:00
@build_tools/make_xml_documentation --command=create_xml --source-tree=. --mod-subdirs="$(DOC_MOD_SUBDIRS)" \
--for-wiki --output-file=$@ --core-output-file=./doc/core-en_US.xml
endif
validate-docs: doc/core-en_US.xml
ifeq ($(XMLSTARLET)$(XMLLINT),::)
@echo "--------------------------------------------------------------------------"
@echo "--- Please install xmllint or xmlstarlet to validate the documentation ---"
@echo "--------------------------------------------------------------------------"
else
ifneq ($(XMLLINT),:)
$(XMLLINT) --dtdvalid doc/appdocsxml.dtd --noout $<
else
$(XMLSTARLET) val -d doc/appdocsxml.dtd $<
endif
endif
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
update:
Merged revisions 7265-7266,7268-7275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines Changing bug report address to the Asterisk issue tracker ........ r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines Makefile 'update' target now supports updating from Subversion repositories (issue #5875) remove support for 'patches' subdirectory, it's no longer useful ........ r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines ensure channel's scheduling context is freed (issue #5788) ........ r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines don't block waiting for the Festival server forever when it goes away (issue #5882) ........ r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines allow variables to exist on both 'halves' of the Local channel (issue #5810) ........ r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879) ........ r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870) reformat password changing code to conform to coding guidelines (issue #5870) ........ r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines allow previous context-searching behavior to be used if desired (issue #5899) ........ r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines inherit channel variables into channels created by Page() application (issue #5888) ........ r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-02 01:01:11 +00:00
@if [ -d .svn ]; then \
echo "Updating from Subversion..." ; \
fromrev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
Merged revisions 7265-7266,7268-7275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines Changing bug report address to the Asterisk issue tracker ........ r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines Makefile 'update' target now supports updating from Subversion repositories (issue #5875) remove support for 'patches' subdirectory, it's no longer useful ........ r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines ensure channel's scheduling context is freed (issue #5788) ........ r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines don't block waiting for the Festival server forever when it goes away (issue #5882) ........ r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines allow variables to exist on both 'halves' of the Local channel (issue #5810) ........ r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879) ........ r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870) reformat password changing code to conform to coding guidelines (issue #5870) ........ r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines allow previous context-searching behavior to be used if desired (issue #5899) ........ r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines inherit channel variables into channels created by Page() application (issue #5888) ........ r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-02 01:01:11 +00:00
svn update | tee update.out; \
torev="`svn info | $(AWK) '/Revision: / {print $$2}'`"; \
echo "`date` Updated from revision $${fromrev} to $${torev}." >> update.log; \
Merged revisions 7265-7266,7268-7275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines Changing bug report address to the Asterisk issue tracker ........ r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines Makefile 'update' target now supports updating from Subversion repositories (issue #5875) remove support for 'patches' subdirectory, it's no longer useful ........ r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines ensure channel's scheduling context is freed (issue #5788) ........ r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines don't block waiting for the Festival server forever when it goes away (issue #5882) ........ r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines allow variables to exist on both 'halves' of the Local channel (issue #5810) ........ r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879) ........ r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870) reformat password changing code to conform to coding guidelines (issue #5870) ........ r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines allow previous context-searching behavior to be used if desired (issue #5899) ........ r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines inherit channel variables into channels created by Page() application (issue #5888) ........ r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-02 01:01:11 +00:00
rm -f .version; \
if [ `grep -c ^C update.out` -gt 0 ]; then \
echo ; echo "The following files have conflicts:" ; \
grep ^C update.out | cut -b4- ; \
fi ; \
Merged revisions 7265-7266,7268-7275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines Changing bug report address to the Asterisk issue tracker ........ r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines Makefile 'update' target now supports updating from Subversion repositories (issue #5875) remove support for 'patches' subdirectory, it's no longer useful ........ r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines ensure channel's scheduling context is freed (issue #5788) ........ r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines don't block waiting for the Festival server forever when it goes away (issue #5882) ........ r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines allow variables to exist on both 'halves' of the Local channel (issue #5810) ........ r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879) ........ r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870) reformat password changing code to conform to coding guidelines (issue #5870) ........ r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines allow previous context-searching behavior to be used if desired (issue #5899) ........ r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines inherit channel variables into channels created by Page() application (issue #5888) ........ r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-02 01:01:11 +00:00
rm -f update.out; \
else \
Merged revisions 7265-7266,7268-7275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7265 | oej | 2005-12-01 17:18:14 -0600 (Thu, 01 Dec 2005) | 2 lines Changing bug report address to the Asterisk issue tracker ........ r7266 | kpfleming | 2005-12-01 17:18:29 -0600 (Thu, 01 Dec 2005) | 3 lines Makefile 'update' target now supports updating from Subversion repositories (issue #5875) remove support for 'patches' subdirectory, it's no longer useful ........ r7268 | kpfleming | 2005-12-01 17:34:58 -0600 (Thu, 01 Dec 2005) | 2 lines ensure channel's scheduling context is freed (issue #5788) ........ r7269 | kpfleming | 2005-12-01 17:49:44 -0600 (Thu, 01 Dec 2005) | 2 lines don't block waiting for the Festival server forever when it goes away (issue #5882) ........ r7270 | kpfleming | 2005-12-01 18:26:12 -0600 (Thu, 01 Dec 2005) | 2 lines allow variables to exist on both 'halves' of the Local channel (issue #5810) ........ r7271 | kpfleming | 2005-12-01 18:28:48 -0600 (Thu, 01 Dec 2005) | 2 lines protect agent_bridgedchannel() from segfaulting when there is no bridged channel (issue #5879) ........ r7272 | kpfleming | 2005-12-01 18:39:00 -0600 (Thu, 01 Dec 2005) | 3 lines properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870) reformat password changing code to conform to coding guidelines (issue #5870) ........ r7273 | kpfleming | 2005-12-01 18:42:40 -0600 (Thu, 01 Dec 2005) | 2 lines allow previous context-searching behavior to be used if desired (issue #5899) ........ r7274 | kpfleming | 2005-12-01 18:51:15 -0600 (Thu, 01 Dec 2005) | 2 lines inherit channel variables into channels created by Page() application (issue #5888) ........ r7275 | oej | 2005-12-01 18:52:13 -0600 (Thu, 01 Dec 2005) | 2 lines Bug #5907. Improve SIP INFO DTMF debugging output. (1.2 & Trunk) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-12-02 01:01:11 +00:00
echo "Not under version control"; \
fi
NEWHEADERS=$(notdir $(wildcard include/asterisk/*.h))
OLDHEADERS=$(filter-out $(NEWHEADERS) $(notdir $(DESTDIR)$(ASTHEADERDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
INSTALLDIRS="$(ASTLIBDIR)" "$(ASTMODDIR)" "$(ASTSBINDIR)" "$(ASTCACHEDIR)" "$(ASTETCDIR)" "$(ASTVARRUNDIR)" \
"$(ASTSPOOLDIR)" "$(ASTSPOOLDIR)/dictate" "$(ASTSPOOLDIR)/meetme" \
"$(ASTSPOOLDIR)/monitor" "$(ASTSPOOLDIR)/system" "$(ASTSPOOLDIR)/tmp" \
"$(ASTSPOOLDIR)/voicemail" "$(ASTSPOOLDIR)/recording" \
"$(ASTLOGDIR)" "$(ASTLOGDIR)/cdr-csv" "$(ASTLOGDIR)/cdr-custom" \
"$(ASTLOGDIR)/cel-custom" "$(ASTDATADIR)" "$(ASTDATADIR)/documentation" \
"$(ASTDATADIR)/documentation/thirdparty" "$(ASTDATADIR)/firmware" \
"$(ASTDATADIR)/firmware/iax" "$(ASTDATADIR)/images" "$(ASTDATADIR)/keys" \
"$(ASTDATADIR)/phoneprov" "$(ASTDATADIR)/rest-api" "$(ASTDATADIR)/static-http" \
build-system: Allow building with static pjproject Background here: http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html From CHANGES: * To help insure that Asterisk is compiled and run with the same known version of pjproject, a new option (--with-pjproject-bundled) has been added to ./configure. When specified, the version of pjproject specified in third-party/versions.mak will be downloaded and configured. When you make Asterisk, the build process will also automatically build pjproject and Asterisk will be statically linked to it. Once a particular version of pjproject is configured and built, it won't be configured or built again unless you run a 'make distclean'. To facilitate testing, when 'make install' is run, the pjsua and pjsystest utilities and the pjproject python bindings will be installed in ASTDATADIR/third-party/pjproject. The default behavior remains building with the shared pjproject installation, if any. Building: All you have to do is include the --with-pjproject-bundled option on the ./configure command line (and remove any existing --with-pjproject option if specified). Everything else is automatic. Behind the scenes: The top-level Makefile was modified to include 'third-party' in the list of MOD_SUBDIRS. The third-party directory was created to contain any third party packages that may be needed in the future. Its Makefile automatically iterates over any subdirectories passing on targets. The third-party/pjproject directory was created to house the pjproject source distribution. Its Makefile contains targets to download, patch configure, generate dependencies, compile libs, apps and python bindings, sanitized build.mak and generate a symbols list. When bootstrap.sh is run, it automatically includes the configure.m4 file in third-party/pjproject. This file has a macro to download and conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR and PJPROJECT_BUNDLED. It also tests for the capabilities like PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to trying to compile. Of course, bootstrap.sh is only run once and the configure file is incldued in the patch. When configure is run with the new options, the macro in configure.m4 triggers the download, patch, conifgure and tests. No compilation is performed at this time. The downloaded tarball is cached in /tmp so it doesn't get downloaded again on a distclean. When make is run in the top-level Asterisk source directory, it will automatically descend all the subdirectories in third_party just as it does for addons, apps, etc. The top-level Makefile makes sure that the 'third-party' is built before 'main' so that dependencies from the other directories are built first. When main does build, a new shared library (libasteriskpj) is created that links statically to the pjproject .a files and exports all their symbols. The asterisk binary links to that, just as it does with libasteriskssl. When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject python bindings are installed in ASTDATADIR/third-party/pjproject. This will facilitate testing, including running the testsuite which will be updated to check that directory for the pjsua module ahead of the system python library. Modules should continue to depend on pjproject if they use pjproject APIs directly. They should not care about the implementation. No changes to any res_pjsip modules were made. Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
"$(ASTDATADIR)/sounds" "$(ASTDATADIR)/moh" "$(ASTMANDIR)/man8" "$(AGI_DIR)" "$(ASTDBDIR)" \
"$(ASTDATADIR)/third-party" "${ASTDATADIR}/keys/stir_shaken" "${ASTDATADIR}/keys/stir_shaken/cache"
installdirs:
@for i in $(INSTALLDIRS); do \
if [ ! -z "$${i}" -a ! -d "$(DESTDIR)$${i}" ]; then \
$(INSTALL) -d "$(DESTDIR)$${i}"; \
fi; \
done
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
main-bininstall:
+@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main bininstall
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)/"
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"
$(INSTALL) -m 644 doc/appdocsxml.xslt "$(DESTDIR)$(ASTDATADIR)/documentation"
$(INSTALL) -m 644 doc/appdocsxml.dtd "$(DESTDIR)$(ASTDATADIR)/documentation"
endif
$(INSTALL) -m 644 doc/asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -m 644 doc/astdb*.8 "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -m 644 contrib/scripts/astgenkey.8 "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -m 644 contrib/scripts/autosupport.8 "$(DESTDIR)$(ASTMANDIR)/man8"
$(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 "$(DESTDIR)$(ASTMANDIR)/man8"
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):
build-system: Allow building with static pjproject Background here: http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html From CHANGES: * To help insure that Asterisk is compiled and run with the same known version of pjproject, a new option (--with-pjproject-bundled) has been added to ./configure. When specified, the version of pjproject specified in third-party/versions.mak will be downloaded and configured. When you make Asterisk, the build process will also automatically build pjproject and Asterisk will be statically linked to it. Once a particular version of pjproject is configured and built, it won't be configured or built again unless you run a 'make distclean'. To facilitate testing, when 'make install' is run, the pjsua and pjsystest utilities and the pjproject python bindings will be installed in ASTDATADIR/third-party/pjproject. The default behavior remains building with the shared pjproject installation, if any. Building: All you have to do is include the --with-pjproject-bundled option on the ./configure command line (and remove any existing --with-pjproject option if specified). Everything else is automatic. Behind the scenes: The top-level Makefile was modified to include 'third-party' in the list of MOD_SUBDIRS. The third-party directory was created to contain any third party packages that may be needed in the future. Its Makefile automatically iterates over any subdirectories passing on targets. The third-party/pjproject directory was created to house the pjproject source distribution. Its Makefile contains targets to download, patch configure, generate dependencies, compile libs, apps and python bindings, sanitized build.mak and generate a symbols list. When bootstrap.sh is run, it automatically includes the configure.m4 file in third-party/pjproject. This file has a macro to download and conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR and PJPROJECT_BUNDLED. It also tests for the capabilities like PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to trying to compile. Of course, bootstrap.sh is only run once and the configure file is incldued in the patch. When configure is run with the new options, the macro in configure.m4 triggers the download, patch, conifgure and tests. No compilation is performed at this time. The downloaded tarball is cached in /tmp so it doesn't get downloaded again on a distclean. When make is run in the top-level Asterisk source directory, it will automatically descend all the subdirectories in third_party just as it does for addons, apps, etc. The top-level Makefile makes sure that the 'third-party' is built before 'main' so that dependencies from the other directories are built first. When main does build, a new shared library (libasteriskpj) is created that links statically to the pjproject .a files and exports all their symbols. The asterisk binary links to that, just as it does with libasteriskssl. When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject python bindings are installed in ASTDATADIR/third-party/pjproject. This will facilitate testing, including running the testsuite which will be updated to check that directory for the pjsua module ahead of the system python library. Modules should continue to depend on pjproject if they use pjproject APIs directly. They should not care about the implementation. No changes to any res_pjsip modules were made. Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
+@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-install=) install
NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
OLDMODS=$(filter-out $(NEWMODS) $(notdir $(DESTDIR)$(ASTMODDIR)),$(notdir $(wildcard $(DESTDIR)$(ASTMODDIR)/*.so)))
ifneq ($(BASH),:)
FILMODS=$(filter-out $(shell ./build_tools/list_valid_installed_externals),$(OLDMODS))
else
FILMODS=$(OLDMODS)
endif
BADMODS=$(strip $(FILMODS))
oldmodcheck:
build: Add download capability for external packages The DPMA and g729a, silk, siren7 and siren14 codecs hosted at http://downloads.digium.com/pub/telephony/ are now listed in the "External" sections of the "Resource Modules" and "Codec Translators" pages in menuselect. Any that are selected will automatically be downloaded and installed when "make install" is run. Their LICENSE and README (if avaialble) files will be installed to ASTVARLIBDIR/documentation/thirdparty/<product_name>. Example use with codecs: The codecs/codecs.xml file is a menuselect style xml file that lists the codecs to be included. Their support levels are 'external', which triggers the download and install, and defaultenabled is no. Also because codec_g729a is actually in a directory named codec_g729 on the download server, the newly added 'member_data' element is used to override the default of the directory name being the package name. You can use the 'directory_name' attribute to keep default base URL (http://downloads.digium.com/pub/telephony/) but use the new directory, or you use the 'remote_url' attribute to specify a full URL to the download directory. In this case, you must still follow the same subdirectory naming conventions as that used for the packages located at 'http://downloads.digium.com/pub/telephony'. A new configure option '--with-externals-cache' was added and like '--with-sounds-cache' it allows the installer to cache tarballs so they're not downloaded every time. To assist with the download and install process, each external package now has a manifest.xml file that, among other things, contains a package version and checksums for each file in the tarball. The manifest is saved to both the cache directory and ASTMODDIR and together with the manifest.xml on the downloads site, tells the install scripts whether a download and/or update is needed. bash and xmlstarlet are required for downloader operation. If they're not installed, the external items in menuselect will be unavailable. Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
2016-08-02 01:55:33 +00:00
@if [ -n "$(BADMODS)" ]; then \
echo " WARNING WARNING WARNING" ;\
echo "" ;\
echo " Your Asterisk modules directory, located at" ;\
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
echo " $(DESTDIR)$(ASTMODDIR)" ;\
echo " contains modules that were not installed by this " ;\
echo " version of Asterisk. Please ensure that these" ;\
echo " modules are compatible with this version before" ;\
echo " attempting to run Asterisk." ;\
echo "" ;\
build: Add download capability for external packages The DPMA and g729a, silk, siren7 and siren14 codecs hosted at http://downloads.digium.com/pub/telephony/ are now listed in the "External" sections of the "Resource Modules" and "Codec Translators" pages in menuselect. Any that are selected will automatically be downloaded and installed when "make install" is run. Their LICENSE and README (if avaialble) files will be installed to ASTVARLIBDIR/documentation/thirdparty/<product_name>. Example use with codecs: The codecs/codecs.xml file is a menuselect style xml file that lists the codecs to be included. Their support levels are 'external', which triggers the download and install, and defaultenabled is no. Also because codec_g729a is actually in a directory named codec_g729 on the download server, the newly added 'member_data' element is used to override the default of the directory name being the package name. You can use the 'directory_name' attribute to keep default base URL (http://downloads.digium.com/pub/telephony/) but use the new directory, or you use the 'remote_url' attribute to specify a full URL to the download directory. In this case, you must still follow the same subdirectory naming conventions as that used for the packages located at 'http://downloads.digium.com/pub/telephony'. A new configure option '--with-externals-cache' was added and like '--with-sounds-cache' it allows the installer to cache tarballs so they're not downloaded every time. To assist with the download and install process, each external package now has a manifest.xml file that, among other things, contains a package version and checksums for each file in the tarball. The manifest is saved to both the cache directory and ASTMODDIR and together with the manifest.xml on the downloads site, tells the install scripts whether a download and/or update is needed. bash and xmlstarlet are required for downloader operation. If they're not installed, the external items in menuselect will be unavailable. Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
2016-08-02 01:55:33 +00:00
for f in $(BADMODS); do \
echo " $$f" ;\
done ;\
echo "" ;\
echo " WARNING WARNING WARNING" ;\
fi
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
ld-cache-update:
ifeq ($(LDCONFIG),)
else ifeq ($(LDCONFIG),:)
else
ifeq ($(DESTDIR),) # DESTDIR means binary archive creation; ldconfig should be run on postinst
@if [ $$(id -u) -eq 0 ] ; then \
$(LDCONFIG) "$(ASTLIBDIR)/" ; \
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
else \
echo " WARNING WARNING WARNING" ;\
echo "" ;\
echo " You cannot rebuild the system linker cache unless you are root. " ;\
echo " You MUST do one of the following..." ;\
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
echo " * Re-run 'make install' as root. " ;\
echo " * Run 'ldconfig $(ASTLIBDIR)' as root. " ;\
echo " * Run asterisk with 'LD_LIBRARY_PATH=$(ASTLIBDIR) asterisk' " ;\
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
echo "" ;\
echo " WARNING WARNING WARNING" ;\
fi
endif
endif
export _oldlibdir =
export _oldmoddir =
ifeq ($(findstring 64,$(HOST_CPU)),64)
# Strip any trailing '/' so the dir and notdir functions work correctly
_current_libdir = $(patsubst %/,%,$(DESTDIR)$(ASTLIBDIR))
# Only process if the paths end in lib64 or lib.
# If we're installing to lib64, check lib for orphans.
# If we're installing to lib, check lib64 for orphans.
# Otherwise, leave _oldlibdir empty.
ifeq ($(notdir $(_current_libdir)),lib64)
_oldlibdir = $(dir $(_current_libdir))lib
else ifeq ($(notdir $(_current_libdir)),lib)
_oldlibdir = $(dir $(_current_libdir))lib64
endif
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
# Strip any trailing '/' so the dir and notdir functions work correctly
_current_moddir = $(patsubst %/,%,$(DESTDIR)$(ASTMODDIR))
# Only process if the paths contain /lib64/ or /lib/.
# If we're installing to lib64, check lib for orphans.
# If we're installing to lib, check lib64 for orphans.
# Otherwise, leave _oldmoddir empty.
ifeq ($(findstring /lib64/,$(_current_moddir)),/lib64/)
_oldmoddir = $(subst /lib64/,/lib/,$(_current_moddir))
else ifeq ($(findstring /lib/,$(_current_moddir)),/lib/)
_oldmoddir = $(subst /lib/,/lib64/,$(_current_moddir))
endif
endif
check-old-libdir:
@test -n "$(_oldlibdir)" -a -d "$(_oldlibdir)" || exit 0 ;\
oldfiles=`find "$(_oldlibdir)" -name libasterisk* -print -quit -o \( -path *asterisk/modules/* -a -name *.so \) -print -quit 2>/dev/null` ;\
if [ "x$$oldfiles" != "x" ] ; then \
echo " WARNING WARNING WARNING" ;\
echo "" ;\
echo " Installation is to: " ;\
echo " $(DESTDIR)$(ASTLIBDIR)" ;\
echo " but there are asterisk shared libraries in: " ;\
echo " $(_oldlibdir)" ;\
echo " or" ;\
echo " $(_oldlibdir)/asterisk/modules" ;\
echo "" ;\
echo " It is unlikely that asterisk will start." ;\
echo "" ;\
echo " You should do one of the following..." ;\
echo " * Run 'make uninstall' to remove the incorrect libraries" ;\
echo " then run 'make install' again." ;\
echo " * Manually remove the libraries from" ;\
echo " $(_oldlibdir)" ;\
echo " and run 'ldconfig' to rebuild the linker cache." ;\
echo "" ;\
echo " WARNING WARNING WARNING" ;\
fi
badshell:
ifneq ($(filter ~%,$(DESTDIR)),)
@echo "Your shell doesn't do ~ expansion when expected (specifically, when doing \"make install DESTDIR=~/path\")."
@echo "Try replacing ~ with \$$HOME, as in \"make install DESTDIR=\$$HOME/path\"."
@exit 1
endif
versioncheck:
ifeq ($(ASTERISKVERSION),UNKNOWN__git_check_fail)
@echo "Asterisk Version is unknown due to a git error. If you are running make"
@echo "as a different user than the project owner, this can be resolved by"
@echo "running the following command as the user currently executing make: "$$USER
@echo "git config --global --add safe.directory "$(mkfile_dir:/=)
@exit 1
endif
install: badshell versioncheck bininstall datafiles
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install "$(DESTDIR)" . ; \
fi
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " +---- Asterisk Installation Complete -------+"
@echo " + +"
@echo " + YOU MUST READ THE SECURITY DOCUMENT +"
@echo " + +"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " + Asterisk has successfully been installed. +"
@echo " + If you would like to install the sample +"
@echo " + configuration files (overwriting any +"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " + existing config files), run: +"
@echo " + +"
@echo " + For generic reference documentation: +"
@echo " + $(mK) samples +"
@echo " + +"
@echo " + For a sample basic PBX: +"
@echo " + $(mK) basic-pbx +"
@echo " + +"
@echo " + +"
@echo " +----------------- or ---------------------+"
@echo " + +"
@echo " + You can go ahead and install the asterisk +"
@echo " + program documentation now or later run: +"
@echo " + +"
@echo " + $(mK) progdocs +"
@echo " + +"
@echo " + **Note** This requires that you have +"
@echo " + doxygen installed on your local system +"
@echo " +-------------------------------------------+"
@$(MAKE) -s oldmodcheck
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
@$(MAKE) -s ld-cache-update
@$(MAKE) -s check-old-libdir
isntall: install
upgrade: bininstall
# Install configuration files from the specified directory
# Parameters:
# (1) the configuration directory to install from
# (2) the extension to strip off
define INSTALL_CONFIGS
@for x in $(1)/*$(2); do \
dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x $(2)`"; \
if [ -f "$${dst}" ]; then \
if [ "$(OVERWRITE)" = "y" ]; then \
if cmp -s "$${dst}" "$$x" ; then \
echo "Config file $$x is unchanged"; \
continue; \
fi ; \
mv -f "$${dst}" "$${dst}.old" ; \
else \
echo "Skipping config file $$x"; \
continue; \
fi ;\
fi ; \
echo "Installing file $$x"; \
$(INSTALL) -m 644 "$$x" "$${dst}" ;\
done ; \
if [ "$(OVERWRITE)" = "y" ]; then \
echo "Updating asterisk.conf" ; \
sed -e 's|^astcachedir.*$$|astcachedir => $(ASTCACHEDIR)|' \
-e 's|^astetcdir.*$$|astetcdir => $(ASTETCDIR)|' \
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
-e 's|^astmoddir.*$$|astmoddir => $(ASTMODDIR)|' \
-e 's|^astvarlibdir.*$$|astvarlibdir => $(ASTVARLIBDIR)|' \
-e 's|^astdbdir.*$$|astdbdir => $(ASTDBDIR)|' \
-e 's|^astkeydir.*$$|astkeydir => $(ASTKEYDIR)|' \
-e 's|^astdatadir.*$$|astdatadir => $(ASTDATADIR)|' \
-e 's|^astagidir.*$$|astagidir => $(AGI_DIR)|' \
-e 's|^astspooldir.*$$|astspooldir => $(ASTSPOOLDIR)|' \
-e 's|^astrundir.*$$|astrundir => $(ASTVARRUNDIR)|' \
-e 's|^astlogdir.*$$|astlogdir => $(ASTLOGDIR)|' \
-e 's|^astsbindir.*$$|astsbindir => $(ASTSBINDIR)|' \
"$(DESTDIR)$(ASTCONFPATH)" > "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
$(INSTALL) -m 644 "$(DESTDIR)$(ASTCONFPATH).tmp" "$(DESTDIR)$(ASTCONFPATH)" ; \
rm -f "$(DESTDIR)$(ASTCONFPATH).tmp" ; \
fi
endef
install-headers:
# Will create all components of "$(DESTDIR)$(ASTHEADERDIR)/doxygen" including "$(DESTDIR)$(includedir)"
$(INSTALL) -d "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
$(INSTALL) -m 644 include/asterisk.h "$(DESTDIR)$(includedir)"
$(INSTALL) -m 644 include/asterisk/*.h "$(DESTDIR)$(ASTHEADERDIR)"
$(INSTALL) -m 644 include/asterisk/doxygen/*.h "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
if [ -n "$(OLDHEADERS)" ]; then \
for h in $(OLDHEADERS); do rm -f "$(DESTDIR)$(ASTHEADERDIR)/$$h"; done \
fi
install-configs:
@if test -z "$(CONFIG_SRC)" -o ! -d "$(CONFIG_SRC)"; then \
>&2 echo "CONFIG_SRC must be set to a directory."; \
exit 1; \
fi
@echo "Installing config files from $(CONFIG_SRC)/*$(CONFIG_EXTEN)"
$(call INSTALL_CONFIGS,$(CONFIG_SRC),$(CONFIG_EXTEN))
# XXX why *.adsi is installed first ?
adsi:
@echo Installing adsi config files...
$(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)"
@for x in configs/samples/*.adsi; do \
dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
if [ -f "$${dst}" ] ; then \
echo "Overwriting $$x" ; \
else \
echo "Installing $$x" ; \
fi ; \
$(INSTALL) -m 644 "$$x" "$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
done
samples: adsi
@echo Installing other config files...
$(call INSTALL_CONFIGS,configs/samples,.sample)
$(INSTALL) -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX"
build_tools/make_sample_voicemail "$(DESTDIR)/$(ASTDATADIR)" "$(DESTDIR)/$(ASTSPOOLDIR)"
@for x in phoneprov/*; do \
dst="$(DESTDIR)$(ASTDATADIR)/$$x" ; \
if [ -f "$${dst}" ]; then \
if [ "$(OVERWRITE)" = "y" ]; then \
if cmp -s "$${dst}" "$$x" ; then \
echo "Config file $$x is unchanged"; \
continue; \
fi ; \
mv -f "$${dst}" "$${dst}.old" ; \
else \
echo "Skipping config file $$x"; \
continue; \
fi ;\
fi ; \
echo "Installing file $$x"; \
$(INSTALL) -m 644 "$$x" "$${dst}" ;\
done
basic-pbx:
@echo Installing basic-pbx config files...
$(call INSTALL_CONFIGS,configs/basic-pbx)
webvmail:
@[ -d "$(DESTDIR)$(HTTP_DOCSDIR)/" ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@[ -d "$(DESTDIR)$(HTTP_CGIDIR)" ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
$(INSTALL) -m 4755 contrib/scripts/vmail.cgi "$(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi"
$(INSTALL) -d "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk"
for x in images/*.gif; do \
$(INSTALL) -m 644 $$x "$(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/"; \
done
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " +--------- Asterisk Web Voicemail ----------+"
@echo " + +"
@echo " + Asterisk Web Voicemail is installed in +"
@echo " + your cgi-bin directory: +"
@echo " + $(DESTDIR)$(HTTP_CGIDIR)"
@echo " + IT USES A SETUID ROOT PERL SCRIPT, SO +"
@echo " + IF YOU DON'T LIKE THAT, UNINSTALL IT! +"
@echo " + +"
@echo " + Other static items have been stored in: +"
@echo " + $(DESTDIR)$(HTTP_DOCSDIR)"
@echo " + +"
@echo " + If these paths do not match your httpd +"
@echo " + installation, correct the definitions +"
@echo " + in your Makefile of HTTP_CGIDIR and +"
@echo " + HTTP_DOCSDIR +"
@echo " + +"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " +-------------------------------------------+"
progdocs:
ifeq ($(DOXYGEN),:)
@echo "Doxygen is not installed. Please install and re-run the configuration script."
else
@cp doc/Doxyfile.in doc/Doxyfile
ifeq ($(DOT),:)
@echo "DOT is not installed. Doxygen will not produce any diagrams. Please install and re-run the configuration script."
else
@echo "HAVE_DOT = YES" >> doc/Doxyfile
endif
ifneq ($(NOISY_BUILD),yes)
@echo "EXTRACT_ALL = YES" >> doc/Doxyfile
endif
ifeq ($(AST_DEVMODE),yes)
@echo "INTERNAL_DOCS = YES" >> doc/Doxyfile
@echo "WARN_NO_PARAMDOC = YES" >> doc/Doxyfile
endif
ifeq ($(ASTERISKVERSION),UNKNOWN__and_probably_unsupported)
@echo "Asterisk Version is unknown, not configuring Doxygen PROJECT_NUMBER."
else ifeq ($(ASTERISKVERSION),UNKNOWN__git_check_fail)
@echo "Asterisk Version is unknown due to a git error. If you are running make"
@echo "as a different user than the project owner, this can be resolved by"
@echo "running the following command as the user currently executing make: "$$USER
@echo "git config --global --add safe.directory "$(mkfile_dir:/=)
@echo "not configuring Doxygen PROJECT_NUMBER."
else
@echo "PROJECT_NUMBER = $(ASTERISKVERSION)" >> doc/Doxyfile
endif
@echo "Generating C-API documentation. This will take a while."
@doxygen doc/Doxyfile
@echo "Generation complete. Any warnings are in ./doxygen.log."
endif
install-logrotate:
if [ ! -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ]; then \
$(INSTALL) -d "$(DESTDIR)$(ASTETCDIR)/../logrotate.d" ; \
fi
sed 's#__LOGDIR__#$(ASTLOGDIR)#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#$(ASTSBINDIR)#g' > contrib/scripts/asterisk.logrotate.tmp
$(INSTALL) -m 0644 contrib/scripts/asterisk.logrotate.tmp "$(DESTDIR)$(ASTETCDIR)/../logrotate.d/asterisk"
rm -f contrib/scripts/asterisk.logrotate.tmp
config:
@if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
./build_tools/install_subst contrib/init.d/rc.redhat.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
fi ; \
if [ -z "$(DESTDIR)" ] ; then \
/sbin/chkconfig --add asterisk ; \
fi ; \
elif [ -f /etc/debian_version ] ; then \
./build_tools/install_subst contrib/init.d/rc.debian.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
fi ; \
if [ -z "$(DESTDIR)" ] ; then \
/usr/sbin/update-rc.d asterisk defaults 50 91 ; \
fi ; \
elif [ -f /etc/gentoo-release ] ; then \
./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
if [ -z "$(DESTDIR)" ] ; then \
/sbin/rc-update add asterisk default ; \
fi ; \
elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
if [ ! -f /etc/sysconfig/asterisk ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
fi ; \
if [ -z "$(DESTDIR)" ] ; then \
/sbin/chkconfig --add asterisk ; \
fi ; \
elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
if [ ! -f /etc/sysconfig/asterisk ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
fi ; \
if [ -z "$(DESTDIR)" ] ; then \
/sbin/chkconfig --add asterisk ; \
fi ; \
elif [ -f /etc/os-release ] && [ "opensuse" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
if [ ! -f /etc/sysconfig/asterisk ] ; then \
$(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
fi ; \
if [ -z "$(DESTDIR)" ] ; then \
/sbin/chkconfig --add asterisk ; \
fi ; \
elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
elif [ -f /etc/slackware-version ]; then \
./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
elif [ -f /etc/os-release ] && [ "slackware" = "$(shell . /etc/os-release 2>/dev/null && echo $$ID)" ] ; then \
./build_tools/install_subst contrib/init.d/rc.slackware.asterisk "$(DESTDIR)/etc/rc.d/rc.asterisk"; \
elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
fi; \
if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
fi; \
else \
echo "We could not install init scripts for your distribution." ; \
fi
sounds:
$(MAKE) -C sounds all
# If the cleancount has been changed, force a make clean.
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
# .cleancount is the global clean count, and .lastclean is the
# last clean count we had
.lastclean: .cleancount
@$(MAKE) clean
@[ -f "$(DESTDIR)$(ASTDBDIR)/astdb.sqlite3" ] || [ ! -f "$(DESTDIR)$(ASTDBDIR)/astdb" ] || [ ! -f menuselect.makeopts ] || grep -q MENUSELECT_UTILS=.*astdb2sqlite3 menuselect.makeopts || (sed -i.orig -e's/MENUSELECT_UTILS=\(.*\)/MENUSELECT_UTILS=\1 astdb2sqlite3/' menuselect.makeopts && echo "Updating menuselect.makeopts to include astdb2sqlite3" && echo "Original version backed up to menuselect.makeopts.orig")
$(SUBDIRS_UNINSTALL):
build-system: Allow building with static pjproject Background here: http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html From CHANGES: * To help insure that Asterisk is compiled and run with the same known version of pjproject, a new option (--with-pjproject-bundled) has been added to ./configure. When specified, the version of pjproject specified in third-party/versions.mak will be downloaded and configured. When you make Asterisk, the build process will also automatically build pjproject and Asterisk will be statically linked to it. Once a particular version of pjproject is configured and built, it won't be configured or built again unless you run a 'make distclean'. To facilitate testing, when 'make install' is run, the pjsua and pjsystest utilities and the pjproject python bindings will be installed in ASTDATADIR/third-party/pjproject. The default behavior remains building with the shared pjproject installation, if any. Building: All you have to do is include the --with-pjproject-bundled option on the ./configure command line (and remove any existing --with-pjproject option if specified). Everything else is automatic. Behind the scenes: The top-level Makefile was modified to include 'third-party' in the list of MOD_SUBDIRS. The third-party directory was created to contain any third party packages that may be needed in the future. Its Makefile automatically iterates over any subdirectories passing on targets. The third-party/pjproject directory was created to house the pjproject source distribution. Its Makefile contains targets to download, patch configure, generate dependencies, compile libs, apps and python bindings, sanitized build.mak and generate a symbols list. When bootstrap.sh is run, it automatically includes the configure.m4 file in third-party/pjproject. This file has a macro to download and conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR and PJPROJECT_BUNDLED. It also tests for the capabilities like PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to trying to compile. Of course, bootstrap.sh is only run once and the configure file is incldued in the patch. When configure is run with the new options, the macro in configure.m4 triggers the download, patch, conifgure and tests. No compilation is performed at this time. The downloaded tarball is cached in /tmp so it doesn't get downloaded again on a distclean. When make is run in the top-level Asterisk source directory, it will automatically descend all the subdirectories in third_party just as it does for addons, apps, etc. The top-level Makefile makes sure that the 'third-party' is built before 'main' so that dependencies from the other directories are built first. When main does build, a new shared library (libasteriskpj) is created that links statically to the pjproject .a files and exports all their symbols. The asterisk binary links to that, just as it does with libasteriskssl. When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject python bindings are installed in ASTDATADIR/third-party/pjproject. This will facilitate testing, including running the testsuite which will be updated to check that directory for the pjsua module ahead of the system python library. Modules should continue to depend on pjproject if they use pjproject APIs directly. They should not care about the implementation. No changes to any res_pjsip modules were made. Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
+@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTDATADIR="$(ASTDATADIR)" $(SUBMAKE) -C $(@:-uninstall=) uninstall
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
main-binuninstall:
+@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" ASTLIBDIR="$(ASTLIBDIR)" $(SUBMAKE) -C main binuninstall
uninstall-headers:
rm -rf "$(DESTDIR)$(ASTHEADERDIR)"
rm -f "$(DESTDIR)$(includedir)/asterisk.h"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
_uninstall: $(SUBDIRS_UNINSTALL) main-binuninstall
rm -f "$(DESTDIR)$(ASTMODDIR)/"*
test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -f "$(_oldmoddir)/"* || :
rm -f "$(DESTDIR)$(ASTSBINDIR)/astgenkey"
rm -f "$(DESTDIR)$(ASTSBINDIR)/autosupport"
rm -rf "$(DESTDIR)$(ASTDATADIR)/firmware"
rm -f "$(DESTDIR)$(ASTMANDIR)/man8/asterisk.8"
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
ifeq ($(LDCONFIG),)
else ifeq ($(LDCONFIG),:)
else
$(LDCONFIG) "$(ASTLIBDIR)/" || :
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
endif
uninstall: _uninstall
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " +--------- Asterisk Uninstall Complete -----+"
@echo " + Asterisk binaries, sounds, man pages, +"
@echo " + headers, modules, and firmware builds, +"
@echo " + have all been uninstalled. +"
@echo " + +"
@echo " + To remove ALL traces of Asterisk, +"
@echo " + including configuration, spool +"
@echo " + directories, and logs, run the following +"
@echo " + command: +"
@echo " + +"
Address OpenSSL initialization issues when using third-party libraries. When Asterisk is used with various third-party libraries (CURL, PostgresSQL, many others) that have the ability themselves to use OpenSSL, it is possible for conflicts to arise in how the OpenSSL libraries are initialized and shutdown. This patch addresses these conflicts by 'wrapping' the important functions from the OpenSSL libraries in a new shared library that is part of Asterisk itself, and is loaded in such a way as to ensure that *all* calls to these functions will be dispatched through the Asterisk wrapper functions, not the native functions. This new library is optional, but enabled by default. See the CHANGES file for documentation on how to disable it. Along the way, this patch also makes a few other minor changes: * Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to more closely match what is used during run-time configuration. * Corrects some errors in the configure script where AC_CHECK_TOOLS was used instead of AC_PATH_PROG. * Adds a new variable for linker flags in the build system (DYLINK), used for producing true shared libraries (as opposed to the dynamically loadable modules that the build system produces for 'regular' Asterisk modules). * Moves the Makefile bits that handle installation and uninstallation of the main Asterisk binary into main/Makefile from the top-level Makefile. * Moves a couple of useful preprocessor macros from optional_api.h to asterisk.h. Review: https://reviewboard.asterisk.org/r/1006/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
@echo " + $(mK) uninstall-all +"
@echo " +-------------------------------------------+"
uninstall-all: _uninstall uninstall-headers
rm -rf "$(DESTDIR)$(ASTMODDIR)"
test -n "$(_oldmoddir)" -a -d "$(_oldmoddir)" && rm -rf "$(_oldmoddir)" || :
rm -rf "$(DESTDIR)$(ASTVARLIBDIR)"
rm -rf "$(DESTDIR)$(ASTDATADIR)"
rm -rf "$(DESTDIR)$(ASTSPOOLDIR)"
rm -rf "$(DESTDIR)$(ASTETCDIR)"
rm -rf "$(DESTDIR)$(ASTLOGDIR)"
rm -rf "$(DESTDIR)$(ASTCACHEDIR)"
menuconfig: menuselect
cmenuconfig: cmenuselect
gmenuconfig: gmenuselect
nmenuconfig: nmenuselect
menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
@if [ -x menuselect/nmenuselect ]; then \
$(MAKE) nmenuselect; \
elif [ -x menuselect/cmenuselect ]; then \
$(MAKE) cmenuselect; \
elif [ -x menuselect/gmenuselect ]; then \
$(MAKE) gmenuselect; \
else \
echo "No menuselect user interface found. Install ncurses,"; \
echo "newt or GTK libraries to build one and re-rerun"; \
echo "'./configure' and 'make menuselect'."; \
fi
cmenuselect: menuselect/cmenuselect menuselect-tree menuselect.makeopts
-@menuselect/cmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
gmenuselect: menuselect/gmenuselect menuselect-tree menuselect.makeopts
-@menuselect/gmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
nmenuselect: menuselect/nmenuselect menuselect-tree menuselect.makeopts
-@menuselect/nmenuselect menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
# options for make in menuselect/
MAKE_MENUSELECT=CC="$(BUILD_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" \
CFLAGS="$(BUILD_CFLAGS)" LDFLAGS="$(BUILD_LDFLAGS)" \
$(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
menuselect/menuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) menuselect
menuselect/cmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) cmenuselect
menuselect/gmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) gmenuselect
menuselect/nmenuselect: menuselect/makeopts .lastclean
+$(MAKE_MENUSELECT) nmenuselect
menuselect/makeopts: makeopts .lastclean
+$(MAKE_MENUSELECT) makeopts
menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc) $(wildcard $(dir)/*.xml)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml utils/utils.xml agi/agi.xml configure makeopts
@echo "Generating input for menuselect ..."
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
@echo "<?xml version=\"1.0\"?>" > $@
@echo >> $@
@echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
+@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
@cat build_tools/cflags.xml >> $@
+@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
@if [ "${AST_DEVMODE}" = "yes" ]; then \
cat build_tools/cflags-devmode.xml >> $@; \
fi
@cat utils/utils.xml >> $@
@cat agi/agi.xml >> $@
Merged revisions 93180 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r93180 | kpfleming | 2007-12-16 22:44:51 -0800 (Sun, 16 Dec 2007) | 23 lines In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html, rizzo brought up some issues related to the way that the metadata required for menuselect and the rest of the build system is extracted from the source files. Since I had a few hours to kill on an airplane today, I decided to improve this situation... so now the system caches the extracted metadata and uses it to build the menuselect 'tree' as much as it can. The result of this is that when a single source file is changed, only the metadata for that file needs to be extracted again, and the rest is used from the cache files. I also reduced the number of forked processes required to do the metadata extraction; it was actually possible to do most of what we needed in the Makefiles themselves without using any shell scripts at all! On my laptop, these changes resulted in an 80% decrease in the time required for the 'menuselect.makeopts' automatic check to occur after editing a single source file. While doing this work I also cleaned up a few minor things in the Makefiles, adding a check for 'awk' to the configure script and changed all remaining places we use 'grep' or 'awk' to use the ones found by the configure script, and changed the 'prep_tarball' script to build the menuselect metadata so that tarballs of Asterisk will include it and won't require the user to wait while it is extracted after unpacking. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:25:35 +00:00
@cat sounds/sounds.xml >> $@
@echo "</menu>" >> $@
# We don't want to require Python or Pystache for every build, so this is its
# own target.
Update events to use Swagger 1.3 subtyping, and related aftermath This patch started with the simple idea of changing the /events data model to be more sane. The original model would send out events like: { "stasis_start": { "args": [], "channel": { ... } } } The event discriminator was the field name instead of being a value in the object, due to limitations in how Swagger 1.1 could model objects. While technically sufficient in communicating event information, it was really difficult to deal with in terms of client side JSON handling. This patch takes advantage of a proposed extension[1] to Swagger which allows type variance through the use of a discriminator field. This had a domino effect that made this a surprisingly large patch. [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ In changing the models, I also had to change the swagger_model.py processor so it can handle the type discriminator and subtyping. I took that a big step forward, and using that information to generate an ari_model module, which can validate a JSON object against the Swagger model. The REST and WebSocket generators were changed to take advantage of the validators. If compiled with AST_DEVMODE enabled, JSON objects that don't match their corresponding models will not be sent out. For REST API calls, a 500 Internal Server response is sent. For WebSockets, the invalid JSON message is replaced with an error message. Since this took over about half of the job of the existing JSON generators, and the .to_json virtual function on messages took over the other half, I reluctantly removed the generators. The validators turned up all sorts of errors and inconsistencies in our data models, and the code. These were cleaned up, with checks in the code generator avoid some of the consistency problems in the future. * The model for a channel snapshot was trimmed down to match the information sent via AMI. Many of the field being sent were not useful in the general case. * The model for a bridge snapshot was updated to be more consistent with the other ARI models. Another impact of introducing subtyping was that the swagger-codegen documentation generator was insufficient (at least until it catches up with Swagger 1.2). I wanted it to be easier to generate docs for the API anyways, so I ported the wiki pages to use the Asterisk Swagger generator. In the process, I was able to clean up many of the model links, which would occasionally give inconsistent results on the wiki. I also added error responses to the wiki docs, making the wiki documentation more complete. Finally, since Stasis-HTTP will now be named Asterisk REST Interface (ARI), any new functions and files I created carry the ari_ prefix. I changed a few stasis_http references to ari where it was non-intrusive and made sense. (closes issue ASTERISK-21885) Review: https://reviewboard.asterisk.org/r/2639/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 16:32:41 +00:00
ari-stubs:
ifeq ($(PYTHON),:)
@echo "--------------------------------------------------------------------------"
Update events to use Swagger 1.3 subtyping, and related aftermath This patch started with the simple idea of changing the /events data model to be more sane. The original model would send out events like: { "stasis_start": { "args": [], "channel": { ... } } } The event discriminator was the field name instead of being a value in the object, due to limitations in how Swagger 1.1 could model objects. While technically sufficient in communicating event information, it was really difficult to deal with in terms of client side JSON handling. This patch takes advantage of a proposed extension[1] to Swagger which allows type variance through the use of a discriminator field. This had a domino effect that made this a surprisingly large patch. [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ In changing the models, I also had to change the swagger_model.py processor so it can handle the type discriminator and subtyping. I took that a big step forward, and using that information to generate an ari_model module, which can validate a JSON object against the Swagger model. The REST and WebSocket generators were changed to take advantage of the validators. If compiled with AST_DEVMODE enabled, JSON objects that don't match their corresponding models will not be sent out. For REST API calls, a 500 Internal Server response is sent. For WebSockets, the invalid JSON message is replaced with an error message. Since this took over about half of the job of the existing JSON generators, and the .to_json virtual function on messages took over the other half, I reluctantly removed the generators. The validators turned up all sorts of errors and inconsistencies in our data models, and the code. These were cleaned up, with checks in the code generator avoid some of the consistency problems in the future. * The model for a channel snapshot was trimmed down to match the information sent via AMI. Many of the field being sent were not useful in the general case. * The model for a bridge snapshot was updated to be more consistent with the other ARI models. Another impact of introducing subtyping was that the swagger-codegen documentation generator was insufficient (at least until it catches up with Swagger 1.2). I wanted it to be easier to generate docs for the API anyways, so I ported the wiki pages to use the Asterisk Swagger generator. In the process, I was able to clean up many of the model links, which would occasionally give inconsistent results on the wiki. I also added error responses to the wiki docs, making the wiki documentation more complete. Finally, since Stasis-HTTP will now be named Asterisk REST Interface (ARI), any new functions and files I created carry the ari_ prefix. I changed a few stasis_http references to ari where it was non-intrusive and made sense. (closes issue ASTERISK-21885) Review: https://reviewboard.asterisk.org/r/2639/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 16:32:41 +00:00
@echo "--- Please install python to build ARI stubs ---"
@echo "--------------------------------------------------------------------------"
@false
else
@$(INSTALL) -d doc/rest-api
Update events to use Swagger 1.3 subtyping, and related aftermath This patch started with the simple idea of changing the /events data model to be more sane. The original model would send out events like: { "stasis_start": { "args": [], "channel": { ... } } } The event discriminator was the field name instead of being a value in the object, due to limitations in how Swagger 1.1 could model objects. While technically sufficient in communicating event information, it was really difficult to deal with in terms of client side JSON handling. This patch takes advantage of a proposed extension[1] to Swagger which allows type variance through the use of a discriminator field. This had a domino effect that made this a surprisingly large patch. [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ In changing the models, I also had to change the swagger_model.py processor so it can handle the type discriminator and subtyping. I took that a big step forward, and using that information to generate an ari_model module, which can validate a JSON object against the Swagger model. The REST and WebSocket generators were changed to take advantage of the validators. If compiled with AST_DEVMODE enabled, JSON objects that don't match their corresponding models will not be sent out. For REST API calls, a 500 Internal Server response is sent. For WebSockets, the invalid JSON message is replaced with an error message. Since this took over about half of the job of the existing JSON generators, and the .to_json virtual function on messages took over the other half, I reluctantly removed the generators. The validators turned up all sorts of errors and inconsistencies in our data models, and the code. These were cleaned up, with checks in the code generator avoid some of the consistency problems in the future. * The model for a channel snapshot was trimmed down to match the information sent via AMI. Many of the field being sent were not useful in the general case. * The model for a bridge snapshot was updated to be more consistent with the other ARI models. Another impact of introducing subtyping was that the swagger-codegen documentation generator was insufficient (at least until it catches up with Swagger 1.2). I wanted it to be easier to generate docs for the API anyways, so I ported the wiki pages to use the Asterisk Swagger generator. In the process, I was able to clean up many of the model links, which would occasionally give inconsistent results on the wiki. I also added error responses to the wiki docs, making the wiki documentation more complete. Finally, since Stasis-HTTP will now be named Asterisk REST Interface (ARI), any new functions and files I created carry the ari_ prefix. I changed a few stasis_http references to ari where it was non-intrusive and made sense. (closes issue ASTERISK-21885) Review: https://reviewboard.asterisk.org/r/2639/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 16:32:41 +00:00
$(PYTHON) rest-api-templates/make_ari_stubs.py \
--resources rest-api/resources.json --source-dir $(ASTTOPDIR) \
--dest-dir $(ASTTOPDIR)/doc/rest-api --docs-prefix ../
endif
check-alembic: makeopts
@find contrib/ast-db-manage/ -name '*.pyc' -delete
@ALEMBIC=$(ALEMBIC) build_tools/make_check_alembic config cdr voicemail >&2
.PHONY: install-configs
.PHONY: install-headers
.PHONY: menuselect
.PHONY: main
.PHONY: sounds
.PHONY: clean
.PHONY: dist-clean
.PHONY: distclean
.PHONY: all
.PHONY: _all
.PHONY: full
.PHONY: _full
.PHONY: uninstall
.PHONY: _uninstall
.PHONY: uninstall-all
.PHONY: uninstall-headers
.PHONY: badshell
.PHONY: installdirs
.PHONY: progdocs
.PHONY: validate-docs
.PHONY: _clean
Update events to use Swagger 1.3 subtyping, and related aftermath This patch started with the simple idea of changing the /events data model to be more sane. The original model would send out events like: { "stasis_start": { "args": [], "channel": { ... } } } The event discriminator was the field name instead of being a value in the object, due to limitations in how Swagger 1.1 could model objects. While technically sufficient in communicating event information, it was really difficult to deal with in terms of client side JSON handling. This patch takes advantage of a proposed extension[1] to Swagger which allows type variance through the use of a discriminator field. This had a domino effect that made this a surprisingly large patch. [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ In changing the models, I also had to change the swagger_model.py processor so it can handle the type discriminator and subtyping. I took that a big step forward, and using that information to generate an ari_model module, which can validate a JSON object against the Swagger model. The REST and WebSocket generators were changed to take advantage of the validators. If compiled with AST_DEVMODE enabled, JSON objects that don't match their corresponding models will not be sent out. For REST API calls, a 500 Internal Server response is sent. For WebSockets, the invalid JSON message is replaced with an error message. Since this took over about half of the job of the existing JSON generators, and the .to_json virtual function on messages took over the other half, I reluctantly removed the generators. The validators turned up all sorts of errors and inconsistencies in our data models, and the code. These were cleaned up, with checks in the code generator avoid some of the consistency problems in the future. * The model for a channel snapshot was trimmed down to match the information sent via AMI. Many of the field being sent were not useful in the general case. * The model for a bridge snapshot was updated to be more consistent with the other ARI models. Another impact of introducing subtyping was that the swagger-codegen documentation generator was insufficient (at least until it catches up with Swagger 1.2). I wanted it to be easier to generate docs for the API anyways, so I ported the wiki pages to use the Asterisk Swagger generator. In the process, I was able to clean up many of the model links, which would occasionally give inconsistent results on the wiki. I also added error responses to the wiki docs, making the wiki documentation more complete. Finally, since Stasis-HTTP will now be named Asterisk REST Interface (ARI), any new functions and files I created carry the ari_ prefix. I changed a few stasis_http references to ari where it was non-intrusive and made sense. (closes issue ASTERISK-21885) Review: https://reviewboard.asterisk.org/r/2639/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 16:32:41 +00:00
.PHONY: ari-stubs
.PHONY: basic-pbx
.PHONY: check-alembic
build: Execute ldconfig to build cache. (take two) On some platforms a multiarch approach is used for libraries. The build system does not take this into account and still places libraries into the lib directory if no --libdir is specified to configure. On initial startup this results in libasteriskssl.so not being found, as it is not in the multiarch lib directory. To make matters worse, options were being passed to ldconfig on both Linux and FreeBSD that actually prevented the rebuild of the cache. * Fedora has a /usr/share/config.site that automatically tells autoconf to use /usr/lib64 but CentOS does not. This logic was copied to configure.ac and modified so systems like Ubuntu, which still use /usr/lib for 64-bit systems, aren't affected. Now that we have them in the correct directory... In order for the system loader to find libasteriskssl and libasteriskpj, one of 3 things has to happen... - The linker cache must be rebuilt including the directory where the libasterisk* libraries were installed. Only root can rebuild the cache. This was busted. - We have to link the asterisk binary with an rpath pointing to the directrory where the libasterisk* libraries were installed. This makes things very complicated and will happen over the collective dead bodies of everyone who's had to package a distribution with an rpath. - Finally, you can start asterisk with LD_LIBRARY_PATH set to the directrory where the libasterisk* libraries were installed. There are no other options. So... * The invokation of ldconfig has been moved from main/Makefile to ASTTOPDIR/Makefile, the options have been removed, and DESTDIR/ASTLIBDIR appended. If you aren't root, you will be warned after the "Asterisk Installation Compete" banner that you must re-run 'make install' as root, manually run 'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with LD_LIBRARY_PATH. ASTERISK-26705 Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
2017-02-23 21:49:17 +00:00
.PHONY: ld-cache-update
.PHONY: check-old-libdir
.PHONY: $(SUBDIRS_INSTALL)
.PHONY: $(SUBDIRS_DIST_CLEAN)
.PHONY: $(SUBDIRS_CLEAN)
.PHONY: $(SUBDIRS_UNINSTALL)
.PHONY: $(SUBDIRS)
FORCE:
# This only stops targets within the root Makefile from building in parallel.
.NOTPARALLEL: