Add documentation for zstd static linking

- Add README.md to deps/zstd documenting source and usage
- Add comments in deps/Makefile for zstd build rule
- Add comments in include/makefiles_paths.mk for ZSTD paths
- Update INSTALL.md to note zstd is bundled and statically linked

Related: #5462
v3.0-mac260320
René Cannaò 3 weeks ago
parent 3f1b0a1510
commit df97ae9009

@ -191,6 +191,8 @@ zypper install -y automake bzip2 cmake make gcc-c++ gcc git openssl openssl-deve
brew install automake bzip2 cmake make git gpatch gnutls openssl@3 icu4c pkg-config libiconv zlib
```
Note: zstd compression library is bundled with ProxySQL and statically linked, so it doesn't need to be installed separately.
To compile on macOS, you must set the following environment variables to ensure the build system can find OpenSSL and Homebrew dependencies:
```bash

3
deps/Makefile vendored

@ -175,6 +175,9 @@ lz4/lz4/lib/liblz4.a:
lz4: lz4/lz4/lib/liblz4.a
# zstd - Zstandard compression library
# Used for compressed protocol support in MySQL/PostgreSQL connections
# Source: https://github.com/facebook/zstd
zstd/zstd/lib/libzstd.a:
cd zstd && rm -rf zstd-*/ || true
cd zstd && tar -zxf zstd-*.tar.gz

@ -0,0 +1,31 @@
# zstd - Zstandard Compression Library
This directory contains the zstd compression library used by ProxySQL for
compressed protocol support in MySQL and PostgreSQL connections.
## Source
- **Project**: https://github.com/facebook/zstd
- **Version**: 1.5.7
- **License**: BSD-3-Clause / GPL-2.0-only (dual licensed)
## Build
The library is built automatically by the ProxySQL build system:
```bash
cd deps/zstd && tar -zxf zstd-1.5.7.tar.gz
cd zstd/zstd/lib && make libzstd.a
```
## Static Linking
zstd is statically linked into ProxySQL to eliminate runtime dependencies
on system libraries. This ensures consistent behavior across different
platforms (Linux, macOS, FreeBSD).
## Usage in ProxySQL
- MySQL compressed protocol (`mysql_compression`)
- PostgreSQL compressed protocol support
- Used by `mysql_data_stream.cpp` and `MySQL_Protocol.cpp`

1
deps/zstd/zstd vendored

@ -0,0 +1 @@
zstd-1.5.7

@ -54,6 +54,7 @@ CITYHASH_LDIR := $(CITYHASH_PATH)/src/.libs
LZ4_PATH := $(DEPS_PATH)/lz4/lz4
LZ4_LDIR := $(LZ4_PATH)/lib
# Zstandard compression library for protocol compression support
ZSTD_PATH := $(DEPS_PATH)/zstd/zstd
ZSTD_IDIR := $(ZSTD_PATH)/lib
ZSTD_LDIR := $(ZSTD_PATH)/lib

Loading…
Cancel
Save