Skip to content

Commit

Permalink
Fixes for the build to inclide the new ASM source
Browse files Browse the repository at this point in the history
  • Loading branch information
luben committed Dec 23, 2021
1 parent 8ccba7c commit 3c34b68
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
cmake_minimum_required(VERSION 3.5)
project(zstd-jni)
file(STRINGS "version" NATIVE_VERSION)
enable_language(C ASM)
find_package(JNI)
include_directories("src/main/native" "src/main/native/common" "src/main/native/compress" "src/main/native/decompress" "src/main/native/dictBuilder" "src/main/native/legacy")
if (JNI_FOUND)
include_directories(${JNI_INCLUDE_DIRS})
endif (JNI_FOUND)
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.c")
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.[cS]")
add_library(zstd-jni-${NATIVE_VERSION} SHARED ${SOURCES})
add_definitions("-DZSTD_MULTITHREAD=1")
add_definitions("-DZSTD_LEGACY_SUPPORT=4")
Expand Down
18 changes: 1 addition & 17 deletions make_so.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,7 @@ compile () {
INSTALL=target/classes/$OS/$ARCH
rsync -r --delete jni $HOST:
rsync -r --delete src/main/native $HOST:
ssh $HOST 'export PATH=$HOME/bin:$PATH; '$CC' -shared -flto -DDYNAMIC_BMI2=0 -fPIC -O3 -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I/usr/include -I./jni -I./native -I./native/common -I./native/legacy -std=c99 -lpthread -o libzstd-jni-'$VERSION'.so native/*.c native/legacy/*.c native/common/*.c native/compress/*.c native/decompress/*.c native/dictBuilder/*.c'
mkdir -p $INSTALL
scp $HOST:libzstd-jni-$VERSION.so $INSTALL
}

compile_ppc64_aix () {
ARCH=ppc64
OS=aix
CC=xlc_r
HOST="gcc-$ARCH-$OS"
echo "Compiling for $ARCH/$OS on $HOST"
INSTALL=target/classes/$OS/$ARCH
ssh $HOST rm -rf jni native
scp -r jni $HOST:
scp -r src/main/native $HOST:
ssh $HOST 'export PATH=$HOME/bin:$PATH; '$CC' -q64 -bshared -brtl -G -DDYNAMIC_BMI2=0 -O3 -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I/usr/include -I./jni -I./native -I./native/common -I./native/legacy -o libzstd-jni-'$VERSION'.so native/*.c native/legacy/*.c native/common/*.c native/compress/*.c native/decompress/*.c native/dictBuilder/*.c'
ssh $HOST 'export PATH=$HOME/bin:$PATH; '$CC' -shared -flto -fPIC -O3 -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I/usr/include -I./jni -I./native -I./native/common -I./native/legacy -std=c99 -lpthread -o libzstd-jni-'$VERSION'.so native/*.c native/legacy/*.c native/common/*.c native/compress/*.c native/decompress/*.[cS] native/dictBuilder/*.c'
mkdir -p $INSTALL
scp $HOST:libzstd-jni-$VERSION.so $INSTALL
}
Expand All @@ -41,4 +26,3 @@ compile aarch64 linux
compile mips64 linux
compile amd64 freebsd "cc"
compile i386 freebsd "cc -m32 -march=i486 -mfancy-math-387"
# compile_ppc64_aix
2 changes: 1 addition & 1 deletion make_so_cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ compile() {
rsync -r --delete src/main/native $BUILD_DIR

pushd $BUILD_DIR
$CC -shared -static-libgcc -DDYNAMIC_BMI2=0 -fPIC -O3 -flto -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I/usr/include -I./jni -I./native -I./native/common -I./native/legacy -std=c99 -lpthread -o libzstd-jni-$VERSION.so native/*.c native/legacy/*.c native/common/*.c native/compress/*.c native/decompress/*.c native/dictBuilder/*.c
$CC -shared -static-libgcc -fPIC -O3 -flto -DZSTD_LEGACY_SUPPORT=4 -DZSTD_MULTITHREAD=1 -I/usr/include -I./jni -I./native -I./native/common -I./native/legacy -std=c99 -lpthread -o libzstd-jni-$VERSION.so native/*.c native/legacy/*.c native/common/*.c native/compress/*.c native/decompress/*.c native/dictBuilder/*.c
popd

mkdir -p $INSTALL
Expand Down

0 comments on commit 3c34b68

Please sign in to comment.