summaryrefslogtreecommitdiff
path: root/third-party/pjproject/Makefile
AgeCommit message (Collapse)Author
2017-11-19Build: Fix OSX build issues.Corey Farrell
OSX does not support 'readlink -f' or 'sed -r'. Replace readlink with the GNU make macro 'realpath'. Replace sed with grep in one place, cut in the other. ASTERISK-27332 Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748
2017-08-15configure: Check cache for valid pjproject tarball before downloading.Richard Mudgett
On a fresh Asterisk source directory, the bundled pjproject tarball is unconditionally downloaded even if the tarball is already in a specified cache directory. * Made check if the pjproject tarball is valid in the cache directory before downloading the tarball on a fresh source directory. Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
2017-06-13pjproject_bundled: Use the asterisk github mirror for downloadGeorge Joseph
We now mirror the pjproject tarball and md5 at https://github.com/asterisk/third-party/tree/master/pjproject To improve download reliability, we now get the tarball from our mirror instead of from pjsip.org. ASTERISK-27052 #close Reported-by: 'alex' Change-Id: I60236587a8935bfa71fcc391f4e2ecb31918c08a
2017-03-23pjproject_bundled: raise timeout value used when downloadingKevin Harwell
After configuring Asterisk with '--with-pjproject-bundled' the configure/build process attempts to download pjproject from its download site. Currently, a timeout of 10 seconds is used that will stop the download process if pjproject has not been fully downloaded in that time. For some systems this was not enough time and the process was timing out too early. This patch raises the download timeout value to '60'. Also, this patch fixes another bug where the DOWNLOAD_TIMEOUT variable was not being properly exported due to a naming error. DOWNLOAD_MAX_TIMEOUT is now properly renamed to DOWNLOAD_TIMEOUT. ASTERISK-26814 #close Change-Id: Ia56e4e8a3d39db76bc8a1852b2cf07ec10b39842
2017-03-10pjproject_bundled: Reduce the need for rebuildsGeorge Joseph
Bundled pjproject should now only rebuild if one of the menuselect "Compiler Flags" options changes. Change-Id: If114a2e16b9e77af371a600d6a5e197bbf28fe43
2017-01-23pjproject_bundled: Fix setting max log levelGeorge Joseph
An earlier attempt to prevent pjsua from spitting out an extra 6795 lines of debug output every time the testsuite called it was also turning off the ability for asterisk to output debug info when it needed to. This patch reverts the earlier fix and instead adds a pjproject patch that sets the startup log level to 1 for pjsua pjsystest and the pjsua python binding. This is an asterisk-only patch that does not affect pjproject functionality and will not be submitted upstream. Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8
2017-01-08pjproject_bundled: Fix compilation with MALLOC_DEBUGGeorge Joseph
When MALLOC_DEBUG was specified, make was failing. Immediately remaking would work. The issues was in the ordering of the make dependencies. Change-Id: If6030b54fc693f3179f32bfd20c6b5d5f1b3f7cd
2017-01-03pjproject_bundled: Compile pjsua with max log level = 2George Joseph
A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6. This allowed us to control the log level better from inside Asterisk. An unfortunate side effect of this was that the pjsua binary and python bindings were also compiled with log level set to 6 so whenever a testsuite test that uses pjsua runs, it spits out 6795 lines of debug in an instant even before the test starts. I believe this overruns the Jenkins capture buffer and prevents the test from properly terminating. In turn, this results in the testsuite just hanging until the job is killed. It's more frequent on the higher end agents because they can spit out the messages faster. Unfortunately, the messages are all spit out before we have control of the python pj.Lib instance where we can set logging levels so the only alternative was to actually compile pjsua and _pjsua.so with an overridden PJ_LOG_MAX_LEVEL. Although defining a lower max level was done in the Makefile, the define in config_site.h had to be wrapped with "#ifndef" so the change would take effect. Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff
2016-12-18pjproject_bundled: Make build single threadedGeorge Joseph
There were just too many issues in various environments with multi threaded building of pjproject. It doesn't really speed things up anyway since asterisk is already being compiled in parallel. Change-Id: Ie5648fb91bb89b4224b6bf43a0daa1af793c4ce1
2016-12-09pjproject_bundled: Retry download if previously saved tarball is badGeorge Joseph
If a tarball is corrupted during download, the makefile will attempt to download it again. If the tarball somehow gets corrupted after it's downloaded however, the makefile was just failing. We now retry the download. ASTERISK-26653 #close Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359
2016-12-06pjproject_bundled: Fix missing inclusion of symbolsGeorge Joseph
Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to the CFLAGS. Not sure how they went missing. Also fixed an uninstall problem where we weren't removing the symlink from libasteriskpj.so.2 to libasteriskpj.so. While I was there, I fixed it for libasteriskssl as well. Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556
2016-11-21Merge "pjproject_bundled: Improve reliability of pjproject download"zuul
2016-11-18pjproject_bundled: Improve reliability of pjproject downloadGeorge Joseph
The download process now has a timeout which will cause wget to retry if it stops retrieving data for 5 seconds and fetch and curl to timeout if the whole retrieval take smore than 30 seconds. If the tarball retrieval works, the MD5SUM file is retrieved from the downloads site and the md5 checksum is verified. If either the tarball retrieval or MD5SUM retrieval fails, or the checksums don't match, the entire process is retried once. If it fails again, any incomplete tarball is deleted. .DELETE_ON_ERROR: was also added to the Makefile. Not only does this delete the tarball on failure, it till also delete corrupted library files from the pjproject source directory should they fail to build correctly. Tested all the way back to FreeBSD 9, CentOS 6, Debian 6 and Ubuntu 14. Change-Id: Iea7d33b96a31622ab1b6e54baebaf271959514e1
2016-11-16build: Various OpenBSD issuesGeorge Joseph
OpenBSD's 'find' doesn't take the -delete argument so you have to pipe through 'xargs rm -rf'. 'echo -e' doesn't like \t starting a line. It just prints 't' which causes the libasteriskpj.exports file to be garbage. They were just cosmetic so they were removed. librt doesn't exist so the link of libasteriskpj.so fails. It's not actually needed for linux anyway so -lrt was removed from the link. res_rtp_asterisk was failing to load because of an undefined DTLS_method. '|| defined(LIBRESSL_VERSION_NUMBER)' was added to the #if so DTLSv1_method is used instead. ASTERISK-26608 Change-Id: I926ec95b0b69633231e3ad1d6e803b977272c49c
2016-11-03pjproject_bundled: Fix issue with libasteriskpj needing libresampleGeorge Joseph
libresample is only needed by pjproject if we're building pjsua, which we only do if TEST_FRAMEWORK is selected. It's required by pjsua to process audio which is needed by some testsuite tests. Unfortunately, pjproject relies on a newer version of libresample than the version that ships by most distros so we need to compile the version that's bundled with pjproject. Since we only need it for pjsua, we DON'T want it's symbols exposed when we actually build asterisk. There was a problem however... TEST_FRAMEWORK is only known AFTER we've already run ./configure on both asterisk and pjproject but pjproject's ./configure needs to test it to know whether to set up to build libresample or not. The previous way of figuring this out was to always tell ./configure "yes" but not actually build the library. This caused an issue where building libasteriskpj was being told to include libresample but it wasn't actually there. The solution is to still do a default pjproject configure during an asterisk ./configure but if makeopts or menuselect.makeopts changes subsequently, we now reconfigure pjproject, taking into account the current state of TEST_FRAMEWORK. Previously, if makeopts or menuselect.makeopts changed, only a recompile of pjproject was done. Change-Id: I9b5d84c61384a3ae07fe30e85c49698378cc4685
2016-10-31pjproject_bundled: Fix compile of pjsua so it handles audioGeorge Joseph
In order for pjsua and its python binding to actually negotiate audio for the testsuite tests, it needs g711 and resample. The pj* libraries themselves do not. Unfortunately, pjproject relies on a brand new libresample that most distros don't ship so we need to use the libresample already bundled with pjproject. Only the pjsua executable and the _pjsua.so python library are linked with it so it shouldn't interfere with asterisk itself. Also it was pointed out that apply_patches couldn't handle multiple patches that depended on each other during the dry-run, so the dry-run was removed. Change-Id: I24f397462b486dcdde0dcafe40e6c55a6593f098
2016-10-27pjproject_bundled: Remove usage of tar's --strip-components optionGeorge Joseph
Older versions of tar don't support the --strip-components option so instead of doing 'tar --strip-components=1 -C source', we now just untar to the tarball's root directory (pjproject-<version>) and rename that directory to 'source'. Also fixed an issue where the pjproject source directory is a hard coded absolute pathname. ASTERISK-26510 #close ASTERISK-22480 #close Change-Id: I9ec92952507a91ff4e4d01e0149e09fd8e8f32b0
2016-10-24pjproject_bundled: Fixed various build issuesGeorge Joseph
* CFLAGS is now properly set when using older gcc. * All third-party pjproject targets have been removed. This fixes an issue with older libsrtp in some distros. * Manually removing the source directory now causes a rebuild. * EXTERNALS_CACHE_DIR is now properly checked. * Whitespace fixes. Change-Id: I98fec6847efc5602a9f41cb95096fd660a49fa60
2016-10-14Fix issues with bundled pjproject cached download.Corey Farrell
Previously when testing I had a preexisting makeopts in ASTTOPDIR. The ordering of configure.ac causes --with-externals-cache to be processed after third-party configure. In cases where the Asterisk clone is cleaned it would cause pjproject to be downloaded to /tmp. This moves processing of the externals cache and sounds cache to happen before third-party configure. This also addresses a possible issue with the third-party Makefile. If TMPDIR is set by the environment it would override the path given to --with-externals-cache. ASTERISK-26416 Change-Id: Ifab7f35bfcd5a31a31a3a4353cc26a68c8c6592d
2016-10-09bundled_pjproject: Add tests for programs used by the Makefile, et al.George Joseph
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 e6b0053d7561032b7adbf6f3afaecf30f5046605) (cherry picked from commit a0d02f38322c2c4d7743504003fd376d32a133db)
2016-10-09pjproject_bundled: Add MALLOC_DEBUG capabilityGeorge Joseph
pjproject_bundled will now use the asterisk memory debugging APIs if MALLOC_DEBUG is turned on in menuselect. Because this required stubs for the executable programs and the python bindings, some Makefile reorganization was needed to properly handle the dependencies. As a result, the makefile now individually makes each of the pjproject libraries separately instead of making them all in 1 shot. The only visible change is that there are separate status lines printed for each library instead oif 1 for all libs. Also, the making of the pjproject dependency files was eliminated. They're not needed for building unless you're actively modifying pjproject source files and it makes the build process faster. Finally, any issues with parallel builds should be resolved again making the build faster. Change-Id: Icc5e3d658fbfb00e0a46b44c66dcc2522d5171b0
2016-05-08pjproject_bundled: Check for python-dev and TEST_FRAMEWORKGeorge Joseph
The pjsua and pjsystest apps are now built only if TEST_FRAMEWORK is set. The python bindings are now built only if TEST_FRAMEWORK is set and a python development package is installed. libresample was also disabled. ASTERISK-25993 #close Reported-by: Joshua Colp Change-Id: If4e91c503a02f113d5b71bc8b972081fa3ff6f03
2016-05-03pjproject_bundled: Various fixes discovered during testing of OSesGeorge Joseph
For all OSes: * Disabled third-party codecs in pjproject and added '--disable-speex-codec --disable-speex-aec --disable-gsm-codec' to the configure options since we don't use the pjsip codec capability. FreeBSD: * Added FreeBSD support to install_prereq. * Changed pjproject/configure.m4 to use $GNU_MAKE instead of hardcoding "make". * Added __progname and environ to asterisk.exports.in. * Reverted the use of ldconfig to create shared library symlinks to ln. * Only enable epoll in pjproject if `uname -s` is Linux. * Added a patch to pjproject to take the name of the 'make' command from an environment variable if supplied. This is needed for the python bindings. (merged by Teluu into pjproject trunk 5/3/2016) FreeBSD support isn't complete. Still some general issues regarding make/gmake having nothing to do with pjproject. With some handholding it DOES build successfully. CentOS: Added 'patch' and 'bzip2' to install_prereq PACKAGES_RH. CentOS 6/7 32/64 build and run the pjsip testsuite successfully. Ubuntu: No changes required. Ubuntu 15/16 32/64 build and run the pjsip testsuite successfully. Debian: No changes required. Debian 6/7/8 32/64 build and run the pjsip testsuite successfully. There will utimately be a follow-up patch to create an install_prereq for the testsuite as I've discovered a few missing requirements. ASTERISK-25968 #close Change-Id: I5756a07facfc63798115a5e73a8709382fe9259c
2016-03-12pjproject: Pass (dont_)optimize flags to pjproject and fix pjsuaGeorge Joseph
The pjproject Makefile now uses the Asterisk optimization flags which are determined by the setting of the DONT_OPTMIZE menuselect flag. The Makefile was also restructured so a change to the top level menuselect.makeopts will result in a rebuild of pjproject. Also, "--disable-resample" was removed from the pjproject configure options. Without resample, pjsua (which is used by the testsuite) can't make audio calls. When it can't, it segfaults. Change-Id: I24b0a4d0872acef00ed89b3c527a713ee4c2ccd4
2016-03-01build-system: Allow building with static pjprojectGeorge Joseph
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