Skip to content
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

Use pcfiledir for prefix in pkgconfig file #1905

Merged
merged 3 commits into from
Oct 22, 2018
Merged

Use pcfiledir for prefix in pkgconfig file #1905

merged 3 commits into from
Oct 22, 2018

Conversation

fandjelo
Copy link
Contributor

Using absolute paths in the pkg-config file makes it not relocatable and
leads to problems, when trying to use it with precompiled cross
toolchains. Setting prefix to relative path based on pcfiledir makes it
more reliable for such cases.

Using absolute paths in the pkg-config file makes it not relocatable and
leads to problems, when trying to use it with precompiled cross
toolchains. Setting prefix to relative path based on pcfiledir makes it
more reliable for such cases.
@gennadiycivil
Copy link
Contributor

Thank your for this contribution. Could you please elaborate and provide more information on exactly the issue / problems this is trying to address.
What is the before/after effect this would create and how is this beneficial? "leads to problems" is not sufficient

@fandjelo
Copy link
Contributor Author

Thank you for the reply. Currently generated pkg-config (f.e. gtest.pc) file contains absolute paths to the includes and libraries directories. When building a package, which final usage location is unknown during the compilation, the paths could be incorrect, so using pkg-config through the environment variable PKG_CONFIG_PATH would not work. This is often needed, when using cross compiler environment with precompiled cross libraries (like gtest). To solve this problem all paths in the pc file can be generated relative to the installation path, using prefix set to ${pcfiledir} variable. This way the built package can be located and work anywhere. If it helps, following text explains it a little bit more in detail: https://wp.colliertech.org/cj/?p=164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants