3 # Copyright (C) 2020 Michael Jeanson <mjeanson@efficios.com>
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 COLOR_BLUE
='\033[0;34m'
21 COLOR_NONE
='\033[0m' # No Color
24 echo -e "${COLOR_BLUE}$1${COLOR_NONE}"
30 print_blue
"Operating System Details"
32 if [ -f "/etc/os-release" ]; then
33 (.
"/etc/os-release"; echo "Version: $NAME $VERSION")
34 elif [ -f "/etc/release" ]; then
35 echo "Version: $(head -n1 /etc/release)"
36 elif command -v sw_vers
>/dev
/null
2>&1; then
38 echo "Version: $(sw_vers -productName) $(sw_vers -productVersion)"
47 print_pkgconfig_mod
() {
49 if pkg-config
--exists "${mod}"; then
50 print_blue
"$mod version"
51 pkg-config
--modversion "${mod}"
58 print_blue
"Selected CC version"
59 ${CC:-cc} --version |
head -n1
61 print_blue
"Default gcc version"
62 gcc
--version |
head -n1
65 if command -v clang
>/dev
/null
2>&1; then
66 print_blue
"Default clang version"
70 print_blue
"git version"
73 print_blue
"bash version"
74 bash
--version |
head -n1
76 print_blue
"make version"
77 ${MAKE:-make} --version |
head -n1
79 if command -v cmake
>/dev
/null
2>&1; then
80 print_blue
"cmake version"
84 print_blue
"automake version"
85 automake
--version |
head -n1
87 print_blue
"autoconf version"
88 autoconf
--version |
head -n1
90 print_blue
"libtool version"
91 if libtool
--version >/dev
/null
2>&1; then
92 libtool
--version |
head -n1
98 print_blue
"bison version"
99 ${BISON:-bison} --version |
head -n1
101 print_blue
"flex version"
102 ${FLEX:-flex} --version
104 print_blue
"swig version"
105 swig
-version |
${GREP:-grep} SWIG
107 print_blue
"tar version"
108 ${TAR:-tar} --version |
head -n1
110 print_blue
"Selected python version"
111 ${PYTHON:-python} --version
113 if command -v "${PYTHON2:-python2}" >/dev
/null
2>&1; then
114 print_blue
"python2 version"
115 ${PYTHON2:-python2} --version
118 if command -v "${PYTHON3:-python3}" >/dev
/null
2>&1; then
119 print_blue
"python3 version"
120 ${PYTHON3:-python3} --version
123 print_blue
"java version"
126 print_blue
"javac version"
129 if command -v asciidoc
>/dev
/null
2>&1; then
130 print_blue
"asciidoc version"
134 if command -v xmlto
>/dev
/null
2>&1; then
135 print_blue
"xmlto version"
139 if command -v openssl
>/dev
/null
2>&1; then
140 print_blue
"openssl version"
144 if command -v pkg-config
>/dev
/null
2>&1; then
145 print_blue
"pkg-config version"
148 #print_blue "pkg-config modules installed"
149 #pkg-config --list-all
151 print_pkgconfig_mod glib-2.0
152 print_pkgconfig_mod libdw
153 print_pkgconfig_mod libelf
154 print_pkgconfig_mod libxml-2.0
155 print_pkgconfig_mod msgpack
156 print_pkgconfig_mod popt
157 print_pkgconfig_mod uuid
158 print_pkgconfig_mod zlib