2018-08-02 04:22:09 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-09-09 05:30:28 +02:00
|
|
|
if [ ! -d zlib-ng ]; then
|
|
|
|
echo "Cloning zlib-ng..."
|
|
|
|
git clone https://github.com/zlib-ng/zlib-ng.git
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Compiling zlib-ng..."
|
|
|
|
cd zlib-ng
|
|
|
|
CFLAGS="-fPIC -O3" ./configure --zlib-compat --static
|
|
|
|
make clean && make
|
|
|
|
cd ..
|
|
|
|
|
2018-08-02 04:22:09 +02:00
|
|
|
# Modify as you need.
|
2018-12-24 18:18:36 +01:00
|
|
|
MBEDTLS_ROOT=mbedtls
|
2018-08-05 05:46:41 +02:00
|
|
|
CFLAGS="-O3 -I$JAVA_HOME/include/ -I$JAVA_HOME/include/linux/ -fPIC -shared"
|
2019-09-09 05:30:28 +02:00
|
|
|
gcc $CFLAGS -Izlib-ng src/main/c/jni_util.c src/main/c/jni_zlib_deflate.c src/main/c/jni_zlib_inflate.c \
|
|
|
|
src/main/c/jni_zlib_common.c zlib-ng/libz.a -o src/main/resources/linux_x64/velocity-compress.so
|
2018-08-05 05:46:41 +02:00
|
|
|
gcc $CFLAGS -I $MBEDTLS_ROOT/include -shared $MBEDTLS_ROOT/library/aes.c $MBEDTLS_ROOT/library/aesni.c \
|
|
|
|
$MBEDTLS_ROOT/library/platform.c $MBEDTLS_ROOT/library/platform_util.c src/main/c/jni_util.c src/main/c/jni_cipher.c \
|
|
|
|
-o src/main/resources/linux_x64/velocity-cipher.so
|