setup-buildtools.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # Copyright The OpenTelemetry Authors
  3. # SPDX-License-Identifier: Apache-2.0
  4. set -e
  5. # Switch to workspace root directory first
  6. DIR="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
  7. if [ -f /bin/yum ] ; then
  8. # Prefer yum over apt-get
  9. yum -y install automake
  10. yum -y install autoconf
  11. yum -y install libtool
  12. yum -y install make gcc gcc-c++
  13. yum -y install wget
  14. yum -y install libcurl
  15. yum -y install zlib-devel
  16. yum -y install git
  17. yum -y install gperftools-libs
  18. yum -y install libcurl-devel
  19. yum -y install rpm-build
  20. # Install gcc-7
  21. # FIXME: current tooling is CentOS-centric :-/
  22. yum -y install centos-release-scl
  23. yum -y install devtoolset-7
  24. yum -y install devtoolset-7-valgrind
  25. yum-config-manager --enable rhel-server-rhscl-7-rpms
  26. else
  27. # Use apt-get
  28. export DEBIAN_FRONTEND=noninteractive
  29. apt-get update -y
  30. apt-get install -qq automake
  31. apt-get install -qq bc
  32. apt-get install -qq libtool-bin
  33. apt-get install -qq cmake
  34. apt-get install -qq curl
  35. apt-get install -qq libcurl4-openssl-dev
  36. apt-get install -qq zlib1g-dev
  37. apt-get install -qq git
  38. apt-get install -qq build-essential
  39. apt-get install -qq libssl-dev
  40. apt-get install -qq libsqlite3-dev
  41. # Stock sqlite may be too old
  42. #apt install libsqlite3-dev
  43. apt-get install -qq wget
  44. apt-get install -qq clang-format
  45. apt-get install -qq libgtest-dev
  46. apt-get install -qq libbenchmark-dev
  47. apt-get install -qq nlohmann-json-dev
  48. fi
  49. # Build and install latest CMake
  50. $DIR/setup-cmake.sh
  51. ## Change owner from root to current dir owner
  52. chown -R `stat . -c %u:%g` *