docker-build-linux-centos.sh 944 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. set -e
  4. #set -x
  5. # just in-case this is run outside Docker
  6. mkdir -p /rocksdb-local-build
  7. rm -rf /rocksdb-local-build/*
  8. cp -r /rocksdb-host/* /rocksdb-local-build
  9. cd /rocksdb-local-build
  10. # Use scl devtoolset if available
  11. if hash scl 2>/dev/null; then
  12. if scl --list | grep -q 'devtoolset-7'; then
  13. # CentOS 7+
  14. scl enable devtoolset-7 'make clean-not-downloaded'
  15. scl enable devtoolset-7 'PORTABLE=1 make -j2 rocksdbjavastatic'
  16. elif scl --list | grep -q 'devtoolset-2'; then
  17. # CentOS 5 or 6
  18. scl enable devtoolset-2 'make clean-not-downloaded'
  19. scl enable devtoolset-2 'PORTABLE=1 make -j2 rocksdbjavastatic'
  20. else
  21. echo "Could not find devtoolset"
  22. exit 1;
  23. fi
  24. else
  25. make clean-not-downloaded
  26. PORTABLE=1 make -j2 rocksdbjavastatic
  27. fi
  28. cp java/target/librocksdbjni-linux*.so java/target/rocksdbjni-*-linux*.jar /rocksdb-java-target