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

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Dec 14 16:30:35 UTC 2015


On 12/14/15 at 03:23pm, Christian Hesse wrote:
> 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?

Could you not have your configure script define an appropriate macro
based on the pkg-config information?

apg


More information about the pacman-dev mailing list