Check if the host system has the desired binutils for HOST_BINUTILSVER.
authorSascha Wildner <saw@online.de>
Sat, 2 Apr 2011 23:06:12 +0000 (01:06 +0200)
committerSascha Wildner <saw@online.de>
Sat, 2 Apr 2011 23:06:33 +0000 (01:06 +0200)
If not, fall back to the previous ones. This fixes buildworld for systems
that don't have binutils 2.21 installed at all (everthing that was last
upgraded before we added 2.21).

Reported-by: Ferruccio Zamuner <nonsolosoft@diff.org>
share/mk/bsd.cpu.mk

index 1488f20..f724448 100644 (file)
@@ -25,7 +25,13 @@ HOST_CCVER?= ${_DEFAULT_CCVER}
 .endif
 
 _DEFAULT_BINUTILSVER=  binutils221
+_PREVIOUS_BINUTILSVER= binutils217
+
+.if exists(/usr/libexec/${_DEFAULT_BINUTILSVER}/elf/as)
 HOST_BINUTILSVER?=     ${_DEFAULT_BINUTILSVER}
+.else
+HOST_BINUTILSVER?=     ${_PREVIOUS_BINUTILSVER}
+.endif
 
 .if defined(FORCE_CPUTYPE)
 CPUTYPE= ${FORCE_CPUTYPE}