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