Also provide musl libc builds of Velocity natives

Reference: PaperMC/Paper#11367
This commit is contained in:
Andrew Steinborn
2024-09-07 12:56:31 -04:00
parent 784806848d
commit 525ac2712e
11 changed files with 81 additions and 19 deletions

View File

@@ -20,9 +20,11 @@ if [ ! "$CC" ]; then
export CC=gcc
fi
output_file="velocity-cipher.so"
if [ -n "$OPENSSL_VERSION" ]; then
output_file="velocity-cipher-ossl${OPENSSL_VERSION}.so"
# Determine if we are on musl libc or glibc
suffix=""
if ldd --version 2>&1 | grep -q musl; then
suffix="-musl"
filename=$(echo "$filename" | sed "s/\.so/$suffix.so/")
fi
CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -Wall -Werror -fomit-frame-pointer"