tcmalloc.sh 681 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # Blog: http://blog.linuxeye.com
  4. Install_tcmalloc()
  5. {
  6. cd $oneinstack_dir/src
  7. . ../functions/download.sh
  8. src_url=https://googledrive.com/host/0B6NtGsLhIcf7MWxMMF9JdTN3UVk/gperftools-$tcmalloc_version.tar.gz && Download_src
  9. tar xzf gperftools-$tcmalloc_version.tar.gz
  10. cd gperftools-$tcmalloc_version
  11. ./configure --enable-frame-pointers
  12. make && make install
  13. cd ..
  14. /bin/rm -rf gperftools-$tcmalloc_version
  15. if [ -f "/usr/local/lib/libtcmalloc.so" ];then
  16. echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf
  17. ldconfig
  18. else
  19. echo -e "\033[31mgperftools install failed, Please contact the author! \033[0m"
  20. kill -9 $$
  21. fi
  22. cd ..
  23. }