rust-lang / libz-sys

Rust crate package to link to a system libz (zlib)
Apache License 2.0
110 stars 73 forks source link

Write more variables into zlib.pc #157

Closed sagudev closed 9 months ago

sagudev commented 9 months ago

Added version, that is parsed from zlib.h and includedir and libdir

sagudev commented 9 months ago

Some C/C++ programs have configure scripts that check zlib versions. This PR just fills some of those placeholder so zlib.pc can be used by configure script.

sagudev commented 9 months ago

I thought about this and have to consider it a backwards-incompatible change as this will crash hard if a header file provided by any system does not contain the desired information, information that previously wasn't provided.

Making zlib.pc is only done when compiling from source, which is part of this repo, so zlib.h will always contain that information, that's how zlib's build system is doing it. But better safe than sorry, so there will be no panic on version fail.

sagudev commented 9 months ago

No worries, git stores previous commits too.

sagudev commented 9 months ago

assuming that you are sure that the generated includedir and libdir variables will be correct on any system.

If prefix is valid than includedir and libdir should be valid too.

Byron commented 9 months ago

Thanks again!