check-deps 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. # Now Check if Tcl is installed, run it if so. The backslash extends the comment and hides the line below against Tcl interpreter \
  3. exec tclsh "$0" "$@" || echo "Please install 'tcl' package first - it's required to run any other scripts here." && exit 1
  4. #
  5. # SRT - Secure, Reliable, Transport
  6. # Copyright (c) 2018 Haivision Systems Inc.
  7. #
  8. # This Source Code Form is subject to the terms of the Mozilla Public
  9. # License, v. 2.0. If a copy of the MPL was not distributed with this
  10. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  11. #
  12. if { [catch {package require Tcl 8.5}] } {
  13. puts stderr "Tcl version at least 8.5 required, please upgrade"
  14. exit 1
  15. }
  16. set ok 1
  17. if { [catch {exec pkg-config --exists openssl}] } {
  18. set ok 0
  19. puts "Openssl: NOT INSTALLED, please install (libssl-dev\[el\], openssl-dev\[el\] etc.)"
  20. } else {
  21. puts "Openssl: found version [exec pkg-config --modversion openssl] -- ok"
  22. }
  23. set nothave [catch {set cmake [exec cmake --version]}]
  24. if { $nothave } {
  25. puts "CMake version >= 2.8 required - please install cmake"
  26. set ok 0
  27. } else {
  28. set cmakel1 [lindex [split $cmake \n] 0]
  29. set cv [lindex $cmakel1 end]
  30. if { [package vcompare $cv 2.8] == -1 } {
  31. puts "CMake version >= 2.8 required - please upgrade cmake"
  32. set ok 0
  33. } else {
  34. puts "Cmake version $cv -- ok."
  35. }
  36. }
  37. # May others also apply
  38. if { $ok } {
  39. puts "All dependencies satisfied, you should be good to go."
  40. exit 0
  41. }
  42. puts "Please fix the above findings before compiling"
  43. exit 1