--modversion format
LHB
lhb.jr at aol.com
Tue Oct 25 21:12:02 PDT 2011
On 10/25/2011 07:07 AM, Troy A. Griffitts wrote:
> This may sound like a really odd request for pkg-config, but we're
> getting requests for a #if 'comparable' version number for our library.
> e.g., given:
>
>
> SWORD_VERSION := $(shell pkg-config --modversion sword)
> CFLAGS += -DSWORD_VERSION=$(SWORD_VERSION)
>
>
> It's not easy in code to do something like
>
> #if SWORD_VERSION > 1.6.2
>
> But it would be easy to do something like:
>
> #if SWORD_VERSION > 0x010602
>
>
> Is there any chance for some logic in pkg-config and a new option like
> --modversion0x to turn 1.6.2 formatted version numbers into 0x010602?
>
> Just thought I'd ask.
>
> Troy
>
>
> _______________________________________________
1) This can be done.
2) So are we saying that
a) 1.12.5 --> 0x010B05
or
b) 1.12.5 --> 0x011205
I'm thinking that (a) is what you are saying.
Of course this would limit the numbers to below 256 but that doesn't
seem to be an issue in reality. I could make this happen within a few
days. At least, I could send you a patch.
--
LHB Jr.
More information about the pkg-config
mailing list