autotools - Abstracting include paths and library names with pkg-config? -
i'm working project goes 1 of 2 package names, depending on distribution. on debian , derivatives, package name libcrypto++
. on fedora , derivates, called libcryptopp
. (the official project name crypto++).
users write code, , things like:
#include <crypto++/aes.h>
and later, link library -lcrypto++
.
obviously, using "debian conventions" breaks things on fedora (and vice versa). see, example, how change include file path autotools?
i'm trying determine can used abstract differences away user's code "just works".
can pkg-config files
used handle differences? if so, how handle #include <crypto++/...>
versus #include <cryptopp/...>
found in user code? (i'm concerned header clashes, openssl , crypto++ both providing aes.h
).
if not, can issues caused different names on different platforms?
there's nothing built-in auto-tools automatically. it's unusual need.
there ways work. here couple:
make symlink in build tree, name like, pointing include tree. is, symlink
libcrypto++
/usr/include/libcrytpopp
; use#include <libcrypto++/mumble>
in source. can make symlinkconfigure
.generate new c macro definition @
configure
time (seeac_define
) expands string holding prefix, e.g.,"libcryptopp"
. use pasting in#include
line include proper header. see this answer.
Comments
Post a Comment