[asterisk-dev] Add module dependecy in build system

George Joseph george.joseph at fairview5.com
Wed Mar 9 00:22:08 CST 2016


On Tue, Mar 8, 2016 at 2:39 PM, Catalin Stanciu <catacsdev at gmail.com> wrote:

> Thank you for your support, the help make me succeed, having now the
> package working in ubuntu.
> Now I am testing the module in Centos 6. First I found
> that PKG_CONFIG_PATH is empty, so the AST_PKG_CONFIG_CHECK was not able to
> find the lib and include routes. I solved it exporting the pkgconfig routes:
>
> export
> PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/src/mongo-c-driver-1.3.3/src/:/usr/local/lib/pkgconfig/
>

​I think you need to install the ​libmongo-client-devel package rather than
from source.


>
> Everything seems to be correct since i found this problem when executing
> ./configure:
>
> checking for pg_config... /usr/bin/pg_config
> checking for PQescapeStringConn in -lpq... yes
> checking for pg_encoding_to_char within Postgres headers... yes
> ./configure: line 43633: syntax error near unexpected token
> `$PJPROJECT_DIR'
> ./configure: line 43633: `       PJPROJECT_CONFIGURE($PJPROJECT_DIR)'
>
>
​There's something in configure.ac​ just before the error that's causing
the issue.


> My intuition told to install pjproject, so i did it, but output still the
> same.
>
> PD: George, are you using any yum repo to install libmongo-client. After a
> bit of research I have installed the mongo driver form source, because i
> didn't found any other method to install it.
>

​The package is libmongo-client-devel.​



> Than you all.
>
>
> On Mon, Mar 7, 2016 at 12:11 AM, Rafael Prado Rocchi <prado at practis.com.br
> > wrote:
>
>> Hello,
>> you are doing the right way, I'll put some basic information with
>> examples to contribute.
>>
>> When creating a MODULE that needs some dependency, there are two
>> situations to check initially:
>>
>> 1) If the library is already present in configure.ac (and detected when
>> you run ./configure), then you just need to put the dependency inside the
>> Module source using <depend> tag
>> 2) If it is a NEW library not present in configure.ac, then you have to
>> change configure.ac and recreate 'configure' script.
>>
>>
>> Supposing the new library included was for example 'openr2'
>> You can do a quick check running:
>>
>> ./configure |grep openr2
>>
>>
>> The result should make it clear if it was detected or nor detected, like
>> the above example, that would give you this result:
>>
>> checking for openr2_chan_new in -lopenr2... yes
>>
>>
>> The result "yes" above means the library was Found and it's ready for
>> use. You correctly modified configure.ac and recreated configure.
>> If you get a different result or no result, check the paths where the
>> library lives in you linux distro and make the appropriate changes in
>> configure.ac because configure was not able to find them, also check the
>> logfile.
>> Some types of library install theirselves in different places, and some
>> linux distros have different places for them, special attention for 64bit
>> distros vs 32bit distros.
>>
>>
>> After succeed with ./configure you can tie dependency in any module
>> source code by using the <depend> tag inside the module you need.
>>
>> example from chan_dahdi.c :
>>
>> /*** MODULEINFO
>>         <depend>res_smdi</depend>
>>         <depend>dahdi</depend>
>>         <depend>tonezone</depend>
>>         <depend>res_features</depend>
>>         <use>pri</use>
>>         <use>openr2</use>
>>  ***/
>>
>> <depend> means module will NOT compile if dependency is not satisfied.
>> <use> means module can make use of the library or not, it's not essencial
>> and it WILL compile without the library being detected by ./configure.
>>
>>
>> I hope you succeed.
>>
>>
>> Regards,
>> Rafael Prado
>>
>>
>>
>> De: <asterisk-dev-bounces at lists.digium.com> em nome de Catalin Stanciu <
>> catacsdev at gmail.com>
>> Responder para: Asterisk List <asterisk-dev at lists.digium.com>
>> Data: domingo, 6 de março de 2016 17:56
>> Para: Asterisk List <asterisk-dev at lists.digium.com>
>> Assunto: [asterisk-dev] Add module dependecy in build system
>>
>> Hello,
>>
>> I am trying to include a module dependency in  the asterisk build system,
>> but after some hours of research I couldn't found any useful information.
>> To start I have followed the asterisk manual (
>> https://wiki.asterisk.org/wiki/display/AST/Build+System+Architecture)
>>
>> 1. I have used the AST_EXT_LIB_SETUP and AST_EXT_LIB_CHECK functions to
>> configure in configure.ac
>> 2. I have included in build_tools/menuselect-deps.in the line similar to
>> other dependencies
>> 3. I have included in makeopts.in  two lines one for LIB and the other
>> for INCLUDE.
>> 4. Finally I have included in the module source code the lines with
>> MODULEINFO
>>
>> I don't know what I am doing wrong but I think the documentation for
>> build  system architecture must have some examples with explanation of
>> complex cases.
>>
>> Thank you.
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-dev mailing list
>> To UNSUBSCRIBE or update options visit:
>>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>>
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20160308/89fd84f2/attachment-0001.html>


More information about the asterisk-dev mailing list