New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: correct way to use Requires.private #300
Comments
Requires.private is always considered for CFLAGS, because the module's headers may be referenced by the dependent (in fact, this would make a lot of sense, consider a module which builds on top of GTK, for example, it would need to reference the GTK headers). Requires.private is only considered for LIBS if |
Thanks for your reply, I had missed it and I'm only reading it now. What if the modules headers are not referenced by the dependent? Is there a way to have CFLAGS behave in the same way as LIBS? I.e. make Requires.private only considered if --static is requested, both for LIBS and CFLAGS. |
…abled If librepo is built with zchunk support, zchunk's zck.h header file is included from librepo public header files, thus applications building against librepo needs zchunk header files available at build time. Those who only use pkg-config for tracking dependencies, reported build failures: /usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory This patch adds the dependency on zck to librepo.pc. It enhances Requires.private instead of Requires to prevent from contaminating "pkgconf --libs librepo" with -lzck. Contrary, "pkgconf --cflags librepo" correctly appends include path to zck header files. The dependency on zck.pc is only checked and enforced with "pkgconf --cflags librepo" invocation. This behaviour is a feature. See <pkgconf/pkgconf#352> and <pkgconf/pkgconf#300>. Fixes: rpm-software-management#305
Document that "pkgconf --cflags" inherits paths for including headers from dependencies listed in Requires.private. pkgconf#300 pkgconf#352
Document that "pkgconf --cflags" inherits paths for including headers from dependencies listed in Requires.private. pkgconf#300 pkgconf#352
…abled If librepo is built with zchunk support, zchunk's zck.h header file is included from librepo public header files, thus applications building against librepo needs zchunk header files available at build time. Those who only use pkg-config for tracking dependencies, reported build failures: /usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory This patch adds the dependency on zck to librepo.pc. It enhances Requires.private instead of Requires to prevent from contaminating "pkgconf --libs librepo" with -lzck. Contrary, "pkgconf --cflags librepo" correctly appends include path to zck header files. The dependency on zck.pc is only checked and enforced with "pkgconf --cflags librepo" invocation. This behaviour is a feature. See <pkgconf/pkgconf#352> and <pkgconf/pkgconf#300>. Fixes: rpm-software-management#305
…abled If librepo is built with zchunk support, zchunk's zck.h header file is included from librepo public header files, thus applications building against librepo needs zchunk header files available at build time. Those who only use pkg-config for tracking dependencies, reported build failures: /usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory This patch adds the dependency on zck to librepo.pc. It enhances Requires.private instead of Requires to prevent from contaminating "pkgconf --libs librepo" with -lzck. Contrary, "pkgconf --cflags librepo" correctly appends include path to zck header files. The dependency on zck.pc is only checked and enforced with "pkgconf --cflags librepo" invocation. This behaviour is a feature. See <pkgconf/pkgconf#352> and <pkgconf/pkgconf#300>. Fixes: #305
Documentation clarifying the current situation was merged in #353. |
Hi,
I'm trying to understand how to correctly use the
Requires.private
property in a.pc
file.Let's say that
libA
internally depends onlibB
and thatlibA.so
is dynamically linked tolibB.so
whenlibA
is built as shared library.My understanding is that
libA
should includelibB
in itsRequires.private
.pc
file, is that right?That would be mainly in order to support static builds.
Now, let's say that
my-app
is usinglibA
and usesPKG_CHECK_MODULES
in itsconfigure.ac
to detect the presence oflibA
. As far as I can see ifRequires.private
is used, theconfigure
script ofmy-app
will fail with something:if the
.pc
file oflibB
is not installed on the system. This happens because thepkg.m4
macros generates a command like:which fails with:
Distributions like Debian ship
.pc
files in a separate-dev
package, so the scenario in which the.pc
file oflibA
is present, but the one oflibB
is not is actually the normal one, because a user buildingmy-app
should only need the thelibA-dev
package.Should perhaps
Libs.private
be used instead? I'm confused about the proper way to do this.Thanks
The text was updated successfully, but these errors were encountered: