Nick West writes: > by:- > > GCC_MAJOR := $(shell $(CXX) -v 2>&1 | \ > grep " version " | cut -d' ' -f3 | cut -d'.' -f1) > GCC_MINOR := $(shell $(CXX) -v 2>&1 | \ > grep " version " | cut -d' ' -f3 | cut -d'.' -f2) GCC defines these values implicitly as CPP macros. So, alternatively, you can access them like: GCC_MAJOR := $shell(echo|gcc -dM -E -|grep __GNUC__|cut -d' ' -f3) GCC_MINOR := $shell(echo|gcc -dM -E -|grep __GNUC_MINOR__|cut -d' ' -f3) The question is, which changes more frequently, GCC's version string formatting or its macro names? -Brett.
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:03 MET