There are several ways to get necessary compilation
and linking information on Unix and application can use
any of these methods to do crypto engine selection either
at linking or run time.
PKG_CHECK_MODULES() macro
Example 2. Using PKG_CHECK_MODULES() macro in a configure.in file
to select crypto engine (openssl) at linking time.
dnl
dnl Check for xmlsec and friends
dnl
PKG_CHECK_MODULES(XMLSEC, xmlsec1-openssl >= 1.0.0 xml2 libxslt,,exit)
CFLAGS="$CFLAGS $XMLSEC_CFLAGS"
CPPFLAGS="$CPPFLAGS $XMLSEC_CFLAGS"
LDFLAGS="$LDFLAGS $XMLSEC_LIBS"
Example 3. Using PKG_CHECK_MODULES() macro in a configure.in file
to enable dynamical loading of xmlsec-crypto library.
dnl
dnl Check for xmlsec and friends
dnl
PKG_CHECK_MODULES(XMLSEC, xmlsec1 >= 1.0.0 xml2 libxslt,,exit)
CFLAGS="$CFLAGS $XMLSEC_CFLAGS"
CPPFLAGS="$CPPFLAGS $XMLSEC_CFLAGS"
LDFLAGS="$LDFLAGS $XMLSEC_LIBS"
pkg-config script
Example 4. Using pkg-config script in a Makefile
to select crypto engine (nss) at linking time.