[pacman-dev] [PATCH v2 1/1] libalpm: generate alpm.h on the fly and add version information

Christian Hesse list at eworm.de
Mon Dec 14 14:23:50 UTC 2015


Allan McRae <allan at archlinux.org> on Sun, 2015/12/06 10:33:
> On 06/12/15 06:33, Christian Hesse wrote:
> > Allan McRae <allan at archlinux.org> on Sun, 2015/11/29 09:10:  
> >> On 30/12/14 02:53, Christian Hesse wrote:  
> >>> From: Christian Hesse <mail at eworm.de>
> >>>
> >>> Programs linked against libalpm (for example packagekit) may want to use
> >>> preprocessor macros to check version and choose correct API. This adds
> >>> version information to alpm.h.
> >>>
> >>> Signed-off-by: Christian Hesse <mail at eworm.de>    
> >>
> >> Follow-up on an old patch...   Is the version provided by pkg-config
> >> file not enough?  
> > 
> > The version provided by pkg-config is fine if you want to make configure
> > check for a required version. But that does not help if you want to
> > support older libalpm in third party software and API changes, no? For
> > example packagekit dropped support for pacman < 4.2 (libalpm < 9) with
> > the last API change.  
> 
> Isn't that the whole point of the configure check?

I do not get the point... With pkg-config I can check the version and break
with something like:

configure: error: Package requirements (libalpm >= 8.2.0) were not met:

But I would like to support the older code with something like this:

#if ALPM_VERSION_NUMBER < 0x090000
	/* legacy code here */
#else
	/* for recent library */
#endif

I can't do that with pkg-config, no?
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Chris           get my mail address:    */=0;b=c[a++];)
putchar(b-1/(/*               gcc -o sig sig.c && ./sig    */b/42*2-3)*42);}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20151214/15d377aa/attachment.asc>


More information about the pacman-dev mailing list