File: check-gcc.sh

package info (click to toggle)
skyeye 1.2.5-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,236 kB
  • ctags: 19,345
  • sloc: ansic: 90,379; sh: 5,188; python: 707; cpp: 417; makefile: 322; exp: 38
file content (38 lines) | stat: -rw-r--r-- 679 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
#
# Written by Anthony Lee 2007.03
#

printf "Checking gcc ... "

case $CC in
	*gcc*)
		;;
	*)
		printf "IGNORE\n"
		exit 0
		;;
esac

if ( $CC -dumpversion > /dev/null 2>&1 ); then
	GCC_VERSION=`$CC -dumpversion`
elif ( $CC --version > /dev/null 2>&1 ); then
	GCC_VERSION=`$CC --version`
else
	GCC_VERSION=unknown
fi

case $GCC_VERSION in
	unknown|2.*)
		printf "FAILED\n\n"
		printf "*** You are using $CC, version $GCC_VERSION .\n"
		printf "*** To perform the compilation, we need gcc >= 3.x.x !!!\n"
		printf "*** Run \"make NO_GCC_CHECK=1\" instead to ignore it.\n\n"
		exit 1
		;;
	*)
		printf "OK ( `basename $CC` version: $GCC_VERSION )\n"
		exit 0
		;;
esac