configure: Support --with-zstd=PATH
Questions the use of custom path handling for Zstd in configure scripts when pkg-config might suffice.
This discussion questions the necessity of custom --with-zstd=PATH logic in binutils’ configure scripts, suggesting that pkg-config could achieve a similar result. The commenter notes that GCC’s --with-zstd is more flexible, allowing separate specification of include and library paths, and is implemented via open-coded logic in configure.ac rather than a generalized approach. The core of the question is about the use case for binutils’ specific path handling.
- proposer
Submitted a patch (v2) to allow `--with-zstd=PATH` to specify an installation prefix for zstd headers and libraries.
“Allow --with-zstd to specify an installation prefix. Use the headers and static library under that prefix, and reject it if it does not provide zstd 1.4.0 or newer.”
- reviewer
Inquires about the use case for a custom `--with-zstd=PATH` when `pkg-config` could be used, and points out GCC's more flexible `--with-zstd` implementation.
“Can you explain why using pkg-config wouldn't work for your use case? In your other message, you mentioned that gcc also accepted a --with-zstd=path, but it actually accepts more:”
Technical Tradeoffs
- Using a custom `--with-zstd=PATH` offers direct control over library and header locations but might be redundant if `pkg-config` adequately serves the purpose.
- GCC's approach with separate include/lib path options provides finer control but adds complexity to the configure script.
In Details
This thread discusses the binutils configure script's handling of Zstd library integration. The patch adds a --with-zstd=PATH option, similar to GCC's, to specify a custom installation prefix. However, a reviewer questions its necessity, suggesting pkg-config as an alternative and highlighting GCC's more granular --with-zstd-include and --with-zstd-lib options, which are implemented via open-coded configure.ac logic.
- configure script
- A script generated by Autoconf that checks the system for required software dependencies, compiler capabilities, and other environmental factors to prepare the build process for a specific system.
- pkg-config
- A helper tool used to provide information about installed libraries, such as compiler and linker flags, needed to build against them. It simplifies cross-platform build configurations.
- Zstd
- A fast lossless compression algorithm and data stream format, often used for compression in various software projects.
- Autoconf
- A tool that automatically configures source code package build environments. It generates the
configurescript.