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