From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Retanubun Date: Fri, 20 Mar 2009 09:27:06 -0400 Subject: [U-Boot] [PATCH] Coldire: mcf52x2: Improve gcc version detection In-Reply-To: <20090319211415.355BB832E8B7@gemini.denx.de> References: <49C25764.8010804@RuggedCom.com> <20090319211415.355BB832E8B7@gemini.denx.de> Message-ID: <49C399AA.2030107@RuggedCom.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Wolfgang, > 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. > Thanks for the comments, sorry if I'm (re)stating the obvious, but just to be clear: ifneq ($(findstring 4.1,$(shell $(CC) --version)),4.1) while simple, will cause gcc-4.0.x or gcc-3.x.x to try to use the -mcpu option which is not supported yet until gcc-4.2.+ (if I am not mistaken). I realize the world is always moving forward and this is an increasingly moot argument, but the embedded world is often very attached to our toolchains :P I am sure there are many better ways of extracting the version string, my attempt is to highlight one way that converts the version to a number and use the '-gt' to compare on it. Feel free to educate me in 'the better way', my user-space kung-fu is not that strong yet :) Regards, - Richard Retanubun