
Dear Richard Retanubun,
In message 49C25764.8010804@RuggedCom.com you wrote:
--- a/cpu/mcf52x2/config.mk +++ b/cpu/mcf52x2/config.mk @@ -33,9 +33,11 @@ is5272:=$(shell grep CONFIG_M5272 $(TOPDIR)/include/$(cfg)) is5275:=$(shell grep CONFIG_M5275 $(TOPDIR)/include/$(cfg)) is5282:=$(shell grep CONFIG_M5282 $(TOPDIR)/include/$(cfg))
+# If gcc 4.2 or greater use -mcpu= otherwise use -m5307 on gcc 4.1 and older +GCC_SUPPORTS_MCPU = $(shell if [ `echo __GNUC__ __GNUC_MINOR__ | $(CC) -E -xc - \
- | tail -n 1 | sed -e 's/ /0/'` -gt 401 ];then echo yes; else echo no; fi)
-ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1)
+ifeq ($(GCC_SUPPORTS_MCPU),yes) ifneq (,$(findstring CONFIG_M5249,$(is5249))) PLATFORM_CPPFLAGS += -mcpu=5249 endif
What makes you think that
echo __GNUC__ __GNUC_MINOR__ | $(CC) -E -xc - \ | tail -n 1 | sed -e 's/ /0/'
would be any better than parsing the output of "$(CC) --version"?
The fact that it takes 4 processes instead of one (or say two if we add the filtering) is not a recommendation.
Best regards,
Wolfgang Denk