[Asterisk-code-review] RFC: build-system: Allow building with static pjproject (asterisk[13])

George Joseph asteriskteam at digium.com
Sat Jan 23 23:37:13 CST 2016


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/2072

to look at the new patch set (#3).

Change subject: RFC: build-system: Allow building with static pjproject
......................................................................

RFC: build-system: Allow building with static pjproject

Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html

*** For the time being, to facilitate testing and provide a transition
period, the default behavior is still to dynamically link
to the system-installed shared pjproject libraries.

Static link:

New ./configure option:

--enable-static-pjproject
	If --with-pjproject=PATH was specified, it is assumed that PATH
	points to the pjproject source directory.  If --with-pjproject
	was specified without PATH or not specified at all, PATH is
	assumed to be ./third_party/pjproject/source. Regardless, the
	directory must contain a fully built source tree.

To build, cd to third_party/pjproject and type 'make'.  The Makefile will
download an official tarball from pjsip.org, unpack it into the 'source'
subdirectory, apply any patches located in the 'patches' directory, run
configure with the correct options, do a 'make dep' and a 'make'.  The
default is not to enable shared libraries but it doesn't hurt anything
if the shared libraries are also built.

When that's done, cd to the Asterisk top directory, run './configure' with
the --enable-static-pjproject option and proceed as normal.

Implementation Notes:

No c source files were changed.

res_pjsip.h was modified so that CHECK_PJSIP_MODULE_LOADED also checks for
res_pjproject if the HAVE_PJPROJECT_STATIC flag is set.

configure.ac was modified to process the new option and perform appropriate
checks.

res_pjproject now houses all pjproject APIs so res/Makefile was modified
to perform special processing on res_pjproject if using the static
libraries.

The res_pjproject.exports file is now dynamically built by listing the
global symbols from pjproject's .a files.  Since the original export
generation commands were embedded in the '%.so: %.o' rules, it wasn't
possible to override them just for res_pjproject so the exports
files have been given their own rules ('%.exports: %.exports.in') which
allows them to be overridden with a
'res_pjproject.exports: res_pjproject.exports.in' rule that combines the
existing res_pjproject.exports.in file with the symbols from pjproject.

A side effect of the new catch-all exports rule is that they now echo
messages to the terminal.
If there was no specific .in file for a module...
   [COPY]  default.exports.in -> <module>.exports
otherwise...
   [GENERATE]  <module>.exports.in -> <module>.exports
I can squash them if they're too noisy.

Modules should continue to depend on pjproject if they use pjproject APIs
directly.  They should not care about the implementation.  They should only
depend on res_pjproject if they need a specific res_pjproject API.

I would like to alter the dependency chain if HAVE_PJPROJECT_STATIC is
specified so menuselect shows that res_pjproject is needed but so far
that has eluded me.

REMINDER:  This is an RFC only at this time.

Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
---
M .gitignore
M Makefile.moddir_rules
M Makefile.rules
M build_tools/make_linker_version_script
M configure
M configure.ac
R default.exports.in
M include/asterisk/autoconfig.h.in
M include/asterisk/res_pjsip.h
M makeopts.in
M res/Makefile
A third_party/Makefile
A third_party/pjproject/.gitignore
A third_party/pjproject/Makefile
A third_party/pjproject/apply_patches
A third_party/pjproject/patches/0002-no_third_party.patch
A third_party/versions.mak
17 files changed, 347 insertions(+), 76 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/2072/3
-- 
To view, visit https://gerrit.asterisk.org/2072
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Anonymous Coward #1000019



More information about the asterisk-code-review mailing list