3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 13:30:17 +01:00
Velocity/native/compile-linux.sh

19 Zeilen
761 B
Bash

2018-08-02 04:22:09 +02:00
#!/bin/bash
if [ ! -d libdeflate ]; then
echo "Cloning libdeflate..."
git clone https://github.com/ebiggers/libdeflate.git
fi
echo "Compiling libdeflate..."
cd libdeflate || exit
2020-10-04 21:30:28 +02:00
CFLAGS="-fPIC -O2 -fomit-frame-pointer" make
cd ..
2020-10-04 21:30:28 +02:00
CFLAGS="-O2 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared -Wl,-z,noexecstack -fomit-frame-pointer"
ARCH=$(uname -m)
mkdir -p src/main/resources/linux_$ARCH
gcc $CFLAGS -Ilibdeflate src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
libdeflate/libdeflate.a -o src/main/resources/linux_$ARCH/velocity-compress.so
gcc $CFLAGS -I $MBEDTLS_ROOT/include -shared src/main/c/jni_util.c src/main/c/jni_cipher.c \
-o src/main/resources/linux_$ARCH/velocity-cipher.so -lcrypto