2017-05-12 18:23:14 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-04-18 17:51:19 +00:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
2017-05-12 18:23:14 +00:00
|
|
|
|
|
|
|
set -e
|
2018-12-07 22:33:54 +00:00
|
|
|
#set -x
|
2017-05-12 18:23:14 +00:00
|
|
|
|
2019-11-26 18:52:04 +00:00
|
|
|
# just in-case this is run outside Docker
|
|
|
|
mkdir -p /rocksdb-local-build
|
2017-10-02 18:06:26 +00:00
|
|
|
|
2019-11-26 18:52:04 +00:00
|
|
|
rm -rf /rocksdb-local-build/*
|
|
|
|
cp -r /rocksdb-host/* /rocksdb-local-build
|
|
|
|
cd /rocksdb-local-build
|
|
|
|
|
|
|
|
# Use scl devtoolset if available
|
2017-10-02 18:06:26 +00:00
|
|
|
if hash scl 2>/dev/null; then
|
2022-02-17 20:47:45 +00:00
|
|
|
if scl --list | grep -q 'devtoolset-8'; then
|
|
|
|
# CentOS 6+
|
|
|
|
scl enable devtoolset-8 'make clean-not-downloaded'
|
|
|
|
scl enable devtoolset-8 'PORTABLE=1 make -j2 rocksdbjavastatic'
|
|
|
|
elif scl --list | grep -q 'devtoolset-7'; then
|
|
|
|
# CentOS 6+
|
|
|
|
scl enable devtoolset-7 'make clean-not-downloaded'
|
|
|
|
scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic'
|
|
|
|
elif scl --list | grep -q 'devtoolset-2'; then
|
|
|
|
# CentOS 5 or 6
|
|
|
|
scl enable devtoolset-2 'make clean-not-downloaded'
|
|
|
|
scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic'
|
|
|
|
else
|
|
|
|
echo "Could not find devtoolset"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2017-10-02 18:06:26 +00:00
|
|
|
else
|
2022-02-17 20:47:45 +00:00
|
|
|
make clean-not-downloaded
|
|
|
|
PORTABLE=1 make -j2 rocksdbjavastatic
|
2017-10-02 18:06:26 +00:00
|
|
|
fi
|
|
|
|
|
2020-08-06 21:10:12 +00:00
|
|
|
cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar java/target/rocksdbjni-*-linux*.jar.sha1 /rocksdb-java-target
|
2017-05-12 18:23:14 +00:00
|
|
|
|