rust-pcap / pcap

Rust language pcap library
Apache License 2.0
595 stars 138 forks source link

Pick up libpcap from pkg-config if available. #277

Closed Fuuzetsu closed 1 year ago

Fuuzetsu commented 1 year ago

To keep existing behaviour, it will look for LIBPCAP_LIBDIR first and only then go the pkg-config way and then go for the hail mary as it used to. This will be less likely to break any existing setup and is similar to pq-sys for example.

Fixes #276

Wojtek242 commented 1 year ago

Great! Thanks a lot!

Could I ask you to just wrap this up with an update to the CHANGELOG.md file and to the README sections "Library location" and "Library version" to explain the use of pkg config. It might be worth pointing out that this can be used to configure static linking which some people are quite interested in (https://docs.rs/pkg-config/latest/pkg_config/).

Just a few sentences and don't worry about word smithing. I can modify/polish it later myself. There's also no rush, so whenever you have time.

Fuuzetsu commented 1 year ago

Added some words to README and CHANGELOG + added a change to honour LIBPCAP_VER even in pkg-config scenario.