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

Support standard methods of specifying header / library locations #88

Open
mjpieters opened this issue Jan 3, 2019 · 1 comment
Open

Comments

@mjpieters
Copy link

Currently the setup.py strategy is to look for pcap.h in a fixed set of locations. Please support either LDFLAGS / CFLAGS (or CPPFLAGS) to specify additional locations, and / or use pkg-config to locate the prefix.

For example, running pkg-config --libs-only-L --cflags libpcap on conforming systems gives you the correct -I and -L flags (to then be parsed further) or use pkg-config --variable=includedir libpcap and pkg-config --variable=libdir libpcap to get the include and library paths as two separate strings on stdout.

For LDFLAGS and CFLAGS no further parsing would be required, as setuptools.Extension() supports those natively, provided you don't override those. Perhaps only do the current manual search if a pkg-config search fails and no LDFLAGS / CFLAGS / CPPFLAGS environment variables are set?

This then allows for isolated builds that use a specific, bundled version of libpcap.

@hellais
Copy link
Member

hellais commented Jan 22, 2019

This is a very good suggestion and I would be glad to review and accept a PR implementing it!

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

No branches or pull requests

2 participants