Subject: Re: detect linkage against openssl or gcrypt

Re: detect linkage against openssl or gcrypt

From: Bill Segall <>
Date: Mon, 29 Jul 2013 18:47:48 +1000

> Is it? How would you build your makefile / build scripts with pkg-config
to figure this out?

Well at least on Unix it's there. You'll want the content of:

 `pkg-config --cflags libssh2` and `pkg-config --libs libssh2` in CFLAGS
and LDFLAGS. If you're in a configure environment I'd set them to some
variables such as LIBSSH2_CFLAGS/LDFLAGS and reference those in your's rather than polluting the global CFLAGS and LDFLAGS. If
you're using raw Makefiles you could just directly add the pkg-config
evaluation output to your compile and link lines.

Don't be surprised if the CFLAGS are an empty string if you're installing
packages on Ubuntu (or anywhere that installs the headers intro
/usr/include), but remember it's still good to add the pkg-config result in
case it becomes non-empty in a subsequent release or you build against
patch release in a non-standard location etc.

Hope this helps,


Received on 2013-07-29