21 # questions. |
21 # questions. |
22 # |
22 # |
23 # |
23 # |
24 |
24 |
25 #------------------------------------------------------------------------ |
25 #------------------------------------------------------------------------ |
26 # CC, CPP & AS |
26 # CC, CXX & AS |
27 |
27 |
28 CPP = g++ |
28 CXX = g++ |
29 CC = gcc |
29 CC = gcc |
30 AS = $(CC) -c |
30 AS = $(CC) -c |
31 |
31 |
32 Compiler = gcc |
32 Compiler = gcc |
33 |
33 |
34 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only |
34 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only |
35 # prints the numbers (e.g. "2.95", "3.2.1") |
35 # prints the numbers (e.g. "2.95", "3.2.1") |
36 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
36 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
37 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
37 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
38 |
38 |
39 # Check for the versions of C++ and C compilers ($CPP and $CC) used. |
39 # Check for the versions of C++ and C compilers ($CXX and $CC) used. |
40 |
40 |
41 # Get the last thing on the line that looks like x.x+ (x is a digit). |
41 # Get the last thing on the line that looks like x.x+ (x is a digit). |
42 COMPILER_REV := \ |
42 COMPILER_REV := \ |
43 $(shell $(CPP) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
43 $(shell $(CXX) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
44 C_COMPILER_REV := \ |
44 CC_COMPILER_REV := \ |
45 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
45 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
46 |
46 |
47 |
47 |
48 # check for precompiled headers support |
48 # check for precompiled headers support |
49 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" |
49 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" |