From: Wolfgang Denk Date: Thu, 19 Mar 2009 22:14:15 +0100 Subject: [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection In-Reply-To: <49C25764.8010804@RuggedCom.com> References: <49C25764.8010804@RuggedCom.com> Message-ID: <20090319211415.355BB832E8B7@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Most people would like to be delivered from temptation but would like it to keep in touch." - Robert Orben