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

please use PKG_CONFIG_KEEP_SYSTEM_CFLAGS and PKG_CONFIG_KEEP_SYSTEM_LIBS #92

Closed
kaniini opened this issue Sep 8, 2019 · 2 comments · Fixed by #93
Closed

please use PKG_CONFIG_KEEP_SYSTEM_CFLAGS and PKG_CONFIG_KEEP_SYSTEM_LIBS #92

kaniini opened this issue Sep 8, 2019 · 2 comments · Fixed by #93

Comments

@kaniini
Copy link
Contributor

kaniini commented Sep 8, 2019

The rust pkg_config crate parses the gcc cflags and link flag output of pkg-config to deduce semantic meaning behind certain flags.

There's nothing wrong with that per se, but pkgconf typically assumes that when invoked, it is generating output for use with the system C/C++ compiler. Accordingly, it typically simplifies the output it generates for the convenience of humans using the tool by removing flags that gcc automatically implies (such as -I/usr/include for example).

This causes strange conflicts with the pkg_config crate naturally. This can be fixed by telling pkgconf that you're not GCC, by adding two environment variables:

  • PKG_CONFIG_SYSTEM_INCLUDE_PATH=
  • PKG_CONFIG_SYSTEM_LIBRARY_PATH=

These paths should be either blank or paths that will automatically be implied by the toolchain. In the case of rust-onig/rust-onig#119, the paths should be blank if the implied paths (e.g. /usr/include) will not be included in the include_paths property.

@sdroege
Copy link
Collaborator

sdroege commented Sep 8, 2019

Can you provide a PR for this? I don't have any system with pkgconf, so can't really test this.

@kaniini
Copy link
Contributor Author

kaniini commented Sep 8, 2019

I am sure we can come up with something. ping @ignatenkobrain (trust me, you don't want to see me writing rust, i don't know what i am doing in this language ;))

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

Successfully merging a pull request may close this issue.

2 participants