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
|
2018-12-07 22:33:54 +00:00
|
|
|
if scl --list | grep -q 'devtoolset-7'; then
|
2019-11-27 00:51:26 +00:00
|
|
|
# CentOS 7+
|
|
|
|
scl enable devtoolset-7 'make clean-not-downloaded'
|
2019-08-16 23:25:11 +00:00
|
|
|
scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic'
|
2018-12-07 22:33:54 +00:00
|
|
|
elif scl --list | grep -q 'devtoolset-2'; then
|
2019-11-27 00:51:26 +00:00
|
|
|
# CentOS 5 or 6
|
|
|
|
scl enable devtoolset-2 'make clean-not-downloaded'
|
2019-08-16 23:25:11 +00:00
|
|
|
scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic'
|
2018-12-07 22:33:54 +00:00
|
|
|
else
|
|
|
|
echo "Could not find devtoolset"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2017-10-02 18:06:26 +00:00
|
|
|
else
|
2019-11-27 00:51:26 +00:00
|
|
|
make clean-not-downloaded
|
2019-08-16 23:25:11 +00:00
|
|
|
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
|
|
|
|