<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hello, </div>
<div>you are doing the right way, I'll put some basic information with examples to contribute.</div>
<div><br>
</div>
<div>When creating a MODULE that needs some dependency, there are two situations to check initially:</div>
<div><br>
</div>
<div>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</div>
<div>2) If it is a NEW library not present in configure.ac, then you have to change configure.ac and recreate 'configure' script.</div>
<div><br>
</div>
<div><br>
</div>
<div>Supposing the new library included was for example 'openr2' </div>
<div>You can do a quick check running: </div>
<div><br>
</div>
<div>./configure |grep openr2</div>
<div><br>
</div>
<div><br>
</div>
<div>The result should make it clear if it was detected or nor detected, like the above example, that would give you this result:</div>
<div><br>
</div>
<div>
<div>checking for openr2_chan_new in -lopenr2... yes</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div>The result "yes" above means the library was Found and it's ready for use. You correctly modified configure.ac and recreated configure.</div>
<div>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.</div>
<div>
<div>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.</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>After succeed with ./configure you can tie dependency in any module source code by using the <depend> tag inside the module you need.</div>
<div><br>
</div>
<div>example from chan_dahdi.c :</div>
<div><br>
</div>
<div>
<div>
<div>/*** MODULEINFO</div>
<div>        <depend>res_smdi</depend></div>
<div>        <depend>dahdi</depend></div>
<div>        <depend>tonezone</depend></div>
<div>        <depend>res_features</depend></div>
<div>        <use>pri</use></div>
<div>        <use>openr2</use></div>
<div> ***/</div>
</div>
</div>
<div><br>
</div>
<div><depend> means module will NOT compile if dependency is not satisfied.</div>
<div><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.</div>
<div><br>
</div>
<div><br>
</div>
<div>I hope you succeed.</div>
<div><br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Rafael Prado</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">De: </span><<a href="mailto:asterisk-dev-bounces@lists.digium.com">asterisk-dev-bounces@lists.digium.com</a>> em nome de Catalin Stanciu <<a href="mailto:catacsdev@gmail.com">catacsdev@gmail.com</a>><br>
<span style="font-weight:bold">Responder para: </span>Asterisk List <<a href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>><br>
<span style="font-weight:bold">Data: </span>domingo, 6 de março de 2016 17:56<br>
<span style="font-weight:bold">Para: </span>Asterisk List <<a href="mailto:asterisk-dev@lists.digium.com">asterisk-dev@lists.digium.com</a>><br>
<span style="font-weight:bold">Assunto: </span>[asterisk-dev] Add module dependecy in build system<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hello,
<div><br>
</div>
<div>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.</div>
<div>To start I have followed the asterisk manual (<a href="https://wiki.asterisk.org/wiki/display/AST/Build+System+Architecture">https://wiki.asterisk.org/wiki/display/AST/Build+System+Architecture</a>)</div>
<div><br>
</div>
<div>1. I have used the AST_EXT_LIB_SETUP and AST_EXT_LIB_CHECK functions to configure in
<a href="http://configure.ac">configure.ac</a></div>
<div>2. I have included in build_tools/<a href="http://menuselect-deps.in">menuselect-deps.in</a> the line similar to other dependencies</div>
<div>3. I have included in <a href="http://makeopts.in">makeopts.in</a>  two lines one for LIB and the other for INCLUDE.</div>
<div>4. Finally I have included in the module source code the lines with MODULEINFO</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Thank you.</div>
</div>
</div>
</div>
</span>
</body>
</html>