<div><br></div><div dir="auto">why am i on this mailing list <br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 1, 2021 at 9:10 AM George Joseph <<a href="mailto:gjoseph@sangoma.com">gjoseph@sangoma.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 1, 2021 at 1:44 AM Alexander Traud <<a href="mailto:pabstraud@compuserve.com" target="_blank">pabstraud@compuserve.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Not at runtime but at compile-time, how does the compiler of a module detect which version is used? Before Asterisk 11, I included <asterisk/version.h> and the preprocessor macro ASTERISK_VERSION_NUM was available, see [1]. How do I solve that today?<br>
<br>
My workaround, because I build in-tree anyway, I patched its Makefile as well: _ASTCFLAGS+=-DASTERISK_VERSION_NUM=$(ASTERISKVERSIONNUM).<br>
<br></blockquote><div><br></div><div>I was thinking about calling build_tools/make_version from <a href="http://configure.ac" target="_blank">configure.ac</a> and having it exported to autoconfig.h but it could get stale if you did a git pull on the same branch and didn't re-run ./configure.  The issue I have with the -DASTERISK_VERSION_NUM is that IDEs won't detect that and will probably show the code as if it weren't defined.   I think the best way to do this may be to have <a href="http://configure.ac" target="_blank">configure.ac</a> run make_version but then have the Makefile also run it and if it's different, just run sed on autoconfig.h to replace the version.</div><div><br></div><div>You'd have to update:</div><div><a href="http://configure.ac" target="_blank">configure.ac</a></div><div><a href="http://autoconfig.h.in" target="_blank">autoconfig.h.in</a></div><div><a href="http://makeopts.in" target="_blank">makeopts.in</a></div><div>Makefile.in</div><div><br></div><div>Should be fairly easy though.</div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">
[1] <<a href="https://github.com/asterisk/asterisk/commit/9ee8a74" rel="noreferrer" target="_blank">https://github.com/asterisk/asterisk/commit/9ee8a74</a>><br>
<br>
<br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div></div>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div></div>