C++ project flags for *.pc.in file run by configure?

Jeffrey Walton noloader at gmail.com
Fri Nov 10 12:38:59 UTC 2017


Hi Everyone,

We are a C++ library. I'm trying to determine how to include CXXFLAGS
in our *.pc.in file.

Most sample *.pc files that discuss the subject of configure
generating a *.pc have:

   Cflags: ${@CFLAGS@} -I${includedir}
   Libs: -L${libdir} -lcryptopp

My question is, what do we do for a C++ project? Should we use this:

   Cxxflags: ${@CXXFLAGS@} -I${includedir}
   Libs: -L${libdir} -lcryptopp

Or maybe this:

   Cxxflags: ${@AM_FLAGS@ @CXXFLAGS@} -I${includedir}
   Libs: -L${libdir} -lcryptopp

Or maybe something else?

We can't risk using Cflags, where options like -std=c11 may be
present. Building some packages, like Git, require both CFLAGS and
CXXFLAGS due to dependent libraries like PCRE and PCRE2.

My apologies for asking. The pkg-config(1) man page does not discuss
it. I've tried searching the mailing list archives, but I am drowning
in irrelevant noise.

Jeff


More information about the pkg-config mailing list