Commit Graph

743 Commits

Author SHA1 Message Date
George Joseph 3e97156fd3 Makefile: Disable XML doc validation
make_xml_documentation was being called with the --validate
flag set when it shouldn't have been.  This was causing
build failures if neither xmllint nor xmlstarlet were installed.
The correct behavior is to simply print a message that either
one of those tools should be installed for validation and
continue with the build.

ASTERISK-29988

Change-Id: Idc6c44114e7dd3fadae183a4e22f4fdba0b8a645
2022-03-29 12:39:35 -05:00
George Joseph 144b3c5453 make_xml_documentation: Remove usage of get_sourceable_makeopts
get_sourceable_makeopts wasn't handling variables with embedded
double quotes in them very well.  One example was the DOWNLOAD
variable when curl was being used instead of wget.  Rather than
trying to fix get_sourceable_makeopts, it's just been removed.

ASTERISK-29986
Reported by: Stefan Ruijsenaars

Change-Id: Idf2a90902228c2558daa5be7a4f8327556099cd2
2022-03-29 12:38:17 -05:00
George Joseph 2e00b5edbd 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-28 08:13:11 -06:00
Alexander Traud f3b29c6aa8 progdocs: Update Makefile.
In developer mode, use internal documentation as well.
This should produce no warnings. Fix yours!

In noisy mode, output all possible warnings of Doxygen.
This creates zillion of warnings. Double-check your current module!

Any warnings are in the file './doxygen.log'. Beside that, this change
avoids deprecated parameters because the configuration file for Doxygen
contains only those parameters which differ from the default. This
avoids the need to update the file on each run. Furthermore, it adds
AST_VECTOR to be expanded. Finally, the default name for that file is
Doxyfile. Therefore, let us use that!

ASTERISK-26991
ASTERISK-20259

Change-Id: I4129092a199d5e24c319a09cd088614b121015af
2021-12-08 17:23:51 +01:00
Josh Soref 4490f0b962 Makefile: Spelling fixes
Correct typos of the following word families:

libraries
install
overwrite

ASTERISK-29714

Change-Id: I6488814f79186d6c23dfd7b7f9bba0a046126174
2021-11-15 16:39:19 -06:00
Sean Bright 9fcd50a8c9 Makefile: Use basename in a POSIX-compliant way.
If you aren't using GNU coreutils, chances are that your basename
doesn't know about the -s argument. Luckily for us, basename does what
we need it do even without the -s argument.

Change-Id: I8b81a429bb037b997ee6640ff8a2b5e860962bb7
2021-10-11 10:04:26 -05:00
Joshua C. Colp 149e5e5b86 xml: Embed module information into core XML documentation.
This change embeds the MODULEINFO block of modules
into the core XML documentation. This provides a shared
mechanism for use by both menuselect and Asterisk for
information and a definitive source of truth.

ASTERISK-29335

Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90
2021-03-16 10:30:43 -05:00
lvl b08427134f Introduce astcachedir, to be used for temporary bucket files
As described in the issue, /tmp is not a suitable location for a
large amount of cached media files, since most distributions make
/tmp a RAM-based tmpfs mount with limited capacity.

I opted for a location that can be configured separately, as opposed
to using a subdirectory of spooldir, given the different storage
profile (transient files vs files that might stay there indefinitely).

This commit just makes the cache directory configurable, and changes
the default location from /tmp to /var/cache/asterisk.

ASTERISK-29143

Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
2020-12-09 11:17:27 -06:00
cmaj 3040edcbb1 Makefile: Fix certified version numbers
Adds sed before awk to produce reasonable ASTERISKVERSIONNUM
on certified versions of Asterisk eg. 16.8-cert3 is 160803
instead of the previous 00800.

ASTERISK-29021 #close

Change-Id: Icf241df0ff6db09011b8c936a317a84b0b634e16
2020-08-14 14:48:45 -05:00
Ben Ford 9acf840f7c res_stir_shaken: Implemented signature verification.
There are a lot of moving parts in this patch, but the focus of it is on
the verification of the signature using a public key located at the
public key URL provided in the JSON payload. First, we check the
database to see if we have already downloaded the key. If so, check to
see if it has expired. If it has, redownload from the URL. If we don't
have an entry in the database, just go ahead and download the public
key. The expiration is tested each time we download the file. After
that, read the public key from the file and use it to verify the
signature. All sanity checking is done when the payload is first
received, so the verification is complete once this point is reached.

The XML has also been added since a new config option was added to
general (curl_timeout). The maximum amount of time to wait for a
download can be configured through this option, with a low value by
default.

Change-Id: I3ba4c63880493bf8c7d17a9cfca1af0e934d1a1c
2020-05-01 06:31:46 -05:00
Jaco Kroon a699e016dd build: enable building with uClibc
This patch has been included in Gentoo distribution for at least since
asterisk 1.8, but there are references in the logs going back as far as
1.0.0 - not sure if this is still required in any way, it does apply,
and it doesn't (as far as we can determine) cause build failures.

Change-Id: I46d8845e30200205e80580680bf060aa3012ba54
2020-03-25 07:18:35 -05:00
George Joseph c781806e26 Build: Separate header install/uninstall
Asterisk headers are no longer installed and uninstalled
automatically when performing a "make install" or a
"make uninstall".  To install/uninstall the headers, use
"make install-headers" and "make uninstall-headers".
The headers also continue to be uninstalled when performing a
"make uninstall-all".

Also corrects an issue where /usr/include/asterisk.h was never
being removed at all.

Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
2019-07-16 08:17:36 -06:00
Rodrigo Ramírez Norambuena 01c90fefb3 make config: os-release output error.
Fix not show the error
"/bin/sh: /etc/os-release: No such file or directory" when the command
'make config' is run in a System without systemv.

The instruction 'make config' pre execute the syntax
"$(shell . /etc/os-release && echo $$ID)" to identified if system is a
Slackware and Opensuse.

This change prevent show the message and is send to the /dev/null

Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf
2018-08-16 11:07:17 -03:00
Corey Farrell 852e157b19 Build System: Create 'make install-configs' target.
This target requires specifying CONFIG_SRC=path_to_configs.  This can be
used to install custom configs for the Asterisk build while still
performing directory replacements on asterisk.conf.

Modify internal INSTALL_CONFIGS so first argument requires full path to
the config sources relative to Asterisk source root.

Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
2018-07-26 11:19:39 -04:00
Joshua Colp 134e2f0ddc module: Remove deprecated modules and update support levels.
I have removed the STATIC_BUILD option immediately as it has not
been maintained in many years and is non-functional.

ASTERISK-27965

Change-Id: I64783d017b86dba9ee3c7bcfb97e59889a3f76d7
2018-07-18 18:15:53 +00:00
Corey Farrell 879e592baf Build System: Enable python3 compatibility.
* Consistently use spaces in rest-api-templates/asterisk_processor.py.
* Exclude third-party from docs/full-en_US.xml.
* Add docs/full-en_US.xml to .gitignore.
* Use list() to convert python3 view.
* Use python3 print function.
* Replace cmp() with equivalent equation.
* Replace reference to out of scope subtype variable with name
  parameter.
* Use unescaping triple bracket notation in mustache templates where
  needed.  This causes behavior of Python2 to be maintained when using
  Python3.
* Fix references to has_websocket / is_websocket in
  res_ari_resource.c.mustache.
* Update calculation of has_websocket to use any().
* Use unicode mode for writing output file in transform.py.
* Replace 'from swagger_model import *' with explicit import of required
  symbols.

I have not tested spandspflow2pcap.py or voicemailpwcheck.py, only the
print syntax has been fixed.

Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33
2018-04-09 10:07:38 -04:00
Alexander Traud 07cf6b1437 install_prereq: Add Slackware (somehow).
ASTERISK-27770

Change-Id: Ib87e0483c785542238cfe34c1e884d5a31edfaab
2018-03-23 19:15:09 +01:00
Joshua Colp baf06002fe Merge "BuildSystem: Add NetBSD." 2018-03-14 06:17:01 -05:00
Alexander Traud 5b525c9781 BuildSystem: Add NetBSD.
Headers, libraries, and rpath.

ASTERISK-27728
ASTERISK-11015
Reported by: Curt Sampson

Change-Id: I50aa5fcd095937df32a2e33307caac7e79a8b5b7
2018-03-09 17:09:20 +01:00
Richard Mudgett 1fe913f7bd BuildSystem regression: Fix errors reported by clean targets.
Doing a 'make clean', 'make distclean', or 'make dist-clean' gets errors
about an invalid shell option: "/bin/sh: 0: Illegal option -".

The clean targets do not include the makeopts file which defines GREP and
LDCONFIG because the file may not exist and the distclean/dist-clean
targets will delete it anyway.

ASTERISK-27715

Change-Id: I33d40acdb03862bc89aeb6fb1ff497894a8ea7f5
2018-03-07 13:23:15 -06:00
Jenkins2 9bc9662bc9 Merge "BuildSystem: Install init scripts on openSUSE Tumbleweed." 2018-03-06 11:13:53 -06:00
Jenkins2 73846c90fa Merge "BuildSystem: AC_PATH_PROG sets to colon character when not found." 2018-03-06 10:35:54 -06:00
Alexander Traud b97905aaf2 BuildSystem: AC_PATH_PROG sets to colon character when not found.
ASTERISK-27715
Reported by: Corey Farrell

Change-Id: I0d6d9572d1352dc7ad30c9917173f1e980d8c938
2018-03-05 10:42:10 +01:00
Alexander Traud f7b845ff41 BuildSystem: Avoid re-defining of pthread_* on NetBSD.
ASTERISK-27711

Change-Id: Idc9194035b2958b99f6b01eb5b438d45a074565b
2018-03-03 10:53:12 +01:00
Alexander Traud 313a9fe255 BuildSystem: Install init scripts on openSUSE Tumbleweed.
ASTERISK-27710

Change-Id: I4c777e41b31d4415bbe21cb435ad47b43ebb5467
2018-03-02 14:05:25 +01:00
Jenkins2 4568894d2a Merge "BuildSystem: Invoke ldconfig with previous path." 2018-02-16 08:46:12 -06:00
Alexander Traud 6b6b3ffa5b BuildSystem: Invoke ldconfig with previous path.
On OpenBSD, gmake uninstall{-all} registered only libraries from /usr/lib and
lost those from /usr/local/lib. Instead, invoke ldconfig on a path.

ASTERISK-27595

Change-Id: I4aa2c0b5e07119d1a556f8ff6349eaf09e986888
2018-02-13 20:51:00 +01:00
Alexander Traud f9ba31bb21 BuildSystem: Do not warn when bash is not installed.
ASTERISK-27631

Change-Id: Iefdf268b0b98c3e7d8089ba87cf78136ac1d785b
2018-02-13 17:24:18 +01:00
Jenkins2 78efb4ce8e Merge "BuildSystem: Allow make clean all again." 2018-01-22 09:13:29 -06:00
Alexander Traud 693e509566 BuildSystem: Remove orphaned .PHONY targets.
Change-Id: Ic44d75141b9bf99e7d72fcc82ee111b5cf6989d2
2018-01-19 19:21:19 +01:00
Alexander Traud 70137794e9 BuildSystem: Allow make clean all again.
ASTERISK-27600
Reported by: Hamid R. Hashmi

Change-Id: I683d14d024650be04074b037b6300464519409f4
2018-01-19 19:14:53 +01:00
Alexander Traud a046305fae BuildSystem: Avoid $EUID and use id -u instead.
Makefile included a call to ${EUID} which requires the shell bash. To keep
compatibility with other shells like dash or ksh, use id -u instead.

ASTERISK-27589

Change-Id: Ia6e74f5bc9aab4e6dc62b7439f647b7964e6f657
2018-01-16 13:34:23 +01:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 23b0ef3e9b Build System: Disable parallel make in the root Makefile.
This ensures that the root Makefile runs only a single target at a time.
SUBMAKE will still honor requested parallelism, so 'make -j8' will build
one directory at a time but allow 8 jobs at once when building a sub
directory.

This will fix some display glitches related to rebuild of XML
documentation.  It will also prevent some edge case errors where
bundled pjproject needs to be rebuild before other parts of Asterisk.

Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e
2017-11-09 14:30:06 -05:00
Corey Farrell 5553adb8ba Build System: Fix --disable-xmldoc option.
The configure option to disable XML documentation does not currently
work.  This patch makes it effective, but also causes an ABI change by
removing the ast_xmldoc_* symbols.  Disabling xmldoc also prevents docs
from being automatically generated, but they can still be manually
generated with 'make doc/core-en_US.xml'.

ASTERISK-26639

Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44
2017-10-25 11:26:22 -04:00
David M. Lee fcb1a0d7e8 CFLAGS for BIND8 support
Some systems (like macOS) require BIND_8_COMPAT to be defined so that
the nameser libraries are, well, BIND8 compatible.

Change-Id: If79fc27a64f90de1835b5aa3aadfa9be22bd16b0
2017-06-08 17:09:33 -05:00
Walter Doekes a7d94f504f build: Fix deb build issues with fakeroot
If DESTDIR is set, don't call ldconfig. Assume that DESTDIR is used to
create a binary archive. The ldconfig call should be delegated to the
archive postinst script. This fixes the case where fakeroot wraps 'make
install' causing $EUID to be 0 even though it doesn't have permission to
call ldconfig.

The previous logic in configure.ac to detect and correct libdir
has been removed as it was not completely accurate.  CentOS 64-bit
users should again specifiy --libdir=/usr/lib64 when configuring
to prevent install to /usr/lib.

Updated Makefile:check-old-libdir to check for orphans in
lib64 when installing to lib as well as orphans in lib when installing
to lib64.

Updated Makefile and main/Makefile uninstall targets to remove the
orphans using the new logic.

ASTERISK-26705

Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
2017-03-30 17:10:32 -05:00
Sean Bright cf6a6226ab core: Remove embedded module support
This has not worked for some time and is no longer actively maintained.

Change-Id: I5110b0db69c152761b58fa025cb0a53b0e544d99
2017-03-27 10:36:08 -04:00
George Joseph 4692a32ed7 build: Warn if asterisk is installed in both 32 and 64 bit sys dirs
... and clean them both up on uninstall.

We've fixed the issue where 'make install' was installing to
/usr/lib on 64-bit systems that use /usr/lib64.  Now we need
to clean up the remnants in /usr/lib.

* 'make install' now prints a warning if DESTDIR/ASTLIBDIR
  contains 'lib64' and libasterisk* shared libraries or modules
  are also found in DESTDIR/ASTLIBDIR with 'lib64' transformed
  to 'lib'.

* 'make uninstall' ALWAYS cleans up both DESTDIR/ASTLIBDIR and
  DESTDIR/ASTLIBDIR with 'lib64' transformed to 'lib'.

ASTERISK-26705

Change-Id: I6edddeb3c07a51e7c7ba7cac3c05e4bf3ec3f01f
2017-02-27 12:57:18 -06:00
George Joseph b0067bcf2c 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 16:07:29 -06:00
George Joseph 5fb848eebd bundled_pjproject: Add tests for programs used by the Makefile, et al.
Added tests for bzip2, tar, patch, sed and nm to configure.ac.

Set DOWNLOAD_TO_STDOUT to a working command line regardless of
whether the download program is wget, curl or fetch.

Added a 'configure.m4' file to the third-party directory which takes
care of calling any third-party project setup.  Had to move some
pjproject_bundled stuff up in configure.ac so it was called before
the third-party configure macro.

The pjproject tarball is now downloaded to the externals_cache_dir if
it was specified on the ./configure command line

Removed regeneration of the pjproject aconfigure file.  It was only
needed for an old patch that no longer applies.

Converted the tests for symbols to explicit tests since we know that
they're now available in the bundled version.  Saves a little time
during configure.

ASTERISK-26416 #close
Reported-by: Corey Farrell

Change-Id: Id1d94251c0155f8dd41b7de7067f35cfbaafbb9b
(cherry picked from commit e6b0053d75)
(cherry picked from commit a0d02f3832)
2016-10-09 21:25:20 -06:00
George Joseph 6caf6bcdad 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-09-06 10:39:28 -05:00
zuul 3ca6407dab Merge "Makefile: Retain XML Declaration and DTD in docs." 2016-07-20 11:36:08 -05:00
Alexander Traud 6fca2b3bf0 Makefile: Retain XML Declaration and DTD in docs.
Since Asterisk 12, the documentation got an XML Stylesheet. Because of a typo,
the XML Declaration and DTD were overwritten by this.

ASTERISK-26212 #close

Change-Id: If5ee4625068042e98ab3fcb22a25e2f15d0c68bd
2016-07-19 12:06:10 +02:00
Alexander Traud 6428580e7f Makefile: Suppress echoing of target 'config' again.
ASTERISK-26038 #close

Change-Id: I5746cf639f3fdc6332e8a97cf01f979e30bf403f
2016-07-18 11:22:55 +02:00
Tzafrir Cohen 111c4b0324 Makefile: remove OSARCH check for init install
There are more specific checks for the platform.

Specifically this allows installing OS/X init scripts.

ASTERISK-26038 #close

Change-Id: If08933621145b10362a0cfe73c079301d9c13f50
Signed-off-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
2016-05-19 10:26:50 +03:00
George Joseph 3173e91bab 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-03-01 09:30:43 -07:00
George Joseph c53903d447 build_system: Prevent goals needing makeopts from running when it's missing
The Makefile only optionally includes makeopts so when goals like uninstall that
dont depend on anything else are run after a distclean, rules like
'rm -f "$(DESTDIR)$(ASTMODDIR)/"*' get run as 'rm -f ""/*' which attempts
to remove everything in the root directory.

Although there's a rule defined for makeopts which prints a message and does
an 'exit 1', since '-include makepopts' was specified (with the -), the exit
was ignored letting the rest of the rules run.

This patch makes makeopts required unless the goal has the string 'clean' in it.

ASTERISK-25730 #close
Reported-by: George Joseph

Change-Id: I1bce59a7ea4f48e7a468e22b2abbb13c63417ac7
2016-01-27 10:44:01 -06:00
Corey Farrell 5dde111719 Build System: Add support for checking alembic branches.
* Add 'check-alembic' target to root Makefile.
* Create build_tools/make_check_alembic to do the actual checks.

ASTERISK-25685

Change-Id: Ibb3cae7d1202ac23dc70b0f3b5801571ad46b004
2016-01-21 17:15:35 -06:00
Corey Farrell b0bf189908 Fix cli display of build options.
A previous commit reduced the AST_BUILDOPTS compiler define to
only include options that affected ABI.  This included some options
that were previously displayed by cli "core show settings".  This
change corrects the CLI display while still restricting buildopts.h
to ABI effecting options only.

ASTERISK-25434 #close
Reported by: Rusty Newton

Change-Id: Id07af6bedd1d7d325878023e403fbd9d3607e325
2015-11-04 09:15:51 -05:00