ccache-osx.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. echo
  3. echo "Download and install ccache ..."
  4. echo
  5. echo "Downloading sources ..."
  6. curl -L -O https://www.samba.org/ftp/ccache/ccache-3.3.4.tar.gz # latest version available here: https://ccache.samba.org/download.html
  7. echo "Extracting to build directory ..."
  8. tar xzf ccache-3.3.4.tar.gz
  9. cd ccache-3.3.4
  10. echo "Compiling sources ..."
  11. ./configure --prefix=/usr/local --with-bundled-zlib > /dev/null
  12. make
  13. echo "Installing ..."
  14. mkdir /usr/local/opt/ccache
  15. mkdir /usr/local/opt/ccache/bin
  16. cp ccache /usr/local/opt/ccache/bin
  17. ln -s /usr/local/opt/ccache/bin/ccache /usr/local/bin/ccache
  18. mkdir /usr/local/opt/ccache/libexec
  19. links=(
  20. clang
  21. clang++
  22. cc
  23. gcc gcc2 gcc3 gcc-3.3 gcc-4.0 gcc-4.2 gcc-4.3 gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 gcc-4.8 gcc-4.9 gcc-5 gcc-6 gcc-7
  24. c++ c++3 c++-3.3 c++-4.0 c++-4.2 c++-4.3 c++-4.4 c++-4.5 c++-4.6 c++-4.7 c++-4.8 c++-4.9 c++-5 c++-6 c++-7
  25. g++ g++2 g++3 g++-3.3 g++-4.0 g++-4.2 g++-4.3 g++-4.4 g++-4.5 g++-4.6 g++-4.7 g++-4.8 g++-4.9 g++-5 g++-6 g++-7
  26. )
  27. for link in "${links[@]}"; do
  28. ln -s ../bin/ccache /usr/local/opt/ccache/libexec/$link
  29. done
  30. #/usr/local/bin/ccache -M 2G
  31. cd $TRAVIS_BUILD_DIR
  32. echo
  33. echo "Done!"
  34. echo