The approach that I used is similar, but I thought I'd mention it because it
only relies on the installation and not on having the source code (I'm using
a Ubuntu package).  The newer version supports the UHD drivers and there is
an install directory for the headers, so I added the following to my
makefile:

USRP_API_VERSION=$(shell if test -d /usr/local/include/uhd ; then echo
NEW_USRP_API ; else echo OLD_USRP_API ; fi ;)

I used the USRP_API_VERSION variable in a "-D" compiler option.

Thanks for the suggestions, which led to the solution I adopted.



Johnathan Corgan-2 wrote:
> 
> On Oct 12, 2011, at 20:13, Tom Rondeau <trondeau1...@gmail.com> wrote:
> 
> On Wed, Oct 12, 2011 at 5:26 AM, Peter D. Massam
> <peter.mas...@plextek.com>wrote:
> 
>>  I need to be able to maintain my program for both old and new systems
>> and
>> I've been looking for a version constant that I can use for conditional
>> compilation.
>>
>> **
>>
> You can find the version information in
> $(top_builddir)/gnuradio-core/gnuradio-core.pc. This is...
> 
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Getting-the-API-version-at-compile-time-tp32637243p32644037.html
Sent from the GnuRadio mailing list archive at Nabble.com.


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to