mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	The current binutils-version.sh expects the version string at the end of the first line. It turned out to not work with Linaro toolchain: It has "Linaro 2014.09" at the back. To fix this issue, let's parse the word right after the close parenthesis. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: York Sun <yorksun@freescale.com> Acked-by: Dirk Behme <dirk.behme@gmail.com>
		
			
				
	
	
		
			23 lines
		
	
	
		
			499 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			499 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
#
 | 
						|
# binutils-version [-p] gas-command
 | 
						|
#
 | 
						|
# Prints the binutils version of `gas-command' in a canonical 4-digit form
 | 
						|
# such as `0222' for binutils 2.22
 | 
						|
#
 | 
						|
 | 
						|
gas="$*"
 | 
						|
 | 
						|
if [ ${#gas} -eq 0 ]; then
 | 
						|
	echo "Error: No assembler specified."
 | 
						|
	printf "Usage:\n\t$0 <gas-command>\n"
 | 
						|
	exit 1
 | 
						|
fi
 | 
						|
 | 
						|
version_string=$($gas --version | head -1 | sed -e 's/.*) *\([0-9.]*\).*/\1/' )
 | 
						|
 | 
						|
MAJOR=$(echo $version_string | cut -d . -f 1)
 | 
						|
MINOR=$(echo $version_string | cut -d . -f 2)
 | 
						|
 | 
						|
printf "%02d%02d\\n" $MAJOR $MINOR
 |