using .pc file

Jeff Johnson n3npq at mac.com
Mon Mar 14 16:56:03 CET 2011


On Mar 14, 2011, at 10:30 AM, Andreas Metzler wrote:

> Vincent Torri <vincent.torri at gmail.com> wrote:
>> I would like to know if pkg-config support can be added. I can provide a
>> patch if the devs agree with such addition
> [...]
> 
> I had proposed this in 2007, but it was denied. Rationale is here:
> http://article.gmane.org/gmane.comp.encryption.gpg.libgcrypt.devel/1733
> 

Retrofitting pkgconfig onto any project isn't impossibly hard.
Try an add-on patch.

The rationale is perfectly sane for "portable" code. While pkgconfig
might be very useful on uglix, pkgconfig is not sufficiently widely
deployed to use everywhere. Having multiple (the other 2 are *.la files and
/usr/bin/fooconfig scripts) hinting mechanisms to carry around
compiler flags and linkage arguments introduces unreliability.

Werner: FYI only, your gcrypt "portability" issues are hard to solve,
and I have no easy answers. RPM has similarly hard "portability" issues.

Ralf Engelschall wrote a rather nice M4 macro called RPM_CHECK_LIB()
that handles not only all of fooconfig and foo.pc and *.la hinting,
but also permits choosing internal <-> external libraries.

E.g. here's the AutoFu by which RPM finds out how to link with -lgcrypt:

dnl # GCrypt
RPM_CHECK_LIB(
    [GCrypt], [gcrypt],
    [gcrypt], [gcry_pk_verify], [gcrypt.h],
    [no,external:none], [],
    [ AC_DEFINE(WITH_GCRYPT, 1, [Define if building with GCrypt])
    ], [])

RPM_CHECK_LIB() would tranparently handle any of
	/usr/bin/gcryptconfig
	/usr/lib*/pkgconfig/gcrypt.pc
	/usr/lib/libgcrypt.la
as well as (if I was crazy enough to distribute gcrypt w RPM)
an internal sub-tree of gcrypt.

I pass along RPM_CHECK_LIB() solely for your professional hacking pleasure.
Ralf did a *very* nice job writing RPM_CHECK_LIB(), solving a complex
"portability" problem, and (I believe) RPM_CHECK_LIB() as much wider
usage cases than just in RPM.

hth

73 de Jeff	I'm not crazy enough to re-distribute gcrypt+rpm. No need ...
b
> cu andreas
> -- 
> `What a good friend you are to him, Dr. Maturin. His other friends are
> so grateful to you.'
> `I sew his ears on from time to time, sure'
> 
> 
> _______________________________________________
> Gcrypt-devel mailing list
> Gcrypt-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gcrypt-devel




More information about the Gcrypt-devel mailing list