Skip to content

Commit

Permalink
link against static libconstantine rather than shared object
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte committed Sep 19, 2024
1 parent 652cdb8 commit c153304
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,11 @@ build_constantine() {

# Compile the native library
if [[ "$OSTYPE" == "darwin"* ]]; then
gcc -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.dylib" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib/ -lconstantine
# link against the static libconstantine.a so we do not have to deal with multiple libraries in jni/jna:
clang -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/darwin" -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.dylib" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. constantine/lib/libconstantine.a
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
gcc -fPIC -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.so" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib/ constantine/lib/libconstantine.so
# link against the static libconstantine.a so we do not have to deal with multiple libraries in jni/jna:
gcc -I"${JAVA_HOME}/include" -I"${JAVA_HOME}/include/linux" -fPIC -shared -o "$SCRIPTDIR/constantine/build/${OSARCH}/lib/libconstantinebindings.so" jna_ethereum_evm_precompiles.c -Iconstantine/include -I. -Lconstantine/lib constantine/lib/libconstantine.a
else
echo "Unsupported OS/architecture: ${OSARCH}"
exit 1
Expand Down

0 comments on commit c153304

Please sign in to comment.